@wcardinal/wcardinal-ui 0.309.0 → 0.310.1

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 (122) hide show
  1. package/README.md +1 -1
  2. package/dist/types/wcardinal/ui/d-base-state-and-value.d.ts +4 -0
  3. package/dist/types/wcardinal/ui/d-base-state-matcher.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/d-base-state-set-blinker-datum-impl.d.ts +5 -0
  5. package/dist/types/wcardinal/ui/d-base-state-set-blinker-impl.d.ts +8 -0
  6. package/dist/types/wcardinal/ui/d-base-state-set-blinker.d.ts +3 -0
  7. package/dist/types/wcardinal/ui/d-base-state-set-impl.d.ts +51 -18
  8. package/dist/types/wcardinal/ui/d-base-state-set-sub-datum-impl.d.ts +17 -0
  9. package/dist/types/wcardinal/ui/d-base-state-set-sub-datum.d.ts +6 -0
  10. package/dist/types/wcardinal/ui/d-base-state-set-sub-impl.d.ts +15 -0
  11. package/dist/types/wcardinal/ui/d-base-state-set-sub.d.ts +6 -0
  12. package/dist/types/wcardinal/ui/d-base-state-set-ticker-datum-impl.d.ts +5 -0
  13. package/dist/types/wcardinal/ui/d-base-state-set-ticker-impl.d.ts +8 -0
  14. package/dist/types/wcardinal/ui/d-base-state-set-ticker.d.ts +3 -0
  15. package/dist/types/wcardinal/ui/d-base-state-set.d.ts +38 -8
  16. package/dist/types/wcardinal/ui/d-base.d.ts +23 -1
  17. package/dist/types/wcardinal/ui/d-chart-axis-base-guide-container.d.ts +21 -0
  18. package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +6 -0
  19. package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +5 -0
  20. package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +4 -0
  21. package/dist/types/wcardinal/ui/d-chart-axis-guide-container.d.ts +14 -0
  22. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.d.ts +41 -0
  23. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape.d.ts +80 -0
  24. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple.d.ts +32 -0
  25. package/dist/types/wcardinal/ui/d-chart-axis-guide.d.ts +14 -0
  26. package/dist/types/wcardinal/ui/d-chart-axis.d.ts +2 -0
  27. package/dist/types/wcardinal/ui/d-dynamic-text-geometry.d.ts +7 -4
  28. package/dist/types/wcardinal/ui/d-dynamic-text-measure-result.d.ts +3 -0
  29. package/dist/types/wcardinal/ui/d-dynamic-text-measure.d.ts +4 -3
  30. package/dist/types/wcardinal/ui/d-dynamic-text-style.d.ts +16 -1
  31. package/dist/types/wcardinal/ui/d-dynamic-text.d.ts +7 -6
  32. package/dist/types/wcardinal/ui/d-links.d.ts +2 -1
  33. package/dist/types/wcardinal/ui/d-text-base.d.ts +1 -0
  34. package/dist/types/wcardinal/ui/index.d.ts +18 -0
  35. package/dist/types/wcardinal/ui/shape/index.d.ts +2 -0
  36. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-text-base.d.ts +1 -0
  37. package/dist/types/wcardinal/ui/theme/white/d-theme-white-text-base.d.ts +1 -0
  38. package/dist/types/wcardinal/ui/util/util-font.d.ts +2 -0
  39. package/dist/wcardinal/ui/d-base-state-and-value.js +2 -0
  40. package/dist/wcardinal/ui/d-base-state-and-value.js.map +1 -0
  41. package/dist/wcardinal/ui/d-base-state-matcher.js +2 -0
  42. package/dist/wcardinal/ui/d-base-state-matcher.js.map +1 -0
  43. package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js +17 -0
  44. package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js.map +1 -0
  45. package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js +16 -0
  46. package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js.map +1 -0
  47. package/dist/wcardinal/ui/d-base-state-set-blinker.js +2 -0
  48. package/dist/wcardinal/ui/d-base-state-set-blinker.js.map +1 -0
  49. package/dist/wcardinal/ui/d-base-state-set-impl.js +298 -129
  50. package/dist/wcardinal/ui/d-base-state-set-impl.js.map +1 -1
  51. package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js +75 -0
  52. package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js.map +1 -0
  53. package/dist/wcardinal/ui/d-base-state-set-sub-datum.js +2 -0
  54. package/dist/wcardinal/ui/d-base-state-set-sub-datum.js.map +1 -0
  55. package/dist/wcardinal/ui/d-base-state-set-sub-impl.js +73 -0
  56. package/dist/wcardinal/ui/d-base-state-set-sub-impl.js.map +1 -0
  57. package/dist/wcardinal/ui/d-base-state-set-sub.js +2 -0
  58. package/dist/wcardinal/ui/d-base-state-set-sub.js.map +1 -0
  59. package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js +17 -0
  60. package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js.map +1 -0
  61. package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js +16 -0
  62. package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js.map +1 -0
  63. package/dist/wcardinal/ui/d-base-state-set-ticker.js +2 -0
  64. package/dist/wcardinal/ui/d-base-state-set-ticker.js.map +1 -0
  65. package/dist/wcardinal/ui/d-base-state-set.js.map +1 -1
  66. package/dist/wcardinal/ui/d-base.js +34 -2
  67. package/dist/wcardinal/ui/d-base.js.map +1 -1
  68. package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js +75 -0
  69. package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js.map +1 -0
  70. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +7 -0
  71. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
  72. package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
  73. package/dist/wcardinal/ui/d-chart-axis-base.js +23 -1
  74. package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
  75. package/dist/wcardinal/ui/d-chart-axis-guide-container.js +2 -0
  76. package/dist/wcardinal/ui/d-chart-axis-guide-container.js.map +1 -0
  77. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js +328 -0
  78. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js.map +1 -0
  79. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js +2 -0
  80. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js.map +1 -0
  81. package/dist/wcardinal/ui/d-chart-axis-guide-simple.js +123 -0
  82. package/dist/wcardinal/ui/d-chart-axis-guide-simple.js.map +1 -0
  83. package/dist/wcardinal/ui/d-chart-axis-guide.js +2 -0
  84. package/dist/wcardinal/ui/d-chart-axis-guide.js.map +1 -0
  85. package/dist/wcardinal/ui/d-chart-axis.js.map +1 -1
  86. package/dist/wcardinal/ui/d-dynamic-text-geometry.js +17 -10
  87. package/dist/wcardinal/ui/d-dynamic-text-geometry.js.map +1 -1
  88. package/dist/wcardinal/ui/d-dynamic-text-measure-result.js +22 -0
  89. package/dist/wcardinal/ui/d-dynamic-text-measure-result.js.map +1 -1
  90. package/dist/wcardinal/ui/d-dynamic-text-measure.js +14 -10
  91. package/dist/wcardinal/ui/d-dynamic-text-measure.js.map +1 -1
  92. package/dist/wcardinal/ui/d-dynamic-text-style.js +107 -6
  93. package/dist/wcardinal/ui/d-dynamic-text-style.js.map +1 -1
  94. package/dist/wcardinal/ui/d-dynamic-text.js +52 -29
  95. package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
  96. package/dist/wcardinal/ui/d-links.js +18 -1
  97. package/dist/wcardinal/ui/d-links.js.map +1 -1
  98. package/dist/wcardinal/ui/d-text-base.js +6 -3
  99. package/dist/wcardinal/ui/d-text-base.js.map +1 -1
  100. package/dist/wcardinal/ui/index.js +18 -0
  101. package/dist/wcardinal/ui/index.js.map +1 -1
  102. package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js +2 -2
  103. package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js.map +1 -1
  104. package/dist/wcardinal/ui/shape/index.js +2 -0
  105. package/dist/wcardinal/ui/shape/index.js.map +1 -1
  106. package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js +3 -0
  107. package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js.map +1 -1
  108. package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js +3 -0
  109. package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js.map +1 -1
  110. package/dist/wcardinal/ui/util/util-font.js +18 -11
  111. package/dist/wcardinal/ui/util/util-font.js.map +1 -1
  112. package/dist/wcardinal-ui-theme-dark.js +4 -1
  113. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  114. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  115. package/dist/wcardinal-ui-theme-white.js +4 -1
  116. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  117. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  118. package/dist/wcardinal-ui.cjs.js +1404 -275
  119. package/dist/wcardinal-ui.js +1398 -275
  120. package/dist/wcardinal-ui.min.js +2 -2
  121. package/dist/wcardinal-ui.min.js.map +1 -1
  122. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.309.0
2
+ Winter Cardinal UI v0.310.1
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -2605,6 +2605,213 @@
2605
2605
  NEW_WINDOW: "NEW_WINDOW"
2606
2606
  };
2607
2607
 
