@v-c/trigger 0.0.1 → 0.0.4
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/Popup/Arrow.cjs +1 -1
- package/dist/Popup/Arrow.js +36 -33
- package/dist/Popup/Mask.cjs +1 -1
- package/dist/Popup/Mask.js +25 -19
- package/dist/Popup/PopupContent.cjs +1 -1
- package/dist/Popup/PopupContent.js +7 -6
- package/dist/Popup/index.cjs +1 -1
- package/dist/Popup/index.js +152 -116
- package/dist/UniqueProvider/UniqueContainer.cjs +1 -1
- package/dist/UniqueProvider/UniqueContainer.js +55 -41
- package/dist/UniqueProvider/index.cjs +1 -1
- package/dist/UniqueProvider/index.js +24 -24
- package/dist/hooks/useAlign.cjs +1 -1
- package/dist/hooks/useAlign.js +125 -118
- package/dist/hooks/useWinClick.cjs +1 -1
- package/dist/hooks/useWinClick.js +14 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +276 -235
- package/package.json +3 -3
- package/dist/portal/dist/Context.cjs +0 -1
- package/dist/portal/dist/Context.js +0 -14
- package/dist/portal/dist/Portal.cjs +0 -1
- package/dist/portal/dist/Portal.js +0 -73
- package/dist/portal/dist/useDom.cjs +0 -1
- package/dist/portal/dist/useDom.js +0 -34
- package/dist/portal/dist/useScrollLocker.cjs +0 -5
- package/dist/portal/dist/useScrollLocker.js +0 -28
- package/dist/portal/dist/util.cjs +0 -1
- package/dist/portal/dist/util.js +0 -6
- package/dist/resize-observer/dist/Collection.cjs +0 -1
- package/dist/resize-observer/dist/Collection.js +0 -32
- package/dist/resize-observer/dist/SingleObserver/DomWrapper.cjs +0 -1
- package/dist/resize-observer/dist/SingleObserver/DomWrapper.js +0 -11
- package/dist/resize-observer/dist/SingleObserver/index.cjs +0 -1
- package/dist/resize-observer/dist/SingleObserver/index.js +0 -81
- package/dist/resize-observer/dist/index.cjs +0 -1
- package/dist/resize-observer/dist/index.js +0 -44
- package/dist/resize-observer/dist/utils/observerUtil.cjs +0 -1
- package/dist/resize-observer/dist/utils/observerUtil.js +0 -21
- package/dist/util/dist/Children/isFragment.cjs +0 -1
- package/dist/util/dist/Children/isFragment.js +0 -7
- package/dist/util/dist/Children/toArray.cjs +0 -1
- package/dist/util/dist/Children/toArray.js +0 -11
- package/dist/util/dist/Dom/canUseDom.cjs +0 -1
- package/dist/util/dist/Dom/canUseDom.js +0 -6
- package/dist/util/dist/Dom/contains.cjs +0 -1
- package/dist/util/dist/Dom/contains.js +0 -16
- package/dist/util/dist/Dom/dynamicCSS.cjs +0 -1
- package/dist/util/dist/Dom/dynamicCSS.js +0 -73
- package/dist/util/dist/Dom/findDOMNode.cjs +0 -1
- package/dist/util/dist/Dom/findDOMNode.js +0 -12
- package/dist/util/dist/Dom/isVisible.cjs +0 -1
- package/dist/util/dist/Dom/isVisible.js +0 -22
- package/dist/util/dist/Dom/shadow.cjs +0 -1
- package/dist/util/dist/Dom/shadow.js +0 -13
- package/dist/util/dist/classnames.cjs +0 -1
- package/dist/util/dist/classnames.js +0 -30
- package/dist/util/dist/getScrollBarSize.cjs +0 -1
- package/dist/util/dist/getScrollBarSize.js +0 -37
- package/dist/util/dist/props-util/index.cjs +0 -1
- package/dist/util/dist/props-util/index.js +0 -21
- package/dist/util/dist/raf.cjs +0 -1
- package/dist/util/dist/raf.js +0 -37
- package/dist/util/dist/utils/transition.cjs +0 -1
- package/dist/util/dist/utils/transition.js +0 -21
- package/dist/util/dist/warning.cjs +0 -1
- package/dist/util/dist/warning.js +0 -48
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/trigger",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"vue": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@v-c/portal": "0.0.
|
|
32
|
+
"@v-c/portal": "0.0.2",
|
|
33
33
|
"@v-c/resize-observer": "0.0.2",
|
|
34
|
-
"@v-c/util": "0.0.
|
|
34
|
+
"@v-c/util": "0.0.9"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vite build",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),e=Symbol("QueueContextKey");function u(n){const t=n;return o.provide(e,t),t}function r(){return o.inject(e,void 0)}exports.QueueContextKey=e;exports.useContextProvider=u;exports.useContextState=r;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { provide as n, inject as r } from "vue";
|
|
2
|
-
const t = Symbol("QueueContextKey");
|
|
3
|
-
function i(o) {
|
|
4
|
-
const e = o;
|
|
5
|
-
return n(t, e), e;
|
|
6
|
-
}
|
|
7
|
-
function s() {
|
|
8
|
-
return r(t, void 0);
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
t as QueueContextKey,
|
|
12
|
-
i as useContextProvider,
|
|
13
|
-
s as useContextState
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),p=require("../../util/dist/warning.cjs"),l=require("../../util/dist/Dom/canUseDom.cjs"),v=require("../../util/dist/props-util/index.cjs"),y=require("./Context.cjs"),g=require("./useDom.cjs"),m=require("./useScrollLocker.cjs");function q(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}function a(e){return e===!1?!1:!l.default()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e}const C={autoDestroy:!0,getContainer:void 0},S=t.defineComponent((e,{slots:d})=>{const s=t.shallowRef(e.open),i=t.computed(()=>s.value||e.open);process.env.NODE_ENV!=="production"&&p.default(l.default()||!open,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),t.watch([()=>e.open,()=>e.autoDestroy],()=>{(e.autoDestroy||e.open)&&(s.value=e.open)});const o=t.shallowRef(a(e.getContainer));t.onMounted(()=>{const n=a(e.getContainer);o.value=n??null}),t.watch(()=>e.getContainer,()=>{const n=a(e.getContainer);o.value=n??null});const[c,f]=g.default(t.computed(()=>!!(i.value&&!o.value)),e.debug);y.useContextProvider(f);const u=t.computed(()=>o.value??c);return m.default(t.computed(()=>!!(e.autoLock&&e.open&&l.default()&&(u.value===c||u.value===document.body)))),()=>{if(!i.value||!l.default()||o.value===void 0)return null;const n=u.value===!1,r=v.filterEmpty(d.default?.()??[]);return n?r:t.createVNode(t.Teleport,{to:u.value},q(r)?r:{default:()=>[r]})}},{props:t.mergeDefaults({getContainer:{type:[String,Function,Boolean],required:!1,skipCheck:!0},open:{type:Boolean,required:!1},autoDestroy:{type:Boolean,required:!1},autoLock:{type:Boolean,required:!1},debug:{type:String,required:!1}},C),name:"Portal",inheritAttrs:!1});exports.default=S;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { defineComponent as y, shallowRef as p, computed as a, watch as c, onMounted as v, createVNode as g, Teleport as C, mergeDefaults as b, isVNode as q } from "vue";
|
|
2
|
-
import D from "../../util/dist/warning.js";
|
|
3
|
-
import u from "../../util/dist/Dom/canUseDom.js";
|
|
4
|
-
import { filterEmpty as S } from "../../util/dist/props-util/index.js";
|
|
5
|
-
import { useContextProvider as h } from "./Context.js";
|
|
6
|
-
import k from "./useDom.js";
|
|
7
|
-
import w from "./useScrollLocker.js";
|
|
8
|
-
function B(e) {
|
|
9
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !q(e);
|
|
10
|
-
}
|
|
11
|
-
function l(e) {
|
|
12
|
-
return e === !1 ? !1 : !u() || !e ? null : typeof e == "string" ? document.querySelector(e) : typeof e == "function" ? e() : e;
|
|
13
|
-
}
|
|
14
|
-
const P = {
|
|
15
|
-
autoDestroy: !0,
|
|
16
|
-
getContainer: void 0
|
|
17
|
-
}, R = /* @__PURE__ */ y((e, {
|
|
18
|
-
slots: d
|
|
19
|
-
}) => {
|
|
20
|
-
const i = p(e.open), s = a(() => i.value || e.open);
|
|
21
|
-
process.env.NODE_ENV !== "production" && D(u() || !open, "Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."), c([() => e.open, () => e.autoDestroy], () => {
|
|
22
|
-
(e.autoDestroy || e.open) && (i.value = e.open);
|
|
23
|
-
});
|
|
24
|
-
const o = p(l(e.getContainer));
|
|
25
|
-
v(() => {
|
|
26
|
-
const t = l(e.getContainer);
|
|
27
|
-
o.value = t ?? null;
|
|
28
|
-
}), c(() => e.getContainer, () => {
|
|
29
|
-
const t = l(e.getContainer);
|
|
30
|
-
o.value = t ?? null;
|
|
31
|
-
});
|
|
32
|
-
const [f, m] = k(a(() => !!(s.value && !o.value)), e.debug);
|
|
33
|
-
h(m);
|
|
34
|
-
const n = a(() => o.value ?? f);
|
|
35
|
-
return w(a(() => !!(e.autoLock && e.open && u() && (n.value === f || n.value === document.body)))), () => {
|
|
36
|
-
if (!s.value || !u() || o.value === void 0) return null;
|
|
37
|
-
const t = n.value === !1, r = S(d.default?.() ?? []);
|
|
38
|
-
return t ? r : g(C, {
|
|
39
|
-
to: n.value
|
|
40
|
-
}, B(r) ? r : {
|
|
41
|
-
default: () => [r]
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
}, {
|
|
45
|
-
props: /* @__PURE__ */ b({
|
|
46
|
-
getContainer: {
|
|
47
|
-
type: [String, Function, Boolean],
|
|
48
|
-
required: !1,
|
|
49
|
-
skipCheck: !0
|
|
50
|
-
},
|
|
51
|
-
open: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
required: !1
|
|
54
|
-
},
|
|
55
|
-
autoDestroy: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
required: !1
|
|
58
|
-
},
|
|
59
|
-
autoLock: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
required: !1
|
|
62
|
-
},
|
|
63
|
-
debug: {
|
|
64
|
-
type: String,
|
|
65
|
-
required: !1
|
|
66
|
-
}
|
|
67
|
-
}, P),
|
|
68
|
-
name: "Portal",
|
|
69
|
-
inheritAttrs: !1
|
|
70
|
-
});
|
|
71
|
-
export {
|
|
72
|
-
R as default
|
|
73
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../util/dist/Dom/canUseDom.cjs"),t=require("vue"),v=require("./Context.cjs"),m=[];function f(o,r){const e=(()=>{if(!s.default())return null;const n=document.createElement("div");return process.env.NODE_ENV!=="production"&&r&&n.setAttribute("data-debug",r),n})(),l=t.shallowRef(!1),a=v.useContextState(),u=t.shallowRef([]),c=t.computed(()=>a?.value||(l.value?void 0:n=>{u.value=[n,...u.value]}));function d(){e?.parentElement||document.body.appendChild(e),l.value=!0}function i(){e?.parentElement?e?.parentElement?.removeChild(e):e&&l.value&&document.body?.removeChild?.(e),l.value=!1}return t.watch(o,()=>{o.value?a?.value?a.value(d):d():t.nextTick(()=>{i()})},{immediate:!0}),t.onUnmounted(i),t.watch(u,()=>{u.value.length&&(u.value.forEach(n=>n()),u.value=[...m])},{flush:"post",immediate:!0}),[e,c]}exports.default=f;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import c from "../../util/dist/Dom/canUseDom.js";
|
|
2
|
-
import { shallowRef as d, computed as s, watch as i, nextTick as f, onUnmounted as p } from "vue";
|
|
3
|
-
import { useContextState as h } from "./Context.js";
|
|
4
|
-
const E = [];
|
|
5
|
-
function g(l, o) {
|
|
6
|
-
const e = (() => {
|
|
7
|
-
if (!c()) return null;
|
|
8
|
-
const u = document.createElement("div");
|
|
9
|
-
return process.env.NODE_ENV !== "production" && o && u.setAttribute("data-debug", o), u;
|
|
10
|
-
})(), n = d(!1), a = h(), t = d([]), v = s(() => a?.value || (n.value ? void 0 : (u) => {
|
|
11
|
-
t.value = [u, ...t.value];
|
|
12
|
-
}));
|
|
13
|
-
function r() {
|
|
14
|
-
e?.parentElement || document.body.appendChild(e), n.value = !0;
|
|
15
|
-
}
|
|
16
|
-
function m() {
|
|
17
|
-
e?.parentElement ? e?.parentElement?.removeChild(e) : e && n.value && document.body?.removeChild?.(e), n.value = !1;
|
|
18
|
-
}
|
|
19
|
-
return i(l, () => {
|
|
20
|
-
l.value ? a?.value ? a.value(r) : r() : f(() => {
|
|
21
|
-
m();
|
|
22
|
-
});
|
|
23
|
-
}, {
|
|
24
|
-
immediate: !0
|
|
25
|
-
}), p(m), i(t, () => {
|
|
26
|
-
t.value.length && (t.value.forEach((u) => u()), t.value = [...E]);
|
|
27
|
-
}, {
|
|
28
|
-
flush: "post",
|
|
29
|
-
immediate: !0
|
|
30
|
-
}), [e, v];
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
g as default
|
|
34
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../util/dist/Dom/dynamicCSS.cjs"),a=require("../../util/dist/getScrollBarSize.cjs"),e=require("vue"),n=require("./util.cjs"),s=`vc-util-locker-${Date.now()}`;let i=0;function d(r){const o=e.computed(()=>e.unref(r));i+=1;const t=e.shallowRef(`${s}_${i}`);e.watch([t,o],async()=>{if(await e.nextTick(),o.value){const u=a.getTargetScrollBarSize(document.body).width,c=n.isBodyOverflowing();l.updateCSS(`
|
|
2
|
-
html body {
|
|
3
|
-
overflow-y: hidden;
|
|
4
|
-
${c?`width: calc(100% - ${u}px);`:""}
|
|
5
|
-
}`,t.value)}else l.removeCSS(t.value)},{flush:"post",immediate:!0})}exports.default=d;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { updateCSS as r, removeCSS as c } from "../../util/dist/Dom/dynamicCSS.js";
|
|
2
|
-
import { getTargetScrollBarSize as s } from "../../util/dist/getScrollBarSize.js";
|
|
3
|
-
import { computed as m, unref as n, shallowRef as d, watch as f, nextTick as u } from "vue";
|
|
4
|
-
import { isBodyOverflowing as p } from "./util.js";
|
|
5
|
-
const w = `vc-util-locker-${Date.now()}`;
|
|
6
|
-
let t = 0;
|
|
7
|
-
function y(a) {
|
|
8
|
-
const o = m(() => n(a));
|
|
9
|
-
t += 1;
|
|
10
|
-
const e = d(`${w}_${t}`);
|
|
11
|
-
f([e, o], async () => {
|
|
12
|
-
if (await u(), o.value) {
|
|
13
|
-
const i = s(document.body).width, l = p();
|
|
14
|
-
r(`
|
|
15
|
-
html body {
|
|
16
|
-
overflow-y: hidden;
|
|
17
|
-
${l ? `width: calc(100% - ${i}px);` : ""}
|
|
18
|
-
}`, e.value);
|
|
19
|
-
} else
|
|
20
|
-
c(e.value);
|
|
21
|
-
}, {
|
|
22
|
-
flush: "post",
|
|
23
|
-
immediate: !0
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
y as default
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}exports.isBodyOverflowing=e;
|
package/dist/portal/dist/util.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=Symbol("CollectionContext"),d=e.defineComponent({props:{onBatchResize:{type:Function,required:!1}},setup(u,{slots:r}){const o=e.shallowRef(0),t=e.shallowRef([]),c=e.inject(l,()=>{});return e.provide(l,(n,s,i)=>{const a=o.value+1;o.value=a,t.value.push({size:n,element:s,data:i}),Promise.resolve().then(()=>{if(o.value===a){const v=t.value;t.value=[],u.onBatchResize?.(v)}}),c?.(n,s,i)}),()=>r.default?.()}});exports.Collection=d;exports.CollectionContext=l;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineComponent as v, shallowRef as a, inject as f, provide as d } from "vue";
|
|
2
|
-
const i = Symbol("CollectionContext"), C = /* @__PURE__ */ v({
|
|
3
|
-
props: {
|
|
4
|
-
onBatchResize: {
|
|
5
|
-
type: Function,
|
|
6
|
-
required: !1
|
|
7
|
-
}
|
|
8
|
-
},
|
|
9
|
-
setup(r, {
|
|
10
|
-
slots: u
|
|
11
|
-
}) {
|
|
12
|
-
const e = a(0), o = a([]), c = f(i, () => {
|
|
13
|
-
});
|
|
14
|
-
return d(i, (t, l, n) => {
|
|
15
|
-
const s = e.value + 1;
|
|
16
|
-
e.value = s, o.value.push({
|
|
17
|
-
size: t,
|
|
18
|
-
element: l,
|
|
19
|
-
data: n
|
|
20
|
-
}), Promise.resolve().then(() => {
|
|
21
|
-
if (e.value === s) {
|
|
22
|
-
const p = o.value;
|
|
23
|
-
o.value = [], r.onBatchResize?.(p);
|
|
24
|
-
}
|
|
25
|
-
}), c?.(t, l, n);
|
|
26
|
-
}), () => u.default?.();
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
export {
|
|
30
|
-
C as Collection,
|
|
31
|
-
i as CollectionContext
|
|
32
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),u=t.defineComponent({setup(o,{slots:e}){return()=>e.default?.()}});exports.default=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),u=require("../../../util/dist/Dom/findDOMNode.cjs"),x=require("../Collection.cjs"),q=require("../utils/observerUtil.cjs"),C=require("./DomWrapper.cjs"),S=t.defineComponent({props:{data:{type:null,required:!1},disabled:{type:Boolean,required:!1},onResize:{type:Function,required:!1}},name:"SingleObserver",inheritAttrs:!1,setup(a,{expose:w,slots:M}){const n=t.shallowRef(),d=t.shallowRef(),W=t.inject(x.CollectionContext,()=>{}),o=t.shallowRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),h=()=>{const e=u.default(n)||(n.value&&typeof n.value=="object"?u.default(n.value.nativeElement):null)||u.default(d.value);return e&&e.nodeType===3&&e.nextElementSibling?e.nextElementSibling:e},c=e=>{const{onResize:v,data:y}=a,{width:r,height:f}=e.getBoundingClientRect(),{offsetHeight:i,offsetWidth:s}=e,g=Math.floor(r),p=Math.floor(f);if(o.value.width!==g||o.value.height!==p||o.value.offsetWidth!==s||o.value.offsetHeight!==i){const b={width:g,height:p,offsetWidth:s,offsetHeight:i};o.value=b;const H=s===Math.round(r)?r:s,R=i===Math.round(f)?f:i,m={...b,offsetWidth:H,offsetHeight:R};W?.(m,e,y),v&&Promise.resolve().then(()=>{v(m,e)})}};let l;return t.onMounted(()=>{l=h(),l&&!a.disabled&&q.observe(l,c)}),t.onBeforeUnmount(()=>{l&&q.unobserve(l,c)}),w({getDom:h}),()=>t.createVNode(C.default,{ref:d},{default:()=>[M.default?.()]})}});exports.default=S;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { defineComponent as C, shallowRef as r, inject as R, createVNode as q, onMounted as B, onBeforeUnmount as E } from "vue";
|
|
2
|
-
import a from "../../../util/dist/Dom/findDOMNode.js";
|
|
3
|
-
import { CollectionContext as S } from "../Collection.js";
|
|
4
|
-
import { observe as j, unobserve as z } from "../utils/observerUtil.js";
|
|
5
|
-
import P from "./DomWrapper.js";
|
|
6
|
-
const T = /* @__PURE__ */ C({
|
|
7
|
-
props: {
|
|
8
|
-
data: {
|
|
9
|
-
type: null,
|
|
10
|
-
required: !1
|
|
11
|
-
},
|
|
12
|
-
disabled: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
required: !1
|
|
15
|
-
},
|
|
16
|
-
onResize: {
|
|
17
|
-
type: Function,
|
|
18
|
-
required: !1
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
name: "SingleObserver",
|
|
22
|
-
inheritAttrs: !1,
|
|
23
|
-
setup(h, {
|
|
24
|
-
expose: w,
|
|
25
|
-
slots: x
|
|
26
|
-
}) {
|
|
27
|
-
const i = r(), d = r(), H = R(S, () => {
|
|
28
|
-
}), t = r({
|
|
29
|
-
width: -1,
|
|
30
|
-
height: -1,
|
|
31
|
-
offsetWidth: -1,
|
|
32
|
-
offsetHeight: -1
|
|
33
|
-
}), u = () => {
|
|
34
|
-
const e = a(i) || (i.value && typeof i.value == "object" ? a(i.value.nativeElement) : null) || a(d.value);
|
|
35
|
-
return e && e.nodeType === 3 && e.nextElementSibling ? e.nextElementSibling : e;
|
|
36
|
-
}, m = (e) => {
|
|
37
|
-
const {
|
|
38
|
-
onResize: p,
|
|
39
|
-
data: W
|
|
40
|
-
} = h, {
|
|
41
|
-
width: s,
|
|
42
|
-
height: l
|
|
43
|
-
} = e.getBoundingClientRect(), {
|
|
44
|
-
offsetHeight: n,
|
|
45
|
-
offsetWidth: f
|
|
46
|
-
} = e, g = Math.floor(s), v = Math.floor(l);
|
|
47
|
-
if (t.value.width !== g || t.value.height !== v || t.value.offsetWidth !== f || t.value.offsetHeight !== n) {
|
|
48
|
-
const c = {
|
|
49
|
-
width: g,
|
|
50
|
-
height: v,
|
|
51
|
-
offsetWidth: f,
|
|
52
|
-
offsetHeight: n
|
|
53
|
-
};
|
|
54
|
-
t.value = c;
|
|
55
|
-
const y = f === Math.round(s) ? s : f, M = n === Math.round(l) ? l : n, b = {
|
|
56
|
-
...c,
|
|
57
|
-
offsetWidth: y,
|
|
58
|
-
offsetHeight: M
|
|
59
|
-
};
|
|
60
|
-
H?.(b, e, W), p && Promise.resolve().then(() => {
|
|
61
|
-
p(b, e);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
let o;
|
|
66
|
-
return B(() => {
|
|
67
|
-
o = u(), o && !h.disabled && j(o, m);
|
|
68
|
-
}), E(() => {
|
|
69
|
-
o && z(o, m);
|
|
70
|
-
}), w({
|
|
71
|
-
getDom: u
|
|
72
|
-
}), () => q(P, {
|
|
73
|
-
ref: d
|
|
74
|
-
}, {
|
|
75
|
-
default: () => [x.default?.()]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
export {
|
|
80
|
-
T as default
|
|
81
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),n=require("../../util/dist/warning.cjs"),c=require("../../util/dist/Children/toArray.cjs"),a=require("./Collection.cjs"),d=require("./SingleObserver/index.cjs");require("./utils/observerUtil.cjs");function f(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!r.isVNode(e)}const p="vc-observer-key",i=r.defineComponent({props:{data:{type:null,required:!1},disabled:{type:Boolean,required:!1},onResize:{type:Function,required:!1}},setup(e,{slots:s}){return()=>{const o=c.toArray(s.default?.());return process.env.NODE_ENV!=="production"&&(o.length>1?n.default(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):o.length===0&&n.default(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),o.map((t,l)=>{const u=t?.key||`${p}-${l}`;return r.createVNode(d.default,r.mergeProps(e,{key:u}),f(t)?t:{default:()=>[t]})})}}});i.Collection=a.Collection;exports.default=i;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { defineComponent as l, createVNode as a, mergeProps as p, isVNode as c } from "vue";
|
|
2
|
-
import r from "../../util/dist/warning.js";
|
|
3
|
-
import { toArray as d } from "../../util/dist/Children/toArray.js";
|
|
4
|
-
import { Collection as f } from "./Collection.js";
|
|
5
|
-
import m from "./SingleObserver/index.js";
|
|
6
|
-
import "./utils/observerUtil.js";
|
|
7
|
-
function u(e) {
|
|
8
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !c(e);
|
|
9
|
-
}
|
|
10
|
-
const y = "vc-observer-key", b = /* @__PURE__ */ l({
|
|
11
|
-
props: {
|
|
12
|
-
data: {
|
|
13
|
-
type: null,
|
|
14
|
-
required: !1
|
|
15
|
-
},
|
|
16
|
-
disabled: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
required: !1
|
|
19
|
-
},
|
|
20
|
-
onResize: {
|
|
21
|
-
type: Function,
|
|
22
|
-
required: !1
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
setup(e, {
|
|
26
|
-
slots: n
|
|
27
|
-
}) {
|
|
28
|
-
return () => {
|
|
29
|
-
const t = d(n.default?.());
|
|
30
|
-
return process.env.NODE_ENV !== "production" && (t.length > 1 ? r(!1, "Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.") : t.length === 0 && r(!1, "`children` of ResizeObserver is empty. Nothing is in observe.")), t.map((o, s) => {
|
|
31
|
-
const i = o?.key || `${y}-${s}`;
|
|
32
|
-
return a(m, p(e, {
|
|
33
|
-
key: i
|
|
34
|
-
}), u(o) ? o : {
|
|
35
|
-
default: () => [o]
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
b.Collection = f;
|
|
42
|
-
export {
|
|
43
|
-
b as default
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("resize-observer-polyfill"),t=new Map;function s(e){e.forEach(n=>{const{target:o}=n;t.get(o)?.forEach(c=>c(o))})}const r=new u(s);process.env.NODE_ENV;process.env.NODE_ENV;function i(e,n){t.has(e)||(t.set(e,new Set),r.observe(e)),t?.get?.(e)?.add?.(n)}function a(e,n){t.has(e)&&(t?.get?.(e)?.delete?.(n),t?.get?.(e)?.size||(r.unobserve(e),t.delete(e)))}exports.observe=i;exports.unobserve=a;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import a from "resize-observer-polyfill";
|
|
2
|
-
const n = /* @__PURE__ */ new Map();
|
|
3
|
-
function s(e) {
|
|
4
|
-
e.forEach((o) => {
|
|
5
|
-
const { target: t } = o;
|
|
6
|
-
n.get(t)?.forEach((c) => c(t));
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
const r = new a(s);
|
|
10
|
-
process.env.NODE_ENV;
|
|
11
|
-
process.env.NODE_ENV;
|
|
12
|
-
function i(e, o) {
|
|
13
|
-
n.has(e) || (n.set(e, /* @__PURE__ */ new Set()), r.observe(e)), n?.get?.(e)?.add?.(o);
|
|
14
|
-
}
|
|
15
|
-
function p(e, o) {
|
|
16
|
-
n.has(e) && (n?.get?.(e)?.delete?.(o), n?.get?.(e)?.size || (r.unobserve(e), n.delete(e)));
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
i as observe,
|
|
20
|
-
p as unobserve
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");function r(e){return t.isVNode(e)&&e.type===t.Fragment}exports.isFragment=r;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./isFragment.cjs");function a(n,t={}){let e=[];Array.isArray(n)||(n=[n]);for(const r of n)r==null&&!t.keepEmpty||(Array.isArray(r)?e=e.concat(a(r,t)):o.isFragment(r)&&r.children?e=e.concat(a(r.children,t)):e.push(r));return e}exports.toArray=a;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isFragment as c } from "./isFragment.js";
|
|
2
|
-
function e(n, o = {}) {
|
|
3
|
-
let a = [];
|
|
4
|
-
Array.isArray(n) || (n = [n]);
|
|
5
|
-
for (const r of n)
|
|
6
|
-
r == null && !o.keepEmpty || (Array.isArray(r) ? a = a.concat(e(r, o)) : c(r) && r.children ? a = a.concat(e(r.children, o)) : a.push(r));
|
|
7
|
-
return a;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
e as toArray
|
|
11
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}exports.default=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(e,r){if(!e)return!1;if(e.contains)return e.contains(r);let t=r;for(;t;){if(t===e)return!0;t=t.parentNode}return!1}exports.default=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./canUseDom.cjs"),v=require("./contains.cjs"),m="data-vc-order",g="data-vc-priority",T="vc-util-key",a=new Map;function h({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:T}function s(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function M(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function S(e){return Array.from((a.get(e)||e).children).filter(n=>n.tagName==="STYLE")}function f(e,n={}){if(!C.default())return null;const{csp:t,prepend:o,priority:r=0}=n,i=M(o),p=i==="prependQueue",c=document.createElement("style");c.setAttribute(m,i),p&&r&&c.setAttribute(g,`${r}`),t?.nonce&&(c.nonce=t?.nonce),c.innerHTML=e;const u=s(n),{firstChild:y}=u;if(o){if(p){const d=S(u).filter(l=>{if(!["prepend","prependQueue"].includes(l.getAttribute(m)))return!1;const A=Number(l.getAttribute(g)||0);return r>=A});if(d.length)return u.insertBefore(c,d[d.length-1].nextSibling),c}u.insertBefore(c,y)}else u.appendChild(c);return c}function b(e,n={}){const t=s(n);return S(t).find(o=>o.getAttribute(h(n))===e)}function q(e,n={}){const t=b(e,n);t&&s(n).removeChild(t)}function L(e,n){const t=a.get(e);if(!t||!v.default(document,t)){const o=f("",n),{parentNode:r}=o;a.set(e,r),e.removeChild(o)}}function E(e,n,t={}){const o=s(t);L(o,t);const r=b(n,t);if(r)return t.csp?.nonce&&r.nonce!==t.csp?.nonce&&(r.nonce=t.csp?.nonce),r.innerHTML!==e&&(r.innerHTML=e),r;const i=f(e,t);return i.setAttribute(h(t),n),i}exports.injectCSS=f;exports.removeCSS=q;exports.updateCSS=E;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import C from "./canUseDom.js";
|
|
2
|
-
import v from "./contains.js";
|
|
3
|
-
const l = "data-vc-order", m = "data-vc-priority", T = "vc-util-key", d = /* @__PURE__ */ new Map();
|
|
4
|
-
function h({ mark: e } = {}) {
|
|
5
|
-
return e ? e.startsWith("data-") ? e : `data-${e}` : T;
|
|
6
|
-
}
|
|
7
|
-
function s(e) {
|
|
8
|
-
return e.attachTo ? e.attachTo : document.querySelector("head") || document.body;
|
|
9
|
-
}
|
|
10
|
-
function L(e) {
|
|
11
|
-
return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
|
|
12
|
-
}
|
|
13
|
-
function g(e) {
|
|
14
|
-
return Array.from(
|
|
15
|
-
(d.get(e) || e).children
|
|
16
|
-
).filter((n) => n.tagName === "STYLE");
|
|
17
|
-
}
|
|
18
|
-
function S(e, n = {}) {
|
|
19
|
-
if (!C())
|
|
20
|
-
return null;
|
|
21
|
-
const { csp: t, prepend: o, priority: r = 0 } = n, i = L(o), p = i === "prependQueue", c = document.createElement("style");
|
|
22
|
-
c.setAttribute(l, i), p && r && c.setAttribute(m, `${r}`), t?.nonce && (c.nonce = t?.nonce), c.innerHTML = e;
|
|
23
|
-
const u = s(n), { firstChild: y } = u;
|
|
24
|
-
if (o) {
|
|
25
|
-
if (p) {
|
|
26
|
-
const a = g(u).filter((f) => {
|
|
27
|
-
if (!["prepend", "prependQueue"].includes(f.getAttribute(l)))
|
|
28
|
-
return !1;
|
|
29
|
-
const A = Number(f.getAttribute(m) || 0);
|
|
30
|
-
return r >= A;
|
|
31
|
-
});
|
|
32
|
-
if (a.length)
|
|
33
|
-
return u.insertBefore(
|
|
34
|
-
c,
|
|
35
|
-
a[a.length - 1].nextSibling
|
|
36
|
-
), c;
|
|
37
|
-
}
|
|
38
|
-
u.insertBefore(c, y);
|
|
39
|
-
} else
|
|
40
|
-
u.appendChild(c);
|
|
41
|
-
return c;
|
|
42
|
-
}
|
|
43
|
-
function b(e, n = {}) {
|
|
44
|
-
const t = s(n);
|
|
45
|
-
return g(t).find(
|
|
46
|
-
(o) => o.getAttribute(h(n)) === e
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
function H(e, n = {}) {
|
|
50
|
-
const t = b(e, n);
|
|
51
|
-
t && s(n).removeChild(t);
|
|
52
|
-
}
|
|
53
|
-
function M(e, n) {
|
|
54
|
-
const t = d.get(e);
|
|
55
|
-
if (!t || !v(document, t)) {
|
|
56
|
-
const o = S("", n), { parentNode: r } = o;
|
|
57
|
-
d.set(e, r), e.removeChild(o);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function N(e, n, t = {}) {
|
|
61
|
-
const o = s(t);
|
|
62
|
-
M(o, t);
|
|
63
|
-
const r = b(n, t);
|
|
64
|
-
if (r)
|
|
65
|
-
return t.csp?.nonce && r.nonce !== t.csp?.nonce && (r.nonce = t.csp?.nonce), r.innerHTML !== e && (r.innerHTML = e), r;
|
|
66
|
-
const i = S(e, t);
|
|
67
|
-
return i.setAttribute(h(t), n), i;
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
S as injectCSS,
|
|
71
|
-
H as removeCSS,
|
|
72
|
-
N as updateCSS
|
|
73
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue");function t(n){return n instanceof HTMLElement||n instanceof SVGElement}function r(n){const e=u.unref(n);return t(e)?e:e&&"$el"in e?e.$el:null}exports.default=r;exports.isDOM=t;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { unref as t } from "vue";
|
|
2
|
-
function r(e) {
|
|
3
|
-
return e instanceof HTMLElement || e instanceof SVGElement;
|
|
4
|
-
}
|
|
5
|
-
function o(e) {
|
|
6
|
-
const n = t(e);
|
|
7
|
-
return r(n) ? n : n && "$el" in n ? n.$el : null;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
o as default,
|
|
11
|
-
r as isDOM
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=e=>{if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){const{width:t,height:i}=e.getBBox();if(t||i)return!0}if(e.getBoundingClientRect){const{width:t,height:i}=e.getBoundingClientRect();if(t||i)return!0}}return!1};exports.default=r;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const n = (e) => {
|
|
2
|
-
if (!e)
|
|
3
|
-
return !1;
|
|
4
|
-
if (e instanceof Element) {
|
|
5
|
-
if (e.offsetParent)
|
|
6
|
-
return !0;
|
|
7
|
-
if (e.getBBox) {
|
|
8
|
-
const { width: t, height: i } = e.getBBox();
|
|
9
|
-
if (t || i)
|
|
10
|
-
return !0;
|
|
11
|
-
}
|
|
12
|
-
if (e.getBoundingClientRect) {
|
|
13
|
-
const { width: t, height: i } = e.getBoundingClientRect();
|
|
14
|
-
if (t || i)
|
|
15
|
-
return !0;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return !1;
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
n as default
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(t){return t?.getRootNode?.()}function n(t){return o(t)instanceof ShadowRoot}function e(t){return n(t)?o(t):null}exports.getShadowRoot=e;exports.inShadow=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(e){let n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){for(let o=0;o<e.length;o++)if(e[o]){const r=t(e[o]);r&&(n&&(n+=" "),n+=r)}}else for(const o in e)e[o]&&(n&&(n+=" "),n+=o);return n}function i(...e){let n="";for(let o=0;o<e.length;o++){const r=e[o];if(r){const f=t(r);f&&(n&&(n+=" "),n+=f)}}return n}exports.default=i;
|