UNPKG

@progress/kendo-react-gantt

Version:

React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt package

36 lines (35 loc) 1.76 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 t from "react"; import { useLocalization as l } from "@progress/kendo-react-intl"; import { ButtonGroup as p } from "@progress/kendo-react-buttons"; import { ViewSelectorItem as c } from "./ViewSelectorItem.mjs"; import { useGanttViewsContext as m, useGanttActiveViewContext as u } from "../../../context/GanttContext.mjs"; import { messages as d, viewSelector as k } from "../../../messages/index.mjs"; const w = t.forwardRef(() => { const r = m(), [i, o] = u(), a = l(), n = (e) => a.toLanguageString(e, d[e]), s = t.useCallback( (e) => { o && (e.preventDefault(), o(e.target.value)); }, [o] ); return /* @__PURE__ */ t.createElement("div", { className: "k-gantt-views-wrapper" }, /* @__PURE__ */ t.createElement(p, { className: "k-gantt-views" }, r.map((e) => /* @__PURE__ */ t.createElement(c, { key: e.props.name, view: e.props }))), /* @__PURE__ */ t.createElement( "select", { value: i, onChange: s, "aria-label": n(k), className: "k-picker k-picker-solid k-dropdown-list k-dropdown k-views-dropdown k-rounded-md" }, r.map((e) => /* @__PURE__ */ t.createElement("option", { key: e.props.name, value: e.props.name }, typeof e.props.title == "function" ? e.props.title.call(void 0, a) : e.props.title)) )); }); w.displayName = "KendoReactGanttViewSelectorList"; export { w as ViewSelectorList };