2608
+ var DBaseStateSetSubDatumImp = /** @class */ (function () {
2609
+ function DBaseStateSetSubDatumImp(interval) {
2610
+ var _this = this;
2611
+ this._stateToTargets = new Map();
2612
+ this._interval = interval;
2613
+ this._onTimeBound = function () { return _this.onTime(); };
2614
+ }
2615
+ Object.defineProperty(DBaseStateSetSubDatumImp.prototype, "interval", {
2616
+ get: function () {
2617
+ return this._interval;
2618
+ },
2619
+ enumerable: false,
2620
+ configurable: true
2621
+ });
2622
+ DBaseStateSetSubDatumImp.prototype.add = function (state, target) {
2623
+ var stateToTargets = this._stateToTargets;
2624
+ var targets = stateToTargets.get(state);
2625
+ if (targets == null) {
2626
+ targets = new Set();
2627
+ targets.add(target);
2628
+ stateToTargets.set(state, targets);
2629
+ if (stateToTargets.size <= 1) {
2630
+ this.start();
2631
+ }
2632
+ }
2633
+ else {
2634
+ targets.add(target);
2635
+ }
2636
+ return this;
2637
+ };
2638
+ DBaseStateSetSubDatumImp.prototype.remove = function (state, target) {
2639
+ var stateToTargets = this._stateToTargets;
2640
+ var targets = stateToTargets.get(state);
2641
+ if (targets != null && targets.has(target)) {
2642
+ targets.delete(target);
2643
+ target.remove(state);
2644
+ if (targets.size <= 0) {
2645
+ stateToTargets.delete(state);
2646
+ }
2647
+ if (stateToTargets.size <= 0) {
2648
+ this.stop();
2649
+ }
2650
+ }
2651
+ return this;
2652
+ };
2653
+ DBaseStateSetSubDatumImp.prototype.start = function () {
2654
+ if (this._timeoutId == null) {
2655
+ this.onTime();
2656
+ }
2657
+ return this;
2658
+ };
2659
+ DBaseStateSetSubDatumImp.prototype.stop = function () {
2660
+ var timeoutId = this._timeoutId;
2661
+ if (timeoutId != null) {
2662
+ clearTimeout(timeoutId);
2663
+ this._timeoutId = undefined;
2664
+ }
2665
+ return this;
2666
+ };
2667
+ DBaseStateSetSubDatumImp.prototype.onTime = function () {
2668
+ var now = Date.now();
2669
+ var interval = this.interval;
2670
+ var value = this.newValue(now, interval);
2671
+ var on = this.newOn(now, interval);
2672
+ this._stateToTargets.forEach(function (targets, state) {
2673
+ targets.forEach(function (target) {
2674
+ target.set(state, value, on);
2675
+ });
2676
+ });
2677
+ this._timeoutId = window.setTimeout(this._onTimeBound, Math.max(0, interval - (now % interval)));
2678
+ };
2679
+ return DBaseStateSetSubDatumImp;
2680
+ }());
2681
+
2682
+ var DBaseStateSetBlinkerDatumImpl = /** @class */ (function (_super) {
2683
+ __extends(DBaseStateSetBlinkerDatumImpl, _super);
2684
+ function DBaseStateSetBlinkerDatumImpl() {
2685
+ return _super !== null && _super.apply(this, arguments) || this;
2686
+ }
2687
+ DBaseStateSetBlinkerDatumImpl.prototype.newValue = function (now, interval) {
2688
+ return null;
2689
+ };
2690
+ DBaseStateSetBlinkerDatumImpl.prototype.newOn = function (now, interval) {
2691
+ return Math.round(now / interval) % 2 === 0;
2692
+ };
2693
+ return DBaseStateSetBlinkerDatumImpl;
2694
+ }(DBaseStateSetSubDatumImp));
2695
+
2696
+ var DBaseStateSetSubImpl = /** @class */ (function () {
2697
+ function DBaseStateSetSubImpl(parent, intervalToDatum) {
2698
+ this._parent = parent;
2699
+ this._stateToInterval = new Map();
2700
+ this._intervalToDatum = intervalToDatum;
2701
+ }
2702
+ DBaseStateSetSubImpl.prototype.add = function (state, interval) {
2703
+ // Check if the interval is not same
2704
+ var stateToInterval = this._stateToInterval;
2705
+ var oldInterval = stateToInterval.get(state);
2706
+ if (oldInterval === interval) {
2707
+ return this;
2708
+ }
2709
+ // Remove the existing one
2710
+ if (oldInterval != null) {
2711
+ stateToInterval.delete(state);
2712
+ var datum_1 = this._intervalToDatum.get(oldInterval);
2713
+ if (datum_1 != null) {
2714
+ datum_1.remove(state, this._parent);
2715
+ }
2716
+ }
2717
+ // Add a new one
2718
+ stateToInterval.set(state, interval);
2719
+ var datum = this._intervalToDatum.get(interval);
2720
+ if (datum == null) {
2721
+ datum = this.newDatum(interval);
2722
+ this._intervalToDatum.set(interval, datum);
2723
+ }
2724
+ datum.add(state, this._parent);
2725
+ // Done
2726
+ return this;
2727
+ };
2728
+ DBaseStateSetSubImpl.prototype.remove = function (state) {
2729
+ var interval = this._stateToInterval.get(state);
2730
+ if (interval == null) {
2731
+ return this;
2732
+ }
2733
+ this._stateToInterval.delete(state);
2734
+ var datum = this._intervalToDatum.get(interval);
2735
+ if (datum == null) {
2736
+ return this;
2737
+ }
2738
+ datum.remove(state, this._parent);
2739
+ return this;
2740
+ };
2741
+ DBaseStateSetSubImpl.prototype.set = function (state, interval, on) {
2742
+ if (on) {
2743
+ return this.add(state, interval);
2744
+ }
2745
+ else {
2746
+ return this.remove(state);
2747
+ }
2748
+ };
2749
+ DBaseStateSetSubImpl.prototype.has = function (state) {
2750
+ return this._stateToInterval.has(state);
2751
+ };
2752
+ DBaseStateSetSubImpl.prototype.clear = function () {
2753
+ var _this = this;
2754
+ var parent = this._parent;
2755
+ var stateToInterval = this._stateToInterval;
2756
+ stateToInterval.forEach(function (interval, state) {
2757
+ var datum = _this._intervalToDatum.get(interval);
2758
+ if (datum != null) {
2759
+ datum.remove(state, parent);
2760
+ }
2761
+ });
2762
+ stateToInterval.clear();
2763
+ return this;
2764
+ };
2765
+ return DBaseStateSetSubImpl;
2766
+ }());
2767
+
2768
+ var intervalToDatum$1;
2769
+ var DBaseStateSetBlinkerImpl = /** @class */ (function (_super) {
2770
+ __extends(DBaseStateSetBlinkerImpl, _super);
2771
+ function DBaseStateSetBlinkerImpl(parent) {
2772
+ return _super.call(this, parent, (intervalToDatum$1 !== null && intervalToDatum$1 !== void 0 ? intervalToDatum$1 : (intervalToDatum$1 = new Map()))) || this;
2773
+ }
2774
+ DBaseStateSetBlinkerImpl.prototype.newDatum = function (interval) {
2775
+ return new DBaseStateSetBlinkerDatumImpl(interval);
2776
+ };
2777
+ return DBaseStateSetBlinkerImpl;
2778
+ }(DBaseStateSetSubImpl));
2779
+
2780
+ var DBaseStateSetTickerDatumImpl = /** @class */ (function (_super) {
2781
+ __extends(DBaseStateSetTickerDatumImpl, _super);
2782
+ function DBaseStateSetTickerDatumImpl() {
2783
+ return _super !== null && _super.apply(this, arguments) || this;
2784
+ }
2785
+ DBaseStateSetTickerDatumImpl.prototype.newValue = function (now, interval) {
2786
+ return Math.round(now / interval);
2787
+ };
2788
+ DBaseStateSetTickerDatumImpl.prototype.newOn = function (now, interval) {
2789
+ return true;
2790
+ };
2791
+ return DBaseStateSetTickerDatumImpl;
2792
+ }(DBaseStateSetSubDatumImp));
2793
+
2794
+ var intervalToDatum;
2795
+ var DBaseStateSetTickerImpl = /** @class */ (function (_super) {
2796
+ __extends(DBaseStateSetTickerImpl, _super);
2797
+ function DBaseStateSetTickerImpl(parent) {
2798
+ return _super.call(this, parent, (intervalToDatum !== null && intervalToDatum !== void 0 ? intervalToDatum : (intervalToDatum = new Map()))) || this;
2799
+ }
2800
+ DBaseStateSetTickerImpl.prototype.newDatum = function (interval) {
2801
+ return new DBaseStateSetTickerDatumImpl(interval);
2802
+ };
2803
+ return DBaseStateSetTickerImpl;
2804
+ }(DBaseStateSetSubImpl));
2805
+
2806
+ /*
2807
+ * Copyright (C) 2019 Toshiba Corporation
2808
+ * SPDX-License-Identifier: Apache-2.0
2809
+ */
2810
+ var isArray = Array.isArray ||
2811
+ (function (target) {
2812
+ return Object.prototype.toString.call(target) === "[object Array]";
2813
+ });
2814
+
2608
2815
  /*
2609
2816
  * Copyright (C) 2019 Toshiba Corporation
2610
2817
  * SPDX-License-Identifier: Apache-2.0
@@ -2614,6 +2821,14 @@
2614
2821
  return typeof target === "function";
2615
2822
  };
2616
2823
 
2824
+ /*
2825
+ * Copyright (C) 2019 Toshiba Corporation
2826
+ * SPDX-License-Identifier: Apache-2.0
2827
+ */
2828
+ var isNumber = function (target) {
2829
+ return (typeof target === "number" || Object.prototype.toString.call(target) === "[object Number]");
2830
+ };
2831
+
2617
2832
  /*
2618
2833
  * Copyright (C) 2019 Toshiba Corporation
2619
2834
  * SPDX-License-Identifier: Apache-2.0
@@ -2628,22 +2843,80 @@
2628
2843
  */
