MCPcopy Index your code
hub / github.com/tinyplex/tinybase / widget

Function widget

src/ui-solid-dom/common/components.tsx:233–289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231 };
232
233 const widget = () =>
234 getTypeCase(
235 thingType(),
236 <input
237 value={stringThing()}
238 onInput={(event) =>
239 handleThingChange(
240 string(event[CURRENT_TARGET][_VALUE]),
241 setStringThing,
242 )
243 }
244 />,
245 <input
246 type="number"
247 value={numberThing()}
248 onInput={(event) =>
249 handleThingChange(
250 number(event[CURRENT_TARGET][_VALUE] || 0),
251 setNumberThing,
252 )
253 }
254 />,
255 <input
256 type="checkbox"
257 checked={booleanThing()}
258 onInput={(event) =>
259 handleThingChange(
260 boolean(event[CURRENT_TARGET].checked),
261 setBooleanThing,
262 )
263 }
264 />,
265 <input
266 value={objectThing()}
267 class={objectClassName()}
268 onInput={(event) =>
269 handleJsonThingChange(
270 event[CURRENT_TARGET][_VALUE],
271 setObjectThing,
272 isObject,
273 setObjectClassName,
274 )
275 }
276 />,
277 <input
278 value={arrayThing()}
279 class={arrayClassName()}
280 onInput={(event) =>
281 handleJsonThingChange(
282 event[CURRENT_TARGET][_VALUE],
283 setArrayThing,
284 isArray,
285 setArrayClassName,
286 )
287 }
288 />,
289 );
290

Callers 1

contentFunction · 0.70

Calls 5

getTypeCaseFunction · 0.90
stringFunction · 0.90
numberFunction · 0.90
handleThingChangeFunction · 0.70
handleJsonThingChangeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…