@qy_better_lib/hooks 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@qy_better_lib/hooks.min.js +2 -2
- package/lib/index.d.ts +0 -4
- package/lib/index.js +31 -39
- package/package.json +2 -2
- package/lib/node_modules/@qy_better_lib/core/lib/directives/click-outside.js +0 -8
- package/lib/node_modules/@qy_better_lib/core/lib/utils/is.js +0 -8
- package/lib/node_modules/@qy_better_lib/core/lib/utils/object.js +0 -15
- package/lib/use-chart/default.js +0 -11
- package/lib/use-layout-flow/index.js +0 -120
- package/lib/use-utils/use-fullscreen.js +0 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(u,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("mitt")):typeof define=="function"&&define.amd?define(["exports","vue","mitt"],f):(u=typeof globalThis<"u"?globalThis:u||self,f(u["@qy_better_lib/hooks"]={},u.vue,u.mitt))})(this,(function(u,f,R){"use strict";function C(){const t=R();return t.emitAsync=async function(n,...a){const e=this.all?.get(n);if(!e||e.length===0)return[];const r=e.map(i=>{try{const l=i(...a);return l instanceof Promise?l:Promise.resolve(l)}catch(l){return Promise.reject(l)}});return Promise.all(r)},t}const g=C();function U(t){return f.onMounted(()=>{if(t&&t.length>0)for(let n=0;n<t.length;n++){debugger;g.on(t[n].key,t[n].value)}}),f.onUnmounted(()=>{if(t&&t.length>0)for(let n=0;n<t.length;n++)g.off(t[n].key,t[n].value),g.all.delete(t[n].key)}),{emitter:g}}function M(){function t(e,r){const i=document.createElement("a");i.href=e,i.target="_blank",r&&i.setAttribute("download",r),document.body.appendChild(i),i.click(),document.body.removeChild(i)}function n(e){e.forEach(r=>{t(r.url,r.name)})}async function a(e){if(!e)return;const r=new FileReader;return r.readAsDataURL(e),new Promise((i,l)=>{r.onload=o=>i(o.target?.result),r.onerror=o=>l(void 0)})}return{downLoadFile:t,downLoadFiles:n,toBase64:a}}function F(){function t(o){let c=n(),d=e(o);document.body.appendChild(c),document.body.appendChild(d),r(d).then(()=>{window.print(),document.body.removeChild(c),document.body.removeChild(d)})}function n(o){let c=`#print-container {
|
|
2
2
|
display: none;
|
|
3
3
|
}
|
|
4
4
|
@media print {
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
#print-container {
|
|
13
13
|
display: block;
|
|
14
14
|
}
|
|
15
|
-
}`,
|
|
15
|
+
}`,d=document.createElement("style");return d.innerHTML=c,d}function a(){let o=document.getElementById("print-container");o&&document?.querySelector("body")?.removeChild(o)}function e(o){a();let c=document.createElement("div");return c.setAttribute("id","print-container"),c.innerHTML=o,c}function r(o){let c=o.querySelectorAll("img");const d=[].slice.call(c);if(d.length===0)return Promise.resolve();let m=0;return new Promise(h=>{function s(){m++,m===d.length&&h()}d.forEach(y=>{y.addEventListener("load",s),y.addEventListener("error",s)})})}function i(o){const c=document.querySelector(o);c&&t(c.innerHTML)}function l(o){let c="";for(let d=0;d<o.length;d++)c+=o[d].outerHTML;c&&t(c)}return{printHtml:i,printHtmlElement:l}}function j(){const t="A77B030B-E33D-C656-7642-56D6FEA46059";function n(r=null,i,l,o){let c=e(r,i,l,o);document.getElementById(c)===null&&(c=e(r,i,l))}function a(){document.getElementById(t)?.remove()}function e(r=null,i,l,o="#999"){const c=r!=null?document.querySelector(r):document.body,d=document.getElementById(t);d!==null&&c?.removeChild(d);let m=document.createElement("canvas");m.width=250,m.height=150;let h=m.getContext("2d");h&&(h.font="16px Avenir,Helvetica,Arial,sans-serif",h.fillStyle=o.replace(/\,\s(1|(0.\d+)\))/,", 0.1"),h.textAlign="left",h.textBaseline="middle",h.rotate(-15*Math.PI/180),h?.fillText(i,0,m.height),l&&h?.fillText(l,h.measureText(i).width+16,m.height));let s=document.createElement("div");s.id=t,s.style.pointerEvents="none",s.style.top="0px",s.style.left="0px",s.style.position="fixed",s.style.zIndex="100000";const{clientWidth:y,clientHeight:b}=document.documentElement;return s.style.width=y+"px",s.style.height=b+"px",s.style.background="url("+m.toDataURL("image/png")+") left top repeat",c?.appendChild(s),t}return{createWaterMark:n,removeWatermark:a}}function A(t){let n=0,a=!1,e,r;const{server:i,receive:l}=t;window.onbeforeunload=()=>{e?.close()};function o(){try{e=new WebSocket(i),d()}catch(s){console.log("连接建立异常",s)}}function c(){if(n>=5){e?.close();return}if(a)return!1;a=!0,r=setTimeout(function(){o(),a=!1,n++,r&&clearTimeout(r)},5e3)}function d(){e&&(e.onerror=s=>{console.log("连接错误",s),c()},e.onclose=()=>{console.log("连接关闭 - "+new Date().toLocaleTimeString()),c()},e.onopen=()=>{n=0,console.log("连接成功")},e.onmessage=s=>{try{l(s)}catch{console.log("message:"+s.data)}})}function m(s){e?.readyState===WebSocket.OPEN&&e?.send(s)}function h(){e?.close()}return{ws:e,create:o,socketClose:h,sendMessage:m}}var w=(t=>(t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t))(w||{});function p(t){return["image/png","image/jpeg","image/gif"].some(n=>n===t)}async function v(t,n=.92,a=w.JPEG){return p(a)||(a=w.JPEG),t.toDataURL(a,n)}function S(t,n=.92,a=w.JPEG){return new Promise(e=>t.toBlob(r=>e(r),a,n))}async function E(t,n){const a=t.split(",");let e=a[0].match(/:(.*?);/)?.[1];const r=atob(a[1]);let i=r.length;const l=new Uint8Array(i);for(;i--;)l[i]=r.charCodeAt(i);return p(n)&&(e=n),new Blob([l],{type:e})}function k(t){return new Promise((n,a)=>{const e=new Image;e.onload=()=>n(e),e.onerror=()=>a(new Error("dataURLtoImage(): dataURL is illegal")),e.src=t})}function z(t,n){const a=document.createElement("a");a.href=window.URL.createObjectURL(t),a.download=n||Date.now().toString(36),document.body.appendChild(a);const e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),a.dispatchEvent(e),document.body.removeChild(a)}function L(t){return new Promise(n=>{const a=new FileReader;a.onloadend=e=>n(e.target?.result),a.readAsDataURL(t)})}async function P(t,n={}){const a={...n},e=document.createElement("canvas"),r=e.getContext("2d");let i,l;for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&(a[o]=Number(a[o]));if(!a.scale)l=a.width||(a.height||0)*t.width/t.height||t.width,i=a.height||(a.width||0)*t.height/t.width||t.height;else{const o=a.scale>0&&a.scale<10?a.scale:1;l=t.width*o,i=t.height*o}switch([5,6,7,8].some(o=>o===a.orientation)?(e.height=l,e.width=i):(e.height=i,e.width=l),a.orientation){case 3:r.rotate(180*Math.PI/180),r.drawImage(t,-e.width,-e.height,e.width,e.height);break;case 6:r.rotate(90*Math.PI/180),r.drawImage(t,0,-e.width,e.height,e.width);break;case 8:r.rotate(270*Math.PI/180),r.drawImage(t,-e.height,0,e.height,e.width);break;case 2:r.translate(e.width,0),r.scale(-1,1),r.drawImage(t,0,0,e.width,e.height);break;case 4:r.translate(e.width,0),r.scale(-1,1),r.rotate(180*Math.PI/180),r.drawImage(t,-e.width,-e.height,e.width,e.height);break;case 5:r.translate(e.width,0),r.scale(-1,1),r.rotate(90*Math.PI/180),r.drawImage(t,0,-e.width,e.height,e.width);break;case 7:r.translate(e.width,0),r.scale(-1,1),r.rotate(270*Math.PI/180),r.drawImage(t,-e.height,0,e.height,e.width);break;default:r.drawImage(t,0,0,e.width,e.height)}return e}function B(t){return fetch(t).then(n=>n.blob())}function D(t){return new Promise((n,a)=>{const e=new Image;e.onload=()=>n(e),e.onerror=()=>a(new Error("urltoImage(): Image failed to load, please check the image URL")),e.src=t})}async function T(t,n={}){if(!(t instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if(typeof n!="object"&&(n=Object.assign({quality:n})),n.quality=Number(n.quality),Number.isNaN(n.quality))return t;const a=await L(t);let e=a.split(",")[0].match(/:(.*?);/)?.[1],r=w.JPEG;p(n.type)&&(r=n.type,e=n.type);const i=await k(a),l=await P(i,Object.assign({},n)),o=await v(l,n.quality,r),c=await E(o,e);return c.size>t.size?t:c}async function q(t,n={}){if(!(t instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if(typeof n!="object"&&(n=Object.assign({size:n})),n.size=Number(n.size),Number.isNaN(n.size)||n.size*1024>t.size)return t;n.accuracy=Number(n.accuracy),(!n.accuracy||n.accuracy<.8||n.accuracy>.99)&&(n.accuracy=.95);const a={max:n.size*(2-n.accuracy)*1024,accurate:n.size*1024,min:n.size*n.accuracy*1024},e=await L(t);let r=e.split(",")[0].match(/:(.*?);/)?.[1],i=w.JPEG;p(n.type)&&(i=n.type,r=n.type);const l=await k(e),o=await P(l,Object.assign({},n)),c=.75;let d=1,m;const h=new Array(2);for(let y=1;y<=7;y++){m=await v(o,d,i);const b=m.length*c;if(y===7){(a.max<b||a.min>b)&&(m=[m,...h].filter(I=>I).sort((I,H)=>Math.abs(I.length*c-a.accurate)-Math.abs(H.length*c-a.accurate))[0]);break}if(a.max<b)h[1]=m,d-=.5**(y+1);else if(a.min>b)h[0]=m,d+=.5**(y+1);else break}const s=await E(m,r);return s.size>t.size?t:s}u.canvastoDataURL=v,u.canvastoFile=S,u.compress=T,u.compressAccurately=q,u.dataURLtoFile=E,u.dataURLtoImage=k,u.downloadFile=z,u.filetoDataURL=L,u.imagetoCanvas=P,u.urltoBlob=B,u.urltoImage=D,u.useEmits=U,u.useFile=M,u.usePrintHtml=F,u.useWaterMark=j,u.useWebSocket=A,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
import { useEmits as
|
|
2
|
-
import { useFile as
|
|
3
|
-
import { usePrintHtml as
|
|
4
|
-
import { useWaterMark as
|
|
5
|
-
import { useWebSocket as
|
|
6
|
-
import { compress as
|
|
7
|
-
import "./
|
|
8
|
-
import "./use-
|
|
9
|
-
import "
|
|
10
|
-
import {
|
|
11
|
-
import "
|
|
12
|
-
import {
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as W } from "./use-image/dataURLtoImage.js";
|
|
17
|
-
import { default as B } from "./use-image/downloadFile.js";
|
|
18
|
-
import { default as E } from "./use-image/filetoDataURL.js";
|
|
19
|
-
import { default as M } from "./use-image/imagetoCanvas.js";
|
|
20
|
-
import { default as h } from "./use-image/urltoBlob.js";
|
|
21
|
-
import { default as q } from "./use-image/urltoImage.js";
|
|
1
|
+
import { useEmits as t } from "./use-emit/index.js";
|
|
2
|
+
import { useFile as r } from "./use-file/index.js";
|
|
3
|
+
import { usePrintHtml as m } from "./use-print/index.js";
|
|
4
|
+
import { useWaterMark as l } from "./use-waterMark/index.js";
|
|
5
|
+
import { useWebSocket as u } from "./use-websocket/index.js";
|
|
6
|
+
import { compress as d, compressAccurately as i } from "./use-image/index.js";
|
|
7
|
+
import { default as n } from "./use-image/canvastoDataURL.js";
|
|
8
|
+
import { default as L } from "./use-image/canvastoFile.js";
|
|
9
|
+
import { default as U } from "./use-image/dataURLtoFile.js";
|
|
10
|
+
import { default as v } from "./use-image/dataURLtoImage.js";
|
|
11
|
+
import { default as k } from "./use-image/downloadFile.js";
|
|
12
|
+
import { default as I } from "./use-image/filetoDataURL.js";
|
|
13
|
+
import { default as w } from "./use-image/imagetoCanvas.js";
|
|
14
|
+
import { default as A } from "./use-image/urltoBlob.js";
|
|
15
|
+
import { default as C } from "./use-image/urltoImage.js";
|
|
22
16
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
u as
|
|
39
|
-
d as useWaterMark,
|
|
40
|
-
c as useWebSocket
|
|
17
|
+
n as canvastoDataURL,
|
|
18
|
+
L as canvastoFile,
|
|
19
|
+
d as compress,
|
|
20
|
+
i as compressAccurately,
|
|
21
|
+
U as dataURLtoFile,
|
|
22
|
+
v as dataURLtoImage,
|
|
23
|
+
k as downloadFile,
|
|
24
|
+
I as filetoDataURL,
|
|
25
|
+
w as imagetoCanvas,
|
|
26
|
+
A as urltoBlob,
|
|
27
|
+
C as urltoImage,
|
|
28
|
+
t as useEmits,
|
|
29
|
+
r as useFile,
|
|
30
|
+
m as usePrintHtml,
|
|
31
|
+
l as useWaterMark,
|
|
32
|
+
u as useWebSocket
|
|
41
33
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qy_better_lib/hooks",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7",
|
|
5
5
|
"description": "qy better lib hooks",
|
|
6
6
|
"author": "luhuiming",
|
|
7
7
|
"license": "ISC",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"./use-chart": "./lib/use-chart/index.js",
|
|
38
38
|
"./use-chart/*": "./lib/use-chart/*/*.js",
|
|
39
39
|
"./use-utils": "./lib/use-utils/index.js",
|
|
40
|
-
"./use-
|
|
40
|
+
"./use-utils/*": "./lib/use-utils/*/*.js"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@antv/x6": "^2.18.1",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { isClient as s } from "../utils/is.js";
|
|
2
|
-
const d = /* @__PURE__ */ new Map();
|
|
3
|
-
let n;
|
|
4
|
-
s && (document.addEventListener("mousedown", (e) => n = e), document.addEventListener("mouseup", (e) => {
|
|
5
|
-
for (const o of d.values())
|
|
6
|
-
for (const { documentHandler: t } of o)
|
|
7
|
-
t(e, n);
|
|
8
|
-
}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isObject as i } from "./is.js";
|
|
2
|
-
function f(...e) {
|
|
3
|
-
let l = e.length, o = e[0];
|
|
4
|
-
i(o) || (o = {});
|
|
5
|
-
for (let n = 1; n < l; n++) {
|
|
6
|
-
let r = e[n];
|
|
7
|
-
if (i(r))
|
|
8
|
-
for (let t in r)
|
|
9
|
-
t === "__proto__" || o === r[t] || (i(r[t]) ? o[t] = f(o[t], r[t]) : o[t] = r[t]);
|
|
10
|
-
}
|
|
11
|
-
return o;
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
f as deepAssign
|
|
15
|
-
};
|
package/lib/use-chart/default.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
t(12), t(14), t(12), t(8), t(16), t(12), t(12), t(12), t(12);
|
|
2
|
-
function t(e, n = 1920) {
|
|
3
|
-
if (!e) return;
|
|
4
|
-
let i = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
|
5
|
-
if (!i) return e;
|
|
6
|
-
let o = i / n;
|
|
7
|
-
return Number((e * o).toFixed(3));
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
t as auto_chart_size
|
|
11
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Graph as x } from "@antv/x6";
|
|
2
|
-
import { deepAssign as F } from "../node_modules/@qy_better_lib/core/lib/utils/object.js";
|
|
3
|
-
import "../node_modules/@qy_better_lib/core/lib/directives/click-outside.js";
|
|
4
|
-
import y from "dagre";
|
|
5
|
-
function k(E) {
|
|
6
|
-
let c;
|
|
7
|
-
const B = {
|
|
8
|
-
panning: !0,
|
|
9
|
-
// 画布可拖动
|
|
10
|
-
interacting: !1,
|
|
11
|
-
// 边、节点是否可以拖动大小调整等
|
|
12
|
-
mousewheel: {
|
|
13
|
-
enabled: !0
|
|
14
|
-
// 开启滚轮交互
|
|
15
|
-
},
|
|
16
|
-
scaling: { min: 0.1, max: 10 }
|
|
17
|
-
};
|
|
18
|
-
function w(t) {
|
|
19
|
-
const e = F(B, E);
|
|
20
|
-
c = new x({ container: t, ...e });
|
|
21
|
-
}
|
|
22
|
-
function _(t) {
|
|
23
|
-
c.resetCells(t);
|
|
24
|
-
}
|
|
25
|
-
function N(t, e = "LR") {
|
|
26
|
-
const { node_w: o, node_h: a, nodesep: h, ranksep: f } = t, O = c.getNodes(), m = c.getEdges(), g = new y.graphlib.Graph();
|
|
27
|
-
g.setGraph({ rankdir: e, nodesep: h, ranksep: f }), g.setDefaultEdgeLabel(() => ({}));
|
|
28
|
-
const S = o, V = a;
|
|
29
|
-
O.forEach((s) => {
|
|
30
|
-
g.setNode(s.id, { width: S, height: V });
|
|
31
|
-
}), m.forEach((s) => {
|
|
32
|
-
const i = s.getSource(), u = s.getTarget();
|
|
33
|
-
g.setEdge(i.cell, u.cell);
|
|
34
|
-
}), y.layout(g), g.nodes().forEach((s) => {
|
|
35
|
-
const i = c.getCellById(s);
|
|
36
|
-
if (i) {
|
|
37
|
-
const u = g.node(s);
|
|
38
|
-
i.position(u.x, u.y);
|
|
39
|
-
}
|
|
40
|
-
}), m.forEach((s) => {
|
|
41
|
-
const i = s.getSourceNode(), u = s.getTargetNode(), n = i.getBBox(), r = u.getBBox();
|
|
42
|
-
if ((e === "LR" || e === "RL") && n.y !== r.y) {
|
|
43
|
-
const l = e === "LR" ? r.x - n.x - n.width : -n.x + r.x + r.width, p = e === "LR" ? n.width : 0, d = n.x + p + l / 2;
|
|
44
|
-
s.setVertices([
|
|
45
|
-
{ x: d, y: n.center.y },
|
|
46
|
-
{ x: d, y: r.center.y }
|
|
47
|
-
]);
|
|
48
|
-
} else if ((e === "TB" || e === "BT") && n.x !== r.x) {
|
|
49
|
-
const l = e === "TB" ? r.y - n.y - n.height : -n.y + r.y + r.height, p = e === "TB" ? n.height : 0, d = n.y + p + l / 2;
|
|
50
|
-
s.setVertices([
|
|
51
|
-
{ x: n.center.x, y: d },
|
|
52
|
-
{ x: r.center.x, y: d }
|
|
53
|
-
]);
|
|
54
|
-
} else
|
|
55
|
-
s.setVertices([]);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function L(t) {
|
|
59
|
-
c.zoomToFit({ padding: t, maxScale: 1.2 }), c.centerContent();
|
|
60
|
-
}
|
|
61
|
-
function T(t) {
|
|
62
|
-
const e = [];
|
|
63
|
-
return t.forEach((o) => {
|
|
64
|
-
const a = c.createNode(o);
|
|
65
|
-
e.push(a);
|
|
66
|
-
}), e;
|
|
67
|
-
}
|
|
68
|
-
function b(t) {
|
|
69
|
-
const e = [];
|
|
70
|
-
return t.forEach((o) => {
|
|
71
|
-
const a = c.createEdge({
|
|
72
|
-
shape: o.shape,
|
|
73
|
-
source: { cell: o.source_id },
|
|
74
|
-
target: { cell: o.target_id }
|
|
75
|
-
});
|
|
76
|
-
e.push(a);
|
|
77
|
-
}), e;
|
|
78
|
-
}
|
|
79
|
-
function R(t) {
|
|
80
|
-
Object.keys(t).forEach((o) => {
|
|
81
|
-
const a = t[o];
|
|
82
|
-
t[o] = e(a, "g", c), c.on(o, t[o]);
|
|
83
|
-
});
|
|
84
|
-
function e(o, a, h) {
|
|
85
|
-
return function(...f) {
|
|
86
|
-
return f[0][a] = h, o.apply(this, f);
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function C(t) {
|
|
91
|
-
Object.keys(t.nodes).forEach((e) => {
|
|
92
|
-
const o = t.nodes[e];
|
|
93
|
-
x.registerNode(e, o, !0);
|
|
94
|
-
}), Object.keys(t.edges).forEach((e) => {
|
|
95
|
-
const o = t.edges[e];
|
|
96
|
-
x.registerEdge(e, o, !0);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
function j() {
|
|
100
|
-
return c.getNodes();
|
|
101
|
-
}
|
|
102
|
-
function G() {
|
|
103
|
-
c?.clearCells();
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
init: w,
|
|
107
|
-
add_graph_elements: _,
|
|
108
|
-
layout: N,
|
|
109
|
-
center_content: L,
|
|
110
|
-
createNodes: T,
|
|
111
|
-
createEdges: b,
|
|
112
|
-
register_event: R,
|
|
113
|
-
register_custom_elements: C,
|
|
114
|
-
get_nodes: j,
|
|
115
|
-
clear: G
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
export {
|
|
119
|
-
k as useLayoutFlow
|
|
120
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ref as c, shallowRef as r, onMounted as o, onUnmounted as a } from "vue";
|
|
2
|
-
function f(u) {
|
|
3
|
-
const l = c(!1);
|
|
4
|
-
let e = r(null);
|
|
5
|
-
o(() => {
|
|
6
|
-
e.value = document.querySelector(u), e.value?.addEventListener("fullscreenchange", n);
|
|
7
|
-
}), a(() => {
|
|
8
|
-
e.value?.removeEventListener("fullscreenchange", n);
|
|
9
|
-
});
|
|
10
|
-
function t() {
|
|
11
|
-
l.value ? document.exitFullscreen && document.exitFullscreen() : e.value?.requestFullscreen && e.value?.requestFullscreen(), l.value = !l.value;
|
|
12
|
-
}
|
|
13
|
-
function n() {
|
|
14
|
-
l.value = document.fullscreenElement === e.value;
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
container: e,
|
|
18
|
-
full: l,
|
|
19
|
-
on_change: t
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
f as useFullScreen
|
|
24
|
-
};
|