cx 24.10.3 → 24.10.5
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 +127 -47
- package/dist/data.js +26 -29
- package/dist/manifest.js +647 -647
- package/dist/svg.js +59 -56
- package/dist/ui.js +51 -52
- package/dist/widgets.js +40 -44
- package/package.json +32 -32
- package/src/charts/PieChart.js +2 -2
- package/src/charts/PieLabel.js +71 -71
- package/src/charts/axis/Axis.d.ts +113 -110
- package/src/charts/axis/Axis.js +280 -260
- package/src/charts/axis/CategoryAxis.d.ts +27 -24
- package/src/charts/axis/CategoryAxis.js +235 -212
- package/src/charts/axis/NumericAxis.js +347 -347
- package/src/charts/axis/Stack.js +55 -55
- package/src/charts/axis/TimeAxis.js +510 -510
- package/src/charts/helpers/PointReducer.js +43 -43
- package/src/charts/helpers/SnapPointFinder.js +69 -69
- package/src/data/Binding.spec.js +69 -69
- package/src/data/Expression.js +221 -221
- package/src/data/Expression.spec.js +184 -184
- package/src/data/StringTemplate.spec.js +105 -105
- package/src/data/getAccessor.spec.js +11 -11
- package/src/index.scss +6 -6
- package/src/svg/Text.d.ts +40 -40
- package/src/ui/Culture.d.ts +55 -55
- package/src/ui/Culture.js +139 -139
- package/src/ui/FocusManager.js +171 -171
- package/src/ui/Instance.d.ts +72 -72
- package/src/ui/VDOM.d.ts +12 -12
- package/src/ui/app/startAppLoop.js +58 -58
- package/src/ui/index.d.ts +42 -42
- package/src/ui/layout/LabelsTopLayout.js +134 -134
- package/src/util/Console.d.ts +4 -4
- package/src/util/index.d.ts +51 -51
- package/src/util/index.js +54 -54
- package/src/util/isValidIdentifierName.d.ts +1 -1
- package/src/util/isValidIdentifierName.js +5 -5
- package/src/util/isValidIdentifierName.spec.js +33 -33
- package/src/util/scss/add-rules.scss +38 -38
- package/src/widgets/CxCredit.scss +37 -37
- package/src/widgets/HighlightedSearchText.js +36 -36
- package/src/widgets/HighlightedSearchText.scss +18 -18
- package/src/widgets/List.scss +91 -91
- package/src/widgets/drag-drop/DropZone.js +214 -214
- package/src/widgets/form/Calendar.scss +196 -196
- package/src/widgets/form/ColorField.js +397 -397
- package/src/widgets/form/ColorPicker.scss +283 -283
- package/src/widgets/form/DateTimeField.js +573 -573
- package/src/widgets/form/LookupField.d.ts +179 -179
- package/src/widgets/form/MonthField.js +516 -516
- package/src/widgets/form/MonthPicker.scss +118 -118
- package/src/widgets/form/NumberField.js +459 -459
- package/src/widgets/form/NumberField.scss +61 -61
- package/src/widgets/form/Select.scss +99 -99
- package/src/widgets/form/Slider.scss +118 -118
- package/src/widgets/form/Switch.scss +140 -140
- package/src/widgets/form/TextArea.scss +43 -43
- package/src/widgets/form/TextField.js +290 -290
- package/src/widgets/form/TextField.scss +55 -55
- package/src/widgets/form/UploadButton.d.ts +34 -34
- package/src/widgets/form/variables.scss +353 -353
- package/src/widgets/grid/TreeNode.scss +88 -88
- package/src/widgets/nav/Menu.scss +74 -74
- package/src/widgets/overlay/Dropdown.js +612 -612
- package/src/widgets/overlay/FlyweightTooltipTracker.js +39 -39
- package/src/widgets/overlay/Tooltip.js +300 -300
- package/src/widgets/overlay/Window.js +196 -196
- package/src/widgets/overlay/captureMouse.js +124 -124
- package/src/widgets/overlay/variables.scss +83 -83
- package/src/widgets/variables.scss +144 -144
package/dist/charts.js
CHANGED
|
@@ -37,35 +37,72 @@ import {
|
|
|
37
37
|
getCursorPos,
|
|
38
38
|
} from "cx/widgets";
|
|
39
39
|
|
|
40
|
+
function _arrayLikeToArray(r, a) {
|
|
41
|
+
(null == a || a > r.length) && (a = r.length);
|
|
42
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
43
|
+
return n;
|
|
44
|
+
}
|
|
45
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
46
|
+
var t = ("undefined" != typeof Symbol && r[Symbol.iterator]) || r["@@iterator"];
|
|
47
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
48
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
49
|
+
t && (r = t);
|
|
50
|
+
var o = 0;
|
|
51
|
+
return function () {
|
|
52
|
+
return o >= r.length
|
|
53
|
+
? {
|
|
54
|
+
done: !0,
|
|
55
|
+
}
|
|
56
|
+
: {
|
|
57
|
+
done: !1,
|
|
58
|
+
value: r[o++],
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
throw new TypeError(
|
|
63
|
+
"Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
|
|
64
|
+
);
|
|
65
|
+
}
|
|
40
66
|
function _extends() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
target[key] = source[key];
|
|
49
|
-
}
|
|
67
|
+
return (
|
|
68
|
+
(_extends = Object.assign
|
|
69
|
+
? Object.assign.bind()
|
|
70
|
+
: function (n) {
|
|
71
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
72
|
+
var t = arguments[e];
|
|
73
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
50
74
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
75
|
+
return n;
|
|
76
|
+
}),
|
|
77
|
+
_extends.apply(null, arguments)
|
|
78
|
+
);
|
|
55
79
|
}
|
|
56
|
-
function _inheritsLoose(
|
|
57
|
-
|
|
58
|
-
subClass.prototype.constructor = subClass;
|
|
59
|
-
_setPrototypeOf(subClass, superClass);
|
|
80
|
+
function _inheritsLoose(t, o) {
|
|
81
|
+
(t.prototype = Object.create(o.prototype)), (t.prototype.constructor = t), _setPrototypeOf(t, o);
|
|
60
82
|
}
|
|
61
|
-
function _setPrototypeOf(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
83
|
+
function _setPrototypeOf(t, e) {
|
|
84
|
+
return (
|
|
85
|
+
(_setPrototypeOf = Object.setPrototypeOf
|
|
86
|
+
? Object.setPrototypeOf.bind()
|
|
87
|
+
: function (t, e) {
|
|
88
|
+
return (t.__proto__ = e), t;
|
|
89
|
+
}),
|
|
90
|
+
_setPrototypeOf(t, e)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function _unsupportedIterableToArray(r, a) {
|
|
94
|
+
if (r) {
|
|
95
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
96
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
97
|
+
return (
|
|
98
|
+
"Object" === t && r.constructor && (t = r.constructor.name),
|
|
99
|
+
"Map" === t || "Set" === t
|
|
100
|
+
? Array.from(r)
|
|
101
|
+
: "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
|
|
102
|
+
? _arrayLikeToArray(r, a)
|
|
103
|
+
: void 0
|
|
104
|
+
);
|
|
105
|
+
}
|
|
69
106
|
}
|
|
70
107
|
|
|
71
108
|
var Rect = /*#__PURE__*/ (function () {
|
|
@@ -289,7 +326,8 @@ var Axis = /*#__PURE__*/ (function (_BoundedObject) {
|
|
|
289
326
|
y1,
|
|
290
327
|
x2,
|
|
291
328
|
y2,
|
|
292
|
-
tickSize = this.tickSize
|
|
329
|
+
tickSize = this.tickSize,
|
|
330
|
+
tickOffset = this.tickOffset;
|
|
293
331
|
if (this.vertical) {
|
|
294
332
|
x1 = x2 = this.secondary ? bounds.r : bounds.l;
|
|
295
333
|
y1 = bounds.b;
|
|
@@ -321,17 +359,17 @@ var Axis = /*#__PURE__*/ (function (_BoundedObject) {
|
|
|
321
359
|
serie.forEach(function (v, i) {
|
|
322
360
|
var s = calculator.map(v);
|
|
323
361
|
if (_this.secondary) {
|
|
324
|
-
x1 = _this.vertical ? bounds.r : s;
|
|
325
|
-
y1 = _this.vertical ? s : bounds.t;
|
|
326
|
-
x2 = _this.vertical ? bounds.r + tickSize : s;
|
|
327
|
-
y2 = _this.vertical ? s : bounds.t - tickSize;
|
|
362
|
+
x1 = _this.vertical ? bounds.r + tickOffset : s;
|
|
363
|
+
y1 = _this.vertical ? s : bounds.t - tickOffset;
|
|
364
|
+
x2 = _this.vertical ? bounds.r + tickOffset + tickSize : s;
|
|
365
|
+
y2 = _this.vertical ? s : bounds.t - tickOffset - tickSize;
|
|
328
366
|
} else {
|
|
329
|
-
x1 = _this.vertical ? bounds.l : s;
|
|
330
|
-
y1 = _this.vertical ? s : bounds.b;
|
|
331
|
-
x2 = _this.vertical ? bounds.l - tickSize : s;
|
|
332
|
-
y2 = _this.vertical ? s : bounds.b + tickSize;
|
|
367
|
+
x1 = _this.vertical ? bounds.l - tickOffset : s;
|
|
368
|
+
y1 = _this.vertical ? s : bounds.b + tickOffset;
|
|
369
|
+
x2 = _this.vertical ? bounds.l - tickOffset - tickSize : s;
|
|
370
|
+
y2 = _this.vertical ? s : bounds.b + tickOffset + tickSize;
|
|
333
371
|
}
|
|
334
|
-
t.push("M " + x1 + " " + y1 + " L " + x2 + " " + y2);
|
|
372
|
+
if (!_this.useGridlineTicks) t.push("M " + x1 + " " + y1 + " L " + x2 + " " + y2);
|
|
335
373
|
var x, y;
|
|
336
374
|
var labelOffset =
|
|
337
375
|
_this.alternateLabelOffset != null && i % 2 == 1 ? _this.alternateLabelOffset : _this.labelOffset;
|
|
@@ -369,6 +407,23 @@ var Axis = /*#__PURE__*/ (function (_BoundedObject) {
|
|
|
369
407
|
});
|
|
370
408
|
}
|
|
371
409
|
if (!data.hideTicks) {
|
|
410
|
+
if (this.useGridlineTicks) {
|
|
411
|
+
var gridlines = calculator.mapGridlines();
|
|
412
|
+
gridlines.forEach(function (s, i) {
|
|
413
|
+
if (_this.secondary) {
|
|
414
|
+
x1 = _this.vertical ? bounds.r + tickOffset : s;
|
|
415
|
+
y1 = _this.vertical ? s : bounds.t - tickOffset;
|
|
416
|
+
x2 = _this.vertical ? bounds.r + tickOffset + tickSize : s;
|
|
417
|
+
y2 = _this.vertical ? s : bounds.t - tickOffset - tickSize;
|
|
418
|
+
} else {
|
|
419
|
+
x1 = _this.vertical ? bounds.l - tickOffset : s;
|
|
420
|
+
y1 = _this.vertical ? s : bounds.b + tickOffset;
|
|
421
|
+
x2 = _this.vertical ? bounds.l - tickOffset - tickSize : s;
|
|
422
|
+
y2 = _this.vertical ? s : bounds.b + tickOffset + tickSize;
|
|
423
|
+
}
|
|
424
|
+
t.push("M " + x1 + " " + y1 + " L " + x2 + " " + y2);
|
|
425
|
+
});
|
|
426
|
+
}
|
|
372
427
|
res[1] = /*#__PURE__*/ jsx(
|
|
373
428
|
"path",
|
|
374
429
|
{
|
|
@@ -469,6 +524,7 @@ Axis.prototype.hideLabels = false;
|
|
|
469
524
|
Axis.prototype.hideTicks = false;
|
|
470
525
|
Axis.prototype.hideLine = false;
|
|
471
526
|
Axis.prototype.tickSize = 3;
|
|
527
|
+
Axis.prototype.tickOffset = 0;
|
|
472
528
|
Axis.prototype.minTickDistance = 25;
|
|
473
529
|
Axis.prototype.minLabelDistanceVertical = 40;
|
|
474
530
|
Axis.prototype.minLabelDistanceHorizontal = 50;
|
|
@@ -674,10 +730,10 @@ var PieCalculator = /*#__PURE__*/ (function () {
|
|
|
674
730
|
var clockFactor = this.clockwise ? -1 : 1;
|
|
675
731
|
var gapAngle = r0 > 0 && s.gap > 0 ? 2 * Math.asin(s.gap / r0 / 2) : 0;
|
|
676
732
|
s.lastAngle += clockFactor * (angle + gapAngle);
|
|
677
|
-
var endAngle = startAngle + clockFactor * angle + gapAngle;
|
|
733
|
+
var endAngle = startAngle + clockFactor * (angle + gapAngle);
|
|
678
734
|
return {
|
|
679
735
|
startAngle: startAngle,
|
|
680
|
-
endAngle: startAngle + clockFactor * angle + gapAngle,
|
|
736
|
+
endAngle: startAngle + clockFactor * (angle + gapAngle),
|
|
681
737
|
angle: angle,
|
|
682
738
|
midAngle: (startAngle + endAngle) / 2,
|
|
683
739
|
gap: s.gap,
|
|
@@ -4569,7 +4625,7 @@ var CategoryAxis = /*#__PURE__*/ (function (_Axis) {
|
|
|
4569
4625
|
inverted = _instance$data.inverted,
|
|
4570
4626
|
uniform = _instance$data.uniform,
|
|
4571
4627
|
minSize = _instance$data.minSize;
|
|
4572
|
-
instance.calculator.reset(inverted, uniform, values, names, minSize);
|
|
4628
|
+
instance.calculator.reset(inverted, uniform, values, names, minSize, this.minTickDistance, this.minLabelDistance);
|
|
4573
4629
|
};
|
|
4574
4630
|
_proto.reportData = function reportData(context, instance) {
|
|
4575
4631
|
instance.set("categoryCount", instance.calculator.valueList.length);
|
|
@@ -4604,11 +4660,14 @@ CategoryAxis.prototype.labelAnchor = "auto";
|
|
|
4604
4660
|
CategoryAxis.prototype.labelDx = "auto";
|
|
4605
4661
|
CategoryAxis.prototype.labelDy = "auto";
|
|
4606
4662
|
CategoryAxis.prototype.minSize = 1;
|
|
4663
|
+
CategoryAxis.prototype.minLabelDistanceHorizontal = 0;
|
|
4664
|
+
CategoryAxis.prototype.minLabelDistanceVertical = 0;
|
|
4665
|
+
CategoryAxis.prototype.minTickDistance = 0;
|
|
4607
4666
|
Axis.alias("category", CategoryAxis);
|
|
4608
4667
|
var CategoryScale = /*#__PURE__*/ (function () {
|
|
4609
4668
|
function CategoryScale() {}
|
|
4610
4669
|
var _proto2 = CategoryScale.prototype;
|
|
4611
|
-
_proto2.reset = function reset(inverted, uniform, values, names, minSize) {
|
|
4670
|
+
_proto2.reset = function reset(inverted, uniform, values, names, minSize, minTickDistance, minLabelDistance) {
|
|
4612
4671
|
var _this = this;
|
|
4613
4672
|
this.padding = 0.5;
|
|
4614
4673
|
delete this.min;
|
|
@@ -4622,6 +4681,8 @@ var CategoryScale = /*#__PURE__*/ (function () {
|
|
|
4622
4681
|
this.uniform = uniform;
|
|
4623
4682
|
this.valueStacks = {};
|
|
4624
4683
|
this.names = {};
|
|
4684
|
+
this.minTickDistance = minTickDistance;
|
|
4685
|
+
this.minLabelDistance = minLabelDistance;
|
|
4625
4686
|
if (values) {
|
|
4626
4687
|
if (isArray(values))
|
|
4627
4688
|
values.forEach(function (v) {
|
|
@@ -4669,6 +4730,19 @@ var CategoryScale = /*#__PURE__*/ (function () {
|
|
|
4669
4730
|
this.factor = (sign * (this.b - this.a)) / (this.max - this.min + 2 * this.padding);
|
|
4670
4731
|
this.origin = (this.a * (1 + sign)) / 2 + (this.b * (1 - sign)) / 2; //a || b
|
|
4671
4732
|
}
|
|
4733
|
+
this.tickSizes = [];
|
|
4734
|
+
var tickMultiplier = [1, 2, 5];
|
|
4735
|
+
var absFactor = Math.abs(this.factor);
|
|
4736
|
+
for (var base = 1; base < 10000 && this.tickSizes.length < 2; base *= 10) {
|
|
4737
|
+
for (var _iterator = _createForOfIteratorHelperLoose(tickMultiplier), _step; !(_step = _iterator()).done; ) {
|
|
4738
|
+
var m = _step.value;
|
|
4739
|
+
if (base * m * absFactor >= this.minTickDistance && this.tickSizes.length == 0) this.tickSizes.push(base * m);
|
|
4740
|
+
if (base * m * absFactor >= this.minLabelDistance) {
|
|
4741
|
+
this.tickSizes.push(base * m);
|
|
4742
|
+
break;
|
|
4743
|
+
}
|
|
4744
|
+
}
|
|
4745
|
+
}
|
|
4672
4746
|
};
|
|
4673
4747
|
_proto2.hash = function hash() {
|
|
4674
4748
|
return {
|
|
@@ -4739,24 +4813,30 @@ var CategoryScale = /*#__PURE__*/ (function () {
|
|
|
4739
4813
|
return this.valueList[index];
|
|
4740
4814
|
};
|
|
4741
4815
|
_proto2.findTickSize = function findTickSize(minPxDist) {
|
|
4816
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(this.tickSizes), _step2; !(_step2 = _iterator2()).done; ) {
|
|
4817
|
+
var tickSize = _step2.value;
|
|
4818
|
+
if (tickSize * Math.abs(this.factor) >= minPxDist) return tickSize;
|
|
4819
|
+
}
|
|
4742
4820
|
return 1;
|
|
4743
4821
|
};
|
|
4744
4822
|
_proto2.getTickSizes = function getTickSizes() {
|
|
4745
|
-
return
|
|
4823
|
+
return this.tickSizes;
|
|
4746
4824
|
};
|
|
4747
4825
|
_proto2.getTicks = function getTicks(tickSizes) {
|
|
4748
4826
|
var _this2 = this;
|
|
4749
4827
|
return tickSizes.map(function (size) {
|
|
4750
|
-
return _this2.valueList
|
|
4828
|
+
return _this2.valueList.filter(function (_, i) {
|
|
4829
|
+
return i % size == 0;
|
|
4830
|
+
});
|
|
4751
4831
|
});
|
|
4752
4832
|
};
|
|
4753
4833
|
_proto2.mapGridlines = function mapGridlines() {
|
|
4754
|
-
var
|
|
4755
|
-
return
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4834
|
+
var result = [];
|
|
4835
|
+
if (this.tickSizes.length == 0) return result;
|
|
4836
|
+
var step = this.tickSizes[0];
|
|
4837
|
+
for (var index = this.min; index <= this.max + 1; index += step)
|
|
4838
|
+
result.push(this.origin + (index - 0.5 - this.min + this.padding) * this.factor);
|
|
4839
|
+
return result;
|
|
4760
4840
|
};
|
|
4761
4841
|
return CategoryScale;
|
|
4762
4842
|
})();
|
package/dist/data.js
CHANGED
|
@@ -118,6 +118,23 @@ function _construct(t, e, r) {
|
|
|
118
118
|
var p = new (t.bind.apply(t, o))();
|
|
119
119
|
return p;
|
|
120
120
|
}
|
|
121
|
+
function _extends() {
|
|
122
|
+
return (
|
|
123
|
+
(_extends = Object.assign
|
|
124
|
+
? Object.assign.bind()
|
|
125
|
+
: function (n) {
|
|
126
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
127
|
+
var t = arguments[e];
|
|
128
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
129
|
+
}
|
|
130
|
+
return n;
|
|
131
|
+
}),
|
|
132
|
+
_extends.apply(null, arguments)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
function _inheritsLoose(t, o) {
|
|
136
|
+
(t.prototype = Object.create(o.prototype)), (t.prototype.constructor = t), _setPrototypeOf(t, o);
|
|
137
|
+
}
|
|
121
138
|
function _isNativeReflectConstruct() {
|
|
122
139
|
try {
|
|
123
140
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
@@ -126,35 +143,15 @@ function _isNativeReflectConstruct() {
|
|
|
126
143
|
return !!t;
|
|
127
144
|
})();
|
|
128
145
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return target;
|
|
142
|
-
};
|
|
143
|
-
return _extends.apply(this, arguments);
|
|
144
|
-
}
|
|
145
|
-
function _inheritsLoose(subClass, superClass) {
|
|
146
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
147
|
-
subClass.prototype.constructor = subClass;
|
|
148
|
-
_setPrototypeOf(subClass, superClass);
|
|
149
|
-
}
|
|
150
|
-
function _setPrototypeOf(o, p) {
|
|
151
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
152
|
-
? Object.setPrototypeOf.bind()
|
|
153
|
-
: function _setPrototypeOf(o, p) {
|
|
154
|
-
o.__proto__ = p;
|
|
155
|
-
return o;
|
|
156
|
-
};
|
|
157
|
-
return _setPrototypeOf(o, p);
|
|
146
|
+
function _setPrototypeOf(t, e) {
|
|
147
|
+
return (
|
|
148
|
+
(_setPrototypeOf = Object.setPrototypeOf
|
|
149
|
+
? Object.setPrototypeOf.bind()
|
|
150
|
+
: function (t, e) {
|
|
151
|
+
return (t.__proto__ = e), t;
|
|
152
|
+
}),
|
|
153
|
+
_setPrototypeOf(t, e)
|
|
154
|
+
);
|
|
158
155
|
}
|
|
159
156
|
|
|
160
157
|
function computable() {
|