@sheetxl/studio-vanilla
Version:
SheetXL Studio - Vanilla entry point for integrating SheetXL UI.
24 lines (23 loc) • 2.12 kB
JavaScript
import { a as n } from "./ESo6qTbjf45cfiLm.js";
import { r as x } from "./BjUnH-Jak3KkxyMS.js";
import { k as s, T as j, S as m, B as C, l as a, o as l, w as r } from "./Dm24M4tfHrPDHOCg.js";
/**
* @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 b = ({ range: p, options: c, cell: u, onDone: d, ...h }) => {
const [t, o] = x.useState(c ?? s.DefaultRangeOptions), v = j((e) => {
let i = null;
e === "Sort" && (i = { ...c, options: t }), d?.(i);
}, [t, d, c]);
return n.jsx(m, { title: "Sort", options: ["Sort", "Cancel"], onDone: v, ...h, children: n.jsxs(C, { sx: { display: "flex", flexDirection: "column" }, children: [n.jsx(a, { control: n.jsx(l, { checked: !t.reverse, onChange: () => o((e) => ({ ...e, reverse: !e.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.hasHeader, onChange: () => o((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: () => o((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: () => o((e) => {
const i = e.orientation === r.Orientation.Row ? r.Orientation.Column : r.Orientation.Row;
return { ...p.getDefaultSortCriteria(i, u).options, includeHidden: e.includeHidden, reverse: e.reverse, orientation: i };
}) }), label: "Row Sort", labelPlacement: "end" }), n.jsx(a, { control: n.jsx(l, { checked: t.includeHidden, onChange: () => o((e) => ({ ...e, includeHidden: !e.includeHidden })) }), label: "Include Hidden", labelPlacement: "end" })] }) });
};
export {
b as SortDialog,
b as default
};