cx 25.10.1 → 25.11.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/LICENSE-THIRD-PARTY.md +91 -91
- package/LICENSE.md +7 -7
- package/README.md +46 -46
- package/dist/manifest.js +705 -705
- package/dist/ui.js +4 -2
- package/dist/widgets.js +2 -0
- package/package.json +1 -1
- package/src/charts/Bar.d.ts +27 -27
- package/src/charts/BarGraph.d.ts +15 -15
- package/src/charts/Chart.d.ts +12 -12
- package/src/charts/ColorMap.d.ts +21 -21
- package/src/charts/Column.d.ts +29 -29
- package/src/charts/ColumnBarBase.d.ts +64 -64
- package/src/charts/ColumnBarGraphBase.d.ts +73 -73
- package/src/charts/ColumnGraph.d.ts +18 -18
- package/src/charts/Gridlines.d.ts +24 -24
- package/src/charts/Legend.d.ts +45 -45
- package/src/charts/LegendEntry.d.ts +54 -54
- package/src/charts/LineGraph.d.ts +101 -101
- package/src/charts/Marker.d.ts +110 -110
- package/src/charts/MarkerLine.d.ts +56 -56
- package/src/charts/MouseTracker.d.ts +16 -16
- package/src/charts/PieChart.d.ts +92 -92
- package/src/charts/PieLabel.d.ts +26 -26
- package/src/charts/PieLabelsContainer.d.ts +6 -6
- package/src/charts/Range.d.ts +74 -74
- package/src/charts/RangeMarker.d.ts +35 -35
- package/src/charts/ScatterGraph.d.ts +64 -64
- package/src/charts/Swimlane.d.ts +24 -24
- package/src/charts/Swimlanes.d.ts +41 -41
- package/src/charts/axis/Axis.d.ts +113 -113
- package/src/charts/axis/Axis.scss +22 -22
- package/src/charts/axis/CategoryAxis.d.ts +30 -30
- package/src/charts/axis/NumericAxis.d.ts +46 -46
- package/src/charts/axis/Stack.d.ts +10 -10
- package/src/charts/axis/TimeAxis.d.ts +31 -31
- package/src/charts/axis/index.d.ts +3 -3
- package/src/charts/axis/index.scss +5 -5
- package/src/charts/axis/variables.scss +2 -2
- package/src/charts/helpers/MinMaxFinder.d.ts +22 -22
- package/src/charts/helpers/PointReducer.d.ts +24 -24
- package/src/charts/helpers/SnapPointFinder.d.ts +30 -30
- package/src/charts/helpers/ValueAtFinder.d.ts +16 -16
- package/src/charts/helpers/index.d.ts +4 -4
- package/src/charts/index.d.ts +27 -27
- package/src/charts/index.scss +22 -22
- package/src/charts/shapes.d.ts +22 -22
- package/src/data/Grouper.spec.js +57 -57
- package/src/global.scss +13 -13
- package/src/index.scss +6 -6
- package/src/svg/index.scss +8 -8
- package/src/ui/adapter/ArrayAdapter.js +152 -152
- package/src/ui/adapter/GroupAdapter.js +143 -140
- package/src/ui/index.scss +2 -2
- package/src/ui/layout/index.scss +3 -3
- package/src/ui/layout/variables.scss +2 -2
- package/src/ui/variables.scss +1 -1
- package/src/util/call-once.scss +6 -6
- package/src/util/index.scss +10 -10
- package/src/util/scss/divide.scss +3 -3
- package/src/util/scss/index.scss +9 -9
- package/src/variables.scss +217 -217
- package/src/widgets/AccessorBindings.spec.tsx +66 -66
- package/src/widgets/Button.d.ts +58 -58
- package/src/widgets/CxCredit.d.ts +12 -12
- package/src/widgets/DocumentTitle.d.ts +11 -11
- package/src/widgets/FlexBox.d.ts +69 -69
- package/src/widgets/Heading.d.ts +16 -16
- package/src/widgets/HighlightedSearchText.d.ts +9 -9
- package/src/widgets/HtmlElement.d.ts +30 -30
- package/src/widgets/Icon.d.ts +34 -34
- package/src/widgets/ProgressBar.d.ts +17 -17
- package/src/widgets/Resizer.d.ts +27 -27
- package/src/widgets/Sandbox.d.ts +18 -18
- package/src/widgets/Section.d.ts +52 -52
- package/src/widgets/animations.scss +10 -10
- package/src/widgets/autoFocus.d.ts +1 -1
- package/src/widgets/cx.d.ts +1 -1
- package/src/widgets/drag-drop/DragSource.d.ts +45 -45
- package/src/widgets/drag-drop/DropZone.d.ts +98 -98
- package/src/widgets/drag-drop/index.d.ts +4 -4
- package/src/widgets/drag-drop/index.scss +3 -3
- package/src/widgets/drag-drop/ops.d.ts +56 -56
- package/src/widgets/enableAllInternalDependencies.d.ts +1 -1
- package/src/widgets/form/Calendar.variables.scss +63 -63
- package/src/widgets/form/Checkbox.variables.scss +39 -39
- package/src/widgets/form/ColorPicker.variables.scss +22 -22
- package/src/widgets/form/Radio.variables.scss +45 -45
- package/src/widgets/form/index.scss +24 -24
- package/src/widgets/grid/Grid.d.ts +3 -0
- package/src/widgets/grid/Grid.js +3431 -3429
- package/src/widgets/grid/GridCell.d.ts +38 -38
- package/src/widgets/grid/Pagination.d.ts +14 -14
- package/src/widgets/grid/TreeNode.d.ts +23 -23
- package/src/widgets/grid/index.d.ts +3 -3
- package/src/widgets/grid/index.scss +3 -3
- package/src/widgets/icons/arrow-down.svg +3 -3
- package/src/widgets/icons/arrow-right.svg +2 -2
- package/src/widgets/icons/base.svg +104 -104
- package/src/widgets/icons/calendar-old.svg +169 -169
- package/src/widgets/icons/calendar.svg +187 -187
- package/src/widgets/icons/clear.svg +74 -74
- package/src/widgets/icons/close.svg +74 -74
- package/src/widgets/icons/dropdown-arrow.svg +61 -61
- package/src/widgets/icons/file.svg +4 -4
- package/src/widgets/icons/folder-open.svg +5 -5
- package/src/widgets/icons/folder.svg +58 -58
- package/src/widgets/icons/forward.svg +67 -67
- package/src/widgets/icons/loading.svg +4 -4
- package/src/widgets/icons/search.svg +107 -107
- package/src/widgets/icons/sort-asc.svg +3 -3
- package/src/widgets/index.d.ts +55 -55
- package/src/widgets/index.scss +16 -16
- package/src/widgets/nav/Link.d.ts +26 -26
- package/src/widgets/nav/LinkButton.d.ts +34 -34
- package/src/widgets/nav/Menu.d.ts +27 -27
- package/src/widgets/nav/MenuItem.d.ts +31 -31
- package/src/widgets/nav/MenuSpacer.d.ts +5 -5
- package/src/widgets/nav/RedirectRoute.d.ts +9 -9
- package/src/widgets/nav/Route.d.ts +21 -21
- package/src/widgets/nav/Scroller.d.ts +17 -17
- package/src/widgets/nav/Submenu.d.ts +6 -6
- package/src/widgets/nav/Tab.d.ts +33 -33
- package/src/widgets/nav/Tab.variables.scss +84 -84
- package/src/widgets/nav/index.d.ts +10 -10
- package/src/widgets/nav/index.scss +5 -5
- package/src/widgets/overlay/ContextMenu.d.ts +10 -10
- package/src/widgets/overlay/Dropdown.d.ts +32 -32
- package/src/widgets/overlay/FlyweightTooltipTracker.d.ts +8 -8
- package/src/widgets/overlay/MsgBox.d.ts +16 -16
- package/src/widgets/overlay/Overlay.d.ts +73 -73
- package/src/widgets/overlay/Toast.d.ts +30 -30
- package/src/widgets/overlay/Tooltip.d.ts +50 -50
- package/src/widgets/overlay/Window.d.ts +42 -42
- package/src/widgets/overlay/Window.variables.scss +62 -62
- package/src/widgets/overlay/alerts.d.ts +7 -7
- package/src/widgets/overlay/captureMouse.d.ts +53 -53
- package/src/widgets/overlay/captureMouse.scss +13 -13
- package/src/widgets/overlay/createHotPromiseWindowFactory.d.ts +18 -18
- package/src/widgets/overlay/index.d.ts +11 -11
- package/src/widgets/overlay/index.scss +15 -15
|
@@ -1,140 +1,143 @@
|
|
|
1
|
-
import { ArrayAdapter } from "./ArrayAdapter";
|
|
2
|
-
import { ReadOnlyDataView } from "../../data/ReadOnlyDataView";
|
|
3
|
-
import { Grouper } from "../../data/Grouper";
|
|
4
|
-
import { isArray } from "../../util/isArray";
|
|
5
|
-
import { isDefined } from "../../util/isDefined";
|
|
6
|
-
import { getComparer } from "../../data/comparer";
|
|
7
|
-
import { Culture } from "../Culture";
|
|
8
|
-
import { isObject } from "../../util/isObject";
|
|
9
|
-
|
|
10
|
-
export class GroupAdapter extends ArrayAdapter {
|
|
11
|
-
init() {
|
|
12
|
-
super.init();
|
|
13
|
-
|
|
14
|
-
if (this.groupRecordsAlias) this.groupRecordsName = this.groupRecordsAlias;
|
|
15
|
-
|
|
16
|
-
if (this.groupings) this.groupBy(this.groupings);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
getRecords(context, instance, records, parentStore) {
|
|
20
|
-
let result = super.getRecords(context, instance, records, parentStore);
|
|
21
|
-
|
|
22
|
-
if (this.groupings) {
|
|
23
|
-
let groupedResults = [];
|
|
24
|
-
this.processLevel([], result, groupedResults, parentStore);
|
|
25
|
-
result = groupedResults;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
processLevel(keys, records, result, parentStore) {
|
|
32
|
-
let level = keys.length;
|
|
33
|
-
let inverseLevel = this.groupings.length - level;
|
|
34
|
-
|
|
35
|
-
if (inverseLevel == 0) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
grouper
|
|
46
|
-
grouper.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
results.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
$
|
|
61
|
-
$
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
key[name]
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
1
|
+
import { ArrayAdapter } from "./ArrayAdapter";
|
|
2
|
+
import { ReadOnlyDataView } from "../../data/ReadOnlyDataView";
|
|
3
|
+
import { Grouper } from "../../data/Grouper";
|
|
4
|
+
import { isArray } from "../../util/isArray";
|
|
5
|
+
import { isDefined } from "../../util/isDefined";
|
|
6
|
+
import { getComparer } from "../../data/comparer";
|
|
7
|
+
import { Culture } from "../Culture";
|
|
8
|
+
import { isObject } from "../../util/isObject";
|
|
9
|
+
|
|
10
|
+
export class GroupAdapter extends ArrayAdapter {
|
|
11
|
+
init() {
|
|
12
|
+
super.init();
|
|
13
|
+
|
|
14
|
+
if (this.groupRecordsAlias) this.groupRecordsName = this.groupRecordsAlias;
|
|
15
|
+
|
|
16
|
+
if (this.groupings) this.groupBy(this.groupings);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getRecords(context, instance, records, parentStore) {
|
|
20
|
+
let result = super.getRecords(context, instance, records, parentStore);
|
|
21
|
+
|
|
22
|
+
if (this.groupings) {
|
|
23
|
+
let groupedResults = [];
|
|
24
|
+
this.processLevel([], result, groupedResults, parentStore);
|
|
25
|
+
result = groupedResults;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
processLevel(keys, records, result, parentStore) {
|
|
32
|
+
let level = keys.length;
|
|
33
|
+
let inverseLevel = this.groupings.length - level;
|
|
34
|
+
|
|
35
|
+
if (inverseLevel == 0) {
|
|
36
|
+
if (this.preserveOrder && this.sorter) records = this.sorter(records);
|
|
37
|
+
for (let i = 0; i < records.length; i++) {
|
|
38
|
+
records[i].store.setStore(parentStore);
|
|
39
|
+
result.push(records[i]);
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let grouping = this.groupings[level];
|
|
45
|
+
let { grouper } = grouping;
|
|
46
|
+
grouper.reset();
|
|
47
|
+
grouper.processAll(records);
|
|
48
|
+
let results = grouper.getResults();
|
|
49
|
+
|
|
50
|
+
if (grouping.comparer && !this.preserveOrder) results.sort(grouping.comparer);
|
|
51
|
+
|
|
52
|
+
results.forEach((gr) => {
|
|
53
|
+
keys.push(gr.key);
|
|
54
|
+
|
|
55
|
+
let key = keys.map(serializeKey).join("|");
|
|
56
|
+
|
|
57
|
+
let $group = {
|
|
58
|
+
...gr.key,
|
|
59
|
+
...gr.aggregates,
|
|
60
|
+
$name: gr.name,
|
|
61
|
+
$level: inverseLevel,
|
|
62
|
+
$records: gr.records || [],
|
|
63
|
+
$key: key,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
let data = {
|
|
67
|
+
[this.recordName]: gr.records.length > 0 ? gr.records[0].data : null,
|
|
68
|
+
[this.groupName]: $group,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
let groupStore = new ReadOnlyDataView({
|
|
72
|
+
store: parentStore,
|
|
73
|
+
data,
|
|
74
|
+
immutable: this.immutable,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
let group = {
|
|
78
|
+
key,
|
|
79
|
+
data,
|
|
80
|
+
group: $group,
|
|
81
|
+
grouping,
|
|
82
|
+
store: groupStore,
|
|
83
|
+
level: inverseLevel,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
if (grouping.includeHeader !== false)
|
|
87
|
+
result.push({
|
|
88
|
+
...group,
|
|
89
|
+
type: "group-header",
|
|
90
|
+
key: "header:" + group.key,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
this.processLevel(keys, gr.records, result, groupStore);
|
|
94
|
+
|
|
95
|
+
if (grouping.includeFooter !== false)
|
|
96
|
+
result.push({
|
|
97
|
+
...group,
|
|
98
|
+
type: "group-footer",
|
|
99
|
+
key: "footer:" + group.key,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
keys.pop();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
groupBy(groupings) {
|
|
107
|
+
if (!groupings) this.groupings = null;
|
|
108
|
+
else if (isArray(groupings)) {
|
|
109
|
+
this.groupings = groupings;
|
|
110
|
+
this.groupings.forEach((g) => {
|
|
111
|
+
let groupSorters = [];
|
|
112
|
+
let key = {};
|
|
113
|
+
for (let name in g.key) {
|
|
114
|
+
if (!g.key[name] || !isDefined(g.key[name].direction) || !isDefined(g.key[name].value))
|
|
115
|
+
g.key[name] = { value: g.key[name], direction: "ASC" };
|
|
116
|
+
key[name] = g.key[name].value;
|
|
117
|
+
groupSorters.push({
|
|
118
|
+
field: name,
|
|
119
|
+
direction: g.key[name].direction,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
g.grouper = new Grouper(key, { ...this.aggregates, ...g.aggregates }, (r) => r.store.getData(), g.text);
|
|
123
|
+
if (g.comparer == null && groupSorters.length > 0)
|
|
124
|
+
g.comparer = getComparer(
|
|
125
|
+
groupSorters,
|
|
126
|
+
(x) => x.key,
|
|
127
|
+
this.sortOptions ? Culture.getComparer(this.sortOptions) : null,
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
} else throw new Error("Invalid grouping provided.");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
GroupAdapter.prototype.groupName = "$group";
|
|
135
|
+
GroupAdapter.prototype.preserveOrder = false;
|
|
136
|
+
|
|
137
|
+
function serializeKey(data) {
|
|
138
|
+
if (isObject(data))
|
|
139
|
+
return Object.keys(data)
|
|
140
|
+
.map((k) => serializeKey(data[k]))
|
|
141
|
+
.join(":");
|
|
142
|
+
return data?.toString() ?? "";
|
|
143
|
+
}
|
package/src/ui/index.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
@import 'layout/index';
|
|
1
|
+
|
|
2
|
+
@import 'layout/index';
|
package/src/ui/layout/index.scss
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
@import "LabelsLeftLayout";
|
|
3
|
-
@import "LabelsTopLayout";
|
|
1
|
+
|
|
2
|
+
@import "LabelsLeftLayout";
|
|
3
|
+
@import "LabelsTopLayout";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
// Layout variables
|
|
1
|
+
|
|
2
|
+
// Layout variables
|
package/src/ui/variables.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
@import "layout/variables";
|
package/src/util/call-once.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
$cx-call-once-data: () !default;
|
|
2
|
-
|
|
3
|
-
@function cx-call-once($name) {
|
|
4
|
-
$result: map_get($cx-call-once-data, $name);
|
|
5
|
-
$cx-call-once-data: map_merge($cx-call-once-data, ($name: true)) !global;
|
|
6
|
-
@return $result != true;
|
|
1
|
+
$cx-call-once-data: () !default;
|
|
2
|
+
|
|
3
|
+
@function cx-call-once($name) {
|
|
4
|
+
$result: map_get($cx-call-once-data, $name);
|
|
5
|
+
$cx-call-once-data: map_merge($cx-call-once-data, ($name: true)) !global;
|
|
6
|
+
@return $result != true;
|
|
7
7
|
}
|
package/src/util/index.scss
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.cx-text-left.cx-text-left {
|
|
2
|
-
text-align: left;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.cx-text-right.cx-text-right {
|
|
6
|
-
text-align: right;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.cx-text-center.cx-text-center {
|
|
10
|
-
text-align: center;
|
|
1
|
+
.cx-text-left.cx-text-left {
|
|
2
|
+
text-align: left;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cx-text-right.cx-text-right {
|
|
6
|
+
text-align: right;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.cx-text-center.cx-text-center {
|
|
10
|
+
text-align: center;
|
|
11
11
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
@function cx-divide($a, $b) {
|
|
2
|
-
@return $a / $b;
|
|
3
|
-
}
|
|
1
|
+
@function cx-divide($a, $b) {
|
|
2
|
+
@return $a / $b;
|
|
3
|
+
}
|
package/src/util/scss/index.scss
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import "add-rules";
|
|
2
|
-
@import "calc";
|
|
3
|
-
@import "call-once";
|
|
4
|
-
@import "clockwise";
|
|
5
|
-
@import "colors";
|
|
6
|
-
@import "deep-merge";
|
|
7
|
-
@import "deep-get";
|
|
8
|
-
@import "include";
|
|
9
|
-
@import "divide";
|
|
1
|
+
@import "add-rules";
|
|
2
|
+
@import "calc";
|
|
3
|
+
@import "call-once";
|
|
4
|
+
@import "clockwise";
|
|
5
|
+
@import "colors";
|
|
6
|
+
@import "deep-merge";
|
|
7
|
+
@import "deep-get";
|
|
8
|
+
@import "include";
|
|
9
|
+
@import "divide";
|