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.
@@ -1,7 +1,7 @@
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";
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 N, VCol as z } from "vuetify/components";
4
- const g = /* @__PURE__ */ k({
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: V,
22
- xlAndUp: h,
23
- xxl: C
24
- } = w(), c = f(() => {
25
- const n = (l) => {
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 t of l) {
30
- const s = n(t);
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 C.value ? r(
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
- ) : 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 }, () => []);
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
- n[l % c.value].push(r);
48
- }), n;
47
+ t[l % a.value].push(r);
48
+ }), t;
49
49
  });
50
- return (n, r) => (o(), p(m(E), { class: "pt-6" }, {
50
+ return (t, r) => (n(), p(c(E), { class: "pt-6" }, {
51
51
  default: i(() => [
52
- b(m(N), null, {
52
+ h(c(z), null, {
53
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
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
- (o(!0), d(x, null, v(l, (s, a) => (o(), d("div", {
60
- key: a,
61
- class: B({ "mb-6": a !== l.length - 1 })
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(n.$slots, "item", {
63
+ M(t.$slots, "item", {
64
64
  item: s,
65
- index: a,
66
- columnIndex: t
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
- }), R = {
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
- R as default
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.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"}})}));
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.0.6",
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
- "lint": "eslint . --ext .ts,.vue"
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",