UNPKG

@progress/kendo-react-spreadsheet

Version:
45 lines (44 loc) 1.49 kB
/** * @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 { DropDownButton as s } from "@progress/kendo-react-buttons"; import { customFormatIcon as i } from "@progress/kendo-svg-icons"; import { FORMATS as p } from "./utils.mjs"; import { IconWrap as l } from "@progress/kendo-react-common"; import { useLocalization as f } from "@progress/kendo-react-intl"; import { keys as e, messages as u } from "../messages.mjs"; const d = (r) => { const { spreadsheetRef: t } = r, m = o.useCallback((a) => { const n = a.item.value || null; setTimeout(() => { if (t.current) { const c = { command: "PropertyChangeCommand", options: { property: "format", value: n } }; t.current.executeCommand(c); } }, 0); }, []); return /* @__PURE__ */ o.createElement( s, { icon: "custom-format", svgIcon: i, fillMode: "flat", onItemClick: m, items: p, title: f().toLanguageString(e.format, u[e.format]), text: /* @__PURE__ */ o.createElement(l, { name: "caret-alt-down" }) } ); }; d.displayName = "Format"; export { d as Format };