masonry-simple 1.3.0 → 1.4.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/dist/index.js +3 -7
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +3 -7
- package/dist/index.module.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +3 -11
package/dist/index.js
CHANGED
|
@@ -29,16 +29,12 @@ class $4fa36e821943b400$export$2e2bcd8739ae039 {
|
|
|
29
29
|
item.style.gridRowEnd = "span " + rowSpan;
|
|
30
30
|
}
|
|
31
31
|
resizeAllItems() {
|
|
32
|
-
|
|
32
|
+
const rowHeight = 1;
|
|
33
33
|
const rowGap = parseInt(window.getComputedStyle(this.grid).getPropertyValue("grid-row-gap"));
|
|
34
34
|
this.grid.style.alignItems = "start";
|
|
35
35
|
this.gridItems.forEach((item)=>this.resizeItem(item, rowHeight, rowGap));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
rowHeight = newHeight;
|
|
39
|
-
this.grid.style.alignItems = "stretch";
|
|
40
|
-
this.gridItems.forEach((item)=>this.resizeItem(item, rowHeight, rowGap));
|
|
41
|
-
}
|
|
36
|
+
this.grid.style.alignItems = "stretch";
|
|
37
|
+
this.gridItems.forEach((item)=>this.resizeItem(item, rowHeight, rowGap));
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
40
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAe;IACd,aAAc;QACb,IAAI,CAAC,IAAI,GAAG,IAAI;QAChB,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,GAAG,IAAI;IAC3B;IAEA,QAAQ,UAAU,CAAC,CAAC,EAAE;QACrB,MAAM,aACL,YAAY,aACZ,GAAG;QAEJ,IAAI,CAAC,IAAI,GAAG,qBAAqB,cAAc,YAAY,SAAS,aAAa,CAAC,UAAU;QAE5F,IAAI,CAAC,IAAI,CA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SAAS,EAAE,MAAM,EAAE;QACnC,MAAM,UAAU,KAAK,IAAI,CAAC,AAAC,CAAA,KAAK,YAAY,GAAG,MAAK,IAAM,CAAA,YAAY,MAAK;QAC3E,KAAK,KAAK,CAAC,UAAU,GAAG,UAAU;IACnC;IAEA,iBAAiB;QAChB,MAAM,YAAY;QAClB,MAAM,SAAS,SAAS,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC;QAC5E,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG;QAC7B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA,OAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,WAAW;QAChE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG;QAC7B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA,OAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,WAAW;IACjE;AACD","sources":["src/index.js"],"sourcesContent":["export default class MasonrySimple {\r\n\tconstructor() {\r\n\t\tthis.grid = null\r\n\t\tthis.gridItems = []\r\n\t\tthis.resizeObserver = null\r\n\t}\r\n\r\n\toptions(options = {}) {\r\n\t\tconst {\r\n\t\t\tcontainer = '.masonry',\r\n\t\t} = options\r\n\r\n\t\tthis.grid = container instanceof HTMLElement ? container : document.querySelector(container)\r\n\r\n\t\tif (!this.grid) return\r\n\r\n\t\tthis.gridItems = Array.from(this.grid.children)\r\n\t\tthis.grid.style.contain = 'layout'\r\n\t\tthis.resizeObserver = new ResizeObserver(this.resizeAllItems.bind(this))\r\n\t\tthis.resizeObserver.observe(this.grid)\r\n\t\tthis.resizeAllItems()\r\n\t}\r\n\r\n\tresizeItem(item, rowHeight, rowGap) {\r\n\t\tconst rowSpan = Math.ceil((item.clientHeight + rowGap) / (rowHeight + rowGap))\r\n\t\titem.style.gridRowEnd = 'span ' + rowSpan\r\n\t}\r\n\r\n\tresizeAllItems() {\r\n\t\tconst rowHeight = 1\r\n\t\tconst rowGap = parseInt(window.getComputedStyle(this.grid).getPropertyValue('grid-row-gap'))\r\n\t\tthis.grid.style.alignItems = 'start'\r\n\t\tthis.gridItems.forEach(item => this.resizeItem(item, rowHeight, rowGap))\r\n\t\tthis.grid.style.alignItems = 'stretch'\r\n\t\tthis.gridItems.forEach(item => this.resizeItem(item, rowHeight, rowGap))\r\n\t}\r\n}"],"names":[],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -19,16 +19,12 @@ class $cf838c15c8b009ba$export$2e2bcd8739ae039 {
|
|
|
19
19
|
item.style.gridRowEnd = "span " + rowSpan;
|
|
20
20
|
}
|
|
21
21
|
resizeAllItems() {
|
|
22
|
-
|
|
22
|
+
const rowHeight = 1;
|
|
23
23
|
const rowGap = parseInt(window.getComputedStyle(this.grid).getPropertyValue("grid-row-gap"));
|
|
24
24
|
this.grid.style.alignItems = "start";
|
|
25
25
|
this.gridItems.forEach((item)=>this.resizeItem(item, rowHeight, rowGap));
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
rowHeight = newHeight;
|
|
29
|
-
this.grid.style.alignItems = "stretch";
|
|
30
|
-
this.gridItems.forEach((item)=>this.resizeItem(item, rowHeight, rowGap));
|
|
31
|
-
}
|
|
26
|
+
this.grid.style.alignItems = "stretch";
|
|
27
|
+
this.gridItems.forEach((item)=>this.resizeItem(item, rowHeight, rowGap));
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAe;IACd,aAAc;QACb,IAAI,CAAC,IAAI,GAAG,IAAI;QAChB,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,GAAG,IAAI;IAC3B;IAEA,QAAQ,UAAU,CAAC,CAAC,EAAE;QACrB,MAAM,aACL,YAAY,aACZ,GAAG;QAEJ,IAAI,CAAC,IAAI,GAAG,qBAAqB,cAAc,YAAY,SAAS,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AAc;IACpB;IAEA,WAAW,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE;QACnC,MAAM,UAAU,KAAK,IAAI,CAAC,AAAC,CAAA,KAAK,YAAY,GAAG,MAAK,IAAM,CAAA,YAAY,MAAK;QAC3E,KAAK,KAAK,CAAC,UAAU,GAAG,UAAU;IACnC;IAEA,iBAAiB;QAChB,MAAM,YAAY;QAClB,MAAM,SAAS,SAAS,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC;QAC5E,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG;QAC7B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA,OAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,WAAW;QAChE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG;QAC7B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA,OAAQ,IAAI,CAAC,UAAU,CAAC,MAAM,WAAW;IACjE;AACD","sources":["src/index.js"],"sourcesContent":["export default class MasonrySimple {\r\n\tconstructor() {\r\n\t\tthis.grid = null\r\n\t\tthis.gridItems = []\r\n\t\tthis.resizeObserver = null\r\n\t}\r\n\r\n\toptions(options = {}) {\r\n\t\tconst {\r\n\t\t\tcontainer = '.masonry',\r\n\t\t} = options\r\n\r\n\t\tthis.grid = container instanceof HTMLElement ? container : document.querySelector(container)\r\n\r\n\t\tif (!this.grid) return\r\n\r\n\t\tthis.gridItems = Array.from(this.grid.children)\r\n\t\tthis.grid.style.contain = 'layout'\r\n\t\tthis.resizeObserver = new ResizeObserver(this.resizeAllItems.bind(this))\r\n\t\tthis.resizeObserver.observe(this.grid)\r\n\t\tthis.resizeAllItems()\r\n\t}\r\n\r\n\tresizeItem(item, rowHeight, rowGap) {\r\n\t\tconst rowSpan = Math.ceil((item.clientHeight + rowGap) / (rowHeight + rowGap))\r\n\t\titem.style.gridRowEnd = 'span ' + rowSpan\r\n\t}\r\n\r\n\tresizeAllItems() {\r\n\t\tconst rowHeight = 1\r\n\t\tconst rowGap = parseInt(window.getComputedStyle(this.grid).getPropertyValue('grid-row-gap'))\r\n\t\tthis.grid.style.alignItems = 'start'\r\n\t\tthis.gridItems.forEach(item => this.resizeItem(item, rowHeight, rowGap))\r\n\t\tthis.grid.style.alignItems = 'stretch'\r\n\t\tthis.gridItems.forEach(item => this.resizeItem(item, rowHeight, rowGap))\r\n\t}\r\n}"],"names":[],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -27,19 +27,11 @@ export default class MasonrySimple {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
resizeAllItems() {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const rowHeight = 1
|
|
32
31
|
const rowGap = parseInt(window.getComputedStyle(this.grid).getPropertyValue('grid-row-gap'))
|
|
33
|
-
|
|
34
32
|
this.grid.style.alignItems = 'start'
|
|
35
33
|
this.gridItems.forEach(item => this.resizeItem(item, rowHeight, rowGap))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (rowHeight !== newHeight) {
|
|
40
|
-
rowHeight = newHeight
|
|
41
|
-
this.grid.style.alignItems = 'stretch'
|
|
42
|
-
this.gridItems.forEach(item => this.resizeItem(item, rowHeight, rowGap))
|
|
43
|
-
}
|
|
34
|
+
this.grid.style.alignItems = 'stretch'
|
|
35
|
+
this.gridItems.forEach(item => this.resizeItem(item, rowHeight, rowGap))
|
|
44
36
|
}
|
|
45
37
|
}
|