@sheetxl/utils-mui 0.7.27 → 0.7.28-beta.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/browser/cjs/CMDyOaq_TZmhbR3R.cjs +1 -0
- package/browser/cjs/GeHQP4M_1ydWv9v4.cjs +3 -0
- package/browser/cjs/index.cjs +4 -7
- package/browser/esm/9fsNC-TCsC2eWrT7.mjs +2544 -0
- package/browser/esm/C1J1QewWhbiiqeRG.mjs +96 -0
- package/browser/esm/index.mjs +2688 -72
- package/licenses/dependencies.txt +60 -198
- package/node/esm/BIcd-KmTY3PjXAVL.mjs +97 -0
- package/node/esm/index.mjs +3354 -981
- package/package.json +12 -14
- package/resources/contents.json +18 -0
- package/resources/locales/contents.json +16 -0
- package/resources/locales/de/ui.msg.json +22 -0
- package/resources/locales/en/ui.msg.json +22 -0
- package/types/index.d.ts +2 -1068
- package/types/src/button/ButtonContent.d.ts +17 -0
- package/types/src/button/ExhibitIconButton.d.ts +31 -0
- package/types/src/button/ExhibitMenuHeader.d.ts +15 -0
- package/types/src/button/ExhibitMenuItem.d.ts +24 -0
- package/types/src/button/ExhibitOptionButton.d.ts +16 -0
- package/types/src/button/ExhibitPopupIconButton.d.ts +18 -0
- package/types/src/button/ExhibitPopupMenuItem.d.ts +8 -0
- package/types/src/button/ExhibitTooltip.d.ts +26 -0
- package/types/src/button/OverflowPalette.d.ts +29 -0
- package/types/src/button/SelectedIcon.d.ts +18 -0
- package/types/src/button/index.d.ts +11 -0
- package/types/src/command/CommandButton.d.ts +4 -0
- package/types/src/command/CommandGroup.d.ts +71 -0
- package/types/src/command/CommandPopupButton.d.ts +34 -0
- package/types/src/command/CommandToolbar.d.ts +51 -0
- package/types/src/command/CommandTooltip.d.ts +22 -0
- package/types/src/command/InputCommandButton.d.ts +20 -0
- package/types/src/command/ToggleGroupButton.d.ts +33 -0
- package/types/src/command/index.d.ts +8 -0
- package/types/src/command/useManagedRipple.d.ts +23 -0
- package/types/src/components/AnimatedLoadingPanel.d.ts +45 -0
- package/types/src/components/ChipStrip.d.ts +9 -0
- package/types/src/components/ContextMenu.d.ts +32 -0
- package/types/src/components/ExhibitDivider.d.ts +6 -0
- package/types/src/components/NestingPopupButton.d.ts +11 -0
- package/types/src/components/ScrollButtons.d.ts +7 -0
- package/types/src/components/SimpleTooltip.d.ts +15 -0
- package/types/src/components/StackTrace.d.ts +20 -0
- package/types/src/components/StackTraceErrorPanel.d.ts +28 -0
- package/types/src/components/index.d.ts +10 -0
- package/types/src/dialog/InputDialog.d.ts +8 -0
- package/types/src/dialog/InternalWindow.d.ts +142 -0
- package/types/src/dialog/OptionsDialog.d.ts +19 -0
- package/types/src/dialog/index.d.ts +10 -0
- package/types/src/dialog/useInputDialog.d.ts +6 -0
- package/types/src/dialog/useLazyWindow.d.ts +14 -0
- package/types/src/dialog/useOptionsDialog.d.ts +8 -0
- package/types/src/float/ExhibitFloatPanel.d.ts +22 -0
- package/types/src/float/ExhibitFloatProvider.d.ts +17 -0
- package/types/src/float/ExhibitPopup.d.ts +97 -0
- package/types/src/float/index.d.ts +4 -0
- package/types/src/index.d.ts +8 -0
- package/types/src/locales/index.d.ts +3 -0
- package/types/src/theme/ExhibitTheme.d.ts +71 -0
- package/types/src/theme/IconSupport.d.ts +11 -0
- package/types/src/theme/ScrollbarTheming.d.ts +12 -0
- package/types/src/theme/index.d.ts +4 -0
- package/browser/cjs/DaEKEZaG-FHdWrtX.cjs +0 -6
- package/browser/cjs/DfODF1nk9pC8WaMc.cjs +0 -11
- package/browser/esm/CvYgOZcfwT-xE3Sk.mjs +0 -2891
- package/browser/esm/i2MzZuUDebibOGmf.mjs +0 -44
- package/node/assets/style.css +0 -1
- package/node/esm/CaDPRPvErt0JK4E-.mjs +0 -45
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.28-beta.2
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { T as e, t } from "./9fsNC-TCsC2eWrT7.mjs";
|
|
8
|
+
import { Box as n, FormControl as r, TextField as i } from "@mui/material";
|
|
9
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
10
|
+
import { forwardRef as o, memo as s, useState as c } from "react";
|
|
11
|
+
import { KeyCodes as l, useCallbackRef as u } from "@sheetxl/utils-react";
|
|
12
|
+
var d = ["Input"], f = s(o((o, s) => {
|
|
13
|
+
let { initialValue: f = "", onOption: p, onValidateOption: m, onInput: h, onValidateInput: g, onDone: _, propsInput: v, inputLabel: y, inputType: b, inputPlaceHolder: x, options: S = d, autoFocusSel: C = ".autoFocus", cancelOption: w, defaultOption: T = S?.[0], ...E } = o, [D, O] = c(!1), [k, A] = c(f), [j, M] = c(""), [N, P] = c(!0), F = u(async (e, t) => {
|
|
14
|
+
if (!g) return !0;
|
|
15
|
+
let n = await g?.(e, t);
|
|
16
|
+
M(n?.message ?? "");
|
|
17
|
+
let r = n?.valid ?? !0;
|
|
18
|
+
return P(r), r;
|
|
19
|
+
}, [g]), I = u(async (e) => {
|
|
20
|
+
h?.(k, e);
|
|
21
|
+
}, [
|
|
22
|
+
k,
|
|
23
|
+
h,
|
|
24
|
+
_,
|
|
25
|
+
p,
|
|
26
|
+
w,
|
|
27
|
+
T
|
|
28
|
+
]), L = u(async (e) => {
|
|
29
|
+
e.keyCode === l.Enter && await F?.(k, void 0);
|
|
30
|
+
}, [k, I]), R = u((e) => {
|
|
31
|
+
A(e.target.value), F?.(e.target.value, void 0);
|
|
32
|
+
}, [m]);
|
|
33
|
+
return a(t, {
|
|
34
|
+
options: S,
|
|
35
|
+
onDone: _,
|
|
36
|
+
onOption: (e, t) => {
|
|
37
|
+
t || I(e);
|
|
38
|
+
},
|
|
39
|
+
onValidateOption: u(async (e) => await F(k, e) ?? !0, [k, m]),
|
|
40
|
+
cancelOption: w,
|
|
41
|
+
defaultOption: T,
|
|
42
|
+
autoFocusSel: C,
|
|
43
|
+
ref: s,
|
|
44
|
+
...E,
|
|
45
|
+
children: a(n, {
|
|
46
|
+
sx: {
|
|
47
|
+
paddingTop: (e) => e.spacing(1),
|
|
48
|
+
paddingBottom: (e) => e.spacing(0)
|
|
49
|
+
},
|
|
50
|
+
children: a(r, {
|
|
51
|
+
sx: {
|
|
52
|
+
paddingTop: (e) => e.spacing(1.5),
|
|
53
|
+
minWidth: 135,
|
|
54
|
+
width: "100%"
|
|
55
|
+
},
|
|
56
|
+
size: "small",
|
|
57
|
+
children: a(i, {
|
|
58
|
+
onFocus: (e) => {
|
|
59
|
+
D || e.target?.select(), O(!0);
|
|
60
|
+
},
|
|
61
|
+
type: b,
|
|
62
|
+
label: y,
|
|
63
|
+
helperText: j || " ",
|
|
64
|
+
sx: {
|
|
65
|
+
width: "100%",
|
|
66
|
+
"& .MuiFormHelperText-root": {
|
|
67
|
+
marginTop: (e) => e.spacing(.5),
|
|
68
|
+
color: N ? void 0 : "error.main"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
slotProps: {
|
|
72
|
+
inputLabel: { shrink: !0 },
|
|
73
|
+
htmlInput: {
|
|
74
|
+
placeholder: x,
|
|
75
|
+
spellCheck: !1,
|
|
76
|
+
autoComplete: "off",
|
|
77
|
+
...v,
|
|
78
|
+
className: e("autoFocus", v?.className),
|
|
79
|
+
sx: {
|
|
80
|
+
paddingTop: (e) => e.spacing(1.25),
|
|
81
|
+
paddingBottom: (e) => e.spacing(.75)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
value: k,
|
|
86
|
+
onChange: R,
|
|
87
|
+
onKeyDown: L,
|
|
88
|
+
onContextMenu: (e) => {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}));
|
|
96
|
+
export { f as default };
|