@wcardinal/wcardinal-ui 0.157.0 → 0.158.0

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 (70) hide show
  1. package/dist/types/wcardinal/ui/d-application-layer-like.d.ts +0 -1
  2. package/dist/types/wcardinal/ui/d-application-layer.d.ts +0 -2
  3. package/dist/types/wcardinal/ui/d-base.d.ts +11 -12
  4. package/dist/types/wcardinal/ui/d-diagram-snapshot.d.ts +0 -2
  5. package/dist/types/wcardinal/ui/d-image-base.d.ts +2 -0
  6. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-bottom.d.ts +4 -0
  7. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-center.d.ts +6 -0
  8. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-container.d.ts +25 -0
  9. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-left.d.ts +4 -0
  10. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-middle.d.ts +6 -0
  11. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-right.d.ts +4 -0
  12. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-top.d.ts +4 -0
  13. package/dist/types/wcardinal/ui/d-image-piece-layouter-part.d.ts +8 -0
  14. package/dist/types/wcardinal/ui/d-image-piece-layouter.d.ts +17 -0
  15. package/dist/types/wcardinal/ui/d-menu-sided.d.ts +1 -1
  16. package/dist/types/wcardinal/ui/d-text-base.d.ts +5 -5
  17. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-input.d.ts +1 -1
  18. package/dist/types/wcardinal/ui/theme/white/d-theme-white-input.d.ts +1 -1
  19. package/dist/wcardinal/ui/d-application-layer-like.js.map +1 -1
  20. package/dist/wcardinal/ui/d-application-layer.js +3 -21
  21. package/dist/wcardinal/ui/d-application-layer.js.map +1 -1
  22. package/dist/wcardinal/ui/d-base.js +126 -100
  23. package/dist/wcardinal/ui/d-base.js.map +1 -1
  24. package/dist/wcardinal/ui/d-diagram-snapshot.js +2 -18
  25. package/dist/wcardinal/ui/d-diagram-snapshot.js.map +1 -1
  26. package/dist/wcardinal/ui/d-html-element.js +0 -3
  27. package/dist/wcardinal/ui/d-html-element.js.map +1 -1
  28. package/dist/wcardinal/ui/d-image-base.js +9 -264
  29. package/dist/wcardinal/ui/d-image-base.js.map +1 -1
  30. package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js +31 -0
  31. package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js.map +1 -0
  32. package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js +24 -0
  33. package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js.map +1 -0
  34. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js +158 -0
  35. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js.map +1 -0
  36. package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js +30 -0
  37. package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js.map +1 -0
  38. package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js +24 -0
  39. package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js.map +1 -0
  40. package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js +31 -0
  41. package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js.map +1 -0
  42. package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js +32 -0
  43. package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js.map +1 -0
  44. package/dist/wcardinal/ui/d-image-piece-layouter-part.js +18 -0
  45. package/dist/wcardinal/ui/d-image-piece-layouter-part.js.map +1 -0
  46. package/dist/wcardinal/ui/d-image-piece-layouter.js +65 -0
  47. package/dist/wcardinal/ui/d-image-piece-layouter.js.map +1 -0
  48. package/dist/wcardinal/ui/d-menu-item-text.js +18 -2
  49. package/dist/wcardinal/ui/d-menu-item-text.js.map +1 -1
  50. package/dist/wcardinal/ui/d-menu-sided.js +2 -2
  51. package/dist/wcardinal/ui/d-menu-sided.js.map +1 -1
  52. package/dist/wcardinal/ui/d-text-base.js +34 -24
  53. package/dist/wcardinal/ui/d-text-base.js.map +1 -1
  54. package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js +2 -2
  55. package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js.map +1 -1
  56. package/dist/wcardinal/ui/theme/white/d-theme-white-input.js +2 -2
  57. package/dist/wcardinal/ui/theme/white/d-theme-white-input.js.map +1 -1
  58. package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js +3 -1
  59. package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js.map +1 -1
  60. package/dist/wcardinal-ui-theme-dark.js +3 -3
  61. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  62. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  63. package/dist/wcardinal-ui-theme-white.js +3 -3
  64. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  65. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  66. package/dist/wcardinal-ui.cjs.js +613 -467
  67. package/dist/wcardinal-ui.js +609 -463
  68. package/dist/wcardinal-ui.min.js +2 -2
  69. package/dist/wcardinal-ui.min.js.map +1 -1
  70. package/package.json +1 -1
