UNPKG

@sheetxl/studio-vanilla

Version:

SheetXL Studio - Vanilla entry point for integrating SheetXL UI.

7 lines (6 loc) 1.62 kB
"use strict";/** * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.6.4 * * (C) 2025-present SheetXL Inc. & Michael T. Ford * License: The license can be found at https://www.sheetxl.com/license. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Bd-US8M4eZh5SC26.cjs"),C=["Ok","Cancel"],u=e.reactExports.memo(d=>{const{tableOptions:n,context:r,onOption:i,onValidateOption:S,onDone:p,options:c=C,defaultOption:a=c?.[0],cancelOption:s="Cancel",sx:g,...m}=d,[b,h]=e.reactExports.useState(!1),[o,j]=e.reactExports.useState(()=>n?.hasHeader??!1),[l,O]=e.reactExports.useState(()=>n?.ranges??null),E=e.T(t=>{const x={...n,hasHeader:o,ranges:l};i?.(t,t===s,t===a),p?.({option:t,tableOptions:x})},[p,i,a,s,o,l,n]),f=e.reactExports.useCallback(async(t,x)=>null,[]);return e.jsxRuntimeExports.jsx(e.S3,{title:"Insert Table",options:c,onDone:E,onValidateOption:f,defaultOption:a,cancelOption:s,autoFocusSel:".range-input input",sx:{width:"360px",...g},...m,children:e.jsxRuntimeExports.jsxs(e.Box,{sx:{paddingTop:t=>t.spacing(1),paddingBottom:t=>t.spacing(0),rowGap:t=>t.spacing(1),display:"flex",flexDirection:"column"},children:[e.jsxRuntimeExports.jsx(e.Wp,{formName:"range",value:l,onChangeInput:t=>O(t),resolvedAddress:r.getNames().getRanges.bind(r.getNames()),onFocus:t=>{b||t.target?.select(),h(!0)}}),e.jsxRuntimeExports.jsx(e.FormControlLabel,{control:e.jsxRuntimeExports.jsx(e.Checkbox,{checked:o,onChange:()=>j(!o)}),label:"Table has headers",labelPlacement:"end"})]})})});exports.TableNewDialog=u,exports.default=u;