zimjs 18.0.2 → 18.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zim.js +15 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "18.0.2",
3
+ "version": "18.0.3",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -47513,6 +47513,7 @@ or using next(), prev() or go() methods or index property.
47513
47513
  Can be horizontal or vertical.
47514
47514
  See: ZIM Carousel for a 2D component.
47515
47515
  See: https://zimjs.com/018/carousel3D.html for an example
47516
+ See: https://zimjs.com/018/carousel3D_2.html for a simple example
47516
47517
 
47517
47518
  NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
47518
47519
 
@@ -66412,28 +66413,31 @@ note: the item is not the event object target - as that is the tile
66412
66413
 
66413
66414
  if (zot(spacingH) || !zot(colSize) || !zot(width)) spacingH = 0; // sizes override spacing
66414
66415
  if (zot(spacingV) || !zot(rowSize) || !zot(height)) spacingV = 0;
66416
+ if (zot(squeezeH)) squeezeH = DS.squeezeH!=null?DS.squeezeH:false;
66417
+ if (zot(squeezeV)) squeezeV = DS.squeezeV!=null?DS.squeezeV:false;
66418
+ if (zot(align)) align = DS.align!=null?DS.align:"left";
66419
+ if (zot(valign)) valign = DS.valign!=null?DS.valign:"top";
66420
+ if (zot(count)) count = DS.count!=null?DS.count:(unique&&Array.isArray(obj))?obj.length:null;
66421
+ if (count === 0) {count = null; if (zon) {zogy("ZIM Tile() - count parameter of 0 is ignored - see docs");}}
66415
66422
 
66416
66423
  // Added ZIM 018
66417
66424
  var spacingHList = [];
66418
66425
  var spacingVList = [];
66419
66426
  var spacingHTotal = 0;
66420
66427
  var spacingVTotal = 0;
66421
- for (i=0; i<cols-1; i++) {
66428
+ var mCols = (count && count<cols)?count-1:cols-1;
66429
+ for (i=0; i<mCols; i++) {
66422
66430
  var s = zik(spacingH);
66423
66431
  spacingHList.push(s);
66424
66432
  spacingHTotal += s;
66425
66433
  }
66426
- for (i=0; i<rows-1; i++) {
66434
+ var mRows = (count && Math.ceil(count/cols)<rows)?Math.ceil(count/cols)-1:rows-1;
66435
+ for (i=0; i<mRows; i++) {
66427
66436
  var s = zik(spacingV);
66428
66437
  spacingVList.push(s);
66429
66438
  spacingVTotal += s;
66430
66439
  }
66431
- if (zot(squeezeH)) squeezeH = DS.squeezeH!=null?DS.squeezeH:false;
66432
- if (zot(squeezeV)) squeezeV = DS.squeezeV!=null?DS.squeezeV:false;
66433
- if (zot(align)) align = DS.align!=null?DS.align:"left";
66434
- if (zot(valign)) valign = DS.valign!=null?DS.valign:"top";
66435
- if (zot(count)) count = DS.count!=null?DS.count:(unique&&Array.isArray(obj))?obj.length:null;
66436
- if (count === 0) {count = null; if (zon) {zogy("ZIM Tile() - count parameter of 0 is ignored - see docs");}}
66440
+
66437
66441
  if (zot(mirrorH)) mirrorH = DS.mirrorH!=null?DS.mirrorH:false;
66438
66442
  if (zot(mirrorV)) mirrorV = DS.mirrorV!=null?DS.mirrorV:false;
66439
66443
  if (zot(snapToPixel)) snapToPixel = DS.snapToPixel!=null?DS.snapToPixel:true;
@@ -66665,15 +66669,15 @@ note: the item is not the event object target - as that is the tile
66665
66669
  }
66666
66670
 
66667
66671
  if (!zot(height)&&that.squeezeV=="full") {
66668
- overallHeight = height;
66669
- } else if (!zot(height)) {
66672
+ overallHeight = height;
66673
+ } else if (!zot(height)) {
66670
66674
  if (scaleToV) overallHeight = height;
66671
66675
  else overallHeight = Math.max(heightTotalMax+spacingVTotal, height);
66672
66676
  } else {
66673
66677
  if (heightUncompressedMax > 0) overallHeight = heightUncompressedMax+spacingVTotal;
66674
66678
  else overallHeight = heightTotalMax+spacingVTotal;
66675
66679
  }
66676
-
66680
+
66677
66681
  that.setBounds(0,0,overallWidth,overallHeight);
66678
66682
  widthScaling = (overallWidth-spacingHOTotal)/(widthO);
66679
66683
  heightScaling = (overallHeight-spacingVOTotal)/(heightO);