zimjs 17.2.3 → 17.2.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/.gitattributes +1 -0
- package/package.json +1 -1
- package/src/zim.js +66 -9
package/.gitattributes
CHANGED
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -29112,6 +29112,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
29112
29112
|
}
|
|
29113
29113
|
|
|
29114
29114
|
this._enabled = true;
|
|
29115
|
+
var lastReadOnly;
|
|
29116
|
+
setTimeout(function() {
|
|
29117
|
+
lastReadOnly = that.readOnly;
|
|
29118
|
+
},50);
|
|
29115
29119
|
Object.defineProperty(that, 'enabled', {
|
|
29116
29120
|
get: function() {
|
|
29117
29121
|
return that._enabled;
|
|
@@ -29123,6 +29127,18 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
29123
29127
|
} else {
|
|
29124
29128
|
setDrag();
|
|
29125
29129
|
}
|
|
29130
|
+
if (that.blinker) {
|
|
29131
|
+
if (!value) {
|
|
29132
|
+
that.blinker.vis(false);
|
|
29133
|
+
that.selection.vis(false);
|
|
29134
|
+
lastReadOnly = that.readOnly;
|
|
29135
|
+
that.readOnly = true;
|
|
29136
|
+
} else {
|
|
29137
|
+
that.readOnly = lastReadOnly;
|
|
29138
|
+
if (!that.readOnly) that.blinker.vis(true);
|
|
29139
|
+
that.selection.vis(true);
|
|
29140
|
+
}
|
|
29141
|
+
}
|
|
29126
29142
|
zenable(that, value);
|
|
29127
29143
|
}
|
|
29128
29144
|
});
|
|
@@ -31109,7 +31125,12 @@ align - get or set the horizontal alignment of the text
|
|
|
31109
31125
|
color - gets or sets the label text color
|
|
31110
31126
|
backgroundColor - gets or sets the background color
|
|
31111
31127
|
readOnly - get or set the field as readOnly - also see readOnly parameter
|
|
31128
|
+
read only of true will allow selection and copy but not typing and cursor will be removed
|
|
31129
|
+
set enabled to false to not allow selection and copy
|
|
31112
31130
|
enabled - default is true - set to false to disable
|
|
31131
|
+
setting enabled false will remember the readOnly setting when enabled is set to false
|
|
31132
|
+
so when set to true again it will be that remembered readOnly and will not rememember any changes to readOnly made in-between
|
|
31133
|
+
so any in-between readOnly changes will have to be re-applied after enabled is set back to true
|
|
31113
31134
|
veeObj - an object with ZIM VEE original parameters:value allowing the ZIM VEE values to be referenced
|
|
31114
31135
|
for instance, obj.prop = Pick.choose(obj.veeObj.prop); will reset the the prop to the result of the original ZIM VEE value
|
|
31115
31136
|
|
|
@@ -31522,14 +31543,16 @@ zim.TextInput = function(width, height, placeholder, text, size, font, color, ba
|
|
|
31522
31543
|
|
|
31523
31544
|
Object.defineProperty(that, 'readOnly', {
|
|
31524
31545
|
get: function() {
|
|
31525
|
-
return readOnly;
|
|
31546
|
+
return readOnly;
|
|
31526
31547
|
},
|
|
31527
31548
|
set: function(value) {
|
|
31528
31549
|
readOnly = value;
|
|
31529
31550
|
that.htmlTag.readOnly = readOnly;
|
|
31551
|
+
if (value) that.blinker.vis(false);
|
|
31552
|
+
else that.blinker.vis(true);
|
|
31530
31553
|
}
|
|
31531
31554
|
});
|
|
31532
|
-
|
|
31555
|
+
that.readOnly = readOnly;
|
|
31533
31556
|
|
|
31534
31557
|
Object.defineProperty(that, 'focus', {
|
|
31535
31558
|
get: function() {
|
|
@@ -47368,6 +47391,7 @@ value - get or set the text content of the TextArea
|
|
|
47368
47391
|
text - get or set the text value
|
|
47369
47392
|
focus - get or set if the TextArea tag has focus or use setFocus() to set (might need timeout 100ms before setting)
|
|
47370
47393
|
readOnly - set to true to not be able to edit or to false to be able to edit (always can select)
|
|
47394
|
+
set enabled to false to disable selection
|
|
47371
47395
|
maxLength - get or set the maximum number of characters typed - will not truncate existing characters until typed
|
|
47372
47396
|
tag - the HTML textarea tag - just a regular HMTL form tag which can be styled
|
|
47373
47397
|
background - access to the Rectangle() used for the background
|
|
@@ -47376,6 +47400,8 @@ background - access to the Rectangle() used for the background
|
|
|
47376
47400
|
blendMode - how the object blends with what is underneath - such as "difference", "multiply", etc. same as CreateJS compositeOperation
|
|
47377
47401
|
keyFocus - get or set the keyboard focus on the component - see also zim.KEYFOCUS
|
|
47378
47402
|
will be set to true if this component is the first made or component is the last to be used
|
|
47403
|
+
enabled - get or set enabled of TextArea
|
|
47404
|
+
this will remember last readOnly so any setting of readonly in between enabled settings will have to be reapplied.
|
|
47379
47405
|
frame - get or set the frame - set this if changing frames
|
|
47380
47406
|
|
|
47381
47407
|
ALSO: see ZIM Container for properties such as:
|
|
@@ -47687,6 +47713,30 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
47687
47713
|
}
|
|
47688
47714
|
}
|
|
47689
47715
|
});
|
|
47716
|
+
|
|
47717
|
+
that._enabled = true;
|
|
47718
|
+
var lastReadOnly = that.readOnly;
|
|
47719
|
+
Object.defineProperty(that, 'enabled', {
|
|
47720
|
+
get: function() {
|
|
47721
|
+
zog("here")
|
|
47722
|
+
return that._enabled;
|
|
47723
|
+
},
|
|
47724
|
+
set: function(value) {
|
|
47725
|
+
if (!value) {
|
|
47726
|
+
lastReadOnly = that.readOnly;
|
|
47727
|
+
that.readOnly = false; // needed to remove selection
|
|
47728
|
+
that.focus = false;
|
|
47729
|
+
that.tag.style.pointerEvents = "none";
|
|
47730
|
+
setTimeout(function() {
|
|
47731
|
+
that.readOnly = true;
|
|
47732
|
+
},50); // setting readonly brings back selection even after blur - bug in HTML
|
|
47733
|
+
} else {
|
|
47734
|
+
that.tag.style.pointerEvents = "unset"; // tried all, unset, inherent, auto, initial, revert
|
|
47735
|
+
that.readOnly = lastReadOnly; // does not bring selection back
|
|
47736
|
+
}
|
|
47737
|
+
zenable(that, value);
|
|
47738
|
+
}
|
|
47739
|
+
});
|
|
47690
47740
|
|
|
47691
47741
|
this.resizeEvent = frame.on("resize", that.resize);
|
|
47692
47742
|
this.updateEvent = frame.on("update", that.resize);
|
|
@@ -51130,7 +51180,7 @@ RETURNS obj for chaining
|
|
|
51130
51180
|
|
|
51131
51181
|
if (e.stageX == null) return; // added for TextureActive drag in 2D view
|
|
51132
51182
|
|
|
51133
|
-
if (slide) {
|
|
51183
|
+
if (slide) {
|
|
51134
51184
|
dragObject.dispatchEvent("slidestart");
|
|
51135
51185
|
|
|
51136
51186
|
if (dragObject.parent) {
|
|
@@ -51172,6 +51222,12 @@ RETURNS obj for chaining
|
|
|
51172
51222
|
lastBackT = upT = 0;
|
|
51173
51223
|
}
|
|
51174
51224
|
|
|
51225
|
+
if (Math.abs(dX) < 1 && Math.abs(dY) < 1) {
|
|
51226
|
+
hasMoved = false;
|
|
51227
|
+
dragObject.dispatchEvent("slidestop");
|
|
51228
|
+
zim.Ticker.remove(obj.zimDragTicker);
|
|
51229
|
+
}
|
|
51230
|
+
|
|
51175
51231
|
// if (dampX) dampX.immediate(50);
|
|
51176
51232
|
// if (dampY) dampY.immediate(0);
|
|
51177
51233
|
|
|
@@ -51253,7 +51309,8 @@ RETURNS obj for chaining
|
|
|
51253
51309
|
}
|
|
51254
51310
|
}
|
|
51255
51311
|
});
|
|
51256
|
-
if (miss) {
|
|
51312
|
+
if (miss) {
|
|
51313
|
+
dragObject.dropTarget = dragObject.droppedTarget = null;
|
|
51257
51314
|
if (dropBack) {
|
|
51258
51315
|
dragObject.animate({
|
|
51259
51316
|
props:{x:dragObject.dropStartX, y:dragObject.dropStartY, scale:dragObject.dropStartS},
|
|
@@ -51362,7 +51419,7 @@ RETURNS obj for chaining
|
|
|
51362
51419
|
o.y = desiredY;
|
|
51363
51420
|
o.slideStartX = null;
|
|
51364
51421
|
o.slideStartY = null;
|
|
51365
|
-
if (hasMoved) {
|
|
51422
|
+
if (hasMoved) {
|
|
51366
51423
|
o.dispatchEvent("slidestop");
|
|
51367
51424
|
zim.Ticker.remove(obj.zimDragTicker);
|
|
51368
51425
|
}
|
|
@@ -51387,7 +51444,7 @@ RETURNS obj for chaining
|
|
|
51387
51444
|
function setUpSlide() {
|
|
51388
51445
|
obj.zimDragTicker = function() {
|
|
51389
51446
|
if (zot(obj.slideStartX)) return; // don't stop other things like window scrollbar from moving object
|
|
51390
|
-
|
|
51447
|
+
|
|
51391
51448
|
if (!dragObject) dragObject = obj; // could be risky if intending to drag children
|
|
51392
51449
|
if (obj.downCheck) {
|
|
51393
51450
|
var point;
|
|
@@ -58074,7 +58131,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
58074
58131
|
// if (internal) target.percentComplete = target.pathRatio = 0;
|
|
58075
58132
|
|
|
58076
58133
|
if (zot(command)) command = true;
|
|
58077
|
-
if (target.pan == undefined) {
|
|
58134
|
+
if (target.pan == undefined && target.type != "Timer") { // hmmm what about other objects with paused properties...
|
|
58078
58135
|
if (target.type != undefined) target.paused = true;
|
|
58079
58136
|
target.animating = false;
|
|
58080
58137
|
}
|
|
@@ -79163,7 +79220,6 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
|
|
|
79163
79220
|
}
|
|
79164
79221
|
});
|
|
79165
79222
|
}
|
|
79166
|
-
|
|
79167
79223
|
if (
|
|
79168
79224
|
cache &&
|
|
79169
79225
|
!particle.emitShape &&
|
|
@@ -79275,7 +79331,7 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
|
|
|
79275
79331
|
else max = zik(life);
|
|
79276
79332
|
var min;
|
|
79277
79333
|
if (interval.min) min = interval.min;
|
|
79278
|
-
else if (Array.isArray(interval)) min = zim.
|
|
79334
|
+
else if (Array.isArray(interval)) min = zim.arrayMinMax(interval).min;
|
|
79279
79335
|
else min = zik(interval);
|
|
79280
79336
|
warm = Math.min(200, Math.round(max/min));
|
|
79281
79337
|
}
|
|
@@ -79520,6 +79576,7 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
|
|
|
79520
79576
|
return that.cloneProps(new zim.Emitter(objClone, width, height, that.interval, that.num, that.life, that.fade, that.shrink, warm, that.decayTime, that.decayStart, that.trace, that.traceFadeTime, that.traceShiftX, that.traceShiftY, that.angle, that.emitterForce, that.gravity, that.wind, that.layers, that.animation, zim.copy(that.random), that.horizontal, that.vertical, that.sink, that.sinkForce, cache, that.events, startPaused, that.pool, that.poolMin, particles, focusWarm, style, that.group, inherit));
|
|
79521
79577
|
};
|
|
79522
79578
|
|
|
79579
|
+
|
|
79523
79580
|
this.dispose = function() {
|
|
79524
79581
|
if (that.zimInterval) that.zimInterval.clear();
|
|
79525
79582
|
if (emitterTicker) {
|