UNPKG

@sheetxl/studio-vanilla

Version:

SheetXL Studio - Vanilla entry point for integrating SheetXL UI.

24 lines (23 loc) 2.2 kB
import { a as n } from "./DrQ2E12IEJK6WHfw.js"; import { r as p } from "./BTLmGxC1eZDXb9cY.js"; import { V as s, Y as O, Z as S, B as g, C as a, E as l, w as r } from "./elB9a338Kjeh3S89.js"; /** * @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. */ const D = p.memo((h) => { const { initialValue: c, context: d, onInput: u, onDone: x, ...m } = h, v = d?.().range, C = d?.().cell.toString(), [t, i] = p.useState(c ?? s.DefaultRangeOptions), j = O((e) => { let o = null; e === "Sort" && (o = { ...c, ...t }), u?.(o), x?.(o); }, [t, x, u, c]); return n.jsx(S, { title: "Sort", options: ["Sort", "Cancel"], onDone: j, ...m, children: n.jsxs(g, { sx: { display: "flex", flexDirection: "column" }, children: [n.jsx(a, { control: n.jsx(l, { checked: !t.reverse, onChange: () => i((e) => ({ ...e, reverse: !e.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.hasHeader, onChange: () => i((e) => ({ ...e, hasHeader: !e.hasHeader })) }), label: "Has Header", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.collatorOptions?.sensitivity === s.CaseSensitiveOptions.sensitivity, onChange: () => i((e) => ({ ...e, collatorOptions: t.collatorOptions?.sensitivity === s.CaseSensitiveOptions.sensitivity ? s.CaseInsensitiveOptions : s.CaseSensitiveOptions })) }), label: "Case Sensitive", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.orientation === r.Orientation.Row, onChange: () => i((e) => { const o = e.orientation === r.Orientation.Row ? r.Orientation.Column : r.Orientation.Row; return { ...v.getDefaultSortCriteria(o, C).options, includeHidden: e.includeHidden, reverse: e.reverse, orientation: o }; }) }), label: "Row Sort", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.includeHidden, onChange: () => i((e) => ({ ...e, includeHidden: !e.includeHidden })) }), label: "Include Hidden", labelPlacement: "end" })] }) }); }); export { D as SortDialog, D as default };