@wcardinal/wcardinal-ui 0.309.0 → 0.310.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.
- package/README.md +1 -1
- package/dist/types/wcardinal/ui/d-base-state-and-value.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-base-state-matcher.d.ts +1 -0
- package/dist/types/wcardinal/ui/d-base-state-set-blinker-datum-impl.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-base-state-set-blinker-impl.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-base-state-set-blinker.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-base-state-set-impl.d.ts +51 -18
- package/dist/types/wcardinal/ui/d-base-state-set-sub-datum-impl.d.ts +17 -0
- package/dist/types/wcardinal/ui/d-base-state-set-sub-datum.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-base-state-set-sub-impl.d.ts +15 -0
- package/dist/types/wcardinal/ui/d-base-state-set-sub.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-base-state-set-ticker-datum-impl.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-base-state-set-ticker-impl.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-base-state-set-ticker.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-base-state-set.d.ts +38 -8
- package/dist/types/wcardinal/ui/d-base.d.ts +23 -1
- package/dist/types/wcardinal/ui/d-chart-axis-base-guide-container.d.ts +21 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-container.d.ts +14 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.d.ts +41 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape.d.ts +80 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-simple.d.ts +32 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide.d.ts +14 -0
- package/dist/types/wcardinal/ui/d-chart-axis.d.ts +2 -0
- package/dist/types/wcardinal/ui/d-dynamic-text-geometry.d.ts +7 -4
- package/dist/types/wcardinal/ui/d-dynamic-text-measure-result.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-dynamic-text-measure.d.ts +4 -3
- package/dist/types/wcardinal/ui/d-dynamic-text-style.d.ts +16 -1
- package/dist/types/wcardinal/ui/d-dynamic-text.d.ts +7 -6
- package/dist/types/wcardinal/ui/d-links.d.ts +2 -1
- package/dist/types/wcardinal/ui/d-text-base.d.ts +1 -0
- package/dist/types/wcardinal/ui/index.d.ts +18 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-text-base.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-text-base.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/util-font.d.ts +2 -0
- package/dist/wcardinal/ui/d-base-state-and-value.js +2 -0
- package/dist/wcardinal/ui/d-base-state-and-value.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-matcher.js +2 -0
- package/dist/wcardinal/ui/d-base-state-matcher.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js +17 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js +16 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-impl.js +298 -129
- package/dist/wcardinal/ui/d-base-state-set-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js +75 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-datum.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-datum.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-impl.js +73 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-sub.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-sub.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js +17 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js +16 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set.js.map +1 -1
- package/dist/wcardinal/ui/d-base.js +34 -2
- package/dist/wcardinal/ui/d-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js +75 -0
- package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +7 -0
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js +23 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-guide-container.js +2 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-container.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js +328 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js +2 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple.js +123 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide.js +2 -0
- package/dist/wcardinal/ui/d-chart-axis-guide.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-geometry.js +17 -10
- package/dist/wcardinal/ui/d-dynamic-text-geometry.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-measure-result.js +22 -0
- package/dist/wcardinal/ui/d-dynamic-text-measure-result.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-measure.js +14 -10
- package/dist/wcardinal/ui/d-dynamic-text-measure.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-style.js +107 -6
- package/dist/wcardinal/ui/d-dynamic-text-style.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text.js +52 -29
- package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
- package/dist/wcardinal/ui/d-links.js +18 -1
- package/dist/wcardinal/ui/d-links.js.map +1 -1
- package/dist/wcardinal/ui/d-text-base.js +6 -3
- package/dist/wcardinal/ui/d-text-base.js.map +1 -1
- package/dist/wcardinal/ui/index.js +18 -0
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js +2 -2
- package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js +3 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js +3 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js.map +1 -1
- package/dist/wcardinal/ui/util/util-font.js +18 -11
- package/dist/wcardinal/ui/util/util-font.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +4 -1
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +4 -1
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +1403 -275
- package/dist/wcardinal-ui.js +1397 -275
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.310.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -2608,6 +2608,213 @@ var DBaseState = {
|
|
|
2608
2608
|
NEW_WINDOW: "NEW_WINDOW"
|
|
2609
2609
|
};
|
|
2610
2610
|
|
|
2611
|
+
var DBaseStateSetSubDatumImp = /** @class */ (function () {
|
|
2612
|
+
function DBaseStateSetSubDatumImp(interval) {
|
|
2613
|
+
var _this = this;
|
|
2614
|
+
this._stateToTargets = new Map();
|
|
2615
|
+
this._interval = interval;
|
|
2616
|
+
this._onTimeBound = function () { return _this.onTime(); };
|
|
2617
|
+
}
|
|
2618
|
+
Object.defineProperty(DBaseStateSetSubDatumImp.prototype, "interval", {
|
|
2619
|
+
get: function () {
|
|
2620
|
+
return this._interval;
|
|
2621
|
+
},
|
|
2622
|
+
enumerable: false,
|
|
2623
|
+
configurable: true
|
|
2624
|
+
});
|
|
2625
|
+
DBaseStateSetSubDatumImp.prototype.add = function (state, target) {
|
|
2626
|
+
var stateToTargets = this._stateToTargets;
|
|
2627
|
+
var targets = stateToTargets.get(state);
|
|
2628
|
+
if (targets == null) {
|
|
2629
|
+
targets = new Set();
|
|
2630
|
+
targets.add(target);
|
|
2631
|
+
stateToTargets.set(state, targets);
|
|
2632
|
+
if (stateToTargets.size <= 1) {
|
|
2633
|
+
this.start();
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
else {
|
|
2637
|
+
targets.add(target);
|
|
2638
|
+
}
|
|
2639
|
+
return this;
|
|
2640
|
+
};
|
|
2641
|
+
DBaseStateSetSubDatumImp.prototype.remove = function (state, target) {
|
|
2642
|
+
var stateToTargets = this._stateToTargets;
|
|
2643
|
+
var targets = stateToTargets.get(state);
|
|
2644
|
+
if (targets != null && targets.has(target)) {
|
|
2645
|
+
targets.delete(target);
|
|
2646
|
+
target.remove(state);
|
|
2647
|
+
if (targets.size <= 0) {
|
|
2648
|
+
stateToTargets.delete(state);
|
|
2649
|
+
}
|
|
2650
|
+
if (stateToTargets.size <= 0) {
|
|
2651
|
+
this.stop();
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
return this;
|
|
2655
|
+
};
|
|
2656
|
+
DBaseStateSetSubDatumImp.prototype.start = function () {
|
|
2657
|
+
if (this._timeoutId == null) {
|
|
2658
|
+
this.onTime();
|
|
2659
|
+
}
|
|
2660
|
+
return this;
|
|
2661
|
+
};
|
|
2662
|
+
DBaseStateSetSubDatumImp.prototype.stop = function () {
|
|
2663
|
+
var timeoutId = this._timeoutId;
|
|
2664
|
+
if (timeoutId != null) {
|
|
2665
|
+
clearTimeout(timeoutId);
|
|
2666
|
+
this._timeoutId = undefined;
|
|
2667
|
+
}
|
|
2668
|
+
return this;
|
|
2669
|
+
};
|
|
2670
|
+
DBaseStateSetSubDatumImp.prototype.onTime = function () {
|
|
2671
|
+
var now = Date.now();
|
|
2672
|
+
var interval = this.interval;
|
|
2673
|
+
var value = this.newValue(now, interval);
|
|
2674
|
+
var on = this.newOn(now, interval);
|
|
2675
|
+
this._stateToTargets.forEach(function (targets, state) {
|
|
2676
|
+
targets.forEach(function (target) {
|
|
2677
|
+
target.set(state, value, on);
|
|
2678
|
+
});
|
|
2679
|
+
});
|
|
2680
|
+
this._timeoutId = window.setTimeout(this._onTimeBound, Math.max(0, interval - (now % interval)));
|
|
2681
|
+
};
|
|
2682
|
+
return DBaseStateSetSubDatumImp;
|
|
2683
|
+
}());
|
|
2684
|
+
|
|
2685
|
+
var DBaseStateSetBlinkerDatumImpl = /** @class */ (function (_super) {
|
|
2686
|
+
__extends(DBaseStateSetBlinkerDatumImpl, _super);
|
|
2687
|
+
function DBaseStateSetBlinkerDatumImpl() {
|
|
2688
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2689
|
+
}
|
|
2690
|
+
DBaseStateSetBlinkerDatumImpl.prototype.newValue = function (now, interval) {
|
|
2691
|
+
return null;
|
|
2692
|
+
};
|
|
2693
|
+
DBaseStateSetBlinkerDatumImpl.prototype.newOn = function (now, interval) {
|
|
2694
|
+
return Math.round(now / interval) % 2 === 0;
|
|
2695
|
+
};
|
|
2696
|
+
return DBaseStateSetBlinkerDatumImpl;
|
|
2697
|
+
}(DBaseStateSetSubDatumImp));
|
|
2698
|
+
|
|
2699
|
+
var DBaseStateSetSubImpl = /** @class */ (function () {
|
|
2700
|
+
function DBaseStateSetSubImpl(parent, intervalToDatum) {
|
|
2701
|
+
this._parent = parent;
|
|
2702
|
+
this._stateToInterval = new Map();
|
|
2703
|
+
this._intervalToDatum = intervalToDatum;
|
|
2704
|
+
}
|
|
2705
|
+
DBaseStateSetSubImpl.prototype.add = function (state, interval) {
|
|
2706
|
+
// Check if the interval is not same
|
|
2707
|
+
var stateToInterval = this._stateToInterval;
|
|
2708
|
+
var oldInterval = stateToInterval.get(state);
|
|
2709
|
+
if (oldInterval === interval) {
|
|
2710
|
+
return this;
|
|
2711
|
+
}
|
|
2712
|
+
// Remove the existing one
|
|
2713
|
+
if (oldInterval != null) {
|
|
2714
|
+
stateToInterval.delete(state);
|
|
2715
|
+
var datum_1 = this._intervalToDatum.get(oldInterval);
|
|
2716
|
+
if (datum_1 != null) {
|
|
2717
|
+
datum_1.remove(state, this._parent);
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
// Add a new one
|
|
2721
|
+
stateToInterval.set(state, interval);
|
|
2722
|
+
var datum = this._intervalToDatum.get(interval);
|
|
2723
|
+
if (datum == null) {
|
|
2724
|
+
datum = this.newDatum(interval);
|
|
2725
|
+
this._intervalToDatum.set(interval, datum);
|
|
2726
|
+
}
|
|
2727
|
+
datum.add(state, this._parent);
|
|
2728
|
+
// Done
|
|
2729
|
+
return this;
|
|
2730
|
+
};
|
|
2731
|
+
DBaseStateSetSubImpl.prototype.remove = function (state) {
|
|
2732
|
+
var interval = this._stateToInterval.get(state);
|
|
2733
|
+
if (interval == null) {
|
|
2734
|
+
return this;
|
|
2735
|
+
}
|
|
2736
|
+
this._stateToInterval.delete(state);
|
|
2737
|
+
var datum = this._intervalToDatum.get(interval);
|
|
2738
|
+
if (datum == null) {
|
|
2739
|
+
return this;
|
|
2740
|
+
}
|
|
2741
|
+
datum.remove(state, this._parent);
|
|
2742
|
+
return this;
|
|
2743
|
+
};
|
|
2744
|
+
DBaseStateSetSubImpl.prototype.set = function (state, interval, on) {
|
|
2745
|
+
if (on) {
|
|
2746
|
+
return this.add(state, interval);
|
|
2747
|
+
}
|
|
2748
|
+
else {
|
|
2749
|
+
return this.remove(state);
|
|
2750
|
+
}
|
|
2751
|
+
};
|
|
2752
|
+
DBaseStateSetSubImpl.prototype.has = function (state) {
|
|
2753
|
+
return this._stateToInterval.has(state);
|
|
2754
|
+
};
|
|
2755
|
+
DBaseStateSetSubImpl.prototype.clear = function () {
|
|
2756
|
+
var _this = this;
|
|
2757
|
+
var parent = this._parent;
|
|
2758
|
+
var stateToInterval = this._stateToInterval;
|
|
2759
|
+
stateToInterval.forEach(function (interval, state) {
|
|
2760
|
+
var datum = _this._intervalToDatum.get(interval);
|
|
2761
|
+
if (datum != null) {
|
|
2762
|
+
datum.remove(state, parent);
|
|
2763
|
+
}
|
|
2764
|
+
});
|
|
2765
|
+
stateToInterval.clear();
|
|
2766
|
+
return this;
|
|
2767
|
+
};
|
|
2768
|
+
return DBaseStateSetSubImpl;
|
|
2769
|
+
}());
|
|
2770
|
+
|
|
2771
|
+
var intervalToDatum$1;
|
|
2772
|
+
var DBaseStateSetBlinkerImpl = /** @class */ (function (_super) {
|
|
2773
|
+
__extends(DBaseStateSetBlinkerImpl, _super);
|
|
2774
|
+
function DBaseStateSetBlinkerImpl(parent) {
|
|
2775
|
+
return _super.call(this, parent, (intervalToDatum$1 !== null && intervalToDatum$1 !== void 0 ? intervalToDatum$1 : (intervalToDatum$1 = new Map()))) || this;
|
|
2776
|
+
}
|
|
2777
|
+
DBaseStateSetBlinkerImpl.prototype.newDatum = function (interval) {
|
|
2778
|
+
return new DBaseStateSetBlinkerDatumImpl(interval);
|
|
2779
|
+
};
|
|
2780
|
+
return DBaseStateSetBlinkerImpl;
|
|
2781
|
+
}(DBaseStateSetSubImpl));
|
|
2782
|
+
|
|
2783
|
+
var DBaseStateSetTickerDatumImpl = /** @class */ (function (_super) {
|
|
2784
|
+
__extends(DBaseStateSetTickerDatumImpl, _super);
|
|
2785
|
+
function DBaseStateSetTickerDatumImpl() {
|
|
2786
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2787
|
+
}
|
|
2788
|
+
DBaseStateSetTickerDatumImpl.prototype.newValue = function (now, interval) {
|
|
2789
|
+
return Math.round(now / interval);
|
|
2790
|
+
};
|
|
2791
|
+
DBaseStateSetTickerDatumImpl.prototype.newOn = function (now, interval) {
|
|
2792
|
+
return true;
|
|
2793
|
+
};
|
|
2794
|
+
return DBaseStateSetTickerDatumImpl;
|
|
2795
|
+
}(DBaseStateSetSubDatumImp));
|
|
2796
|
+
|
|
2797
|
+
var intervalToDatum;
|
|
2798
|
+
var DBaseStateSetTickerImpl = /** @class */ (function (_super) {
|
|
2799
|
+
__extends(DBaseStateSetTickerImpl, _super);
|
|
2800
|
+
function DBaseStateSetTickerImpl(parent) {
|
|
2801
|
+
return _super.call(this, parent, (intervalToDatum !== null && intervalToDatum !== void 0 ? intervalToDatum : (intervalToDatum = new Map()))) || this;
|
|
2802
|
+
}
|
|
2803
|
+
DBaseStateSetTickerImpl.prototype.newDatum = function (interval) {
|
|
2804
|
+
return new DBaseStateSetTickerDatumImpl(interval);
|
|
2805
|
+
};
|
|
2806
|
+
return DBaseStateSetTickerImpl;
|
|
2807
|
+
}(DBaseStateSetSubImpl));
|
|
2808
|
+
|
|
2809
|
+
/*
|
|
2810
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
2811
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
2812
|
+
*/
|
|
2813
|
+
var isArray = Array.isArray ||
|
|
2814
|
+
(function (target) {
|
|
2815
|
+
return Object.prototype.toString.call(target) === "[object Array]";
|
|
2816
|
+
});
|
|
2817
|
+
|
|
2611
2818
|
/*
|
|
2612
2819
|
* Copyright (C) 2019 Toshiba Corporation
|
|
2613
2820
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -2617,6 +2824,14 @@ var isFunction = function (target) {
|
|
|
2617
2824
|
return typeof target === "function";
|
|
2618
2825
|
};
|
|
2619
2826
|
|
|
2827
|
+
/*
|
|
2828
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
2829
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
2830
|
+
*/
|
|
2831
|
+
var isNumber = function (target) {
|
|
2832
|
+
return (typeof target === "number" || Object.prototype.toString.call(target) === "[object Number]");
|
|
2833
|
+
};
|
|
2834
|
+
|
|
2620
2835
|
/*
|
|
2621
2836
|
* Copyright (C) 2019 Toshiba Corporation
|
|
2622
2837
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -2631,22 +2846,80 @@ var isString = function (target) {
|
|
|
2631
2846
|
*/
|
|
2632
2847
|
var DBaseStateSetImpl = /** @class */ (function () {
|
|
2633
2848
|
function DBaseStateSetImpl() {
|
|
2634
|
-
this._local = new
|
|
2849
|
+
this._local = new Map();
|
|
2635
2850
|
this._parent = null;
|
|
2636
2851
|
}
|
|
2637
|
-
DBaseStateSetImpl.prototype
|
|
2638
|
-
|
|
2852
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "local", {
|
|
2853
|
+
get: function () {
|
|
2854
|
+
return this._local;
|
|
2855
|
+
},
|
|
2856
|
+
enumerable: false,
|
|
2857
|
+
configurable: true
|
|
2858
|
+
});
|
|
2859
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "parent", {
|
|
2860
|
+
get: function () {
|
|
2861
|
+
return this._parent;
|
|
2862
|
+
},
|
|
2863
|
+
set: function (parent) {
|
|
2864
|
+
if (this._parent !== parent) {
|
|
2865
|
+
this.begin();
|
|
2866
|
+
this._parent = parent;
|
|
2867
|
+
this.end();
|
|
2868
|
+
}
|
|
2869
|
+
},
|
|
2870
|
+
enumerable: false,
|
|
2871
|
+
configurable: true
|
|
2872
|
+
});
|
|
2873
|
+
DBaseStateSetImpl.prototype.onParentChange = function (newState, oldState) {
|
|
2874
|
+
this._parent = oldState;
|
|
2875
|
+
this.begin();
|
|
2876
|
+
this._parent = newState;
|
|
2877
|
+
this.end();
|
|
2639
2878
|
};
|
|
2640
|
-
DBaseStateSetImpl.prototype
|
|
2641
|
-
|
|
2879
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "blinker", {
|
|
2880
|
+
get: function () {
|
|
2881
|
+
var result = this._blinker;
|
|
2882
|
+
if (result == null) {
|
|
2883
|
+
result = this.newBlinker();
|
|
2884
|
+
this._blinker = result;
|
|
2885
|
+
}
|
|
2886
|
+
return result;
|
|
2887
|
+
},
|
|
2888
|
+
enumerable: false,
|
|
2889
|
+
configurable: true
|
|
2890
|
+
});
|
|
2891
|
+
DBaseStateSetImpl.prototype.newBlinker = function () {
|
|
2892
|
+
return new DBaseStateSetBlinkerImpl(this);
|
|
2642
2893
|
};
|
|
2643
|
-
DBaseStateSetImpl.prototype
|
|
2644
|
-
|
|
2645
|
-
|
|
2894
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "ticker", {
|
|
2895
|
+
get: function () {
|
|
2896
|
+
var result = this._ticker;
|
|
2897
|
+
if (result == null) {
|
|
2898
|
+
result = this.newTicker();
|
|
2899
|
+
this._ticker = result;
|
|
2900
|
+
}
|
|
2901
|
+
return result;
|
|
2902
|
+
},
|
|
2903
|
+
enumerable: false,
|
|
2904
|
+
configurable: true
|
|
2905
|
+
});
|
|
2906
|
+
DBaseStateSetImpl.prototype.newTicker = function () {
|
|
2907
|
+
return new DBaseStateSetTickerImpl(this);
|
|
2646
2908
|
};
|
|
2647
|
-
DBaseStateSetImpl.prototype.
|
|
2648
|
-
var
|
|
2649
|
-
return
|
|
2909
|
+
DBaseStateSetImpl.prototype.is = function (state, value) {
|
|
2910
|
+
var v = this._local.get(state);
|
|
2911
|
+
return v !== undefined && (value === undefined || value === v);
|
|
2912
|
+
};
|
|
2913
|
+
DBaseStateSetImpl.prototype.in = function (state, value) {
|
|
2914
|
+
return this.is(state, value) || this.under(state, value);
|
|
2915
|
+
};
|
|
2916
|
+
DBaseStateSetImpl.prototype.on = function (state, value) {
|
|
2917
|
+
var parent = this._parent;
|
|
2918
|
+
return parent != null && parent.is(state, value);
|
|
2919
|
+
};
|
|
2920
|
+
DBaseStateSetImpl.prototype.under = function (state, value) {
|
|
2921
|
+
var parent = this._parent;
|
|
2922
|
+
return parent != null && parent.in(state, value);
|
|
2650
2923
|
};
|
|
2651
2924
|
DBaseStateSetImpl.prototype.lock = function (callOnChange) {
|
|
2652
2925
|
return this;
|
|
@@ -2660,35 +2933,78 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
2660
2933
|
DBaseStateSetImpl.prototype.end = function () {
|
|
2661
2934
|
return this;
|
|
2662
2935
|
};
|
|
2663
|
-
DBaseStateSetImpl.prototype.checkAdded = function (added) {
|
|
2664
|
-
|
|
2936
|
+
DBaseStateSetImpl.prototype.checkAdded = function (added, value) {
|
|
2937
|
+
var v = this._local.get(added);
|
|
2938
|
+
return v === undefined || v !== value;
|
|
2665
2939
|
};
|
|
2666
|
-
DBaseStateSetImpl.prototype.add = function (state) {
|
|
2667
|
-
if (
|
|
2940
|
+
DBaseStateSetImpl.prototype.add = function (state, value) {
|
|
2941
|
+
if (value === void 0) { value = null; }
|
|
2942
|
+
if (this.checkAdded(state, value)) {
|
|
2668
2943
|
this.begin();
|
|
2669
|
-
this._local.
|
|
2944
|
+
this._local.set(state, value);
|
|
2670
2945
|
this.end();
|
|
2671
2946
|
}
|
|
2672
2947
|
return this;
|
|
2673
2948
|
};
|
|
2674
|
-
DBaseStateSetImpl.prototype.
|
|
2949
|
+
DBaseStateSetImpl.prototype.checkAddedsString = function (states) {
|
|
2675
2950
|
var local = this._local;
|
|
2676
2951
|
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
2677
|
-
|
|
2952
|
+
var v = local.get(states[i]);
|
|
2953
|
+
if (v === undefined || v !== null) {
|
|
2678
2954
|
return true;
|
|
2679
2955
|
}
|
|
2680
2956
|
}
|
|
2681
2957
|
return false;
|
|
2682
2958
|
};
|
|
2683
|
-
DBaseStateSetImpl.prototype.
|
|
2684
|
-
var
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2959
|
+
DBaseStateSetImpl.prototype.checkAddedsObject = function (states) {
|
|
2960
|
+
var local = this._local;
|
|
2961
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
2962
|
+
var state = states[i];
|
|
2963
|
+
var v = local.get(state.state);
|
|
2964
|
+
if (v === undefined || v !== state.value) {
|
|
2965
|
+
return true;
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
return false;
|
|
2969
|
+
};
|
|
2970
|
+
DBaseStateSetImpl.prototype.addAll = function (first) {
|
|
2971
|
+
if (isString(first)) {
|
|
2972
|
+
return this.addAllString(arguments); // eslint-disable-line prefer-rest-params
|
|
2973
|
+
}
|
|
2974
|
+
else if (isArray(first)) {
|
|
2975
|
+
if (0 < first.length) {
|
|
2976
|
+
var element = first[0];
|
|
2977
|
+
if (isString(element)) {
|
|
2978
|
+
return this.addAllString(first);
|
|
2979
|
+
}
|
|
2980
|
+
else {
|
|
2981
|
+
return this.addAllObject(first);
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
return this;
|
|
2985
|
+
}
|
|
2986
|
+
else {
|
|
2987
|
+
return this.addAllObject(arguments); // eslint-disable-line prefer-rest-params
|
|
2988
|
+
}
|
|
2989
|
+
};
|
|
2990
|
+
DBaseStateSetImpl.prototype.addAllString = function (states) {
|
|
2991
|
+
if (this.checkAddedsString(states)) {
|
|
2992
|
+
this.begin();
|
|
2993
|
+
var local = this._local;
|
|
2994
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
2995
|
+
local.set(states[i], null);
|
|
2996
|
+
}
|
|
2997
|
+
this.end();
|
|
2998
|
+
}
|
|
2999
|
+
return this;
|
|
3000
|
+
};
|
|
3001
|
+
DBaseStateSetImpl.prototype.addAllObject = function (states) {
|
|
3002
|
+
if (this.checkAddedsObject(states)) {
|
|
2688
3003
|
this.begin();
|
|
2689
3004
|
var local = this._local;
|
|
2690
3005
|
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
2691
|
-
|
|
3006
|
+
var state = states[i];
|
|
3007
|
+
local.set(state.state, state.value);
|
|
2692
3008
|
}
|
|
2693
3009
|
this.end();
|
|
2694
3010
|
}
|
|
@@ -2705,7 +3021,7 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
2705
3021
|
}
|
|
2706
3022
|
return this;
|
|
2707
3023
|
};
|
|
2708
|
-
DBaseStateSetImpl.prototype.
|
|
3024
|
+
DBaseStateSetImpl.prototype.checkRemovedsString = function (states) {
|
|
2709
3025
|
var local = this._local;
|
|
2710
3026
|
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
2711
3027
|
if (local.has(states[i])) {
|
|
@@ -2714,120 +3030,211 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
2714
3030
|
}
|
|
2715
3031
|
return false;
|
|
2716
3032
|
};
|
|
2717
|
-
DBaseStateSetImpl.prototype.
|
|
2718
|
-
var _this = this;
|
|
3033
|
+
DBaseStateSetImpl.prototype.checkRemovedsObject = function (states) {
|
|
2719
3034
|
var local = this._local;
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
3035
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
3036
|
+
if (local.has(states[i].state)) {
|
|
3037
|
+
return true;
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
return false;
|
|
3041
|
+
};
|
|
3042
|
+
DBaseStateSetImpl.prototype.removeAll = function (first) {
|
|
3043
|
+
if (isFunction(first)) {
|
|
3044
|
+
return this.removeAllMatcher(first);
|
|
3045
|
+
}
|
|
3046
|
+
else if (isString(first)) {
|
|
3047
|
+
return this.removeAllString(arguments); // eslint-disable-line prefer-rest-params
|
|
3048
|
+
}
|
|
3049
|
+
else if (isArray(first)) {
|
|
3050
|
+
if (0 < first.length) {
|
|
3051
|
+
var element = first[0];
|
|
3052
|
+
if (isString(element)) {
|
|
3053
|
+
return this.removeAllString(first);
|
|
3054
|
+
}
|
|
3055
|
+
else {
|
|
3056
|
+
return this.removeAllObject(first);
|
|
2729
3057
|
}
|
|
2730
|
-
});
|
|
2731
|
-
if (isDirty_1) {
|
|
2732
|
-
this.end();
|
|
2733
3058
|
}
|
|
3059
|
+
return this;
|
|
2734
3060
|
}
|
|
2735
3061
|
else {
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
3062
|
+
return this.removeAllObject(arguments); // eslint-disable-line prefer-rest-params
|
|
3063
|
+
}
|
|
3064
|
+
};
|
|
3065
|
+
DBaseStateSetImpl.prototype.removeAllMatcher = function (matcher) {
|
|
3066
|
+
var _this = this;
|
|
3067
|
+
var isDirty = false;
|
|
3068
|
+
var local = this._local;
|
|
3069
|
+
local.forEach(function (value, state) {
|
|
3070
|
+
if (matcher(state)) {
|
|
3071
|
+
if (!isDirty) {
|
|
3072
|
+
isDirty = true;
|
|
3073
|
+
_this.begin();
|
|
2743
3074
|
}
|
|
2744
|
-
|
|
3075
|
+
local.delete(state);
|
|
2745
3076
|
}
|
|
3077
|
+
});
|
|
3078
|
+
if (isDirty) {
|
|
3079
|
+
this.end();
|
|
2746
3080
|
}
|
|
2747
3081
|
return this;
|
|
2748
3082
|
};
|
|
2749
|
-
DBaseStateSetImpl.prototype.
|
|
2750
|
-
|
|
2751
|
-
if (0 < local.size) {
|
|
3083
|
+
DBaseStateSetImpl.prototype.removeAllString = function (states) {
|
|
3084
|
+
if (this.checkRemovedsString(states)) {
|
|
2752
3085
|
this.begin();
|
|
2753
|
-
local.
|
|
3086
|
+
var local = this._local;
|
|
3087
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
3088
|
+
local.delete(states[i]);
|
|
3089
|
+
}
|
|
3090
|
+
this.end();
|
|
3091
|
+
}
|
|
3092
|
+
return this;
|
|
3093
|
+
};
|
|
3094
|
+
DBaseStateSetImpl.prototype.removeAllObject = function (states) {
|
|
3095
|
+
if (this.checkRemovedsObject(states)) {
|
|
3096
|
+
this.begin();
|
|
3097
|
+
var local = this._local;
|
|
3098
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
3099
|
+
local.delete(states[i].state);
|
|
3100
|
+
}
|
|
2754
3101
|
this.end();
|
|
2755
3102
|
}
|
|
2756
3103
|
return this;
|
|
2757
3104
|
};
|
|
2758
|
-
DBaseStateSetImpl.prototype.set = function (
|
|
2759
|
-
if (
|
|
2760
|
-
if (
|
|
2761
|
-
this.add(
|
|
3105
|
+
DBaseStateSetImpl.prototype.set = function (first, second, third) {
|
|
3106
|
+
if (second === true) {
|
|
3107
|
+
if (first != null) {
|
|
3108
|
+
this.add(first);
|
|
2762
3109
|
}
|
|
2763
3110
|
}
|
|
2764
|
-
else if (
|
|
2765
|
-
if (
|
|
2766
|
-
this.remove(
|
|
3111
|
+
else if (second === false) {
|
|
3112
|
+
if (first != null) {
|
|
3113
|
+
this.remove(first);
|
|
2767
3114
|
}
|
|
2768
3115
|
}
|
|
2769
|
-
else {
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
if (removed != null) {
|
|
2774
|
-
if (this.checkAdded(added) || this.checkRemoved(removed)) {
|
|
2775
|
-
this.begin();
|
|
2776
|
-
this._local.add(added).delete(removed);
|
|
2777
|
-
this.end();
|
|
2778
|
-
}
|
|
3116
|
+
else if (second == null || isNumber(second)) {
|
|
3117
|
+
if (third === true) {
|
|
3118
|
+
if (first != null) {
|
|
3119
|
+
this.add(first, second);
|
|
2779
3120
|
}
|
|
2780
|
-
|
|
2781
|
-
|
|
3121
|
+
}
|
|
3122
|
+
else if (third === false) {
|
|
3123
|
+
if (first != null) {
|
|
3124
|
+
this.remove(first);
|
|
2782
3125
|
}
|
|
2783
3126
|
}
|
|
2784
|
-
else
|
|
2785
|
-
this.
|
|
3127
|
+
else {
|
|
3128
|
+
return this.doSet(first, second, third);
|
|
2786
3129
|
}
|
|
2787
3130
|
}
|
|
3131
|
+
else {
|
|
3132
|
+
return this.doSet(first, null, second);
|
|
3133
|
+
}
|
|
2788
3134
|
return this;
|
|
2789
3135
|
};
|
|
2790
|
-
DBaseStateSetImpl.prototype.
|
|
2791
|
-
if (
|
|
2792
|
-
if (
|
|
2793
|
-
this.
|
|
3136
|
+
DBaseStateSetImpl.prototype.doSet = function (added, value, removed) {
|
|
3137
|
+
if (added != null) {
|
|
3138
|
+
if (removed != null) {
|
|
3139
|
+
if (this.checkAdded(added, value) || this.checkRemoved(removed)) {
|
|
3140
|
+
this.begin();
|
|
3141
|
+
this._local.set(added, value).delete(removed);
|
|
3142
|
+
this.end();
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
else {
|
|
3146
|
+
this.add(added, value);
|
|
2794
3147
|
}
|
|
2795
3148
|
}
|
|
2796
|
-
else if (
|
|
2797
|
-
|
|
2798
|
-
|
|
3149
|
+
else if (removed != null) {
|
|
3150
|
+
this.remove(removed);
|
|
3151
|
+
}
|
|
3152
|
+
return this;
|
|
3153
|
+
};
|
|
3154
|
+
DBaseStateSetImpl.prototype.setAll = function (first, second) {
|
|
3155
|
+
if (second === true) {
|
|
3156
|
+
if (first != null) {
|
|
3157
|
+
this.addAll(first);
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
else if (second === false) {
|
|
3161
|
+
if (first != null) {
|
|
3162
|
+
this.removeAll(first);
|
|
2799
3163
|
}
|
|
2800
3164
|
}
|
|
2801
3165
|
else {
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
local.add(addeds[i]);
|
|
2811
|
-
}
|
|
2812
|
-
for (var i = 0, imax = removeds.length; i < imax; ++i) {
|
|
2813
|
-
local.delete(removeds[i]);
|
|
2814
|
-
}
|
|
2815
|
-
this.end();
|
|
3166
|
+
if (first != null && 0 < first.length) {
|
|
3167
|
+
if (second != null && 0 < second.length) {
|
|
3168
|
+
var added = first[0];
|
|
3169
|
+
if (isString(added)) {
|
|
3170
|
+
return this.setAllString(first, second);
|
|
3171
|
+
}
|
|
3172
|
+
else {
|
|
3173
|
+
return this.setAllObject(first, second);
|
|
2816
3174
|
}
|
|
2817
3175
|
}
|
|
2818
3176
|
else {
|
|
2819
|
-
this.addAll(
|
|
3177
|
+
this.addAll(first);
|
|
2820
3178
|
}
|
|
2821
3179
|
}
|
|
2822
|
-
else if (
|
|
2823
|
-
this.removeAll(
|
|
3180
|
+
else if (second != null) {
|
|
3181
|
+
this.removeAll(second);
|
|
2824
3182
|
}
|
|
2825
3183
|
}
|
|
2826
3184
|
return this;
|
|
2827
3185
|
};
|
|
3186
|
+
DBaseStateSetImpl.prototype.setAllString = function (addeds, removeds) {
|
|
3187
|
+
if (this.checkAddedsString(addeds) || this.checkRemovedsString(removeds)) {
|
|
3188
|
+
this.begin();
|
|
3189
|
+
var local = this._local;
|
|
3190
|
+
for (var i = 0, imax = addeds.length; i < imax; ++i) {
|
|
3191
|
+
local.set(addeds[i], null);
|
|
3192
|
+
}
|
|
3193
|
+
for (var i = 0, imax = removeds.length; i < imax; ++i) {
|
|
3194
|
+
local.delete(removeds[i]);
|
|
3195
|
+
}
|
|
3196
|
+
this.end();
|
|
3197
|
+
}
|
|
3198
|
+
return this;
|
|
3199
|
+
};
|
|
3200
|
+
DBaseStateSetImpl.prototype.setAllObject = function (addeds, removeds) {
|
|
3201
|
+
if (this.checkAddedsObject(addeds) || this.checkRemovedsString(removeds)) {
|
|
3202
|
+
this.begin();
|
|
3203
|
+
var local = this._local;
|
|
3204
|
+
for (var i = 0, imax = addeds.length; i < imax; ++i) {
|
|
3205
|
+
var added = addeds[i];
|
|
3206
|
+
local.set(added.state, added.value);
|
|
3207
|
+
}
|
|
3208
|
+
for (var i = 0, imax = removeds.length; i < imax; ++i) {
|
|
3209
|
+
local.delete(removeds[i]);
|
|
3210
|
+
}
|
|
3211
|
+
this.end();
|
|
3212
|
+
}
|
|
3213
|
+
return this;
|
|
3214
|
+
};
|
|
3215
|
+
DBaseStateSetImpl.prototype.clear = function () {
|
|
3216
|
+
var local = this._local;
|
|
3217
|
+
if (0 < local.size) {
|
|
3218
|
+
this.begin();
|
|
3219
|
+
local.clear();
|
|
3220
|
+
this.end();
|
|
3221
|
+
}
|
|
3222
|
+
return this;
|
|
3223
|
+
};
|
|
3224
|
+
DBaseStateSetImpl.prototype.valueOf = function (state, def) {
|
|
3225
|
+
var result = this._local.get(state);
|
|
3226
|
+
if (result !== undefined) {
|
|
3227
|
+
return result;
|
|
3228
|
+
}
|
|
3229
|
+
var parent = this._parent;
|
|
3230
|
+
if (parent != null) {
|
|
3231
|
+
return parent.valueOf(state, def);
|
|
3232
|
+
}
|
|
3233
|
+
return def;
|
|
3234
|
+
};
|
|
2828
3235
|
DBaseStateSetImpl.prototype.each = function (iteratee) {
|
|
2829
|
-
this._local.forEach(function (state) {
|
|
2830
|
-
iteratee(state);
|
|
3236
|
+
this._local.forEach(function (value, state) {
|
|
3237
|
+
iteratee(state, value);
|
|
2831
3238
|
});
|
|
2832
3239
|
return this;
|
|
2833
3240
|
};
|
|
@@ -2839,41 +3246,14 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
2839
3246
|
this.begin();
|
|
2840
3247
|
var local_1 = this._local;
|
|
2841
3248
|
local_1.clear();
|
|
2842
|
-
other.local.forEach(function (value) {
|
|
2843
|
-
local_1.
|
|
3249
|
+
other.local.forEach(function (value, state) {
|
|
3250
|
+
local_1.set(state, value);
|
|
2844
3251
|
});
|
|
2845
3252
|
this._parent = other.parent;
|
|
2846
3253
|
this.end();
|
|
2847
3254
|
}
|
|
2848
3255
|
return this;
|
|
2849
3256
|
};
|
|
2850
|
-
Object.defineProperty(DBaseStateSetImpl.prototype, "local", {
|
|
2851
|
-
get: function () {
|
|
2852
|
-
return this._local;
|
|
2853
|
-
},
|
|
2854
|
-
enumerable: false,
|
|
2855
|
-
configurable: true
|
|
2856
|
-
});
|
|
2857
|
-
Object.defineProperty(DBaseStateSetImpl.prototype, "parent", {
|
|
2858
|
-
get: function () {
|
|
2859
|
-
return this._parent;
|
|
2860
|
-
},
|
|
2861
|
-
set: function (parent) {
|
|
2862
|
-
if (this._parent !== parent) {
|
|
2863
|
-
this.begin();
|
|
2864
|
-
this._parent = parent;
|
|
2865
|
-
this.end();
|
|
2866
|
-
}
|
|
2867
|
-
},
|
|
2868
|
-
enumerable: false,
|
|
2869
|
-
configurable: true
|
|
2870
|
-
});
|
|
2871
|
-
DBaseStateSetImpl.prototype.onParentChange = function (newState, oldState) {
|
|
2872
|
-
this._parent = oldState;
|
|
2873
|
-
this.begin();
|
|
2874
|
-
this._parent = newState;
|
|
2875
|
-
this.end();
|
|
2876
|
-
};
|
|
2877
3257
|
Object.defineProperty(DBaseStateSetImpl.prototype, "isHovered", {
|
|
2878
3258
|
get: function () {
|
|
2879
3259
|
return this.is(DBaseState.HOVERED);
|
|
@@ -3441,8 +3821,8 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
3441
3821
|
});
|
|
3442
3822
|
DBaseStateSetImpl.prototype.toObject = function () {
|
|
3443
3823
|
var states = [];
|
|
3444
|
-
this._local.forEach(function (value) {
|
|
3445
|
-
states.push(
|
|
3824
|
+
this._local.forEach(function (value, state) {
|
|
3825
|
+
states.push(state);
|
|
3446
3826
|
});
|
|
3447
3827
|
return {
|
|
3448
3828
|
local: states
|
|
@@ -3545,12 +3925,12 @@ var EShapeStateSetImplObservable = /** @class */ (function (_super) {
|
|
|
3545
3925
|
EShapeStateSetImplObservable.prototype.onChange = function (newState, oldState) {
|
|
3546
3926
|
if (newState.isActive) {
|
|
3547
3927
|
if (!oldState.isActive) {
|
|
3548
|
-
this._local.
|
|
3928
|
+
this._local.set(EShapeState.ACTIVATED, null).delete(EShapeState.DEACTIVATED);
|
|
3549
3929
|
}
|
|
3550
3930
|
}
|
|
3551
3931
|
else {
|
|
3552
3932
|
if (oldState.isActive) {
|
|
3553
|
-
this._local.
|
|
3933
|
+
this._local.set(EShapeState.DEACTIVATED, null).delete(EShapeState.ACTIVATED);
|
|
3554
3934
|
}
|
|
3555
3935
|
}
|
|
3556
3936
|
_super.prototype.onChange.call(this, newState, oldState);
|
|
@@ -6316,15 +6696,6 @@ var EShapeDataMappingImpl = /** @class */ (function () {
|
|
|
6316
6696
|
return EShapeDataMappingImpl;
|
|
6317
6697
|
}());
|
|
6318
6698
|
|
|
6319
|
-
/*
|
|
6320
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
6321
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6322
|
-
*/
|
|
6323
|
-
var isArray = Array.isArray ||
|
|
6324
|
-
(function (target) {
|
|
6325
|
-
return Object.prototype.toString.call(target) === "[object Array]";
|
|
6326
|
-
});
|
|
6327
|
-
|
|
6328
6699
|
var EShapeDataScopedImpl = /** @class */ (function () {
|
|
6329
6700
|
function EShapeDataScopedImpl() {
|
|
6330
6701
|
}
|
|
@@ -8880,14 +9251,6 @@ var EShapeActionValueType = {
|
|
|
8880
9251
|
EXTENSION: 1000
|
|
8881
9252
|
};
|
|
8882
9253
|
|
|
8883
|
-
/*
|
|
8884
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
8885
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
8886
|
-
*/
|
|
8887
|
-
var isNumber = function (target) {
|
|
8888
|
-
return (typeof target === "number" || Object.prototype.toString.call(target) === "[object Number]");
|
|
8889
|
-
};
|
|
8890
|
-
|
|
8891
9254
|
/*
|
|
8892
9255
|
* Copyright (C) 2019 Toshiba Corporation
|
|
8893
9256
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -13572,11 +13935,42 @@ var DBase = /** @class */ (function (_super) {
|
|
|
13572
13935
|
if (options != null) {
|
|
13573
13936
|
var state = options.state;
|
|
13574
13937
|
if (state != null) {
|
|
13938
|
+
var s = _this._state;
|
|
13575
13939
|
if (isString(state)) {
|
|
13576
|
-
|
|
13940
|
+
s.add(state);
|
|
13941
|
+
}
|
|
13942
|
+
else if (isArray(state)) {
|
|
13943
|
+
s.addAll(state);
|
|
13577
13944
|
}
|
|
13578
13945
|
else {
|
|
13579
|
-
|
|
13946
|
+
// Values
|
|
13947
|
+
var values = state.values;
|
|
13948
|
+
if (values != null) {
|
|
13949
|
+
if (isString(values)) {
|
|
13950
|
+
s.add(values);
|
|
13951
|
+
}
|
|
13952
|
+
else {
|
|
13953
|
+
s.addAll(values);
|
|
13954
|
+
}
|
|
13955
|
+
}
|
|
13956
|
+
// Blinker
|
|
13957
|
+
var blinkers = state.blinkers;
|
|
13958
|
+
if (blinkers != null) {
|
|
13959
|
+
var b = s.blinker;
|
|
13960
|
+
for (var i = 0, imax = blinkers.length; i < imax; ++i) {
|
|
13961
|
+
var blinker = blinkers[i];
|
|
13962
|
+
b.add(blinker.state, blinker.interval);
|
|
13963
|
+
}
|
|
13964
|
+
}
|
|
13965
|
+
// Ticker
|
|
13966
|
+
var tickers = state.tickers;
|
|
13967
|
+
if (tickers != null) {
|
|
13968
|
+
var t = s.ticker;
|
|
13969
|
+
for (var i = 0, imax = tickers.length; i < imax; ++i) {
|
|
13970
|
+
var ticker = tickers[i];
|
|
13971
|
+
t.add(ticker.state, ticker.interval);
|
|
13972
|
+
}
|
|
13973
|
+
}
|
|
13580
13974
|
}
|
|
13581
13975
|
}
|
|
13582
13976
|
}
|
|
@@ -27389,6 +27783,8 @@ var DDynamicTextMeasureResult = /** @class */ (function () {
|
|
|
27389
27783
|
this.width = 0;
|
|
27390
27784
|
this.height = 0;
|
|
27391
27785
|
this.characters = [];
|
|
27786
|
+
this.scale = 1;
|
|
27787
|
+
this.scaled = false;
|
|
27392
27788
|
this.clipped = false;
|
|
27393
27789
|
this.x = 0;
|
|
27394
27790
|
this.y = 0;
|
|
@@ -27398,6 +27794,8 @@ var DDynamicTextMeasureResult = /** @class */ (function () {
|
|
|
27398
27794
|
this.countPerLine = 0;
|
|
27399
27795
|
this.width = 0;
|
|
27400
27796
|
this.height = 0;
|
|
27797
|
+
this.scale = 1;
|
|
27798
|
+
this.scaled = false;
|
|
27401
27799
|
this.clipped = false;
|
|
27402
27800
|
this.x = 0;
|
|
27403
27801
|
this.y = 0.5 * (lineHeight - fontHeight);
|
|
@@ -27484,6 +27882,24 @@ var DDynamicTextMeasureResult = /** @class */ (function () {
|
|
|
27484
27882
|
}
|
|
27485
27883
|
return false;
|
|
27486
27884
|
};
|
|
27885
|
+
DDynamicTextMeasureResult.prototype.fit = function (width, height) {
|
|
27886
|
+
var w = this.width;
|
|
27887
|
+
var h = this.height;
|
|
27888
|
+
if (1e-4 < w && width < w) {
|
|
27889
|
+
if (1e-4 < h && height < h) {
|
|
27890
|
+
this.scale = Math.min(width / w, height / h);
|
|
27891
|
+
this.scaled = true;
|
|
27892
|
+
}
|
|
27893
|
+
else {
|
|
27894
|
+
this.scale = width / w;
|
|
27895
|
+
this.scaled = true;
|
|
27896
|
+
}
|
|
27897
|
+
}
|
|
27898
|
+
else if (1e-4 < h && height < h) {
|
|
27899
|
+
this.scale = height / h;
|
|
27900
|
+
this.scaled = true;
|
|
27901
|
+
}
|
|
27902
|
+
};
|
|
27487
27903
|
DDynamicTextMeasureResult.prototype.end = function (lineHeight, fontHeight) {
|
|
27488
27904
|
this.newLine(lineHeight);
|
|
27489
27905
|
this.y -= 0.5 * (lineHeight - fontHeight);
|
|
@@ -27506,21 +27922,22 @@ var NEW_LINE = "\n";
|
|
|
27506
27922
|
var DDynamicTextMeasure = /** @class */ (function () {
|
|
27507
27923
|
function DDynamicTextMeasure() {
|
|
27508
27924
|
}
|
|
27509
|
-
DDynamicTextMeasure.measure = function (text, atlas,
|
|
27925
|
+
DDynamicTextMeasure.measure = function (text, atlas, modifier) {
|
|
27510
27926
|
var result = DDynamicTextMeasure.RESULT || new DDynamicTextMeasureResult();
|
|
27511
27927
|
DDynamicTextMeasure.RESULT = result;
|
|
27512
27928
|
if (atlas != null) {
|
|
27513
27929
|
var itr = UtilCharacterIterator.from(text);
|
|
27514
27930
|
var fh = atlas.font.height;
|
|
27515
|
-
var lh =
|
|
27516
|
-
var
|
|
27517
|
-
var
|
|
27518
|
-
var
|
|
27519
|
-
var
|
|
27931
|
+
var lh = modifier.lineHeight;
|
|
27932
|
+
var cf = modifier.fitting;
|
|
27933
|
+
var cc = !cf && modifier.clipping;
|
|
27934
|
+
var cw = modifier.width;
|
|
27935
|
+
var ch = modifier.height;
|
|
27936
|
+
var cp = !cf && modifier.wordWrap;
|
|
27520
27937
|
result.start(lh, fh);
|
|
27521
27938
|
switch (cp) {
|
|
27522
27939
|
case DDynamicTextStyleWordWrap.BREAK_ALL:
|
|
27523
|
-
if (
|
|
27940
|
+
if (cc) {
|
|
27524
27941
|
this.measure1(itr, cw, ch, fh, lh, atlas, result);
|
|
27525
27942
|
}
|
|
27526
27943
|
else {
|
|
@@ -27530,7 +27947,7 @@ var DDynamicTextMeasure = /** @class */ (function () {
|
|
|
27530
27947
|
case DDynamicTextStyleWordWrap.NORMAL:
|
|
27531
27948
|
var lb = this.newLineBreaker(text);
|
|
27532
27949
|
if (lb) {
|
|
27533
|
-
if (
|
|
27950
|
+
if (cc) {
|
|
27534
27951
|
this.measure1a(lb, itr, cw, ch, fh, lh, atlas, result);
|
|
27535
27952
|
}
|
|
27536
27953
|
else {
|
|
@@ -27538,7 +27955,7 @@ var DDynamicTextMeasure = /** @class */ (function () {
|
|
|
27538
27955
|
}
|
|
27539
27956
|
}
|
|
27540
27957
|
else {
|
|
27541
|
-
if (
|
|
27958
|
+
if (cc) {
|
|
27542
27959
|
this.measure1b(itr, cw, ch, fh, lh, atlas, result);
|
|
27543
27960
|
}
|
|
27544
27961
|
else {
|
|
@@ -27547,7 +27964,7 @@ var DDynamicTextMeasure = /** @class */ (function () {
|
|
|
27547
27964
|
}
|
|
27548
27965
|
break;
|
|
27549
27966
|
default:
|
|
27550
|
-
if (
|
|
27967
|
+
if (cc) {
|
|
27551
27968
|
this.measure3(itr, cw, lh, atlas, result);
|
|
27552
27969
|
}
|
|
27553
27970
|
else {
|
|
@@ -27556,6 +27973,9 @@ var DDynamicTextMeasure = /** @class */ (function () {
|
|
|
27556
27973
|
break;
|
|
27557
27974
|
}
|
|
27558
27975
|
result.end(lh, fh);
|
|
27976
|
+
if (cf) {
|
|
27977
|
+
result.fit(cw, ch);
|
|
27978
|
+
}
|
|
27559
27979
|
}
|
|
27560
27980
|
else {
|
|
27561
27981
|
result.start(0, 0);
|
|
@@ -27846,14 +28266,16 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
27846
28266
|
var _this = _super.call(this, new Float32Array(64), new Float32Array(64), new Uint16Array(48)) || this;
|
|
27847
28267
|
_this.width = 0;
|
|
27848
28268
|
_this.height = 0;
|
|
28269
|
+
_this.scale = 1;
|
|
28270
|
+
_this.scaled = false;
|
|
27849
28271
|
_this.clipped = false;
|
|
27850
28272
|
return _this;
|
|
27851
28273
|
}
|
|
27852
|
-
DDynamicTextGeometry.prototype.update = function (text, atlas,
|
|
28274
|
+
DDynamicTextGeometry.prototype.update = function (text, atlas, modifier) {
|
|
27853
28275
|
var vertexBuffer = this.getBuffer("aVertexPosition");
|
|
27854
28276
|
var uvBuffer = this.getBuffer("aTextureCoord");
|
|
27855
28277
|
var indexBuffer = this.getIndex();
|
|
27856
|
-
var result = DDynamicTextMeasure.measure(text, atlas,
|
|
28278
|
+
var result = DDynamicTextMeasure.measure(text, atlas, modifier);
|
|
27857
28279
|
var requiredTextSize = Math.ceil(result.count / 8) << 3;
|
|
27858
28280
|
var requiredVertexSize = requiredTextSize << 3;
|
|
27859
28281
|
if (vertexBuffer.data.length < requiredVertexSize) {
|
|
@@ -27870,6 +28292,7 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
27870
28292
|
if (atlas != null) {
|
|
27871
28293
|
var count = result.count;
|
|
27872
28294
|
var characters = result.characters;
|
|
28295
|
+
var scale = result.scale;
|
|
27873
28296
|
for (var i = 0; i < count; ++i) {
|
|
27874
28297
|
var character = characters[i];
|
|
27875
28298
|
var cx = character.x;
|
|
@@ -27877,13 +28300,15 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
27877
28300
|
var cc = character.character;
|
|
27878
28301
|
var w = atlas.width;
|
|
27879
28302
|
var h = atlas.height;
|
|
27880
|
-
this.writeCharacter(vertices, uvs, indices, i, cx, cy, cc, w, h);
|
|
28303
|
+
this.writeCharacter(vertices, uvs, indices, i, cx, cy, scale, cc, w, h);
|
|
27881
28304
|
}
|
|
27882
28305
|
for (var i = count, imax = vertices.length >> 3; i < imax; ++i) {
|
|
27883
28306
|
this.writeCharacterEmpty(vertices, uvs, indices, i);
|
|
27884
28307
|
}
|
|
27885
|
-
this.width = result.width;
|
|
27886
|
-
this.height = result.height;
|
|
28308
|
+
this.width = result.width * scale;
|
|
28309
|
+
this.height = result.height * scale;
|
|
28310
|
+
this.scale = scale;
|
|
28311
|
+
this.scaled = result.scaled;
|
|
27887
28312
|
this.clipped = result.clipped;
|
|
27888
28313
|
}
|
|
27889
28314
|
else {
|
|
@@ -27892,22 +28317,24 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
27892
28317
|
}
|
|
27893
28318
|
this.width = 0;
|
|
27894
28319
|
this.height = 0;
|
|
28320
|
+
this.scale = 1;
|
|
28321
|
+
this.scaled = false;
|
|
27895
28322
|
this.clipped = false;
|
|
27896
28323
|
}
|
|
27897
28324
|
vertexBuffer.update();
|
|
27898
28325
|
uvBuffer.update();
|
|
27899
28326
|
indexBuffer.update();
|
|
27900
28327
|
};
|
|
27901
|
-
DDynamicTextGeometry.prototype.writeCharacter = function (vertices, uvs, indices, index, x, y, character, width, height) {
|
|
28328
|
+
DDynamicTextGeometry.prototype.writeCharacter = function (vertices, uvs, indices, index, x, y, scale, character, width, height) {
|
|
27902
28329
|
var cx = character.x;
|
|
27903
28330
|
var cy = character.y;
|
|
27904
28331
|
var cw = character.width;
|
|
27905
28332
|
var ch = character.height;
|
|
27906
28333
|
var cox = character.origin.x;
|
|
27907
|
-
var x0 = x + (cx - cox);
|
|
27908
|
-
var y0 = y;
|
|
27909
|
-
var x1 = x0 + cw;
|
|
27910
|
-
var y1 = y0 + ch;
|
|
28334
|
+
var x0 = (x + (cx - cox)) * scale;
|
|
28335
|
+
var y0 = y * scale;
|
|
28336
|
+
var x1 = x0 + cw * scale;
|
|
28337
|
+
var y1 = y0 + ch * scale;
|
|
27911
28338
|
var iv = index << 3;
|
|
27912
28339
|
vertices[iv + 0] = x0;
|
|
27913
28340
|
vertices[iv + 1] = y0;
|
|
@@ -27974,7 +28401,7 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
27974
28401
|
*/
|
|
27975
28402
|
var DDynamicTextStyle = /** @class */ (function () {
|
|
27976
28403
|
function DDynamicTextStyle(options, onChange) {
|
|
27977
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
28404
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
27978
28405
|
this._id = 0;
|
|
27979
28406
|
this._idApproved = -1;
|
|
27980
28407
|
var defaultOptions = this.getDefaultOptions();
|
|
@@ -27987,8 +28414,9 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
27987
28414
|
this._fontWeight = (_f = options.fontWeight) !== null && _f !== void 0 ? _f : defaultOptions.fontWeight;
|
|
27988
28415
|
this._fill = (_g = options.fill) !== null && _g !== void 0 ? _g : defaultOptions.fill;
|
|
27989
28416
|
this._clipping = (_h = options.clipping) !== null && _h !== void 0 ? _h : defaultOptions.clipping;
|
|
27990
|
-
this.
|
|
27991
|
-
this.
|
|
28417
|
+
this._fitting = (_j = options.fitting) !== null && _j !== void 0 ? _j : defaultOptions.fitting;
|
|
28418
|
+
this._wordWrap = toEnum((_k = options.wordWrap) !== null && _k !== void 0 ? _k : defaultOptions.wordWrap, DDynamicTextStyleWordWrap);
|
|
28419
|
+
this._lineHeight = (_l = options.lineHeight) !== null && _l !== void 0 ? _l : defaultOptions.lineHeight;
|
|
27992
28420
|
}
|
|
27993
28421
|
else {
|
|
27994
28422
|
this._align = defaultOptions.align;
|
|
@@ -27999,9 +28427,14 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
27999
28427
|
this._fontWeight = defaultOptions.fontWeight;
|
|
28000
28428
|
this._fill = defaultOptions.fill;
|
|
28001
28429
|
this._clipping = defaultOptions.clipping;
|
|
28430
|
+
this._fitting = defaultOptions.fitting;
|
|
28002
28431
|
this._wordWrap = toEnum(defaultOptions.wordWrap, DDynamicTextStyleWordWrap);
|
|
28003
28432
|
this._lineHeight = defaultOptions.lineHeight;
|
|
28004
28433
|
}
|
|
28434
|
+
this._fontSizeFitted = this._fontSize;
|
|
28435
|
+
this._lineHeightFitted = this._lineHeight;
|
|
28436
|
+
this._isFontFitted = false;
|
|
28437
|
+
this._fontIdFontSize = this._fontSize;
|
|
28005
28438
|
this._fontIdId = -1;
|
|
28006
28439
|
this._fontId = "";
|
|
28007
28440
|
this._fontIdApproved = "";
|
|
@@ -28027,6 +28460,7 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
28027
28460
|
fontWeight: "normal",
|
|
28028
28461
|
fill: theme.getColor(new DBaseStateSetImpl()),
|
|
28029
28462
|
clipping: true,
|
|
28463
|
+
fitting: false,
|
|
28030
28464
|
wordWrap: DDynamicTextStyleWordWrap.NONE,
|
|
28031
28465
|
lineHeight: theme.getLineHeight()
|
|
28032
28466
|
};
|
|
@@ -28053,6 +28487,14 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
28053
28487
|
enumerable: false,
|
|
28054
28488
|
configurable: true
|
|
28055
28489
|
});
|
|
28490
|
+
Object.defineProperty(DDynamicTextStyle.prototype, "fontIdFontSize", {
|
|
28491
|
+
get: function () {
|
|
28492
|
+
this.update();
|
|
28493
|
+
return this._fontSizeFitted;
|
|
28494
|
+
},
|
|
28495
|
+
enumerable: false,
|
|
28496
|
+
configurable: true
|
|
28497
|
+
});
|
|
28056
28498
|
Object.defineProperty(DDynamicTextStyle.prototype, "fontIdApproved", {
|
|
28057
28499
|
get: function () {
|
|
28058
28500
|
return this._fontIdApproved;
|
|
@@ -28110,12 +28552,29 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
28110
28552
|
set: function (fontSize) {
|
|
28111
28553
|
if (this._fontSize !== fontSize) {
|
|
28112
28554
|
this._fontSize = fontSize;
|
|
28555
|
+
this._fontSizeFitted = fontSize;
|
|
28556
|
+
this._lineHeightFitted = this._lineHeight;
|
|
28557
|
+
this._isFontFitted = false;
|
|
28113
28558
|
this.onChange();
|
|
28114
28559
|
}
|
|
28115
28560
|
},
|
|
28116
28561
|
enumerable: false,
|
|
28117
28562
|
configurable: true
|
|
28118
28563
|
});
|
|
28564
|
+
Object.defineProperty(DDynamicTextStyle.prototype, "fontSizeFitted", {
|
|
28565
|
+
get: function () {
|
|
28566
|
+
return this._fontSizeFitted;
|
|
28567
|
+
},
|
|
28568
|
+
enumerable: false,
|
|
28569
|
+
configurable: true
|
|
28570
|
+
});
|
|
28571
|
+
Object.defineProperty(DDynamicTextStyle.prototype, "isFontFitted", {
|
|
28572
|
+
get: function () {
|
|
28573
|
+
return this._isFontFitted;
|
|
28574
|
+
},
|
|
28575
|
+
enumerable: false,
|
|
28576
|
+
configurable: true
|
|
28577
|
+
});
|
|
28119
28578
|
Object.defineProperty(DDynamicTextStyle.prototype, "fontStyle", {
|
|
28120
28579
|
get: function () {
|
|
28121
28580
|
return this._fontStyle;
|
|
@@ -28158,11 +28617,13 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
28158
28617
|
DDynamicTextStyle.prototype.update = function () {
|
|
28159
28618
|
if (this._fontIdId !== this._id) {
|
|
28160
28619
|
this._fontIdId = this._id;
|
|
28161
|
-
this.
|
|
28620
|
+
var fontIdFontSize = this._fitting ? this._fontSizeFitted : this._fontSize;
|
|
28621
|
+
this._fontIdFontSize = fontIdFontSize;
|
|
28622
|
+
this._fontId = this.toFontId(fontIdFontSize);
|
|
28162
28623
|
}
|
|
28163
28624
|
};
|
|
28164
|
-
DDynamicTextStyle.prototype.
|
|
28165
|
-
return "".concat(this._fontStyle, " ").concat(this._fontVariant, " ").concat(this._fontWeight, " ").concat(
|
|
28625
|
+
DDynamicTextStyle.prototype.toFontId = function (fontSize) {
|
|
28626
|
+
return "".concat(this._fontStyle, " ").concat(this._fontVariant, " ").concat(this._fontWeight, " ").concat(fontSize, "px ").concat(this._fontFamily);
|
|
28166
28627
|
};
|
|
28167
28628
|
Object.defineProperty(DDynamicTextStyle.prototype, "clipping", {
|
|
28168
28629
|
get: function () {
|
|
@@ -28177,6 +28638,19 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
28177
28638
|
enumerable: false,
|
|
28178
28639
|
configurable: true
|
|
28179
28640
|
});
|
|
28641
|
+
Object.defineProperty(DDynamicTextStyle.prototype, "fitting", {
|
|
28642
|
+
get: function () {
|
|
28643
|
+
return this._fitting;
|
|
28644
|
+
},
|
|
28645
|
+
set: function (fitting) {
|
|
28646
|
+
if (this._fitting !== fitting) {
|
|
28647
|
+
this._fitting = fitting;
|
|
28648
|
+
this.onChange();
|
|
28649
|
+
}
|
|
28650
|
+
},
|
|
28651
|
+
enumerable: false,
|
|
28652
|
+
configurable: true
|
|
28653
|
+
});
|
|
28180
28654
|
Object.defineProperty(DDynamicTextStyle.prototype, "wordWrap", {
|
|
28181
28655
|
get: function () {
|
|
28182
28656
|
return this._wordWrap;
|
|
@@ -28197,15 +28671,140 @@ var DDynamicTextStyle = /** @class */ (function () {
|
|
|
28197
28671
|
set: function (lineHeight) {
|
|
28198
28672
|
if (this._lineHeight !== lineHeight) {
|
|
28199
28673
|
this._lineHeight = lineHeight;
|
|
28674
|
+
this._fontSizeFitted = this._fontSize;
|
|
28675
|
+
this._lineHeightFitted = lineHeight;
|
|
28676
|
+
this._isFontFitted = false;
|
|
28677
|
+
this.onChange();
|
|
28678
|
+
}
|
|
28679
|
+
},
|
|
28680
|
+
enumerable: false,
|
|
28681
|
+
configurable: true
|
|
28682
|
+
});
|
|
28683
|
+
Object.defineProperty(DDynamicTextStyle.prototype, "lineHeightFitted", {
|
|
28684
|
+
get: function () {
|
|
28685
|
+
return this._lineHeightFitted;
|
|
28686
|
+
},
|
|
28687
|
+
set: function (lineHeightFitted) {
|
|
28688
|
+
if (this._lineHeightFitted !== lineHeightFitted) {
|
|
28689
|
+
this._lineHeightFitted = lineHeightFitted;
|
|
28200
28690
|
this.onChange();
|
|
28201
28691
|
}
|
|
28202
28692
|
},
|
|
28203
28693
|
enumerable: false,
|
|
28204
28694
|
configurable: true
|
|
28205
28695
|
});
|
|
28696
|
+
DDynamicTextStyle.prototype.fit = function (fontSize, lineHeight) {
|
|
28697
|
+
var isChanged = false;
|
|
28698
|
+
if (fontSize < this._fontSizeFitted) {
|
|
28699
|
+
this._fontSizeFitted = fontSize;
|
|
28700
|
+
isChanged = true;
|
|
28701
|
+
}
|
|
28702
|
+
if (this._lineHeightFitted !== lineHeight) {
|
|
28703
|
+
this._lineHeightFitted = lineHeight;
|
|
28704
|
+
isChanged = true;
|
|
28705
|
+
}
|
|
28706
|
+
if (this._isFontFitted !== true) {
|
|
28707
|
+
this._isFontFitted = true;
|
|
28708
|
+
isChanged = true;
|
|
28709
|
+
}
|
|
28710
|
+
if (isChanged) {
|
|
28711
|
+
this.onChange();
|
|
28712
|
+
}
|
|
28713
|
+
return isChanged;
|
|
28714
|
+
};
|
|
28715
|
+
DDynamicTextStyle.prototype.unfit = function () {
|
|
28716
|
+
var isChanged = false;
|
|
28717
|
+
if (this._isFontFitted !== false) {
|
|
28718
|
+
this._isFontFitted = false;
|
|
28719
|
+
isChanged = true;
|
|
28720
|
+
}
|
|
28721
|
+
if (this._fontSizeFitted !== this._fontSize) {
|
|
28722
|
+
this._fontSizeFitted = this._fontSize;
|
|
28723
|
+
isChanged = true;
|
|
28724
|
+
}
|
|
28725
|
+
if (this._lineHeightFitted !== this._lineHeight) {
|
|
28726
|
+
this._lineHeightFitted = this._lineHeight;
|
|
28727
|
+
isChanged = true;
|
|
28728
|
+
}
|
|
28729
|
+
if (isChanged) {
|
|
28730
|
+
this.onChange();
|
|
28731
|
+
}
|
|
28732
|
+
return isChanged;
|
|
28733
|
+
};
|
|
28206
28734
|
return DDynamicTextStyle;
|
|
28207
28735
|
}());
|
|
28208
28736
|
|
|
28737
|
+
/*
|
|
28738
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
28739
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
28740
|
+
*/
|
|
28741
|
+
var UtilFont = /** @class */ (function () {
|
|
28742
|
+
function UtilFont() {
|
|
28743
|
+
}
|
|
28744
|
+
UtilFont.measure = function (font) {
|
|
28745
|
+
var results = this._results;
|
|
28746
|
+
if (results == null) {
|
|
28747
|
+
results = new Map();
|
|
28748
|
+
this._results = results;
|
|
28749
|
+
}
|
|
28750
|
+
var result = results.get(font);
|
|
28751
|
+
if (result != null) {
|
|
28752
|
+
return result;
|
|
28753
|
+
}
|
|
28754
|
+
this.setup(font);
|
|
28755
|
+
var blockRect = this._block.getBoundingClientRect();
|
|
28756
|
+
var blockRectTop = blockRect.top;
|
|
28757
|
+
var spanRect = this._span.getBoundingClientRect();
|
|
28758
|
+
var ascent = blockRectTop - spanRect.top;
|
|
28759
|
+
var descent = spanRect.bottom - blockRectTop;
|
|
28760
|
+
result = {
|
|
28761
|
+
ascent: ascent,
|
|
28762
|
+
descent: descent
|
|
28763
|
+
};
|
|
28764
|
+
results.set(font, result);
|
|
28765
|
+
return result;
|
|
28766
|
+
};
|
|
28767
|
+
UtilFont.toSize = function (font) {
|
|
28768
|
+
this.setup(font);
|
|
28769
|
+
return parseFloat(window.getComputedStyle(this._span).fontSize);
|
|
28770
|
+
};
|
|
28771
|
+
UtilFont.setup = function (font) {
|
|
28772
|
+
var span = this._span;
|
|
28773
|
+
if (span == null) {
|
|
28774
|
+
span = document.createElement("span");
|
|
28775
|
+
span.innerText = "|ÉqÅ";
|
|
28776
|
+
span.style.border = "none";
|
|
28777
|
+
span.style.margin = "0px";
|
|
28778
|
+
this._span = span;
|
|
28779
|
+
}
|
|
28780
|
+
var block = this._block;
|
|
28781
|
+
if (block == null) {
|
|
28782
|
+
block = document.createElement("div");
|
|
28783
|
+
block.style.display = "inline-block";
|
|
28784
|
+
block.style.width = "0px";
|
|
28785
|
+
block.style.height = "0px";
|
|
28786
|
+
block.style.border = "none";
|
|
28787
|
+
block.style.margin = "0px";
|
|
28788
|
+
block.style.verticalAlign = "baseline";
|
|
28789
|
+
this._block = block;
|
|
28790
|
+
}
|
|
28791
|
+
var div = this._div;
|
|
28792
|
+
if (div == null) {
|
|
28793
|
+
div = document.createElement("div");
|
|
28794
|
+
div.style.position = "absolute";
|
|
28795
|
+
div.style.padding = "0px";
|
|
28796
|
+
div.style.margin = "0px";
|
|
28797
|
+
div.style.visibility = "hidden";
|
|
28798
|
+
div.appendChild(span);
|
|
28799
|
+
div.appendChild(block);
|
|
28800
|
+
document.body.appendChild(div);
|
|
28801
|
+
this._div = div;
|
|
28802
|
+
}
|
|
28803
|
+
span.style.font = font;
|
|
28804
|
+
};
|
|
28805
|
+
return UtilFont;
|
|
28806
|
+
}());
|
|
28807
|
+
|
|
28209
28808
|
/*
|
|
28210
28809
|
* Copyright (C) 2019 Toshiba Corporation
|
|
28211
28810
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -28228,8 +28827,9 @@ var DDynamicText = /** @class */ (function (_super) {
|
|
|
28228
28827
|
_this._atlasRevisionUpdated = 0;
|
|
28229
28828
|
_this._width = 0;
|
|
28230
28829
|
_this._height = 0;
|
|
28231
|
-
_this.
|
|
28232
|
-
|
|
28830
|
+
_this._modifier = {
|
|
28831
|
+
clipping: false,
|
|
28832
|
+
fitting: false,
|
|
28233
28833
|
wordWrap: DDynamicTextStyleWordWrap.NONE,
|
|
28234
28834
|
width: 0,
|
|
28235
28835
|
height: 0,
|
|
@@ -28253,13 +28853,13 @@ var DDynamicText = /** @class */ (function (_super) {
|
|
|
28253
28853
|
this._textApproved = text;
|
|
28254
28854
|
var fontId = style.fontId;
|
|
28255
28855
|
var fontIdApproved = style.fontIdApproved;
|
|
28256
|
-
var
|
|
28856
|
+
var fontIdFontSize = style.fontIdFontSize;
|
|
28257
28857
|
var fill = style.fill;
|
|
28258
28858
|
var fillApproved = style.fillApproved;
|
|
28259
28859
|
style.approve();
|
|
28260
28860
|
var atlases = layer.getDynamicFontAtlases();
|
|
28261
28861
|
if (text !== textApproved || fontId !== fontIdApproved || fill !== fillApproved) {
|
|
28262
|
-
atlases.add(fontId,
|
|
28862
|
+
atlases.add(fontId, fontIdFontSize, fill, text);
|
|
28263
28863
|
atlases.remove(fontIdApproved, fillApproved, textApproved);
|
|
28264
28864
|
}
|
|
28265
28865
|
}
|
|
@@ -28272,9 +28872,11 @@ var DDynamicText = /** @class */ (function (_super) {
|
|
|
28272
28872
|
set: function (text) {
|
|
28273
28873
|
if (this._text !== text) {
|
|
28274
28874
|
this._text = text;
|
|
28275
|
-
this.
|
|
28276
|
-
|
|
28277
|
-
|
|
28875
|
+
if (!this._style.unfit()) {
|
|
28876
|
+
this._isDirty = true;
|
|
28877
|
+
this._isGeometryDirty = true;
|
|
28878
|
+
this.update_();
|
|
28879
|
+
}
|
|
28278
28880
|
}
|
|
28279
28881
|
},
|
|
28280
28882
|
enumerable: false,
|
|
@@ -28329,13 +28931,14 @@ var DDynamicText = /** @class */ (function (_super) {
|
|
|
28329
28931
|
configurable: true
|
|
28330
28932
|
});
|
|
28331
28933
|
DDynamicText.prototype.update = function () {
|
|
28934
|
+
var _this = this;
|
|
28332
28935
|
this.update_();
|
|
28936
|
+
var style = this._style;
|
|
28333
28937
|
var atlas = this._atlas;
|
|
28334
28938
|
if (atlas == null) {
|
|
28335
28939
|
var layer = DApplications.getLayer(this);
|
|
28336
28940
|
if (layer) {
|
|
28337
|
-
|
|
28338
|
-
atlas = layer.getDynamicFontAtlases().get(style_1.fontId, style_1.fill);
|
|
28941
|
+
atlas = layer.getDynamicFontAtlases().get(style.fontId, style.fill);
|
|
28339
28942
|
if (atlas != null) {
|
|
28340
28943
|
this._atlasRevisionUpdated = atlas.getRevisionUpdate();
|
|
28341
28944
|
this._atlas = atlas;
|
|
@@ -28351,50 +28954,68 @@ var DDynamicText = /** @class */ (function (_super) {
|
|
|
28351
28954
|
this._isGeometryDirty = true;
|
|
28352
28955
|
}
|
|
28353
28956
|
}
|
|
28354
|
-
var
|
|
28355
|
-
|
|
28356
|
-
if (this.updateClipping(style, clipping)) {
|
|
28957
|
+
var modifier = this._modifier;
|
|
28958
|
+
if (this.updateClipping(style, modifier)) {
|
|
28357
28959
|
this._isGeometryDirty = true;
|
|
28358
28960
|
}
|
|
28359
28961
|
if (this._isGeometryDirty) {
|
|
28360
28962
|
this._isGeometryDirty = false;
|
|
28361
|
-
this.geometry
|
|
28963
|
+
var geometry = this.geometry;
|
|
28964
|
+
geometry.update(this._text, atlas, modifier);
|
|
28965
|
+
if (modifier.fitting && !style.isFontFitted && geometry.scaled) {
|
|
28966
|
+
var oldScale = geometry.scale;
|
|
28967
|
+
var oldFontSize = style.fontSize;
|
|
28968
|
+
var newFontId = style.toFontId(Math.ceil(oldFontSize * oldScale * 1000) / 1000);
|
|
28969
|
+
var newFontSize = UtilFont.toSize(newFontId);
|
|
28970
|
+
var newScale = newFontSize / oldFontSize;
|
|
28971
|
+
var newLineHeight = style.lineHeight * newScale;
|
|
28972
|
+
if (style.fit(newFontSize, newLineHeight)) {
|
|
28973
|
+
setTimeout(function () {
|
|
28974
|
+
DApplications.update(_this);
|
|
28975
|
+
}, 0);
|
|
28976
|
+
}
|
|
28977
|
+
}
|
|
28362
28978
|
}
|
|
28363
28979
|
};
|
|
28364
|
-
DDynamicText.prototype.updateClipping = function (style,
|
|
28980
|
+
DDynamicText.prototype.updateClipping = function (style, modifier) {
|
|
28365
28981
|
var isChanged = false;
|
|
28366
28982
|
var styleClipping = style.clipping;
|
|
28367
|
-
if (clipping
|
|
28368
|
-
clipping
|
|
28983
|
+
if (modifier.clipping !== styleClipping) {
|
|
28984
|
+
modifier.clipping = styleClipping;
|
|
28985
|
+
isChanged = true;
|
|
28986
|
+
}
|
|
28987
|
+
var styleFitting = style.fitting;
|
|
28988
|
+
if (modifier.fitting !== styleFitting) {
|
|
28989
|
+
modifier.fitting = styleFitting;
|
|
28369
28990
|
isChanged = true;
|
|
28370
28991
|
}
|
|
28371
28992
|
var styleWordWrap = style.wordWrap;
|
|
28372
|
-
if (
|
|
28373
|
-
|
|
28993
|
+
if (modifier.wordWrap !== styleWordWrap) {
|
|
28994
|
+
modifier.wordWrap = styleWordWrap;
|
|
28374
28995
|
isChanged = true;
|
|
28375
28996
|
}
|
|
28376
|
-
var styleLineHeight = style.lineHeight;
|
|
28377
|
-
if (
|
|
28378
|
-
|
|
28997
|
+
var styleLineHeight = styleFitting ? style.lineHeightFitted : style.lineHeight;
|
|
28998
|
+
if (modifier.lineHeight !== styleLineHeight) {
|
|
28999
|
+
modifier.lineHeight = styleLineHeight;
|
|
28379
29000
|
isChanged = true;
|
|
28380
29001
|
}
|
|
28381
|
-
if (styleClipping || styleWordWrap) {
|
|
29002
|
+
if (styleClipping || styleFitting || styleWordWrap) {
|
|
28382
29003
|
var parent_1 = this.parent;
|
|
28383
29004
|
if (parent_1 instanceof DBase) {
|
|
28384
29005
|
var width = parent_1.width -
|
|
28385
29006
|
parent_1.padding.getLeft() -
|
|
28386
29007
|
parent_1.padding.getRight() -
|
|
28387
|
-
|
|
28388
|
-
if (
|
|
28389
|
-
|
|
29008
|
+
modifier.delta.width;
|
|
29009
|
+
if (modifier.width !== width) {
|
|
29010
|
+
modifier.width = width;
|
|
28390
29011
|
isChanged = true;
|
|
28391
29012
|
}
|
|
28392
29013
|
var height = parent_1.height -
|
|
28393
29014
|
parent_1.padding.getTop() -
|
|
28394
29015
|
parent_1.padding.getBottom() -
|
|
28395
|
-
|
|
28396
|
-
if (
|
|
28397
|
-
|
|
29016
|
+
modifier.delta.height;
|
|
29017
|
+
if (modifier.height !== height) {
|
|
29018
|
+
modifier.height = height;
|
|
28398
29019
|
isChanged = true;
|
|
28399
29020
|
}
|
|
28400
29021
|
}
|
|
@@ -28402,7 +29023,7 @@ var DDynamicText = /** @class */ (function (_super) {
|
|
|
28402
29023
|
return isChanged;
|
|
28403
29024
|
};
|
|
28404
29025
|
DDynamicText.prototype.setClippingDelta = function (width, height) {
|
|
28405
|
-
var delta = this.
|
|
29026
|
+
var delta = this._modifier.delta;
|
|
28406
29027
|
delta.width = width;
|
|
28407
29028
|
delta.height = height;
|
|
28408
29029
|
};
|
|
@@ -28422,7 +29043,7 @@ var DDynamicText = /** @class */ (function (_super) {
|
|
|
28422
29043
|
* SPDX-License-Identifier: Apache-2.0
|
|
28423
29044
|
*/
|
|
28424
29045
|
var toTextStyle = function (theme, options, state) {
|
|
28425
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
29046
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
28426
29047
|
var style = (_a = options === null || options === void 0 ? void 0 : options.text) === null || _a === void 0 ? void 0 : _a.style;
|
|
28427
29048
|
if (style != null) {
|
|
28428
29049
|
var fill = (_b = style.fill) !== null && _b !== void 0 ? _b : theme.getColor(state);
|
|
@@ -28432,8 +29053,9 @@ var toTextStyle = function (theme, options, state) {
|
|
|
28432
29053
|
var fontStyle = (_f = style.fontStyle) !== null && _f !== void 0 ? _f : theme.getFontStyle();
|
|
28433
29054
|
var fontVariant = (_g = style.fontVariant) !== null && _g !== void 0 ? _g : theme.getFontVariant();
|
|
28434
29055
|
var clipping = (_h = style.clipping) !== null && _h !== void 0 ? _h : theme.getTextStyleClipping();
|
|
28435
|
-
var
|
|
28436
|
-
var
|
|
29056
|
+
var fitting = (_j = style.fitting) !== null && _j !== void 0 ? _j : theme.getTextStyleFitting();
|
|
29057
|
+
var wordWrap = (_k = style.wordWrap) !== null && _k !== void 0 ? _k : theme.getTextStyleWordWrap();
|
|
29058
|
+
var lineHeight = (_l = style.lineHeight) !== null && _l !== void 0 ? _l : theme.getLineHeight();
|
|
28437
29059
|
return {
|
|
28438
29060
|
fill: fill,
|
|
28439
29061
|
fontSize: fontSize,
|
|
@@ -28442,6 +29064,7 @@ var toTextStyle = function (theme, options, state) {
|
|
|
28442
29064
|
fontStyle: fontStyle,
|
|
28443
29065
|
fontVariant: fontVariant,
|
|
28444
29066
|
clipping: clipping,
|
|
29067
|
+
fitting: fitting,
|
|
28445
29068
|
wordWrap: wordWrap,
|
|
28446
29069
|
lineHeight: lineHeight
|
|
28447
29070
|
};
|
|
@@ -28454,6 +29077,7 @@ var toTextStyle = function (theme, options, state) {
|
|
|
28454
29077
|
fontStyle: theme.getFontStyle(),
|
|
28455
29078
|
fontVariant: theme.getFontVariant(),
|
|
28456
29079
|
clipping: theme.getTextStyleClipping(),
|
|
29080
|
+
fitting: theme.getTextStyleFitting(),
|
|
28457
29081
|
wordWrap: theme.getTextStyleWordWrap(),
|
|
28458
29082
|
lineHeight: theme.getLineHeight()
|
|
28459
29083
|
};
|
|
@@ -43009,11 +43633,27 @@ var DLinks = /** @class */ (function () {
|
|
|
43009
43633
|
options.state = [state, DBaseState.NEW_WINDOW];
|
|
43010
43634
|
}
|
|
43011
43635
|
}
|
|
43012
|
-
else {
|
|
43636
|
+
else if (isArray(state)) {
|
|
43013
43637
|
if (state.indexOf(DBaseState.NEW_WINDOW) < 0) {
|
|
43014
43638
|
state.push(DBaseState.NEW_WINDOW);
|
|
43015
43639
|
}
|
|
43016
43640
|
}
|
|
43641
|
+
else {
|
|
43642
|
+
var values = state.values;
|
|
43643
|
+
if (values == null) {
|
|
43644
|
+
state.values = DBaseState.NEW_WINDOW;
|
|
43645
|
+
}
|
|
43646
|
+
else if (isString(values)) {
|
|
43647
|
+
if (values !== DBaseState.NEW_WINDOW) {
|
|
43648
|
+
state.values = [values, DBaseState.NEW_WINDOW];
|
|
43649
|
+
}
|
|
43650
|
+
}
|
|
43651
|
+
else {
|
|
43652
|
+
if (values.indexOf(DBaseState.NEW_WINDOW) < 0) {
|
|
43653
|
+
values.push(DBaseState.NEW_WINDOW);
|
|
43654
|
+
}
|
|
43655
|
+
}
|
|
43656
|
+
}
|
|
43017
43657
|
}
|
|
43018
43658
|
}
|
|
43019
43659
|
return options;
|
|
@@ -46049,6 +46689,9 @@ var DThemeWhiteTextBase = /** @class */ (function (_super) {
|
|
|
46049
46689
|
DThemeWhiteTextBase.prototype.getTextStyleClipping = function () {
|
|
46050
46690
|
return true;
|
|
46051
46691
|
};
|
|
46692
|
+
DThemeWhiteTextBase.prototype.getTextStyleFitting = function () {
|
|
46693
|
+
return false;
|
|
46694
|
+
};
|
|
46052
46695
|
DThemeWhiteTextBase.prototype.getTextStyleWordWrap = function () {
|
|
46053
46696
|
return DDynamicTextStyleWordWrap.NONE;
|
|
46054
46697
|
};
|
|
@@ -55763,6 +56406,9 @@ var DThemeDarkTextBase = /** @class */ (function (_super) {
|
|
|
55763
56406
|
DThemeDarkTextBase.prototype.getTextStyleClipping = function () {
|
|
55764
56407
|
return true;
|
|
55765
56408
|
};
|
|
56409
|
+
DThemeDarkTextBase.prototype.getTextStyleFitting = function () {
|
|
56410
|
+
return false;
|
|
56411
|
+
};
|
|
55766
56412
|
DThemeDarkTextBase.prototype.getTextStyleWordWrap = function () {
|
|
55767
56413
|
return DDynamicTextStyleWordWrap.NONE;
|
|
55768
56414
|
};
|
|
@@ -64536,70 +65182,6 @@ var DynamicAtlasItemText = /** @class */ (function (_super) {
|
|
|
64536
65182
|
return DynamicAtlasItemText;
|
|
64537
65183
|
}(DynamicAtlasItem));
|
|
64538
65184
|
|
|
64539
|
-
/*
|
|
64540
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
64541
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
64542
|
-
*/
|
|
64543
|
-
var UtilFont = /** @class */ (function () {
|
|
64544
|
-
function UtilFont() {
|
|
64545
|
-
}
|
|
64546
|
-
UtilFont.measure = function (font) {
|
|
64547
|
-
var results = this._results;
|
|
64548
|
-
if (results == null) {
|
|
64549
|
-
results = new Map();
|
|
64550
|
-
this._results = results;
|
|
64551
|
-
}
|
|
64552
|
-
var result = results.get(font);
|
|
64553
|
-
if (result != null) {
|
|
64554
|
-
return result;
|
|
64555
|
-
}
|
|
64556
|
-
var span = this._span;
|
|
64557
|
-
if (span == null) {
|
|
64558
|
-
span = document.createElement("span");
|
|
64559
|
-
span.innerText = "|ÉqÅ";
|
|
64560
|
-
span.style.border = "none";
|
|
64561
|
-
span.style.margin = "0px";
|
|
64562
|
-
this._span = span;
|
|
64563
|
-
}
|
|
64564
|
-
var block = this._block;
|
|
64565
|
-
if (block == null) {
|
|
64566
|
-
block = document.createElement("div");
|
|
64567
|
-
block.style.display = "inline-block";
|
|
64568
|
-
block.style.width = "0px";
|
|
64569
|
-
block.style.height = "0px";
|
|
64570
|
-
block.style.border = "none";
|
|
64571
|
-
block.style.margin = "0px";
|
|
64572
|
-
block.style.verticalAlign = "baseline";
|
|
64573
|
-
this._block = block;
|
|
64574
|
-
}
|
|
64575
|
-
var div = this._div;
|
|
64576
|
-
if (div == null) {
|
|
64577
|
-
div = document.createElement("div");
|
|
64578
|
-
div.style.position = "absolute";
|
|
64579
|
-
div.style.padding = "0px";
|
|
64580
|
-
div.style.margin = "0px";
|
|
64581
|
-
div.style.visibility = "hidden";
|
|
64582
|
-
div.appendChild(span);
|
|
64583
|
-
div.appendChild(block);
|
|
64584
|
-
document.body.appendChild(div);
|
|
64585
|
-
this._div = div;
|
|
64586
|
-
}
|
|
64587
|
-
span.style.font = font;
|
|
64588
|
-
var blockRect = block.getBoundingClientRect();
|
|
64589
|
-
var blockRectTop = blockRect.top;
|
|
64590
|
-
var spanRect = span.getBoundingClientRect();
|
|
64591
|
-
var ascent = blockRectTop - spanRect.top;
|
|
64592
|
-
var descent = spanRect.bottom - blockRectTop;
|
|
64593
|
-
result = {
|
|
64594
|
-
ascent: ascent,
|
|
64595
|
-
descent: descent
|
|
64596
|
-
};
|
|
64597
|
-
results.set(font, result);
|
|
64598
|
-
return result;
|
|
64599
|
-
};
|
|
64600
|
-
return UtilFont;
|
|
64601
|
-
}());
|
|
64602
|
-
|
|
64603
65185
|
/*
|
|
64604
65186
|
* Copyright (C) 2019 Toshiba Corporation
|
|
64605
65187
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -72715,6 +73297,80 @@ var DChartAxisBaseBar = /** @class */ (function () {
|
|
|
72715
73297
|
return DChartAxisBaseBar;
|
|
72716
73298
|
}());
|
|
72717
73299
|
|
|
73300
|
+
var DChartAxisBaseGuideContainer = /** @class */ (function () {
|
|
73301
|
+
function DChartAxisBaseGuideContainer(axis) {
|
|
73302
|
+
this._axis = axis;
|
|
73303
|
+
this._index = 0;
|
|
73304
|
+
this._list = [];
|
|
73305
|
+
}
|
|
73306
|
+
DChartAxisBaseGuideContainer.prototype.add = function (guide) {
|
|
73307
|
+
this._list.push(guide);
|
|
73308
|
+
var container = this._container;
|
|
73309
|
+
var index = this._index;
|
|
73310
|
+
if (container != null) {
|
|
73311
|
+
guide.bind(container, index, this._axis);
|
|
73312
|
+
}
|
|
73313
|
+
return this;
|
|
73314
|
+
};
|
|
73315
|
+
DChartAxisBaseGuideContainer.prototype.get = function (index) {
|
|
73316
|
+
var list = this._list;
|
|
73317
|
+
if (0 <= index && index < list.length) {
|
|
73318
|
+
return list[index];
|
|
73319
|
+
}
|
|
73320
|
+
return null;
|
|
73321
|
+
};
|
|
73322
|
+
DChartAxisBaseGuideContainer.prototype.indexOf = function (guide) {
|
|
73323
|
+
return this._list.indexOf(guide);
|
|
73324
|
+
};
|
|
73325
|
+
DChartAxisBaseGuideContainer.prototype.clear = function () {
|
|
73326
|
+
var list = this._list;
|
|
73327
|
+
for (var i = 0, imax = list.length; i < imax; ++i) {
|
|
73328
|
+
list[i].destroy();
|
|
73329
|
+
}
|
|
73330
|
+
list.length = 0;
|
|
73331
|
+
return this;
|
|
73332
|
+
};
|
|
73333
|
+
DChartAxisBaseGuideContainer.prototype.size = function () {
|
|
73334
|
+
return this._list.length;
|
|
73335
|
+
};
|
|
73336
|
+
DChartAxisBaseGuideContainer.prototype.bind = function (container, index) {
|
|
73337
|
+
this._container = container;
|
|
73338
|
+
this._index = index;
|
|
73339
|
+
var axis = this._axis;
|
|
73340
|
+
var list = this._list;
|
|
73341
|
+
for (var i = 0, imax = list.length; i < imax; ++i) {
|
|
73342
|
+
list[i].bind(container, index, axis);
|
|
73343
|
+
}
|
|
73344
|
+
};
|
|
73345
|
+
DChartAxisBaseGuideContainer.prototype.unbind = function () {
|
|
73346
|
+
var list = this._list;
|
|
73347
|
+
for (var i = 0, imax = list.length; i < imax; ++i) {
|
|
73348
|
+
list[i].unbind();
|
|
73349
|
+
}
|
|
73350
|
+
this._index = 0;
|
|
73351
|
+
this._container = undefined;
|
|
73352
|
+
};
|
|
73353
|
+
DChartAxisBaseGuideContainer.prototype.update = function () {
|
|
73354
|
+
var isUpdated = false;
|
|
73355
|
+
var list = this._list;
|
|
73356
|
+
for (var i = 0, imax = list.length; i < imax; ++i) {
|
|
73357
|
+
if (list[i].update()) {
|
|
73358
|
+
isUpdated = true;
|
|
73359
|
+
}
|
|
73360
|
+
}
|
|
73361
|
+
return isUpdated;
|
|
73362
|
+
};
|
|
73363
|
+
DChartAxisBaseGuideContainer.prototype.destroy = function () {
|
|
73364
|
+
var list = this._list;
|
|
73365
|
+
for (var i = 0, imax = list.length; i < imax; ++i) {
|
|
73366
|
+
list[i].destroy();
|
|
73367
|
+
}
|
|
73368
|
+
this._index = 0;
|
|
73369
|
+
this._container = undefined;
|
|
73370
|
+
};
|
|
73371
|
+
return DChartAxisBaseGuideContainer;
|
|
73372
|
+
}());
|
|
73373
|
+
|
|
72718
73374
|
/*
|
|
72719
73375
|
* Copyright (C) 2019 Toshiba Corporation
|
|
72720
73376
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -72728,6 +73384,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
|
|
|
72728
73384
|
this.label = this.toLabel(theme, options);
|
|
72729
73385
|
this.padding = (_b = options === null || options === void 0 ? void 0 : options.padding) !== null && _b !== void 0 ? _b : theme.getPadding();
|
|
72730
73386
|
this.bar = this.toBar(theme, options);
|
|
73387
|
+
this.guide = this.toGuide(theme, options);
|
|
72731
73388
|
}
|
|
72732
73389
|
DChartAxisBaseOptionParser.prototype.toPosition = function (theme, options) {
|
|
72733
73390
|
var position = options === null || options === void 0 ? void 0 : options.position;
|
|
@@ -72739,6 +73396,12 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
|
|
|
72739
73396
|
}
|
|
72740
73397
|
return theme.getPosition();
|
|
72741
73398
|
};
|
|
73399
|
+
DChartAxisBaseOptionParser.prototype.toGuide = function (theme, options) {
|
|
73400
|
+
var _a, _b;
|
|
73401
|
+
return {
|
|
73402
|
+
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 : []
|
|
73403
|
+
};
|
|
73404
|
+
};
|
|
72742
73405
|
DChartAxisBaseOptionParser.prototype.toBar = function (theme, options) {
|
|
72743
73406
|
var _a;
|
|
72744
73407
|
return {
|
|
@@ -73720,6 +74383,7 @@ var DChartAxisBase = /** @class */ (function () {
|
|
|
73720
74383
|
this._index = 0;
|
|
73721
74384
|
this._bar = this.newBar(parser, theme, options);
|
|
73722
74385
|
this._tick = this.newTick(parser, theme, options);
|
|
74386
|
+
this._guide = this.newGuide(parser, theme, options);
|
|
73723
74387
|
}
|
|
73724
74388
|
DChartAxisBase.prototype.newParser = function (theme, options) {
|
|
73725
74389
|
return new DChartAxisBaseOptionParser(theme, options);
|
|
@@ -73774,13 +74438,30 @@ var DChartAxisBase = /** @class */ (function () {
|
|
|
73774
74438
|
DChartAxisBase.prototype.newTick = function (parser, theme, options) {
|
|
73775
74439
|
return new DChartAxisBaseTickContainer(parser);
|
|
73776
74440
|
};
|
|
74441
|
+
Object.defineProperty(DChartAxisBase.prototype, "guide", {
|
|
74442
|
+
get: function () {
|
|
74443
|
+
return this._guide;
|
|
74444
|
+
},
|
|
74445
|
+
enumerable: false,
|
|
74446
|
+
configurable: true
|
|
74447
|
+
});
|
|
74448
|
+
DChartAxisBase.prototype.newGuide = function (parser, theme, options) {
|
|
74449
|
+
var result = new DChartAxisBaseGuideContainer(this);
|
|
74450
|
+
var list = parser.guide.list;
|
|
74451
|
+
for (var i = 0, imax = list.length; i < imax; ++i) {
|
|
74452
|
+
result.add(list[i]);
|
|
74453
|
+
}
|
|
74454
|
+
return result;
|
|
74455
|
+
};
|
|
73777
74456
|
DChartAxisBase.prototype.bind = function (container, index) {
|
|
73778
74457
|
this._container = container;
|
|
73779
74458
|
this._index = index;
|
|
73780
74459
|
this._bar.bind(container, index);
|
|
73781
74460
|
this._tick.bind(container, index);
|
|
74461
|
+
this._guide.bind(container, index);
|
|
73782
74462
|
};
|
|
73783
74463
|
DChartAxisBase.prototype.unbind = function () {
|
|
74464
|
+
this._guide.unbind();
|
|
73784
74465
|
this._tick.unbind();
|
|
73785
74466
|
this._bar.unbind();
|
|
73786
74467
|
this._index = 0;
|
|
@@ -73789,7 +74470,8 @@ var DChartAxisBase = /** @class */ (function () {
|
|
|
73789
74470
|
DChartAxisBase.prototype.update = function () {
|
|
73790
74471
|
var isBarUpdated = this._bar.update();
|
|
73791
74472
|
var isTicksUpdated = this._tick.update();
|
|
73792
|
-
|
|
74473
|
+
var isGuideUpdated = this._guide.update();
|
|
74474
|
+
if (isBarUpdated || isTicksUpdated || isGuideUpdated) {
|
|
73793
74475
|
var container = this._container;
|
|
73794
74476
|
if (container) {
|
|
73795
74477
|
DApplications.update(container.plotArea);
|
|
@@ -73799,10 +74481,12 @@ var DChartAxisBase = /** @class */ (function () {
|
|
|
73799
74481
|
DChartAxisBase.prototype.onRender = function () {
|
|
73800
74482
|
this._bar.update();
|
|
73801
74483
|
this._tick.update();
|
|
74484
|
+
this._guide.update();
|
|
73802
74485
|
};
|
|
73803
74486
|
DChartAxisBase.prototype.destroy = function () {
|
|
73804
74487
|
this._bar.destroy();
|
|
73805
74488
|
this._tick.destroy();
|
|
74489
|
+
this._guide.destroy();
|
|
73806
74490
|
this._container = undefined;
|
|
73807
74491
|
};
|
|
73808
74492
|
DChartAxisBase.prototype.toTheme = function (options) {
|
|
@@ -73914,6 +74598,441 @@ var DChartAxisContainerImpl = /** @class */ (function () {
|
|
|
73914
74598
|
return DChartAxisContainerImpl;
|
|
73915
74599
|
}());
|
|
73916
74600
|
|
|
74601
|
+
var DChartAxisGuideSimpleShapeImpl = /** @class */ (function () {
|
|
74602
|
+
function DChartAxisGuideSimpleShapeImpl(options) {
|
|
74603
|
+
this._options = options;
|
|
74604
|
+
}
|
|
74605
|
+
Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "bar", {
|
|
74606
|
+
get: function () {
|
|
74607
|
+
var result = this._bar;
|
|
74608
|
+
if (result === undefined) {
|
|
74609
|
+
result = this.newBar();
|
|
74610
|
+
this._bar = result;
|
|
74611
|
+
}
|
|
74612
|
+
return result;
|
|
74613
|
+
},
|
|
74614
|
+
enumerable: false,
|
|
74615
|
+
configurable: true
|
|
74616
|
+
});
|
|
74617
|
+
DChartAxisGuideSimpleShapeImpl.prototype.newBar = function () {
|
|
74618
|
+
var _a, _b;
|
|
74619
|
+
var bar = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.bar) !== null && _b !== void 0 ? _b : {};
|
|
74620
|
+
if (bar.enable !== false) {
|
|
74621
|
+
var result = new EShapeBar();
|
|
74622
|
+
result.stroke.copy(this.toStrokeOptions(bar.stroke, EShapeStrokeStyle.DASHED));
|
|
74623
|
+
result.text.copy(this.toTextOptions(bar.text));
|
|
74624
|
+
return result;
|
|
74625
|
+
}
|
|
74626
|
+
return null;
|
|
74627
|
+
};
|
|
74628
|
+
DChartAxisGuideSimpleShapeImpl.prototype.toStrokeOptions = function (options, style) {
|
|
74629
|
+
var _a;
|
|
74630
|
+
options = options || {};
|
|
74631
|
+
return {
|
|
74632
|
+
enable: options.enable,
|
|
74633
|
+
color: options.color,
|
|
74634
|
+
alpha: options.alpha,
|
|
74635
|
+
width: options.width,
|
|
74636
|
+
align: options.align,
|
|
74637
|
+
side: toEnum(options.side, EShapeStrokeSide),
|
|
74638
|
+
style: toEnum((_a = options.style) !== null && _a !== void 0 ? _a : style, EShapeStrokeStyle)
|
|
74639
|
+
};
|
|
74640
|
+
};
|
|
74641
|
+
DChartAxisGuideSimpleShapeImpl.prototype.toTextOptions = function (options) {
|
|
74642
|
+
options = options || {};
|
|
74643
|
+
return {
|
|
74644
|
+
value: options.value,
|
|
74645
|
+
color: options.color,
|
|
74646
|
+
alpha: options.alpha,
|
|
74647
|
+
family: options.family,
|
|
74648
|
+
size: options.size,
|
|
74649
|
+
weight: toEnum(options.weight, EShapeTextWeight),
|
|
74650
|
+
align: this.toTextAlignOptions(options.align),
|
|
74651
|
+
offset: options.offset,
|
|
74652
|
+
style: toEnum(options.style, EShapeTextStyle),
|
|
74653
|
+
outline: options.outline,
|
|
74654
|
+
spacing: options.spacing,
|
|
74655
|
+
direction: toEnum(options.direction, EShapeTextDirection),
|
|
74656
|
+
padding: options.padding,
|
|
74657
|
+
clipping: options.clipping,
|
|
74658
|
+
fitting: options.fitting
|
|
74659
|
+
};
|
|
74660
|
+
};
|
|
74661
|
+
DChartAxisGuideSimpleShapeImpl.prototype.toTextAlignOptions = function (options) {
|
|
74662
|
+
options = options || {};
|
|
74663
|
+
return {
|
|
74664
|
+
horizontal: toEnum(options === null || options === void 0 ? void 0 : options.horizontal, EShapeTextAlignHorizontal),
|
|
74665
|
+
vertical: toEnum(options === null || options === void 0 ? void 0 : options.vertical, EShapeTextAlignVertical)
|
|
74666
|
+
};
|
|
74667
|
+
};
|
|
74668
|
+
DChartAxisGuideSimpleShapeImpl.prototype.toBarPosition = function (axis) {
|
|
74669
|
+
switch (axis.position) {
|
|
74670
|
+
case DChartAxisPosition.LEFT:
|
|
74671
|
+
case DChartAxisPosition.RIGHT:
|
|
74672
|
+
return EShapeBarPosition.LEFT;
|
|
74673
|
+
default:
|
|
74674
|
+
return EShapeBarPosition.TOP;
|
|
74675
|
+
}
|
|
74676
|
+
};
|
|
74677
|
+
Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "label", {
|
|
74678
|
+
get: function () {
|
|
74679
|
+
var result = this._label;
|
|
74680
|
+
if (result === undefined) {
|
|
74681
|
+
result = this.newLabel();
|
|
74682
|
+
this._label = result;
|
|
74683
|
+
}
|
|
74684
|
+
return result;
|
|
74685
|
+
},
|
|
74686
|
+
enumerable: false,
|
|
74687
|
+
configurable: true
|
|
74688
|
+
});
|
|
74689
|
+
DChartAxisGuideSimpleShapeImpl.prototype.newLabel = function () {
|
|
74690
|
+
var _a, _b, _c, _d;
|
|
74691
|
+
var label = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : {};
|
|
74692
|
+
if (label.enable === true) {
|
|
74693
|
+
var result = new EShapeRectangleRounded();
|
|
74694
|
+
result.stroke.copy(this.toStrokeOptions(label.stroke));
|
|
74695
|
+
result.fill.copy(label.fill);
|
|
74696
|
+
result.text.copy(this.toTextOptions(label.text));
|
|
74697
|
+
result.size.set((_c = label.width) !== null && _c !== void 0 ? _c : 50, (_d = label.height) !== null && _d !== void 0 ? _d : 30);
|
|
74698
|
+
return result;
|
|
74699
|
+
}
|
|
74700
|
+
return null;
|
|
74701
|
+
};
|
|
74702
|
+
Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "labelMargin", {
|
|
74703
|
+
get: function () {
|
|
74704
|
+
var result = this._labelMargin;
|
|
74705
|
+
if (result == null) {
|
|
74706
|
+
result = this.newLabelMargin();
|
|
74707
|
+
this._labelMargin = result;
|
|
74708
|
+
}
|
|
74709
|
+
return result;
|
|
74710
|
+
},
|
|
74711
|
+
enumerable: false,
|
|
74712
|
+
configurable: true
|
|
74713
|
+
});
|
|
74714
|
+
DChartAxisGuideSimpleShapeImpl.prototype.newLabelMargin = function () {
|
|
74715
|
+
var options = this._options;
|
|
74716
|
+
if (options != null) {
|
|
74717
|
+
var label = options.label;
|
|
74718
|
+
if (label != null) {
|
|
74719
|
+
var result = label.margin;
|
|
74720
|
+
if (result != null) {
|
|
74721
|
+
return result;
|
|
74722
|
+
}
|
|
74723
|
+
}
|
|
74724
|
+
}
|
|
74725
|
+
return 10;
|
|
74726
|
+
};
|
|
74727
|
+
Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "tick", {
|
|
74728
|
+
get: function () {
|
|
74729
|
+
var result = this._tick;
|
|
74730
|
+
if (result === undefined) {
|
|
74731
|
+
result = this.newTick();
|
|
74732
|
+
this._tick = result;
|
|
74733
|
+
}
|
|
74734
|
+
return result;
|
|
74735
|
+
},
|
|
74736
|
+
enumerable: false,
|
|
74737
|
+
configurable: true
|
|
74738
|
+
});
|
|
74739
|
+
DChartAxisGuideSimpleShapeImpl.prototype.newTick = function () {
|
|
74740
|
+
var _a, _b, _c;
|
|
74741
|
+
var tick = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.tick) !== null && _b !== void 0 ? _b : {};
|
|
74742
|
+
if (tick.enable === true) {
|
|
74743
|
+
var result = new EShapeBar();
|
|
74744
|
+
result.stroke.copy(this.toStrokeOptions(tick.stroke));
|
|
74745
|
+
result.text.copy(this.toTextOptions(tick.text));
|
|
74746
|
+
var size = (_c = tick.size) !== null && _c !== void 0 ? _c : 5;
|
|
74747
|
+
result.size.set(size, size);
|
|
74748
|
+
return result;
|
|
74749
|
+
}
|
|
74750
|
+
return null;
|
|
74751
|
+
};
|
|
74752
|
+
Object.defineProperty(DChartAxisGuideSimpleShapeImpl.prototype, "tickMargin", {
|
|
74753
|
+
get: function () {
|
|
74754
|
+
var result = this._tickMargin;
|
|
74755
|
+
if (result == null) {
|
|
74756
|
+
result = this.newTickMargin();
|
|
74757
|
+
this._tickMargin = result;
|
|
74758
|
+
}
|
|
74759
|
+
return result;
|
|
74760
|
+
},
|
|
74761
|
+
enumerable: false,
|
|
74762
|
+
configurable: true
|
|
74763
|
+
});
|
|
74764
|
+
DChartAxisGuideSimpleShapeImpl.prototype.newTickMargin = function () {
|
|
74765
|
+
var options = this._options;
|
|
74766
|
+
if (options != null) {
|
|
74767
|
+
var tick = options.tick;
|
|
74768
|
+
if (tick != null) {
|
|
74769
|
+
var result = tick.margin;
|
|
74770
|
+
if (result != null) {
|
|
74771
|
+
return result;
|
|
74772
|
+
}
|
|
74773
|
+
}
|
|
74774
|
+
}
|
|
74775
|
+
return 0;
|
|
74776
|
+
};
|
|
74777
|
+
DChartAxisGuideSimpleShapeImpl.prototype.toTickPosition = function (axis) {
|
|
74778
|
+
switch (axis.position) {
|
|
74779
|
+
case DChartAxisPosition.LEFT:
|
|
74780
|
+
case DChartAxisPosition.RIGHT:
|
|
74781
|
+
return EShapeBarPosition.LEFT;
|
|
74782
|
+
default:
|
|
74783
|
+
return EShapeBarPosition.TOP;
|
|
74784
|
+
}
|
|
74785
|
+
};
|
|
74786
|
+
DChartAxisGuideSimpleShapeImpl.prototype.bind = function (container, index, axis) {
|
|
74787
|
+
var bar = this.bar;
|
|
74788
|
+
if (bar != null) {
|
|
74789
|
+
bar.points.position = this.toBarPosition(axis);
|
|
74790
|
+
bar.attach(container.container);
|
|
74791
|
+
}
|
|
74792
|
+
var label = this.label;
|
|
74793
|
+
if (label != null) {
|
|
74794
|
+
label.attach(container.container);
|
|
74795
|
+
}
|
|
74796
|
+
var tick = this.tick;
|
|
74797
|
+
if (tick != null) {
|
|
74798
|
+
tick.points.position = this.toTickPosition(axis);
|
|
74799
|
+
tick.attach(container.container);
|
|
74800
|
+
}
|
|
74801
|
+
};
|
|
74802
|
+
DChartAxisGuideSimpleShapeImpl.prototype.unbind = function () {
|
|
74803
|
+
var bar = this._bar;
|
|
74804
|
+
if (bar != null) {
|
|
74805
|
+
bar.detach();
|
|
74806
|
+
}
|
|
74807
|
+
var label = this._label;
|
|
74808
|
+
if (label != null) {
|
|
74809
|
+
label.detach();
|
|
74810
|
+
}
|
|
74811
|
+
var tick = this._tick;
|
|
74812
|
+
if (tick != null) {
|
|
74813
|
+
tick.detach();
|
|
74814
|
+
}
|
|
74815
|
+
};
|
|
74816
|
+
DChartAxisGuideSimpleShapeImpl.prototype.update = function (position, x, y, visible, width, height, offset) {
|
|
74817
|
+
var bar = this._bar;
|
|
74818
|
+
if (bar != null) {
|
|
74819
|
+
bar.disallowUploadedUpdate();
|
|
74820
|
+
switch (position) {
|
|
74821
|
+
case DChartAxisPosition.TOP:
|
|
74822
|
+
bar.transform.position.set(x, y);
|
|
74823
|
+
bar.size.set(0, height);
|
|
74824
|
+
bar.visible = visible;
|
|
74825
|
+
break;
|
|
74826
|
+
case DChartAxisPosition.BOTTOM:
|
|
74827
|
+
bar.transform.position.set(x, y);
|
|
74828
|
+
bar.size.set(0, height);
|
|
74829
|
+
bar.visible = visible;
|
|
74830
|
+
break;
|
|
74831
|
+
case DChartAxisPosition.LEFT:
|
|
74832
|
+
bar.transform.position.set(x, y);
|
|
74833
|
+
bar.size.set(width, 0);
|
|
74834
|
+
bar.visible = visible;
|
|
74835
|
+
break;
|
|
74836
|
+
case DChartAxisPosition.RIGHT:
|
|
74837
|
+
bar.transform.position.set(x, y);
|
|
74838
|
+
bar.size.set(width, 0);
|
|
74839
|
+
bar.visible = visible;
|
|
74840
|
+
break;
|
|
74841
|
+
}
|
|
74842
|
+
bar.allowUploadedUpdate();
|
|
74843
|
+
}
|
|
74844
|
+
var label = this._label;
|
|
74845
|
+
if (label != null) {
|
|
74846
|
+
var m = this.labelMargin;
|
|
74847
|
+
var s = label.size;
|
|
74848
|
+
var ox = offset + s.x * 0.5 + m;
|
|
74849
|
+
var oy = offset + s.y * 0.5 + m;
|
|
74850
|
+
label.disallowUploadedUpdate();
|
|
74851
|
+
switch (position) {
|
|
74852
|
+
case DChartAxisPosition.TOP:
|
|
74853
|
+
label.transform.position.set(x, -oy);
|
|
74854
|
+
label.visible = visible;
|
|
74855
|
+
break;
|
|
74856
|
+
case DChartAxisPosition.BOTTOM:
|
|
74857
|
+
label.transform.position.set(x, height + oy);
|
|
74858
|
+
label.visible = visible;
|
|
74859
|
+
break;
|
|
74860
|
+
case DChartAxisPosition.LEFT:
|
|
74861
|
+
label.transform.position.set(-ox, y);
|
|
74862
|
+
label.visible = visible;
|
|
74863
|
+
break;
|
|
74864
|
+
case DChartAxisPosition.RIGHT:
|
|
74865
|
+
label.transform.position.set(width + ox, y);
|
|
74866
|
+
label.visible = visible;
|
|
74867
|
+
break;
|
|
74868
|
+
}
|
|
74869
|
+
label.allowUploadedUpdate();
|
|
74870
|
+
}
|
|
74871
|
+
var tick = this._tick;
|
|
74872
|
+
if (tick != null) {
|
|
74873
|
+
var m = this.tickMargin;
|
|
74874
|
+
var s = tick.size;
|
|
74875
|
+
var ox = offset + s.x * 0.5 + m;
|
|
74876
|
+
var oy = offset + s.y * 0.5 + m;
|
|
74877
|
+
tick.disallowUploadedUpdate();
|
|
74878
|
+
switch (position) {
|
|
74879
|
+
case DChartAxisPosition.TOP:
|
|
74880
|
+
tick.transform.position.set(x, -oy);
|
|
74881
|
+
tick.visible = visible;
|
|
74882
|
+
break;
|
|
74883
|
+
case DChartAxisPosition.BOTTOM:
|
|
74884
|
+
tick.transform.position.set(x, height + oy);
|
|
74885
|
+
tick.visible = visible;
|
|
74886
|
+
break;
|
|
74887
|
+
case DChartAxisPosition.LEFT:
|
|
74888
|
+
tick.transform.position.set(-ox, y);
|
|
74889
|
+
tick.visible = visible;
|
|
74890
|
+
break;
|
|
74891
|
+
case DChartAxisPosition.RIGHT:
|
|
74892
|
+
tick.transform.position.set(width + ox, y);
|
|
74893
|
+
tick.visible = visible;
|
|
74894
|
+
break;
|
|
74895
|
+
}
|
|
74896
|
+
tick.allowUploadedUpdate();
|
|
74897
|
+
}
|
|
74898
|
+
return true;
|
|
74899
|
+
};
|
|
74900
|
+
DChartAxisGuideSimpleShapeImpl.prototype.destroy = function () {
|
|
74901
|
+
var bar = this._bar;
|
|
74902
|
+
if (bar != null) {
|
|
74903
|
+
bar.destroy();
|
|
74904
|
+
}
|
|
74905
|
+
var label = this._label;
|
|
74906
|
+
if (label != null) {
|
|
74907
|
+
label.destroy();
|
|
74908
|
+
}
|
|
74909
|
+
var tick = this._tick;
|
|
74910
|
+
if (tick != null) {
|
|
74911
|
+
tick.destroy();
|
|
74912
|
+
}
|
|
74913
|
+
};
|
|
74914
|
+
return DChartAxisGuideSimpleShapeImpl;
|
|
74915
|
+
}());
|
|
74916
|
+
|
|
74917
|
+
var DChartAxisGuideSimple = /** @class */ (function () {
|
|
74918
|
+
function DChartAxisGuideSimple(options) {
|
|
74919
|
+
var _a;
|
|
74920
|
+
this._options = options;
|
|
74921
|
+
this._index = 0;
|
|
74922
|
+
this._position = (_a = options === null || options === void 0 ? void 0 : options.position) !== null && _a !== void 0 ? _a : 0;
|
|
74923
|
+
this._work = new pixi_js.Point();
|
|
74924
|
+
this._isShown = true;
|
|
74925
|
+
}
|
|
74926
|
+
Object.defineProperty(DChartAxisGuideSimple.prototype, "shape", {
|
|
74927
|
+
get: function () {
|
|
74928
|
+
var result = this._shape;
|
|
74929
|
+
if (result == null) {
|
|
74930
|
+
result = this.newShape();
|
|
74931
|
+
this._shape = result;
|
|
74932
|
+
}
|
|
74933
|
+
return result;
|
|
74934
|
+
},
|
|
74935
|
+
enumerable: false,
|
|
74936
|
+
configurable: true
|
|
74937
|
+
});
|
|
74938
|
+
DChartAxisGuideSimple.prototype.newShape = function () {
|
|
74939
|
+
return new DChartAxisGuideSimpleShapeImpl(this._options);
|
|
74940
|
+
};
|
|
74941
|
+
Object.defineProperty(DChartAxisGuideSimple.prototype, "position", {
|
|
74942
|
+
get: function () {
|
|
74943
|
+
return this._position;
|
|
74944
|
+
},
|
|
74945
|
+
set: function (position) {
|
|
74946
|
+
this._position = position;
|
|
74947
|
+
},
|
|
74948
|
+
enumerable: false,
|
|
74949
|
+
configurable: true
|
|
74950
|
+
});
|
|
74951
|
+
DChartAxisGuideSimple.prototype.show = function () {
|
|
74952
|
+
this._isShown = true;
|
|
74953
|
+
return this;
|
|
74954
|
+
};
|
|
74955
|
+
DChartAxisGuideSimple.prototype.isShown = function () {
|
|
74956
|
+
return this._isShown;
|
|
74957
|
+
};
|
|
74958
|
+
DChartAxisGuideSimple.prototype.hide = function () {
|
|
74959
|
+
this._isShown = false;
|
|
74960
|
+
return this;
|
|
74961
|
+
};
|
|
74962
|
+
DChartAxisGuideSimple.prototype.isHidden = function () {
|
|
74963
|
+
return !this._isShown;
|
|
74964
|
+
};
|
|
74965
|
+
DChartAxisGuideSimple.prototype.bind = function (container, index, axis) {
|
|
74966
|
+
this._container = container;
|
|
74967
|
+
this._index = index;
|
|
74968
|
+
this._axis = axis;
|
|
74969
|
+
this.shape.bind(container, index, axis);
|
|
74970
|
+
};
|
|
74971
|
+
DChartAxisGuideSimple.prototype.unbind = function () {
|
|
74972
|
+
var shape = this._shape;
|
|
74973
|
+
if (shape != null) {
|
|
74974
|
+
shape.unbind();
|
|
74975
|
+
}
|
|
74976
|
+
this._axis = undefined;
|
|
74977
|
+
this._index = 0;
|
|
74978
|
+
this._container = undefined;
|
|
74979
|
+
};
|
|
74980
|
+
DChartAxisGuideSimple.prototype.update = function () {
|
|
74981
|
+
var container = this._container;
|
|
74982
|
+
var index = this._index;
|
|
74983
|
+
var shape = this._shape;
|
|
74984
|
+
var axis = this._axis;
|
|
74985
|
+
if (shape != null && container != null && axis != null) {
|
|
74986
|
+
var plotArea = container.plotArea;
|
|
74987
|
+
var transform = plotArea.container.transform.localTransform;
|
|
74988
|
+
var plotAreaWidth = plotArea.width;
|
|
74989
|
+
var plotAreaHeight = plotArea.height;
|
|
74990
|
+
var offset = axis.padding * index;
|
|
74991
|
+
switch (axis.position) {
|
|
74992
|
+
case DChartAxisPosition.TOP:
|
|
74993
|
+
case DChartAxisPosition.BOTTOM:
|
|
74994
|
+
var coordinateX = plotArea.coordinate.x.get(axis.coordinate);
|
|
74995
|
+
if (coordinateX) {
|
|
74996
|
+
var work = this._work;
|
|
74997
|
+
work.set(coordinateX.transform.map(coordinateX.map(this._position)), 0);
|
|
74998
|
+
transform.apply(work, work);
|
|
74999
|
+
var x = work.x;
|
|
75000
|
+
shape.update(axis.position, x, plotAreaHeight * 0.5, this._isShown && 0 <= x && x <= plotAreaWidth, plotAreaWidth, plotAreaHeight, offset);
|
|
75001
|
+
}
|
|
75002
|
+
else {
|
|
75003
|
+
shape.update(axis.position, 0, plotAreaHeight * 0.5, false, plotAreaWidth, plotAreaHeight, offset);
|
|
75004
|
+
}
|
|
75005
|
+
break;
|
|
75006
|
+
case DChartAxisPosition.LEFT:
|
|
75007
|
+
case DChartAxisPosition.RIGHT:
|
|
75008
|
+
var coordinateY = plotArea.coordinate.y.get(axis.coordinate);
|
|
75009
|
+
if (coordinateY) {
|
|
75010
|
+
var work = this._work;
|
|
75011
|
+
work.set(0, coordinateY.transform.map(coordinateY.map(this._position)));
|
|
75012
|
+
transform.apply(work, work);
|
|
75013
|
+
var y = work.y;
|
|
75014
|
+
shape.update(axis.position, plotAreaWidth * 0.5, y, this._isShown && 0 <= y && y <= plotAreaHeight, plotAreaWidth, plotAreaHeight, offset);
|
|
75015
|
+
}
|
|
75016
|
+
else {
|
|
75017
|
+
shape.update(axis.position, plotAreaWidth * 0.5, 0, false, plotAreaWidth, plotAreaHeight, offset);
|
|
75018
|
+
}
|
|
75019
|
+
break;
|
|
75020
|
+
}
|
|
75021
|
+
return true;
|
|
75022
|
+
}
|
|
75023
|
+
return false;
|
|
75024
|
+
};
|
|
75025
|
+
DChartAxisGuideSimple.prototype.destroy = function () {
|
|
75026
|
+
var shape = this._shape;
|
|
75027
|
+
if (shape != null) {
|
|
75028
|
+
shape.destroy();
|
|
75029
|
+
}
|
|
75030
|
+
this._index = 0;
|
|
75031
|
+
this._container = undefined;
|
|
75032
|
+
};
|
|
75033
|
+
return DChartAxisGuideSimple;
|
|
75034
|
+
}());
|
|
75035
|
+
|
|
73917
75036
|
/*
|
|
73918
75037
|
* Copyright (C) 2019 Toshiba Corporation
|
|
73919
75038
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -91685,8 +92804,14 @@ exports.DBaseReflowableContainer = DBaseReflowableContainer;
|
|
|
91685
92804
|
exports.DBaseReflowableImpl = DBaseReflowableImpl;
|
|
91686
92805
|
exports.DBaseSnippetContainer = DBaseSnippetContainer;
|
|
91687
92806
|
exports.DBaseState = DBaseState;
|
|
92807
|
+
exports.DBaseStateSetBlinkerDatumImpl = DBaseStateSetBlinkerDatumImpl;
|
|
92808
|
+
exports.DBaseStateSetBlinkerImpl = DBaseStateSetBlinkerImpl;
|
|
91688
92809
|
exports.DBaseStateSetImpl = DBaseStateSetImpl;
|
|
91689
92810
|
exports.DBaseStateSetImplObservable = DBaseStateSetImplObservable;
|
|
92811
|
+
exports.DBaseStateSetSubDatumImp = DBaseStateSetSubDatumImp;
|
|
92812
|
+
exports.DBaseStateSetSubImpl = DBaseStateSetSubImpl;
|
|
92813
|
+
exports.DBaseStateSetTickerDatumImpl = DBaseStateSetTickerDatumImpl;
|
|
92814
|
+
exports.DBaseStateSetTickerImpl = DBaseStateSetTickerImpl;
|
|
91690
92815
|
exports.DBoard = DBoard;
|
|
91691
92816
|
exports.DBorderMask = DBorderMask;
|
|
91692
92817
|
exports.DButton = DButton;
|
|
@@ -91717,12 +92842,15 @@ exports.DCanvasContainer = DCanvasContainer;
|
|
|
91717
92842
|
exports.DChart = DChart;
|
|
91718
92843
|
exports.DChartAxisBase = DChartAxisBase;
|
|
91719
92844
|
exports.DChartAxisBaseBar = DChartAxisBaseBar;
|
|
92845
|
+
exports.DChartAxisBaseGuideContainer = DChartAxisBaseGuideContainer;
|
|
91720
92846
|
exports.DChartAxisBaseOptionParser = DChartAxisBaseOptionParser;
|
|
91721
92847
|
exports.DChartAxisBaseTickContainer = DChartAxisBaseTickContainer;
|
|
91722
92848
|
exports.DChartAxisBaseTickMajor = DChartAxisBaseTickMajor;
|
|
91723
92849
|
exports.DChartAxisBaseTickMajorGridline = DChartAxisBaseTickMajorGridline;
|
|
91724
92850
|
exports.DChartAxisBaseTickMinor = DChartAxisBaseTickMinor;
|
|
91725
92851
|
exports.DChartAxisContainerImpl = DChartAxisContainerImpl;
|
|
92852
|
+
exports.DChartAxisGuideSimple = DChartAxisGuideSimple;
|
|
92853
|
+
exports.DChartAxisGuideSimpleShapeImpl = DChartAxisGuideSimpleShapeImpl;
|
|
91726
92854
|
exports.DChartAxisPosition = DChartAxisPosition;
|
|
91727
92855
|
exports.DChartAxisTickPosition = DChartAxisTickPosition;
|
|
91728
92856
|
exports.DChartAxisX = DChartAxisX;
|