@volverjs/ui-vue 0.0.14 → 0.0.15
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/Volver.d.ts +5 -5
- package/dist/components/VvAction/VvAction.es.js +26 -26
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/index.d.ts +1 -44
- package/dist/components/VvAlert/VvAlert.es.js +43 -44
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -55
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +34 -34
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +186 -187
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +215 -217
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +235 -237
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -78
- package/dist/components/VvCombobox/VvCombobox.es.js +810 -813
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +1 -1
- package/dist/components/VvCombobox/index.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdown.es.js +4 -4
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +50 -50
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -31
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +415 -418
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +595 -588
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +6 -6
- package/dist/components/VvInputText/index.d.ts +3 -3
- package/dist/components/VvNav/VvNav.es.js +63 -63
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +41 -41
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +222 -224
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +234 -236
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -78
- package/dist/components/VvSelect/VvSelect.es.js +200 -203
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +1 -1
- package/dist/components/VvSelect/index.d.ts +2 -2
- package/dist/components/VvTab/VvTab.es.js +35 -35
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +341 -344
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/index.es.js +1965 -1958
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +34 -34
- package/dist/composables/index.umd.js +2 -2
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/directives/index.es.js +22 -22
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +13 -13
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +19 -19
- package/dist/index.umd.js +1 -1
- package/dist/json-render/index.es.js +1877 -1870
- package/dist/json-render/index.umd.js +1 -1
- package/dist/props/index.d.ts +1 -1
- package/dist/resolvers/unplugin.es.js +28 -28
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/types/alert.d.ts +1 -1
- package/dist/types/nav.d.ts +1 -1
- package/dist/utils/ObjectUtilities.d.ts +0 -6
- package/package.json +1 -1
- package/src/Volver.ts +8 -6
- package/src/components/VvAction/index.ts +1 -3
- package/src/components/VvButton/VvButton.vue +1 -1
- package/src/components/VvCheckboxGroup/index.ts +1 -3
- package/src/components/VvCombobox/VvCombobox.vue +3 -3
- package/src/components/VvDropdown/VvDropdown.vue +8 -8
- package/src/components/VvIcon/VvIcon.vue +3 -6
- package/src/components/VvInputFile/VvInputFile.vue +6 -6
- package/src/components/VvInputText/VvInputText.vue +95 -78
- package/src/components/VvRadioGroup/index.ts +1 -3
- package/src/composables/useBlurhash.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useDefaults.ts +55 -44
- package/src/composables/useModifiers.ts +1 -1
- package/src/index.ts +2 -2
- package/src/resolvers/unplugin.ts +6 -6
- package/src/types/alert.ts +1 -1
- package/src/types/nav.ts +1 -1
- package/src/utils/DateUtilities.ts +3 -3
- package/src/utils/DomUtilities.ts +7 -1
- package/src/utils/ObjectUtilities.ts +60 -59
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as u, getCurrentInstance as _, onMounted as A, onUnmounted as T, reactive as z, ref as d, unref as c } from "vue";
|
|
2
2
|
import { wrap as P } from "comlink";
|
|
3
3
|
import D from "pica";
|
|
4
4
|
import { useVirtualizer as N } from "@tanstack/vue-virtual";
|
|
5
|
-
var j = 1e4, F = "info", g = "default",
|
|
5
|
+
var j = 1e4, F = "info", g = "default", U = "information", W = "check-circle", V = "warning", H = "error", w = /* @__PURE__ */ new Map([
|
|
6
6
|
["success", W],
|
|
7
|
-
["info",
|
|
7
|
+
["info", U],
|
|
8
8
|
["warning", V],
|
|
9
9
|
["danger", H]
|
|
10
10
|
]), m = z(/* @__PURE__ */ new Map([[g, /* @__PURE__ */ new Map()]]));
|
|
11
11
|
function Z() {
|
|
12
|
-
const n = ({ id: r = crypto.randomUUID(), group: a = g, title: s, icon: o =
|
|
12
|
+
const n = ({ id: r = crypto.randomUUID(), group: a = g, title: s, icon: o = U, content: i, footer: l, modifiers: f = F, dismissable: p = !0, autoClose: h = j, timestamp: I = Date.now() } = {}) => {
|
|
13
13
|
m.has(a) || m.set(a, /* @__PURE__ */ new Map());
|
|
14
|
-
const
|
|
14
|
+
const x = m.get(a), k = typeof f == "string" ? f.split(" ") : f;
|
|
15
15
|
if (!o) {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const M = k.find((O) => w.has(O));
|
|
17
|
+
M && (o = w.get(M));
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
x?.set(r.toString(), {
|
|
20
20
|
id: r,
|
|
21
21
|
group: a,
|
|
22
22
|
title: s,
|
|
@@ -26,11 +26,11 @@ function Z() {
|
|
|
26
26
|
modifiers: f,
|
|
27
27
|
dismissable: p,
|
|
28
28
|
autoClose: h,
|
|
29
|
-
timestamp:
|
|
29
|
+
timestamp: I
|
|
30
30
|
});
|
|
31
31
|
}, t = (r, a = g) => {
|
|
32
32
|
m.get(a)?.delete(r.toString());
|
|
33
|
-
}, e = (r = g) =>
|
|
33
|
+
}, e = (r = g) => u(() => {
|
|
34
34
|
const a = m.get(r);
|
|
35
35
|
return a && a instanceof Map ? [...a.values()].toSorted((s, o) => s.timestamp - o.timestamp) : [];
|
|
36
36
|
});
|
|
@@ -43,12 +43,12 @@ function Z() {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
function nn(n, t) {
|
|
46
|
-
const { x: e, y: r, getBoundingClientRect: a, onScroll: s } =
|
|
46
|
+
const { x: e, y: r, getBoundingClientRect: a, onScroll: s } = $(n), o = (l) => {
|
|
47
47
|
e.value = l.clientX, r.value = l.clientY, l.preventDefault(), n.value.show();
|
|
48
|
-
}, i =
|
|
48
|
+
}, i = u(() => c(t));
|
|
49
49
|
return i && _() && (A(() => {
|
|
50
50
|
i.value?.addEventListener("contextmenu", o, !1);
|
|
51
|
-
}),
|
|
51
|
+
}), T(() => {
|
|
52
52
|
i.value?.removeEventListener("contextmenu", o);
|
|
53
53
|
})), {
|
|
54
54
|
x: e,
|
|
@@ -59,16 +59,16 @@ function nn(n, t) {
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
function B(n) {
|
|
62
|
-
if (!n) return;
|
|
62
|
+
if (!n || typeof globalThis.getComputedStyle != "function" || typeof document > "u") return;
|
|
63
63
|
let t = n.parentElement;
|
|
64
64
|
for (; t; ) {
|
|
65
|
-
const { overflow: e } =
|
|
65
|
+
const { overflow: e } = globalThis.getComputedStyle(t);
|
|
66
66
|
if (e.split(" ").every((r) => r === "auto" || r === "scroll")) return t;
|
|
67
67
|
t = t.parentElement;
|
|
68
68
|
}
|
|
69
69
|
return document.documentElement;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function $(n) {
|
|
72
72
|
const t = d(0), e = d(0), r = d();
|
|
73
73
|
let a = 0, s = 0, o = 0, i = 0;
|
|
74
74
|
const l = (p) => {
|
|
@@ -86,7 +86,7 @@ function G(n) {
|
|
|
86
86
|
});
|
|
87
87
|
return _() && (A(() => {
|
|
88
88
|
n.value && (n.value.init({ getBoundingClientRect: f }), r.value = B(n.value.$el), r.value && r.value.addEventListener("scroll", l));
|
|
89
|
-
}),
|
|
89
|
+
}), T(() => {
|
|
90
90
|
r.value && r.value.removeEventListener("scroll", l);
|
|
91
91
|
})), {
|
|
92
92
|
x: t,
|
|
@@ -95,7 +95,7 @@ function G(n) {
|
|
|
95
95
|
onScroll: l
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
var
|
|
98
|
+
var C = `(function() {
|
|
99
99
|
var v = [
|
|
100
100
|
"0",
|
|
101
101
|
"1",
|
|
@@ -514,8 +514,8 @@ var I = `(function() {
|
|
|
514
514
|
isBlurhashValid: Y
|
|
515
515
|
});
|
|
516
516
|
})();
|
|
517
|
-
`, E = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",
|
|
518
|
-
function
|
|
517
|
+
`, E = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", C], { type: "text/javascript;charset=utf-8" });
|
|
518
|
+
function G(n) {
|
|
519
519
|
let t;
|
|
520
520
|
try {
|
|
521
521
|
if (t = E && (self.URL || self.webkitURL).createObjectURL(E), !t) throw "";
|
|
@@ -524,17 +524,17 @@ function $(n) {
|
|
|
524
524
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
525
525
|
}), e;
|
|
526
526
|
} catch {
|
|
527
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
527
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(C), { name: n?.name });
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
var v;
|
|
531
531
|
function y() {
|
|
532
|
-
return v || (v = P(new
|
|
532
|
+
return v || (v = P(new G())), v;
|
|
533
533
|
}
|
|
534
534
|
function b(n) {
|
|
535
535
|
return new Promise((t, e) => {
|
|
536
536
|
const r = new Image();
|
|
537
|
-
r.onload = () => t(r), r.onerror = (
|
|
537
|
+
r.onload = () => t(r), r.onerror = () => e(/* @__PURE__ */ new Error(`Failed to load image: ${n}`)), r.src = n;
|
|
538
538
|
});
|
|
539
539
|
}
|
|
540
540
|
function Y(n, t, e) {
|
|
@@ -582,17 +582,17 @@ function S(n) {
|
|
|
582
582
|
function en(n) {
|
|
583
583
|
const t = N({
|
|
584
584
|
get count() {
|
|
585
|
-
return
|
|
585
|
+
return c(n.count);
|
|
586
586
|
},
|
|
587
|
-
getScrollElement: () =>
|
|
587
|
+
getScrollElement: () => c(n.scrollEl),
|
|
588
588
|
getItemKey: n.getItemKey,
|
|
589
589
|
estimateSize: (i) => {
|
|
590
|
-
const l =
|
|
590
|
+
const l = c(n.estimateSize);
|
|
591
591
|
return typeof l == "function" ? l(i) : L(l);
|
|
592
592
|
},
|
|
593
|
-
overscan: L(
|
|
594
|
-
horizontal:
|
|
595
|
-
}), e =
|
|
593
|
+
overscan: L(c(n.overscan)),
|
|
594
|
+
horizontal: c(n.horizontal)
|
|
595
|
+
}), e = u(() => t.value.getVirtualItems()), r = u(() => e.value.length), a = u(() => e.value[0]), s = u(() => e.value[r.value - 1]), o = u(() => t.value.getTotalSize() ?? 0);
|
|
596
596
|
return {
|
|
597
597
|
virtualizer: t,
|
|
598
598
|
virtualItems: e,
|
|
@@ -600,20 +600,20 @@ function en(n) {
|
|
|
600
600
|
firstVirtualItem: a,
|
|
601
601
|
lastVirtualItem: s,
|
|
602
602
|
totalSize: o,
|
|
603
|
-
startSpacer:
|
|
603
|
+
startSpacer: u(() => {
|
|
604
604
|
const i = a.value?.start ?? 0;
|
|
605
605
|
return {
|
|
606
606
|
show: i > 0,
|
|
607
607
|
size: i,
|
|
608
|
-
style:
|
|
608
|
+
style: c(n.horizontal) ? R(i) : S(i)
|
|
609
609
|
};
|
|
610
610
|
}),
|
|
611
|
-
endSpacer:
|
|
611
|
+
endSpacer: u(() => {
|
|
612
612
|
const i = s.value?.end ?? 0, l = o.value - i;
|
|
613
613
|
return {
|
|
614
614
|
show: l > 0,
|
|
615
615
|
size: l,
|
|
616
|
-
style:
|
|
616
|
+
style: c(n.horizontal) ? R(l) : S(l)
|
|
617
617
|
};
|
|
618
618
|
})
|
|
619
619
|
};
|
|
@@ -622,6 +622,6 @@ export {
|
|
|
622
622
|
Z as useAlert,
|
|
623
623
|
tn as useBlurhash,
|
|
624
624
|
nn as useDropdownContextmenu,
|
|
625
|
-
|
|
625
|
+
$ as useDropdownVirtualElement,
|
|
626
626
|
en as useVirtualScroll
|
|
627
627
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(c,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("comlink"),require("pica"),require("@tanstack/vue-virtual")):typeof define=="function"&&define.amd?define(["exports","vue","comlink","pica","@tanstack/vue-virtual"],a):(c=typeof globalThis<"u"?globalThis:c||self,a(c.composables={},c.Vue,c.comlink,c.pica,c.TanstackVueVirtual))})(this,function(c,a,U,g,P){Object.defineProperty(c,Symbol.toStringTag,{value:"Module"});var C=Object.create,v=Object.defineProperty,I=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,k=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,z=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=x(t),u=0,i=o.length,l;u<i;u++)l=o[u],!j.call(n,l)&&l!==e&&v(n,l,{get:(s=>t[s]).bind(null,l),enumerable:!(r=I(t,l))||r.enumerable});return n},D=(n,t,e)=>(e=n!=null?C(k(n)):{},z(t||!n||!n.__esModule?v(e,"default",{value:n,enumerable:!0}):e,n));g=D(g,1);var N=1e4,F="info",m="default",M="information",V="check-circle",W="warning",H="error",y=new Map([["success",V],["info",M],["warning",W],["danger",H]]),h=(0,a.reactive)(new Map([[m,new Map]]));function B(){const n=({id:r=crypto.randomUUID(),group:o=m,title:u,icon:i=M,content:l,footer:s,modifiers:f=F,dismissable:w=!0,autoClose:p=N,timestamp:Q=Date.now()}={})=>{h.has(o)||h.set(o,new Map);const Z=h.get(o),nn=typeof f=="string"?f.split(" "):f;if(!i){const A=nn.find(tn=>y.has(tn));A&&(i=y.get(A))}Z?.set(r.toString(),{id:r,group:o,title:u,icon:i,content:l,footer:s,modifiers:f,dismissable:w,autoClose:p,timestamp:Q})},t=(r,o=m)=>{h.get(o)?.delete(r.toString())},e=(r=m)=>(0,a.computed)(()=>{const o=h.get(r);return o&&o instanceof Map?[...o.values()].toSorted((u,i)=>u.timestamp-i.timestamp):[]});return{groups:h,alerts:e(),addAlert:n,removeAlert:t,getAlerts:e}}function $(n,t){const{x:e,y:r,getBoundingClientRect:o,onScroll:u}=E(n),i=s=>{e.value=s.clientX,r.value=s.clientY,s.preventDefault(),n.value.show()},l=(0,a.computed)(()=>(0,a.unref)(t));return l&&(0,a.getCurrentInstance)()&&((0,a.onMounted)(()=>{l.value?.addEventListener("contextmenu",i,!1)}),(0,a.onUnmounted)(()=>{l.value?.removeEventListener("contextmenu",i)})),{x:e,y:r,getBoundingClientRect:o,onContextmenu:i,onScroll:u}}function G(n){if(!n||typeof globalThis.getComputedStyle!="function"||typeof document>"u")return;let t=n.parentElement;for(;t;){const{overflow:e}=globalThis.getComputedStyle(t);if(e.split(" ").every(r=>r==="auto"||r==="scroll"))return t;t=t.parentElement}return document.documentElement}function E(n){const t=(0,a.ref)(0),e=(0,a.ref)(0),r=(0,a.ref)();let o=0,u=0,i=0,l=0;const s=w=>{const p=w.target;o=p.scrollLeft-l,u=p.scrollTop-i,e.value=e.value-u,t.value=t.value-o,l=p.scrollLeft,i=p.scrollTop},f=()=>({width:0,height:0,x:t.value,y:e.value,top:e.value,left:t.value,right:t.value,bottom:e.value});return(0,a.getCurrentInstance)()&&((0,a.onMounted)(()=>{n.value&&(n.value.init({getBoundingClientRect:f}),r.value=G(n.value.$el),r.value&&r.value.addEventListener("scroll",s))}),(0,a.onUnmounted)(()=>{r.value&&r.value.removeEventListener("scroll",s)})),{x:t,y:e,getBoundingClientRect:f,onScroll:s}}var b=`(function() {
|
|
2
2
|
var v = [
|
|
3
3
|
"0",
|
|
4
4
|
"1",
|
|
@@ -417,4 +417,4 @@
|
|
|
417
417
|
isBlurhashValid: Y
|
|
418
418
|
});
|
|
419
419
|
})();
|
|
420
|
-
`,_=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",b],{type:"text/javascript;charset=utf-8"});function q(n){let t;try{if(t=_&&(self.URL||self.webkitURL).createObjectURL(_),!t)throw"";const e=new Worker(t,{name:n?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(b),{name:n?.name})}}var d;function L(){return d||(d=(0,U.wrap)(new q)),d}function R(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>t(r),r.onerror=(
|
|
420
|
+
`,_=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",b],{type:"text/javascript;charset=utf-8"});function q(n){let t;try{if(t=_&&(self.URL||self.webkitURL).createObjectURL(_),!t)throw"";const e=new Worker(t,{name:n?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(b),{name:n?.name})}}var d;function L(){return d||(d=(0,U.wrap)(new q)),d}function R(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>e(new Error(`Failed to load image: ${n}`)),r.src=n})}function Y(n,t,e){return n>t?{width:e,height:Math.round(e*(t/n))}:{width:Math.round(e*(n/t)),height:e}}async function X(n,t,e){const r=(0,g.default)(),o=document.createElement("canvas");return o.width=t,o.height=e,(await r.resize(n,o)).getContext("2d")?.getImageData(0,0,t,e).data}function K(){async function n(t){const e=URL.createObjectURL(t);try{const r=await R(e);if("width"in r&&"height"in r){const{width:o,height:u}=Y(r.width,r.height,32),i=await X(r,o,u);if(i)return L().encode(i,o,u,4,4)}}finally{URL.revokeObjectURL(e)}}return{encode:n,decode:(...t)=>L().decode(...t),loadImage:R}}function S(n){if(n!==void 0)return typeof n=="number"?n:Number.parseInt(n.replace("px",""),10)}function O(n){return{width:`${n}px`}}function T(n){return{height:`${n}px`}}function J(n){const t=(0,P.useVirtualizer)({get count(){return(0,a.unref)(n.count)},getScrollElement:()=>(0,a.unref)(n.scrollEl),getItemKey:n.getItemKey,estimateSize:l=>{const s=(0,a.unref)(n.estimateSize);return typeof s=="function"?s(l):S(s)},overscan:S((0,a.unref)(n.overscan)),horizontal:(0,a.unref)(n.horizontal)}),e=(0,a.computed)(()=>t.value.getVirtualItems()),r=(0,a.computed)(()=>e.value.length),o=(0,a.computed)(()=>e.value[0]),u=(0,a.computed)(()=>e.value[r.value-1]),i=(0,a.computed)(()=>t.value.getTotalSize()??0);return{virtualizer:t,virtualItems:e,virtualItemsLength:r,firstVirtualItem:o,lastVirtualItem:u,totalSize:i,startSpacer:(0,a.computed)(()=>{const l=o.value?.start??0;return{show:l>0,size:l,style:(0,a.unref)(n.horizontal)?O(l):T(l)}}),endSpacer:(0,a.computed)(()=>{const l=u.value?.end??0,s=i.value-l;return{show:s>0,size:s,style:(0,a.unref)(n.horizontal)?O(s):T(s)}})}}c.useAlert=B,c.useBlurhash=K,c.useDropdownContextmenu=$,c.useDropdownVirtualElement=E,c.useVirtualScroll=J});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
|
-
export declare function useModifiers(prefix: string, modifiers?: Ref<
|
|
2
|
+
export declare function useModifiers(prefix: string, modifiers?: Ref<unknown>, others?: Ref<Record<string, boolean>>): globalThis.ComputedRef<Record<string, boolean>>;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Emitter } from 'mitt';
|
|
2
2
|
import type { InjectionKey, Ref } from 'vue';
|
|
3
|
-
import type { AccordionGroupState, AlertGroupState, ButtonGroupState, InputGroupState } from './types';
|
|
3
|
+
import type { AccordionGroupState, AlertGroupState, AlertModifier, ButtonGroupState, InputGroupState } from './types';
|
|
4
4
|
import type { Volver } from './Volver';
|
|
5
5
|
export declare const DEFAULT_ICONIFY_PROVIDER = "vv";
|
|
6
6
|
export declare enum StorageType {
|
|
@@ -101,4 +101,4 @@ export declare const DEFAULT_ALERT_INFO_ICON = "information";
|
|
|
101
101
|
export declare const DEFAULT_ALERT_SUCCESS_ICON = "check-circle";
|
|
102
102
|
export declare const DEFAULT_ALERT_WARNING_ICON = "warning";
|
|
103
103
|
export declare const DEFAULT_ALERT_DANGER_ICON = "error";
|
|
104
|
-
export declare const DefaultAlertIconMap: Map<
|
|
104
|
+
export declare const DefaultAlertIconMap: Map<AlertModifier, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed as y, createElementBlock as V, createTextVNode as I, defineComponent as $, getCurrentInstance as
|
|
1
|
+
import { computed as y, createElementBlock as V, createTextVNode as I, defineComponent as $, getCurrentInstance as j, h as B, normalizeClass as F, onMounted as w, onUnmounted as N, openBlock as q, ref as v, render as x, renderSlot as K, toDisplayString as M, toRefs as U, unref as g } from "vue";
|
|
2
2
|
var L = /* @__PURE__ */ (function(e) {
|
|
3
3
|
return e.local = "local", e.session = "session", e;
|
|
4
4
|
})({}), z = /* @__PURE__ */ (function(e) {
|
|
@@ -18,7 +18,7 @@ function G(e, t) {
|
|
|
18
18
|
const { x: o, y: a, getBoundingClientRect: l, onScroll: r } = H(e), i = (n) => {
|
|
19
19
|
o.value = n.clientX, a.value = n.clientY, n.preventDefault(), e.value.show();
|
|
20
20
|
}, u = y(() => g(t));
|
|
21
|
-
return u &&
|
|
21
|
+
return u && j() && (w(() => {
|
|
22
22
|
u.value?.addEventListener("contextmenu", i, !1);
|
|
23
23
|
}), N(() => {
|
|
24
24
|
u.value?.removeEventListener("contextmenu", i);
|
|
@@ -31,10 +31,10 @@ function G(e, t) {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
function _(e) {
|
|
34
|
-
if (!e) return;
|
|
34
|
+
if (!e || typeof globalThis.getComputedStyle != "function" || typeof document > "u") return;
|
|
35
35
|
let t = e.parentElement;
|
|
36
36
|
for (; t; ) {
|
|
37
|
-
const { overflow: o } =
|
|
37
|
+
const { overflow: o } = globalThis.getComputedStyle(t);
|
|
38
38
|
if (o.split(" ").every((a) => a === "auto" || a === "scroll")) return t;
|
|
39
39
|
t = t.parentElement;
|
|
40
40
|
}
|
|
@@ -43,10 +43,10 @@ function _(e) {
|
|
|
43
43
|
function H(e) {
|
|
44
44
|
const t = v(0), o = v(0), a = v();
|
|
45
45
|
let l = 0, r = 0, i = 0, u = 0;
|
|
46
|
-
const n = (
|
|
47
|
-
const s =
|
|
46
|
+
const n = (R) => {
|
|
47
|
+
const s = R.target;
|
|
48
48
|
l = s.scrollLeft - u, r = s.scrollTop - i, o.value = o.value - r, t.value = t.value - l, u = s.scrollLeft, i = s.scrollTop;
|
|
49
|
-
},
|
|
49
|
+
}, P = () => ({
|
|
50
50
|
width: 0,
|
|
51
51
|
height: 0,
|
|
52
52
|
x: t.value,
|
|
@@ -56,14 +56,14 @@ function H(e) {
|
|
|
56
56
|
right: t.value,
|
|
57
57
|
bottom: o.value
|
|
58
58
|
});
|
|
59
|
-
return
|
|
60
|
-
e.value && (e.value.init({ getBoundingClientRect:
|
|
59
|
+
return j() && (w(() => {
|
|
60
|
+
e.value && (e.value.init({ getBoundingClientRect: P }), a.value = _(e.value.$el), a.value && a.value.addEventListener("scroll", n));
|
|
61
61
|
}), N(() => {
|
|
62
62
|
a.value && a.value.removeEventListener("scroll", n);
|
|
63
63
|
})), {
|
|
64
64
|
x: t,
|
|
65
65
|
y: o,
|
|
66
|
-
getBoundingClientRect:
|
|
66
|
+
getBoundingClientRect: P,
|
|
67
67
|
onScroll: n
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -164,7 +164,7 @@ var ce = {
|
|
|
164
164
|
} }, p = { modifiers: {
|
|
165
165
|
type: [String, Array],
|
|
166
166
|
default: void 0
|
|
167
|
-
} },
|
|
167
|
+
} }, h = { hintLabel: {
|
|
168
168
|
type: String,
|
|
169
169
|
default: ""
|
|
170
170
|
} }, te = {
|
|
@@ -267,7 +267,7 @@ var ce = {
|
|
|
267
267
|
type: Boolean,
|
|
268
268
|
default: !1
|
|
269
269
|
}
|
|
270
|
-
},
|
|
270
|
+
}, T = {
|
|
271
271
|
...ne,
|
|
272
272
|
name: {
|
|
273
273
|
type: String,
|
|
@@ -280,7 +280,7 @@ var ce = {
|
|
|
280
280
|
type: String,
|
|
281
281
|
default: "off"
|
|
282
282
|
} }, be = {
|
|
283
|
-
...
|
|
283
|
+
...T,
|
|
284
284
|
...ie,
|
|
285
285
|
...ue,
|
|
286
286
|
...A,
|
|
@@ -288,7 +288,7 @@ var ce = {
|
|
|
288
288
|
...C,
|
|
289
289
|
...b,
|
|
290
290
|
...m,
|
|
291
|
-
...
|
|
291
|
+
...h,
|
|
292
292
|
...S,
|
|
293
293
|
...p,
|
|
294
294
|
...oe,
|
|
@@ -310,11 +310,11 @@ var ce = {
|
|
|
310
310
|
},
|
|
311
311
|
...k
|
|
312
312
|
}, me = {
|
|
313
|
-
...
|
|
313
|
+
...T,
|
|
314
314
|
...A,
|
|
315
315
|
...b,
|
|
316
316
|
...m,
|
|
317
|
-
...
|
|
317
|
+
...h,
|
|
318
318
|
...d,
|
|
319
319
|
...C,
|
|
320
320
|
...p,
|
|
@@ -341,7 +341,7 @@ var ce = {
|
|
|
341
341
|
...b,
|
|
342
342
|
...m,
|
|
343
343
|
...te,
|
|
344
|
-
...
|
|
344
|
+
...h,
|
|
345
345
|
...d,
|
|
346
346
|
...C,
|
|
347
347
|
...p,
|
|
@@ -386,7 +386,7 @@ var ce = {
|
|
|
386
386
|
type: String,
|
|
387
387
|
default: Y.button
|
|
388
388
|
}
|
|
389
|
-
},
|
|
389
|
+
}, he = {
|
|
390
390
|
storageType: {
|
|
391
391
|
type: String,
|
|
392
392
|
default: L.local,
|
|
@@ -422,15 +422,15 @@ var fe = { name: "VvTooltip" }, pe = /* @__PURE__ */ $({
|
|
|
422
422
|
inert: ""
|
|
423
423
|
}, [K(l.$slots, "default", {}, () => [I(M(l.value), 1)])], 2));
|
|
424
424
|
}
|
|
425
|
-
}),
|
|
425
|
+
}), D = pe, Pe = {
|
|
426
426
|
beforeMount(e, t) {
|
|
427
|
-
x(B(
|
|
427
|
+
x(B(D, {
|
|
428
428
|
value: t.value,
|
|
429
429
|
position: t.arg
|
|
430
430
|
}), e);
|
|
431
431
|
},
|
|
432
432
|
updated(e, t) {
|
|
433
|
-
x(B(
|
|
433
|
+
x(B(D, {
|
|
434
434
|
value: t.value,
|
|
435
435
|
position: t.arg
|
|
436
436
|
}), e);
|
|
@@ -438,5 +438,5 @@ var fe = { name: "VvTooltip" }, pe = /* @__PURE__ */ $({
|
|
|
438
438
|
};
|
|
439
439
|
export {
|
|
440
440
|
ce as vContextmenu,
|
|
441
|
-
|
|
441
|
+
Pe as vTooltip
|
|
442
442
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(i,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis<"u"?globalThis:i||self,t(i.directives={},i.Vue))})(this,function(i,t){Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});var C=(function(e){return e.local="local",e.session="session",e})({}),
|
|
1
|
+
(function(i,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis<"u"?globalThis:i||self,t(i.directives={},i.Vue))})(this,function(i,t){Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});var C=(function(e){return e.local="local",e.session="session",e})({}),w=(function(e){return e.absolute="absolute",e.fixed="fixed",e})({}),y=(function(e){return e.left="left",e.right="right",e.top="top",e.bottom="bottom",e})({}),N=(function(e){return e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e})({}),P=(function(e){return e.before="before",e.after="after",e})({}),B=(function(e){return e.button="button",e.submit="submit",e.reset="reset",e})({}),T=(function(e){return e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e})({});function _(e,o){const{x:a,y:r,getBoundingClientRect:n,onScroll:l}=k(e),d=u=>{a.value=u.clientX,r.value=u.clientY,u.preventDefault(),e.value.show()},s=(0,t.computed)(()=>(0,t.unref)(o));return s&&(0,t.getCurrentInstance)()&&((0,t.onMounted)(()=>{s.value?.addEventListener("contextmenu",d,!1)}),(0,t.onUnmounted)(()=>{s.value?.removeEventListener("contextmenu",d)})),{x:a,y:r,getBoundingClientRect:n,onContextmenu:d,onScroll:l}}function x(e){if(!e||typeof globalThis.getComputedStyle!="function"||typeof document>"u")return;let o=e.parentElement;for(;o;){const{overflow:a}=globalThis.getComputedStyle(o);if(a.split(" ").every(r=>r==="auto"||r==="scroll"))return o;o=o.parentElement}return document.documentElement}function k(e){const o=(0,t.ref)(0),a=(0,t.ref)(0),r=(0,t.ref)();let n=0,l=0,d=0,s=0;const u=ee=>{const v=ee.target;n=v.scrollLeft-s,l=v.scrollTop-d,a.value=a.value-l,o.value=o.value-n,s=v.scrollLeft,d=v.scrollTop},D=()=>({width:0,height:0,x:o.value,y:a.value,top:a.value,left:o.value,right:o.value,bottom:a.value});return(0,t.getCurrentInstance)()&&((0,t.onMounted)(()=>{e.value&&(e.value.init({getBoundingClientRect:D}),r.value=x(e.value.$el),r.value&&r.value.addEventListener("scroll",u))}),(0,t.onUnmounted)(()=>{r.value&&r.value.removeEventListener("scroll",u)})),{x:o,y:a,getBoundingClientRect:D,onScroll:u}}var A={beforeUpdate(e,o){const{onContextmenu:a,onScroll:r,getBoundingClientRect:n}=_(o);o.value.init({getBoundingClientRect:n}),e.addEventListener("contextmenu",a,!1);const l=x(o.value.$el);l&&l.addEventListener("scroll",r),e.additionalData={onContextmenu:a,onScroll:r,scrollContainerEl:l}},beforeUnmount(e){e?.additionalData?.onContextmenu&&e.removeEventListener("contextmenu",e.additionalData.onContextmenu),e?.additionalData?.onScroll&&e?.additionalData?.scrollContainerEl&&e.additionalData.scrollContainerEl.removeEventListener("scroll",e.additionalData.onScroll)}},V={showPassword:"eye-on",hidePassword:"eye-off",showDatePicker:"calendar",showTimePicker:"time",showColorPicker:"color",clear:"close",add:"add",remove:"trash",edit:"edit",download:"download"},I={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},g={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},b={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},m={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},f={disabled:{type:Boolean,default:!1}},L={required:{type:Boolean,default:!1}},R={active:{type:Boolean,default:!1}},$={current:{type:Boolean,default:!1}},te={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:V.clear},labelClear:{type:String,default:"Clear"}},M={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}},S={readonly:{type:Boolean,default:!1}},c={modifiers:{type:[String,Array],default:void 0}},h={hintLabel:{type:String,default:""}},q={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},F={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},K={debounce:{type:[Number,String],default:void 0}},U={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:P.before,validation:e=>Object.values(P).includes(e)}},E={tabindex:{type:[String,Number],default:0}},z={floating:{type:Boolean,default:!1}},X={id:[String,Number]},oe={placement:{type:String,default:y.bottom,validator:e=>Object.values(y).includes(e)||Object.values(N).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(w).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},O={...X,name:{type:String,required:!0}},Y={autofocus:{type:Boolean,default:!1}},G={autocomplete:{type:String,default:"off"}},ae={...O,...Y,...G,...E,...f,...S,...g,...b,...h,...m,...c,...F,...K,...U,...z,...p,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},...L},re={...O,...E,...g,...b,...h,...f,...S,...c,...p,...m,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},le={...g,...b,...q,...h,...f,...S,...c,...p,...m,...L,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}},ne={...f,...p,...M,...R,...$,...I,type:{type:String,default:B.button,validator:e=>Object.values(B).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:T.button}},ie={storageType:{type:String,default:C.local,validator:e=>Object.values(C).includes(e)},storageKey:String},H={...c,position:{type:String,default:y.bottom},value:{type:String}};function W(e,o,a){return(0,t.computed)(()=>{const r={[e]:!0},n=typeof o?.value=="string"?o.value.split(" "):o?.value;return n&&Array.isArray(n)&&n.forEach(l=>{l&&(r[`${e}--${l}`]=!0)}),a&&Object.keys(a.value).forEach(l=>{r[`${e}--${l}`]=(0,t.unref)(a.value[l])}),r})}var J={name:"VvTooltip"},Q=(0,t.defineComponent)({...J,props:H,setup(e){const o=e,{modifiers:a}=(0,t.toRefs)(o),r=W("vv-tooltip",a,(0,t.computed)(()=>({[o.position]:!0})));return(n,l)=>((0,t.openBlock)(),(0,t.createElementBlock)("span",{class:(0,t.normalizeClass)((0,t.unref)(r)),role:"tooltip",inert:""},[(0,t.renderSlot)(n.$slots,"default",{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.value),1)])],2))}}),j=Q,Z={beforeMount(e,o){(0,t.render)((0,t.h)(j,{value:o.value,position:o.arg}),e)},updated(e,o){(0,t.render)((0,t.h)(j,{value:o.value,position:o.arg}),e)}};i.vContextmenu=A,i.vTooltip=Z});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function
|
|
3
|
-
const { x: n, y: l, getBoundingClientRect: r, onScroll: o } =
|
|
1
|
+
import { computed as x, getCurrentInstance as d, onMounted as f, onUnmounted as m, ref as s, unref as E } from "vue";
|
|
2
|
+
function g(e, t) {
|
|
3
|
+
const { x: n, y: l, getBoundingClientRect: r, onScroll: o } = D(e), u = (a) => {
|
|
4
4
|
n.value = a.clientX, l.value = a.clientY, a.preventDefault(), e.value.show();
|
|
5
|
-
}, i =
|
|
5
|
+
}, i = x(() => E(t));
|
|
6
6
|
return i && d() && (f(() => {
|
|
7
7
|
i.value?.addEventListener("contextmenu", u, !1);
|
|
8
8
|
}), m(() => {
|
|
@@ -15,21 +15,21 @@ function D(e, t) {
|
|
|
15
15
|
onScroll: o
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
if (!e) return;
|
|
18
|
+
function p(e) {
|
|
19
|
+
if (!e || typeof globalThis.getComputedStyle != "function" || typeof document > "u") return;
|
|
20
20
|
let t = e.parentElement;
|
|
21
21
|
for (; t; ) {
|
|
22
|
-
const { overflow: n } =
|
|
22
|
+
const { overflow: n } = globalThis.getComputedStyle(t);
|
|
23
23
|
if (n.split(" ").every((l) => l === "auto" || l === "scroll")) return t;
|
|
24
24
|
t = t.parentElement;
|
|
25
25
|
}
|
|
26
26
|
return document.documentElement;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function D(e) {
|
|
29
29
|
const t = s(0), n = s(0), l = s();
|
|
30
30
|
let r = 0, o = 0, u = 0, i = 0;
|
|
31
|
-
const a = (
|
|
32
|
-
const c =
|
|
31
|
+
const a = (C) => {
|
|
32
|
+
const c = C.target;
|
|
33
33
|
r = c.scrollLeft - i, o = c.scrollTop - u, n.value = n.value - o, t.value = t.value - r, i = c.scrollLeft, u = c.scrollTop;
|
|
34
34
|
}, v = () => ({
|
|
35
35
|
width: 0,
|
|
@@ -42,7 +42,7 @@ function L(e) {
|
|
|
42
42
|
bottom: n.value
|
|
43
43
|
});
|
|
44
44
|
return d() && (f(() => {
|
|
45
|
-
e.value && (e.value.init({ getBoundingClientRect: v }), l.value =
|
|
45
|
+
e.value && (e.value.init({ getBoundingClientRect: v }), l.value = p(e.value.$el), l.value && l.value.addEventListener("scroll", a));
|
|
46
46
|
}), m(() => {
|
|
47
47
|
l.value && l.value.removeEventListener("scroll", a);
|
|
48
48
|
})), {
|
|
@@ -54,9 +54,9 @@ function L(e) {
|
|
|
54
54
|
}
|
|
55
55
|
var S = {
|
|
56
56
|
beforeUpdate(e, t) {
|
|
57
|
-
const { onContextmenu: n, onScroll: l, getBoundingClientRect: r } =
|
|
57
|
+
const { onContextmenu: n, onScroll: l, getBoundingClientRect: r } = g(t);
|
|
58
58
|
t.value.init({ getBoundingClientRect: r }), e.addEventListener("contextmenu", n, !1);
|
|
59
|
-
const o =
|
|
59
|
+
const o = p(t.value.$el);
|
|
60
60
|
o && o.addEventListener("scroll", l), e.additionalData = {
|
|
61
61
|
onContextmenu: n,
|
|
62
62
|
onScroll: l,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("vue")):typeof define=="function"&&define.amd?define(["vue"],s):(n=typeof globalThis<"u"?globalThis:n||self,n["v-contextmenu"]=s(n.Vue))})(this,function(n){function s(e,t){const{x:o,y:l,getBoundingClientRect:i,onScroll:a}=m(e),u=r=>{o.value=r.clientX,l.value=r.clientY,r.preventDefault(),e.value.show()},c=(0,n.computed)(()=>(0,n.unref)(t));return c&&(0,n.getCurrentInstance)()&&((0,n.onMounted)(()=>{c.value?.addEventListener("contextmenu",u,!1)}),(0,n.onUnmounted)(()=>{c.value?.removeEventListener("contextmenu",u)})),{x:o,y:l,getBoundingClientRect:i,onContextmenu:u,onScroll:a}}function f(e){if(!e)return;let t=e.parentElement;for(;t;){const{overflow:o}=
|
|
1
|
+
(function(n,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("vue")):typeof define=="function"&&define.amd?define(["vue"],s):(n=typeof globalThis<"u"?globalThis:n||self,n["v-contextmenu"]=s(n.Vue))})(this,function(n){function s(e,t){const{x:o,y:l,getBoundingClientRect:i,onScroll:a}=m(e),u=r=>{o.value=r.clientX,l.value=r.clientY,r.preventDefault(),e.value.show()},c=(0,n.computed)(()=>(0,n.unref)(t));return c&&(0,n.getCurrentInstance)()&&((0,n.onMounted)(()=>{c.value?.addEventListener("contextmenu",u,!1)}),(0,n.onUnmounted)(()=>{c.value?.removeEventListener("contextmenu",u)})),{x:o,y:l,getBoundingClientRect:i,onContextmenu:u,onScroll:a}}function f(e){if(!e||typeof globalThis.getComputedStyle!="function"||typeof document>"u")return;let t=e.parentElement;for(;t;){const{overflow:o}=globalThis.getComputedStyle(t);if(o.split(" ").every(l=>l==="auto"||l==="scroll"))return t;t=t.parentElement}return document.documentElement}function m(e){const t=(0,n.ref)(0),o=(0,n.ref)(0),l=(0,n.ref)();let i=0,a=0,u=0,c=0;const r=C=>{const d=C.target;i=d.scrollLeft-c,a=d.scrollTop-u,o.value=o.value-a,t.value=t.value-i,c=d.scrollLeft,u=d.scrollTop},v=()=>({width:0,height:0,x:t.value,y:o.value,top:o.value,left:t.value,right:t.value,bottom:o.value});return(0,n.getCurrentInstance)()&&((0,n.onMounted)(()=>{e.value&&(e.value.init({getBoundingClientRect:v}),l.value=f(e.value.$el),l.value&&l.value.addEventListener("scroll",r))}),(0,n.onUnmounted)(()=>{l.value&&l.value.removeEventListener("scroll",r)})),{x:t,y:o,getBoundingClientRect:v,onScroll:r}}var p={beforeUpdate(e,t){const{onContextmenu:o,onScroll:l,getBoundingClientRect:i}=s(t);t.value.init({getBoundingClientRect:i}),e.addEventListener("contextmenu",o,!1);const a=f(t.value.$el);a&&a.addEventListener("scroll",l),e.additionalData={onContextmenu:o,onScroll:l,scrollContainerEl:a}},beforeUnmount(e){e?.additionalData?.onContextmenu&&e.removeEventListener("contextmenu",e.additionalData.onContextmenu),e?.additionalData?.onScroll&&e?.additionalData?.scrollContainerEl&&e.additionalData.scrollContainerEl.removeEventListener("scroll",e.additionalData.onScroll)}};return p});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Volver
|
|
1
|
+
import type { Volver } from './Volver';
|
|
2
2
|
import VolverPlugin from './Volver';
|
|
3
3
|
export { VolverPlugin };
|
|
4
4
|
export * from './types';
|
|
5
|
-
export type { Volver, VolverOptions };
|
|
5
|
+
export type { Volver, VolverOptions } from './Volver';
|
|
6
6
|
declare module 'vue' {
|
|
7
7
|
interface ComponentCustomProperties {
|
|
8
8
|
$vv?: typeof Volver.prototype;
|
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { addAPIProvider as d, addCollection as _, addIcon as v } from "@iconify/vue";
|
|
2
|
-
import { ref as
|
|
3
|
-
var
|
|
2
|
+
import { ref as E } from "vue";
|
|
3
|
+
var P = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), x = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), L = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), p = /[^\p{L}\d]+/giu, l = "$1\0$2", f = "";
|
|
4
4
|
function h(r) {
|
|
5
5
|
let e = r.trim();
|
|
6
|
-
e = e.replace(
|
|
6
|
+
e = e.replace(P, l).replace(x, l), e = e.replace(p, "\0");
|
|
7
7
|
let s = 0, t = e.length;
|
|
8
8
|
for (; e.charAt(s) === "\0"; ) s++;
|
|
9
9
|
if (s === t) return [];
|
|
10
10
|
for (; e.charAt(t - 1) === "\0"; ) t--;
|
|
11
11
|
return e.slice(s, t).split(/\0/g);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function C(r) {
|
|
14
14
|
const e = h(r);
|
|
15
15
|
for (let s = 0; s < e.length; s++) {
|
|
16
|
-
const t = e[s], n =
|
|
16
|
+
const t = e[s], n = L.exec(t);
|
|
17
17
|
if (n) {
|
|
18
18
|
const i = n.index + (n[1] ?? n[2]).length;
|
|
19
19
|
e.splice(s, 1, t.slice(0, i), t.slice(i));
|
|
@@ -21,21 +21,21 @@ function m(r) {
|
|
|
21
21
|
}
|
|
22
22
|
return e;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const [s, t, n] =
|
|
26
|
-
return s + t.map(
|
|
24
|
+
function m(r, e) {
|
|
25
|
+
const [s, t, n] = g(r, e);
|
|
26
|
+
return s + t.map(I(e?.locale)).join(e?.delimiter ?? " ") + n;
|
|
27
27
|
}
|
|
28
28
|
function A(r, e) {
|
|
29
|
-
return
|
|
29
|
+
return m(r, {
|
|
30
30
|
delimiter: "-",
|
|
31
31
|
...e
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function I(r) {
|
|
35
35
|
return r === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(r);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const s = e.split ?? (e.separateNumbers ?
|
|
37
|
+
function g(r, e = {}) {
|
|
38
|
+
const s = e.split ?? (e.separateNumbers ? C : h), t = e.prefixCharacters ?? f, n = e.suffixCharacters ?? f;
|
|
39
39
|
let i = 0, a = r.length;
|
|
40
40
|
for (; i < r.length; ) {
|
|
41
41
|
const c = r.charAt(i);
|
|
@@ -53,7 +53,7 @@ function I(r, e = {}) {
|
|
|
53
53
|
r.slice(a)
|
|
54
54
|
];
|
|
55
55
|
}
|
|
56
|
-
var R = /* @__PURE__ */ Symbol.for("volver");
|
|
56
|
+
var R = /* @__PURE__ */ Symbol.for("volver"), b = { cache: "force-cache" };
|
|
57
57
|
function u(r, e, s) {
|
|
58
58
|
const t = s || r.name;
|
|
59
59
|
if (!t) return r;
|
|
@@ -78,13 +78,13 @@ function u(r, e, s) {
|
|
|
78
78
|
}, {})
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
var
|
|
81
|
+
var w = class {
|
|
82
82
|
_fetchOptions = {};
|
|
83
83
|
_iconsCollections = [];
|
|
84
84
|
_iconsProvider = "vv";
|
|
85
85
|
_nuxt = !1;
|
|
86
86
|
_experimentalFeatures = {};
|
|
87
|
-
defaults =
|
|
87
|
+
defaults = E({});
|
|
88
88
|
constructor({ fetchWithCredentials: r, fetchOptions: e, iconsProvider: s, nuxt: t, iconsCollections: n, defaults: i, experimentalFeatures: a } = {}) {
|
|
89
89
|
e && (this._fetchOptions = e), r && (this._fetchOptions = {
|
|
90
90
|
...this._fetchOptions,
|
|
@@ -114,7 +114,7 @@ var b = class {
|
|
|
114
114
|
addIconsAPIProvider(r, e) {
|
|
115
115
|
return d(r, e);
|
|
116
116
|
}
|
|
117
|
-
async fetchIcon(r, e =
|
|
117
|
+
async fetchIcon(r, e = b) {
|
|
118
118
|
const s = await fetch(r, {
|
|
119
119
|
...this._fetchOptions,
|
|
120
120
|
...e
|
|
@@ -122,8 +122,8 @@ var b = class {
|
|
|
122
122
|
if (!s.ok) throw new Error(`Cannot fetch icon "${r}": ${s.status} ${s.statusText}`);
|
|
123
123
|
return s.text();
|
|
124
124
|
}
|
|
125
|
-
},
|
|
126
|
-
const s = new
|
|
125
|
+
}, F = { install(r, e = {}) {
|
|
126
|
+
const s = new w(e);
|
|
127
127
|
r.config.globalProperties.$vv = s, e.components && Object.entries(e.components).forEach(([t, n]) => {
|
|
128
128
|
r.component(t, u(n, e.defaults));
|
|
129
129
|
}), e.aliases && Object.entries(e.aliases).forEach(([t, n]) => {
|
|
@@ -134,5 +134,5 @@ var b = class {
|
|
|
134
134
|
}), r.provide(R, s);
|
|
135
135
|
} };
|
|
136
136
|
export {
|
|
137
|
-
|
|
137
|
+
F as VolverPlugin
|
|
138
138
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("@iconify/vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@iconify/vue","vue"],f):(a=typeof globalThis<"u"?globalThis:a||self,f(a.volver={},a.IconifyVue,a.Vue))})(this,function(a,f,_){Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});var P=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),
|
|
1
|
+
(function(a,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("@iconify/vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@iconify/vue","vue"],f):(a=typeof globalThis<"u"?globalThis:a||self,f(a.volver={},a.IconifyVue,a.Vue))})(this,function(a,f,_){Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});var P=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),E=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),p=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),x=/[^\p{L}\d]+/giu,u="$1\0$2",d="";function h(t){let e=t.trim();e=e.replace(P,u).replace(E,u),e=e.replace(x,"\0");let i=0,r=e.length;for(;e.charAt(i)==="\0";)i++;if(i===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(i,r).split(/\0/g)}function L(t){const e=h(t);for(let i=0;i<e.length;i++){const r=e[i],n=p.exec(r);if(n){const s=n.index+(n[1]??n[2]).length;e.splice(i,1,r.slice(0,s),r.slice(s))}}return e}function C(t,e){const[i,r,n]=A(t,e);return i+r.map(m(e?.locale)).join(e?.delimiter??" ")+n}function I(t,e){return C(t,{delimiter:"-",...e})}function m(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function A(t,e={}){const i=e.split??(e.separateNumbers?L:h),r=e.prefixCharacters??d,n=e.suffixCharacters??d;let s=0,o=t.length;for(;s<t.length;){const c=t.charAt(s);if(!r.includes(c))break;s++}for(;o>s;){const c=o-1,l=t.charAt(c);if(!n.includes(l))break;o=c}return[t.slice(0,s),i(t.slice(s,o)),t.slice(o)]}var g=Symbol.for("volver"),T={cache:"force-cache"};function v(t,e,i){const r=i||t.name;if(!r)return t;const n=e?.[r],s=t.props;return!n||!s?{...t,name:r}:{...t,name:r,props:Object.keys(s).reduce((o,c)=>{if(!(c in n))return o[c]=s[c],o;const l=n[c];return typeof s[c]=="function"||Array.isArray(s[c])?(o[c]={type:s[c],default:l},o):(o[c]={...s[c],default:l},o)},{})}}var b=class{_fetchOptions={};_iconsCollections=[];_iconsProvider="vv";_nuxt=!1;_experimentalFeatures={};defaults=(0,_.ref)({});constructor({fetchWithCredentials:t,fetchOptions:e,iconsProvider:i,nuxt:r,iconsCollections:n,defaults:s,experimentalFeatures:o}={}){e&&(this._fetchOptions=e),t&&(this._fetchOptions={...this._fetchOptions,credentials:"include"}),i&&(this._iconsProvider=i),r&&(this._nuxt=r),n&&Array.isArray(n)&&n.forEach(c=>{this.addCollection(c,this._iconsProvider)}),s&&(this.defaults.value=s),o&&(this._experimentalFeatures=o)}get nuxt(){return this._nuxt}get iconsProvider(){return this._iconsProvider}get iconsCollections(){return this._iconsCollections}get experimentalFeatures(){return this._experimentalFeatures}addCollection(t,e=this._iconsProvider){return this._iconsCollections.push(t),(0,f.addCollection)(t,e)}addIcon(t,e){return(0,f.addIcon)(t,e)}addIconsAPIProvider(t,e){return(0,f.addAPIProvider)(t,e)}async fetchIcon(t,e=T){const i=await fetch(t,{...this._fetchOptions,...e});if(!i.ok)throw new Error(`Cannot fetch icon "${t}": ${i.status} ${i.statusText}`);return i.text()}},R={install(t,e={}){const i=new b(e);t.config.globalProperties.$vv=i,e.components&&Object.entries(e.components).forEach(([r,n])=>{t.component(r,v(n,e.defaults))}),e.aliases&&Object.entries(e.aliases).forEach(([r,n])=>{t.component(r,v(n,e.defaults,r))}),e.directives&&Object.entries(e.directives).forEach(([r,n])=>{const s=I(r);s.startsWith("v-")&&(r=s.substring(2).toLocaleLowerCase()),t.directive(r,n)}),t.provide(g,i)}};a.VolverPlugin=R});
|