targetj 1.0.232 → 1.0.233

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 CHANGED
@@ -378,14 +378,14 @@ App({
378
378
  html() { return user.email; }
379
379
  }
380
380
  };
381
- },
382
- pause$$: { interval: 150 },
383
- highlightOne$$() {
384
- const user = this.getChild(0);
385
- user.setTarget('backgroundColor', { value: ['#fff7cc', '#fff1a8'], steps: 14 });
386
- user.setTarget('scale', { value: [1, 1.04, 1], steps: 14 });
387
- user.setTarget('boxShadow', '0 10px 24px rgba(0,0,0,.14)');
388
381
  }
382
+ },
383
+ pause$$: { interval: 150 },
384
+ highlightOne$$() {
385
+ const user = this.getChild(0);
386
+ user.setTarget('backgroundColor', { value: ['#fff7cc', '#fff1a8'], steps: 14 });
387
+ user.setTarget('scale', { value: [1, 1.04, 1], steps: 14 });
388
+ user.setTarget('boxShadow', '0 10px 24px rgba(0,0,0,.14)');
389
389
  }
390
390
  }
391
391
  }).mount('#app');
@@ -425,42 +425,47 @@ App({
425
425
  height() { return getScreenHeight(); },
426
426
  x() { return (getScreenWidth() - this.getWidth()) / 2; },
427
427
  containerOverflowMode: "always",
428
- addChildren() {
429
- return Array.from({ length: 10 }, (_, i) => ({
430
- height: 56,
431
- width() { return this.parent.getWidth(); },
432
- bottomMargin: 8,
433
- borderRadius: 12,
434
- backgroundColor: "white",
435
- boxShadow: "0 8px 20px rgba(0,0,0,0.08)",
436
- photo: {
437
- x: 10, y: 10, width: 34, height: 34,
438
- borderRadius: "50%",
439
- backgroundColor: "#ddd"
440
- },
441
- userName: {
442
- x: 60, y: 10, width: 180, height: 30,
443
- overflow: "hidden",
444
- borderRadius: 5,
445
- backgroundColor: "#ddd"
446
- },
447
- pause$$: { interval: 100 },
448
- fetch$$: "https://targetjs.io/api/randomUser",
449
- reveal$$() {
450
- const userName = this.getChild("userName");
451
- userName.setTarget("html", this.val("fetch$$").name);
452
- userName.setTarget("backgroundColor", { value: "white", steps: 20 });
453
- this.getChild("photo").setTarget("backgroundColor", { value: "#" + Math.random().toString(16).slice(-6), steps: 20 });
454
- },
455
- }));
428
+ addChildren: {
429
+ waitForChildren: 'visible',
430
+ value() {
431
+ return Array.from({ length: 10 }, (_, i) => ({
432
+ height: 56,
433
+ width() { return this.parent.getWidth(); },
434
+ bottomMargin: 8,
435
+ borderRadius: 12,
436
+ backgroundColor: "white",
437
+ boxShadow: "0 8px 20px rgba(0,0,0,0.08)",
438
+ photo: {
439
+ x: 10, y: 10, width: 34, height: 34,
440
+ borderRadius: "50%",
441
+ backgroundColor: "#ddd"
442
+ },
443
+ userName: {
444
+ x: 60, y: 10, width: 180, height: 30,
445
+ overflow: "hidden",
446
+ borderRadius: 5,
447
+ backgroundColor: "#ddd"
448
+ },
449
+ pause$$: { interval: 100 },
450
+ fetch$$: "https://targetjs.io/api/randomUser",
451
+ reveal$$() {
452
+ const userName = this.getChild("userName");
453
+ userName.setTarget("html", this.val("fetch$$").name);
454
+ userName.setTarget("backgroundColor", { value: "white", steps: 20 });
455
+ this.getChild("photo").setTarget("backgroundColor", { value: "#" + Math.random().toString(16).slice(-6), steps: 20 });
456
+ },
457
+ }));
458
+ }
456
459
  },
457
460
  wave$$: {
458
461
  interval: 30,
459
462
  cycles() { return this.visibleChildren.length; },
460
463
  value(i) {
461
464
  const child = this.visibleChildren[i];
462
- child.setTarget("scale", { value: [1, 1.06, 1], steps: 18 });
463
- child.setTarget("opacity", { value: [1, 0.92, 1], steps: 18 });
465
+ if (child) {
466
+ child.setTarget("scale", { value: [1, 1.06, 1], steps: 18 });
467
+ child.setTarget("opacity", { value: [1, 0.92, 1], steps: 18 });
468
+ }
464
469
  }
465
470
  },
466
471
  onScroll() {
package/build/Viewport.js CHANGED
@@ -154,6 +154,12 @@ var Viewport = exports.Viewport = /*#__PURE__*/function () {
154
154
  this.ySouth = Math.max(ySouth, this.ySouth);
155
155
  child.getRealParent().viewport.xEast = Math.max(child.getRealParent().viewport.xEast, this.xEast);
156
156
  child.getRealParent().viewport.ySouth = Math.max(child.getRealParent().viewport.ySouth, this.ySouth);
157
+ if (this.container.getContainerOverflowMode() === 'always' || this.currentChild.getItemOverflowMode() === 'always') {
158
+ this.yEast = child.getRealParent().viewport.ySouth;
159
+ this.yNext = child.getRealParent().viewport.ySouth;
160
+ this.xNext = child.getRealParent().viewport.xWest;
161
+ this.xSouth = child.getRealParent().viewport.xWest;
162
+ }
157
163
  }
158
164
  }]);
159
165
  }();