@sheetxl/utils-mui 0.3.18 → 0.3.20

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/utils-mui",
3
3
  "description": "Utilities MUI - Utilities for MUI Components needed for all SheetXL components.",
4
- "version": "0.3.18",
4
+ "version": "0.3.20",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -29,8 +29,8 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@popperjs/core": "^2.11.8",
32
- "@sheetxl/utils": "^0.3.18",
33
- "@sheetxl/utils-react": "^0.3.18",
32
+ "@sheetxl/utils": "^0.3.20",
33
+ "@sheetxl/utils-react": "^0.3.20",
34
34
  "clsx": "^2.1.1",
35
35
  "detect-it": "^4.0.1",
36
36
  "focus-trap-react": "^10.1.4",
package/types/index.d.ts CHANGED
@@ -110,7 +110,9 @@ export declare const CheckIcon: (props: SvgIconProps) => JSX.Element;
110
110
 
111
111
  export declare const CheckSuccessIcon: (props: SvgIconProps) => JSX.Element;
112
112
 
113
- export declare const ChipStrip: default_2.FC<ChipStripProps>;
113
+ export declare const ChipStrip: default_2.FC<ChipStripProps & {
114
+ ref?: any;
115
+ }>;
114
116
 
115
117
  export declare interface ChipStripProps extends BoxProps {
116
118
  chips: string | string[] | default_2.ReactNode | default_2.ReactNode[];
@@ -203,7 +205,9 @@ export declare type CommandButtonRefAttribute = {
203
205
  ref?: default_2.Ref<HTMLDivElement>;
204
206
  };
205
207
 
206
- export declare const CommandPopupButton: default_2.FC<CommandPopupButtonProps>;
208
+ export declare const CommandPopupButton: default_2.FC<CommandPopupButtonProps & {
209
+ ref?: any;
210
+ }>;
207
211
 
208
212
  /**
209
213
  * Attach a command to a popup.
@@ -240,7 +244,7 @@ export declare type CommandPopupButtonRefAttribute = {
240
244
  ref?: default_2.Ref<HTMLDivElement>;
241
245
  };
242
246
 
243
- export declare const CommandToolbar: default_2.FC<CommandToolbarProps & CommandToolbarRefAttribute>;
247
+ export declare const CommandToolbar: default_2.NamedExoticComponent<Omit<CommandToolbarProps, "ref"> & default_2.RefAttributes<ICommandToolbarElement>>;
244
248
 
245
249
  export declare interface CommandToolbarAttributes {
246
250
  }
@@ -267,7 +271,9 @@ export declare interface CommandToolbarRefAttribute {
267
271
  ref?: default_2.Ref<HTMLDivElement>;
268
272
  }
269
273
 
270
- export declare const CommandTooltip: default_2.FC<CommandTooltipProps>;
274
+ export declare const CommandTooltip: default_2.FC<CommandTooltipProps & {
275
+ ref?: any;
276
+ }>;
271
277
 
272
278
  export declare interface CommandTooltipProps extends Omit<TooltipProps, "title"> {
273
279
  command: ICommand<any, any>;
@@ -413,7 +419,9 @@ export declare const ErrorAlertIcon: (props: SvgIconProps) => JSX.Element;
413
419
  * Simple panel to show error.
414
420
  * Todo - allow for action flag
415
421
  */
416
- export declare const ErrorPanel: default_2.FC<ErrorPanelProps>;
422
+ export declare const ErrorPanel: default_2.FC<ErrorPanelProps & {
423
+ ref?: any;
424
+ }>;
417
425
 
418
426
  export declare interface ErrorPanelProps extends BoxProps {
419
427
  icon?: default_2.ReactNode;
@@ -461,12 +469,16 @@ export declare interface ExhibitComponentsVariants extends ComponentsVariants {
461
469
  }>;
462
470
  }
463
471
 
464
- export declare const ExhibitDivider: default_2.FC<ExhibitDividerProps>;
472
+ export declare const ExhibitDivider: default_2.FC<ExhibitDividerProps & {
473
+ ref?: any;
474
+ }>;
465
475
 
466
476
  export declare interface ExhibitDividerProps extends DividerProps {
467
477
  }
468
478
 
469
- export declare const ExhibitFloatPanel: default_2.FC<ExhibitFloatPanelProps>;
479
+ export declare const ExhibitFloatPanel: default_2.FC<ExhibitFloatPanelProps & {
480
+ ref?: any;
481
+ }>;
470
482
 
471
483
  /**
472
484
  * TODO - review the usefulness of this class
@@ -497,7 +509,9 @@ export declare interface ExhibitFloatPanelProps extends BoxProps {
497
509
  /**
498
510
  * This is a simple styled icon button.
499
511
  */
500
- export declare const ExhibitIconButton: default_2.FC<ExhibitIconButtonProps>;
512
+ export declare const ExhibitIconButton: default_2.FC<ExhibitIconButtonProps & {
513
+ ref?: any;
514
+ }>;
501
515
 
502
516
  export declare interface ExhibitIconButtonProps extends IconButtonProps {
503
517
  dense?: boolean;
@@ -522,7 +536,9 @@ export declare interface ExhibitIconButtonProps extends IconButtonProps {
522
536
  parentFloat?: FloatReference;
523
537
  }
524
538
 
525
- export declare const ExhibitMenuHeader: default_2.FC<ExhibitMenuHeaderProps>;
539
+ export declare const ExhibitMenuHeader: default_2.FC<ExhibitMenuHeaderProps & {
540
+ ref?: any;
541
+ }>;
526
542
 
527
543
  export declare interface ExhibitMenuHeaderProps extends TypographyProps {
528
544
  /**
@@ -534,7 +550,9 @@ export declare interface ExhibitMenuHeaderProps extends TypographyProps {
534
550
  variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'caption' | 'overline';
535
551
  }
536
552
 
537
- export declare const ExhibitMenuItem: default_2.FC<ExhibitMenuItemProps>;
553
+ export declare const ExhibitMenuItem: default_2.FC<ExhibitMenuItemProps & {
554
+ ref?: any;
555
+ }>;
538
556
 
539
557
  export declare interface ExhibitMenuItemProps extends MenuItemProps {
540
558
  icon?: default_2.ReactNode | (() => default_2.ReactNode);
@@ -554,7 +572,9 @@ export declare interface ExhibitMenuItemProps extends MenuItemProps {
554
572
  chips?: string | string[] | default_2.ReactNode | default_2.ReactNode[];
555
573
  }
556
574
 
557
- export declare const ExhibitOptionButton: default_2.FC<ExhibitOptionButtonProps>;
575
+ export declare const ExhibitOptionButton: default_2.FC<ExhibitOptionButtonProps & {
576
+ ref?: any;
577
+ }>;
558
578
 
559
579
  declare interface ExhibitOptionButtonProps extends ExhibitIconButtonProps {
560
580
  onSelectToggle?: (value: boolean) => void;
@@ -565,7 +585,9 @@ declare interface ExhibitOptionButtonProps extends ExhibitIconButtonProps {
565
585
  tabIndex?: number;
566
586
  }
567
587
 
568
- export declare const ExhibitPopper: default_2.FC<ExhibitPopperProps>;
588
+ export declare const ExhibitPopper: default_2.FC<ExhibitPopperProps & {
589
+ ref?: any;
590
+ }>;
569
591
 
570
592
  export declare interface ExhibitPopperPosition {
571
593
  top: number;
@@ -654,7 +676,9 @@ export declare interface ExhibitPopupButtonProps extends BoxProps {
654
676
  touchRippleRef?: default_2.Ref<any>;
655
677
  }
656
678
 
657
- export declare const ExhibitPopupIconButton: default_2.FC<ExhibitPopupIconButtonProps>;
679
+ export declare const ExhibitPopupIconButton: default_2.FC<ExhibitPopupIconButtonProps & {
680
+ ref?: any;
681
+ }>;
658
682
 
659
683
  export declare interface ExhibitPopupIconButtonProps extends ExhibitPopupButtonProps {
660
684
  dense?: boolean;
@@ -663,7 +687,9 @@ export declare interface ExhibitPopupIconButtonProps extends ExhibitPopupButtonP
663
687
  buttonProps?: BoxProps;
664
688
  }
665
689
 
666
- export declare const ExhibitPopupMenuItem: default_2.FC<ExhibitPopupMenuItemProps>;
690
+ export declare const ExhibitPopupMenuItem: default_2.FC<ExhibitPopupMenuItemProps & {
691
+ ref?: any;
692
+ }>;
667
693
 
668
694
  export declare interface ExhibitPopupMenuItemProps extends ExhibitPopupButtonProps {
669
695
  }
@@ -693,7 +719,9 @@ export declare interface ExhibitThemeOptions extends ThemeOptions {
693
719
  components?: ExhibitComponents;
694
720
  }
695
721
 
696
- export declare const ExhibitTooltip: default_2.FC<ExhibitTooltipProps>;
722
+ export declare const ExhibitTooltip: default_2.FC<ExhibitTooltipProps & {
723
+ ref?: any;
724
+ }>;
697
725
 
698
726
  export declare interface ExhibitTooltipProps extends Omit<TooltipProps, "title"> {
699
727
  title?: string | default_2.ReactNode;
@@ -934,7 +962,9 @@ export declare interface LazyWindowOptions extends UseModalOptions {
934
962
  disableAutoDestroy?: boolean;
935
963
  }
936
964
 
937
- export declare const LoadingPanel: default_2.FC<LoadingPanelProps>;
965
+ export declare const LoadingPanel: default_2.FC<LoadingPanelProps & {
966
+ ref?: any;
967
+ }>;
938
968
 
939
969
  export declare interface LoadingPanelProps extends BoxProps {
940
970
  icon?: default_2.ReactNode;
@@ -961,7 +991,9 @@ export declare const MergeVerticalIcon: (props: SvgIconProps) => JSX.Element;
961
991
 
962
992
  export { ModalProvider }
963
993
 
964
- export declare const NestingPopupButton: default_2.FC<NestingPopupButtonProps>;
994
+ export declare const NestingPopupButton: default_2.FC<NestingPopupButtonProps & {
995
+ ref?: any;
996
+ }>;
965
997
 
966
998
  export declare interface NestingPopupButtonProps extends ExhibitPopupButtonProps {
967
999
  nestedChildren?: NestingPopupButtonProps[];
@@ -974,7 +1006,9 @@ export declare interface NestingPopupButtonProps extends ExhibitPopupButtonProps
974
1006
 
975
1007
  export declare const NewPresetStylesIcon: (props: SvgIconProps) => JSX.Element;
976
1008
 
977
- export declare const OptionsDialog: default_2.FC<OptionsDialogProps>;
1009
+ export declare const OptionsDialog: default_2.FC<OptionsDialogProps & {
1010
+ ref?: any;
1011
+ }>;
978
1012
 
979
1013
  export declare interface OptionsDialogProps extends OptionsNotificationOptions, InternalWindowProps {
980
1014
  }
@@ -1142,7 +1176,9 @@ export declare const ShowRowIcon: (props: SvgIconProps) => JSX.Element;
1142
1176
  /**
1143
1177
  * Simple Popup that takes a list of commands for a popup
1144
1178
  */
1145
- export declare const SimpleCommandPopupButton: default_2.FC<SimpleCommandPopupButtonProps>;
1179
+ export declare const SimpleCommandPopupButton: default_2.FC<SimpleCommandPopupButtonProps & {
1180
+ ref?: any;
1181
+ }>;
1146
1182
 
1147
1183
  export declare interface SimpleCommandPopupButtonProps extends CommandPopupButtonProps {
1148
1184
  /**
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.3.18
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),t=require("./cSO00cr9Gj7V4ZaU.cjs"),s=require("@mui/material"),T=require("@mui/system"),L=["Input"],N=n.memo(n.forwardRef((y,$)=>{const{initialValue:v="",onOption:w,onValidateOption:u,onInputOption:c,onValidateInputOption:p,onDone:d,inputProps:g,inputLabel:F,inputType:S,inputPlaceHolder:P,options:h=L,autoFocusSel:b=".autoFocus",cancelOption:m,defaultOption:f=h?.[0],...C}=y,[I,j]=n.useState(!1),[a,q]=n.useState(v),[k,D]=n.useState(""),[V,B]=n.useState(!0),i=t.T(async(e,o)=>{if(!p)return!0;const r=await p?.(e,o);D(r?.message??"");const O=r?.valid??!0;return B(O),O},[p]),x=t.T(async e=>{c?.(a,e)},[a,c,d,w,m,f]),M=t.T(async e=>{e.keyCode===t.eo.Enter&&await i?.(a,null)},[a,x]),A=t.T(e=>{q(e.target.value),i?.(e.target.value,null)},[u]),H=t.T(async e=>{let o=await i(a,e);try{o!==!1&&(o=await i(a,e))}catch{}return o??!0},[a,u]);return l.jsx(t.OptionsDialog,{options:h,onDone:d,onOption:(e,o)=>{o||x(e)},onValidateOption:H,cancelOption:m,defaultOption:f,autoFocusSel:b,...C,children:l.jsx(s.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0)},children:l.jsx(s.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:l.jsx(s.TextField,{onFocus:e=>{I||e.target?.select(),j(!0)},type:S,label:F,helperText:k||" ",sx:{width:"100%","& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5),color:V?void 0:"error.main"}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{placeholder:P,spellCheck:!1,autoComplete:"off",...g,className:t.clsx("autoFocus",g?.className),sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${T.alpha("#fff",t.getOverlayAlpha(5))}, ${T.alpha("#fff",t.getOverlayAlpha(5))})`}}},value:a,onChange:A,onKeyDown:M,onContextMenu:e=>{e.stopPropagation()}})})})})}));exports.default=N;
@@ -1,43 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { memo as j, forwardRef as z, useState as p } from "react";
3
- import { T as t, e as E, O as K, c as R, g as O } from "./GExU1ihv051uaJmR.mjs";
4
- import { Box as W, FormControl as q, TextField as A } from "@mui/material";
5
- import { alpha as y } from "@mui/system";
6
- /**
7
- * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.3.18
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- */
12
- const G = ["Input"], _ = j(z((T, J) => {
13
- const { initialValue: w = "", onOption: F, onValidateOption: l, onInputOption: c, onValidateInputOption: s, onDone: u, inputProps: d, inputLabel: C, inputType: I, inputPlaceHolder: P, options: m = G, autoFocusSel: v = ".autoFocus", cancelOption: g, defaultOption: f = m?.[0], ...b } = T, [k, V] = p(!1), [a, B] = p(w), [D, S] = p(""), [H, L] = p(!0), e = t(async (o, n) => {
14
- if (!s) return !0;
15
- const r = await s?.(o, n);
16
- S(r?.message ?? "");
17
- const x = r?.valid ?? !0;
18
- return L(x), x;
19
- }, [s]), h = t(async (o) => {
20
- c?.(a, o);
21
- }, [a, c, u, F, g, f]), M = t(async (o) => {
22
- o.keyCode === E.Enter && await e?.(a, null);
23
- }, [a, h]), N = t((o) => {
24
- B(o.target.value), e?.(o.target.value, null);
25
- }, [l]), $ = t(async (o) => {
26
- let n = await e(a, o);
27
- try {
28
- n !== !1 && (n = await e(a, o));
29
- } catch {
30
- }
31
- return n ?? !0;
32
- }, [a, l]);
33
- return i(K, { options: m, onDone: u, onOption: (o, n) => {
34
- n || h(o);
35
- }, onValidateOption: $, cancelOption: g, defaultOption: f, autoFocusSel: v, ...b, children: i(W, { sx: { paddingTop: (o) => o.spacing(1), paddingBottom: (o) => o.spacing(0) }, children: i(q, { sx: { paddingTop: (o) => o.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: i(A, { onFocus: (o) => {
36
- k || o.target?.select(), V(!0);
37
- }, type: I, label: C, helperText: D || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (o) => o.spacing(0.5), color: H ? void 0 : "error.main" } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { placeholder: P, spellCheck: !1, autoComplete: "off", ...d, className: R("autoFocus", d?.className), sx: { paddingTop: (o) => o.spacing(1.25), paddingBottom: (o) => o.spacing(0.75), backgroundImage: `linear-gradient(${y("#fff", O(5))}, ${y("#fff", O(5))})` } } }, value: a, onChange: N, onKeyDown: M, onContextMenu: (o) => {
38
- o.stopPropagation();
39
- } }) }) }) });
40
- }));
41
- export {
42
- _ as default
43
- };