vuetify-masonry 0.0.6 → 0.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuetify-masonry",
3
- "version": "0.0.6",
3
+ "version": "0.2.0",
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",
@@ -15,10 +15,15 @@
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/senerh/vuetify-masonry.git"
21
+ },
18
22
  "scripts": {
19
23
  "dev": "vite",
20
24
  "build": "vite build",
21
- "lint": "eslint . --ext .ts,.vue"
25
+ "lint": "eslint . --ext .ts,.vue",
26
+ "release": "semantic-release"
22
27
  },
23
28
  "peerDependencies": {
24
29
  "vue": "^3.2.0",
@@ -1,30 +0,0 @@
1
- export type NbMasonryColumns = 1 | 2 | 3 | 4 | 6 | 12;
2
- export type ColProp = NbMasonryColumns | `${NbMasonryColumns}`;
3
- declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
5
- col?: ColProp;
6
- items?: T[];
7
- xs?: ColProp;
8
- sm?: ColProp;
9
- md?: ColProp;
10
- lg?: ColProp;
11
- xl?: ColProp;
12
- xxl?: ColProp;
13
- } & Partial<{}>> & import('vue').PublicProps;
14
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
15
- attrs: any;
16
- slots: {
17
- item?(_: {
18
- item: T;
19
- index: number;
20
- columnIndex: number;
21
- }): any;
22
- };
23
- emit: {};
24
- }>) => import('vue').VNode & {
25
- __ctx?: Awaited<typeof __VLS_setup>;
26
- };
27
- export default _default;
28
- type __VLS_PrettifyLocal<T> = {
29
- [K in keyof T]: T[K];
30
- } & {};
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { App } from 'vue';
2
- import { default as VMasonry } from './components/VMasonry.vue';
3
- declare const installable: {
4
- install(app: App): void;
5
- };
6
- export { VMasonry };
7
- export default installable;
@@ -1,6 +0,0 @@
1
- export * from '../index'
2
- export {}
3
- import VuetifyMasonry from '../index'
4
- export default VuetifyMasonry
5
- export * from '../index'
6
- export {}
@@ -1,88 +0,0 @@
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({
5
- __name: "VMasonry",
6
- props: {
7
- col: {},
8
- items: { default: () => [] },
9
- xs: {},
10
- sm: {},
11
- md: {},
12
- lg: {},
13
- xl: {},
14
- xxl: {}
15
- },
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;
32
- }
33
- return 1;
34
- };
35
- return C.value ? r(
36
- e.xxl,
37
- e.xl,
38
- e.lg,
39
- e.md,
40
- e.sm,
41
- e.xs,
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 }, () => []);
46
- return e.items.forEach((r, l) => {
47
- n[l % c.value].push(r);
48
- }), n;
49
- });
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
- }));
78
- }
79
- }), R = {
80
- ...g,
81
- install(u) {
82
- u.component("VMasonry", g);
83
- }
84
- };
85
- export {
86
- g as VMasonry,
87
- R as default
88
- };
@@ -1 +0,0 @@
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"}})}));