@sheetxl/utils-mui 0.7.6 → 0.7.8

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.
@@ -0,0 +1,44 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { memo as j, forwardRef as z, useState as s } from "react";
3
+ import { O as E, c as R } from "./BdK_nANHPbXOoKy3.mjs";
4
+ import { alpha as x, getOverlayAlpha as y } from "@mui/material/styles";
5
+ import { Box as A, FormControl as W, TextField as q } from "@mui/material";
6
+ import { useCallbackRef as n, KeyCodes as G } from "@sheetxl/utils-react";
7
+ /**
8
+ * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.8
9
+ *
10
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
11
+ * License: The license can be found at https://www.sheetxl.com/license.
12
+ */
13
+ const J = ["Input"], aa = j(z((w, C) => {
14
+ const { initialValue: F = "", onOption: T, onValidateOption: r, onInputOption: c, onValidateInputOption: p, onDone: u, inputProps: d, inputLabel: v, inputType: b, inputPlaceHolder: k, options: m = J, autoFocusSel: I = ".autoFocus", cancelOption: g, defaultOption: f = m?.[0], ...P } = w, [V, B] = s(!1), [o, D] = s(F), [S, H] = s(""), [K, L] = s(!0), e = n(async (a, t) => {
15
+ if (!p) return !0;
16
+ const l = await p?.(a, t);
17
+ H(l?.message ?? "");
18
+ const O = l?.valid ?? !0;
19
+ return L(O), O;
20
+ }, [p]), h = n(async (a) => {
21
+ c?.(o, a);
22
+ }, [o, c, u, T, g, f]), M = n(async (a) => {
23
+ a.keyCode === G.Enter && await e?.(o, null);
24
+ }, [o, h]), N = n((a) => {
25
+ D(a.target.value), e?.(a.target.value, null);
26
+ }, [r]), $ = n(async (a) => {
27
+ let t = await e(o, a);
28
+ try {
29
+ t !== !1 && (t = await e(o, a));
30
+ } catch {
31
+ }
32
+ return t ?? !0;
33
+ }, [o, r]);
34
+ return i(E, { options: m, onDone: u, onOption: (a, t) => {
35
+ t || h(a);
36
+ }, onValidateOption: $, cancelOption: g, defaultOption: f, autoFocusSel: I, ref: C, ...P, children: i(A, { sx: { paddingTop: (a) => a.spacing(1), paddingBottom: (a) => a.spacing(0) }, children: i(W, { sx: { paddingTop: (a) => a.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: i(q, { onFocus: (a) => {
37
+ V || a.target?.select(), B(!0);
38
+ }, type: b, label: v, helperText: S || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (a) => a.spacing(0.5), color: K ? void 0 : "error.main" } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { placeholder: k, spellCheck: !1, autoComplete: "off", ...d, className: R("autoFocus", d?.className), sx: { paddingTop: (a) => a.spacing(1.25), paddingBottom: (a) => a.spacing(0.75), backgroundImage: `linear-gradient(${x("#fff", y(5))}, ${x("#fff", y(5))})` } } }, value: o, onChange: N, onKeyDown: M, onContextMenu: (a) => {
39
+ a.stopPropagation();
40
+ } }) }) }) });
41
+ }));
42
+ export {
43
+ aa as default
44
+ };
@@ -1,7 +1,7 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- import { B as t, y as s, x as e, z as n, C as i, D as l, A as r, m as p, I as u, _ as c, a4 as d, a6 as m, a9 as h, a7 as E, J as I, G as C, w as b, a3 as g, E as B, b as S, a as x, f as P, Y as T, d as A, e as w, g as M, a5 as v, Q as D, a8 as F, L as k, M as f, N as O, O as R, Z as y, $ as L, S as W, aa as z, K as G, H, n as N, T as j, a1 as q, j as J, q as K, p as Q, v as U, r as V, l as X, a0 as Y, i as Z, V as _, h as $, o as aa, s as oa, W as ta, k as sa, t as ea, a2 as na, U as ia, P as la, X as ra, R as pa, u as ua, F as ca } from "./BKsvb2y93wXmAwiC.mjs";
2
+ import { B as t, y as s, x as e, z as n, C as i, D as l, A as r, m as p, I as u, _ as c, a4 as d, a6 as m, a9 as h, a7 as E, J as I, G as C, w as b, a3 as g, E as B, b as S, a as x, f as P, Y as T, d as A, e as w, g as M, a5 as v, Q as D, a8 as F, L as k, M as f, N as O, O as R, Z as y, $ as L, S as W, aa as z, K as G, H, n as N, T as j, a1 as q, j as J, q as K, p as Q, v as U, r as V, l as X, a0 as Y, i as Z, V as _, h as $, o as aa, s as oa, W as ta, k as sa, t as ea, a2 as na, U as ia, P as la, X as ra, R as pa, u as ua, F as ca } from "./BdK_nANHPbXOoKy3.mjs";
3
3
  /**
4
- * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.6
4
+ * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.8
5
5
  *
6
6
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
7
7
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -404,7 +404,7 @@ SOFTWARE.
404
404
  ---
405
405
 
406
406
  Name: react-hook-form
407
- Version: 7.62.0
407
+ Version: 7.63.0
408
408
  License: MIT
409
409
  Private: false
410
410
  Description: Performant, flexible and extensible forms library for React Hooks
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.6
2
+ * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.8
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -7,12 +7,12 @@
7
7
  import { jsx as t } from "react/jsx-runtime";
8
8
  import { memo as o, forwardRef as n, useState as a } from "react";
9
9
  import e from "clsx";
10
- import { alpha as i, getOverlayAlpha as p } from "@mui/material/styles";
11
- import { Box as r, FormControl as l, TextField as s } from "@mui/material";
10
+ import { alpha as i, getOverlayAlpha as r } from "@mui/material/styles";
11
+ import { Box as p, FormControl as l, TextField as s } from "@mui/material";
12
12
  import { useCallbackRef as c, KeyCodes as u } from "@sheetxl/utils-react";
13
13
  import { OptionsDialog as m } from "./index.mjs";
14
14
  const d = ["Input"], g = o(n((o2, n2) => {
15
- const { initialValue: g2 = "", onOption: f, onValidateOption: h, onInputOption: x, onValidateInputOption: y, onDone: O, inputProps: w, inputLabel: T, inputType: F, inputPlaceHolder: I, options: P = d, autoFocusSel: v = ".autoFocus", cancelOption: C, defaultOption: b = P?.[0], ...k } = o2, [V, D] = a(false), [j, B] = a(g2), [H, L] = a(""), [M, N] = a(true), S = c(async (t2, o3) => {
15
+ const { initialValue: g2 = "", onOption: f, onValidateOption: h, onInputOption: x, onValidateInputOption: y, onDone: O, inputProps: w, inputLabel: T, inputType: F, inputPlaceHolder: v, options: C = d, autoFocusSel: I = ".autoFocus", cancelOption: b, defaultOption: k = C?.[0], ...P } = o2, [V, D] = a(false), [j, B] = a(g2), [H, L] = a(""), [M, N] = a(true), S = c(async (t2, o3) => {
16
16
  if (!y) return true;
17
17
  const n3 = await y?.(t2, o3);
18
18
  L(n3?.message ?? "");
@@ -20,7 +20,7 @@ const d = ["Input"], g = o(n((o2, n2) => {
20
20
  return N(a2), a2;
21
21
  }, [y]), $ = c(async (t2) => {
22
22
  x?.(j, t2);
23
- }, [j, x, O, f, C, b]), z = c(async (t2) => {
23
+ }, [j, x, O, f, b, k]), z = c(async (t2) => {
24
24
  t2.keyCode === u.Enter && await S?.(j, null);
25
25
  }, [j, $]), E = c((t2) => {
26
26
  B(t2.target.value), S?.(t2.target.value, null);
@@ -32,11 +32,11 @@ const d = ["Input"], g = o(n((o2, n2) => {
32
32
  }
33
33
  return o3 ?? true;
34
34
  }, [j, h]);
35
- return t(m, { options: P, onDone: O, onOption: (t2, o3) => {
35
+ return t(m, { options: C, onDone: O, onOption: (t2, o3) => {
36
36
  o3 || $(t2);
37
- }, onValidateOption: K, cancelOption: C, defaultOption: b, autoFocusSel: v, ref: n2, ...k, children: t(r, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0) }, children: t(l, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(s, { onFocus: (t2) => {
37
+ }, onValidateOption: K, cancelOption: b, defaultOption: k, autoFocusSel: I, ref: n2, ...P, children: t(p, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0) }, children: t(l, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(s, { onFocus: (t2) => {
38
38
  V || t2.target?.select(), D(true);
39
- }, type: F, label: T, helperText: H || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5), color: M ? void 0 : "error.main" } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { placeholder: I, spellCheck: false, autoComplete: "off", ...w, className: e("autoFocus", w?.className), sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", p(5))}, ${i("#fff", p(5))})` } } }, value: j, onChange: E, onKeyDown: z, onContextMenu: (t2) => {
39
+ }, type: F, label: T, helperText: H || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5), color: M ? void 0 : "error.main" } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { placeholder: v, spellCheck: false, autoComplete: "off", ...w, className: e("autoFocus", w?.className), sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", r(5))}, ${i("#fff", r(5))})` } } }, value: j, onChange: E, onKeyDown: z, onContextMenu: (t2) => {
40
40
  t2.stopPropagation();
41
41
  } }) }) }) });
42
42
  }));