@@ -80,7 +80,7 @@ var DBase = /** @class */ (function (_super) {
80
80
  _this._auto = new DBaseAutoSet();
81
81
  _this._isDirty = true;
82
82
  _this._hasDirty = false;
83
- _this._isChildrenDirty = false;
83
+ _this._isHierarchyDirty = false;
84
84
  _this._shadow = null;
85
85
  _this.name = (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : "";
86
86
  var theme = toTheme(options) || _this.getThemeDefault();
@@ -90,7 +90,7 @@ var DBase = /** @class */ (function (_super) {
90
90
  _this._clearType = toEnum((_b = options === null || options === void 0 ? void 0 : options.clear) !== null && _b !== void 0 ? _b : theme.getClearType(), DLayoutClearType);
91
91
  _this._padding = new DBasePadding(theme, options, function () {
92
92
  _this.toParentResized();
93
- _this.toChildrenDirty();
93
+ _this.toHierarchyDirty();
94
94
  DApplications.update(_this);
95
95
  });
96
96
  var toDirtyAndUpdate = function () {
@@ -219,8 +219,8 @@ var DBase = /** @class */ (function (_super) {
219
219
  if (_this.isDirty() || _this.hasDirty()) {
220
220
  _this.toParentHasDirty();
221
221
  }
222
- if (_this._isChildrenDirty) {
223
- _this.toParentChildrenDirty();
222
+ if (_this._isHierarchyDirty) {
223
+ _this.toParentHierarchyDirty();
224
224
  }
225
225
  var newParent = _this.parent;
226
226
  if (newParent instanceof DBase) {
@@ -312,7 +312,7 @@ var DBase = /** @class */ (function (_super) {
312
312
  new DBaseReflowableImpl(this);
313
313
  };
314
314
  DBase.prototype.onChildrenChange = function () {
315
- this.toChildrenDirty();
315
+ this.toHierarchyDirty();
316
316
  _super.prototype.onChildrenChange.call(this);
317
317
  };
318
318
  DBase.prototype.onShortcut = function (e) {
@@ -342,46 +342,48 @@ var DBase = /** @class */ (function (_super) {
342
342
  DBase.prototype.resize = function (width, height) {
343
343
  var oldWidth = this._width;
344
344
  var oldHeight = this._height;
345
- var widthResized = oldWidth !== width;
346
- var heightResized = oldHeight !== height;
347
- if (widthResized) {
348
- this._width = width;
345
+ var newWidth = width != null ? width : oldWidth;
346
+ var newHeight = height != null ? height : oldHeight;
347
+ var isWidthChanged = oldWidth !== newWidth;
348
+ var isHeightChanged = oldHeight !== newHeight;
349
+ if (isWidthChanged) {
350
+ this._width = newWidth;
349
351
  }
350
- if (heightResized) {
351
- this._height = height;
352
+ if (isHeightChanged) {
353
+ this._height = newHeight;
352
354
  }
353
- var resized = widthResized || heightResized;
354
- if (resized) {
355
- this.onResize(width, height, oldWidth, oldHeight);
355
+ var isChanged = isWidthChanged || isHeightChanged;
356
+ if (isChanged) {
357
+ this.onResize(newWidth, newHeight, oldWidth, oldHeight);
356
358
  }
357
- if (widthResized) {
359
+ if (isWidthChanged) {
358
360
  var scalarSet = this._scalarSet;
359
361
  if (scalarSet.x != null) {
360
- var position = this.transform.position;
362
+ var position = this._position;
361
363
  var parent_1 = this.getParentOfSize();
362
364
  if (parent_1) {
363
- this.x = scalarSet.x(parent_1.width, width, parent_1.padding.getLeft(), position.x);
365
+ this._position.x = scalarSet.x(parent_1.width, newWidth, parent_1.padding.getLeft(), position.x);
364
366
  }
365
367
  }
366
368
  }
367
- if (heightResized) {
369
+ if (isHeightChanged) {
368
370
  var scalarSet = this._scalarSet;
369
371
  if (scalarSet.y != null) {
370
- var position = this.transform.position;
372
+ var position = this._position;
371
373
  var parent_2 = this.getParentOfSize();
372
374
  if (parent_2) {
373
- this.y = scalarSet.y(parent_2.height, height, parent_2.padding.getTop(), position.y);
375
+ this._position.y = scalarSet.y(parent_2.height, newHeight, parent_2.padding.getTop(), position.y);
374
376
  }
375
377
  }
376
378
  }
377
- return resized;
379
+ return isChanged;
378
380
  };
379
381
  DBase.prototype.getClearType = function () {
380
382
  return this._clearType;
381
383
  };
382
384
  DBase.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
383
385
  this.toDirty();
384
- this.toChildrenDirty();
386
+ this.toHierarchyDirty();
385
387
  var padding = this._padding;
386
388
  var children = this.children;
387
389
  for (var i = 0, imax = children.length; i < imax; ++i) {
@@ -414,7 +416,7 @@ var DBase = /** @class */ (function (_super) {
414
416
  return this._position.x;
415
417
  },
416
418
  set: function (x) {
417
- this._position.x = x;
419
+ this.setX(x);
418
420
  },
419
421
  enumerable: false,
420
422
  configurable: true
@@ -425,15 +427,25 @@ var DBase = /** @class */ (function (_super) {
425
427
  return scalarSet.x;
426
428
  }
427
429
  else {
428
- return this.x;
430
+ return this._position.x;
429
431
  }
430
432
  };
431
433
  DBase.prototype.setX = function (x) {
434
+ var scalarSet = this._scalarSet;
432
435
  if (isNumber(x)) {
433
- this.x = x;
436
+ var position = this._position;
437
+ if (position.x !== x) {
438
+ scalarSet.x = undefined;
439
+ position.x = x;
440
+ }
441
+ else {
442
+ if (scalarSet.x !== undefined) {
443
+ scalarSet.x = undefined;
444
+ this.toParentResized();
445
+ }
446
+ }
434
447
  }
435
448
  else {
436
- var scalarSet = this._scalarSet;
437
449
  var scalar = DScalarFunctions.position(x);
438
450
  if (scalarSet.x !== scalar) {
439
451
  scalarSet.x = scalar;
@@ -447,7 +459,7 @@ var DBase = /** @class */ (function (_super) {
447
459
  return this._position.y;
448
460
  },
449
461
  set: function (y) {
450
- this._position.y = y;
462
+ this.setY(y);
451
463
  },
452
464
  enumerable: false,
453
465
  configurable: true
@@ -458,15 +470,25 @@ var DBase = /** @class */ (function (_super) {
458
470
  return scalarSet.y;
459
471
  }
460
472
  else {
461
- return this.y;
473
+ return this._position.y;
462
474
  }
463
475
  };
464
476
  DBase.prototype.setY = function (y) {
477
+ var scalarSet = this._scalarSet;
465
478
  if (isNumber(y)) {
466
- this.y = y;
479
+ var position = this._position;
480
+ if (position.y !== y) {
481
+ scalarSet.y = undefined;
482
+ position.y = y;
483
+ }
484
+ else {
485
+ if (scalarSet.y !== undefined) {
486
+ scalarSet.y = undefined;
487
+ this.toParentResized();
488
+ }
489
+ }
467
490
  }
468
491
  else {
469
- var scalarSet = this._scalarSet;
470
492
  var scalar = DScalarFunctions.position(y);
471
493
  if (scalarSet.y !== scalar) {
472
494
  scalarSet.y = scalar;
@@ -480,21 +502,7 @@ var DBase = /** @class */ (function (_super) {
480
502
  return this._width;
481
503
  },
482
504
  set: function (width) {
483
- var oldWidth = this._width;
484
- if (oldWidth !== width) {
485
- this._width = width;
486
- var height = this._height;
487
- this.onResize(width, height, oldWidth, height);
488
- // Layout
489
- var scalarSet = this._scalarSet;
490
- if (scalarSet.x != null) {
491
- var position = this.transform.position;
492
- var parent_3 = this.getParentOfSize();
493
- if (parent_3) {
494
- this.x = scalarSet.x(parent_3.width, width, parent_3.padding.getLeft(), position.x);
495
- }
496
- }
497
- }
505
+ this.setWidth(width);
498
506
  },
499
507
  enumerable: false,
500
508
  configurable: true
@@ -507,15 +515,34 @@ var DBase = /** @class */ (function (_super) {
507
515
  var isOn = auto.isOn;
508
516
  var isAuto = auto.from(width);
509
517
  if (auto.isOn !== isOn) {
510
- this.toChildrenDirty();
518
+ this.toHierarchyDirty();
511
519
  DApplications.update(this);
512
520
  }
513
521
  if (!isAuto) {
522
+ var scalarSet = this._scalarSet;
514
523
  if (isNumber(width)) {
515
- this.width = width;
524
+ var oldWidth = this._width;
525
+ if (oldWidth !== width) {
526
+ scalarSet.width = undefined;
527
+ this._width = width;
528
+ var height = this._height;
529
+ this.onResize(width, height, oldWidth, height);
530
+ if (scalarSet.x != null) {
531
+ var position = this._position;
532
+ var parent_3 = this.getParentOfSize();
533
+ if (parent_3) {
534
+ position.x = scalarSet.x(parent_3.width, width, parent_3.padding.getLeft(), position.x);
535
+ }
536
+ }
537
+ }
538
+ else {
539
+ if (scalarSet.width !== undefined) {
540
+ scalarSet.width = undefined;
541
+ this.toParentResized();
542
+ }
543
+ }
516
544
  }
517
545
  else {
518
- var scalarSet = this._scalarSet;
519
546
  var scalar = DScalarFunctions.size(width);
520
547
  if (scalarSet.width !== scalar) {
521
548
  scalarSet.width = scalar;
@@ -530,21 +557,7 @@ var DBase = /** @class */ (function (_super) {
530
557
  return this._height;
531
558
  },
532
559
  set: function (height) {
533
- var oldHeight = this._height;
534
- if (oldHeight !== height) {
535
- this._height = height;
536
- var width = this._width;
537
- this.onResize(width, height, width, oldHeight);
538
- // Layout
539
- var scalarSet = this._scalarSet;
540
- if (scalarSet.y != null) {
541
- var position = this.transform.position;
542
- var parent_4 = this.getParentOfSize();
543
- if (parent_4) {
544
- this.y = scalarSet.y(parent_4.height, height, parent_4.padding.getTop(), position.y);
545
- }
546
- }
547
- }
560
+ this.setHeight(height);
548
561
  },
549
562
  enumerable: false,
550
563
  configurable: true
@@ -557,15 +570,34 @@ var DBase = /** @class */ (function (_super) {
557
570
  var isOn = auto.isOn;
558
571
  var isAuto = auto.from(height);
559
572
  if (auto.isOn !== isOn) {
560
- this.toChildrenDirty();
573
+ this.toHierarchyDirty();
561
574
  DApplications.update(this);
562
575
  }
563
576
  if (!isAuto) {
577
+ var scalarSet = this._scalarSet;
564
578
  if (isNumber(height)) {
565
- this.height = height;
579
+ var oldHeight = this._height;
580
+ if (oldHeight !== height) {
581
+ scalarSet.height = undefined;
582
+ this._height = height;
583
+ var width = this._width;
584
+ this.onResize(width, height, width, oldHeight);
585
+ if (scalarSet.y != null) {
586
+ var position = this._position;
587
+ var parent_4 = this.getParentOfSize();
588
+ if (parent_4) {
589
+ position.y = scalarSet.y(parent_4.height, height, parent_4.padding.getTop(), position.y);
590
+ }
591
+ }
592
+ }
593
+ else {
594
+ if (scalarSet.height !== undefined) {
595
+ scalarSet.height = undefined;
596
+ this.toParentResized();
597
+ }
598
+ }
566
599
  }
567
600
  else {
568
- var scalarSet = this._scalarSet;
569
601
  var scalar = DScalarFunctions.size(height);
570
602
  if (scalarSet.height !== scalar) {
571
603
  scalarSet.height = scalar;
@@ -664,7 +696,7 @@ var DBase = /** @class */ (function (_super) {
664
696
  DBase.prototype.show = function () {
665
697
  if (!this.visible) {
666
698
  this.visible = true;
667
- this.toParentChildrenDirty();
699
+ this.toParentHierarchyDirty();
668
700
  DApplications.update(this);
669
701
  }
670
702
  return this;
@@ -675,7 +707,7 @@ var DBase = /** @class */ (function (_super) {
675
707
  DBase.prototype.hide = function () {
676
708
  if (this.visible) {
677
709
  this.visible = false;
678
- this.toParentChildrenDirty();
710
+ this.toParentHierarchyDirty();
679
711
  this.blur(true);
680
712
  DApplications.update(this);
681
713
  }
@@ -706,25 +738,25 @@ var DBase = /** @class */ (function (_super) {
706
738
  parent.toHasDirty();
707
739
  }
708
740
  };
709
- DBase.prototype.toChildrenDirty = function () {
710
- if (!this._isChildrenDirty) {
711
- this._isChildrenDirty = true;
712
- this.onChildrenDirty();
713
- this.toParentChildrenDirty();
741
+ DBase.prototype.toHierarchyDirty = function () {
742
+ if (!this._isHierarchyDirty) {
743
+ this._isHierarchyDirty = true;
744
+ this.onHierarchyDirty();
745
+ this.toParentHierarchyDirty();
714
746
  return true;
715
747
  }
716
748
  return false;
717
749
  };
718
- DBase.prototype.toParentChildrenDirty = function () {
750
+ DBase.prototype.toParentHierarchyDirty = function () {
719
751
  var parent = this.parent;
720
752
  if (parent instanceof DBase) {
721
- parent.toChildrenDirty();
753
+ parent.toHierarchyDirty();
722
754
  }
723
755
  };
724
- DBase.prototype.isChildrenDirty = function () {
725
- return this._isChildrenDirty;
756
+ DBase.prototype.isHierarchyDirty = function () {
757
+ return this._isHierarchyDirty;
726
758
  };
727
- DBase.prototype.onChildrenDirty = function () {
759
+ DBase.prototype.onHierarchyDirty = function () {
728
760
  // DO NOTHING
729
761
  };
730
762
  DBase.prototype.isDirty = function () {
@@ -840,16 +872,26 @@ var DBase = /** @class */ (function (_super) {
840
872
  enumerable: false,
841
873
  configurable: true
842
874
  });
843
- DBase.prototype.refit = function () {
844
- if (this._isChildrenDirty) {
845
- this._isChildrenDirty = false;
875
+ DBase.prototype.reflow = function () {
876
+ var isDirty = this._isDirty;
877
+ if (isDirty) {
878
+ this.onReflow();
879
+ this._isDirty = false;
880
+ }
881
+ var hasDirty = this._hasDirty;
882
+ var isHierarchyDirty = this._isHierarchyDirty;
883
+ if (hasDirty || isHierarchyDirty) {
884
+ this._hasDirty = false;
885
+ this._isHierarchyDirty = false;
846
886
  var children = this.children;
847
887
  for (var i = 0, imax = children.length; i < imax; ++i) {
848
888
  var child = children[i];
849
889
  if (child instanceof DBase) {
850
- child.refit();
890
+ child.reflow();
851
891
  }
852
892
  }
893
+ }
894
+ if (isDirty || hasDirty || isHierarchyDirty) {
853
895
  this.onRefit();
854
896
  }
855
897
  };
@@ -884,7 +926,7 @@ var DBase = /** @class */ (function (_super) {
884
926
  width = Math.max(width, child.x + child.width);
885
927
  }
886
928
  }
887
- this.width = width + this.padding.getRight();
929
+ this.resize(width + this.padding.getRight(), undefined);
888
930
  }
889
931
  else if (isHeightAuto) {
890
932
  var height = 0;
@@ -895,7 +937,7 @@ var DBase = /** @class */ (function (_super) {
895
937
  height = Math.max(height, child.y + child.height);
896
938
  }
897
939
  }
898
- this.height = height + this.padding.getBottom();
940
+ this.resize(undefined, height + this.padding.getBottom());
899
941
  }
900
942
  };
901
943
  DBase.prototype.isRefitable = function (target) {
@@ -907,22 +949,6 @@ var DBase = /** @class */ (function (_super) {
907
949
  DBase.prototype.hasRefitableWidth = function (target) {
908
950
  return (this.isRefitable(target) && !(target instanceof DBase && isFunction(target.getWidth())));
909
951
  };
910
- DBase.prototype.reflow = function () {
911
- if (this._isDirty) {
912
- this.onReflow();
913
- this._isDirty = false;
914
- }
915
- if (this._hasDirty) {
916
- var children = this.children;
917
- for (var i = 0, imax = children.length; i < imax; ++i) {
918
- var child = children[i];
919
- if (child instanceof DBase) {
920
- child.reflow();
921
- }
922
- }
923
- this._hasDirty = false;
924
- }
925
- };
926
952
  DBase.prototype.onReflow = function () {
927
953
  this._reflowable.onReflow(this, this._width, this._height);
928
954
  };