eventSend(domevent, originator = "") {
    if (this.$attrs) {
      log("error", "Uib:eventSend", "`this` has been usurped by VueJS. Make sure that you wrap the call in a function: `doEvent: function (event) { uibuilder.eventSend(event) },`")();
      return;
    }
    if (!domevent && !event) {
      log("warn", "Uib:eventSend", "Neither the domevent nor the hidden event properties are set. You probably called this function directly rather than applying to an on click event.")();
      return;
    }
    if (!domevent || !domevent.constructor) domevent = event;
    if (!domevent.constructor.name.endsWith("Event") || !domevent.currentTarget) {
      log("warn", "Uib:eventSend", "ARGUMENT NOT A DOM EVENT - use data attributes not function arguments to pass data. Arg Type: ".concat(domevent.constructor.name), domevent)();
      return;
    }
    domevent.preventDefault();
    const target = domevent.currentTarget;
    const props = this.getElementCustomProps(target);
    const attribs = this.getElementAttributes(target);
    let payload = {};
    let formDetails;
    if (target.form) {
      formDetails = {
        id: this.returnElementId(target.form),
        valid: target.form.checkValidity()
      };
      Object.values(target.form).forEach((frmEl, i) => {
        if (["fieldset", "object"].includes(frmEl.type)) return;
        const details = this.getFormElementDetails(frmEl);
        if (details) {
          if (frmEl.type === "file" && frmEl.files.length > 0) {
            details.value = this._processFilesInput(frmEl);
          }
          formDetails[details.id] = details;
          payload[details.id] = details.value;
        }
      });
    } else {
      if (target.type === "file") {
        payload = this._processFilesInput(target);
      }
    }
    const classes = this.getElementClasses(target);
    if (Object.keys(target.dataset).length > 0) payload = { ...payload, ...target.dataset };
    const { value: value2, checked } = this.getFormElementValue(target);
    if (value2 !== null) payload.value = value2;
    if (checked !== null) payload.checked = checked;
    let nprops;
    if (Object.prototype.toString.call(target) === "[object Notification]") {
      payload = "notification-".concat(target.userAction);
      nprops = {
        // userAction: target.userAction, // uib custom prop: click, close or error
        actions: target.actions,
        badge: target.badge,
        body: target.body,
        data: target.data,
        dir: target.dir,
        icon: target.icon,
        image: target.image,
        lang: target.lang,
        renotify: target.renotify,
        requireInteraction: target.requireInteraction,
        silent: target.silent,
        tag: target.tag,
        timestamp: target.timestamp,
        title: target.title,
        vibrate: target.vibrate
      };
    }
    const msg = {
      // - this may be an empty Object if no data attributes defined
      payload,
      _ui: {
        type: "eventSend",
        id: target.id !== "" ? target.id : void 0,
        name: target.name !== "" ? target.name : void 0,
        slotText: target.textContent ? target.textContent.substring(0, 255) : void 0,
        dataset: { ...target.dataset },
        form: formDetails,
        props,
        attribs,
        classes,
        notification: nprops,
        event: domevent.type,
        altKey: domevent.altKey,
        ctrlKey: domevent.ctrlKey,
        shiftKey: domevent.shiftKey,
        metaKey: domevent.metaKey,
        pointerType: domevent.pointerType,
        nodeName: target.nodeName,
        clientId: this.clientId,
        pageName: this.pageName,
        tabId: this.tabId
      }
    };
    log("trace", "Uib:eventSend", "Sending msg to Node-RED", msg)();
    this._send(msg, this._ioChannels.client, originator);
  }
Easily send a msg back to Node-RED on a DOM event
@example In plain HTML/JavaScript
   `<button id="button1" name="button 1" data-fred="jim"></button>`
   $('#button1').onclick = (evt) => {
     uibuilder.eventSend(evt)
   }
@example
In VueJS: `<b-button id="myButton1" @click="doEvent" data-something="hello"></b-button>`
In VueJS methods: `doEvent: uibuilder.eventSend,`

All `data-` attributes will be passed back to Node-RED,
   use them instead of arguments in the click function.
   All target._ui custom properties are also passed back to Node-RED.

@param {MouseEvent|any} domevent DOM Event object
@param {string} [originator] A Node-RED node ID to return the message to