ideaz-element
Version:
<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>
56 lines (55 loc) • 1.45 kB
JavaScript
import { defineComponent as o, createVNode as a } from "vue";
import "../../../utils/index.mjs";
import "./hooks/index.mjs";
import { useNamespace as f } from "../../../hooks/useNamespace.mjs";
import { useFullscreen as s } from "./hooks/useFullScreen.mjs";
import { isFunction as t } from "../../../utils/is.mjs";
const b = /* @__PURE__ */ o({
name: "ZFullScreen",
props: {
el: {
type: [Function, HTMLElement],
default: () => document.body
},
renderExit: {
type: Function
},
renderEnter: {
type: Function
}
},
emits: ["change"],
setup(e, {
emit: i,
slots: n
}) {
const l = f("full-screen"), {
isTargetFullscreen: u,
toggleFullscreen: m
} = s({
getElement: document.body,
onFullscreenChange: (r) => {
const c = t(e.el) ? e.el() : e.el;
c && (r ? c.classList.add("z-full-screen-class") : c.classList.remove("z-full-screen-class")), i("change", r);
}
}), d = () => {
var r;
if (u.value) {
if (t(n.exit)) return n.exit();
if (t(e.renderExit)) return e.renderExit();
} else {
if (t(n.enter)) return n.enter();
if (t(e.renderEnter)) return e.renderEnter();
}
return (r = n.default) == null ? void 0 : r.call(n);
};
return () => a("div", {
class: l.b(""),
onClick: m
}, [d()]);
}
});
export {
b as default
};
//# sourceMappingURL=index.mjs.map