Yes.
A little hard because I used the new uib-element
node to create it
OK, took me a few seconds to work that out but here it is:
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="../uibuilder/images/node-blue.ico">
<title>Blank template - Node-RED uibuilder</title>
<meta name="description" content="Node-RED uibuilder - Blank template">
<!-- Your own CSS (defaults to loading uibuilders css)-->
<link type="text/css" rel="stylesheet" href="./index.css" media="all">
<!-- #region Supporting Scripts. These MUST be in the right order. Note no leading / -->
<script defer="" src="../uibuilder/uibuilder.iife.min.js"></script>
<!-- <script defer src="./index.js">/* OPTIONAL: Put your custom code in that */</script> -->
<!-- #endregion -->
</head><body class="uib">
<h1 class="with-subtitle">uibuilder Blank Template</h1>
<div role="doc-subtitle">Using the IIFE library - v6.1.0.</div>
<div id="more"><!-- '#more' is used as a parent for dynamic HTML content in examples --></div>
<div id="sform1">
<form>
<div><label for="r1">Text Input:</label><input id="r1" type="text" required="false" label="Text Input:"
value="Foo" onchange="this.dataset.newValue = this.value"
onfocus="this.dataset.oldValue = this.value" name="r1"></div>
<div><label for="r2">Colour:</label><input id="r2" type="color" required="false" label="Colour:"
value="#427798" onchange="this.dataset.newValue = this.value"
onfocus="this.dataset.oldValue = this.value" name="r2"></div>
<div><label for="r3">Date:</label><input id="r3" type="date" required="true" label="Date:"
onchange="this.dataset.newValue = this.value" onfocus="this.dataset.oldValue = this.value"
name="r3"></div>
<div><label for="r4">Range (0-100):</label><input id="r4" type="range" required="false"
label="Range (0-100):" value="20" min="0" max="100" onchange="this.dataset.newValue = this.value"
onfocus="this.dataset.oldValue = this.value" name="r4"></div>
<div><button id="r5" type="button" label="Send to Node-RED" value="Buttons can have values as well"
onclick="uibuilder.eventSend(event)" name="r5">Send to Node-RED</button></div>
</form>
</div>
</body></html>
This one is slightly extended from the previous simply because I was messing with the new zero-code form creator.
This is the format of the msg it creates.
{
"payload": {},
"_ui": {
"type": "eventSend",
"id": "r3",
"name": "r3",
"slotText": "Send to Node-RED",
"form": {
"r1": {
"id": "r1",
"name": "r1",
"value": "#000000",
"data": {}
},
"r2": {
"id": "r2",
"name": "r2",
"value": "20",
"data": {}
},
"r3": {
"id": "r3",
"name": "r3",
"value": "Buttons can have values as well",
"data": {}
}
},
"props": {},
"attribs": {
"type": "button",
"label": "Send to Node-RED",
"value": "Buttons can have values as well",
"onclick": "uibuilder.eventSend(event)"
},
"classes": [],
"event": "click",
"altKey": false,
"ctrlKey": false,
"shiftKey": false,
"metaKey": false,
"pointerType": "mouse",
"nodeName": "BUTTON",
"clientId": "_zJ-sV_1mtwtEqLl6u-2d",
"pageName": "index.html",
"tabId": "t524596"
},
"_socketId": "5wOPtyHnpcFfV3lFAAAQ",
"topic": "sform1",
"_uib": {
"_socketId": "5wOPtyHnpcFfV3lFAAAQ",
"version": "6.1.0-iife.min",
"ip": "::1",
"clientId": "_zJ-sV_1mtwtEqLl6u-2d",
"tabId": "t524596",
"url": "uib-element-test",
"pageName": "index.html",
"connections": 0,
"lastNavType": "reload",
"tls": false,
"connectedTimestamp": "2023-02-26T19:22:49.468Z",
"referer": "http://red.localhost:3001/uib-element-test/"
},
"_msgid": "e4cbd7572c80687a"
}
PS: There is no JavaScript at all. The CSS is the standard uib-brand.css
. Too long to really share here, you can get it from the v6.1.0 branch on GitHub. node-red-contrib-uibuilder/uib-brand.css at v6.1.0 Ā· TotallyInformation/node-red-contrib-uibuilder (github.com)