@progress/kendo-react-gantt
Version:
React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt package
9 lines (8 loc) • 1.9 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 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 g=require("react"),f=require("@progress/kendo-react-intl"),k=require("@progress/kendo-react-buttons"),l=require("../../../context/GanttContext.js"),s=require("../../../messages/index.js");function S(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const o=S(g),i=o.forwardRef(()=>{const n=l.useGanttViewsContext(),[r,t]=l.useGanttActiveViewContext(),a=f.useLocalization(),c=e=>a.toLanguageString(e,s.messages[e]),u=o.useMemo(()=>n.map(e=>{const m=typeof e.props.title=="function"?e.props.title(a):e.props.title;return{value:e.props.name,text:m}}),[n,a]),p=o.useCallback(e=>{t&&t(e)},[t]),d=o.useCallback(e=>{t&&(e.preventDefault(),t(e.target.value))},[t]);return o.createElement("div",{className:"k-gantt-views-wrapper"},o.createElement(k.SegmentedControl,{className:"k-gantt-views",items:u,value:r,onChange:p,"aria-label":c(s.viewSelector)}),o.createElement("select",{value:r,onChange:d,"aria-label":c(s.viewSelector),className:"k-picker k-picker-solid k-dropdown-list k-dropdown k-views-dropdown k-rounded-md"},n.map(e=>o.createElement("option",{key:e.props.name,value:e.props.name},typeof e.props.title=="function"?e.props.title(a):e.props.title))))});i.displayName="KendoReactGanttViewSelectorList";exports.ViewSelectorList=i;