feat(core): remove closestPolyfill
This commit is contained in:
parent
495cb0c500
commit
8301191814
5 changed files with 7 additions and 29 deletions
6
.changeset/spotty-zebras-sip.md
Normal file
6
.changeset/spotty-zebras-sip.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
'@lion/core': minor
|
||||||
|
'@lion/listbox': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Remove closestPolyfill
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import './src/closestPolyfill.js';
|
|
||||||
|
|
@ -30,9 +30,7 @@
|
||||||
"prepublishOnly": "npm run publish-docs",
|
"prepublishOnly": "npm run publish-docs",
|
||||||
"test": "cd ../../ && npm run test:browser -- --group core"
|
"test": "cd ../../ && npm run test:browser -- --group core"
|
||||||
},
|
},
|
||||||
"sideEffects": [
|
"sideEffects": false,
|
||||||
"./closestPolyfill.js"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@open-wc/dedupe-mixin": "^1.3.0",
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
||||||
"@open-wc/scoped-elements": "^2.0.1",
|
"@open-wc/scoped-elements": "^2.0.1",
|
||||||
|
|
@ -47,7 +45,6 @@
|
||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./index.js",
|
".": "./index.js",
|
||||||
"./closestPolyfill": "./src/closestPolyfill.js",
|
|
||||||
"./docs/*": "./docs/*"
|
"./docs/*": "./docs/*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { css, dedupeMixin, html, ScopedElementsMixin, SlotMixin } from '@lion/core';
|
import { css, dedupeMixin, html, ScopedElementsMixin, SlotMixin } from '@lion/core';
|
||||||
import '@lion/core/closestPolyfill';
|
|
||||||
import { ChoiceGroupMixin, FormControlMixin, FormRegistrarMixin } from '@lion/form-core';
|
import { ChoiceGroupMixin, FormControlMixin, FormRegistrarMixin } from '@lion/form-core';
|
||||||
import { LionOptions } from './LionOptions.js';
|
import { LionOptions } from './LionOptions.js';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue