| 11284 | // Licensed under the MIT license. |
| 11285 | var _base = require("../base"); |
| 11286 | function Signal(props) { |
| 11287 | if (!props.explorer.viewer || !props.signal) return null; |
| 11288 | if (props.signal.bind) { |
| 11289 | const input = props.signal.bind.input; |
| 11290 | if (input) { |
| 11291 | const fn = map[input]; |
| 11292 | if (fn) { |
| 11293 | const prefix = props.prefix ? `${props.prefix} ` : ""; |
| 11294 | let initialValue; |
| 11295 | try { |
| 11296 | initialValue = props.explorer.viewer.vegaViewGl.signal(props.signal.name); |
| 11297 | } catch (error) { |
| 11298 | // continue regardless of error |
| 11299 | } |
| 11300 | const control = fn(prefix, props.signal.bind, initialValue, (value)=>{ |
| 11301 | props.onChange && props.onChange(value); |
| 11302 | props.explorer.signal(props.signal.name, value, props.newViewStateTarget); |
| 11303 | }, props.disabled, props.collapseLabel, props.componentRef); |
| 11304 | return (0, _base.base).react.createElement("div", { |
| 11305 | className: "sanddance-signal" |
| 11306 | }, control); |
| 11307 | } |
| 11308 | } |
| 11309 | } |
| 11310 | return null; |
| 11311 | } |
| 11312 | const map = {}; |
| 11313 | map["range"] = (prefix, bind, initialValue, onChange, disabled, collapseLabel, ref)=>{ |
| 11314 | return (0, _base.base).react.createElement((0, _base.base).fluentUI.Slider, { |