2021-09-16 02:00:52 +08:00
|
|
|
<script>
|
2021-10-16 21:27:57 +08:00
|
|
|
export let widget;
|
2022-02-06 23:02:20 +01:00
|
|
|
export let wsPush = (ws, topic, status) => {};
|
2021-12-27 02:46:05 +01:00
|
|
|
export let value;
|
|
|
|
|
value = value;
|
2021-09-16 02:00:52 +08:00
|
|
|
</script>
|
|
|
|
|
|
2021-12-28 23:55:14 +01:00
|
|
|
<div class="crd-itm-psn">
|
|
|
|
|
<div class="wgt-dscr-w">
|
2021-09-17 23:18:06 +08:00
|
|
|
<!-- svelte-ignore a11y-label-has-associated-control -->
|
2021-12-28 23:55:14 +01:00
|
|
|
<label class="wgt-dscr-stl">{!widget.descr ? "" : widget.descr}</label>
|
2021-09-17 23:18:06 +08:00
|
|
|
</div>
|
2021-12-28 23:55:14 +01:00
|
|
|
<div class="wgt-w">
|
2021-10-16 21:27:57 +08:00
|
|
|
{#if widget.type == "number"}
|
2022-02-06 23:02:20 +01:00
|
|
|
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(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"}
|
2022-02-06 23:02:20 +01:00
|
|
|
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(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"}
|
2022-02-06 23:02:20 +01:00
|
|
|
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(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"}
|
2022-02-06 23:02:20 +01:00
|
|
|
<input class={widget["send"] == true ? "wgt-ipt text-right border-red-500" : "wgt-ipt text-right focus:border-indigo-500"} on:change={() => ((widget["send"] = true), wsPush(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>
|