-
Notifications
You must be signed in to change notification settings - Fork 0
/
7766.27cfead6.iframe.bundle.js
1 lines (1 loc) · 26.7 KB
/
7766.27cfead6.iframe.bundle.js
1
"use strict";(self.webpackChunkstorybook=self.webpackChunkstorybook||[]).push([[7766],{"../../packages/common-mui/src/dialogs/InternalWindow.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>InternalWindow,h:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/react/index.js"),react_dom__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/react-dom/index.js"),clsx__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("../../node_modules/clsx/dist/clsx.mjs"),react_merge_refs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("../../node_modules/react-merge-refs/dist/index.mjs"),focus_trap_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("../../node_modules/focus-trap-react/dist/focus-trap-react.js"),focus_trap_react__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(focus_trap_react__WEBPACK_IMPORTED_MODULE_2__),react_use_esm_useMeasure__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("../../node_modules/react-use/esm/useMeasure.js"),_mui_system__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("../../node_modules/@mui/system/esm/colorManipulator.js"),_mui_material_styles__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("../../node_modules/@mui/material/styles/useThemeProps.js"),_mui_material_styles__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("../../node_modules/@mui/material/styles/useTheme.js"),_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("../../node_modules/@mui/material/Box/Box.js"),_mui_material_Fade__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("../../node_modules/@mui/material/Fade/Fade.js"),_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("../../node_modules/@mui/material/DialogTitle/DialogTitle.js"),_mui_material_Backdrop__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("../../node_modules/@mui/material/Backdrop/Backdrop.js"),_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("../../node_modules/@mui/material/IconButton/IconButton.js"),_mui_material_Paper__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("../../node_modules/@mui/material/Paper/Paper.js"),_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("../../node_modules/@mui/icons-material/Close.js"),react_draggable__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("../../node_modules/react-draggable/build/cjs/cjs.js"),react_draggable__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(react_draggable__WEBPACK_IMPORTED_MODULE_3__),_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("../../packages/common-react/src/hooks/useCallbackRef.ts"),_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("../../packages/common-react/src/hooks/useImperativeHandleElement.ts"),_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("../../packages/common-react/src/types/types.ts"),_button__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("../../packages/common-mui/src/button/ExhibitTooltip.tsx"),_theming__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("../../packages/common-mui/src/theming/ScrollbarTheming.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("../../node_modules/react/jsx-runtime.js");const ZERO_POINT={x:0,y:0},DraggablePaperComponent=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(((props,refForwarded)=>{const{defaultPosition=ZERO_POINT,PaperComponent=_mui_material_Paper__WEBPACK_IMPORTED_MODULE_5__.A,onDragStop,rootSel:_rootSel=".MuiModal-root",handleSel=".draggable-title",titleSize,rootSize,...rest}=props,refLocal=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),dragBounds=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>titleSize&&rootSize?{left:0,top:0,right:rootSize.width-titleSize.width,bottom:rootSize.height-titleSize.height}:null),[titleSize,rootSize]),[position,setPosition]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[boundedPosition,setBoundedPosition]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)((()=>{!position&&defaultPosition&&setPosition(defaultPosition??ZERO_POINT)}),[defaultPosition]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{dragBounds&&position&&setBoundedPosition({x:Math.max(0,Math.min(position.x,dragBounds.right)),y:Math.max(0,Math.min(position.y,dragBounds.bottom))})}),[position,dragBounds]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_draggable__WEBPACK_IMPORTED_MODULE_3___default(),{nodeRef:refLocal,handle:handleSel,cancel:'[class*="MuiDialogContent-root"]',position:boundedPosition,bounds:dragBounds??".MuiModal-root",onStop:onDragStop,onDrag:(e,data)=>{setPosition({x:data.x,y:data.y})},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(PaperComponent,{ref:(0,react_merge_refs__WEBPACK_IMPORTED_MODULE_6__.P)([refLocal,refForwarded]),...rest})})}))),DEFAULT_POSITION={x:"50",y:"50"},InternalWindow=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)((inProps=>{const props=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_7__.A)({props:inProps,name:"MuiDialog"}),theme=(0,_mui_material_styles__WEBPACK_IMPORTED_MODULE_8__.A)(),defaultTransitionDuration={enter:.66*theme.transitions.duration.enteringScreen,exit:.66*theme.transitions.duration.leavingScreen},{title="SheetXL",key="draggable-window",onCancel,onDone,onShow,onHide,refWindow,open,autoFocusSel,children,TransitionComponent=_mui_material_Fade__WEBPACK_IMPORTED_MODULE_9__.A,TransitionProps:propTransitionProps,transitionDuration=defaultTransitionDuration,BackdropComponent=_mui_material_Backdrop__WEBPACK_IMPORTED_MODULE_10__.A,BackdropProps:propBackdropProps,PaperComponent=_mui_material_Paper__WEBPACK_IMPORTED_MODULE_5__.A,PaperProps:propPaperProps,onBackdropClick,sx:propSx,className:propClassName,onMouseDown:propOnMouseDown,initialPosition:propInitialPosition=DEFAULT_POSITION,isModal=!1,...rest}=props,refFocusTrap=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(),[initialPosition,setInitialPosition]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[visible,setVisible]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[active,setActive]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),refRipple=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),[refRootMeasure,rootRect]=(0,react_use_esm_useMeasure__WEBPACK_IMPORTED_MODULE_11__.A)(),refWindowLocal=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(),[refTitleMeasure,titleRect]=(0,react_use_esm_useMeasure__WEBPACK_IMPORTED_MODULE_11__.A)(),refPaperComponent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{initialPosition&&setVisible(open)}),[open,initialPosition]);const handleCancel=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_12__.c)((()=>{onCancel?.(),setVisible(!1)}),[onCancel]);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{if(0===rootRect.width&&0===rootRect.height||initialPosition)return;const paperBounds=refPaperComponent.current?.getBoundingClientRect(),remainingHeight=rootRect.height-paperBounds.height,remainingWidth=rootRect.width-paperBounds.width;let x=.5*remainingWidth,y=.5*remainingHeight;"number"==typeof propInitialPosition?.x?x=propInitialPosition.x:"string"==typeof propInitialPosition?.x&&(x=remainingWidth*(parseFloat(propInitialPosition.x)/100)),"number"==typeof propInitialPosition?.y?y=propInitialPosition.y:"string"==typeof propInitialPosition?.y&&(y=remainingHeight*(parseFloat(propInitialPosition.y)/100)),setInitialPosition({x,y})}),[rootRect,titleRect]);const[hasFocus,setHasFocus]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[lastFocus,setLastFocus]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[relatedFocus,setRelatedFocus]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),autoFocus=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((options=>{if(lastFocus)return lastFocus.focus(options),!0;if(autoFocusSel){const autoFocus=refWindowLocal.current?.querySelectorAll?.(autoFocusSel);if(autoFocus&&autoFocus.length>0)return autoFocus[0]?.focus?.(options),!0}return refWindowLocal.current?.focus?.(options),!1}),[lastFocus,autoFocusSel]),refLocal=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_13__.c)(refWindow,(()=>({focus:options=>{autoFocus(options)}})),[]),transitionProps={...propTransitionProps,onExited:node=>{onDone?.(null),propTransitionProps?.onExited?.(node)},onExit:node=>{const closureRelatedFocus=relatedFocus;closureRelatedFocus&&requestAnimationFrame((()=>{refLocal.current?.contains(document.activeElement)&&closureRelatedFocus.focus()})),onHide?.(),setActive(!1),propTransitionProps?.onExit?.(node)},onEntered:(node,isAppearing)=>{onShow?.(),propTransitionProps?.onEntered?.(node,isAppearing)},onEntering:(_node,_isAppearing)=>{setActive(!0)}};(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{active&&autoFocus()}),[active]);const elemWindow=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(focus_trap_react__WEBPACK_IMPORTED_MODULE_2___default(),{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:refFocusTrap,active,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(TransitionComponent,{in:visible,timeout:transitionDuration,role:"presentation",...transitionProps,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.A,{className:"MuiDialog-container",ref:refWindowLocal,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:e=>{e.which===_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_15__.cK.Escape&&(handleCancel(),refRipple.current?.start(e,{center:!1}),setTimeout((()=>refRipple.current?.stop(e)),180))},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(DraggablePaperComponent,{className:(0,clsx__WEBPACK_IMPORTED_MODULE_16__.A)({"Mui-focusVisible":hasFocus},propClassName),sx:{"& *":theme=>(0,_theming__WEBPACK_IMPORTED_MODULE_17__.F)(theme),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:theme=>`solid ${(0,_mui_system__WEBPACK_IMPORTED_MODULE_18__.X4)(theme.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:theme=>`solid ${(0,_mui_system__WEBPACK_IMPORTED_MODULE_18__.X4)(theme.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",...propSx},defaultPosition:initialPosition,ref:refPaperComponent,titleSize:titleRect,rootSize:rootRect,PaperComponent,...rest,...propPaperProps,children:[title?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_DialogTitle__WEBPACK_IMPORTED_MODULE_19__.A,{className:(0,clsx__WEBPACK_IMPORTED_MODULE_16__.A)({"Mui-selected":hasFocus},"draggable-title"),sx:{cursor:"move",display:"flex",color:theme=>theme.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:theme=>`${theme.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:theme=>theme.transitions.duration.shortest/2+"ms"},backgroundColor:theme=>(0,_mui_system__WEBPACK_IMPORTED_MODULE_18__.X4)(theme.palette.action.hover,.03)},ref:refTitleMeasure,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.A,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:theme=>theme.spacing(1),marginLeft:theme=>theme.spacing(1),marginRight:theme=>theme.spacing(1)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.A,{sx:{flex:"1 1 100%",paddingLeft:theme=>theme.spacing(1)},children:title}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_button__WEBPACK_IMPORTED_MODULE_20__.lA,{label:"Close",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_21__.A,{"aria-label":"close",sx:{color:theme=>theme.palette.text.icon??theme.palette.action.active},touchRippleRef:refRipple,onPointerDown:e=>{refRipple.current?.start(e,{center:!1}),e.stopPropagation(),e.preventDefault()},onPointerUp:handleCancel,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_22__.A,{})})})]})}):null,children]})})})});let backdrop=null;return isModal&&(backdrop=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BackdropComponent,{...propBackdropProps,open:visible,onMouseDown:e=>{handleCancel(),propBackdropProps?.onMouseDown?.(e)},onClick:e=>{onBackdropClick?.(e),propBackdropProps?.onClick?.(e)},sx:{pointerEvents:"auto",...propBackdropProps?.sx}})),(0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.A,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:(0,react_merge_refs__WEBPACK_IMPORTED_MODULE_6__.P)([refLocal,refRootMeasure]),onMouseDown:e=>{hasFocus&&(e.target===refWindowLocal.current||e.target.tabIndex<0)&&refWindowLocal.current?.contains(document.activeElement)&&e.preventDefault()},onContextMenu:e=>{e.isPropagationStopped()||e.preventDefault()},onFocus:e=>{!hasFocus&&(e.target===refWindowLocal.current||e.target.tabIndex<0)&&setTimeout((()=>{autoFocus()}),100),refFocusTrap.current?.focusTrap?.unpause(),setHasFocus(!0),refWindowLocal.current?.contains(e.target)&&e.target!==refWindowLocal.current&&setLastFocus(e.target),e.relatedTarget&&!relatedFocus&&setRelatedFocus(e.relatedTarget)},onBlur:e=>{refLocal?.current?.contains(e.relatedTarget)||(setRelatedFocus(null),refFocusTrap.current?.focusTrap?.pause(),setHasFocus(!1))},children:[backdrop,elemWindow]}),document.body,key+"")})),__WEBPACK_DEFAULT_EXPORT__=InternalWindow;try{InternalWindow.displayName="InternalWindow",InternalWindow.__docgenInfo={description:"",displayName:"InternalWindow",props:{open:{defaultValue:null,description:"",name:"open",required:!1,type:{name:"boolean"}},title:{defaultValue:null,description:"The dialog title",name:"title",required:!1,type:{name:"string"}},autoFocusSel:{defaultValue:null,description:"Query selector for the element to focus on show.\n@remarks It would be better to honor autoFocus attribute but React is 'hiding' it",name:"autoFocusSel",required:!1,type:{name:"string"}},onCancel:{defaultValue:null,description:"",name:"onCancel",required:!1,type:{name:"() => void"}},onDone:{defaultValue:null,description:"",name:"onDone",required:!1,type:{name:"(results?: any) => void"}},onShow:{defaultValue:null,description:"",name:"onShow",required:!1,type:{name:"() => void"}},onHide:{defaultValue:null,description:"",name:"onHide",required:!1,type:{name:"() => void"}},refWindow:{defaultValue:null,description:"We couldn't use the forwardRef? Revisit this.\nIt seemed to be due to the createPortal returns a ReactPortal not an HTMLElement",name:"refWindow",required:!1,type:{name:"Ref<InternalWindowElement>"}},isModal:{defaultValue:null,description:"If true this will show a backdrop\n@remarks Our floating menu achieve modality without a background by listens to global clicks (and focus)\n@defaultValue false",name:"isModal",required:!1,type:{name:"boolean"}},initialPosition:{defaultValue:null,description:"A default position for the window. The default is center at %50, %50.",name:"initialPosition",required:!1,type:{name:"RelativePoint"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"Ref<HTMLDivElement>"}},component:{defaultValue:null,description:"",name:"component",required:!1,type:{name:"ElementType<any, keyof IntrinsicElements>"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["../../packages/common-mui/src/dialogs/InternalWindow.tsx#InternalWindow"]={docgenInfo:InternalWindow.__docgenInfo,name:"InternalWindow",path:"../../packages/common-mui/src/dialogs/InternalWindow.tsx#InternalWindow"})}catch(__react_docgen_typescript_loader_error){}},"../../packages/sheet-mui/src/dialogs/TableDetailsWindow.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{TableDetailsWindow:()=>TableDetailsWindow,default:()=>dialogs_TableDetailsWindow});var react=__webpack_require__("../../node_modules/react/index.js"),useMeasure=__webpack_require__("../../node_modules/react-use/esm/useMeasure.js"),colorManipulator=__webpack_require__("../../node_modules/@mui/system/esm/colorManipulator.js"),getOverlayAlpha=__webpack_require__("../../node_modules/@mui/material/styles/getOverlayAlpha.js"),DialogContent=__webpack_require__("../../node_modules/@mui/material/DialogContent/DialogContent.js"),Box=__webpack_require__("../../node_modules/@mui/material/Box/Box.js"),TextField=__webpack_require__("../../node_modules/@mui/material/TextField/TextField.js"),InternalWindow=__webpack_require__("../../packages/common-mui/src/dialogs/InternalWindow.tsx"),ExhibitDivider=__webpack_require__("../../packages/common-mui/src/components/ExhibitDivider.tsx");const useTableListener=(model,listener,options)=>{const listenerRef=(0,react.useRef)(listener);listenerRef.current=listener;const fireOnModelChange=options?.fireOnModelChange??!0;(0,react.useEffect)((()=>{if(!model||!listenerRef.current)return;const stableListener={onTableChange(model){listenerRef.current?.onTableChange?.(model)},onClose(model){listenerRef.current?.onClose?.(model)}},remover=model.addListener(stableListener);return fireOnModelChange&&(stableListener.onTableChange(model),stableListener.onClose(model)),()=>{remover?.()}}),[model])};var Checkbox=__webpack_require__("../../node_modules/@mui/material/Checkbox/Checkbox.js"),FormControlLabel=__webpack_require__("../../node_modules/@mui/material/FormControlLabel/FormControlLabel.js"),jsx_runtime=__webpack_require__("../../node_modules/react/jsx-runtime.js");const TableStyleOptionsPanel=(0,react.memo)((0,react.forwardRef)(((props,refForwarded)=>{const{styleInfo,onStyleInfoChange,showHeaderRow,onShowHeaderRowChange,showTotalRow,onShowTotalRowChange,showFilterButton,onShowFilterButtonChange,sx:propSX,...rest}=props;return(0,jsx_runtime.jsxs)(Box.A,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:theme=>`${theme.spacing(2)}`,marginRight:theme=>`${theme.spacing(2)}`},"& .MuiCheckbox-root":{padding:theme=>`${theme.spacing(.5)}`},...propSX},...rest,ref:refForwarded,children:[onShowHeaderRowChange&&(0,jsx_runtime.jsx)(FormControlLabel.A,{control:(0,jsx_runtime.jsx)(Checkbox.A,{checked:showHeaderRow,onChange:()=>onShowHeaderRowChange(!showHeaderRow)}),label:"Header Row",labelPlacement:"end"}),onShowTotalRowChange&&(0,jsx_runtime.jsx)(FormControlLabel.A,{control:(0,jsx_runtime.jsx)(Checkbox.A,{checked:showTotalRow,onChange:()=>onShowTotalRowChange(!showTotalRow)}),label:"Total Row",labelPlacement:"end"}),(0,jsx_runtime.jsx)(FormControlLabel.A,{control:(0,jsx_runtime.jsx)(Checkbox.A,{checked:styleInfo?.showRowStripes,onChange:()=>{onStyleInfoChange?.({...styleInfo,showRowStripes:!styleInfo?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),(0,jsx_runtime.jsx)(FormControlLabel.A,{control:(0,jsx_runtime.jsx)(Checkbox.A,{checked:styleInfo?.showFirstColumn,onChange:()=>{onStyleInfoChange?.({...styleInfo,showFirstColumn:!styleInfo?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),(0,jsx_runtime.jsx)(FormControlLabel.A,{control:(0,jsx_runtime.jsx)(Checkbox.A,{checked:styleInfo?.showLastColumn,onChange:()=>{onStyleInfoChange?.({...styleInfo,showLastColumn:!styleInfo?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),(0,jsx_runtime.jsx)(FormControlLabel.A,{control:(0,jsx_runtime.jsx)(Checkbox.A,{checked:styleInfo?.showColumnStripes,onChange:()=>{onStyleInfoChange?.({...styleInfo,showColumnStripes:!styleInfo?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),onShowFilterButtonChange&&(0,jsx_runtime.jsx)(FormControlLabel.A,{control:(0,jsx_runtime.jsx)(Checkbox.A,{checked:showFilterButton,onChange:()=>onShowFilterButtonChange(!showFilterButton)}),label:"Filter Button",labelPlacement:"end"})]})})));try{TableStyleOptionsPanel.displayName="TableStyleOptionsPanel",TableStyleOptionsPanel.__docgenInfo={description:"Shows options with tables.\nTODO - We will later also have the options as commands.",displayName:"TableStyleOptionsPanel",props:{sx:{defaultValue:null,description:"MUI SX props\n@see {@link https://mui.com/system/getting-started/the-sx-prop/}",name:"sx",required:!1,type:{name:"SxProps<Theme>"}},styleInfo:{defaultValue:null,description:"",name:"styleInfo",required:!0,type:{name:"TableStyleInfo"}},showHeaderRow:{defaultValue:null,description:"",name:"showHeaderRow",required:!1,type:{name:"boolean"}},showTotalRow:{defaultValue:null,description:"",name:"showTotalRow",required:!1,type:{name:"boolean"}},showFilterButton:{defaultValue:null,description:"",name:"showFilterButton",required:!1,type:{name:"boolean"}},onStyleInfoChange:{defaultValue:null,description:"",name:"onStyleInfoChange",required:!1,type:{name:"(styleInfo: TableStyleInfo) => void"}},onShowHeaderRowChange:{defaultValue:null,description:"",name:"onShowHeaderRowChange",required:!1,type:{name:"(showHeaderRow: boolean) => void"}},onShowTotalRowChange:{defaultValue:null,description:"",name:"onShowTotalRowChange",required:!1,type:{name:"(showTotalRow: boolean) => void"}},onShowFilterButtonChange:{defaultValue:null,description:"",name:"onShowFilterButtonChange",required:!1,type:{name:"(showFilterButton: boolean) => void"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"Ref<TableStyleOptionsElement>"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["../../packages/sheet-mui/src/components/table/TableStyleOptionsPanel.tsx#TableStyleOptionsPanel"]={docgenInfo:TableStyleOptionsPanel.__docgenInfo,name:"TableStyleOptionsPanel",path:"../../packages/sheet-mui/src/components/table/TableStyleOptionsPanel.tsx#TableStyleOptionsPanel"})}catch(__react_docgen_typescript_loader_error){}const TableDetailsWindow=(0,react.memo)((props=>{const{title:propTitle,onHide:propOnHide,table:propTable,...rest}=props,refFindText=(0,react.useRef)(),[hasFocus,setHasFocus]=(0,react.useState)(!1),refWindow=(0,react.useRef)(null),[_,forceRender]=(0,react.useReducer)((s=>s+1),0),[refContentMeasure,{width:contentWidth}]=(0,useMeasure.A)();return useTableListener(propTable,{onTableChange(_model){forceRender()}}),propTable?(0,jsx_runtime.jsx)(InternalWindow.A,{title:propTitle??"Table Details",initialPosition:{y:"35"},autoFocusSel:".input",refWindow,onHide:propOnHide,onFocus:()=>setHasFocus(!0),onBlur:()=>{setHasFocus(!1)},PaperProps:{elevation:hasFocus?3:1},...rest,children:(0,jsx_runtime.jsxs)(DialogContent.A,{dividers:!0,ref:refContentMeasure,sx:{display:"flex",flexDirection:"column",paddingLeft:theme=>theme.spacing(1.5),paddingRight:theme=>theme.spacing(1.5)},onKeyDown:e=>{e.preventDefault()},children:[(0,jsx_runtime.jsx)(Box.A,{sx:{display:"flex",flexDirection:"row",gap:theme=>theme.spacing(1)},children:(0,jsx_runtime.jsx)(Box.A,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box",paddingLeft:theme=>theme.spacing(2),paddingRight:theme=>theme.spacing(2)},children:(0,jsx_runtime.jsx)(Box.A,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:(0,jsx_runtime.jsx)(TextField.A,{label:"Range",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:theme=>theme.spacing(1),minWidth:contentWidth>420?"20em":void 0,backgroundImage:`linear-gradient(${(0,colorManipulator.X4)("#fff",parseFloat((0,getOverlayAlpha.A)(5)))}, ${(0,colorManipulator.X4)("#fff",parseFloat((0,getOverlayAlpha.A)(5)))})`},inputProps:{ref:refFindText,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:theme=>theme.spacing(1.25),paddingBottom:theme=>theme.spacing(.75)}}},sx:{flex:"1 1 100%",marginTop:theme=>theme.spacing(.75)},onContextMenu:e=>{e.stopPropagation()}})})})}),(0,jsx_runtime.jsxs)(Box.A,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:theme=>theme.spacing(.5),marginTop:theme=>theme.spacing(1)},children:[(0,jsx_runtime.jsx)(ExhibitDivider.b,{orientation:"horizontal",sx:{marginTop:theme=>theme.spacing(1.5),marginBottom:theme=>theme.spacing(.75)}}),(0,jsx_runtime.jsx)(TableStyleOptionsPanel,{styleInfo:propTable.styleInfo,onStyleInfoChange:styleInfo=>{propTable.update({styleInfo})},showHeaderRow:propTable.headerRowCount>=1,onShowHeaderRowChange:showHeaderRow=>{propTable.update({headerRowCount:showHeaderRow?1:0})},showTotalRow:propTable.totalsRowCount>=1,onShowTotalRowChange:showTotalRow=>{propTable.update({totalsRowCount:showTotalRow?1:0})}})]})]})}):null})),dialogs_TableDetailsWindow=TableDetailsWindow;try{TableDetailsWindow.displayName="TableDetailsWindow",TableDetailsWindow.__docgenInfo={description:"TODO\n- save last searches (up/down arrow to navigate) (in preferences/workbook?)\n- later add indexing so we can do real-time search and count",displayName:"TableDetailsWindow",props:{table:{defaultValue:null,description:"",name:"table",required:!1,type:{name:"ITableModel"}},open:{defaultValue:null,description:"",name:"open",required:!1,type:{name:"boolean"}},title:{defaultValue:null,description:"The dialog title",name:"title",required:!1,type:{name:"string"}},autoFocusSel:{defaultValue:null,description:"Query selector for the element to focus on show.\n@remarks It would be better to honor autoFocus attribute but React is 'hiding' it",name:"autoFocusSel",required:!1,type:{name:"string"}},onCancel:{defaultValue:null,description:"",name:"onCancel",required:!1,type:{name:"() => void"}},onDone:{defaultValue:null,description:"",name:"onDone",required:!1,type:{name:"(results?: any) => void"}},onShow:{defaultValue:null,description:"",name:"onShow",required:!1,type:{name:"() => void"}},onHide:{defaultValue:null,description:"",name:"onHide",required:!1,type:{name:"() => void"}},refWindow:{defaultValue:null,description:"We couldn't use the forwardRef? Revisit this.\nIt seemed to be due to the createPortal returns a ReactPortal not an HTMLElement",name:"refWindow",required:!1,type:{name:"Ref<InternalWindowElement>"}},isModal:{defaultValue:null,description:"If true this will show a backdrop\n@remarks Our floating menu achieve modality without a background by listens to global clicks (and focus)\n@defaultValue false",name:"isModal",required:!1,type:{name:"boolean"}},initialPosition:{defaultValue:null,description:"A default position for the window. The default is center at %50, %50.",name:"initialPosition",required:!1,type:{name:"RelativePoint"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"Ref<HTMLDivElement>"}},component:{defaultValue:null,description:"",name:"component",required:!1,type:{name:"ElementType<any, keyof IntrinsicElements>"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["../../packages/sheet-mui/src/dialogs/TableDetailsWindow.tsx#TableDetailsWindow"]={docgenInfo:TableDetailsWindow.__docgenInfo,name:"TableDetailsWindow",path:"../../packages/sheet-mui/src/dialogs/TableDetailsWindow.tsx#TableDetailsWindow"})}catch(__react_docgen_typescript_loader_error){}}}]);