vuetify-masonry 0.0.5 → 0.0.6
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/vuetify-masonry.mjs +61 -63
- package/dist/vuetify-masonry.umd.js +1 -1
- package/package.json +1 -1
package/dist/vuetify-masonry.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useDisplay as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as k, computed as f, createBlock as p, openBlock as o, unref as m, withCtx as i, createVNode as b, createElementBlock as d, Fragment as x, renderList as v, normalizeClass as B, renderSlot as M } from "vue";
|
|
2
|
+
import { useDisplay as w } from "vuetify";
|
|
3
|
+
import { VContainer as E, VRow as N, VCol as z } from "vuetify/components";
|
|
4
|
+
const g = /* @__PURE__ */ k({
|
|
4
5
|
__name: "VMasonry",
|
|
5
6
|
props: {
|
|
6
7
|
col: {},
|
|
@@ -12,26 +13,26 @@ const y = /* @__PURE__ */ B({
|
|
|
12
13
|
xl: {},
|
|
13
14
|
xxl: {}
|
|
14
15
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const e =
|
|
17
|
-
xs:
|
|
18
|
-
smAndUp:
|
|
19
|
-
mdAndUp:
|
|
20
|
-
lgAndUp:
|
|
21
|
-
xlAndUp:
|
|
22
|
-
xxl:
|
|
23
|
-
} =
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
return typeof
|
|
27
|
-
},
|
|
28
|
-
for (const
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
16
|
+
setup(u) {
|
|
17
|
+
const e = u, {
|
|
18
|
+
xs: y,
|
|
19
|
+
smAndUp: _,
|
|
20
|
+
mdAndUp: A,
|
|
21
|
+
lgAndUp: V,
|
|
22
|
+
xlAndUp: h,
|
|
23
|
+
xxl: C
|
|
24
|
+
} = w(), c = f(() => {
|
|
25
|
+
const n = (l) => {
|
|
26
|
+
if (l !== void 0)
|
|
27
|
+
return typeof l == "string" ? Number(l) : l;
|
|
28
|
+
}, r = (...l) => {
|
|
29
|
+
for (const t of l) {
|
|
30
|
+
const s = n(t);
|
|
31
|
+
if (s !== void 0) return s;
|
|
31
32
|
}
|
|
32
33
|
return 1;
|
|
33
34
|
};
|
|
34
|
-
return
|
|
35
|
+
return C.value ? r(
|
|
35
36
|
e.xxl,
|
|
36
37
|
e.xl,
|
|
37
38
|
e.lg,
|
|
@@ -39,52 +40,49 @@ const y = /* @__PURE__ */ B({
|
|
|
39
40
|
e.sm,
|
|
40
41
|
e.xs,
|
|
41
42
|
e.col
|
|
42
|
-
) :
|
|
43
|
-
}),
|
|
44
|
-
const
|
|
45
|
-
return e.items.forEach((
|
|
46
|
-
l
|
|
47
|
-
}),
|
|
43
|
+
) : h.value ? r(e.xl, e.lg, e.md, e.sm, e.xs, e.col) : V.value ? r(e.lg, e.md, e.sm, e.xs, e.col) : A.value ? r(e.md, e.sm, e.xs, e.col) : _.value ? r(e.sm, e.xs, e.col) : y.value ? r(e.xs, e.col) : r(e.col);
|
|
44
|
+
}), U = f(() => {
|
|
45
|
+
const n = Array.from({ length: c.value }, () => []);
|
|
46
|
+
return e.items.forEach((r, l) => {
|
|
47
|
+
n[l % c.value].push(r);
|
|
48
|
+
}), n;
|
|
48
49
|
});
|
|
49
|
-
return (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
_: 3
|
|
78
|
-
});
|
|
79
|
-
};
|
|
50
|
+
return (n, r) => (o(), p(m(E), { class: "pt-6" }, {
|
|
51
|
+
default: i(() => [
|
|
52
|
+
b(m(N), null, {
|
|
53
|
+
default: i(() => [
|
|
54
|
+
(o(!0), d(x, null, v(U.value, (l, t) => (o(), p(m(z), {
|
|
55
|
+
key: t,
|
|
56
|
+
cols: 12 / c.value
|
|
57
|
+
}, {
|
|
58
|
+
default: i(() => [
|
|
59
|
+
(o(!0), d(x, null, v(l, (s, a) => (o(), d("div", {
|
|
60
|
+
key: a,
|
|
61
|
+
class: B({ "mb-6": a !== l.length - 1 })
|
|
62
|
+
}, [
|
|
63
|
+
M(n.$slots, "item", {
|
|
64
|
+
item: s,
|
|
65
|
+
index: a,
|
|
66
|
+
columnIndex: t
|
|
67
|
+
})
|
|
68
|
+
], 2))), 128))
|
|
69
|
+
]),
|
|
70
|
+
_: 2
|
|
71
|
+
}, 1032, ["cols"]))), 128))
|
|
72
|
+
]),
|
|
73
|
+
_: 3
|
|
74
|
+
})
|
|
75
|
+
]),
|
|
76
|
+
_: 3
|
|
77
|
+
}));
|
|
80
78
|
}
|
|
81
|
-
}),
|
|
82
|
-
...
|
|
83
|
-
install(
|
|
84
|
-
|
|
79
|
+
}), R = {
|
|
80
|
+
...g,
|
|
81
|
+
install(u) {
|
|
82
|
+
u.component("VMasonry", g);
|
|
85
83
|
}
|
|
86
84
|
};
|
|
87
85
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
g as VMasonry,
|
|
87
|
+
R as default
|
|
90
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuetify"),require("vuetify/components")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify","vuetify/components"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.VuetifyMasonry={},o.Vue,o.Vuetify,o.components))})(this,(function(o,e,m,i){"use strict";const u=e.defineComponent({__name:"VMasonry",props:{col:{},items:{default:()=>[]},xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}},setup(f){const n=f,{xs:x,smAndUp:y,mdAndUp:k,lgAndUp:h,xlAndUp:B,xxl:V}=m.useDisplay(),a=e.computed(()=>{const l=t=>{if(t!==void 0)return typeof t=="string"?Number(t):t},r=(...t)=>{for(const s of t){const c=l(s);if(c!==void 0)return c}return 1};return V.value?r(n.xxl,n.xl,n.lg,n.md,n.sm,n.xs,n.col):B.value?r(n.xl,n.lg,n.md,n.sm,n.xs,n.col):h.value?r(n.lg,n.md,n.sm,n.xs,n.col):k.value?r(n.md,n.sm,n.xs,n.col):y.value?r(n.sm,n.xs,n.col):x.value?r(n.xs,n.col):r(n.col)}),_=e.computed(()=>{const l=Array.from({length:a.value},()=>[]);return n.items.forEach((r,t)=>{l[t%a.value].push(r)}),l});return(l,r)=>(e.openBlock(),e.createBlock(e.unref(i.VContainer),{class:"pt-6"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.VRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(t,s)=>(e.openBlock(),e.createBlock(e.unref(i.VCol),{key:s,cols:12/a.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:e.normalizeClass({"mb-6":d!==t.length-1})},[e.renderSlot(l.$slots,"item",{item:c,index:d,columnIndex:s})],2))),128))]),_:2},1032,["cols"]))),128))]),_:3})]),_:3}))}}),p={...u,install(f){f.component("VMasonry",u)}};o.VMasonry=u,o.default=p,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|