-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
26 lines (23 loc) · 960 Bytes
/
Copy pathmain.js
File metadata and controls
26 lines (23 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Primary Imports
import {
CheckboxGroup,
ComboboxField,
ComboboxListbox,
ComboboxOption,
SelectEnhancer,
} from "@itenthusiasm/custom-elements";
/* -------------------- "App Logic" -------------------- */
customElements.define("checkbox-group", CheckboxGroup);
customElements.define("combobox-listbox", ComboboxListbox);
customElements.define("combobox-field", ComboboxField);
customElements.define("combobox-option", ComboboxOption);
customElements.define("select-enhancer", SelectEnhancer);
/* -------------------- Handlers for Debugging -------------------- */
document.querySelector("form")?.addEventListener("submit", handleSubmit);
/** @param {SubmitEvent} event */
function handleSubmit(event) {
event.preventDefault();
const form = /** @type {HTMLFormElement} */ (event.currentTarget);
console.log(Object.fromEntries(new FormData(form))); // eslint-disable-line no-console
console.log(event); // eslint-disable-line no-console
}