2629
2844
  var DBaseStateSetImpl = /** @class */ (function () {
2630
2845
  function DBaseStateSetImpl() {
2631
- this._local = new Set();
2846
+ this._local = new Map();
2632
2847
  this._parent = null;
2633
2848
  }
2634
- DBaseStateSetImpl.prototype.is = function (state) {
2635
- return this._local.has(state);
2849
+ Object.defineProperty(DBaseStateSetImpl.prototype, "local", {
2850
+ get: function () {
2851
+ return this._local;
2852
+ },
2853
+ enumerable: false,
2854
+ configurable: true
2855
+ });
2856
+ Object.defineProperty(DBaseStateSetImpl.prototype, "parent", {
2857
+ get: function () {
2858
+ return this._parent;
2859
+ },
2860
+ set: function (parent) {
2861
+ if (this._parent !== parent) {
2862
+ this.begin();
2863
+ this._parent = parent;
2864
+ this.end();
2865
+ }
2866
+ },
2867
+ enumerable: false,
2868
+ configurable: true
2869
+ });
2870
+ DBaseStateSetImpl.prototype.onParentChange = function (newState, oldState) {
2871
+ this._parent = oldState;
2872
+ this.begin();
2873
+ this._parent = newState;
2874
+ this.end();
2636
2875
  };
2637
- DBaseStateSetImpl.prototype.in = function (state) {
2638
- return this.is(state) || this.under(state);
2876
+ Object.defineProperty(DBaseStateSetImpl.prototype, "blinker", {
2877
+ get: function () {
2878
+ var result = this._blinker;
2879
+ if (result == null) {
2880
+ result = this.newBlinker();
2881
+ this._blinker = result;
2882
+ }
2883
+ return result;
2884
+ },
2885
+ enumerable: false,
2886
+ configurable: true
2887
+ });
2888
+ DBaseStateSetImpl.prototype.newBlinker = function () {
2889
+ return new DBaseStateSetBlinkerImpl(this);
2639
2890
  };
2640
- DBaseStateSetImpl.prototype.on = function (state) {
2641
- var _a, _b;
2642
- return (_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.is(state)) !== null && _b !== void 0 ? _b : false;
2891
+ Object.defineProperty(DBaseStateSetImpl.prototype, "ticker", {
2892
+ get: function () {
2893
+ var result = this._ticker;
2894
+ if (result == null) {
2895
+ result = this.newTicker();
2896
+ this._ticker = result;
2897
+ }
2898
+ return result;
2899
+ },
2900
+ enumerable: false,
2901
+ configurable: true
2902
+ });
2903
+ DBaseStateSetImpl.prototype.newTicker = function () {
2904
+ return new DBaseStateSetTickerImpl(this);
2643
2905
  };
2644
- DBaseStateSetImpl.prototype.under = function (state) {
2645
- var _a, _b;
2646
- return (_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.in(state)) !== null && _b !== void 0 ? _b : false;
2906
+ DBaseStateSetImpl.prototype.is = function (state, value) {
2907
+ var v = this._local.get(state);
2908
+ return v !== undefined && (value === undefined || value === v);
2909
+ };
2910
+ DBaseStateSetImpl.prototype.in = function (state, value) {
2911
+ return this.is(state, value) || this.under(state, value);
2912
+ };
2913
+ DBaseStateSetImpl.prototype.on = function (state, value) {
2914
+ var parent = this._parent;
2915
+ return parent != null && parent.is(state, value);
2916
+ };
2917
+ DBaseStateSetImpl.prototype.under = function (state, value) {
2918
+ var parent = this._parent;
2919
+ return parent != null && parent.in(state, value);
2647
2920
  };
2648
2921
  DBaseStateSetImpl.prototype.lock = function (callOnChange) {
2649
2922
  return this;
@@ -2657,35 +2930,78 @@
2657
2930
  DBaseStateSetImpl.prototype.end = function () {
2658
2931
  return this;
2659
2932
  };
2660
- DBaseStateSetImpl.prototype.checkAdded = function (added) {
2661
- return !this._local.has(added);
2933
+ DBaseStateSetImpl.prototype.checkAdded = function (added, value) {
2934
+ var v = this._local.get(added);
2935
+ return v === undefined || v !== value;
2662
2936
  };
2663
- DBaseStateSetImpl.prototype.add = function (state) {
2664
- if (this.checkAdded(state)) {
2937
+ DBaseStateSetImpl.prototype.add = function (state, value) {
2938
+ if (value === void 0) { value = null; }
2939
+ if (this.checkAdded(state, value)) {
2665
2940
  this.begin();
2666
- this._local.add(state);
2941
+ this._local.set(state, value);
2667
2942
  this.end();
2668
2943
  }
2669
2944
  return this;
2670
2945
  };
2671
- DBaseStateSetImpl.prototype.checkAddeds = function (states) {
2946
+ DBaseStateSetImpl.prototype.checkAddedsString = function (states) {
2672
2947
  var local = this._local;
2673
2948
  for (var i = 0, imax = states.length; i < imax; ++i) {
2674
- if (!local.has(states[i])) {
2949
+ var v = local.get(states[i]);
2950
+ if (v === undefined || v !== null) {
2675
2951
  return true;
2676
2952
  }
2677
2953
  }
2678
2954
  return false;
2679
2955
  };
2680
- DBaseStateSetImpl.prototype.addAll = function (stateOrStates) {
2681
- var states = isString(stateOrStates)
2682
- ? arguments // eslint-disable-line prefer-rest-params
2683
- : stateOrStates;
2684
- if (this.checkAddeds(states)) {
2956
+ DBaseStateSetImpl.prototype.checkAddedsObject = function (states) {
2957
+ var local = this._local;
2958
+ for (var i = 0, imax = states.length; i < imax; ++i) {
2959
+ var state = states[i];
2960
+ var v = local.get(state.state);
2961
+ if (v === undefined || v !== state.value) {
2962
+ return true;
2963
+ }
2964
+ }
2965
+ return false;
2966
+ };
2967
+ DBaseStateSetImpl.prototype.addAll = function (first) {
2968
+ if (isString(first)) {
2969
+ return this.addAllString(arguments); // eslint-disable-line prefer-rest-params
2970
+ }
2971
+ else if (isArray(first)) {
2972
+ if (0 < first.length) {
2973
+ var element = first[0];
2974
+ if (isString(element)) {
2975
+ return this.addAllString(first);
2976
+ }
2977
+ else {
2978
+ return this.addAllObject(first);
2979
+ }
2980
+ }
2981
+ return this;
2982
+ }
2983
+ else {
2984
+ return this.addAllObject(arguments); // eslint-disable-line prefer-rest-params
2985
+ }
2986
+ };
2987
+ DBaseStateSetImpl.prototype.addAllString = function (states) {
2988
+ if (this.checkAddedsString(states)) {
2989
+ this.begin();
2990
+ var local = this._local;
2991
+ for (var i = 0, imax = states.length; i < imax; ++i) {
2992
+ local.set(states[i], null);
2993
+ }
2994
+ this.end();
2995
+ }
2996
+ return this;
2997
+ };
2998
+ DBaseStateSetImpl.prototype.addAllObject = function (states) {
2999
+ if (this.checkAddedsObject(states)) {
2685
3000
  this.begin();
2686
3001
  var local = this._local;
2687
3002
  for (var i = 0, imax = states.length; i < imax; ++i) {
2688
- local.add(states[i]);
3003
+ var state = states[i];
3004
+ local.set(state.state, state.value);
2689
3005
  }
2690
3006
  this.end();
2691
3007
  }
@@ -2702,7 +3018,7 @@
2702
3018
  }
2703
3019
  return this;
2704
3020
  };
2705
- DBaseStateSetImpl.prototype.checkRemoveds = function (states) {
3021
+ DBaseStateSetImpl.prototype.checkRemovedsString = function (states) {
2706
3022
  var local = this._local;
2707
3023
  for (var i = 0, imax = states.length; i < imax; ++i) {
2708
3024
  if (local.has(states[i])) {
@@ -2711,120 +3027,211 @@
2711
3027
  }
2712
3028
  return false;
2713
3029
  };
2714
- DBaseStateSetImpl.prototype.removeAll = function (stateOrStatesOrMatcher) {
2715
- var _this = this;
3030
+ DBaseStateSetImpl.prototype.checkRemovedsObject = function (states) {
2716
3031
  var local = this._local;
2717
- if (isFunction(stateOrStatesOrMatcher)) {
2718
- var isDirty_1 = false;
2719
- local.forEach(function (state) {
2720
- if (stateOrStatesOrMatcher(state)) {
2721
- if (!isDirty_1) {
2722
- isDirty_1 = true;
2723
- _this.begin();
2724
- }
2725
- local.delete(state);
3032
+ for (var i = 0, imax = states.length; i < imax; ++i) {
3033
+ if (local.has(states[i].state)) {
3034
+ return true;
3035
+ }
3036
+ }
3037
+ return false;
3038
+ };
3039
+ DBaseStateSetImpl.prototype.removeAll = function (first) {
3040
+ if (isFunction(first)) {
3041
+ return this.removeAllMatcher(first);
3042
+ }
3043
+ else if (isString(first)) {
3044
+ return this.removeAllString(arguments); // eslint-disable-line prefer-rest-params
3045
+ }
3046
+ else if (isArray(first)) {
3047
+ if (0 < first.length) {
3048
+ var element = first[0];
3049
+ if (isString(element)) {
3050
+ return this.removeAllString(first);
3051
+ }
3052
+ else {
3053
+ return this.removeAllObject(first);
2726
3054
  }
2727
- });
2728
- if (isDirty_1) {
2729
- this.end();
2730
3055
  }
3056
+ return this;
2731
3057
  }
2732
3058
  else {
2733
- var states = isString(stateOrStatesOrMatcher)
2734
- ? arguments // eslint-disable-line prefer-rest-params
2735
- : stateOrStatesOrMatcher;
2736
- if (this.checkRemoveds(states)) {
2737
- this.begin();
2738
- for (var i = 0, imax = states.length; i < imax; ++i) {
2739
- local.delete(states[i]);
3059
+ return this.removeAllObject(arguments); // eslint-disable-line prefer-rest-params
3060
+ }
3061
+ };
3062
+ DBaseStateSetImpl.prototype.removeAllMatcher = function (matcher) {
3063
+ var _this = this;
3064
+ var isDirty = false;
3065
+ var local = this._local;
3066
+ local.forEach(function (value, state) {
3067
+ if (matcher(state)) {
3068
+ if (!isDirty) {
3069
+ isDirty = true;
3070
+ _this.begin();
2740
3071
  }
2741
- this.end();
3072
+ local.delete(state);
2742
3073
  }
3074
+ });
3075
+ if (isDirty) {
3076
+ this.end();
2743
3077
  }
2744
3078
  return this;
2745
3079
  };
2746
- DBaseStateSetImpl.prototype.clear = function () {
2747
- var local = this._local;
2748
- if (0 < local.size) {
3080
+ DBaseStateSetImpl.prototype.removeAllString = function (states) {
3081
+ if (this.checkRemovedsString(states)) {
2749
3082
  this.begin();
2750
- local.clear();
3083
+ var local = this._local;
3084
+ for (var i = 0, imax = states.length; i < imax; ++i) {
3085
+ local.delete(states[i]);
3086
+ }
3087
+ this.end();
3088
+ }
3089
+ return this;
3090
+ };
3091
+ DBaseStateSetImpl.prototype.removeAllObject = function (states) {
3092
+ if (this.checkRemovedsObject(states)) {
3093
+ this.begin();
3094
+ var local = this._local;
3095
+ for (var i = 0, imax = states.length; i < imax; ++i) {
3096
+ local.delete(states[i].state);
3097
+ }
2751
3098
  this.end();
2752
3099
  }
2753
3100
  return this;
2754
3101
  };
2755
- DBaseStateSetImpl.prototype.set = function (stateOrAdded, isOnOrRemoved) {
2756
- if (isOnOrRemoved === true) {
2757
- if (stateOrAdded != null) {
2758
- this.add(stateOrAdded);
3102
+ DBaseStateSetImpl.prototype.set = function (first, second, third) {
3103
+ if (second === true) {
3104
+ if (first != null) {
3105
+ this.add(first);
2759
3106
  }
2760
3107
  }
2761
- else if (isOnOrRemoved === false) {
2762
- if (stateOrAdded != null) {
2763
- this.remove(stateOrAdded);
3108
+ else if (second === false) {
3109
+ if (first != null) {
3110
+ this.remove(first);
2764
3111
  }
2765
3112
  }
2766
- else {
2767
- var added = stateOrAdded;
2768
- var removed = isOnOrRemoved;
2769
- if (added != null) {
2770
- if (removed != null) {
2771
- if (this.checkAdded(added) || this.checkRemoved(removed)) {
2772
- this.begin();
2773
- this._local.add(added).delete(removed);
2774
- this.end();
2775
- }
3113
+ else if (second == null || isNumber(second)) {
3114
+ if (third === true) {
3115
+ if (first != null) {
3116
+ this.add(first, second);
2776
3117
  }
2777
- else {
2778
- this.add(added);
3118
+ }
3119
+ else if (third === false) {
3120
+ if (first != null) {
3121
+ this.remove(first);
2779
3122
  }
2780
3123
  }
2781
- else if (removed != null) {
2782
- this.remove(removed);
3124
+ else {
3125
+ return this.doSet(first, second, third);
2783
3126
  }
2784
3127
  }
3128
+ else {
3129
+ return this.doSet(first, null, second);
3130
+ }
2785
3131
  return this;
2786
3132
  };
2787
- DBaseStateSetImpl.prototype.setAll = function (statesOrAddeds, isOnOrRemoveds) {
2788
- if (isOnOrRemoveds === true) {
2789
- if (statesOrAddeds != null) {
2790
- this.addAll(statesOrAddeds);
3133
+ DBaseStateSetImpl.prototype.doSet = function (added, value, removed) {
3134
+ if (added != null) {
3135
+ if (removed != null) {
3136
+ if (this.checkAdded(added, value) || this.checkRemoved(removed)) {
3137
+ this.begin();
3138
+ this._local.set(added, value).delete(removed);
3139
+ this.end();
3140
+ }
3141
+ }
3142
+ else {
3143
+ this.add(added, value);
2791
3144
  }
2792
3145
  }
2793
- else if (isOnOrRemoveds === false) {
2794
- if (statesOrAddeds != null) {
2795
- this.removeAll(statesOrAddeds);
3146
+ else if (removed != null) {
3147
+ this.remove(removed);
3148
+ }
3149
+ return this;
3150
+ };
3151
+ DBaseStateSetImpl.prototype.setAll = function (first, second) {
3152
+ if (second === true) {
3153
+ if (first != null) {
3154
+ this.addAll(first);
3155
+ }
3156
+ }
3157
+ else if (second === false) {
3158
+ if (first != null) {
3159
+ this.removeAll(first);
2796
3160
  }
2797
3161
  }
2798
3162
  else {
2799
- var addeds = statesOrAddeds;
2800
- var removeds = isOnOrRemoveds;
2801
- if (addeds != null) {
2802
- if (removeds != null) {
2803
- if (this.checkAddeds(addeds) || this.checkRemoveds(removeds)) {
2804
- this.begin();
2805
- var local = this._local;
2806
- for (var i = 0, imax = addeds.length; i < imax; ++i) {
2807
- local.add(addeds[i]);
2808
- }
2809
- for (var i = 0, imax = removeds.length; i < imax; ++i) {
2810
- local.delete(removeds[i]);
2811
- }
2812
- this.end();
3163
+ if (first != null && 0 < first.length) {
3164
+ if (second != null && 0 < second.length) {
3165
+ var added = first[0];
3166
+ if (isString(added)) {
3167
+ return this.setAllString(first, second);
3168
+ }
3169
+ else {
3170
+ return this.setAllObject(first, second);
2813
3171
  }
2814
3172
  }
2815
3173
  else {
2816
- this.addAll(addeds);
3174
+ this.addAll(first);
2817
3175
  }
2818
3176
  }
2819
- else if (removeds != null) {
2820
- this.removeAll(removeds);
3177
+ else if (second != null) {
3178
+ this.removeAll(second);
2821
3179
  }
2822
3180
  }
2823
3181
  return this;
2824
3182
  };
3183
+ DBaseStateSetImpl.prototype.setAllString = function (addeds, removeds) {
3184
+ if (this.checkAddedsString(addeds) || this.checkRemovedsString(removeds)) {
3185
+ this.begin();
3186
+ var local = this._local;
3187
+ for (var i = 0, imax = addeds.length; i < imax; ++i) {
3188
+ local.set(addeds[i], null);
3189
+ }
3190
+ for (var i = 0, imax = removeds.length; i < imax; ++i) {
3191
+ local.delete(removeds[i]);
3192
+ }
3193
+ this.end();
3194
+ }
3195
+ return this;
3196
+ };
3197
+ DBaseStateSetImpl.prototype.setAllObject = function (addeds, removeds) {
3198
+ if (this.checkAddedsObject(addeds) || this.checkRemovedsString(removeds)) {
3199
+ this.begin();
3200
+ var local = this._local;
3201
+ for (var i = 0, imax = addeds.length; i < imax; ++i) {
3202
+ var added = addeds[i];
3203
+ local.set(added.state, added.value);
3204
+ }
3205
+ for (var i = 0, imax = removeds.length; i < imax; ++i) {
3206
+ local.delete(removeds[i]);
3207
+ }
3208
+ this.end();
3209
+ }
3210
+ return this;
3211
+ };
3212
+ DBaseStateSetImpl.prototype.clear = function () {
3213
+ var local = this._local;
3214
+ if (0 < local.size) {
3215
+ this.begin();
3216
+ local.clear();
3217
+ this.end();
3218
+ }
3219
+ return this;
3220
+ };
3221
+ DBaseStateSetImpl.prototype.valueOf = function (state, def) {
3222
+ var result = this._local.get(state);
3223
+ if (result !== undefined) {
3224
+ return result;
3225
+ }
3226
+ var parent = this._parent;
3227
+ if (parent != null) {
3228
+ return parent.valueOf(state, def);
3229
+ }
3230
+ return def;
3231
+ };
2825
3232
  DBaseStateSetImpl.prototype.each = function (iteratee) {
2826
- this._local.forEach(function (state) {
2827
- iteratee(state);
3233
+ this._local.forEach(function (value, state) {
3234
+ iteratee(state, value);
2828
3235
  });
2829
3236
  return this;
2830
3237
  };
@@ -2836,41 +3243,14 @@
2836
3243
  this.begin();
2837
3244
  var local_1 = this._local;
2838
3245
  local_1.clear();
2839
- other.local.forEach(function (value) {
2840
- local_1.add(value);
3246
+ other.local.forEach(function (value, state) {
3247
+ local_1.set(state, value);
2841
3248
  });
2842
3249
  this._parent = other.parent;
2843
3250
  this.end();
2844
3251
  }
2845
3252
  return this;
2846
3253
  };
2847
- Object.defineProperty(DBaseStateSetImpl.prototype, "local", {
2848
- get: function () {
2849
- return this._local;
2850
- },
2851
- enumerable: false,
2852
- configurable: true
2853
- });
2854
- Object.defineProperty(DBaseStateSetImpl.prototype, "parent", {
2855
- get: function () {
2856
- return this._parent;
2857
- },
2858
- set: function (parent) {
2859
- if (this._parent !== parent) {
2860
- this.begin();
2861
- this._parent = parent;
2862
- this.end();
2863
- }
2864
- },
2865
- enumerable: false,
2866
- configurable: true
2867
- });
2868
- DBaseStateSetImpl.prototype.onParentChange = function (newState, oldState) {
2869
- this._parent = oldState;
2870
- this.begin();
2871
- this._parent = newState;
2872
- this.end();
2873
- };
2874
3254
  Object.defineProperty(DBaseStateSetImpl.prototype, "isHovered", {
2875
3255
  get: function () {
2876
3256
  return this.is(DBaseState.HOVERED);
@@ -3438,8 +3818,8 @@
3438
3818
  });
3439
3819
  DBaseStateSetImpl.prototype.toObject = function () {
3440
3820
  var states = [];
3441
- this._local.forEach(function (value) {
3442
- states.push(value);
3821
+ this._local.forEach(function (value, state) {
3822
+ states.push(state);
3443
3823
  });
3444
3824
  return {
3445
3825
  local: states
@@ -3542,12 +3922,12 @@
3542
3922
  EShapeStateSetImplObservable.prototype.onChange = function (newState, oldState) {
3543
3923
  if (newState.isActive) {
3544
3924
  if (!oldState.isActive) {
3545
- this._local.add(EShapeState.ACTIVATED).delete(EShapeState.DEACTIVATED);
3925
+ this._local.set(EShapeState.ACTIVATED, null).delete(EShapeState.DEACTIVATED);
3546
3926
  }
3547
3927
  }
3548
3928
  else {
3549
3929
  if (oldState.isActive) {
3550
- this._local.add(EShapeState.DEACTIVATED).delete(EShapeState.ACTIVATED);
3930
+ this._local.set(EShapeState.DEACTIVATED, null).delete(EShapeState.ACTIVATED);
3551
3931
  }
3552
3932
  }
3553
3933
  _super.prototype.onChange.call(this, newState, oldState);
@@ -6313,15 +6693,6 @@
6313
6693
  return EShapeDataMappingImpl;
6314
6694
  }());
6315
6695
 
6316
- /*
6317
- * Copyright (C) 2019 Toshiba Corporation
6318
- * SPDX-License-Identifier: Apache-2.0
6319
- */
6320
- var isArray = Array.isArray ||
6321
- (function (target) {
6322
- return Object.prototype.toString.call(target) === "[object Array]";
6323
- });
6324
-
6325
6696
  var EShapeDataScopedImpl = /** @class */ (function () {
6326
6697
  function EShapeDataScopedImpl() {
6327
6698
  }
@@ -8877,14 +9248,6 @@
8877
9248
  EXTENSION: 1000
8878
9249
  };
8879
9250
 
8880
- /*
8881
- * Copyright (C) 2019 Toshiba Corporation
8882
- * SPDX-License-Identifier: Apache-2.0
8883
- */
8884
- var isNumber = function (target) {
8885
- return (typeof target === "number" || Object.prototype.toString.call(target) === "[object Number]");
8886
- };
8887
-
8888
9251
  /*
8889
9252
  * Copyright (C) 2019 Toshiba Corporation
8890
9253
  * SPDX-License-Identifier: Apache-2.0
@@ -13569,11 +13932,42 @@
13569
13932
  if (options != null) {
13570
13933
  var state = options.state;
13571
13934
  if (state != null) {
13935
+ var s = _this._state;
13572
13936
  if (isString(state)) {
13573
- _this._state.add(state);
13937
+ s.add(state);
13938
+ }
13939
+ else if (isArray(state)) {
13940
+ s.addAll(state);
13574
13941
  }
13575
13942
  else {
13576
- _this._state.addAll(state);
13943
+ // Values
13944
+ var values = state.values;
13945
+ if (values != null) {
13946
+ if (isString(values)) {
13947
+ s.add(values);
13948
+ }
13949
+ else {
13950
+ s.addAll(values);
13951
+ }
13952
+ }
13953
+ // Blinker
13954
+ var blinkers = state.blinkers;
13955
+ if (blinkers != null) {
13956
+ var b = s.blinker;
13957
+ for (var i = 0, imax = blinkers.length; i < imax; ++i) {
13958
+ var blinker = blinkers[i];
13959
+ b.add(blinker.state, blinker.interval);
13960
+ }
13961
+ }
13962
+ // Ticker
13963
+ var tickers = state.tickers;
13964
+ if (tickers != null) {
13965
+ var t = s.ticker;
13966
+ for (var i = 0, imax = tickers.length; i < imax; ++i) {
13967
+ var ticker = tickers[i];
13968
+ t.add(ticker.state, ticker.interval);
13969
+ }
13970
+ }
13577
13971
  }
13578
13972
  }
13579
13973
  }
@@ -27386,6 +27780,8 @@
27386
27780
  this.width = 0;
27387
27781
  this.height = 0;
27388
27782
  this.characters = [];
27783
+ this.scale = 1;
27784
+ this.scaled = false;
27389
27785
  this.clipped = false;
27390
27786
  this.x = 0;
27391
27787
  this.y = 0;
@@ -27395,6 +27791,8 @@
27395
27791
  this.countPerLine = 0;
27396
27792
  this.width = 0;
27397
27793
  this.height = 0;
27794
+ this.scale = 1;
27795
+ this.scaled = false;
27398
27796
  this.clipped = false;
27399
27797
  this.x = 0;
27400
27798
  this.y = 0.5 * (lineHeight - fontHeight);
@@ -27481,6 +27879,24 @@
27481
27879
  }
27482
27880
  return false;
27483
27881
  };
27882
+ DDynamicTextMeasureResult.prototype.fit = function (width, height) {
27883
+ var w = this.width;
27884
+ var h = this.height;
27885
+ if (1e-4 < w && width < w) {
27886
+ if (1e-4 < h && height < h) {
27887
+ this.scale = Math.min(width / w, height / h);
27888
+ this.scaled = true;
27889
+ }
27890
+ else {
27891
+ this.scale = width / w;
27892
+ this.scaled = true;
27893
+ }
27894
+ }
27895
+ else if (1e-4 < h && height < h) {
27896
+ this.scale = height / h;
27897
+ this.scaled = true;
27898
+ }
27899
+ };
27484
27900
  DDynamicTextMeasureResult.prototype.end = function (lineHeight, fontHeight) {
27485
27901
  this.newLine(lineHeight);
27486
27902
  this.y -= 0.5 * (lineHeight - fontHeight);
@@ -27503,21 +27919,22 @@
27503
27919
  var DDynamicTextMeasure = /** @class */ (function () {
27504
27920
  function DDynamicTextMeasure() {
27505
27921
  }
27506
- DDynamicTextMeasure.measure = function (text, atlas, clipping) {
27922
+ DDynamicTextMeasure.measure = function (text, atlas, modifier) {
27507
27923
  var result = DDynamicTextMeasure.RESULT || new DDynamicTextMeasureResult();
27508
27924
  DDynamicTextMeasure.RESULT = result;
27509
27925
  if (atlas != null) {
27510
27926
  var itr = UtilCharacterIterator.from(text);
27511
27927
  var fh = atlas.font.height;
27512
- var lh = clipping.lineHeight;
27513
- var ce = clipping.enable;
27514
- var cw = clipping.width;
27515
- var ch = clipping.height;
27516
- var cp = clipping.wordWrap;
27928
+ var lh = modifier.lineHeight;
27929
+ var cf = modifier.fitting;
27930
+ var cc = !cf && modifier.clipping;
27931
+ var cw = modifier.width;
27932
+ var ch = modifier.height;
27933
+ var cp = !cf && modifier.wordWrap;
27517
27934
  result.start(lh, fh);
27518
27935
  switch (cp) {
27519
27936
  case DDynamicTextStyleWordWrap.BREAK_ALL:
27520
- if (ce) {
27937
+ if (cc) {
27521
27938
  this.measure1(itr, cw, ch, fh, lh, atlas, result);
27522
27939
  }
27523
27940
  else {
@@ -27527,7 +27944,7 @@
27527
27944
  case DDynamicTextStyleWordWrap.NORMAL:
27528
27945
  var lb = this.newLineBreaker(text);
27529
27946
  if (lb) {
27530
- if (ce) {
27947
+ if (cc) {
27531
27948
  this.measure1a(lb, itr, cw, ch, fh, lh, atlas, result);
27532
27949
  }
27533
27950
  else {
@@ -27535,7 +27952,7 @@
27535
27952
  }
27536
27953
  }
27537
27954
  else {
27538
- if (ce) {
27955
+ if (cc) {
27539
27956
  this.measure1b(itr, cw, ch, fh, lh, atlas, result);
27540
27957
  }
27541
27958
  else {
@@ -27544,7 +27961,7 @@
27544
27961
  }
27545
27962
  break;
27546
27963
  default:
27547
- if (ce) {
27964
+ if (cc) {
27548
27965
  this.measure3(itr, cw, lh, atlas, result);
27549
27966
  }
27550
27967
  else {
@@ -27553,6 +27970,9 @@
27553
27970
  break;
27554
27971
  }
27555
27972
  result.end(lh, fh);
27973
+ if (cf) {
27974
+ result.fit(cw, ch);
27975
+ }
27556
27976
  }
27557
27977
  else {
27558
27978
  result.start(0, 0);
@@ -27843,14 +28263,16 @@
27843
28263
  var _this = _super.call(this, new Float32Array(64), new Float32Array(64), new Uint16Array(48)) || this;
27844
28264
  _this.width = 0;
27845
28265
  _this.height = 0;
28266
+ _this.scale = 1;
28267
+ _this.scaled = false;
27846
28268
  _this.clipped = false;
27847
28269
  return _this;
27848
28270
  }
27849
- DDynamicTextGeometry.prototype.update = function (text, atlas, clipping) {
28271
+ DDynamicTextGeometry.prototype.update = function (text, atlas, modifier) {
27850
28272
  var vertexBuffer = this.getBuffer("aVertexPosition");
27851
28273
  var uvBuffer = this.getBuffer("aTextureCoord");
27852
28274
  var indexBuffer = this.getIndex();
27853
- var result = DDynamicTextMeasure.measure(text, atlas, clipping);
28275
+ var result = DDynamicTextMeasure.measure(text, atlas, modifier);
27854
28276
  var requiredTextSize = Math.ceil(result.count / 8) << 3;
27855
28277
  var requiredVertexSize = requiredTextSize << 3;
27856
28278
  if (vertexBuffer.data.length < requiredVertexSize) {
@@ -27867,6 +28289,7 @@
27867
28289
  if (atlas != null) {
27868
28290
  var count = result.count;
27869
28291
  var characters = result.characters;
28292
+ var scale = result.scale;
27870
28293
  for (var i = 0; i < count; ++i) {
27871
28294
  var character = characters[i];
27872
28295
  var cx = character.x;
@@ -27874,13 +28297,15 @@
27874
28297
  var cc = character.character;
27875
28298
  var w = atlas.width;
27876
28299
  var h = atlas.height;
27877
- this.writeCharacter(vertices, uvs, indices, i, cx, cy, cc, w, h);
28300
+ this.writeCharacter(vertices, uvs, indices, i, cx, cy, scale, cc, w, h);
27878
28301
  }
27879
28302
  for (var i = count, imax = vertices.length >> 3; i < imax; ++i) {
27880
28303
  this.writeCharacterEmpty(vertices, uvs, indices, i);
27881
28304
  }
27882
- this.width = result.width;
27883
- this.height = result.height;
28305
+ this.width = result.width * scale;
28306
+ this.height = result.height * scale;
28307
+ this.scale = scale;
28308
+ this.scaled = result.scaled;
27884
28309
  this.clipped = result.clipped;
27885
28310
  }
27886
28311
  else {
@@ -27889,22 +28314,24 @@
27889
28314
  }
27890
28315
  this.width = 0;
27891
28316
  this.height = 0;
28317
+ this.scale = 1;
28318
+ this.scaled = false;
27892
28319
  this.clipped = false;
27893
28320
  }
27894
28321
  vertexBuffer.update();
27895
28322
  uvBuffer.update();
27896
28323
  indexBuffer.update();
27897
28324
  };
27898
- DDynamicTextGeometry.prototype.writeCharacter = function (vertices, uvs, indices, index, x, y, character, width, height) {
28325
+ DDynamicTextGeometry.prototype.writeCharacter = function (vertices, uvs, indices, index, x, y, scale, character, width, height) {
27899
28326
  var cx = character.x;
27900
28327
  var cy = character.y;
27901
28328
  var cw = character.width;
27902
28329
  var ch = character.height;
27903
28330
  var cox = character.origin.x;
27904
- var x0 = x + (cx - cox);
27905
- var y0 = y;
27906
- var x1 = x0 + cw;
27907
- var y1 = y0 + ch;
28331
+ var x0 = (x + (cx - cox)) * scale;
28332
+ var y0 = y * scale;
28333
+ var x1 = x0 + cw * scale;
28334
+ var y1 = y0 + ch * scale;
27908
28335
  var iv = index << 3;
27909
28336
  vertices[iv + 0] = x0;
27910
28337
  vertices[iv + 1] = y0;
@@ -27971,7 +28398,7 @@
27971
28398
  */
27972
28399
  var DDynamicTextStyle = /** @class */ (function () {
27973
28400
  function DDynamicTextStyle(options, onChange) {
27974
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
28401
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
27975
28402
  this._id = 0;
27976
28403
  this._idApproved = -1;
27977
28404
  var defaultOptions = this.getDefaultOptions();
@@ -27984,8 +28411,9 @@
27984
28411
  this._fontWeight = (_f = options.fontWeight) !== null && _f !== void 0 ? _f : defaultOptions.fontWeight;
27985
28412
  this._fill = (_g = options.fill) !== null && _g !== void 0 ? _g : defaultOptions.fill;
27986
28413
  this._clipping = (_h = options.clipping) !== null && _h !== void 0 ? _h : defaultOptions.clipping;
27987
- this._wordWrap = toEnum((_j = options.wordWrap) !== null && _j !== void 0 ? _j : defaultOptions.wordWrap, DDynamicTextStyleWordWrap);
27988
- this._lineHeight = (_k = options.lineHeight) !== null && _k !== void 0 ? _k : defaultOptions.lineHeight;
28414
+ this._fitting = (_j = options.fitting) !== null && _j !== void 0 ? _j : defaultOptions.fitting;
28415
+ this._wordWrap = toEnum((_k = options.wordWrap) !== null && _k !== void 0 ? _k : defaultOptions.wordWrap, DDynamicTextStyleWordWrap);
28416
+ this._lineHeight = (_l = options.lineHeight) !== null && _l !== void 0 ? _l : defaultOptions.lineHeight;
27989
28417
  }
27990
28418
  else {
27991
28419
  this._align = defaultOptions.align;
@@ -27996,9 +28424,14 @@
27996
28424
  this._fontWeight = defaultOptions.fontWeight;
27997
28425
  this._fill = defaultOptions.fill;
27998
28426
  this._clipping = defaultOptions.clipping;
28427
+ this._fitting = defaultOptions.fitting;
27999
28428
  this._wordWrap = toEnum(defaultOptions.wordWrap, DDynamicTextStyleWordWrap);
28000
28429
  this._lineHeight = defaultOptions.lineHeight;
28001
28430
  }
28431
+ this._fontSizeFitted = this._fontSize;
28432
+ this._lineHeightFitted = this._lineHeight;
28433
+ this._isFontFitted = false;
28434
+ this._fontIdFontSize = this._fontSize;
28002
28435
  this._fontIdId = -1;
28003
28436
  this._fontId = "";
28004
28437
  this._fontIdApproved = "";
@@ -28024,6 +28457,7 @@
28024
28457
  fontWeight: "normal",
28025
28458
  fill: theme.getColor(new DBaseStateSetImpl()),
28026
28459
  clipping: true,
28460
+ fitting: false,
28027
28461
  wordWrap: DDynamicTextStyleWordWrap.NONE,
28028
28462
  lineHeight: theme.getLineHeight()
28029
28463
  };
@@ -28050,6 +28484,14 @@
28050
28484
  enumerable: false,
28051
28485
  configurable: true
28052
28486
  });
28487
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontIdFontSize", {
28488
+ get: function () {
28489
+ this.update();
28490
+ return this._fontSizeFitted;
28491
+ },
28492
+ enumerable: false,
28493
+ configurable: true
28494
+ });
28053
28495
  Object.defineProperty(DDynamicTextStyle.prototype, "fontIdApproved", {
28054
28496
  get: function () {
28055
28497
  return this._fontIdApproved;
@@ -28107,12 +28549,29 @@
28107
28549
  set: function (fontSize) {
28108
28550
  if (this._fontSize !== fontSize) {
28109
28551
  this._fontSize = fontSize;
28552
+ this._fontSizeFitted = fontSize;
28553
+ this._lineHeightFitted = this._lineHeight;
28554
+ this._isFontFitted = false;
28110
28555
  this.onChange();
28111
28556
  }
28112
28557
  },
28113
28558
  enumerable: false,
28114
28559
  configurable: true
28115
28560
  });
28561
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontSizeFitted", {
28562
+ get: function () {
28563
+ return this._fontSizeFitted;
28564
+ },
28565
+ enumerable: false,
28566
+ configurable: true
28567
+ });
28568
+ Object.defineProperty(DDynamicTextStyle.prototype, "isFontFitted", {
28569
+ get: function () {
28570
+ return this._isFontFitted;
28571
+ },
28572
+ enumerable: false,
28573
+ configurable: true
28574
+ });
28116
28575
  Object.defineProperty(DDynamicTextStyle.prototype, "fontStyle", {
28117
28576
  get: function () {
28118
28577
  return this._fontStyle;
@@ -28155,11 +28614,13 @@
28155
28614
  DDynamicTextStyle.prototype.update = function () {
28156
28615
  if (this._fontIdId !== this._id) {
28157
28616
  this._fontIdId = this._id;
28158
- this._fontId = this.newFontId();
28617
+ var fontIdFontSize = this._fitting ? this._fontSizeFitted : this._fontSize;
28618
+ this._fontIdFontSize = fontIdFontSize;
28619
+ this._fontId = this.toFontId(fontIdFontSize);
28159
28620
  }
28160
28621
  };
28161
- DDynamicTextStyle.prototype.newFontId = function () {
28162
- return "".concat(this._fontStyle, " ").concat(this._fontVariant, " ").concat(this._fontWeight, " ").concat(this._fontSize, "px ").concat(this._fontFamily);
28622
+ DDynamicTextStyle.prototype.toFontId = function (fontSize) {
28623
+ return "".concat(this._fontStyle, " ").concat(this._fontVariant, " ").concat(this._fontWeight, " ").concat(fontSize, "px ").concat(this._fontFamily);
28163
28624
  };
28164
28625
  Object.defineProperty(DDynamicTextStyle.prototype, "clipping", {
28165
28626
  get: function () {
@@ -28174,6 +28635,19 @@
28174
28635
  enumerable: false,
28175
28636
  configurable: true
28176
28637
  });
28638
+ Object.defineProperty(DDynamicTextStyle.prototype, "fitting", {
28639
+ get: function () {
28640
+ return this._fitting;
28641
+ },
28642
+ set: function (fitting) {
28643
+ if (this._fitting !== fitting) {
28644
+ this._fitting = fitting;
28645
+ this.onChange();
28646
+ }
28647
+ },
28648
+ enumerable: false,
28649
+ configurable: true
28650
+ });
28177
28651
  Object.defineProperty(DDynamicTextStyle.prototype, "wordWrap", {
28178
28652
  get: function () {
28179
28653
  return this._wordWrap;
@@ -28194,15 +28668,140 @@
28194
28668
  set: function (lineHeight) {
28195
28669
  if (this._lineHeight !== lineHeight) {
28196
28670
  this._lineHeight = lineHeight;
28671
+ this._fontSizeFitted = this._fontSize;
28672
+ this._lineHeightFitted = lineHeight;
28673
+ this._isFontFitted = false;
28674
+ this.onChange();
28675
+ }
28676
+ },
28677
+ enumerable: false,
28678
+ configurable: true
28679
+ });
28680
+ Object.defineProperty(DDynamicTextStyle.prototype, "lineHeightFitted", {
28681
+ get: function () {
28682
+ return this._lineHeightFitted;
28683
+ },
28684
+ set: function (lineHeightFitted) {
28685
+ if (this._lineHeightFitted !== lineHeightFitted) {
28686
+ this._lineHeightFitted = lineHeightFitted;
28197
28687
  this.onChange();
28198
28688
  }
28199
28689
  },
28200
28690
  enumerable: false,
28201
28691
  configurable: true
28202
28692
  });
28693
+ DDynamicTextStyle.prototype.fit = function (fontSize, lineHeight) {
28694
+ var isChanged = false;
28695
+ if (fontSize < this._fontSizeFitted) {
28696
+ this._fontSizeFitted = fontSize;
28697
+ isChanged = true;
28698
+ }
28699
+ if (this._lineHeightFitted !== lineHeight) {
28700
+ this._lineHeightFitted = lineHeight;
28701
+ isChanged = true;
28702
+ }
28703
+ if (this._isFontFitted !== true) {
28704
+ this._isFontFitted = true;
28705
+ isChanged = true;
28706
+ }
28707
+ if (isChanged) {
28708
+ this.onChange();
28709
+ }
28710
+ return isChanged;
28711
+ };
28712
+ DDynamicTextStyle.prototype.unfit = function () {
28713
+ var isChanged = false;
28714
+ if (this._isFontFitted !== false) {
28715
+ this._isFontFitted = false;
28716
+ isChanged = true;
28717
+ }
28718
+ if (this._fontSizeFitted !== this._fontSize) {
28719
+ this._fontSizeFitted = this._fontSize;
28720
+ isChanged = true;
28721
+ }
28722
+ if (this._lineHeightFitted !== this._lineHeight) {
28723
+ this._lineHeightFitted = this._lineHeight;
28724
+ isChanged = true;
28725
+ }
28726
+ if (isChanged) {
28727
+ this.onChange();
28728
+ }
28729
+ return isChanged;
28730
+ };
28203
28731
  return DDynamicTextStyle;
28204
28732
  }());
28205
28733
 
28734
+ /*
28735
+ * Copyright (C) 2019 Toshiba Corporation
28736
+ * SPDX-License-Identifier: Apache-2.0
28737
+ */
28738
+ var UtilFont = /** @class */ (function () {
28739
+ function UtilFont() {
28740
+ }
28741
+ UtilFont.measure = function (font) {
28742
+ var results = this._results;
28743
+ if (results == null) {
28744
+ results = new Map();
28745
+ this._results = results;
28746
+ }
28747
+ var result = results.get(font);
28748
+ if (result != null) {
28749
+ return result;
28750
+ }
28751
+ this.setup(font);
28752
+ var blockRect = this._block.getBoundingClientRect();
28753
+ var blockRectTop = blockRect.top;
28754
+ var spanRect = this._span.getBoundingClientRect();
28755
+ var ascent = blockRectTop - spanRect.top;
28756
+ var descent = spanRect.bottom - blockRectTop;
28757
+ result = {
28758
+ ascent: ascent,
28759
+ descent: descent
28760
+ };
28761
+ results.set(font, result);
28762
+ return result;
28763
+ };
28764
+ UtilFont.toSize = function (font) {
28765
+ this.setup(font);
28766
+ return parseFloat(window.getComputedStyle(this._span).fontSize);
28767
+ };
28768
+ UtilFont.setup = function (font) {
28769
+ var span = this._span;
28770
+ if (span == null) {
28771
+ span = document.createElement("span");
28772
+ span.innerText = "|ÉqÅ";
28773
+ span.style.border = "none";
28774
+ span.style.margin = "0px";
28775
+ this._span = span;
28776
+ }
28777
+ var block = this._block;
28778
+ if (block == null) {
28779
+ block = document.createElement("div");
28780
+ block.style.display = "inline-block";
28781
+ block.style.width = "0px";
28782
+ block.style.height = "0px";
28783
+ block.style.border = "none";
28784
+ block.style.margin = "0px";
28785
+ block.style.verticalAlign = "baseline";
28786
+ this._block = block;
28787
+ }
28788
+ var div = this._div;
28789
+ if (div == null) {
28790
+ div = document.createElement("div");
28791
+ div.style.position = "absolute";
28792
+ div.style.padding = "0px";
28793
+ div.style.margin = "0px";
28794
+ div.style.visibility = "hidden";
28795
+ div.appendChild(span);
28796
+ div.appendChild(block);
28797
+ document.body.appendChild(div);
28798
+ this._div = div;
28799
+ }
28800
+ span.style.font = font;
28801
+ };
28802
+ return UtilFont;
28803
+ }());
28804
+
28206
28805
  /*
28207
28806
  * Copyright (C) 2019 Toshiba Corporation
28208
28807
  * SPDX-License-Identifier: Apache-2.0
@@ -28225,8 +28824,9 @@
28225
28824
  _this._atlasRevisionUpdated = 0;
28226
28825
  _this._width = 0;
28227
28826
  _this._height = 0;
28228
- _this._clipping = {
28229
- enable: false,
28827
+ _this._modifier = {
28828
+ clipping: false,
28829
+ fitting: false,
28230
28830
  wordWrap: DDynamicTextStyleWordWrap.NONE,
28231
28831
  width: 0,
28232
28832
  height: 0,
@@ -28250,13 +28850,13 @@
28250
28850
  this._textApproved = text;
28251
28851
  var fontId = style.fontId;
28252
28852
  var fontIdApproved = style.fontIdApproved;
28253
- var fontSize = style.fontSize;
28853
+ var fontIdFontSize = style.fontIdFontSize;
28254
28854
  var fill = style.fill;
28255
28855
  var fillApproved = style.fillApproved;
28256
28856
  style.approve();
28257
28857
  var atlases = layer.getDynamicFontAtlases();
28258
28858
  if (text !== textApproved || fontId !== fontIdApproved || fill !== fillApproved) {
28259
- atlases.add(fontId, fontSize, fill, text);
28859
+ atlases.add(fontId, fontIdFontSize, fill, text);
28260
28860
  atlases.remove(fontIdApproved, fillApproved, textApproved);
28261
28861
  }
28262
28862
  }
@@ -28269,9 +28869,11 @@
28269
28869
  set: function (text) {
28270
28870
  if (this._text !== text) {
28271
28871
  this._text = text;
28272
- this._isDirty = true;
28273
- this._isGeometryDirty = true;
28274
- this.update_();
28872
+ if (!this._style.unfit()) {
28873
+ this._isDirty = true;
28874
+ this._isGeometryDirty = true;
28875
+ this.update_();
28876
+ }
28275
28877
  }
28276
28878
  },
28277
28879
  enumerable: false,
@@ -28326,13 +28928,14 @@
28326
28928
  configurable: true
28327
28929
  });
28328
28930
  DDynamicText.prototype.update = function () {
28931
+ var _this = this;
28329
28932
  this.update_();
28933
+ var style = this._style;
28330
28934
  var atlas = this._atlas;
28331
28935
  if (atlas == null) {
28332
28936
  var layer = DApplications.getLayer(this);
28333
28937
  if (layer) {
28334
- var style_1 = this._style;
28335
- atlas = layer.getDynamicFontAtlases().get(style_1.fontId, style_1.fill);
28938
+ atlas = layer.getDynamicFontAtlases().get(style.fontId, style.fill);
28336
28939
  if (atlas != null) {
28337
28940
  this._atlasRevisionUpdated = atlas.getRevisionUpdate();
28338
28941
  this._atlas = atlas;
@@ -28348,50 +28951,68 @@
28348
28951
  this._isGeometryDirty = true;
28349
28952
  }
28350
28953
  }
28351
- var style = this._style;
28352
- var clipping = this._clipping;
28353
- if (this.updateClipping(style, clipping)) {
28954
+ var modifier = this._modifier;
28955
+ if (this.updateClipping(style, modifier)) {
28354
28956
  this._isGeometryDirty = true;
28355
28957
  }
28356
28958
  if (this._isGeometryDirty) {
28357
28959
  this._isGeometryDirty = false;
28358
- this.geometry.update(this._text, atlas, clipping);
28960
+ var geometry = this.geometry;
28961
+ geometry.update(this._text, atlas, modifier);
28962
+ if (modifier.fitting && !style.isFontFitted && geometry.scaled) {
28963
+ var oldScale = geometry.scale;
28964
+ var oldFontSize = style.fontSize;
28965
+ var newFontId = style.toFontId(Math.ceil(oldFontSize * oldScale * 1000) / 1000);
28966
+ var newFontSize = UtilFont.toSize(newFontId);
28967
+ var newScale = newFontSize / oldFontSize;
28968
+ var newLineHeight = style.lineHeight * newScale;
28969
+ if (style.fit(newFontSize, newLineHeight)) {
28970
+ setTimeout(function () {
28971
+ DApplications.update(_this);
28972
+ }, 0);
28973
+ }
28974
+ }
28359
28975
  }
28360
28976
  };
28361
- DDynamicText.prototype.updateClipping = function (style, clipping) {
28977
+ DDynamicText.prototype.updateClipping = function (style, modifier) {
28362
28978
  var isChanged = false;
28363
28979
  var styleClipping = style.clipping;
28364
- if (clipping.enable !== styleClipping) {
28365
- clipping.enable = styleClipping;
28980
+ if (modifier.clipping !== styleClipping) {
28981
+ modifier.clipping = styleClipping;
28982
+ isChanged = true;
28983
+ }
28984
+ var styleFitting = style.fitting;
28985
+ if (modifier.fitting !== styleFitting) {
28986
+ modifier.fitting = styleFitting;
28366
28987
  isChanged = true;
28367
28988
  }
28368
28989
  var styleWordWrap = style.wordWrap;
28369
- if (clipping.wordWrap !== styleWordWrap) {
28370
- clipping.wordWrap = styleWordWrap;
28990
+ if (modifier.wordWrap !== styleWordWrap) {
28991
+ modifier.wordWrap = styleWordWrap;
28371
28992
  isChanged = true;
28372
28993
  }
28373
- var styleLineHeight = style.lineHeight;
28374
- if (clipping.lineHeight !== styleLineHeight) {
28375
- clipping.lineHeight = styleLineHeight;
28994
+ var styleLineHeight = styleFitting ? style.lineHeightFitted : style.lineHeight;
28995
+ if (modifier.lineHeight !== styleLineHeight) {
28996
+ modifier.lineHeight = styleLineHeight;
28376
28997
  isChanged = true;
28377
28998
  }
28378
- if (styleClipping || styleWordWrap) {
28999
+ if (styleClipping || styleFitting || styleWordWrap) {
28379
29000
  var parent_1 = this.parent;
28380
29001
  if (parent_1 instanceof DBase) {
28381
29002
  var width = parent_1.width -
28382
29003
  parent_1.padding.getLeft() -
28383
29004
  parent_1.padding.getRight() -
28384
- clipping.delta.width;
28385
- if (clipping.width !== width) {
28386
- clipping.width = width;
29005
+ modifier.delta.width;
29006
+ if (modifier.width !== width) {
29007
+ modifier.width = width;
28387
29008
  isChanged = true;
28388
29009
  }
28389
29010
  var height = parent_1.height -
28390
29011
  parent_1.padding.getTop() -
28391
29012
  parent_1.padding.getBottom() -
28392
- clipping.delta.height;
28393
- if (clipping.height !== height) {
28394
- clipping.height = height;
29013
+ modifier.delta.height;
29014
+ if (modifier.height !== height) {
29015
+ modifier.height = height;
28395
29016
  isChanged = true;
28396
29017
  }
28397
29018
  }
@@ -28399,7 +29020,7 @@
28399
29020
  return isChanged;
28400
29021
  };
28401
29022
  DDynamicText.prototype.setClippingDelta = function (width, height) {
28402
- var delta = this._clipping.delta;
29023
+ var delta = this._modifier.delta;
28403
29024
  delta.width = width;
28404
29025
  delta.height = height;
28405
29026
  };
@@ -28419,7 +29040,7 @@
28419
29040
  * SPDX-License-Identifier: Apache-2.0
28420
29041
  */
28421
29042
  var toTextStyle = function (theme, options, state) {
28422
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
29043
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
28423
29044
  var style = (_a = options === null || options === void 0 ? void 0 : options.text) === null || _a === void 0 ? void 0 : _a.style;
28424
29045
  if (style != null) {
28425
29046
  var fill = (_b = style.fill) !== null && _b !== void 0 ? _b : theme.getColor(state);
@@ -28429,8 +29050,9 @@
28429
29050
  var fontStyle = (_f = style.fontStyle) !== null && _f !== void 0 ? _f : theme.getFontStyle();
28430
29051
  var fontVariant = (_g = style.fontVariant) !== null && _g !== void 0 ? _g : theme.getFontVariant();
28431
29052
  var clipping = (_h = style.clipping) !== null && _h !== void 0 ? _h : theme.getTextStyleClipping();
28432
- var wordWrap = (_j = style.wordWrap) !== null && _j !== void 0 ? _j : theme.getTextStyleWordWrap();
28433
- var lineHeight = (_k = style.lineHeight) !== null && _k !== void 0 ? _k : theme.getLineHeight();
29053
+ var fitting = (_j = style.fitting) !== null && _j !== void 0 ? _j : theme.getTextStyleFitting();
29054
+ var wordWrap = (_k = style.wordWrap) !== null && _k !== void 0 ? _k : theme.getTextStyleWordWrap();
29055
+ var lineHeight = (_l = style.lineHeight) !== null && _l !== void 0 ? _l : theme.getLineHeight();
28434
29056
  return {
28435
29057
  fill: fill,
28436
29058
  fontSize: fontSize,
@@ -28439,6 +29061,7 @@
28439
29061
  fontStyle: fontStyle,
28440
29062
  fontVariant: fontVariant,
28441
29063
  clipping: clipping,
29064
+ fitting: fitting,
28442
29065
  wordWrap: wordWrap,
28443
29066
  lineHeight: lineHeight
28444
29067
  };
@@ -28451,6 +29074,7 @@
28451
29074
  fontStyle: theme.getFontStyle(),
28452
29075
  fontVariant: theme.getFontVariant(),
28453
29076
  clipping: theme.getTextStyleClipping(),
29077
+ fitting: theme.getTextStyleFitting(),
28454
29078
  wordWrap: theme.getTextStyleWordWrap(),
28455
29079
  lineHeight: theme.getLineHeight()
28456
29080
  };
@@ -43006,11 +43630,27 @@
43006
43630
  options.state = [state, DBaseState.NEW_WINDOW];
43007
43631
  }
43008
43632
  }
43009
- else {
43633
+ else if (isArray(state)) {
43010
43634
  if (state.indexOf(DBaseState.NEW_WINDOW) < 0) {
43011
43635
  state.push(DBaseState.NEW_WINDOW);
43012
43636
  }
43013
43637
  }
43638
+ else {
43639
+ var values = state.values;
43640
+ if (values == null) {
43641
+ state.values = DBaseState.NEW_WINDOW;
43642
+ }
43643
+ else if (isString(values)) {
43644
+ if (values !== DBaseState.NEW_WINDOW) {
43645
+ state.values = [values, DBaseState.NEW_WINDOW];
43646
+ }
43647
+ }
43648
+ else {
43649
+ if (values.indexOf(DBaseState.NEW_WINDOW) < 0) {
43650
+ values.push(DBaseState.NEW_WINDOW);
43651
+ }
43652
+ }
43653
+ }
43014
43654
  }
43015
43655
  }
43016
43656
  return options;
@@ -45556,70 +46196,6 @@
45556
46196
  return DynamicAtlasItemText;
45557
46197
  }(DynamicAtlasItem));
45558
46198
 
45559
- /*
45560
- * Copyright (C) 2019 Toshiba Corporation
45561
- * SPDX-License-Identifier: Apache-2.0
45562
- */
45563
- var UtilFont = /** @class */ (function () {
45564
- function UtilFont() {
45565
- }
45566
- UtilFont.measure = function (font) {
45567
- var results = this._results;
45568
- if (results == null) {
45569
- results = new Map();
45570
- this._results = results;
45571
- }
45572
- var result = results.get(font);
45573
- if (result != null) {
45574
- return result;
45575
- }
45576
- var span = this._span;
45577
- if (span == null) {
45578
- span = document.createElement("span");
45579
- span.innerText = "|ÉqÅ";
45580
- span.style.border = "none";
45581
- span.style.margin = "0px";
45582
- this._span = span;
45583
- }
45584
- var block = this._block;
45585
- if (block == null) {
45586
- block = document.createElement("div");
45587
- block.style.display = "inline-block";
45588
- block.style.width = "0px";
45589
- block.style.height = "0px";
45590
- block.style.border = "none";
45591
- block.style.margin = "0px";
45592
- block.style.verticalAlign = "baseline";
45593
- this._block = block;
45594
- }
45595
- var div = this._div;
45596
- if (div == null) {
45597
- div = document.createElement("div");
45598
- div.style.position = "absolute";
45599
- div.style.padding = "0px";
45600
- div.style.margin = "0px";
45601
- div.style.visibility = "hidden";
45602
- div.appendChild(span);
45603
- div.appendChild(block);
45604
- document.body.appendChild(div);
45605
- this._div = div;
45606
- }
45607
- span.style.font = font;
45608
- var blockRect = block.getBoundingClientRect();
45609
- var blockRectTop = blockRect.top;
45610
- var spanRect = span.getBoundingClientRect();
45611
- var ascent = blockRectTop - spanRect.top;
45612
- var descent = spanRect.bottom - blockRectTop;
45613
- result = {
45614
- ascent: ascent,
45615
- descent: descent
45616
- };
45617
- results.set(font, result);
45618
- return result;
45619
- };
45620
- return UtilFont;
45621
- }());
45622
-
45623
46199
  /*
45624
46200
  * Copyright (C) 2019 Toshiba Corporation
45625
46201
  * SPDX-License-Identifier: Apache-2.0
@@ -54386,6 +54962,80 @@
54386
54962
  return DChartAxisBaseBar;
54387
54963
  }());
54388
54964
 
54965
+ var DChartAxisBaseGuideContainer = /** @class */ (function () {
54966
+ function DChartAxisBaseGuideContainer(axis) {
54967
+ this._axis = axis;
54968
+ this._index = 0;
54969
+ this._list = [];
54970
+ }
54971
+ DChartAxisBaseGuideContainer.prototype.add = function (guide) {
54972
+ this._list.push(guide);
54973
+ var container = this._container;
54974
+ var index = this._index;
54975
+ if (container != null) {
54976
+ guide.bind(container, index, this._axis);
54977
+ }
54978
+ return this;
54979
+ };
54980
+ DChartAxisBaseGuideContainer.prototype.get = function (index) {
54981
+ var list = this._list;
54982
+ if (0 <= index && index < list.length) {
54983
+ return list[index];
54984
+ }
54985
+ return null;
54986
+ };
54987
+ DChartAxisBaseGuideContainer.prototype.indexOf = function (guide) {
54988
+ return this._list.indexOf(guide);
54989
+ };
54990
+ DChartAxisBaseGuideContainer.prototype.clear = function () {
54991
+ var list = this._list;
54992
+ for (var i = 0, imax = list.length; i < imax; ++i) {
54993
+ list[i].destroy();
54994
+ }
54995
+ list.length = 0;
54996
+ return this;
54997
+ };
54998
+ DChartAxisBaseGuideContainer.prototype.size = function () {
54999
+ return this._list.length;
55000
+ };
55001
+ DChartAxisBaseGuideContainer.prototype.bind = function (container, index) {
55002
+ this._container = container;
55003
+ this._index = index;
55004
+ var axis = this._axis;
55005
+ var list = this._list;
55006
+ for (var i = 0, imax = list.length; i < imax; ++i) {
55007
+ list[i].bind(container, index, axis);
55008
+ }
55009
+ };
55010
+ DChartAxisBaseGuideContainer.prototype.unbind = function () {
55011
+ var list = this._list;
55012
+ for (var i = 0, imax = list.length; i < imax; ++i) {
55013
+ list[i].unbind();
55014
+ }
55015
+ this._index = 0;
55016
+ this._container = undefined;
55017
+ };
55018
+ DChartAxisBaseGuideContainer.prototype.update = function () {
55019
+ var isUpdated = false;
55020
+ var list = this._list;
55021
+ for (var i = 0, imax = list.length; i < imax; ++i) {
55022
+ if (list[i].update()) {
55023
+ isUpdated = true;
55024
+ }
55025
+ }
55026
+ return isUpdated;
55027
+ };
55028
+ DChartAxisBaseGuideContainer.prototype.destroy = function () {
55029
+ var list = this._list;
55030
+ for (var i = 0, imax = list.length; i < imax; ++i) {
55031
+ list[i].destroy();
55032
+ }
55033
+ this._index = 0;
55034
+ this._container = undefined;
55035
+ };
55036
+ return DChartAxisBaseGuideContainer;
55037
+ }());
55038
+
54389
55039
  /*
54390
55040
  * Copyright (C) 2019 Toshiba Corporation
54391
55041
  * SPDX-License-Identifier: Apache-2.0
@@ -54408,6 +55058,7 @@
54408
55058
  this.label = this.toLabel(theme, options);
54409
55059
  this.padding = (_b = options === null || options === void 0 ? void 0 : options.padding) !== null && _b !== void 0 ? _b : theme.getPadding();
54410
55060
  this.bar = this.toBar(theme, options);
55061
+ this.guide = this.toGuide(theme, options);
54411
55062
  }
54412
55063
  DChartAxisBaseOptionParser.prototype.toPosition = function (theme, options) {
54413
55064
  var position = options === null || options === void 0 ? void 0 : options.position;
@@ -54419,6 +55070,12 @@
54419
55070
  }
54420
55071
  return theme.getPosition();
54421
55072
  };
55073
+ DChartAxisBaseOptionParser.prototype.toGuide = function (theme, options) {
55074
+ var _a, _b;
55075
+ return {
55076
+ list: (_b = (_a = options === null || options === void 0 ? void 0 : options.guide) === null || _a === void 0 ? void 0 : _a.list) !== null && _b !== void 0 ? _b : []
55077
+ };
55078
+ };
54422
55079
  DChartAxisBaseOptionParser.prototype.toBar = function (theme, options) {
54423
55080
  var _a;
54424
55081
  return {
@@ -55400,6 +56057,7 @@
55400
56057
  this._index = 0;
55401
56058
  this._bar = this.newBar(parser, theme, options);
55402
56059
  this._tick = this.newTick(parser, theme, options);
56060
+ this._guide = this.newGuide(parser, theme, options);
55403
56061
  }
55404
56062
  DChartAxisBase.prototype.newParser = function (theme, options) {
55405
56063
  return new DChartAxisBaseOptionParser(theme, options);
@@ -55454,13 +56112,30 @@
55454
56112
  DChartAxisBase.prototype.newTick = function (parser, theme, options) {
55455
56113
  return new DChartAxisBaseTickContainer(parser);
55456
56114
  };
56115
+ Object.defineProperty(DChartAxisBase.prototype, "guide", {
56116
+ get: function () {
56117
+ return this._guide;
56118
+ },
56119
+ enumerable: false,
56120
+ configurable: true
56121
+ });
56122
+ DChartAxisBase.prototype.newGuide = function (parser, theme, options) {
56123
+ var result = new DChartAxisBaseGuideContainer(this);
56124
+ var list = parser.guide.list;
56125
+ for (var i = 0, imax = list.length; i < imax; ++i) {
56126
+ result.add(list[i]);
56127
+ }
56128
+ return result;
56129
+ };
55457
56130
  DChartAxisBase.prototype.bind = function (container, index) {
55458
56131
  this._container = container;
55459
56132
  this._index = index;
55460
56133
  this._bar.bind(container, index);
55461
56134
  this._tick.bind(container, index);
56135
+ this._guide.bind(container, index);
55462
56136
  };
55463
56137
  DChartAxisBase.prototype.unbind = function () {
56138
+ this._guide.unbind();
55464
56139
  this._tick.unbind();
55465
56140
  this._bar.unbind();
55466
56141
  this._index = 0;
@@ -55469,7 +56144,8 @@
55469
56144
  DChartAxisBase.prototype.update = function () {
55470
56145
  var isBarUpdated = this._bar.update();
55471
56146
  var isTicksUpdated = this._tick.update();
55472
- if (isBarUpdated || isTicksUpdated) {
56147
+ var isGuideUpdated = this._guide.update();
56148
+ if (isBarUpdated || isTicksUpdated || isGuideUpdated) {
55473
56149
  var container = this._container;
55474
56150
  if (container) {
55475
56151
  DApplications.update(container.plotArea);
@@ -55479,10 +56155,12 @@
55479
56155
  DChartAxisBase.prototype.onRender = function () {
55480
56156
  this._bar.update();
55481
56157
  this._tick.update();
56158
+ this._guide.update();
55482
56159
  };
55483
56160
  DChartAxisBase.prototype.destroy = function () {
55484
56161
  this._bar.destroy();
55485
56162
  this._tick.destroy();
56163
+ this._guide.destroy();
55486
56164
  this._container = undefined;
55487
56165
  };
55488
56166
  DChartAxisBase.prototype.toTheme = function (options) {
@@ -55594,6 +56272,441 @@
55594
56272
  return DChartAxisContainerImpl;
55595
56273
  }());
55596
56274
 
56275
+ var DChartAxisGuideSimpleShapeImpl = /** @class */ (function () {
56276
+ function DChartAxisGuideSimpleShapeImpl(options) {
56277
+ this._options = options;
56278
+ }
56279
+ Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "bar", {
56280
+ get: function () {
56281
+ var result = this._bar;
56282
+ if (result === undefined) {
56283
+ result = this.newBar();
56284
+ this._bar = result;
56285
+ }
56286
+ return result;
56287
+ },
56288
+ enumerable: false,
56289
+ configurable: true
56290
+ });
56291
+ DChartAxisGuideSimpleShapeImpl.prototype.newBar = function () {
56292
+ var _a, _b;
56293
+ var bar = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.bar) !== null && _b !== void 0 ? _b : {};
56294
+ if (bar.enable !== false) {
56295
+ var result = new EShapeBar();
56296
+ result.stroke.copy(this.toStrokeOptions(bar.stroke, EShapeStrokeStyle.DASHED));
56297
+ result.text.copy(this.toTextOptions(bar.text));
56298
+ return result;
56299
+ }
56300
+ return null;
56301
+ };
56302
+ DChartAxisGuideSimpleShapeImpl.prototype.toStrokeOptions = function (options, style) {
56303
+ var _a;
56304
+ options = options || {};
56305
+ return {
56306
+ enable: options.enable,
56307
+ color: options.color,
56308
+ alpha: options.alpha,
56309
+ width: options.width,
56310
+ align: options.align,
56311
+ side: toEnum(options.side, EShapeStrokeSide),
56312
+ style: toEnum((_a = options.style) !== null && _a !== void 0 ? _a : style, EShapeStrokeStyle)
56313
+ };
56314
+ };
56315
+ DChartAxisGuideSimpleShapeImpl.prototype.toTextOptions = function (options) {
56316
+ options = options || {};
56317
+ return {
56318
+ value: options.value,
56319
+ color: options.color,
56320
+ alpha: options.alpha,
56321
+ family: options.family,
56322
+ size: options.size,
56323
+ weight: toEnum(options.weight, EShapeTextWeight),
56324
+ align: this.toTextAlignOptions(options.align),
56325
+ offset: options.offset,
56326
+ style: toEnum(options.style, EShapeTextStyle),
56327
+ outline: options.outline,
56328
+ spacing: options.spacing,
56329
+ direction: toEnum(options.direction, EShapeTextDirection),
56330
+ padding: options.padding,
56331
+ clipping: options.clipping,
56332
+ fitting: options.fitting
56333
+ };
56334
+ };
56335
+ DChartAxisGuideSimpleShapeImpl.prototype.toTextAlignOptions = function (options) {
56336
+ options = options || {};
56337
+ return {
56338
+ horizontal: toEnum(options === null || options === void 0 ? void 0 : options.horizontal, EShapeTextAlignHorizontal),
56339
+ vertical: toEnum(options === null || options === void 0 ? void 0 : options.vertical, EShapeTextAlignVertical)
56340
+ };
56341
+ };
56342
+ DChartAxisGuideSimpleShapeImpl.prototype.toBarPosition = function (axis) {
56343
+ switch (axis.position) {
56344
+ case DChartAxisPosition.LEFT:
56345
+ case DChartAxisPosition.RIGHT:
56346
+ return EShapeBarPosition.LEFT;
56347
+ default:
56348
+ return EShapeBarPosition.TOP;
56349
+ }
56350
+ };
56351
+ Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "label", {
56352
+ get: function () {
56353
+ var result = this._label;
56354
+ if (result === undefined) {
56355
+ result = this.newLabel();
56356
+ this._label = result;
56357
+ }
56358
+ return result;
56359
+ },
56360
+ enumerable: false,
56361
+ configurable: true
56362
+ });
56363
+ DChartAxisGuideSimpleShapeImpl.prototype.newLabel = function () {
56364
+ var _a, _b, _c, _d;
56365
+ var label = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : {};
56366
+ if (label.enable === true) {
56367
+ var result = new EShapeRectangleRounded();
56368
+ result.stroke.copy(this.toStrokeOptions(label.stroke));
56369
+ result.fill.copy(label.fill);
56370
+ result.text.copy(this.toTextOptions(label.text));
56371
+ result.size.set((_c = label.width) !== null && _c !== void 0 ? _c : 50, (_d = label.height) !== null && _d !== void 0 ? _d : 30);
56372
+ return result;
56373
+ }
56374
+ return null;
56375
+ };
56376
+ Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "labelMargin", {
56377
+ get: function () {
56378
+ var result = this._labelMargin;
56379
+ if (result == null) {
56380
+ result = this.newLabelMargin();
56381
+ this._labelMargin = result;
56382
+ }
56383
+ return result;
56384
+ },
56385
+ enumerable: false,
56386
+ configurable: true
56387
+ });
56388
+ DChartAxisGuideSimpleShapeImpl.prototype.newLabelMargin = function () {
56389
+ var options = this._options;
56390
+ if (options != null) {
56391
+ var label = options.label;
56392
+ if (label != null) {
56393
+ var result = label.margin;
56394
+ if (result != null) {
56395
+ return result;
56396
+ }
56397
+ }
56398
+ }
56399
+ return 10;
56400
+ };
56401
+ Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "tick", {
56402
+ get: function () {
56403
+ var result = this._tick;
56404
+ if (result === undefined) {
56405
+ result = this.newTick();
56406
+ this._tick = result;
56407
+ }
56408
+ return result;
56409
+ },
56410
+ enumerable: false,
56411
+ configurable: true
56412
+ });
56413
+ DChartAxisGuideSimpleShapeImpl.prototype.newTick = function () {
56414
+ var _a, _b, _c;
56415
+ var tick = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.tick) !== null && _b !== void 0 ? _b : {};
56416
+ if (tick.enable === true) {
56417
+ var result = new EShapeBar();
56418
+ result.stroke.copy(this.toStrokeOptions(tick.stroke));
56419
+ result.text.copy(this.toTextOptions(tick.text));
56420
+ var size = (_c = tick.size) !== null && _c !== void 0 ? _c : 5;
56421
+ result.size.set(size, size);
56422
+ return result;
56423
+ }
56424
+ return null;
56425
+ };
56426
+ Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "tickMargin", {
56427
+ get: function () {
56428
+ var result = this._tickMargin;
56429
+ if (result == null) {
56430
+ result = this.newTickMargin();
56431
+ this._tickMargin = result;
56432
+ }
56433
+ return result;
56434
+ },
56435
+ enumerable: false,
56436
+ configurable: true
56437
+ });
56438
+ DChartAxisGuideSimpleShapeImpl.prototype.newTickMargin = function () {
56439
+ var options = this._options;
56440
+ if (options != null) {
56441
+ var tick = options.tick;
56442
+ if (tick != null) {
56443
+ var result = tick.margin;
56444
+ if (result != null) {
56445
+ return result;
56446
+ }
56447
+ }
56448
+ }
56449
+ return 0;
56450
+ };
56451
+ DChartAxisGuideSimpleShapeImpl.prototype.toTickPosition = function (axis) {
56452
+ switch (axis.position) {
56453
+ case DChartAxisPosition.LEFT:
56454
+ case DChartAxisPosition.RIGHT:
56455
+ return EShapeBarPosition.LEFT;
56456
+ default:
56457
+ return EShapeBarPosition.TOP;
56458
+ }
56459
+ };
56460
+ DChartAxisGuideSimpleShapeImpl.prototype.bind = function (container, index, axis) {
56461
+ var bar = this.bar;
56462
+ if (bar != null) {
56463
+ bar.points.position = this.toBarPosition(axis);
56464
+ bar.attach(container.container);
56465
+ }
56466
+ var label = this.label;
56467
+ if (label != null) {
56468
+ label.attach(container.container);
56469
+ }
56470
+ var tick = this.tick;
56471
+ if (tick != null) {
56472
+ tick.points.position = this.toTickPosition(axis);
56473
+ tick.attach(container.container);
56474
+ }
56475
+ };
56476
+ DChartAxisGuideSimpleShapeImpl.prototype.unbind = function () {
56477
+ var bar = this._bar;
56478
+ if (bar != null) {
56479
+ bar.detach();
56480
+ }
56481
+ var label = this._label;
56482
+ if (label != null) {
56483
+ label.detach();
56484
+ }
56485
+ var tick = this._tick;
56486
+ if (tick != null) {
56487
+ tick.detach();
56488
+ }
56489
+ };
56490
+ DChartAxisGuideSimpleShapeImpl.prototype.update = function (position, x, y, visible, width, height, offset) {
56491
+ var bar = this._bar;
56492
+ if (bar != null) {
56493
+ bar.disallowUploadedUpdate();
56494
+ switch (position) {
56495
+ case DChartAxisPosition.TOP:
56496
+ bar.transform.position.set(x, y);
56497
+ bar.size.set(0, height);
56498
+ bar.visible = visible;
56499
+ break;
56500
+ case DChartAxisPosition.BOTTOM:
56501
+ bar.transform.position.set(x, y);
56502
+ bar.size.set(0, height);
56503
+ bar.visible = visible;
56504
+ break;
56505
+ case DChartAxisPosition.LEFT:
56506
+ bar.transform.position.set(x, y);
56507
+ bar.size.set(width, 0);
56508
+ bar.visible = visible;
56509
+ break;
56510
+ case DChartAxisPosition.RIGHT:
56511
+ bar.transform.position.set(x, y);
56512
+ bar.size.set(width, 0);
56513
+ bar.visible = visible;
56514
+ break;
56515
+ }
56516
+ bar.allowUploadedUpdate();
56517
+ }
56518
+ var label = this._label;
56519
+ if (label != null) {
56520
+ var m = this.labelMargin;
56521
+ var s = label.size;
56522
+ var ox = offset + s.x * 0.5 + m;
56523
+ var oy = offset + s.y * 0.5 + m;
56524
+ label.disallowUploadedUpdate();
56525
+ switch (position) {
56526
+ case DChartAxisPosition.TOP:
56527
+ label.transform.position.set(x, -oy);
56528
+ label.visible = visible;
56529
+ break;
56530
+ case DChartAxisPosition.BOTTOM:
56531
+ label.transform.position.set(x, height + oy);
56532
+ label.visible = visible;
56533
+ break;
56534
+ case DChartAxisPosition.LEFT:
56535
+ label.transform.position.set(-ox, y);
56536
+ label.visible = visible;
56537
+ break;
56538
+ case DChartAxisPosition.RIGHT:
56539
+ label.transform.position.set(width + ox, y);
56540
+ label.visible = visible;
56541
+ break;
56542
+ }
56543
+ label.allowUploadedUpdate();
56544
+ }
56545
+ var tick = this._tick;
56546
+ if (tick != null) {
56547
+ var m = this.tickMargin;
56548
+ var s = tick.size;
56549
+ var ox = offset + s.x * 0.5 + m;
56550
+ var oy = offset + s.y * 0.5 + m;
56551
+ tick.disallowUploadedUpdate();
56552
+ switch (position) {
56553
+ case DChartAxisPosition.TOP:
56554
+ tick.transform.position.set(x, -oy);
56555
+ tick.visible = visible;
56556
+ break;
56557
+ case DChartAxisPosition.BOTTOM:
56558
+ tick.transform.position.set(x, height + oy);
56559
+ tick.visible = visible;
56560
+ break;
56561
+ case DChartAxisPosition.LEFT:
56562
+ tick.transform.position.set(-ox, y);
56563
+ tick.visible = visible;
56564
+ break;
56565
+ case DChartAxisPosition.RIGHT:
56566
+ tick.transform.position.set(width + ox, y);
56567
+ tick.visible = visible;
56568
+ break;
56569
+ }
56570
+ tick.allowUploadedUpdate();
56571
+ }
56572
+ return true;
56573
+ };
56574
+ DChartAxisGuideSimpleShapeImpl.prototype.destroy = function () {
56575
+ var bar = this._bar;
56576
+ if (bar != null) {
56577
+ bar.destroy();
56578
+ }
56579
+ var label = this._label;
56580
+ if (label != null) {
56581
+ label.destroy();
56582
+ }
56583
+ var tick = this._tick;
56584
+ if (tick != null) {
56585
+ tick.destroy();
56586
+ }
56587
+ };
56588
+ return DChartAxisGuideSimpleShapeImpl;
56589
+ }());
56590
+
56591
+ var DChartAxisGuideSimple = /** @class */ (function () {
56592
+ function DChartAxisGuideSimple(options) {
56593
+ var _a;
56594
+ this._options = options;
56595
+ this._index = 0;
56596
+ this._position = (_a = options === null || options === void 0 ? void 0 : options.position) !== null && _a !== void 0 ? _a : 0;
56597
+ this._work = new pixi_js.Point();
56598
+ this._isShown = true;
56599
+ }
56600
+ Object.defineProperty(DChartAxisGuideSimple.prototype, "shape", {
56601
+ get: function () {
56602
+ var result = this._shape;
56603
+ if (result == null) {
56604
+ result = this.newShape();
56605
+ this._shape = result;
56606
+ }
56607
+ return result;
56608
+ },
56609
+ enumerable: false,
56610
+ configurable: true
56611
+ });
56612
+ DChartAxisGuideSimple.prototype.newShape = function () {
56613
+ return new DChartAxisGuideSimpleShapeImpl(this._options);
56614
+ };
56615
+ Object.defineProperty(DChartAxisGuideSimple.prototype, "position", {
56616
+ get: function () {
56617
+ return this._position;
56618
+ },
56619
+ set: function (position) {
56620
+ this._position = position;
56621
+ },
56622
+ enumerable: false,
56623
+ configurable: true
56624
+ });
56625
+ DChartAxisGuideSimple.prototype.show = function () {
56626
+ this._isShown = true;
56627
+ return this;
56628
+ };
56629
+ DChartAxisGuideSimple.prototype.isShown = function () {
56630
+ return this._isShown;
56631
+ };
56632
+ DChartAxisGuideSimple.prototype.hide = function () {
56633
+ this._isShown = false;
56634
+ return this;
56635
+ };
56636
+ DChartAxisGuideSimple.prototype.isHidden = function () {
56637
+ return !this._isShown;
56638
+ };
56639
+ DChartAxisGuideSimple.prototype.bind = function (container, index, axis) {
56640
+ this._container = container;
56641
+ this._index = index;
56642
+ this._axis = axis;
56643
+ this.shape.bind(container, index, axis);
56644
+ };
56645
+ DChartAxisGuideSimple.prototype.unbind = function () {
56646
+ var shape = this._shape;
56647
+ if (shape != null) {
56648
+ shape.unbind();
56649
+ }
56650
+ this._axis = undefined;
56651
+ this._index = 0;
56652
+ this._container = undefined;
56653
+ };
56654
+ DChartAxisGuideSimple.prototype.update = function () {
56655
+ var container = this._container;
56656
+ var index = this._index;
56657
+ var shape = this._shape;
56658
+ var axis = this._axis;
56659
+ if (shape != null && container != null && axis != null) {
56660
+ var plotArea = container.plotArea;
56661
+ var transform = plotArea.container.transform.localTransform;
56662
+ var plotAreaWidth = plotArea.width;
56663
+ var plotAreaHeight = plotArea.height;
56664
+ var offset = axis.padding * index;
56665
+ switch (axis.position) {
56666
+ case DChartAxisPosition.TOP:
56667
+ case DChartAxisPosition.BOTTOM:
56668
+ var coordinateX = plotArea.coordinate.x.get(axis.coordinate);
56669
+ if (coordinateX) {
56670
+ var work = this._work;
56671
+ work.set(coordinateX.transform.map(coordinateX.map(this._position)), 0);
56672
+ transform.apply(work, work);
56673
+ var x = work.x;
56674
+ shape.update(axis.position, x, plotAreaHeight * 0.5, this._isShown && 0 <= x && x <= plotAreaWidth, plotAreaWidth, plotAreaHeight, offset);
56675
+ }
56676
+ else {
56677
+ shape.update(axis.position, 0, plotAreaHeight * 0.5, false, plotAreaWidth, plotAreaHeight, offset);
56678
+ }
56679
+ break;
56680
+ case DChartAxisPosition.LEFT:
56681
+ case DChartAxisPosition.RIGHT:
56682
+ var coordinateY = plotArea.coordinate.y.get(axis.coordinate);
56683
+ if (coordinateY) {
56684
+ var work = this._work;
56685
+ work.set(0, coordinateY.transform.map(coordinateY.map(this._position)));
56686
+ transform.apply(work, work);
56687
+ var y = work.y;
56688
+ shape.update(axis.position, plotAreaWidth * 0.5, y, this._isShown && 0 <= y && y <= plotAreaHeight, plotAreaWidth, plotAreaHeight, offset);
56689
+ }
56690
+ else {
56691
+ shape.update(axis.position, plotAreaWidth * 0.5, 0, false, plotAreaWidth, plotAreaHeight, offset);
56692
+ }
56693
+ break;
56694
+ }
56695
+ return true;
56696
+ }
56697
+ return false;
56698
+ };
56699
+ DChartAxisGuideSimple.prototype.destroy = function () {
56700
+ var shape = this._shape;
56701
+ if (shape != null) {
56702
+ shape.destroy();
56703
+ }
56704
+ this._index = 0;
56705
+ this._container = undefined;
56706
+ };
56707
+ return DChartAxisGuideSimple;
56708
+ }());
56709
+
55597
56710
  /*
55598
56711
  * Copyright (C) 2019 Toshiba Corporation
55599
56712
  * SPDX-License-Identifier: Apache-2.0
@@ -73810,6 +74923,7 @@
73810
74923
  EShapeBufferUnit: EShapeBufferUnit,
73811
74924
  EShapeBuffer: EShapeBuffer,
73812
74925
  EShapeCapabilities: EShapeCapabilities,
74926
+ EShapeCapabilityContainerImpl: EShapeCapabilityContainerImpl,
73813
74927
  EShapeCapability: EShapeCapability,
73814
74928
  EShapeConnectorBodies: EShapeConnectorBodies,
73815
74929
  EShapeConnectorBodyImpl: EShapeConnectorBodyImpl,
@@ -74024,8 +75138,14 @@
74024
75138
  DBaseReflowableContainer: DBaseReflowableContainer,
74025
75139
  DBaseReflowableImpl: DBaseReflowableImpl,
74026
75140
  DBaseSnippetContainer: DBaseSnippetContainer,
75141
+ DBaseStateSetBlinkerDatumImpl: DBaseStateSetBlinkerDatumImpl,
75142
+ DBaseStateSetBlinkerImpl: DBaseStateSetBlinkerImpl,
74027
75143
  DBaseStateSetImplObservable: DBaseStateSetImplObservable,
74028
75144
  DBaseStateSetImpl: DBaseStateSetImpl,
75145
+ DBaseStateSetSubDatumImp: DBaseStateSetSubDatumImp,
75146
+ DBaseStateSetSubImpl: DBaseStateSetSubImpl,
75147
+ DBaseStateSetTickerDatumImpl: DBaseStateSetTickerDatumImpl,
75148
+ DBaseStateSetTickerImpl: DBaseStateSetTickerImpl,
74029
75149
  DBaseState: DBaseState,
74030
75150
  DBase: DBase,
74031
75151
  DBoard: DBoard,
@@ -74056,6 +75176,7 @@
74056
75176
  DCanvasContainer: DCanvasContainer,
74057
75177
  DCanvas: DCanvas,
74058
75178
  DChartAxisBaseBar: DChartAxisBaseBar,
75179
+ DChartAxisBaseGuideContainer: DChartAxisBaseGuideContainer,
74059
75180
  DChartAxisBaseOptionParser: DChartAxisBaseOptionParser,
74060
75181
  DChartAxisBaseTickContainer: DChartAxisBaseTickContainer,
74061
75182
  DChartAxisBaseTickMajorGridline: DChartAxisBaseTickMajorGridline,
@@ -74063,6 +75184,8 @@
74063
75184
  DChartAxisBaseTickMinor: DChartAxisBaseTickMinor,
74064
75185
  DChartAxisBase: DChartAxisBase,
74065
75186
  DChartAxisContainerImpl: DChartAxisContainerImpl,
75187
+ DChartAxisGuideSimpleShapeImpl: DChartAxisGuideSimpleShapeImpl,
75188
+ DChartAxisGuideSimple: DChartAxisGuideSimple,
74066
75189
  DChartAxisPosition: DChartAxisPosition,
74067
75190
  DChartAxisTickPosition: DChartAxisTickPosition,
74068
75191
  DChartAxisXDatetime: DChartAxisXDatetime,