-
Notifications
You must be signed in to change notification settings - Fork 0
/
8674.c550edd8.iframe.bundle.js
1 lines (1 loc) · 21.7 KB
/
8674.c550edd8.iframe.bundle.js
1
"use strict";(self.webpackChunkstorybook=self.webpackChunkstorybook||[]).push([[8674],{"../../packages/grid/src/CellEditor.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{o:()=>STANDARD_KEY_CHARS});const STANDARD_KEY_CHARS="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ~`!@#$%^&*()-_=+[{]};:'\",<.>/?|\\"},"../../packages/grid/src/hooks/useKeyboardEditorOverlay.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>useKeyboardEditorOverlay});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/react/index.js"),_sheetxl_common__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("../../packages/common/src/utils/CommonUtils.ts"),_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("../../packages/common-react/src/utils/ReactUtils.ts"),_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("../../packages/common-react/src/types/types.ts"),_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("../../packages/common-react/src/hooks/useCallbackRef.ts"),_utils_RangeUtils__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("../../packages/grid/src/utils/RangeUtils.ts"),_CellEditor__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("../../packages/grid/src/CellEditor.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/react/jsx-runtime.js");const eventToPrintable=event=>{if(!event)return null;if("start"===event.eventType)return{type:event.eventType};if("submit"===event.eventType)return{type:event.eventType};if("cancel"===event.eventType)return{type:event.eventType};if("keyboard"===event.eventType)return{type:event.eventType,key:event.event.key};if("pointer"===event.eventType)return{type:event.eventType};if("coordsChange"===event.eventType){const retValue={type:event.eventType};return event.activeCoords&&(retValue.activeCoords=event.activeCoords),retValue}return{type:event.eventType??"unknown"}},defaultCanEdit=_cellCoords=>!0,defaultIsEditorStartKeyEvent=e=>!!e&&(!(e.ctrlKey||e.metaKey||e.altKey||e.isComposing)&&(!(e.shiftKey||"F2"!==e.key&&" "!==e.key&&"Backspace"!==e.key)||(!e.shiftKey||" "!==e.key)&&-1!==_CellEditor__WEBPACK_IMPORTED_MODULE_2__.o.indexOf(e.key))),defaultIsEditorStartPointerEvent=event=>!!event&&("dblclick"===event.type&&{editMode:!0}),EditorContainer=props=>{const{session,refLatestCoords,handleSubmitEdit,handleCancelEdit,cellBounds,isInBounds,getCellEditor,propsEditor,borderStrokeFill="rgb(33, 115, 70)",borderStrokeWidth=2,style:propStyle,...rest}=props,refLocal=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),refEditor=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),[isContainerMounted,setContainerMounted]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),sessionCoords=session.coords,processEditorEvent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((async kbe=>{const boundsSelf=refLocal.current?.getBoundingClientRect();if(boundsSelf){if("keyboard"===kbe.eventType){const e=kbe.event,newEvent=new KeyboardEvent(e.type,{bubbles:!0,cancelable:!0,view:window,key:e.key,code:e.code,location:e.location,repeat:e.repeat,isComposing:e.isComposing,charCode:e.charCode,keyCode:e.keyCode,which:e.which,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey});newEvent.isSynthetic=!0,newEvent.key,refEditor.current?.dispatchEvent(newEvent)}else"pointer"===kbe.eventType||console.warn("unsupported event type",kbe);await new Promise((resolve=>requestAnimationFrame(resolve)))}}),[]);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const refSelf=refEditor.current;setContainerMounted(!0),refEditor.current.startEdit?.(session.startEvent);return(async()=>{session.editorRefs.push(refSelf),session.editorRefsDispatchEditorEvent.push(processEditorEvent);const events=[...session.events];for(let i=0;i<events.length;i++)await processEditorEvent(events[i]);session.onMount(refSelf)})(),()=>{const index=session.editorRefs.indexOf(refSelf);-1!==index&&session.editorRefs.splice(index,1),session.onUnmount(refSelf)}}),[]);const onSubmitEdit=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((()=>{handleSubmitEdit(session)}),[]),onCancelEdit=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((()=>{handleCancelEdit(session)}),[]),isCurrentEditor=refLatestCoords.current&&(0,_utils_RangeUtils__WEBPACK_IMPORTED_MODULE_3__.rv)(refLatestCoords.current,sessionCoords),shouldRender=isInBounds&&isCurrentEditor&&isContainerMounted,editor=getCellEditor({autoFocus:!!session.startEvent?.autoFocus,...propsEditor,onSubmitEdit,onCancelEdit,ref:refEditor},sessionCoords);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{tabIndex:0,ref:refLocal,style:{background:void 0,...propStyle,opacity:shouldRender?propStyle?.opacity??1:0,pointerEvents:"auto",position:"absolute",boxSizing:"border-box",left:`${cellBounds.x+_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(-borderStrokeWidth/2)}px`,top:`${cellBounds.y+_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(-borderStrokeWidth/2)}px`,width:_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(cellBounds.width+borderStrokeWidth/2,!0),height:_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(cellBounds.height+borderStrokeWidth/2,!0)},...rest,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{style:{position:"absolute",boxSizing:"border-box",left:`${_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(1)}px`,top:`${_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(1)}px`,width:_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(cellBounds.width-2,!0),height:_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_4__.zJ(cellBounds.height-2,!0),outline:`${borderStrokeWidth}px ${borderStrokeFill} solid`,boxShadow:"rgba(60,64,67,.35) 2px 2px 6px 3px",maxHeight:"100%",overflow:"hidden",display:"flex"},children:editor})})};EditorContainer.displayName="EditorContainer";const useKeyboardEditorOverlay=props=>{const{gridRef,activeCoords:propActiveCoords,canEdit:propCanEdit=defaultCanEdit,getCellEditor:propGetCellEditor,onBeforeStartEdit:propOnBeforeStartEdit,onStartEdit:propOnStartEdit,onSubmitEdit:propOnSubmitEdit,onCancelEdit:propOnCancelEdit,onDoneEdit:propOnDoneEdit,onNavigate,onNavigateSelection,isEditorStartKeyEvent=defaultIsEditorStartKeyEvent,isEditorStartPointerEvent=defaultIsEditorStartPointerEvent,containerProps,borderStrokeFill,borderStrokeWidth=2,getCellBoundsRange=null,alignment=_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_5__.OD.Left}=props,[isEditing,setIsEditing]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[editorNaturalSize,setEditorNaturalSize]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(void 0),recalcBounds=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)(((view,coords,width,height,getCellBoundsRange,alignment)=>{if(!coords)return null;const cellRange=getCellBoundsRange?.(coords,view)??gridRef.current.getCoordsAsRange(coords),rangeBounds=view.getCellRangeBounds(cellRange),cellBounds=rangeBounds;if(!view.clipBounds(rangeBounds))return null;width&&(width*=view.zoom),height&&(height*=view.zoom);let effectiveBounds=cellBounds,maxWidth=!1;if(void 0!==width){let measureRange={...cellRange};for(;!maxWidth&&effectiveBounds.width<=width;)alignment===_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_5__.OD.Left?measureRange.colEnd+1<gridRef.current.columnCount?measureRange.colEnd=view.cellLayout.getColIndex(effectiveBounds.x+width):maxWidth=!0:alignment===_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_5__.OD.Right?measureRange.colStart-1>=0?measureRange.colStart=view.cellLayout.getColIndex(effectiveBounds.x-(width-effectiveBounds.width)):maxWidth=!0:alignment===_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_5__.OD.Center&&measureRange.colEnd+1<gridRef.current.columnCount&&measureRange.colStart-1>=0?(measureRange.colStart=view.cellLayout.getColIndex(effectiveBounds.x-(width-effectiveBounds.width)/2),measureRange.colEnd=view.cellLayout.getColIndex(effectiveBounds.x+effectiveBounds.width+(width-effectiveBounds.width)/2)):maxWidth=!0,maxWidth||(effectiveBounds=view.getCellRangeBounds(measureRange))}effectiveBounds.height=cellBounds.height,void 0!==height&&(effectiveBounds.height=Math.max(height+1,cellBounds.height));const{containerWidth,containerHeight}=gridRef.current.getDimensions();return{x:effectiveBounds.x??0,y:effectiveBounds.y??0,height:Math.min(containerHeight-effectiveBounds.y,effectiveBounds.height)+1,width:Math.min(containerWidth-effectiveBounds.x,effectiveBounds.width)+1}}),[alignment,getCellBoundsRange]),canEdit=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)(propCanEdit,[propCanEdit]),focusGrid=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((()=>{gridRef.current?.focus()}),[]),handleBeforeStartEdit=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)((coords=>{propOnBeforeStartEdit?.(coords),dispatchEditorEvent(),setIsEditing(!0)}),[propOnBeforeStartEdit]),handleStartEdit=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)((session=>{propOnStartEdit?.(session.coords)}),[propOnStartEdit]),handleCancelEdit=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)((session=>{session.isSubmitted||session.isCancelled||(refSession.current.isEditorClosed=!0,focusGrid(),session.isCancelled=!0,propOnCancelEdit?.(session.coords),dispatchEditorEvent())}),[propOnCancelEdit]),handleSubmitEdit=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)((session=>{session.isSubmitted||session.isCancelled||(session.isEditorClosing=!0,session.isSubmitted=!0,session.isEditorSubmitted||(session.isEditorSubmitted=!0,session.editorRefs[0]?.submitEdit?.()),session.coords,propOnSubmitEdit?.(session.coords),session.isEditorClosed=!0,focusGrid(),dispatchEditorEvent())}),[propOnSubmitEdit]),handleDoneEdit=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)((session=>{setIsEditing(!1),propOnDoneEdit?.(session.coords),dispatchEditorEvent()}),[propOnDoneEdit]),refSession=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(),refActiveCoords=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),refLatestCoords=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),eventQueue=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]),[onProcessEditorEvent,processEditorEventQueue]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)((s=>s+1),0),dispatchEditorEvent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((e=>{e&&eventQueue.current.push(e),processEditorEventQueue()}),[]),handlePointerEvent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((event=>{const e=event.nativeEvent;if(e.defaultPrevented||e.isSynthetic)return;if(!gridRef.current)return;const coords=gridRef.current.getViewFromOffset(e.clientX,e.clientY)?.getCellCoordsFromOffset(e.clientX,e.clientY);if(!coords)return;dispatchEditorEvent({eventType:"pointer",event:e})}),[]),handleNativeKeyboardEvent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((e=>{if(e.defaultPrevented||e.isSynthetic)return;if(!gridRef.current)return;isEditorStartKeyEvent(e)&&(e.stopPropagation(),e.preventDefault()),e.key;dispatchEditorEvent({eventType:"keyboard",event:e})}),[]);(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)((()=>{const createSession=(coords,startEvent)=>{if(!coords)return null;let topLeftCoords=coords;if(gridRef.current){const range=gridRef.current.getCoordsAsRange(coords);topLeftCoords={rowIndex:range.rowStart,colIndex:range.colStart}}if(!canEdit(topLeftCoords))return null;handleBeforeStartEdit?.(topLeftCoords);const uuid=_sheetxl_common__WEBPACK_IMPORTED_MODULE_7__.QT(),session={coords:topLeftCoords,startEvent:startEvent=Object.freeze({autoFocus:!0,...startEvent}),uuid,isMounted:!1,isStarted:!1,isSubmitted:!1,isEditorSubmitted:!1,isEditorClosing:!1,isEditorClosed:!1,isCancelled:!1,events:[],editorRefsDispatchEditorEvent:[],editorRefs:[],onMount:_refEditor=>{session.isMounted||(session.isMounted=!0,dispatchEditorEvent())},onUnmount:_refEditor=>{if(0===session.editorRefs.length){const doDone=()=>{session.isMounted=!1,dispatchEditorEvent()};if(document.activeElement!==document.body)doDone();else{const detectKey=e=>{e.defaultPrevented||e.target!==document.body||handleNativeKeyboardEvent(e)};window.addEventListener("keydown",detectKey,!0),gridRef.current?.addEventListener("focusin",(()=>{window.removeEventListener("keydown",detectKey),doDone()}),{once:!0}),focusGrid()}}}};return session};if(eventQueue.current.length<=0&&!refSession.current)return;const kbe=eventQueue.current[0];eventToPrintable(kbe),(queue=>{const retValue=[];for(let i=0;i<queue.length;i++){const event=queue[i];retValue.push(eventToPrintable(event))}})(eventQueue.current),refSession.current,refSession.current;let originalSession=refSession.current;if(refSession.current)if(refSession.current.isDone)refSession.current=null;else if(refSession.current.isSubmitted||refSession.current.isCancelled){if(refSession.current.isMounted)return;refSession.current.isDone||(handleDoneEdit(refSession.current),refSession.current.isDone=!0)}if(kbe)if("start"===kbe.eventType){const event=kbe;refSession.current&&(0,_utils_RangeUtils__WEBPACK_IMPORTED_MODULE_3__.rv)(refSession.current.coords,refActiveCoords.current)||(refSession.current=createSession(refActiveCoords.current,event.startEvent))}else if("keyboard"===kbe.eventType){const event=kbe.event;if(refSession.current){event.key,refSession.current.events,refSession.current.events.push(kbe);for(let i=0;i<refSession.current.editorRefsDispatchEditorEvent.length;i++)refSession.current.editorRefsDispatchEditorEvent[i](kbe)}else{if(isEditorStartKeyEvent(event)){let startEvent;const sessionNew=createSession(refActiveCoords.current,startEvent);sessionNew&&sessionNew.events.push(kbe),refSession.current=sessionNew}}}else if("pointer"===kbe.eventType){const event=kbe.event;if(refSession.current){refSession.current.events.push(kbe);for(let i=0;i<refSession.current.editorRefsDispatchEditorEvent.length;i++)refSession.current.editorRefsDispatchEditorEvent[i](kbe)}else{if(isEditorStartPointerEvent(event)){let startEvent;const sessionNew=createSession(refActiveCoords.current,startEvent);sessionNew&&sessionNew.events.push(kbe),refSession.current=sessionNew}}}else if("submit"===kbe.eventType){if(refSession.current&&!refSession.current.isSubmitted&&!refSession.current.isCancelled){if(!refSession.current.isMounted)return;handleSubmitEdit(refSession.current)}}else if("cancel"===kbe.eventType){if(refSession.current&&!refSession.current.isSubmitted&&!refSession.current.isCancelled){if(!refSession.current.isMounted)return;handleCancelEdit(refSession.current)}}else if("coordsChange"===kbe.eventType){const event=kbe;if(refActiveCoords.current=event.activeCoords,refSession.current,refSession.current&&!refSession.current.isSubmitted&&!refSession.current.isCancelled){if(!refSession.current.isMounted)return;handleSubmitEdit(refSession.current)}}eventQueue.current.length>0&&(eventQueue.current.shift(),dispatchEditorEvent()),0===eventQueue.current.length&&(!refSession.current||refSession.current.isEditorClosing||refSession.current.isEditorClosed?!refSession.current&&originalSession&&focusGrid():refSession.current.isMounted&&!refSession.current.isStarted&&(refSession.current.isStarted=!0,refSession.current.startEvent.autoFocus&&("string"==typeof refSession.current.startEvent.autoFocus?refSession.current.editorRefs[0]?.autoFocus(refSession.current.startEvent.autoFocus):refSession.current.editorRefs[0]?.autoFocus()),handleStartEdit?.(refSession.current),requestAnimationFrame((()=>{gridRef.current&&refSession.current?.coords&&gridRef.current&&gridRef.current.scrollCellIntoView(refSession.current.coords)}))))}),[onProcessEditorEvent]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{refLatestCoords.current=propActiveCoords;const currentCoords=refSession.current?.coords;if(!(0,_utils_RangeUtils__WEBPACK_IMPORTED_MODULE_3__.rv)(currentCoords,propActiveCoords)){refSession.current&&(refSession.current.isEditorClosing=!0);dispatchEditorEvent({eventType:"coordsChange",activeCoords:propActiveCoords})}}),[propActiveCoords]);const handleKeyboardEvent=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((event=>{handleNativeKeyboardEvent(event.nativeEvent)}),[]),{width:naturalWidth=0,height:naturalHeight=0}=editorNaturalSize??{width:0,height:0},getCellEditorRef=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_6__.c)(propGetCellEditor,[propGetCellEditor]);return{overlay:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((view=>{if(!refSession.current||refSession.current.isEditorClosed)return refSession.current,null;refSession.current.coords;let cellBounds=recalcBounds(view,refSession.current.coords,naturalWidth,naturalHeight,getCellBoundsRange,alignment),isInBounds=!0;cellBounds&&0!==cellBounds.width&&0!==cellBounds.height||(cellBounds={x:0,y:0,width:naturalWidth,height:naturalWidth},isInBounds=!1);const propsEditor={containerBounds:{x:0,y:0,width:cellBounds.width/view.zoom,height:cellBounds.height/view.zoom},onNavigate,onNavigateSelection,setNaturalSize:setEditorNaturalSize,zoom:view.zoom};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(EditorContainer,{session:refSession.current,refLatestCoords,handleSubmitEdit,handleCancelEdit,cellBounds,borderStrokeWidth,borderStrokeFill,isInBounds,getCellEditor:getCellEditorRef,propsEditor,...containerProps},"editor:"+refSession.current.uuid)}),[propGetCellEditor,onProcessEditorEvent,naturalWidth,naturalHeight,getCellBoundsRange,alignment,borderStrokeWidth,borderStrokeFill]),startEdit:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((startEvent=>{dispatchEditorEvent({eventType:"start",startEvent})}),[]),submitEdit:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((()=>{dispatchEditorEvent({eventType:"submit"})}),[]),cancelEdit:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((()=>{dispatchEditorEvent({eventType:"cancel"})}),[]),onKeyboardEvent:handleKeyboardEvent,onPointerEvent:handlePointerEvent,isEditing}};try{useKeyboardEditorOverlay.displayName="useKeyboardEditorOverlay",useKeyboardEditorOverlay.__docgenInfo={description:"Hook to make enable inline 'keyboard editing'. Simple editing like checkboxes can be implemented as renderers",displayName:"useKeyboardEditorOverlay",props:{gridRef:{defaultValue:null,description:"Access grid methods",name:"gridRef",required:!0,type:{name:"MutableRefObject<GridElement>"}},activeCoords:{defaultValue:null,description:"Active selected cell. This is required to enable\nthe editor to activate when a key is pressed",name:"activeCoords",required:!0,type:{name:"CellCoords"}},getCellEditor:{defaultValue:null,description:"Inject custom editors based on a cell.\nThis should not return null but rather can canEdit.\nThis is called during placement after scrolling and other bookkeeping has occurred",name:"getCellEditor",required:!0,type:{name:"(props: CellEditorProps<any, any> & CellEditorRefAttribute, coords: CellCoords) => ReactElement<CellEditorProps<any, any> & CellEditorRefAttribute, string | JSXElementConstructor<...>>"}},canEdit:{defaultValue:null,description:"Callback fired before editing. Can be used to prevent editing.",name:"canEdit",required:!1,type:{name:"(coords: CellCoords) => boolean"}},onBeforeStartEdit:{defaultValue:null,description:"Callback when a start has been initialed. This is called before the editor is mounted.",name:"onBeforeStartEdit",required:!1,type:{name:"(coords: CellCoords) => void"}},onStartEdit:{defaultValue:null,description:"Callback when user start editing",name:"onStartEdit",required:!1,type:{name:"(coords: CellCoords) => void"}},onSubmitEdit:{defaultValue:null,description:"Callback when user submits a value. Use this to update state",name:"onSubmitEdit",required:!1,type:{name:"(coords: CellCoords) => void"}},onCancelEdit:{defaultValue:null,description:"Callback when user cancels editing",name:"onCancelEdit",required:!1,type:{name:"(coords: CellCoords) => void"}},onDoneEdit:{defaultValue:null,description:"Callback when user is done editing, either a submit or a cancel",name:"onDoneEdit",required:!1,type:{name:"(coords: CellCoords) => void"}},onNavigate:{defaultValue:null,description:"",name:"onNavigate",required:!1,type:{name:"(direction: CartesianDirection) => void"}},onNavigateSelection:{defaultValue:null,description:"",name:"onNavigateSelection",required:!1,type:{name:"(direction: CartesianDirection) => void"}},isEditorStartKeyEvent:{defaultValue:null,description:"Test if the key event should start the editor",name:"isEditorStartKeyEvent",required:!1,type:{name:"(e: KeyboardEvent) => boolean | StartEditEvent"}},isEditorStartPointerEvent:{defaultValue:null,description:"Test if the mouse event should start the editor. If this returns an event this will be dispatched to the editor.\n@param e\n@returns Either true or an StartEditEvent",name:"isEditorStartPointerEvent",required:!1,type:{name:"(e: PointerEvent) => boolean | StartEditEvent"}},containerProps:{defaultValue:null,description:"",name:"containerProps",required:!1,type:{name:"HTMLAttributes<HTMLDivElement>"}},borderStrokeFill:{defaultValue:null,description:"",name:"borderStrokeFill",required:!1,type:{name:"string"}},borderStrokeWidth:{defaultValue:null,description:"",name:"borderStrokeWidth",required:!1,type:{name:"number"}},alignment:{defaultValue:null,description:"The editor alignment. Used for expanding on overflow",name:"alignment",required:!1,type:{name:"enum",value:[{value:'"general"'},{value:'"left"'},{value:'"right"'},{value:'"center"'},{value:'"justify"'},{value:'"fill"'},{value:'"distributed"'},{value:'"centerContinuous"'}]}},getCellBoundsRange:{defaultValue:null,description:"If provided and it doesn't return null then the editor will be aligned to the range.",name:"getCellBoundsRange",required:!1,type:{name:"(coord: CellCoords, view: GridOverlayView) => CellRangeCoords"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["../../packages/grid/src/hooks/useKeyboardEditorOverlay.tsx#useKeyboardEditorOverlay"]={docgenInfo:useKeyboardEditorOverlay.__docgenInfo,name:"useKeyboardEditorOverlay",path:"../../packages/grid/src/hooks/useKeyboardEditorOverlay.tsx#useKeyboardEditorOverlay"})}catch(__react_docgen_typescript_loader_error){}}}]);