@progress/kendo-react-spreadsheet
Version:
KendoReact Spreadsheet package
9 lines (8 loc) • 1.43 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
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),i=require("@progress/kendo-react-buttons"),p=require("@progress/kendo-svg-icons"),g=require("@progress/kendo-react-intl"),a=require("../messages.js");function d(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const c=d(l),s=t=>{const{value:n,spreadsheetRef:e}=t,r=c.useCallback(()=>{if(e.current){const o=e.current.activeSheet();if(o){const u={command:"TextWrapCommand",options:{property:"wrap",value:!o.range(o.activeCell()).wrap()}};e.current.executeCommand(u)}}},[]);return c.createElement(i.Button,{type:"button",togglable:!0,icon:"text-wrap",svgIcon:p.textWrapIcon,fillMode:"flat",title:g.useLocalization().toLanguageString(a.keys.textWrap,a.messages[a.keys.textWrap]),onClick:r,selected:n})};s.displayName="TextWrap";exports.TextWrap=s;