zimjs 18.0.2 → 18.0.4
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 +1 -1
- package/src/zim.js +28 -32
package/package.json
CHANGED
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
|
|
|
@@ -65348,7 +65349,7 @@ addChild(), removeChild(), addChildAt(), getChildAt(), contains(), removeAllChil
|
|
|
65348
65349
|
PROPERTIES
|
|
65349
65350
|
type - holds the class name as a String
|
|
65350
65351
|
items - an array of the wrapper items
|
|
65351
|
-
items2D - read only array of rows each containing an array of
|
|
65352
|
+
items2D - read only array of rows each containing an array of columns of items
|
|
65352
65353
|
** see the parameter for descriptions of the following
|
|
65353
65354
|
** setting each will resize the wrapper at the current width and height
|
|
65354
65355
|
** all these properties accept ZIM VEE (except spacingH) for instance: flip:series(false,true)
|
|
@@ -66321,12 +66322,12 @@ addChild(), removeChild(), addChildAt(), getChildAt(), contains(), removeAllChil
|
|
|
66321
66322
|
PROPERTIES
|
|
66322
66323
|
type - holds the class name as a String
|
|
66323
66324
|
items - read only array of the original tile items - or use tile.getChildAt() or tile.loop(function (item) {})
|
|
66324
|
-
items2D - read only array of rows each containing an array of
|
|
66325
|
+
items2D - read only array of rows each containing an array of columns of items
|
|
66325
66326
|
items2DCols - read only array of columns each containing array of rows of items
|
|
66326
66327
|
** the current properties work for equal column size and equal row size
|
|
66327
66328
|
** although the row and column size can be different
|
|
66328
66329
|
current ** - a read only array of the current order of tile items - if items have been scrambled
|
|
66329
|
-
current2D ** - read only array the current order of rows each containing an array of
|
|
66330
|
+
current2D ** - read only array the current order of rows each containing an array of columns of items
|
|
66330
66331
|
current2DCols ** - read only array the current order of columns each containing array of rows of items
|
|
66331
66332
|
tileNum - this property is added to each object in the tile to give its number in the tile
|
|
66332
66333
|
tileCol - this property is added to each object in the tile to give its column number in the tile
|
|
@@ -66391,49 +66392,44 @@ note: the item is not the event object target - as that is the tile
|
|
|
66391
66392
|
|
|
66392
66393
|
if (zot(spacingH)) spacingH = DS.spacingH!=null?DS.spacingH:null;
|
|
66393
66394
|
if (zot(spacingV)) spacingV = DS.spacingV!=null?DS.spacingV:null;
|
|
66394
|
-
|
|
66395
|
-
// Added ZIM 018
|
|
66396
|
-
var spacingHOList = [];
|
|
66397
|
-
var spacingVOList = [];
|
|
66398
|
-
var spacingHOTotal = 0;
|
|
66399
|
-
var spacingVOTotal = 0;
|
|
66400
|
-
for (i=0; i<cols-1; i++) {
|
|
66401
|
-
var s = zik(spacingH);
|
|
66402
|
-
spacingHOList.push(s);
|
|
66403
|
-
spacingHOTotal += s;
|
|
66404
|
-
}
|
|
66405
|
-
for (i=0; i<rows-1; i++) {
|
|
66406
|
-
var s = zik(spacingV);
|
|
66407
|
-
spacingVOList.push(s);
|
|
66408
|
-
spacingVOTotal += s;
|
|
66409
|
-
}
|
|
66410
|
-
var spacingHAve = cols-1>0?spacingHTotal/(cols-1):0
|
|
66411
|
-
var spacingVAve = rows-1>0?spacingVTotal/(rows-1):0
|
|
66412
66395
|
|
|
66413
66396
|
if (zot(spacingH) || !zot(colSize) || !zot(width)) spacingH = 0; // sizes override spacing
|
|
66414
66397
|
if (zot(spacingV) || !zot(rowSize) || !zot(height)) spacingV = 0;
|
|
66398
|
+
if (zot(squeezeH)) squeezeH = DS.squeezeH!=null?DS.squeezeH:false;
|
|
66399
|
+
if (zot(squeezeV)) squeezeV = DS.squeezeV!=null?DS.squeezeV:false;
|
|
66400
|
+
if (zot(align)) align = DS.align!=null?DS.align:"left";
|
|
66401
|
+
if (zot(valign)) valign = DS.valign!=null?DS.valign:"top";
|
|
66402
|
+
if (zot(count)) count = DS.count!=null?DS.count:(unique&&Array.isArray(obj))?obj.length:null;
|
|
66403
|
+
if (count === 0) {count = null; if (zon) {zogy("ZIM Tile() - count parameter of 0 is ignored - see docs");}}
|
|
66415
66404
|
|
|
66416
66405
|
// Added ZIM 018
|
|
66406
|
+
|
|
66417
66407
|
var spacingHList = [];
|
|
66418
66408
|
var spacingVList = [];
|
|
66419
66409
|
var spacingHTotal = 0;
|
|
66420
66410
|
var spacingVTotal = 0;
|
|
66421
|
-
|
|
66411
|
+
var mCols = (count && count<cols)?count-1:cols-1;
|
|
66412
|
+
for (i=0; i<mCols; i++) {
|
|
66422
66413
|
var s = zik(spacingH);
|
|
66423
66414
|
spacingHList.push(s);
|
|
66424
66415
|
spacingHTotal += s;
|
|
66425
66416
|
}
|
|
66426
|
-
|
|
66417
|
+
var mRows = (count && Math.ceil(count/cols)<rows)?Math.ceil(count/cols)-1:rows-1;
|
|
66418
|
+
for (i=0; i<mRows; i++) {
|
|
66427
66419
|
var s = zik(spacingV);
|
|
66428
66420
|
spacingVList.push(s);
|
|
66429
66421
|
spacingVTotal += s;
|
|
66430
66422
|
}
|
|
66431
|
-
|
|
66432
|
-
|
|
66433
|
-
|
|
66434
|
-
|
|
66435
|
-
|
|
66436
|
-
|
|
66423
|
+
|
|
66424
|
+
var spacingHOList = zim.copy(spacingHList);
|
|
66425
|
+
var spacingVOList = zim.copy(spacingVList);;
|
|
66426
|
+
var spacingHOTotal = spacingHTotal;
|
|
66427
|
+
var spacingVOTotal = spacingVTotal;
|
|
66428
|
+
var spacingHAve = cols-1>0?spacingHTotal/(cols-1):0
|
|
66429
|
+
var spacingVAve = rows-1>0?spacingVTotal/(rows-1):0
|
|
66430
|
+
|
|
66431
|
+
// end add 018
|
|
66432
|
+
|
|
66437
66433
|
if (zot(mirrorH)) mirrorH = DS.mirrorH!=null?DS.mirrorH:false;
|
|
66438
66434
|
if (zot(mirrorV)) mirrorV = DS.mirrorV!=null?DS.mirrorV:false;
|
|
66439
66435
|
if (zot(snapToPixel)) snapToPixel = DS.snapToPixel!=null?DS.snapToPixel:true;
|
|
@@ -66665,15 +66661,15 @@ note: the item is not the event object target - as that is the tile
|
|
|
66665
66661
|
}
|
|
66666
66662
|
|
|
66667
66663
|
if (!zot(height)&&that.squeezeV=="full") {
|
|
66668
|
-
overallHeight = height;
|
|
66669
|
-
} else if (!zot(height)) {
|
|
66664
|
+
overallHeight = height;
|
|
66665
|
+
} else if (!zot(height)) {
|
|
66670
66666
|
if (scaleToV) overallHeight = height;
|
|
66671
66667
|
else overallHeight = Math.max(heightTotalMax+spacingVTotal, height);
|
|
66672
66668
|
} else {
|
|
66673
66669
|
if (heightUncompressedMax > 0) overallHeight = heightUncompressedMax+spacingVTotal;
|
|
66674
66670
|
else overallHeight = heightTotalMax+spacingVTotal;
|
|
66675
66671
|
}
|
|
66676
|
-
|
|
66672
|
+
|
|
66677
66673
|
that.setBounds(0,0,overallWidth,overallHeight);
|
|
66678
66674
|
widthScaling = (overallWidth-spacingHOTotal)/(widthO);
|
|
66679
66675
|
heightScaling = (overallHeight-spacingVOTotal)/(heightO);
|