2021-09-16 02:00:52 +08:00
|
|
|
<script>
|
2021-10-16 21:27:57 +08:00
|
|
|
export let widget;
|
2021-12-08 22:59:21 +01:00
|
|
|
export let wsPushProp = (ws, topic, status) => {};
|
2021-09-16 02:00:52 +08:00
|
|
|
</script>
|
|
|
|
|
|
2021-10-27 05:27:55 +07:00
|
|
|
<div class="card-items-psn">
|
|
|
|
|
<div class="widget-descr-width">
|
2021-09-17 23:18:06 +08:00
|
|
|
<!-- svelte-ignore a11y-label-has-associated-control -->
|
2021-10-20 20:53:07 +08:00
|
|
|
<label class="widget-descr-style">{!widget.descr ? "" : widget.descr}</label>
|
2021-09-17 23:18:06 +08:00
|
|
|
</div>
|
2021-10-27 05:27:55 +07:00
|
|
|
<div class="widget-width">
|
2021-10-16 21:27:57 +08:00
|
|
|
{#if widget.type == "number"}
|
2021-12-08 22:59:21 +01:00
|
|
|
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} step="0.1" type="number" />
|
2021-09-17 23:18:06 +08:00
|
|
|
{/if}
|
2021-10-16 21:27:57 +08:00
|
|
|
{#if widget.type == "text"}
|
2021-12-08 22:59:21 +01:00
|
|
|
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="text" />
|
2021-09-17 23:18:06 +08:00
|
|
|
{/if}
|
2021-10-16 21:27:57 +08:00
|
|
|
{#if widget.type == "date"}
|
2021-12-08 22:59:21 +01:00
|
|
|
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="date" />
|
2021-09-17 23:18:06 +08:00
|
|
|
{/if}
|
2021-10-16 21:27:57 +08:00
|
|
|
{#if widget.type == "time"}
|
2021-12-08 22:59:21 +01:00
|
|
|
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPushProp(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="time" />
|
2021-09-17 23:18:06 +08:00
|
|
|
{/if}
|
2021-09-16 02:00:52 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|