cx 24.9.4 → 24.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.css +19 -16
- package/dist/charts.js +129 -94
- package/dist/data.js +29 -26
- package/dist/manifest.js +718 -718
- package/dist/svg.js +56 -59
- package/dist/ui.js +52 -51
- package/dist/widgets.js +44 -40
- package/package.json +32 -32
- package/src/charts/Legend.js +49 -33
- package/src/charts/Legend.scss +40 -42
- package/src/charts/LegendEntry.js +120 -121
- package/src/charts/LegendEntry.scss +27 -31
- package/src/charts/PieChart.d.ts +92 -89
- package/src/charts/PieChart.js +529 -527
- package/src/charts/PieLabel.js +71 -71
- package/src/charts/axis/NumericAxis.js +347 -347
- package/src/charts/axis/Stack.js +55 -55
- 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/grid/variables.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/svg.js
CHANGED
|
@@ -91,73 +91,70 @@ Rect.prototype.r = 0; //right
|
|
|
91
91
|
Rect.prototype.t = 0; //top
|
|
92
92
|
Rect.prototype.b = 0; //bottom
|
|
93
93
|
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
function _extends() {
|
|
95
|
+
_extends = Object.assign
|
|
96
|
+
? Object.assign.bind()
|
|
97
|
+
: function (target) {
|
|
98
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
99
|
+
var source = arguments[i];
|
|
100
|
+
for (var key in source) {
|
|
101
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
102
|
+
target[key] = source[key];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return target;
|
|
107
|
+
};
|
|
108
|
+
return _extends.apply(this, arguments);
|
|
109
|
+
}
|
|
110
|
+
function _inheritsLoose(subClass, superClass) {
|
|
111
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
112
|
+
subClass.prototype.constructor = subClass;
|
|
113
|
+
_setPrototypeOf(subClass, superClass);
|
|
98
114
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
115
|
+
function _setPrototypeOf(o, p) {
|
|
116
|
+
_setPrototypeOf = Object.setPrototypeOf
|
|
117
|
+
? Object.setPrototypeOf.bind()
|
|
118
|
+
: function _setPrototypeOf(o, p) {
|
|
119
|
+
o.__proto__ = p;
|
|
120
|
+
return o;
|
|
121
|
+
};
|
|
122
|
+
return _setPrototypeOf(o, p);
|
|
123
|
+
}
|
|
124
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
125
|
+
if (!o) return;
|
|
126
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
127
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
128
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
129
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
130
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
131
|
+
}
|
|
132
|
+
function _arrayLikeToArray(arr, len) {
|
|
133
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
134
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
135
|
+
return arr2;
|
|
136
|
+
}
|
|
137
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
138
|
+
var it = (typeof Symbol !== "undefined" && o[Symbol.iterator]) || o["@@iterator"];
|
|
139
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
140
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
|
|
141
|
+
if (it) o = it;
|
|
142
|
+
var i = 0;
|
|
105
143
|
return function () {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
144
|
+
if (i >= o.length)
|
|
145
|
+
return {
|
|
146
|
+
done: true,
|
|
147
|
+
};
|
|
148
|
+
return {
|
|
149
|
+
done: false,
|
|
150
|
+
value: o[i++],
|
|
151
|
+
};
|
|
114
152
|
};
|
|
115
153
|
}
|
|
116
154
|
throw new TypeError(
|
|
117
155
|
"Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.",
|
|
118
156
|
);
|
|
119
157
|
}
|
|
120
|
-
function _extends() {
|
|
121
|
-
return (
|
|
122
|
-
(_extends = Object.assign
|
|
123
|
-
? Object.assign.bind()
|
|
124
|
-
: function (n) {
|
|
125
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
126
|
-
var t = arguments[e];
|
|
127
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
128
|
-
}
|
|
129
|
-
return n;
|
|
130
|
-
}),
|
|
131
|
-
_extends.apply(null, arguments)
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
function _inheritsLoose(t, o) {
|
|
135
|
-
(t.prototype = Object.create(o.prototype)), (t.prototype.constructor = t), _setPrototypeOf(t, o);
|
|
136
|
-
}
|
|
137
|
-
function _setPrototypeOf(t, e) {
|
|
138
|
-
return (
|
|
139
|
-
(_setPrototypeOf = Object.setPrototypeOf
|
|
140
|
-
? Object.setPrototypeOf.bind()
|
|
141
|
-
: function (t, e) {
|
|
142
|
-
return (t.__proto__ = e), t;
|
|
143
|
-
}),
|
|
144
|
-
_setPrototypeOf(t, e)
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
function _unsupportedIterableToArray(r, a) {
|
|
148
|
-
if (r) {
|
|
149
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
150
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
151
|
-
return (
|
|
152
|
-
"Object" === t && r.constructor && (t = r.constructor.name),
|
|
153
|
-
"Map" === t || "Set" === t
|
|
154
|
-
? Array.from(r)
|
|
155
|
-
: "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
|
|
156
|
-
? _arrayLikeToArray(r, a)
|
|
157
|
-
: void 0
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
158
|
|
|
162
159
|
var BoundedObject = /*#__PURE__*/ (function (_PureContainer) {
|
|
163
160
|
function BoundedObject() {
|
package/dist/ui.js
CHANGED
|
@@ -71,51 +71,6 @@ import { VDOM as VDOM$2 } from "cx-react";
|
|
|
71
71
|
import { NumberCulture, DateTimeCulture } from "intl-io";
|
|
72
72
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
73
73
|
|
|
74
|
-
function _defineProperties(e, r) {
|
|
75
|
-
for (var t = 0; t < r.length; t++) {
|
|
76
|
-
var o = r[t];
|
|
77
|
-
(o.enumerable = o.enumerable || !1),
|
|
78
|
-
(o.configurable = !0),
|
|
79
|
-
"value" in o && (o.writable = !0),
|
|
80
|
-
Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function _createClass(e, r, t) {
|
|
84
|
-
return (
|
|
85
|
-
t && _defineProperties(e, t),
|
|
86
|
-
Object.defineProperty(e, "prototype", {
|
|
87
|
-
writable: !1,
|
|
88
|
-
}),
|
|
89
|
-
e
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
function _extends() {
|
|
93
|
-
return (
|
|
94
|
-
(_extends = Object.assign
|
|
95
|
-
? Object.assign.bind()
|
|
96
|
-
: function (n) {
|
|
97
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
98
|
-
var t = arguments[e];
|
|
99
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
100
|
-
}
|
|
101
|
-
return n;
|
|
102
|
-
}),
|
|
103
|
-
_extends.apply(null, arguments)
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
function _inheritsLoose(t, o) {
|
|
107
|
-
(t.prototype = Object.create(o.prototype)), (t.prototype.constructor = t), _setPrototypeOf(t, o);
|
|
108
|
-
}
|
|
109
|
-
function _setPrototypeOf(t, e) {
|
|
110
|
-
return (
|
|
111
|
-
(_setPrototypeOf = Object.setPrototypeOf
|
|
112
|
-
? Object.setPrototypeOf.bind()
|
|
113
|
-
: function (t, e) {
|
|
114
|
-
return (t.__proto__ = e), t;
|
|
115
|
-
}),
|
|
116
|
-
_setPrototypeOf(t, e)
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
74
|
function _toPrimitive(t, r) {
|
|
120
75
|
if ("object" != typeof t || !t) return t;
|
|
121
76
|
var e = t[Symbol.toPrimitive];
|
|
@@ -130,6 +85,52 @@ function _toPropertyKey(t) {
|
|
|
130
85
|
var i = _toPrimitive(t, "string");
|
|
131
86
|
return "symbol" == typeof i ? i : i + "";
|
|
132
87
|
}
|
|
88
|
+
function _defineProperties(target, props) {
|
|
89
|
+
for (var i = 0; i < props.length; i++) {
|
|
90
|
+
var descriptor = props[i];
|
|
91
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
92
|
+
descriptor.configurable = true;
|
|
93
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
94
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
98
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
99
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
100
|
+
writable: false,
|
|
101
|
+
});
|
|
102
|
+
return Constructor;
|
|
103
|
+
}
|
|
104
|
+
function _extends() {
|
|
105
|
+
_extends = Object.assign
|
|
106
|
+
? Object.assign.bind()
|
|
107
|
+
: function (target) {
|
|
108
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
109
|
+
var source = arguments[i];
|
|
110
|
+
for (var key in source) {
|
|
111
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
112
|
+
target[key] = source[key];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return target;
|
|
117
|
+
};
|
|
118
|
+
return _extends.apply(this, arguments);
|
|
119
|
+
}
|
|
120
|
+
function _inheritsLoose(subClass, superClass) {
|
|
121
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
122
|
+
subClass.prototype.constructor = subClass;
|
|
123
|
+
_setPrototypeOf(subClass, superClass);
|
|
124
|
+
}
|
|
125
|
+
function _setPrototypeOf(o, p) {
|
|
126
|
+
_setPrototypeOf = Object.setPrototypeOf
|
|
127
|
+
? Object.setPrototypeOf.bind()
|
|
128
|
+
: function _setPrototypeOf(o, p) {
|
|
129
|
+
o.__proto__ = p;
|
|
130
|
+
return o;
|
|
131
|
+
};
|
|
132
|
+
return _setPrototypeOf(o, p);
|
|
133
|
+
}
|
|
133
134
|
|
|
134
135
|
var computablePrefix = "computable-";
|
|
135
136
|
var triggerPrefix = "trigger-";
|
|
@@ -3653,11 +3654,11 @@ var LabelsLeftLayout = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
3653
3654
|
var CSS = this.CSS,
|
|
3654
3655
|
baseClass = this.baseClass;
|
|
3655
3656
|
var labelClass = CSS.expand(CSS.element(baseClass, "label"), data.labelClass);
|
|
3656
|
-
var
|
|
3657
|
+
var addItem = function addItem(r, key) {
|
|
3657
3658
|
if (!r) return;
|
|
3658
3659
|
if (r.useParentLayout && isArray(r.content))
|
|
3659
3660
|
r.content.forEach(function (x, i) {
|
|
3660
|
-
return
|
|
3661
|
+
return addItem(x, key + "-" + i);
|
|
3661
3662
|
});
|
|
3662
3663
|
else {
|
|
3663
3664
|
result.push(
|
|
@@ -3682,7 +3683,7 @@ var LabelsLeftLayout = /*#__PURE__*/ (function (_PureContainer) {
|
|
|
3682
3683
|
}
|
|
3683
3684
|
};
|
|
3684
3685
|
children.forEach(function (c) {
|
|
3685
|
-
|
|
3686
|
+
addItem(c.vdom, c.key);
|
|
3686
3687
|
});
|
|
3687
3688
|
return /*#__PURE__*/ jsx(
|
|
3688
3689
|
"table",
|
|
@@ -3727,18 +3728,18 @@ var LabelsTopLayout = /*#__PURE__*/ (function (_Container) {
|
|
|
3727
3728
|
fieldCells: [],
|
|
3728
3729
|
rowCapacities: [this.columns],
|
|
3729
3730
|
};
|
|
3730
|
-
var
|
|
3731
|
+
var processContent = function processContent(r) {
|
|
3731
3732
|
if (!r) return;
|
|
3732
3733
|
if (isArray(r.content) && r.useParentLayout)
|
|
3733
3734
|
r.content.forEach(function (x) {
|
|
3734
|
-
return
|
|
3735
|
+
return processContent(x);
|
|
3735
3736
|
});
|
|
3736
3737
|
else if (r.atomic && r.type == "layout-cell")
|
|
3737
3738
|
_this.addItem(state, isArray(r.content) && r.content.length == 1 ? r.content[0] : r.content, r.data);
|
|
3738
3739
|
else _this.addItem(state, r, {});
|
|
3739
3740
|
};
|
|
3740
3741
|
children.forEach(function (item) {
|
|
3741
|
-
return
|
|
3742
|
+
return processContent(item.vdom);
|
|
3742
3743
|
});
|
|
3743
3744
|
this.addRow(state);
|
|
3744
3745
|
return /*#__PURE__*/ jsx(
|
package/dist/widgets.js
CHANGED
|
@@ -141,41 +141,45 @@ import { HtmlElement as HtmlElement$1 } from "cx/widgets";
|
|
|
141
141
|
import { parseStyle as parseStyle$1 } from "cx/src/util/parseStyle";
|
|
142
142
|
|
|
143
143
|
function _extends() {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
_extends = Object.assign
|
|
145
|
+
? Object.assign.bind()
|
|
146
|
+
: function (target) {
|
|
147
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
148
|
+
var source = arguments[i];
|
|
149
|
+
for (var key in source) {
|
|
150
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
151
|
+
target[key] = source[key];
|
|
152
|
+
}
|
|
151
153
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
);
|
|
154
|
+
}
|
|
155
|
+
return target;
|
|
156
|
+
};
|
|
157
|
+
return _extends.apply(this, arguments);
|
|
156
158
|
}
|
|
157
|
-
function _inheritsLoose(
|
|
158
|
-
|
|
159
|
+
function _inheritsLoose(subClass, superClass) {
|
|
160
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
161
|
+
subClass.prototype.constructor = subClass;
|
|
162
|
+
_setPrototypeOf(subClass, superClass);
|
|
159
163
|
}
|
|
160
|
-
function
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return t;
|
|
164
|
+
function _setPrototypeOf(o, p) {
|
|
165
|
+
_setPrototypeOf = Object.setPrototypeOf
|
|
166
|
+
? Object.setPrototypeOf.bind()
|
|
167
|
+
: function _setPrototypeOf(o, p) {
|
|
168
|
+
o.__proto__ = p;
|
|
169
|
+
return o;
|
|
170
|
+
};
|
|
171
|
+
return _setPrototypeOf(o, p);
|
|
169
172
|
}
|
|
170
|
-
function
|
|
171
|
-
return
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
174
|
+
if (source == null) return {};
|
|
175
|
+
var target = {};
|
|
176
|
+
for (var key in source) {
|
|
177
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
178
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
179
|
+
target[key] = source[key];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return target;
|
|
179
183
|
}
|
|
180
184
|
|
|
181
185
|
var impl$1 = false;
|
|
@@ -2267,16 +2271,16 @@ function captureMouseOrTouch2(e, _ref2) {
|
|
|
2267
2271
|
e.preventDefault();
|
|
2268
2272
|
});
|
|
2269
2273
|
};
|
|
2270
|
-
var
|
|
2274
|
+
var end = function end(e) {
|
|
2271
2275
|
batchUpdates(function () {
|
|
2272
2276
|
el.removeEventListener("touchmove", move);
|
|
2273
|
-
el.removeEventListener("touchend",
|
|
2277
|
+
el.removeEventListener("touchend", end);
|
|
2274
2278
|
if (onMouseUp) onMouseUp(e);
|
|
2275
2279
|
e.preventDefault();
|
|
2276
2280
|
});
|
|
2277
2281
|
};
|
|
2278
2282
|
el.addEventListener("touchmove", move);
|
|
2279
|
-
el.addEventListener("touchend",
|
|
2283
|
+
el.addEventListener("touchend", end);
|
|
2280
2284
|
e.stopPropagation();
|
|
2281
2285
|
} else
|
|
2282
2286
|
captureMouse2(e, {
|
|
@@ -2717,7 +2721,7 @@ function notifyDragMove(e, captureData) {
|
|
|
2717
2721
|
}
|
|
2718
2722
|
if (scrollY || scrollX) {
|
|
2719
2723
|
if (!scrollTimer) {
|
|
2720
|
-
var
|
|
2724
|
+
var cb = function cb() {
|
|
2721
2725
|
if (scrollY) {
|
|
2722
2726
|
var current = vscrollParent.scrollTop;
|
|
2723
2727
|
var next = Math.min(
|
|
@@ -2734,9 +2738,9 @@ function notifyDragMove(e, captureData) {
|
|
|
2734
2738
|
); //60 FPS
|
|
2735
2739
|
hscrollParent.scrollLeft = _next;
|
|
2736
2740
|
}
|
|
2737
|
-
scrollTimer = requestAnimationFrame(
|
|
2741
|
+
scrollTimer = requestAnimationFrame(cb);
|
|
2738
2742
|
};
|
|
2739
|
-
scrollTimer = requestAnimationFrame(
|
|
2743
|
+
scrollTimer = requestAnimationFrame(cb);
|
|
2740
2744
|
}
|
|
2741
2745
|
} else {
|
|
2742
2746
|
clearScrollTimer();
|
|
@@ -13891,7 +13895,7 @@ var WheelComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
13891
13895
|
_proto2.scrollTo = function scrollTo() {
|
|
13892
13896
|
var _this4 = this;
|
|
13893
13897
|
var size = this.props.size;
|
|
13894
|
-
var
|
|
13898
|
+
var callback = function callback() {
|
|
13895
13899
|
if (!_this4.scrolling) return;
|
|
13896
13900
|
var x = (_this4.index * _this4.state.wheelHeight) / size;
|
|
13897
13901
|
var delta = Math.round(x - _this4.scrollEl.scrollTop);
|
|
@@ -13903,11 +13907,11 @@ var WheelComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
13903
13907
|
delta = Math.abs(delta) / 10;
|
|
13904
13908
|
if (delta < 1) delta = 1;
|
|
13905
13909
|
_this4.scrollEl.scrollTop += sign * delta;
|
|
13906
|
-
requestAnimationFrame(
|
|
13910
|
+
requestAnimationFrame(callback);
|
|
13907
13911
|
};
|
|
13908
13912
|
if (!this.scrolling) {
|
|
13909
13913
|
this.scrolling = true;
|
|
13910
|
-
requestAnimationFrame(
|
|
13914
|
+
requestAnimationFrame(callback);
|
|
13911
13915
|
}
|
|
13912
13916
|
};
|
|
13913
13917
|
return WheelComponent;
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cx",
|
|
3
|
-
"version": "24.
|
|
4
|
-
"description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"jsnext:main": "src/index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "node build/index"
|
|
9
|
-
},
|
|
10
|
-
"author": "Codaxy",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/codaxy/cxjs"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://cxjs.io",
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"intl-io": "^0.4.3",
|
|
18
|
-
"route-parser": "^0.0.5"
|
|
19
|
-
},
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"@types/react": "*",
|
|
22
|
-
"react": "*",
|
|
23
|
-
"react-dom": "*"
|
|
24
|
-
},
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "git@github.com:codaxy/cxjs.git"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"react-test-renderer": "^18.3.1"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "cx",
|
|
3
|
+
"version": "24.10.1",
|
|
4
|
+
"description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"jsnext:main": "src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "node build/index"
|
|
9
|
+
},
|
|
10
|
+
"author": "Codaxy",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/codaxy/cxjs"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://cxjs.io",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"intl-io": "^0.4.3",
|
|
18
|
+
"route-parser": "^0.0.5"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@types/react": "*",
|
|
22
|
+
"react": "*",
|
|
23
|
+
"react-dom": "*"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git@github.com:codaxy/cxjs.git"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"react-test-renderer": "^18.3.1"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/charts/Legend.js
CHANGED
|
@@ -3,10 +3,24 @@ import { HtmlElement } from "../widgets/HtmlElement";
|
|
|
3
3
|
import { PureContainer } from "../ui/PureContainer";
|
|
4
4
|
import { getShape } from "./shapes";
|
|
5
5
|
import { isUndefined } from "../util/isUndefined";
|
|
6
|
-
import {
|
|
6
|
+
import { isNonEmptyArray } from "../util/isNonEmptyArray";
|
|
7
|
+
import { parseStyle } from "../util/parseStyle";
|
|
7
8
|
import { withHoverSync } from "../ui/HoverSync";
|
|
8
9
|
|
|
9
10
|
export class Legend extends HtmlElement {
|
|
11
|
+
declareData() {
|
|
12
|
+
super.declareData(...arguments, {
|
|
13
|
+
shape: undefined,
|
|
14
|
+
entryStyle: { structured: true },
|
|
15
|
+
entryClass: { structured: true },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
init() {
|
|
20
|
+
this.entryStyle = parseStyle(this.entryStyle);
|
|
21
|
+
super.init();
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
prepareData(context, instance) {
|
|
11
25
|
let { data } = instance;
|
|
12
26
|
data.stateMods = Object.assign(data.stateMods || {}, {
|
|
@@ -15,17 +29,13 @@ export class Legend extends HtmlElement {
|
|
|
15
29
|
super.prepareData(context, instance);
|
|
16
30
|
}
|
|
17
31
|
|
|
18
|
-
declareData() {
|
|
19
|
-
super.declareData(...arguments, {
|
|
20
|
-
shape: undefined,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
32
|
isValidHtmlAttribute(attrName) {
|
|
25
33
|
switch (attrName) {
|
|
26
34
|
case "shapeSize":
|
|
27
35
|
case "svgSize":
|
|
28
36
|
case "shape":
|
|
37
|
+
case "entryStyle":
|
|
38
|
+
case "entryClass":
|
|
29
39
|
return false;
|
|
30
40
|
|
|
31
41
|
default:
|
|
@@ -66,29 +76,31 @@ export class Legend extends HtmlElement {
|
|
|
66
76
|
let entries = instance.legends[this.name] && instance.legends[this.name].entries,
|
|
67
77
|
list;
|
|
68
78
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
let { entryClass, entryStyle, shape } = instance.data;
|
|
80
|
+
|
|
81
|
+
if (isNonEmptyArray(entries)) {
|
|
82
|
+
list = entries.map((e, i) =>
|
|
83
|
+
withHoverSync(i, e.hoverSync, e.hoverChannel, e.hoverId, ({ onMouseMove, onMouseLeave, hover }) => (
|
|
84
|
+
<div
|
|
85
|
+
key={i}
|
|
86
|
+
className={CSS.expand(
|
|
87
|
+
CSS.element(this.baseClass, "entry", {
|
|
88
|
+
"color-root": true,
|
|
89
|
+
hover,
|
|
90
|
+
disabled: e.disabled,
|
|
91
|
+
selected: e.selected,
|
|
92
|
+
}),
|
|
93
|
+
entryClass,
|
|
94
|
+
)}
|
|
95
|
+
style={entryStyle}
|
|
96
|
+
onClick={e.onClick}
|
|
97
|
+
onMouseMove={onMouseMove}
|
|
98
|
+
onMouseLeave={onMouseLeave}
|
|
99
|
+
>
|
|
100
|
+
{this.renderShape(e, shape)}
|
|
101
|
+
<div>{e.displayText || e.name}</div>
|
|
102
|
+
</div>
|
|
103
|
+
)),
|
|
92
104
|
);
|
|
93
105
|
}
|
|
94
106
|
|
|
@@ -101,18 +113,22 @@ export class Legend extends HtmlElement {
|
|
|
101
113
|
});
|
|
102
114
|
const shape = getShape(legendEntriesShape || entry.shape || "square");
|
|
103
115
|
|
|
116
|
+
// if the entry has a custom fill or stroke set, use it for both values
|
|
117
|
+
let style = { ...entry.style };
|
|
118
|
+
style.fill = style.fill ?? style.stroke;
|
|
119
|
+
style.stroke = style.stroke ?? style.fill;
|
|
120
|
+
|
|
104
121
|
return (
|
|
105
122
|
<svg
|
|
106
123
|
className={this.CSS.element(this.baseClass, "svg")}
|
|
107
124
|
style={{
|
|
108
125
|
width: `${this.svgSize}px`,
|
|
109
126
|
height: `${this.svgSize}px`,
|
|
110
|
-
marginTop: `${-this.svgSize / 2}px`,
|
|
111
127
|
}}
|
|
112
128
|
>
|
|
113
129
|
{shape(this.svgSize / 2, this.svgSize / 2, entry.shapeSize || this.shapeSize, {
|
|
114
|
-
style
|
|
115
|
-
className
|
|
130
|
+
style,
|
|
131
|
+
className,
|
|
116
132
|
})}
|
|
117
133
|
</svg>
|
|
118
134
|
);
|