@progress/kendo-react-spreadsheet
Version:
KendoReact Spreadsheet package
44 lines (43 loc) • 1.36 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 o from "react";
import { Button as s } from "@progress/kendo-react-buttons";
import { textWrapIcon as i } from "@progress/kendo-svg-icons";
import { useLocalization as m } from "@progress/kendo-react-intl";
import { keys as r, messages as l } from "../messages.mjs";
const u = (a) => {
const { value: n, spreadsheetRef: t } = a, c = o.useCallback(() => {
if (t.current) {
const e = t.current.activeSheet();
if (e) {
const p = {
command: "TextWrapCommand",
options: { property: "wrap", value: !e.range(e.activeCell()).wrap() }
};
t.current.executeCommand(p);
}
}
}, []);
return /* @__PURE__ */ o.createElement(
s,
{
type: "button",
togglable: !0,
icon: "text-wrap",
svgIcon: i,
fillMode: "flat",
title: m().toLanguageString(r.textWrap, l[r.textWrap]),
onClick: c,
selected: n
}
);
};
u.displayName = "TextWrap";
export {
u as TextWrap
};