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