@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
5 lines (4 loc) • 1.09 kB
JavaScript
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
v3.2.1 */
import{F as r,d as i}from"./BJZTU5BQ.js";function s(){let{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function a(e){e.target.disabled&&e.preventDefault()}var o=["mousedown","mouseup","click"];function c(e){e.target.disabled&&(e.stopImmediatePropagation(),e.preventDefault())}var n={capture:!0};function m(e){if(e.disabled){e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),l(e);return}u(e),e.el.removeAttribute("aria-disabled")}function l(e){e.el.click=s,d(e.el)}function d(e){e.addEventListener("pointerdown",a,n),o.forEach(t=>e.addEventListener(t,c,n))}function u(e){delete e.el.click,f(e.el)}function f(e){e.removeEventListener("pointerdown",a,n),o.forEach(t=>e.removeEventListener(t,c,n))}var v={container:"interaction-container"},p=({children:e,disabled:t})=>i`<div class=${r(v.container)} .inert=${t}>${e}</div>`;export{m as a,p as b};