"use strict";var e=require("prop-types"),a=require("classnames"),l=require("lodash"),t=require("@material-ui/core"),r=require("./TraceSelect.js"),n=require("./TraceSettings.css.js"),s=require("../../ColorPicker/ColorPicker.js"),i=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(e),o=u(a),d=t.withStyles({root:{minHeight:35}})(t.MenuItem),h=function(e){var a=e.traceSettings,u=e.onChange,c=e.mapping,h=e.classes;return i.jsxs("div",{className:n.container,children:[i.jsx("div",{className:n.item,children:i.jsx(r,{value:a.key,onChange:function(e){return u("key",e)},mapping:c,showLabel:!0})}),a.key&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:n.item,children:[i.jsxs(t.FormControl,{children:[i.jsx(t.InputLabel,{htmlFor:"traceType",children:"Trace Type"}),i.jsxs(t.Select,{displayEmpty:!0,value:a.traceType,className:h.select,onChange:function(e){return u("traceType",e.target.value)},inputProps:{name:"traceType"},children:[i.jsx(t.MenuItem,{value:"line",children:"Line"}),i.jsx(t.MenuItem,{value:"numeric",disabled:!0,children:"Numeric"})]})]}),i.jsx(t.TextField,{label:"Width",type:"number",name:"lineWidth",InputLabelProps:{shrink:!0},InputProps:{inputProps:{min:1,max:5}},className:h.lineWidth,value:a.lineWidth,onChange:function(e){return u("lineWidth",l.toNumber(e.target.value))}}),i.jsx(s,{buttonClassName:h.colorPickerBtn,className:h.colorPicker,value:a.color,onChange:function(e){return u("color",e)},label:"Fill color"})]}),i.jsx("div",{className:n.item,children:i.jsxs(t.FormControl,{className:h.formControl,children:[i.jsx(t.InputLabel,{htmlFor:"dashStyle",children:"Line Style"}),i.jsxs(t.Select,{value:a.dashStyle,onChange:function(e){return u("dashStyle",e.target.value)},inputProps:{name:"dashStyle"},classes:{select:h.lineSelect},children:[i.jsx(d,{value:"Solid",children:i.jsx("span",{className:o.default(n.line)})},"Line"),i.jsx(d,{value:"Dot",children:i.jsx("span",{className:o.default(n.line,n.dotted)})},"Dotted"),i.jsx(d,{value:"Dash",children:i.jsx("span",{className:o.default(n.line,n.dashed)})},"Dashed")]})]})}),i.jsx("div",{className:n.item,children:i.jsx(t.FormControl,{children:i.jsx(t.FormControlLabel,{control:i.jsx(t.Checkbox,{checked:a.autoScale,color:"primary",onChange:function(e){return u("autoScale",e.target.checked)},value:"autoScale"}),label:"Auto Scale"})})}),!a.autoScale&&i.jsxs("div",{className:n.scales,children:[i.jsx(t.TextField,{label:"Min Value",type:"number",value:a.scaleMin,onChange:function(e){return u("scaleMin",e.target.value)},InputLabelProps:{shrink:!0},defaultValue:""}),i.jsx(t.TextField,{label:"Max Value",type:"number",value:a.scaleMax,onChange:function(e){return u("scaleMax",e.target.value)},InputLabelProps:{shrink:!0},defaultValue:""})]})]})]})};h.propTypes={traceSettings:c.default.shape({lineWidth:c.default.number,scaleMin:c.default.number,scaleMax:c.default.number,key:c.default.string,color:c.default.string,autoScale:c.default.bool,dashStyle:c.default.string,traceType:c.default.string.isRequired}).isRequired,onChange:c.default.func.isRequired,classes:c.default.shape({}).isRequired,mapping:c.default.arrayOf(c.default.shape({name:c.default.string.isRequired,key:c.default.string.isRequired}).isRequired).isRequired};var m=t.withStyles({select:{minWidth:200},lineSelect:{minWidth:175,display:"flex",alignItems:"center"},lineWidth:{width:64,margin:"0 30px"},colorPicker:{whiteSpace:"nowrap"},colorPickerBtn:{width:36,minWidth:36,height:24}})(h);module.exports=m;
//# sourceMappingURL=TraceSettings.js.map
