From f614a71b4916a25635f4081bef8850b8f9b15942 Mon Sep 17 00:00:00 2001 From: rpm-mcarman <65228808+rpm-mcarman@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:38:50 -0500 Subject: [PATCH] Applications update --- public/dmxAppConnect/config.js | 1708 +++++++++++------ .../dmxAutocomplete/dmxAutocomplete.css | 31 + .../dmxAutocomplete/dmxAutocomplete.js | 8 + views/dspec2.ejs | 34 +- views/dspeckit.ejs | 271 ++- views/layouts/main.ejs | 4 +- 6 files changed, 1372 insertions(+), 684 deletions(-) create mode 100644 public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.css create mode 100644 public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.js diff --git a/public/dmxAppConnect/config.js b/public/dmxAppConnect/config.js index 6fc29be..a6d2b18 100644 --- a/public/dmxAppConnect/config.js +++ b/public/dmxAppConnect/config.js @@ -10898,629 +10898,25 @@ dmx.config({ "outputType": "array" }, "api_loadexistingdspec": [ + { + "type": "text", + "name": "data" + }, { "type": "object", - "name": "data", + "name": "headers", "sub": [ { - "type": "number", - "name": "createuserid" - }, - { - "type": "array", - "name": "boms", - "sub": [ - { - "type": "number", - "name": "createuserid" - }, - { - "type": "object", - "name": "designspec", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "number", - "name": "id" - }, - { - "type": "number", - "name": "updateuserid" - }, - { - "type": "text", - "name": "updatedate" - }, - { - "type": "object", - "name": "partnumber", - "sub": [ - { - "type": "text", - "name": "secondaryvendorpartnumber" - }, - { - "type": "text", - "name": "listprice" - }, - { - "type": "number", - "name": "id" - }, - { - "type": "text", - "name": "ppap" - }, - { - "type": "text", - "name": "weight" - }, - { - "type": "text", - "name": "file" - }, - { - "type": "text", - "name": "comments" - }, - { - "type": "object", - "name": "replaces", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "updatedate" - }, - { - "type": "number", - "name": "updateuserid" - }, - { - "type": "text", - "name": "stdcost" - }, - { - "type": "number", - "name": "createuserid" - }, - { - "type": "text", - "name": "primaryvendorpartnumber" - }, - { - "type": "text", - "name": "primarycustomerpartnumber" - }, - { - "type": "object", - "name": "secondaryvendor", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "createdate" - }, - { - "type": "object", - "name": "partcode", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "object", - "name": "primaryvendor", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "object", - "name": "status", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "description" - }, - { - "type": "object", - "name": "replacedby", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "number" - } - ] - }, - { - "type": "text", - "name": "new" - }, - { - "type": "text", - "name": "createdate" - }, - { - "type": "text", - "name": "old" - }, - { - "type": "number", - "name": "viewlocationid" - } - ] - }, - { - "type": "number", - "name": "id" + "type": "text", + "name": "connection" }, { "type": "text", - "name": "reasonforchange" + "name": "content-length" }, { "type": "text", - "name": "validation" - }, - { - "type": "object", - "name": "partnumber", - "sub": [ - { - "type": "key_array", - "name": "replacedby", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "listprice" - }, - { - "type": "object", - "name": "secondaryvendor", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "file" - }, - { - "type": "object", - "name": "status", - "sub": [ - { - "type": "text", - "name": "createdate" - }, - { - "type": "number", - "name": "id" - }, - { - "type": "text", - "name": "name" - }, - { - "type": "text", - "name": "updateuserid" - }, - { - "type": "text", - "name": "createuserid" - }, - { - "type": "text", - "name": "updatedate" - } - ] - }, - { - "type": "number", - "name": "id" - }, - { - "type": "text", - "name": "createdate" - }, - { - "type": "text", - "name": "updatedate" - }, - { - "type": "object", - "name": "partcode", - "sub": [ - { - "type": "text", - "name": "updatedate" - }, - { - "type": "number", - "name": "updateuserid" - }, - { - "type": "boolean", - "name": "ispartcode" - }, - { - "type": "text", - "name": "name" - }, - { - "type": "text", - "name": "code" - }, - { - "type": "text", - "name": "createdate" - }, - { - "type": "object", - "name": "parent", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "boolean", - "name": "isactive" - }, - { - "type": "number", - "name": "createuserid" - }, - { - "type": "text", - "name": "description" - }, - { - "type": "object", - "name": "parttype", - "sub": [ - { - "type": "text", - "name": "createdate" - }, - { - "type": "number", - "name": "ending" - }, - { - "type": "text", - "name": "name" - }, - { - "type": "number", - "name": "updateuserid" - }, - { - "type": "number", - "name": "id" - }, - { - "type": "text", - "name": "updatedate" - }, - { - "type": "number", - "name": "starting" - }, - { - "type": "number", - "name": "createuserid" - }, - { - "type": "text", - "name": "description" - } - ] - }, - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "stdcost" - }, - { - "type": "text", - "name": "number" - }, - { - "type": "text", - "name": "primaryvendorpartnumber" - }, - { - "type": "number", - "name": "updateuserid" - }, - { - "type": "object", - "name": "replaces", - "sub": [ - { - "type": "text", - "name": "file" - }, - { - "type": "number", - "name": "id" - }, - { - "type": "text", - "name": "weight" - }, - { - "type": "object", - "name": "replaces", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "number", - "name": "updateuserid" - }, - { - "type": "text", - "name": "listprice" - }, - { - "type": "object", - "name": "replacedby", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "stdcost" - }, - { - "type": "object", - "name": "status", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "secondaryvendorpartnumber" - }, - { - "type": "text", - "name": "description" - }, - { - "type": "object", - "name": "primaryvendor", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "object", - "name": "secondaryvendor", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "number", - "name": "createuserid" - }, - { - "type": "text", - "name": "updatedate" - }, - { - "type": "text", - "name": "createdate" - }, - { - "type": "text", - "name": "number" - }, - { - "type": "text", - "name": "primarycustomerpartnumber" - }, - { - "type": "object", - "name": "partcode", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "primaryvendorpartnumber" - }, - { - "type": "text", - "name": "ppap" - }, - { - "type": "text", - "name": "comments" - } - ] - }, - { - "type": "text", - "name": "comments" - }, - { - "type": "text", - "name": "primarycustomerpartnumber" - }, - { - "type": "number", - "name": "createuserid" - }, - { - "type": "text", - "name": "description" - }, - { - "type": "text", - "name": "ppap" - }, - { - "type": "text", - "name": "secondaryvendorpartnumber" - }, - { - "type": "object", - "name": "primaryvendor", - "sub": [ - { - "type": "number", - "name": "id" - } - ] - }, - { - "type": "text", - "name": "weight" - } - ] - }, - { - "type": "text", - "name": "revisionlevel" - }, - { - "type": "text", - "name": "note" - }, - { - "type": "boolean", - "name": "faccompleted" - }, - { - "type": "boolean", - "name": "facrequired" - }, - { - "type": "number", - "name": "updateuserid" - }, - { - "type": "object", - "name": "status", - "sub": [ - { - "type": "text", - "name": "createuserid" - }, - { - "type": "number", - "name": "id" - }, - { - "type": "text", - "name": "updateuserid" - }, - { - "type": "text", - "name": "updatedate" - }, - { - "type": "text", - "name": "name" - }, - { - "type": "text", - "name": "createdate" - } - ] - } - ] - }, - { - "type": "object", - "name": "headers", - "sub": [ - { - "type": "text", - "name": "connection" - }, - { - "type": "text", - "name": "content-length" - }, - { - "type": "text", - "name": "content-type" + "name": "content-type" }, { "type": "text", @@ -12985,6 +12381,1090 @@ dmx.config({ } ], "outputType": "array" - } + }, + "api_getapps": [ + { + "type": "array", + "name": "data", + "sub": [ + { + "type": "object", + "name": "status", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "partnumber", + "sub": [ + { + "type": "text", + "name": "weight" + }, + { + "type": "object", + "name": "status", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "number", + "name": "createuserid" + }, + { + "type": "text", + "name": "updatedate" + }, + { + "type": "text", + "name": "file" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "secondaryvendorpartnumber" + }, + { + "type": "text", + "name": "primarycustomerpartnumber" + }, + { + "type": "object", + "name": "secondaryvendor", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "object", + "name": "replaces", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "object", + "name": "replacedby", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "object", + "name": "partcode", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "text", + "name": "stdcost" + }, + { + "type": "text", + "name": "listprice" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "text", + "name": "number" + }, + { + "type": "text", + "name": "ppap" + }, + { + "type": "object", + "name": "primaryvendor", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "text", + "name": "comments" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "primaryvendorpartnumber" + }, + { + "type": "text", + "name": "description" + } + ] + }, + { + "type": "number", + "name": "createuserid" + }, + { + "type": "text", + "name": "hydcapacity" + }, + { + "type": "text", + "name": "plumbing" + }, + { + "type": "text", + "name": "transcapacity" + }, + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "voltage" + }, + { + "type": "text", + "name": "revisionlevel" + }, + { + "type": "text", + "name": "startingserial" + }, + { + "type": "text", + "name": "motor" + }, + { + "type": "text", + "name": "webpublish" + }, + { + "type": "text", + "name": "arrangement" + }, + { + "type": "object", + "name": "make", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "text", + "name": "electric" + }, + { + "type": "text", + "name": "type" + }, + { + "type": "text", + "name": "serialprefix" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "text", + "name": "endingserial" + }, + { + "type": "object", + "name": "customer", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "number", + "name": "universalkit" + }, + { + "type": "object", + "name": "model", + "sub": [ + { + "type": "object", + "name": "make", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "text", + "name": "updatedate" + }, + { + "type": "object", + "name": "product", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "engine", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "object", + "name": "model", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "displacement" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "boolean", + "name": "oe" + }, + { + "type": "object", + "name": "product", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "array", + "name": "models", + "sub": [ + { + "type": "object", + "name": "make", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "product", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "array", + "name": "engines" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "enginecapacity" + }, + { + "type": "text", + "name": "description" + } + ] + }, + { + "type": "object", + "name": "headers", + "sub": [ + { + "type": "text", + "name": "connection" + }, + { + "type": "text", + "name": "content-length" + }, + { + "type": "text", + "name": "content-type" + }, + { + "type": "text", + "name": "date" + } + ] + } + ], + "api_models": [ + { + "type": "array", + "name": "data", + "sub": [ + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "createuserid" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "object", + "name": "make", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "product", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + } + ] + }, + { + "type": "object", + "name": "headers", + "sub": [ + { + "type": "text", + "name": "connection" + }, + { + "type": "text", + "name": "content-length" + }, + { + "type": "text", + "name": "content-type" + }, + { + "type": "text", + "name": "date" + } + ] + } + ], + "api_customers": [ + { + "type": "array", + "name": "data", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "headers", + "sub": [ + { + "type": "text", + "name": "connection" + }, + { + "type": "text", + "name": "content-length" + }, + { + "type": "text", + "name": "content-type" + }, + { + "type": "text", + "name": "date" + } + ] + } + ], + "api_engines": [ + { + "type": "array", + "name": "data", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "object", + "name": "model", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "object", + "name": "product", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "object", + "name": "make", + "sub": [ + { + "type": "number", + "name": "id" + } + ] + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "object", + "name": "customer", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "text", + "name": "displacement" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "headers", + "sub": [ + { + "type": "text", + "name": "connection" + }, + { + "type": "text", + "name": "content-length" + }, + { + "type": "text", + "name": "content-type" + }, + { + "type": "text", + "name": "date" + } + ] + } + ], + "api_products": [ + { + "type": "array", + "name": "data", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "headers", + "sub": [ + { + "type": "text", + "name": "connection" + }, + { + "type": "text", + "name": "content-length" + }, + { + "type": "text", + "name": "content-type" + }, + { + "type": "text", + "name": "date" + } + ] + } + ], + "api_makes": [ + { + "type": "array", + "name": "data", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "headers", + "sub": [ + { + "type": "text", + "name": "connection" + }, + { + "type": "text", + "name": "content-length" + }, + { + "type": "text", + "name": "content-type" + }, + { + "type": "text", + "name": "date" + } + ] + } + ], + "api_postmodel": [ + { + "type": "array", + "name": "data", + "sub": [ + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "createuserid" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "object", + "name": "make", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + }, + { + "type": "object", + "name": "product", + "sub": [ + { + "type": "text", + "name": "updatedate" + }, + { + "type": "number", + "name": "id" + }, + { + "type": "number", + "name": "updateuserid" + }, + { + "type": "text", + "name": "createdate" + }, + { + "type": "text", + "name": "description" + }, + { + "type": "text", + "name": "name" + }, + { + "type": "number", + "name": "createuserid" + } + ] + } + ] + }, + { + "type": "object", + "name": "headers", + "sub": [ + { + "type": "text", + "name": "connection" + }, + { + "type": "text", + "name": "content-length" + }, + { + "type": "text", + "name": "content-type" + }, + { + "type": "text", + "name": "date" + } + ] + } + ] } }); diff --git a/public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.css b/public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.css new file mode 100644 index 0000000..e6a844a --- /dev/null +++ b/public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.css @@ -0,0 +1,31 @@ +input[is="dmx-autocomplete"] { + position: relative; +} + +.dmx-autocomplete-items { + position: absolute; + background: #fff; + color: #495057; + border: 1px solid #ced4da; + box-shadow: 0 1px 2px rgba(0,0,0,.3); + overflow: auto; + max-height: 50vh; + z-index: 1000; +} + +.dmx-autocomplete-item { + padding: .375rem .75rem; + cursor: default; + white-space: nowrap; +} + +.dmx-autocomplete-item:hover { + background: #e9ecef; +} + +.dmx-autocomplete-active { + background: #007bff; + background: Highlight; + color: #fff; + color: HighlightText; +} \ No newline at end of file diff --git a/public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.js b/public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.js new file mode 100644 index 0000000..c45fe17 --- /dev/null +++ b/public/dmxAppConnect/dmxAutocomplete/dmxAutocomplete.js @@ -0,0 +1,8 @@ +/*! + DMXzone Autocomplete + Version: 1.0.11 + (c) 2022 Wappler.io + @build 2022-04-14 16:50:55 + */ +dmx.Component("autocomplete",{extends:"input",initialData:{selectedItem:null},attributes:{data:{type:Array,default:[]},matchcase:{type:Boolean,default:!1},matchstart:{type:Boolean,default:!1},matchaccent:{type:Boolean,default:!1},optiontext:{type:String,default:"$value"},optionvalue:{type:String,default:"$value"},optionsearch:{type:String,default:null},noresultslabel:{type:String,default:"No Results..."},placeholder:{type:String,default:""},noclear:{type:Boolean,default:!1}},events:{noresults:Event},render:function(t){dmx.BaseComponent.prototype.render.call(this,t),this.dataItems=[],this.props.value?this.updateValue=!0:this.props.value=this.$node.value,this.$node.disabled=this.props.disabled,this.$node.setAttribute("placeholder",this.props.placeholder),this.input=this.$node.cloneNode(),this.input.removeAttribute("id"),this.input.removeAttribute("name"),this.input.setAttribute("placeholder",this.props.placeholder),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("form","dummy"),this.input.addEventListener("blur",this.onBlur.bind(this)),this.input.addEventListener("input",this.onInput.bind(this)),this.input.addEventListener("keydown",this.onKeydown.bind(this)),this.list=document.createElement("div"),this.list.setAttribute("class","dmx-autocomplete-items"),this.$node.style.display="none",this.$node.addEventListener("change",this.updateData.bind(this)),this.$node.addEventListener("invalid",this.updateData.bind(this)),this.update({})},mounted:function(){this.$node.parentNode.insertBefore(this.input,this.$node),this.$node.form&&this.$node.form.addEventListener("reset",this.onReset.bind(this))},update:function(t){dmx.equal(this.props.data,t.data)&&this.props.optiontext==t.optiontext&&this.props.optionvalue==t.optionvalue||(this.dataItems=dmx.repeatItems(this.props.data).map((function(t,e){const i=dmx.parse(this.props.optiontext,dmx.DataScope(t,this));return{index:e,label:i,value:dmx.parse(this.props.optionvalue,dmx.DataScope(t,this)),search:this.props.optionsearch?dmx.parse(this.props.optionsearch,dmx.DataScope(t,this)):i,item:t}}),this),this.updateValue=!0),this.props.value!=t.value&&(this.updateValue=!0),this.props.disabled!=t.disabled&&(this.$node.disabled=this.props.disabled,this.input.disabled=this.props.disabled),this.props.placeholder!=t.placeholder&&this.input.setAttribute("placeholder",this.props.placeholder),this.updateData()},updated:function(){this.updateValue&&(this.updateValue=!1,this.setValue(this.props.value,!0),this.updateData())},updateData:function(t){dmx.Component("form-element").prototype.updateData.call(this,t);var e=this.dataItems.find((function(t){return t.value==this.$node.value}),this);this.set("selectedItem",e?e.item:null)},setValue:function(t,e){var i=this.dataItems.find((function(e){return e.value==t}),this);this.$node.value=i?i.value:"",this.input.value=i?i.label:"",e&&(this.$node.defaultValue=i?i.value:"",this.input.defaultValue=i?i.label:"")},focus:function(){this.input.focus()},disable:function(t){this.$node.disabled=!0===t,this.input.disabled=!0===t,this.updateData()},onReset:function(t){this.$node.value=this.$node.defaultValue,this.input.value=this.input.defaultValue},onBlur:function(t){var e=!1;if(this.dataItems)for(var i=0;i{s.preventDefault(),s.stopPropagation(),e.value=t.value,i.value=t.label,this.closeList(),e.dispatchEvent(new Event("change"))})),this.list.appendChild(a)}}),this),!this.list.children.length){var a=document.createElement("div");a.setAttribute("class","dmx-autocomplete-item"),a.textContent=this.props.noresultslabel,a.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation(),this.closeList(),this.dispatchEvent("noresults",null,{value:s})})),this.list.appendChild(a)}this.showList()}},onKeydown:function(t){if(40==t.keyCode)t.preventDefault(),this.currentFocus++,this.updateActive(),this.showList();else if(38==t.keyCode)t.preventDefault(),this.currentFocus--,this.updateActive(),this.showList();else if(27==t.keyCode)t.preventDefault(),this.currentFocus=-1,this.closeList();else if(13==t.keyCode&&(t.preventDefault(),this.currentFocus>-1)){const t=this.list.getElementsByTagName("div");t&&t[this.currentFocus].dispatchEvent(new MouseEvent("mousedown"))}},matches:function(t,e){return null!=t&&(this.props.matchaccent||(t=this.normalize(t),e=this.normalize(e)),this.props.matchcase||(t=t.toLowerCase(),e=e.toLowerCase()),this.props.matchstart&&(t=t.substring(0,e.length)),-1!=t.indexOf(e))},getItemHtml:function(t,e){var i=this.htmlEncode(t),s=new RegExp((this.props.matchstart?"^":"")+dmx.escapeRegExp(this.htmlEncode(e)),this.props.matchcase?"g":"gi");return i=i.replace(s,(function(t){return""+t+""}))},htmlEncode:function(t){return t=(t=(t=(t=t.replace(/&/g,"&")).replace(/"/g,""")).replace(//g,">")},normalize:function(t){if(t.normalize)return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"");for(var e=t.split(""),i=0;i=192&&s<=383?e[i]=String.fromCharCode("AAAAAAACEEEEIIIIDNOOOOO*OUUUUYIsaaaaaaaceeeeiiii?nooooo/ouuuuy?yAaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiJjJjKkkLlLlLlLlLlNnNnNnnNnOoOoOoOoRrRrRrSsSsSsSsTtTtTtUuUuUuUuUuUuWwYyYZzZzZzF".charCodeAt(s-192)):s>127&&(e[i]="?")}return e.join("")},updateActive:function(){var t=this.list.getElementsByTagName("div");if(t){this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1);for(var e=0;e +
+ +