ion-backdrop.cjs.entry.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*!
  2. * (C) Ionic http://ionicframework.com - MIT License
  3. */
  4. 'use strict';
  5. Object.defineProperty(exports, '__esModule', { value: true });
  6. const index = require('./index-2e236a04.js');
  7. const ionicGlobal = require('./ionic-global-6dea5a96.js');
  8. require('./index-cc858e97.js');
  9. const backdropIosCss = ":host{left:0;right:0;top:0;bottom:0;display:block;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);contain:strict;cursor:pointer;opacity:0.01;-ms-touch-action:none;touch-action:none;z-index:2}:host(.backdrop-hide){background:transparent}:host(.backdrop-no-tappable){cursor:auto}:host{background-color:var(--ion-backdrop-color, #000)}";
  10. const IonBackdropIosStyle0 = backdropIosCss;
  11. const backdropMdCss = ":host{left:0;right:0;top:0;bottom:0;display:block;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);contain:strict;cursor:pointer;opacity:0.01;-ms-touch-action:none;touch-action:none;z-index:2}:host(.backdrop-hide){background:transparent}:host(.backdrop-no-tappable){cursor:auto}:host{background-color:var(--ion-backdrop-color, #000)}";
  12. const IonBackdropMdStyle0 = backdropMdCss;
  13. const Backdrop = class {
  14. constructor(hostRef) {
  15. index.registerInstance(this, hostRef);
  16. this.ionBackdropTap = index.createEvent(this, "ionBackdropTap", 7);
  17. this.visible = true;
  18. this.tappable = true;
  19. this.stopPropagation = true;
  20. }
  21. onMouseDown(ev) {
  22. this.emitTap(ev);
  23. }
  24. emitTap(ev) {
  25. if (this.stopPropagation) {
  26. ev.preventDefault();
  27. ev.stopPropagation();
  28. }
  29. if (this.tappable) {
  30. this.ionBackdropTap.emit();
  31. }
  32. }
  33. render() {
  34. const mode = ionicGlobal.getIonMode(this);
  35. return (index.h(index.Host, { key: '7abaf2c310aa399607451b14063265e8a5846938', "aria-hidden": "true", class: {
  36. [mode]: true,
  37. 'backdrop-hide': !this.visible,
  38. 'backdrop-no-tappable': !this.tappable,
  39. } }));
  40. }
  41. };
  42. Backdrop.style = {
  43. ios: IonBackdropIosStyle0,
  44. md: IonBackdropMdStyle0
  45. };
  46. exports.ion_backdrop = Backdrop;