mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.9 KiB
75 lines
2.9 KiB
/*!
|
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
*/
|
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
import { b as getIonMode } from './ionic-global.js';
|
|
|
|
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)}";
|
|
|
|
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)}";
|
|
|
|
const Backdrop = /*@__PURE__*/ proxyCustomElement(class Backdrop extends HTMLElement {
|
|
constructor(registerHost) {
|
|
super();
|
|
if (registerHost !== false) {
|
|
this.__registerHost();
|
|
}
|
|
this.__attachShadow();
|
|
this.ionBackdropTap = createEvent(this, "ionBackdropTap", 7);
|
|
/**
|
|
* If `true`, the backdrop will be visible.
|
|
*/
|
|
this.visible = true;
|
|
/**
|
|
* If `true`, the backdrop will can be clicked and will emit the `ionBackdropTap` event.
|
|
*/
|
|
this.tappable = true;
|
|
/**
|
|
* If `true`, the backdrop will stop propagation on tap.
|
|
*/
|
|
this.stopPropagation = true;
|
|
}
|
|
onMouseDown(ev) {
|
|
this.emitTap(ev);
|
|
}
|
|
emitTap(ev) {
|
|
if (this.stopPropagation) {
|
|
ev.preventDefault();
|
|
ev.stopPropagation();
|
|
}
|
|
if (this.tappable) {
|
|
this.ionBackdropTap.emit();
|
|
}
|
|
}
|
|
render() {
|
|
const mode = getIonMode(this);
|
|
return (h(Host, { key: '7abaf2c310aa399607451b14063265e8a5846938', "aria-hidden": "true", class: {
|
|
[mode]: true,
|
|
'backdrop-hide': !this.visible,
|
|
'backdrop-no-tappable': !this.tappable,
|
|
} }));
|
|
}
|
|
static get style() { return {
|
|
ios: backdropIosCss,
|
|
md: backdropMdCss
|
|
}; }
|
|
}, [289, "ion-backdrop", {
|
|
"visible": [4],
|
|
"tappable": [4],
|
|
"stopPropagation": [4, "stop-propagation"]
|
|
}, [[2, "click", "onMouseDown"]]]);
|
|
function defineCustomElement() {
|
|
if (typeof customElements === "undefined") {
|
|
return;
|
|
}
|
|
const components = ["ion-backdrop"];
|
|
components.forEach(tagName => { switch (tagName) {
|
|
case "ion-backdrop":
|
|
if (!customElements.get(tagName)) {
|
|
customElements.define(tagName, Backdrop);
|
|
}
|
|
break;
|
|
} });
|
|
}
|
|
|
|
export { Backdrop as B, defineCustomElement as d };
|
|
|