-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4425.51d5d272.iframe.bundle.js
1 lines (1 loc) · 5.8 KB
/
4425.51d5d272.iframe.bundle.js
1
"use strict";(self.webpackChunkstorybook=self.webpackChunkstorybook||[]).push([[4425],{"../../packages/sheet-mui/src/dialogs/SortDialog.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{SortDialog:()=>SortDialog,default:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/react/index.js"),_mui_material_Box__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("../../node_modules/@mui/material/Box/Box.js"),_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("../../node_modules/@mui/material/Checkbox/Checkbox.js"),_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("../../node_modules/@mui/material/FormControlLabel/FormControlLabel.js"),_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("../../packages/common-react/src/hooks/useCallbackRef.ts"),_sheetxl_common_mui__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("../../packages/common-mui/src/dialogs/OptionsDialog.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/react/jsx-runtime.js");const SortDialog=({sortOptions,onDone:propOnDone,...props})=>{const[isAscending,setIsAscending]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((()=>sortOptions?.options?.ascending??!1)),[hasHeader,setHasHeader]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((()=>sortOptions?.options?.hasHeader??!1)),[isCaseSensitive,setIsCaseSensitive]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),handleDone=(0,_sheetxl_common_react__WEBPACK_IMPORTED_MODULE_2__.c)((option=>{if("Sort"!==option)return;const options={...sortOptions?.options,ascending:isAscending,hasHeader},updatedSortOptions={...sortOptions,options};propOnDone?.(updatedSortOptions)}),[isAscending,hasHeader,isCaseSensitive,sortOptions,propOnDone,sortOptions]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_sheetxl_common_mui__WEBPACK_IMPORTED_MODULE_3__.OptionsDialog,{title:"Sort",options:["Sort","Cancel"],onDone:handleDone,...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_4__.A,{sx:{display:"flex",flexDirection:"column"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_5__.A,{control:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_6__.A,{checked:isAscending,onChange:()=>setIsAscending(!isAscending)}),label:"Is Ascending",labelPlacement:"end"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_5__.A,{control:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_6__.A,{checked:hasHeader,onChange:()=>setHasHeader(!hasHeader)}),label:"Has Header",labelPlacement:"end"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_5__.A,{control:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_6__.A,{checked:isCaseSensitive,onChange:()=>setIsCaseSensitive(!isCaseSensitive)}),label:"Case Sensitive",labelPlacement:"end"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_FormControlLabel__WEBPACK_IMPORTED_MODULE_5__.A,{control:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mui_material_Checkbox__WEBPACK_IMPORTED_MODULE_6__.A,{}),label:"Row Sort",labelPlacement:"end"})]})})};SortDialog.displayName="SortDialog";const __WEBPACK_DEFAULT_EXPORT__=SortDialog;try{SortDialog.displayName="SortDialog",SortDialog.__docgenInfo={description:"",displayName:"SortDialog",props:{sortOptions:{defaultValue:null,description:"",name:"sortOptions",required:!0,type:{name:"any"}},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/SortDialog.tsx#SortDialog"]={docgenInfo:SortDialog.__docgenInfo,name:"SortDialog",path:"../../packages/sheet-mui/src/dialogs/SortDialog.tsx#SortDialog"})}catch(__react_docgen_typescript_loader_error){}}}]);