targetj 1.0.130 → 1.0.132
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/README.md +1 -1
- package/build/BaseModel.js +9 -2
- package/build/EventListener.js +1 -1
- package/build/RunScheduler.js +7 -5
- package/build/TModelUtil.js +1 -1
- package/build/TargetUtil.js +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ You'll also find `quickStart`, the first argument in the `TModel` constructor. I
|
|
|
27
27
|
|
|
28
28
|
You can view the live example at [https://targetj.io/examples/quick.html](https://targetj.io/examples/quick.html). Click on "Show Code" to see how the code is executed.
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
import { App, TModel, getEvents } from "targetj";
|
package/build/BaseModel.js
CHANGED
|
@@ -685,15 +685,20 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
685
685
|
}, {
|
|
686
686
|
key: "deleteTargetValue",
|
|
687
687
|
value: function deleteTargetValue(key) {
|
|
688
|
+
var targetValue = this.targetValues[key];
|
|
688
689
|
delete this.targetValues[key];
|
|
689
690
|
this.addToActiveTargets(key);
|
|
690
691
|
this.removeFromUpdatingTargets(key);
|
|
691
|
-
|
|
692
|
+
if (targetValue) {
|
|
693
|
+
(0, _App.getRunScheduler)().schedule(1, 'deleteTargetValue-' + this.oid + "-" + key);
|
|
694
|
+
}
|
|
695
|
+
return this;
|
|
692
696
|
}
|
|
693
697
|
}, {
|
|
694
698
|
key: "resetImperative",
|
|
695
699
|
value: function resetImperative(key) {
|
|
696
700
|
var targetValue = this.targetValues[key];
|
|
701
|
+
var isImperative = targetValue.isImperative;
|
|
697
702
|
if (targetValue) {
|
|
698
703
|
targetValue.isImperative = false;
|
|
699
704
|
targetValue.executionFlag = false;
|
|
@@ -704,7 +709,9 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
704
709
|
targetValue.cycles = 0;
|
|
705
710
|
targetValue.interval = 0;
|
|
706
711
|
}
|
|
707
|
-
|
|
712
|
+
if (isImperative) {
|
|
713
|
+
(0, _App.getRunScheduler)().schedule(1, 'resetImperative-' + this.oid + "-" + key);
|
|
714
|
+
}
|
|
708
715
|
return this;
|
|
709
716
|
}
|
|
710
717
|
}, {
|
package/build/EventListener.js
CHANGED
|
@@ -722,7 +722,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
722
722
|
}, {
|
|
723
723
|
key: "hasDelta",
|
|
724
724
|
value: function hasDelta() {
|
|
725
|
-
return this.deltaX() !== 0
|
|
725
|
+
return this.deltaX() !== 0 || this.deltaY() !== 0;
|
|
726
726
|
}
|
|
727
727
|
}, {
|
|
728
728
|
key: "isEndEvent",
|
package/build/RunScheduler.js
CHANGED
|
@@ -207,14 +207,16 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
207
207
|
}, {
|
|
208
208
|
key: "executeNextRun",
|
|
209
209
|
value: function executeNextRun() {
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
while (this.nextRuns.length > 0) {
|
|
211
|
+
var nextRun = this.nextRuns.shift();
|
|
212
212
|
var now = _TUtil.TUtil.now();
|
|
213
213
|
var newDelay = nextRun.delay - (now - nextRun.insertTime);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
if (newDelay >= 0 || this.nextRuns.length === 0) {
|
|
215
|
+
this.setDelayProcess(nextRun.runId, nextRun.insertTime, now + newDelay, Math.max(newDelay, 0));
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
217
218
|
}
|
|
219
|
+
this.delayProcess = undefined;
|
|
218
220
|
}
|
|
219
221
|
}, {
|
|
220
222
|
key: "delayRun",
|
package/build/TModelUtil.js
CHANGED
|
@@ -46,7 +46,7 @@ var TModelUtil = exports.TModelUtil = /*#__PURE__*/function () {
|
|
|
46
46
|
widthFromDom: false,
|
|
47
47
|
heightFromDom: false,
|
|
48
48
|
isIncluded: true,
|
|
49
|
-
bracketThreshold:
|
|
49
|
+
bracketThreshold: 5,
|
|
50
50
|
bracketSize: 5,
|
|
51
51
|
keepEventDefault: undefined,
|
|
52
52
|
canDeleteDom: undefined
|
package/build/TargetUtil.js
CHANGED
|
@@ -530,18 +530,29 @@ _defineProperty(TargetUtil, "internalEventMap", {
|
|
|
530
530
|
var lastUpdateHeight = tmodel.getActualValueLastUpdate('height');
|
|
531
531
|
var resizeLastUpdate = (0, _App.getLocationManager)().resizeLastUpdate;
|
|
532
532
|
if (lastUpdateWidth && lastUpdateHeight) {
|
|
533
|
+
tmodel.setActualValueLastUpdate('width');
|
|
534
|
+
tmodel.setActualValueLastUpdate('height');
|
|
533
535
|
return resizeLastUpdate > Math.max(lastUpdateWidth, lastUpdateHeight);
|
|
534
536
|
}
|
|
535
537
|
if (lastUpdateWidth) {
|
|
538
|
+
tmodel.setActualValueLastUpdate('width');
|
|
536
539
|
return resizeLastUpdate > lastUpdateWidth;
|
|
537
540
|
}
|
|
538
541
|
if (lastUpdateHeight) {
|
|
542
|
+
tmodel.setActualValueLastUpdate('height');
|
|
539
543
|
return resizeLastUpdate > lastUpdateHeight;
|
|
540
544
|
}
|
|
541
545
|
return (0, _App.getLocationManager)().resizeFlag;
|
|
542
546
|
},
|
|
543
547
|
onParentResize: function onParentResize(tmodel) {
|
|
544
|
-
|
|
548
|
+
if (tmodel.getParent().getActualValueLastUpdate('width') > tmodel.getActualValueLastUpdate('width')) {
|
|
549
|
+
tmodel.setActualValueLastUpdate('width');
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
if (tmodel.getParent().getActualValueLastUpdate('height') > tmodel.getActualValueLastUpdate('height')) {
|
|
553
|
+
tmodel.setActualValueLastUpdate('height');
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
545
556
|
}
|
|
546
557
|
});
|
|
547
558
|
_defineProperty(TargetUtil, "allEventMap", _objectSpread(_objectSpread({}, _TargetUtil.touchEventMap), {}, {
|