cx 24.10.7 → 24.10.9
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/dist/charts.js +11 -1
- package/dist/manifest.js +573 -573
- package/dist/ui.js +20 -3
- package/package.json +1 -1
- package/src/charts/axis/NumericAxis.js +4 -0
- package/src/charts/axis/TimeAxis.js +10 -1
- package/src/ui/Instance.js +614 -610
- package/src/ui/layout/ContentPlaceholder.js +17 -3
- package/src/ui/layout/ContentPlaceholder.spec.js +121 -1
package/dist/ui.js
CHANGED
|
@@ -1786,6 +1786,10 @@ var Instance = /*#__PURE__*/ (function () {
|
|
|
1786
1786
|
else {
|
|
1787
1787
|
this.renderList = this.renderList.insertLeft();
|
|
1788
1788
|
context.pushNamedValue("content", this.widget.putInto, this);
|
|
1789
|
+
if (!context.contentList) context.contentList = {};
|
|
1790
|
+
var list = context.contentList[this.widget.putInto];
|
|
1791
|
+
if (!list) list = context.contentList[this.widget.putInto] = [];
|
|
1792
|
+
list.push(this);
|
|
1789
1793
|
}
|
|
1790
1794
|
}
|
|
1791
1795
|
this.shouldUpdate = false;
|
|
@@ -3892,12 +3896,23 @@ var ContentPlaceholder = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
3892
3896
|
var _this = this;
|
|
3893
3897
|
instance.content = null;
|
|
3894
3898
|
var data = instance.data;
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3899
|
+
if (this.allowMultiple) {
|
|
3900
|
+
var contentList = context.contentList && context.contentList[data.name];
|
|
3901
|
+
if (isNonEmptyArray(contentList) && !this.scoped)
|
|
3902
|
+
for (var i = 0; i < contentList.length; i++) this.setContent(context, instance, contentList[i]);
|
|
3903
|
+
|
|
3904
|
+
// in multi mode register a callback to allow for more entries to be added
|
|
3898
3905
|
context.pushNamedValue("contentPlaceholder", data.name, function (content) {
|
|
3899
3906
|
_this.setContent(context, instance, content);
|
|
3900
3907
|
});
|
|
3908
|
+
} else {
|
|
3909
|
+
var content = context.content && context.content[data.name];
|
|
3910
|
+
if (content && !this.scoped) this.setContent(context, instance, content);
|
|
3911
|
+
else
|
|
3912
|
+
context.pushNamedValue("contentPlaceholder", data.name, function (content) {
|
|
3913
|
+
_this.setContent(context, instance, content);
|
|
3914
|
+
});
|
|
3915
|
+
}
|
|
3901
3916
|
if (this.scoped)
|
|
3902
3917
|
instance.unregisterContentPlaceholder = function () {
|
|
3903
3918
|
context.popNamedValue("contentPlaceholder", data.name);
|
|
@@ -3956,6 +3971,7 @@ var ContentPlaceholderScope = /*#__PURE__*/ (function (_PureContainer2) {
|
|
|
3956
3971
|
this.name.forEach(function (name) {
|
|
3957
3972
|
context.pushNamedValue("contentPlaceholder", name, null);
|
|
3958
3973
|
context.pushNamedValue("content", name, null);
|
|
3974
|
+
context.pushNamedValue("contentList", name, []);
|
|
3959
3975
|
});
|
|
3960
3976
|
_PureContainer2.prototype.explore.call(this, context, instance);
|
|
3961
3977
|
};
|
|
@@ -3963,6 +3979,7 @@ var ContentPlaceholderScope = /*#__PURE__*/ (function (_PureContainer2) {
|
|
|
3963
3979
|
this.name.forEach(function (name) {
|
|
3964
3980
|
context.popNamedValue("contentPlaceholder", name);
|
|
3965
3981
|
context.popNamedValue("content", name);
|
|
3982
|
+
context.popNamedValue("contentList", name);
|
|
3966
3983
|
});
|
|
3967
3984
|
};
|
|
3968
3985
|
return ContentPlaceholderScope;
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { Stack } from "./Stack";
|
|
|
4
4
|
import { Format } from "../../ui/Format";
|
|
5
5
|
import { isNumber } from "../../util/isNumber";
|
|
6
6
|
import { zeroTime } from "../../util/date/zeroTime";
|
|
7
|
+
import { Console } from "../../util/Console";
|
|
7
8
|
|
|
8
9
|
Format.registerFactory("yearOrMonth", (format) => {
|
|
9
10
|
let year = Format.parse("datetime;yyyy");
|
|
@@ -511,6 +512,9 @@ class TimeScale {
|
|
|
511
512
|
break;
|
|
512
513
|
}
|
|
513
514
|
|
|
515
|
+
if (lowerTickUnit && this.minTickUnit && miliSeconds[lowerTickUnit] < miliSeconds[this.minTickUnit])
|
|
516
|
+
lowerTickUnit = this.minTickUnit == this.tickMeasure ? null : this.minTickUnit;
|
|
517
|
+
|
|
514
518
|
if (lowerTickUnit != null && this.scale) {
|
|
515
519
|
let bestMinorTickSize = Infinity;
|
|
516
520
|
let divisions = this.tickDivisions[lowerTickUnit];
|
|
@@ -534,7 +538,7 @@ class TimeScale {
|
|
|
534
538
|
}
|
|
535
539
|
}
|
|
536
540
|
|
|
537
|
-
if (isNumber(this.snapToTicks) && this.snapToTicks >= 0) {
|
|
541
|
+
if (isNumber(this.snapToTicks) && this.snapToTicks >= 0 && this.tickSizes.length > 0) {
|
|
538
542
|
let tickSize = this.tickSizes[Math.min(this.tickSizes.length - 1, this.snapToTicks)];
|
|
539
543
|
this.scale = this.getScale(tickSize.size, tickSize.measure, minRange);
|
|
540
544
|
}
|
|
@@ -567,6 +571,7 @@ class TimeScale {
|
|
|
567
571
|
minDate = new Date(this.scale.min - this.scale.minPadding);
|
|
568
572
|
maxDate = new Date(this.scale.max + this.scale.maxPadding);
|
|
569
573
|
let date = zeroTime(minDate);
|
|
574
|
+
while (date.getTime() < minDate.getTime()) date.setDate(date.getDate() + 1);
|
|
570
575
|
if (measure == "week") {
|
|
571
576
|
//start on monday
|
|
572
577
|
while (date.getDay() != 1) {
|
|
@@ -598,4 +603,8 @@ class TimeScale {
|
|
|
598
603
|
if (this.tickSizes.length == 0) return [];
|
|
599
604
|
return this.getTicks([this.tickSizes[0]])[0].map((x) => this.map(x));
|
|
600
605
|
}
|
|
606
|
+
|
|
607
|
+
book() {
|
|
608
|
+
Console.warn("TimeAxis does not support the autoSize flag for column and bar graphs.");
|
|
609
|
+
}
|
|
601
610
|
}
|