feat(core): remove closestPolyfill

This commit is contained in:
gvangeest 2021-12-29 14:15:45 +01:00
parent 495cb0c500
commit 8301191814
5 changed files with 7 additions and 29 deletions

View file

@ -0,0 +1,6 @@
---
'@lion/core': minor
'@lion/listbox': minor
---
Remove closestPolyfill

View file

@ -1 +0,0 @@
import './src/closestPolyfill.js';

View file

@ -30,9 +30,7 @@
"prepublishOnly": "npm run publish-docs",
"test": "cd ../../ && npm run test:browser -- --group core"
},
"sideEffects": [
"./closestPolyfill.js"
],
"sideEffects": false,
"dependencies": {
"@open-wc/dedupe-mixin": "^1.3.0",
"@open-wc/scoped-elements": "^2.0.1",
@ -47,7 +45,6 @@
},
"exports": {
".": "./index.js",
"./closestPolyfill": "./src/closestPolyfill.js",
"./docs/*": "./docs/*"
}
}

View file

@ -1,23 +0,0 @@
// @ts-nocheck
/* eslint-disable */
/**
* From: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
*/
if (!Element.prototype.matches) {
Element.prototype.matches =
Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
if (!Element.prototype.closest) {
Element.prototype.closest = function (s) {
var el = this;
do {
if (Element.prototype.matches.call(el, s)) return el;
el = el.parentElement || el.parentNode;
} while (el !== null && el.nodeType === 1);
return null;
};
}

View file

@ -1,5 +1,4 @@
import { css, dedupeMixin, html, ScopedElementsMixin, SlotMixin } from '@lion/core';
import '@lion/core/closestPolyfill';
import { ChoiceGroupMixin, FormControlMixin, FormRegistrarMixin } from '@lion/form-core';
import { LionOptions } from './LionOptions.js';