@progress/kendo-react-chart-wizard
Version:
React Chart Wizard lets you create a chart using data from a Grid, another data-bound component, or an external source
9 lines (8 loc) • 2.78 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
*-------------------------------------------------------------------------------------------
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),y=require("@progress/kendo-react-layout"),F=require("@progress/kendo-react-form"),m=require("../FormField.js"),v=require("@progress/kendo-react-inputs"),n=require("../../utils.js"),o=require("../../messages.js"),q=require("@progress/kendo-react-intl"),T=require("@progress/kendo-react-dropdowns"),w=require("@progress/kendo-react-animation"),P=l=>{var g,p,f,b,C;const[s,d]=t.useState(""),r=q.useLocalization(),a=l.state,u=a.seriesType,E=typeof((g=a.series[0])==null?void 0:g.stack)=="object"?(p=a.series[0])==null?void 0:p.stack.type:!1,[S,h]=t.useState(!1),k=t.useCallback(e=>{h(!e.expanded)},[]),x=e=>{s&&l.onStateChange(n.updateState(a,n.ActionTypes.seriesColor,{seriesName:s,color:e.value}))},L=e=>{l.onStateChange(n.updateState(a,n.ActionTypes.seriesLabel,{seriesName:s,all:!s,visible:e.value}))},c={name:r.toLanguageString(o.formatSeriesAllSeries,o.messages.formatSeriesAllSeries)},A=e=>{const i=e.target.value.name;d(i===c.name?"":i)};return t.useEffect(()=>{d("")},[u,E]),t.createElement(y.ExpansionPanel,{style:{maxWidth:"576px"},title:r.toLanguageString(o.formatSeries,o.messages.formatSeries),expanded:S,tabIndex:0,onAction:k},t.createElement(w.Reveal,null,S&&t.createElement(y.ExpansionPanelContent,null,t.createElement(F.FormElement,{onKeyDown:n.stopPropagation},t.createElement(m.FormField,{editorId:"apply-to-series",labelText:r.toLanguageString(o.formatSeriesApplyTo,o.messages.formatSeriesApplyTo)},t.createElement(T.DropDownList,{id:"apply-to-series",data:a.series,textField:"name",dataItemKey:"name",defaultItem:c,disabled:!n.isCategorical(u),value:a.series.find(e=>e.name===s)||c,onChange:A,...n.dropdownlistCommonProps})),t.createElement(m.FormField,{editorId:"seriesColor",labelText:r.toLanguageString(o.formatSeriesColor,o.messages.formatSeriesColor)},t.createElement(v.ColorPicker,{id:"seriesColor",value:s?(f=a.series.find(e=>e.name===s))==null?void 0:f.color:"",onChange:x,disabled:!s,view:"gradient",fillMode:"outline"})),t.createElement(m.FormField,null,t.createElement(v.Checkbox,{label:r.toLanguageString(o.formatSeriesShowLabels,o.messages.formatSeriesShowLabels),checked:s?(C=(b=a.series.find(e=>e.name===s))==null?void 0:b.labels)==null?void 0:C.visible:a.series.every(e=>{var i;return(i=e.labels)==null?void 0:i.visible}),onChange:L}))))))};exports.SeriesPanel=P;