@cgi-learning-hub/ui 0.0.1-dev.1708941839 → 0.0.1-dev.1708959157
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/{Button-X7eWZQfX.js → Button-C5ROgtyW.js} +12 -12
- package/dist/{Button-Tkz5NkF_.cjs → Button-wMPAZpnO.cjs} +1 -1
- package/dist/ButtonBase-C5_-KI-D.js +831 -0
- package/dist/ButtonBase-XPViWbp_.cjs +75 -0
- package/dist/DefaultButton-BD9W4fvr.cjs +28 -0
- package/dist/DefaultButton-BlGFPRC7.js +439 -0
- package/dist/{Input-CbYjsRHK.js → Input-CGU1Xw4s.js} +10 -10
- package/dist/Input-DHic6dYE.cjs +1 -0
- package/dist/{InputBase-B13Nzzhk.js → InputBase-D8YZOKOt.js} +138 -157
- package/dist/InputBase-WBNJQn8V.cjs +4 -0
- package/dist/Tab-C2Tmr8Sv.cjs +1 -0
- package/dist/Tab-Dgd9jYEq.js +237 -0
- package/dist/TransitionGroupContext-C7wWJ6l7.js +14 -0
- package/dist/TransitionGroupContext-g4tmk10h.cjs +1 -0
- package/dist/Typography-CO64FVmw.cjs +1 -0
- package/dist/Typography-Di0hlj32.js +177 -0
- package/dist/assets/index.css +1 -1
- package/dist/components/AnotherComponent/AnotherComponent.cjs.js +1 -1
- package/dist/components/AnotherComponent/AnotherComponent.es.js +3 -3
- package/dist/components/BasicButtons/BasicButtons.cjs.js +1 -1
- package/dist/components/BasicButtons/BasicButtons.es.js +10 -10
- package/dist/components/BasicButtons/BasicButtons.stories.cjs.js +1 -1
- package/dist/components/Dropzone/Dropzone.cjs.js +5 -0
- package/dist/components/Dropzone/Dropzone.d.ts +9 -0
- package/dist/components/Dropzone/Dropzone.es.js +1209 -0
- package/dist/components/Dropzone/index.cjs.js +1 -0
- package/dist/components/Dropzone/index.d.ts +2 -0
- package/dist/components/Dropzone/index.es.js +4 -0
- package/dist/components/buttons/DefaultButton/DefaultButton.cjs.js +1 -28
- package/dist/components/buttons/DefaultButton/DefaultButton.es.js +7 -436
- package/dist/components/buttons/DefaultButton/DefaultButtonIcon.cjs.js +1 -1
- package/dist/components/buttons/DefaultButton/DefaultButtonIcon.es.js +8 -8
- package/dist/components/buttons/DefaultButton/index.cjs.js +1 -1
- package/dist/components/buttons/DefaultButton/index.es.js +2 -2
- package/dist/components/buttons/IconButton/IconButton.cjs.js +2 -0
- package/dist/components/buttons/IconButton/IconButton.d.ts +5 -0
- package/dist/components/buttons/IconButton/IconButton.es.js +187 -0
- package/dist/components/buttons/IconButton/index.cjs.js +1 -0
- package/dist/components/buttons/IconButton/index.d.ts +2 -0
- package/dist/components/buttons/IconButton/index.es.js +4 -0
- package/dist/components/buttons/PrimaryButton/PrimaryButton.cjs.js +1 -1
- package/dist/components/buttons/PrimaryButton/PrimaryButton.es.js +4 -4
- package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.cjs.js +1 -1
- package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.es.js +1 -1
- package/dist/components/buttons/SecondaryButton/SecondaryButton.cjs.js +1 -1
- package/dist/components/buttons/SecondaryButton/SecondaryButton.es.js +2 -2
- package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.cjs.js +1 -1
- package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.es.js +1 -1
- package/dist/components/buttons/index.cjs.js +1 -1
- package/dist/components/buttons/index.d.ts +1 -0
- package/dist/components/buttons/index.es.js +8 -6
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.es.js +22 -12
- package/dist/components/inputs/SearchInput/SearchInput.cjs.js +1 -1
- package/dist/components/inputs/SearchInput/SearchInput.es.js +77 -247
- package/dist/components/inputs/TextInput/TextInput.cjs.js +11 -13
- package/dist/components/inputs/TextInput/TextInput.es.js +367 -404
- package/dist/components/lists/FileList/FileList.cjs.js +1 -0
- package/dist/components/lists/FileList/FileList.d.ts +7 -0
- package/dist/components/lists/FileList/FileList.es.js +19 -0
- package/dist/components/lists/FileList/FileListItem.cjs.js +1 -0
- package/dist/components/lists/FileList/FileListItem.d.ts +13 -0
- package/dist/components/lists/FileList/FileListItem.es.js +40 -0
- package/dist/components/lists/FileList/index.cjs.js +1 -0
- package/dist/components/lists/FileList/index.d.ts +4 -0
- package/dist/components/lists/FileList/index.es.js +6 -0
- package/dist/components/lists/index.cjs.js +1 -0
- package/dist/components/lists/index.d.ts +1 -0
- package/dist/components/lists/index.es.js +6 -0
- package/dist/createSvgIcon-B7HVs3ZC.cjs +2 -0
- package/dist/{createSvgIcon-jvI3LIfI.cjs → createSvgIcon-BivvPRyr.cjs} +1 -1
- package/dist/createSvgIcon-D3HDfwCm.js +143 -0
- package/dist/{createSvgIcon-qXNZi4k1.js → createSvgIcon-D4Mxh_r9.js} +14 -14
- package/dist/{extendSxProp-CvhhU9Vb.cjs → extendSxProp-D5gpnasP.cjs} +1 -1
- package/dist/{extendSxProp-BRHiEwyk.js → extendSxProp-DCdWqtQk.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +20 -10
- package/dist/ownerWindow-BoRkeomM.js +23 -0
- package/dist/ownerWindow-Dk_4aaak.cjs +1 -0
- package/dist/refType-dllUCpD8.cjs +1 -0
- package/dist/refType-hKctx4k0.js +29 -0
- package/dist/useControlled-BsLcOmhe.js +48 -0
- package/dist/useControlled-jN3fqFfv.cjs +3 -0
- package/dist/useForkRef-CGd3Nhyb.cjs +1 -0
- package/dist/useForkRef-DwN_Iz9R.js +17 -0
- package/dist/useIsFocusVisible-BF0lT08B.cjs +1 -0
- package/dist/useIsFocusVisible-D8ksiuhS.js +69 -0
- package/dist/useTheme-BZek68TX.js +9 -0
- package/dist/useTheme-C-LTLVMt.cjs +1 -0
- package/dist/{useThemeProps-CDriK9TK.cjs → useThemeProps-C6ClLEqN.cjs} +14 -14
- package/dist/{useThemeProps-B6yTTpAe.js → useThemeProps-CHytz5pp.js} +741 -714
- package/dist/useTimeout-KN97abZR.js +47 -0
- package/dist/useTimeout-qjxkiZZn.cjs +1 -0
- package/package.json +2 -1
- package/dist/ButtonBase-CKfcGhaU.js +0 -892
- package/dist/ButtonBase-Cg8cBMzO.cjs +0 -75
- package/dist/Input-CAb0EFzc.cjs +0 -1
- package/dist/InputBase-CKlCw9fj.cjs +0 -4
- package/dist/useForkRef-82uiK71d.cjs +0 -1
- package/dist/useForkRef-CLcOhrzI.js +0 -44
- package/dist/useTheme-BWRyHzdn.js +0 -65
- package/dist/useTheme-BpLcDNG1.cjs +0 -1
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
import { P as e,
|
|
2
|
-
import * as
|
|
1
|
+
import { P as e, u as Pe, _ as ge, a as c, b as De, T as We, g as Ve, c as _e, s as we, f as Le, h as fe, e as ee, j as je, y as Ue } from "./useThemeProps-CHytz5pp.js";
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import { jsx as R, jsxs as ne } from "react/jsx-runtime";
|
|
4
|
-
import { a as ve, u as oe
|
|
5
|
-
import * as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function i(...r) {
|
|
10
|
-
const p = () => {
|
|
11
|
-
n.apply(this, r);
|
|
12
|
-
};
|
|
13
|
-
clearTimeout(t), t = setTimeout(p, o);
|
|
14
|
-
}
|
|
15
|
-
return i.clear = () => {
|
|
16
|
-
clearTimeout(t);
|
|
17
|
-
}, i;
|
|
18
|
-
}
|
|
4
|
+
import { a as ve, u as oe } from "./useForkRef-DwN_Iz9R.js";
|
|
5
|
+
import * as $e from "react-dom";
|
|
6
|
+
import { o as me, d as Ge } from "./ownerWindow-BoRkeomM.js";
|
|
7
|
+
import { e as Ke, r as qe } from "./refType-hKctx4k0.js";
|
|
8
|
+
import { Global as Ye } from "@emotion/react";
|
|
19
9
|
function Ze(n) {
|
|
20
|
-
return n && n.ownerDocument || document;
|
|
21
|
-
}
|
|
22
|
-
function me(n) {
|
|
23
|
-
return Ze(n).defaultView || window;
|
|
24
|
-
}
|
|
25
|
-
function Je(n) {
|
|
26
10
|
return n == null || Object.keys(n).length === 0;
|
|
27
11
|
}
|
|
28
12
|
function Ce(n) {
|
|
@@ -30,8 +14,8 @@ function Ce(n) {
|
|
|
30
14
|
styles: o,
|
|
31
15
|
defaultTheme: t = {}
|
|
32
16
|
} = n;
|
|
33
|
-
return /* @__PURE__ */ R(
|
|
34
|
-
styles: typeof o == "function" ? (r) => o(
|
|
17
|
+
return /* @__PURE__ */ R(Ye, {
|
|
18
|
+
styles: typeof o == "function" ? (r) => o(Ze(r) ? t : r) : o
|
|
35
19
|
});
|
|
36
20
|
}
|
|
37
21
|
process.env.NODE_ENV !== "production" && (Ce.propTypes = {
|
|
@@ -43,7 +27,7 @@ function Se({
|
|
|
43
27
|
themeId: o,
|
|
44
28
|
defaultTheme: t = {}
|
|
45
29
|
}) {
|
|
46
|
-
const
|
|
30
|
+
const a = Pe(t), r = typeof n == "function" ? n(o && a[o] || a) : n;
|
|
47
31
|
return /* @__PURE__ */ R(Ce, {
|
|
48
32
|
styles: r
|
|
49
33
|
});
|
|
@@ -69,11 +53,11 @@ process.env.NODE_ENV !== "production" && (Se.propTypes = {
|
|
|
69
53
|
function he(n) {
|
|
70
54
|
return typeof n == "string";
|
|
71
55
|
}
|
|
72
|
-
const
|
|
56
|
+
const Je = ["onChange", "maxRows", "minRows", "style", "value"];
|
|
73
57
|
function U(n) {
|
|
74
58
|
return parseInt(n, 10) || 0;
|
|
75
59
|
}
|
|
76
|
-
const
|
|
60
|
+
const Qe = {
|
|
77
61
|
shadow: {
|
|
78
62
|
// Visibility needed to hide the extra text area on iPads
|
|
79
63
|
visibility: "hidden",
|
|
@@ -91,65 +75,65 @@ const Xe = {
|
|
|
91
75
|
function ye(n) {
|
|
92
76
|
return n == null || Object.keys(n).length === 0 || n.outerHeightStyle === 0 && !n.overflow;
|
|
93
77
|
}
|
|
94
|
-
const xe = /* @__PURE__ */
|
|
78
|
+
const xe = /* @__PURE__ */ s.forwardRef(function(o, t) {
|
|
95
79
|
const {
|
|
96
|
-
onChange:
|
|
80
|
+
onChange: a,
|
|
97
81
|
maxRows: r,
|
|
98
82
|
minRows: p = 1,
|
|
99
83
|
style: I,
|
|
100
84
|
value: E
|
|
101
|
-
} = o,
|
|
85
|
+
} = o, H = ge(o, Je), {
|
|
102
86
|
current: O
|
|
103
|
-
} =
|
|
87
|
+
} = s.useRef(E != null), S = s.useRef(null), F = ve(t, S), v = s.useRef(null), b = s.useRef(0), [N, k] = s.useState({
|
|
104
88
|
outerHeightStyle: 0
|
|
105
|
-
}), B =
|
|
106
|
-
const
|
|
89
|
+
}), B = s.useCallback(() => {
|
|
90
|
+
const d = S.current, u = me(d).getComputedStyle(d);
|
|
107
91
|
if (u.width === "0px")
|
|
108
92
|
return {
|
|
109
93
|
outerHeightStyle: 0
|
|
110
94
|
};
|
|
111
95
|
const f = v.current;
|
|
112
|
-
f.style.width = u.width, f.value =
|
|
96
|
+
f.style.width = u.width, f.value = d.value || o.placeholder || "x", f.value.slice(-1) === `
|
|
113
97
|
` && (f.value += " ");
|
|
114
98
|
const w = u.boxSizing, z = U(u.paddingBottom) + U(u.paddingTop), A = U(u.borderBottomWidth) + U(u.borderTopWidth), C = f.scrollHeight;
|
|
115
99
|
f.value = "x";
|
|
116
100
|
const T = f.scrollHeight;
|
|
117
101
|
let h = C;
|
|
118
102
|
p && (h = Math.max(Number(p) * T, h)), r && (h = Math.min(Number(r) * T, h)), h = Math.max(h, T);
|
|
119
|
-
const G = h + (w === "border-box" ? z + A : 0),
|
|
103
|
+
const G = h + (w === "border-box" ? z + A : 0), P = Math.abs(h - C) <= 1;
|
|
120
104
|
return {
|
|
121
105
|
outerHeightStyle: G,
|
|
122
|
-
overflow:
|
|
106
|
+
overflow: P
|
|
123
107
|
};
|
|
124
|
-
}, [r, p, o.placeholder]),
|
|
108
|
+
}, [r, p, o.placeholder]), V = (d, g) => {
|
|
125
109
|
const {
|
|
126
110
|
outerHeightStyle: u,
|
|
127
111
|
overflow: f
|
|
128
112
|
} = g;
|
|
129
|
-
return b.current < 20 && (u > 0 && Math.abs((
|
|
113
|
+
return b.current < 20 && (u > 0 && Math.abs((d.outerHeightStyle || 0) - u) > 1 || d.overflow !== f) ? (b.current += 1, {
|
|
130
114
|
overflow: f,
|
|
131
115
|
outerHeightStyle: u
|
|
132
116
|
}) : (process.env.NODE_ENV !== "production" && b.current === 20 && console.error(["MUI: Too many re-renders. The layout is unstable.", "TextareaAutosize limits the number of renders to prevent an infinite loop."].join(`
|
|
133
|
-
`)),
|
|
134
|
-
}, m =
|
|
135
|
-
const
|
|
136
|
-
ye(
|
|
117
|
+
`)), d);
|
|
118
|
+
}, m = s.useCallback(() => {
|
|
119
|
+
const d = B();
|
|
120
|
+
ye(d) || k((g) => V(g, d));
|
|
137
121
|
}, [B]);
|
|
138
122
|
oe(() => {
|
|
139
|
-
const
|
|
123
|
+
const d = () => {
|
|
140
124
|
const T = B();
|
|
141
|
-
ye(T) ||
|
|
142
|
-
k((h) =>
|
|
125
|
+
ye(T) || $e.flushSync(() => {
|
|
126
|
+
k((h) => V(h, T));
|
|
143
127
|
});
|
|
144
128
|
}, g = () => {
|
|
145
|
-
b.current = 0,
|
|
129
|
+
b.current = 0, d();
|
|
146
130
|
};
|
|
147
131
|
let u;
|
|
148
132
|
const f = () => {
|
|
149
133
|
cancelAnimationFrame(u), u = requestAnimationFrame(() => {
|
|
150
134
|
g();
|
|
151
135
|
});
|
|
152
|
-
}, w =
|
|
136
|
+
}, w = Ge(g), z = S.current, A = me(z);
|
|
153
137
|
A.addEventListener("resize", w);
|
|
154
138
|
let C;
|
|
155
139
|
return typeof ResizeObserver < "u" && (C = new ResizeObserver(process.env.NODE_ENV === "test" ? f : g), C.observe(z)), () => {
|
|
@@ -157,31 +141,31 @@ const xe = /* @__PURE__ */ a.forwardRef(function(o, t) {
|
|
|
157
141
|
};
|
|
158
142
|
}, [B]), oe(() => {
|
|
159
143
|
m();
|
|
160
|
-
}),
|
|
144
|
+
}), s.useEffect(() => {
|
|
161
145
|
b.current = 0;
|
|
162
146
|
}, [E]);
|
|
163
|
-
const $ = (
|
|
164
|
-
b.current = 0, O || m(),
|
|
147
|
+
const $ = (d) => {
|
|
148
|
+
b.current = 0, O || m(), a && a(d);
|
|
165
149
|
};
|
|
166
|
-
return /* @__PURE__ */ ne(
|
|
167
|
-
children: [/* @__PURE__ */ R("textarea",
|
|
150
|
+
return /* @__PURE__ */ ne(s.Fragment, {
|
|
151
|
+
children: [/* @__PURE__ */ R("textarea", c({
|
|
168
152
|
value: E,
|
|
169
153
|
onChange: $,
|
|
170
154
|
ref: F,
|
|
171
155
|
rows: p,
|
|
172
|
-
style:
|
|
156
|
+
style: c({
|
|
173
157
|
height: N.outerHeightStyle,
|
|
174
158
|
// Need a large enough difference to allow scrolling.
|
|
175
159
|
// This prevents infinite rendering loop.
|
|
176
160
|
overflow: N.overflow ? "hidden" : void 0
|
|
177
161
|
}, I)
|
|
178
|
-
},
|
|
162
|
+
}, H)), /* @__PURE__ */ R("textarea", {
|
|
179
163
|
"aria-hidden": !0,
|
|
180
164
|
className: o.className,
|
|
181
165
|
readOnly: !0,
|
|
182
166
|
ref: v,
|
|
183
167
|
tabIndex: -1,
|
|
184
|
-
style:
|
|
168
|
+
style: c({}, Qe.shadow, I, {
|
|
185
169
|
paddingTop: 0,
|
|
186
170
|
paddingBottom: 0
|
|
187
171
|
})
|
|
@@ -223,23 +207,23 @@ process.env.NODE_ENV !== "production" && (xe.propTypes = {
|
|
|
223
207
|
*/
|
|
224
208
|
value: e.oneOfType([e.arrayOf(e.string), e.number, e.string])
|
|
225
209
|
});
|
|
226
|
-
function
|
|
210
|
+
function Xe({
|
|
227
211
|
props: n,
|
|
228
212
|
states: o,
|
|
229
213
|
muiFormControl: t
|
|
230
214
|
}) {
|
|
231
|
-
return o.reduce((
|
|
215
|
+
return o.reduce((a, r) => (a[r] = n[r], t && typeof n[r] > "u" && (a[r] = t[r]), a), {});
|
|
232
216
|
}
|
|
233
|
-
const Te = /* @__PURE__ */
|
|
217
|
+
const Te = /* @__PURE__ */ s.createContext(void 0);
|
|
234
218
|
process.env.NODE_ENV !== "production" && (Te.displayName = "FormControlContext");
|
|
235
219
|
const Re = Te;
|
|
236
|
-
function
|
|
237
|
-
return
|
|
220
|
+
function en() {
|
|
221
|
+
return s.useContext(Re);
|
|
238
222
|
}
|
|
239
223
|
function Ee(n) {
|
|
240
|
-
return /* @__PURE__ */ R(Se,
|
|
241
|
-
defaultTheme:
|
|
242
|
-
themeId:
|
|
224
|
+
return /* @__PURE__ */ R(Se, c({}, n, {
|
|
225
|
+
defaultTheme: De,
|
|
226
|
+
themeId: We
|
|
243
227
|
}));
|
|
244
228
|
}
|
|
245
229
|
process.env.NODE_ENV !== "production" && (Ee.propTypes = {
|
|
@@ -255,35 +239,35 @@ process.env.NODE_ENV !== "production" && (Ee.propTypes = {
|
|
|
255
239
|
function be(n) {
|
|
256
240
|
return n != null && !(Array.isArray(n) && n.length === 0);
|
|
257
241
|
}
|
|
258
|
-
function
|
|
242
|
+
function nn(n, o = !1) {
|
|
259
243
|
return n && (be(n.value) && n.value !== "" || o && be(n.defaultValue) && n.defaultValue !== "");
|
|
260
244
|
}
|
|
261
|
-
function
|
|
245
|
+
function gn(n) {
|
|
262
246
|
return n.startAdornment;
|
|
263
247
|
}
|
|
264
|
-
function
|
|
248
|
+
function on(n) {
|
|
265
249
|
return _e("MuiInputBase", n);
|
|
266
250
|
}
|
|
267
|
-
const
|
|
251
|
+
const tn = Ve("MuiInputBase", ["root", "formControl", "focused", "disabled", "adornedStart", "adornedEnd", "error", "sizeSmall", "multiline", "colorSecondary", "fullWidth", "hiddenLabel", "readOnly", "input", "inputSizeSmall", "inputMultiline", "inputTypeSearch", "inputAdornedStart", "inputAdornedEnd", "inputHiddenLabel"]), te = tn, rn = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"], sn = (n, o) => {
|
|
268
252
|
const {
|
|
269
253
|
ownerState: t
|
|
270
254
|
} = n;
|
|
271
255
|
return [o.root, t.formControl && o.formControl, t.startAdornment && o.adornedStart, t.endAdornment && o.adornedEnd, t.error && o.error, t.size === "small" && o.sizeSmall, t.multiline && o.multiline, t.color && o[`color${ee(t.color)}`], t.fullWidth && o.fullWidth, t.hiddenLabel && o.hiddenLabel];
|
|
272
|
-
},
|
|
256
|
+
}, an = (n, o) => {
|
|
273
257
|
const {
|
|
274
258
|
ownerState: t
|
|
275
259
|
} = n;
|
|
276
260
|
return [o.input, t.size === "small" && o.inputSizeSmall, t.multiline && o.inputMultiline, t.type === "search" && o.inputTypeSearch, t.startAdornment && o.inputAdornedStart, t.endAdornment && o.inputAdornedEnd, t.hiddenLabel && o.inputHiddenLabel];
|
|
277
|
-
},
|
|
261
|
+
}, ln = (n) => {
|
|
278
262
|
const {
|
|
279
263
|
classes: o,
|
|
280
264
|
color: t,
|
|
281
|
-
disabled:
|
|
265
|
+
disabled: a,
|
|
282
266
|
error: r,
|
|
283
267
|
endAdornment: p,
|
|
284
268
|
focused: I,
|
|
285
269
|
formControl: E,
|
|
286
|
-
fullWidth:
|
|
270
|
+
fullWidth: H,
|
|
287
271
|
hiddenLabel: O,
|
|
288
272
|
multiline: S,
|
|
289
273
|
readOnly: F,
|
|
@@ -291,18 +275,18 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
291
275
|
startAdornment: b,
|
|
292
276
|
type: N
|
|
293
277
|
} = n, k = {
|
|
294
|
-
root: ["root", `color${ee(t)}`,
|
|
295
|
-
input: ["input",
|
|
278
|
+
root: ["root", `color${ee(t)}`, a && "disabled", r && "error", H && "fullWidth", I && "focused", E && "formControl", v && v !== "medium" && `size${ee(v)}`, S && "multiline", b && "adornedStart", p && "adornedEnd", O && "hiddenLabel", F && "readOnly"],
|
|
279
|
+
input: ["input", a && "disabled", N === "search" && "inputTypeSearch", S && "inputMultiline", v === "small" && "inputSizeSmall", O && "inputHiddenLabel", b && "inputAdornedStart", p && "inputAdornedEnd", F && "readOnly"]
|
|
296
280
|
};
|
|
297
|
-
return je(k,
|
|
298
|
-
},
|
|
281
|
+
return je(k, on, o);
|
|
282
|
+
}, un = we("div", {
|
|
299
283
|
name: "MuiInputBase",
|
|
300
284
|
slot: "Root",
|
|
301
|
-
overridesResolver:
|
|
285
|
+
overridesResolver: sn
|
|
302
286
|
})(({
|
|
303
287
|
theme: n,
|
|
304
288
|
ownerState: o
|
|
305
|
-
}) =>
|
|
289
|
+
}) => c({}, n.typography.body1, {
|
|
306
290
|
color: (n.vars || n).palette.text.primary,
|
|
307
291
|
lineHeight: "1.4375em",
|
|
308
292
|
// 23px
|
|
@@ -316,7 +300,7 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
316
300
|
color: (n.vars || n).palette.text.disabled,
|
|
317
301
|
cursor: "default"
|
|
318
302
|
}
|
|
319
|
-
}, o.multiline &&
|
|
303
|
+
}, o.multiline && c({
|
|
320
304
|
padding: "4px 0 5px"
|
|
321
305
|
}, o.size === "small" && {
|
|
322
306
|
paddingTop: 1
|
|
@@ -325,12 +309,12 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
325
309
|
})), dn = we("input", {
|
|
326
310
|
name: "MuiInputBase",
|
|
327
311
|
slot: "Input",
|
|
328
|
-
overridesResolver:
|
|
312
|
+
overridesResolver: an
|
|
329
313
|
})(({
|
|
330
314
|
theme: n,
|
|
331
315
|
ownerState: o
|
|
332
316
|
}) => {
|
|
333
|
-
const t = n.palette.mode === "light",
|
|
317
|
+
const t = n.palette.mode === "light", a = c({
|
|
334
318
|
color: "currentColor"
|
|
335
319
|
}, n.vars ? {
|
|
336
320
|
opacity: n.vars.opacity.inputPlaceholder
|
|
@@ -347,7 +331,7 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
347
331
|
} : {
|
|
348
332
|
opacity: t ? 0.42 : 0.5
|
|
349
333
|
};
|
|
350
|
-
return
|
|
334
|
+
return c({
|
|
351
335
|
font: "inherit",
|
|
352
336
|
letterSpacing: "inherit",
|
|
353
337
|
color: "currentColor",
|
|
@@ -367,12 +351,12 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
367
351
|
// Fix IE11 width issue
|
|
368
352
|
animationName: "mui-auto-fill-cancel",
|
|
369
353
|
animationDuration: "10ms",
|
|
370
|
-
"&::-webkit-input-placeholder":
|
|
371
|
-
"&::-moz-placeholder":
|
|
354
|
+
"&::-webkit-input-placeholder": a,
|
|
355
|
+
"&::-moz-placeholder": a,
|
|
372
356
|
// Firefox 19+
|
|
373
|
-
"&:-ms-input-placeholder":
|
|
357
|
+
"&:-ms-input-placeholder": a,
|
|
374
358
|
// IE11
|
|
375
|
-
"&::-ms-input-placeholder":
|
|
359
|
+
"&::-ms-input-placeholder": a,
|
|
376
360
|
// Edge
|
|
377
361
|
"&:focus": {
|
|
378
362
|
outline: 0
|
|
@@ -423,7 +407,7 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
423
407
|
// Improve type search style.
|
|
424
408
|
MozAppearance: "textfield"
|
|
425
409
|
});
|
|
426
|
-
}),
|
|
410
|
+
}), cn = /* @__PURE__ */ R(Ee, {
|
|
427
411
|
styles: {
|
|
428
412
|
"@keyframes mui-auto-fill": {
|
|
429
413
|
from: {
|
|
@@ -436,8 +420,8 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
436
420
|
}
|
|
437
421
|
}
|
|
438
422
|
}
|
|
439
|
-
}), Oe = /* @__PURE__ */
|
|
440
|
-
var
|
|
423
|
+
}), Oe = /* @__PURE__ */ s.forwardRef(function(o, t) {
|
|
424
|
+
var a;
|
|
441
425
|
const r = Le({
|
|
442
426
|
props: o,
|
|
443
427
|
name: "MuiInputBase"
|
|
@@ -445,7 +429,7 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
445
429
|
"aria-describedby": p,
|
|
446
430
|
autoComplete: I,
|
|
447
431
|
autoFocus: E,
|
|
448
|
-
className:
|
|
432
|
+
className: H,
|
|
449
433
|
components: O = {},
|
|
450
434
|
componentsProps: S = {},
|
|
451
435
|
defaultValue: F,
|
|
@@ -454,10 +438,10 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
454
438
|
endAdornment: N,
|
|
455
439
|
fullWidth: k = !1,
|
|
456
440
|
id: B,
|
|
457
|
-
inputComponent:
|
|
441
|
+
inputComponent: V = "input",
|
|
458
442
|
inputProps: m = {},
|
|
459
443
|
inputRef: $,
|
|
460
|
-
maxRows:
|
|
444
|
+
maxRows: d,
|
|
461
445
|
minRows: g,
|
|
462
446
|
multiline: u = !1,
|
|
463
447
|
name: f,
|
|
@@ -468,84 +452,84 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
468
452
|
onKeyDown: T,
|
|
469
453
|
onKeyUp: h,
|
|
470
454
|
placeholder: G,
|
|
471
|
-
readOnly:
|
|
455
|
+
readOnly: P,
|
|
472
456
|
renderSuffix: re,
|
|
473
457
|
rows: _,
|
|
474
458
|
slotProps: ie = {},
|
|
475
459
|
slots: se = {},
|
|
476
|
-
startAdornment:
|
|
460
|
+
startAdornment: D,
|
|
477
461
|
type: ae = "text",
|
|
478
462
|
value: Ne
|
|
479
|
-
} = r, ze = ge(r,
|
|
463
|
+
} = r, ze = ge(r, rn), L = m.value != null ? m.value : Ne, {
|
|
480
464
|
current: K
|
|
481
|
-
} =
|
|
482
|
-
process.env.NODE_ENV !== "production" &&
|
|
465
|
+
} = s.useRef(L != null), M = s.useRef(), Ae = s.useCallback((i) => {
|
|
466
|
+
process.env.NODE_ENV !== "production" && i && i.nodeName !== "INPUT" && !i.focus && console.error(["MUI: You have provided a `inputComponent` to the input component", "that does not correctly handle the `ref` prop.", "Make sure the `ref` prop is called with a HTMLInputElement."].join(`
|
|
483
467
|
`));
|
|
484
|
-
}, []), Ie = ve(M, $, m.ref, Ae), [q, Y] =
|
|
485
|
-
process.env.NODE_ENV !== "production" &&
|
|
468
|
+
}, []), Ie = ve(M, $, m.ref, Ae), [q, Y] = s.useState(!1), l = en();
|
|
469
|
+
process.env.NODE_ENV !== "production" && s.useEffect(() => {
|
|
486
470
|
if (l)
|
|
487
471
|
return l.registerEffect();
|
|
488
472
|
}, [l]);
|
|
489
|
-
const y =
|
|
473
|
+
const y = Xe({
|
|
490
474
|
props: r,
|
|
491
475
|
muiFormControl: l,
|
|
492
476
|
states: ["color", "disabled", "error", "hiddenLabel", "size", "required", "filled"]
|
|
493
477
|
});
|
|
494
|
-
y.focused = l ? l.focused : q,
|
|
478
|
+
y.focused = l ? l.focused : q, s.useEffect(() => {
|
|
495
479
|
!l && v && q && (Y(!1), w && w());
|
|
496
480
|
}, [l, v, q, w]);
|
|
497
|
-
const Z = l && l.onFilled, J = l && l.onEmpty,
|
|
498
|
-
|
|
481
|
+
const Z = l && l.onFilled, J = l && l.onEmpty, W = s.useCallback((i) => {
|
|
482
|
+
nn(i) ? Z && Z() : J && J();
|
|
499
483
|
}, [Z, J]);
|
|
500
484
|
oe(() => {
|
|
501
|
-
K &&
|
|
485
|
+
K && W({
|
|
502
486
|
value: L
|
|
503
487
|
});
|
|
504
|
-
}, [L,
|
|
505
|
-
const Fe = (
|
|
488
|
+
}, [L, W, K]);
|
|
489
|
+
const Fe = (i) => {
|
|
506
490
|
if (y.disabled) {
|
|
507
|
-
|
|
491
|
+
i.stopPropagation();
|
|
508
492
|
return;
|
|
509
493
|
}
|
|
510
|
-
C && C(
|
|
511
|
-
}, ke = (
|
|
512
|
-
w && w(
|
|
513
|
-
}, Be = (
|
|
494
|
+
C && C(i), m.onFocus && m.onFocus(i), l && l.onFocus ? l.onFocus(i) : Y(!0);
|
|
495
|
+
}, ke = (i) => {
|
|
496
|
+
w && w(i), m.onBlur && m.onBlur(i), l && l.onBlur ? l.onBlur(i) : Y(!1);
|
|
497
|
+
}, Be = (i, ...ce) => {
|
|
514
498
|
if (!K) {
|
|
515
|
-
const pe =
|
|
499
|
+
const pe = i.target || M.current;
|
|
516
500
|
if (pe == null)
|
|
517
501
|
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: Expected valid input target. Did you use a custom `inputComponent` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info." : Ue(1));
|
|
518
|
-
|
|
502
|
+
W({
|
|
519
503
|
value: pe.value
|
|
520
504
|
});
|
|
521
505
|
}
|
|
522
|
-
m.onChange && m.onChange(
|
|
506
|
+
m.onChange && m.onChange(i, ...ce), z && z(i, ...ce);
|
|
523
507
|
};
|
|
524
|
-
|
|
525
|
-
|
|
508
|
+
s.useEffect(() => {
|
|
509
|
+
W(M.current);
|
|
526
510
|
}, []);
|
|
527
|
-
const Me = (
|
|
528
|
-
M.current &&
|
|
511
|
+
const Me = (i) => {
|
|
512
|
+
M.current && i.currentTarget === i.target && M.current.focus(), A && A(i);
|
|
529
513
|
};
|
|
530
|
-
let Q =
|
|
531
|
-
u && Q === "input" && (_ ? (process.env.NODE_ENV !== "production" && (g ||
|
|
514
|
+
let Q = V, x = m;
|
|
515
|
+
u && Q === "input" && (_ ? (process.env.NODE_ENV !== "production" && (g || d) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), x = c({
|
|
532
516
|
type: void 0,
|
|
533
517
|
minRows: _,
|
|
534
518
|
maxRows: _
|
|
535
|
-
}, x)) : x =
|
|
519
|
+
}, x)) : x = c({
|
|
536
520
|
type: void 0,
|
|
537
|
-
maxRows:
|
|
521
|
+
maxRows: d,
|
|
538
522
|
minRows: g
|
|
539
523
|
}, x), Q = xe);
|
|
540
|
-
const
|
|
541
|
-
|
|
524
|
+
const He = (i) => {
|
|
525
|
+
W(i.animationName === "mui-auto-fill-cancel" ? M.current : {
|
|
542
526
|
value: "x"
|
|
543
527
|
});
|
|
544
528
|
};
|
|
545
|
-
|
|
546
|
-
l && l.setAdornedStart(!!
|
|
547
|
-
}, [l,
|
|
548
|
-
const j =
|
|
529
|
+
s.useEffect(() => {
|
|
530
|
+
l && l.setAdornedStart(!!D);
|
|
531
|
+
}, [l, D]);
|
|
532
|
+
const j = c({}, r, {
|
|
549
533
|
color: y.color || "primary",
|
|
550
534
|
disabled: y.disabled,
|
|
551
535
|
endAdornment: N,
|
|
@@ -556,20 +540,20 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
556
540
|
hiddenLabel: y.hiddenLabel,
|
|
557
541
|
multiline: u,
|
|
558
542
|
size: y.size,
|
|
559
|
-
startAdornment:
|
|
543
|
+
startAdornment: D,
|
|
560
544
|
type: ae
|
|
561
|
-
}), le =
|
|
562
|
-
return x =
|
|
563
|
-
children: [!b &&
|
|
564
|
-
ownerState:
|
|
545
|
+
}), le = ln(j), ue = se.root || O.Root || un, X = ie.root || S.root || {}, de = se.input || O.Input || dn;
|
|
546
|
+
return x = c({}, x, (a = ie.input) != null ? a : S.input), /* @__PURE__ */ ne(s.Fragment, {
|
|
547
|
+
children: [!b && cn, /* @__PURE__ */ ne(ue, c({}, X, !he(ue) && {
|
|
548
|
+
ownerState: c({}, j, X.ownerState)
|
|
565
549
|
}, {
|
|
566
550
|
ref: t,
|
|
567
551
|
onClick: Me
|
|
568
552
|
}, ze, {
|
|
569
|
-
className: fe(le.root, X.className,
|
|
570
|
-
children: [
|
|
553
|
+
className: fe(le.root, X.className, H, P && "MuiInputBase-readOnly"),
|
|
554
|
+
children: [D, /* @__PURE__ */ R(Re.Provider, {
|
|
571
555
|
value: null,
|
|
572
|
-
children: /* @__PURE__ */ R(
|
|
556
|
+
children: /* @__PURE__ */ R(de, c({
|
|
573
557
|
ownerState: j,
|
|
574
558
|
"aria-invalid": y.error,
|
|
575
559
|
"aria-describedby": p,
|
|
@@ -578,28 +562,28 @@ const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "ad
|
|
|
578
562
|
defaultValue: F,
|
|
579
563
|
disabled: y.disabled,
|
|
580
564
|
id: B,
|
|
581
|
-
onAnimationStart:
|
|
565
|
+
onAnimationStart: He,
|
|
582
566
|
name: f,
|
|
583
567
|
placeholder: G,
|
|
584
|
-
readOnly:
|
|
568
|
+
readOnly: P,
|
|
585
569
|
required: y.required,
|
|
586
570
|
rows: _,
|
|
587
571
|
value: L,
|
|
588
572
|
onKeyDown: T,
|
|
589
573
|
onKeyUp: h,
|
|
590
574
|
type: ae
|
|
591
|
-
}, x, !he(
|
|
575
|
+
}, x, !he(de) && {
|
|
592
576
|
as: Q,
|
|
593
|
-
ownerState:
|
|
577
|
+
ownerState: c({}, j, x.ownerState)
|
|
594
578
|
}, {
|
|
595
579
|
ref: Ie,
|
|
596
|
-
className: fe(le.input, x.className,
|
|
580
|
+
className: fe(le.input, x.className, P && "MuiInputBase-readOnly"),
|
|
597
581
|
onBlur: ke,
|
|
598
582
|
onChange: Be,
|
|
599
583
|
onFocus: Fe
|
|
600
584
|
}))
|
|
601
|
-
}), N, re ? re(
|
|
602
|
-
startAdornment:
|
|
585
|
+
}), N, re ? re(c({}, y, {
|
|
586
|
+
startAdornment: D
|
|
603
587
|
})) : null]
|
|
604
588
|
}))]
|
|
605
589
|
});
|
|
@@ -701,7 +685,7 @@ process.env.NODE_ENV !== "production" && (Oe.propTypes = {
|
|
|
701
685
|
* Either a string to use a HTML element or a component.
|
|
702
686
|
* @default 'input'
|
|
703
687
|
*/
|
|
704
|
-
inputComponent:
|
|
688
|
+
inputComponent: Ke,
|
|
705
689
|
/**
|
|
706
690
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
|
707
691
|
* @default {}
|
|
@@ -710,7 +694,7 @@ process.env.NODE_ENV !== "production" && (Oe.propTypes = {
|
|
|
710
694
|
/**
|
|
711
695
|
* Pass a ref to the `input` element.
|
|
712
696
|
*/
|
|
713
|
-
inputRef:
|
|
697
|
+
inputRef: qe,
|
|
714
698
|
/**
|
|
715
699
|
* If `dense`, will adjust vertical spacing. This is normally obtained via context from
|
|
716
700
|
* FormControl.
|
|
@@ -834,21 +818,18 @@ process.env.NODE_ENV !== "production" && (Oe.propTypes = {
|
|
|
834
818
|
*/
|
|
835
819
|
value: e.any
|
|
836
820
|
});
|
|
837
|
-
const
|
|
821
|
+
const wn = Oe;
|
|
838
822
|
export {
|
|
839
823
|
Re as F,
|
|
840
|
-
|
|
824
|
+
un as I,
|
|
841
825
|
dn as a,
|
|
842
|
-
|
|
843
|
-
|
|
826
|
+
an as b,
|
|
827
|
+
wn as c,
|
|
844
828
|
he as d,
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
on as h,
|
|
829
|
+
gn as e,
|
|
830
|
+
Xe as f,
|
|
831
|
+
nn as g,
|
|
849
832
|
te as i,
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
an as r,
|
|
853
|
-
nn as u
|
|
833
|
+
sn as r,
|
|
834
|
+
en as u
|
|
854
835
|
};
|