UNPKG

@tomorrowevening/hermes

Version:

An extendable set of Web Tools controlled via a separate window for non-intereference with content.

2 lines (1 loc) 883 B
"use strict";const r=require("react/jsx-runtime"),l=require("react"),a=require("./InspectNumber.cjs");function v(t){const d=t.value.x!==void 0,i=t.step!==void 0?t.step:.01,o=[];if(d){const s=l.useMemo(()=>t.value,[]),u=(e,c)=>{s[e]=c,t.onChange({target:{value:s}})};["x","y","z","w"].forEach(e=>{const c=l.useRef(null);o.push(r.jsxs("div",{children:[r.jsx("label",{ref:c,children:e.toUpperCase()}),r.jsx(a,{value:s[e],type:"number",prop:e,step:i,labelRef:c,onChange:u})]},e))})}else{const s=l.useMemo(()=>t.value,[]),u=(n,e)=>{const c=Number(n);s.elements[c]=e,t.onChange({target:{value:s}})};for(let n=0;n<16;n++){const e=l.useRef(null);o.push(r.jsxs("div",{children:[r.jsx("span",{ref:e,children:n+1}),r.jsx(a,{value:s.elements[n],type:"number",prop:n.toString(),step:i,labelRef:e,onChange:u})]},n.toString()))}}return r.jsx("div",{className:"grid4",children:o})}module.exports=v;