From 1029ec770fd9a9404d3fb95e95f7b94d3afc2c0c Mon Sep 17 00:00:00 2001 From: Wesley Luyten Date: Sat, 17 Jun 2023 14:15:53 -0500 Subject: [PATCH] fix: upgrade esbuild. simple class static props related https://github.com/evanw/esbuild/issues/2416 --- package.json | 4 ++-- src/option.js | 7 ++----- src/selectmenu.js | 7 ++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 3194e44..a8ed0b2 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "esbuild": "^0.17.11", - "wet-run": "^0.0.7" + "esbuild": "^0.18.4", + "wet-run": "^0.2.0" }, "eslintConfig": { "root": true, diff --git a/src/option.js b/src/option.js index 0923ad0..385636b 100644 --- a/src/option.js +++ b/src/option.js @@ -35,6 +35,8 @@ template.innerHTML = /* html */` `; class OptionElement extends globalThis.HTMLElement { + static formAssociated = true; + static observedAttributes = ['disabled', 'selected']; /** @see https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-dirtiness */ #dirty = false; #internals; @@ -143,11 +145,6 @@ class OptionElement extends globalThis.HTMLElement { } } -// Define as an external static so esbuild doesn't add unnecessary transforms -// see https://github.com/evanw/esbuild/issues/2416 -OptionElement.formAssociated = true; -OptionElement.observedAttributes = ['disabled', 'selected']; - if (!globalThis.customElements.get('x-option')) { globalThis.customElements.define('x-option', OptionElement); } diff --git a/src/selectmenu.js b/src/selectmenu.js index 9b45c04..3bfb42d 100644 --- a/src/selectmenu.js +++ b/src/selectmenu.js @@ -126,6 +126,8 @@ template.innerHTML = /* html */` `; class SelectMenuElement extends globalThis.HTMLElement { + static formAssociated = true; + static observedAttributes = ['disabled', 'required', 'multiple']; #internals; constructor() { @@ -462,11 +464,6 @@ class SelectMenuElement extends globalThis.HTMLElement { } } -// Define as an external static so esbuild doesn't add unnecessary transforms -// see https://github.com/evanw/esbuild/issues/2416 -SelectMenuElement.formAssociated = true; -SelectMenuElement.observedAttributes = ['disabled', 'required', 'multiple']; - function reposition(reference, popover) { let { style } = getCSSRule(reference.shadowRoot,