@sheetxl/studio-vanilla
Version:
SheetXL Studio - Vanilla entry point for integrating SheetXL UI.
7 lines (6 loc) • 1.65 kB
JavaScript
"use strict";/**
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.7.27
*
* (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("./Bc1oKNEzl3Kcj4g5.cjs"),S=["Ok","Cancel"],d=e.reactExports.memo(g=>{const{onInput:m,onOption:p,onValidateOption:k,onDone:c,options:u=S,defaultOption:a=u?.[0],cancelOption:s="Cancel",sx:b,initialValue:n,context:l,...h}=g,[j,O]=e.reactExports.useState(!1),[o,E]=e.reactExports.useState(()=>n?.hasHeader??!1),[r,f]=e.reactExports.useState(()=>n?.ranges??null),C=e.k(t=>{const i={...n,hasHeader:o,ranges:r},x=t===s;x||m?.(i),p?.(t,x,t===a),c?.({option:t,tableOptions:i})},[c,p,a,s,o,r,n]),R=e.reactExports.useCallback(async(t,i)=>null,[]);return e.jsxRuntimeExports.jsx(e.Or,{title:"Insert Table",options:u,onDone:C,onValidateOption:R,defaultOption:a,cancelOption:s,autoFocusSel:".range-input input",sx:{width:"360px",...b},...h,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.La,{formName:"range",value:r,onChangeInput:t=>f(t),resolvedAddress:l?l().getNames().getRanges.bind(l().getNames()):void 0,onFocus:t=>{j||t.target?.select(),O(!0)}}),e.jsxRuntimeExports.jsx(e.FormControlLabel,{control:e.jsxRuntimeExports.jsx(e.Checkbox,{checked:o,onChange:()=>E(!o)}),label:"Table has headers",labelPlacement:"end"})]})})});exports.TableNewDialog=d,exports.default=d;