chunk-4LXFBVBS.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // node_modules/@esri/calcite-components/dist/components/interactive.js
  2. function noopClick() {
  3. }
  4. function updateHostInteraction(component, hostIsTabbable = false) {
  5. if (component.disabled) {
  6. component.el.setAttribute("tabindex", "-1");
  7. component.el.setAttribute("aria-disabled", "true");
  8. if (component.el.contains(document.activeElement)) {
  9. document.activeElement.blur();
  10. }
  11. component.el.click = noopClick;
  12. return;
  13. }
  14. component.el.click = HTMLElement.prototype.click;
  15. if (typeof hostIsTabbable === "function") {
  16. component.el.setAttribute("tabindex", hostIsTabbable.call(component) ? "0" : "-1");
  17. } else if (hostIsTabbable === true) {
  18. component.el.setAttribute("tabindex", "0");
  19. } else if (hostIsTabbable === false) {
  20. component.el.removeAttribute("tabindex");
  21. } else
  22. ;
  23. component.el.removeAttribute("aria-disabled");
  24. }
  25. export {
  26. updateHostInteraction
  27. };
  28. /*!
  29. * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  30. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
  31. * v1.0.0-beta.97
  32. */
  33. //# sourceMappingURL=chunk-4LXFBVBS.js.map