@sheetxl/studio-vanilla
Version:
SheetXL Studio - Vanilla entry point for integrating SheetXL UI.
22 lines (21 loc) • 2.04 kB
JavaScript
import { r as h, V as i, T as j, j as n, S as C, B as O, F as a, d as l, w as r } from "./EFJ5klSL3OL5aq6z.mjs";
/**
* @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.
*/
const H = ({ range: u, options: c, cell: x, onDone: d, ...p }) => {
const [t, s] = h.useState(c ?? i.DefaultRangeOptions), v = j((e) => {
let o = null;
e === "Sort" && (o = { ...c, options: t }), d?.(o);
}, [t, d, c]);
return n.jsx(C, { title: "Sort", options: ["Sort", "Cancel"], onDone: v, ...p, children: n.jsxs(O, { sx: { display: "flex", flexDirection: "column" }, children: [n.jsx(a, { control: n.jsx(l, { checked: !t.reverse, onChange: () => s((e) => ({ ...e, reverse: !e.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.hasHeader, onChange: () => s((e) => ({ ...e, hasHeader: !e.hasHeader })) }), label: "Has Header", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.collatorOptions?.sensitivity === i.CaseSensitiveOptions.sensitivity, onChange: () => s((e) => ({ ...e, collatorOptions: t.collatorOptions?.sensitivity === i.CaseSensitiveOptions.sensitivity ? i.CaseInsensitiveOptions : i.CaseSensitiveOptions })) }), label: "Case Sensitive", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.orientation === r.Orientation.Row, onChange: () => s((e) => {
const o = e.orientation === r.Orientation.Row ? r.Orientation.Column : r.Orientation.Row;
return { ...u.getDefaultSortCriteria(o, x).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: () => s((e) => ({ ...e, includeHidden: !e.includeHidden })) }), label: "Include Hidden", labelPlacement: "end" })] }) });
};
export {
H as SortDialog,
H as default
};