@progress/kendo-react-spreadsheet
Version:
KendoReact Spreadsheet package
96 lines (95 loc) • 2.85 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as a from "react";
import { Button as s } from "@progress/kendo-react-buttons";
import { tableColumnInsertLeftIcon as i, tableColumnInsertRightIcon as u, tableRowInsertBelowIcon as r, tableRowInsertAboveIcon as w, tableColumnDeleteIcon as b, tableRowDeleteIcon as C } from "@progress/kendo-svg-icons";
import { messages as R, keys as o } from "../messages.mjs";
import { useLocalization as v } from "@progress/kendo-react-intl";
const l = (e) => (n) => {
const { spreadsheetRef: t, value: d } = n, m = a.useCallback(() => {
if (t.current) {
const c = {
command: e.command,
options: { value: e.value }
};
t.current.executeCommand(c);
}
}, []);
return /* @__PURE__ */ a.createElement(
s,
{
type: "button",
icon: e.icon,
svgIcon: e.svgIcon,
fillMode: "flat",
title: v().toLanguageString(e.titleKey, R[e.titleKey]),
onClick: m,
disabled: d && e.disabled(d)
}
);
}, p = {
command: "AddColumnCommand",
value: "left",
icon: "table-column-insert-left",
svgIcon: i,
titleKey: o.addColumnLeft,
disabled: (e) => e.allCols,
displayName: "AddColumnLeft"
}, y = {
command: "AddColumnCommand",
value: "right",
icon: "table-column-insert-right",
svgIcon: u,
titleKey: o.addColumnRight,
disabled: (e) => e.allCols,
displayName: "AddColumnRight"
}, A = {
command: "AddRowCommand",
value: "below",
icon: "table-row-insert-below",
svgIcon: r,
titleKey: o.addRowBelow,
disabled: (e) => e.allRows,
displayName: "AddRowBelow"
}, I = {
command: "AddRowCommand",
value: "above",
icon: "table-row-insert-above",
svgIcon: w,
titleKey: o.addRowAbove,
disabled: (e) => e.allRows,
displayName: "AddRowAbove"
}, f = {
command: "DeleteColumnCommand",
icon: "table-column-delete",
svgIcon: b,
titleKey: o.deleteColumn,
disabled: (e) => e.allCols,
displayName: "DeleteColumn"
}, g = {
command: "DeleteRowCommand",
icon: "table-row-delete",
svgIcon: C,
titleKey: o.deleteRow,
disabled: (e) => e.allRows,
displayName: "DeleteRow"
}, N = l(p), D = l(y), h = l(A), K = l(I), L = l(f), B = l(g);
N.displayName = "AddColumnLeft";
D.displayName = "AddColumnRight";
h.displayName = "AddRowBelow";
K.displayName = "AddRowAbove";
L.displayName = "DeleteColumn";
B.displayName = "DeleteRow";
export {
N as AddColumnLeft,
D as AddColumnRight,
K as AddRowAbove,
h as AddRowBelow,
L as DeleteColumn,
B as DeleteRow
};