zimjs 18.0.1 → 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 +21 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "18.0.1",
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
 
@@ -51665,13 +51666,17 @@ RETURNS obj for chaining
51665
51666
  });
51666
51667
  });
51667
51668
  } else {
51668
- obj.zimClickDownEvent = obj.on("mousedown", function (e) {
51669
+ obj.zimClickDownEvent = obj.on("mousedown", function (e) {
51669
51670
  if (e.currentTarget.type == "List") {
51670
51671
  if (e.target.type == "WindowBacking") return;
51671
51672
  var local = e.currentTarget.globalToLocal(e.stageX / zim.scaX, e.stageY / zim.scaY);
51672
51673
  if (local.y <= 0) return; // avoid titleBar and organizer
51673
51674
  }
51674
- if (M && !mobileUp && e.currentTarget.type != "List") {
51675
+ var windowParent = false;
51676
+ var pp = e.target.parent.parent;
51677
+ if (pp && pp.type == "Window") windowParent = true;
51678
+ else if (pp && pp.parent && pp.parent.type == "Window") windowParent = true;
51679
+ if (M && !mobileUp && e.currentTarget.type != "List" && !windowParent) {
51675
51680
  if (obj.excludeTap) return;
51676
51681
  call(e);
51677
51682
  if (once) {
@@ -66408,28 +66413,31 @@ note: the item is not the event object target - as that is the tile
66408
66413
 
66409
66414
  if (zot(spacingH) || !zot(colSize) || !zot(width)) spacingH = 0; // sizes override spacing
66410
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");}}
66411
66422
 
66412
66423
  // Added ZIM 018
66413
66424
  var spacingHList = [];
66414
66425
  var spacingVList = [];
66415
66426
  var spacingHTotal = 0;
66416
66427
  var spacingVTotal = 0;
66417
- for (i=0; i<cols-1; i++) {
66428
+ var mCols = (count && count<cols)?count-1:cols-1;
66429
+ for (i=0; i<mCols; i++) {
66418
66430
  var s = zik(spacingH);
66419
66431
  spacingHList.push(s);
66420
66432
  spacingHTotal += s;
66421
66433
  }
66422
- 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++) {
66423
66436
  var s = zik(spacingV);
66424
66437
  spacingVList.push(s);
66425
66438
  spacingVTotal += s;
66426
66439
  }
66427
- if (zot(squeezeH)) squeezeH = DS.squeezeH!=null?DS.squeezeH:false;
66428
- if (zot(squeezeV)) squeezeV = DS.squeezeV!=null?DS.squeezeV:false;
66429
- if (zot(align)) align = DS.align!=null?DS.align:"left";
66430
- if (zot(valign)) valign = DS.valign!=null?DS.valign:"top";
66431
- if (zot(count)) count = DS.count!=null?DS.count:(unique&&Array.isArray(obj))?obj.length:null;
66432
- if (count === 0) {count = null; if (zon) {zogy("ZIM Tile() - count parameter of 0 is ignored - see docs");}}
66440
+
66433
66441
  if (zot(mirrorH)) mirrorH = DS.mirrorH!=null?DS.mirrorH:false;
66434
66442
  if (zot(mirrorV)) mirrorV = DS.mirrorV!=null?DS.mirrorV:false;
66435
66443
  if (zot(snapToPixel)) snapToPixel = DS.snapToPixel!=null?DS.snapToPixel:true;
@@ -66661,15 +66669,15 @@ note: the item is not the event object target - as that is the tile
66661
66669
  }
66662
66670
 
66663
66671
  if (!zot(height)&&that.squeezeV=="full") {
66664
- overallHeight = height;
66665
- } else if (!zot(height)) {
66672
+ overallHeight = height;
66673
+ } else if (!zot(height)) {
66666
66674
  if (scaleToV) overallHeight = height;
66667
66675
  else overallHeight = Math.max(heightTotalMax+spacingVTotal, height);
66668
66676
  } else {
66669
66677
  if (heightUncompressedMax > 0) overallHeight = heightUncompressedMax+spacingVTotal;
66670
66678
  else overallHeight = heightTotalMax+spacingVTotal;
66671
66679
  }
66672
-
66680
+
66673
66681
  that.setBounds(0,0,overallWidth,overallHeight);
66674
66682
  widthScaling = (overallWidth-spacingHOTotal)/(widthO);
66675
66683
  heightScaling = (overallHeight-spacingVOTotal)/(heightO);
@@ -98079,4 +98087,3 @@ export let Style = zim.Style;
98079
98087
  export let assets = zim.assets;
98080
98088
  export let assetIDs = zim.assetIDs;
98081
98089
  export let ZIMON = zim.ZIMON;
98082
-