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