cx 23.11.1 → 23.12.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/dist/manifest.js +578 -578
- package/dist/widgets.js +4 -4
- package/package.json +1 -1
- package/src/data/AggregateFunction.d.ts +20 -18
- package/src/data/AggregateFunction.js +145 -149
- package/src/widgets/Sandbox.d.ts +3 -3
- package/src/widgets/form/LookupField.js +1 -1
- package/src/widgets/grid/Grid.d.ts +1 -0
package/dist/widgets.js
CHANGED
|
@@ -9301,12 +9301,12 @@ var LookupComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
9301
9301
|
if (this.props.multiple) {
|
|
9302
9302
|
var readOnly = data.disabled || data.readOnly;
|
|
9303
9303
|
if (isNonEmptyArray(data.records)) {
|
|
9304
|
-
var
|
|
9304
|
+
var _widget$onGetRecordDi;
|
|
9305
9305
|
var valueTextFormatter =
|
|
9306
|
-
(
|
|
9307
|
-
?
|
|
9306
|
+
(_widget$onGetRecordDi = widget.onGetRecordDisplayText) != null
|
|
9307
|
+
? _widget$onGetRecordDi
|
|
9308
9308
|
: function (record) {
|
|
9309
|
-
return record[
|
|
9309
|
+
return record[widget.valueTextField];
|
|
9310
9310
|
};
|
|
9311
9311
|
text = data.records.map(function (v, i) {
|
|
9312
9312
|
return /*#__PURE__*/ jsxs(
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
interface Aggregator {
|
|
2
|
-
process(value: number, weight?: number);
|
|
3
|
-
getResult(): number
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export class AggregateFunction {
|
|
7
|
-
static sum(): Aggregator;
|
|
8
|
-
|
|
9
|
-
static avg(): Aggregator;
|
|
10
|
-
|
|
11
|
-
static count(): Aggregator;
|
|
12
|
-
|
|
13
|
-
static distinct(): Aggregator;
|
|
14
|
-
|
|
15
|
-
static min(): Aggregator;
|
|
16
|
-
|
|
17
|
-
static max(): Aggregator;
|
|
18
|
-
|
|
1
|
+
interface Aggregator {
|
|
2
|
+
process(value: number, weight?: number);
|
|
3
|
+
getResult(): number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export class AggregateFunction {
|
|
7
|
+
static sum(): Aggregator;
|
|
8
|
+
|
|
9
|
+
static avg(): Aggregator;
|
|
10
|
+
|
|
11
|
+
static count(): Aggregator;
|
|
12
|
+
|
|
13
|
+
static distinct(): Aggregator;
|
|
14
|
+
|
|
15
|
+
static min(): Aggregator;
|
|
16
|
+
|
|
17
|
+
static max(): Aggregator;
|
|
18
|
+
|
|
19
|
+
static last(): Aggregator;
|
|
20
|
+
}
|
|
@@ -1,149 +1,145 @@
|
|
|
1
|
-
export class AggregateFunction {
|
|
2
|
-
static sum() {
|
|
3
|
-
return new Sum();
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
static avg() {
|
|
7
|
-
return new Avg();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
static count() {
|
|
11
|
-
return new Count();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
static distinct() {
|
|
15
|
-
return new Distinct();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static min() {
|
|
19
|
-
return new Min();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static max() {
|
|
23
|
-
return new Max();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Sum.prototype.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
else
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Avg.prototype.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.values
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.empty
|
|
92
|
-
this.result
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
Min.prototype.result = 0;
|
|
149
|
-
Min.prototype.empty = true;
|
|
1
|
+
export class AggregateFunction {
|
|
2
|
+
static sum() {
|
|
3
|
+
return new Sum();
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
static avg() {
|
|
7
|
+
return new Avg();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static count() {
|
|
11
|
+
return new Count();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static distinct() {
|
|
15
|
+
return new Distinct();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static min() {
|
|
19
|
+
return new Min();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static max() {
|
|
23
|
+
return new Max();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static last() {
|
|
27
|
+
return new LastValue();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
class Sum {
|
|
32
|
+
process(value) {
|
|
33
|
+
this.empty = false;
|
|
34
|
+
if (!isNaN(value)) this.result += value;
|
|
35
|
+
else this.invalid = true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getResult() {
|
|
39
|
+
if (this.invalid) return null;
|
|
40
|
+
return this.result;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Sum.prototype.result = 0;
|
|
45
|
+
Sum.prototype.empty = true;
|
|
46
|
+
|
|
47
|
+
class Avg {
|
|
48
|
+
process(value, count = 1) {
|
|
49
|
+
this.empty = false;
|
|
50
|
+
if (!isNaN(value) && !isNaN(count)) {
|
|
51
|
+
this.result += value * count;
|
|
52
|
+
this.count += count;
|
|
53
|
+
} else this.invalid = true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getResult() {
|
|
57
|
+
if (this.empty || this.invalid || this.count == 0) return null;
|
|
58
|
+
return this.result / this.count;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
Avg.prototype.result = 0;
|
|
63
|
+
Avg.prototype.count = 0;
|
|
64
|
+
Avg.prototype.empty = true;
|
|
65
|
+
|
|
66
|
+
class Count {
|
|
67
|
+
process(value) {
|
|
68
|
+
if (value != null) this.result++;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
getResult() {
|
|
72
|
+
return this.result;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
Count.prototype.result = 0;
|
|
77
|
+
|
|
78
|
+
class Distinct {
|
|
79
|
+
constructor() {
|
|
80
|
+
this.values = {};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
process(value) {
|
|
84
|
+
if (value == null || this.values[value]) return;
|
|
85
|
+
this.values[value] = true;
|
|
86
|
+
this.empty = false;
|
|
87
|
+
this.result++;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
getResult() {
|
|
91
|
+
if (this.empty || this.invalid) return null;
|
|
92
|
+
return this.result;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
Distinct.prototype.result = 0;
|
|
97
|
+
Distinct.prototype.empty = true;
|
|
98
|
+
|
|
99
|
+
class Max {
|
|
100
|
+
process(value) {
|
|
101
|
+
if (!isNaN(value)) {
|
|
102
|
+
if (this.empty) this.result = value;
|
|
103
|
+
else if (value > this.result) this.result = value;
|
|
104
|
+
this.empty = false;
|
|
105
|
+
} else if (value != null) this.invalid = true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
getResult() {
|
|
109
|
+
if (this.empty || this.invalid) return null;
|
|
110
|
+
return this.result;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
Max.prototype.result = 0;
|
|
115
|
+
Max.prototype.empty = true;
|
|
116
|
+
|
|
117
|
+
class Min {
|
|
118
|
+
process(value) {
|
|
119
|
+
if (!isNaN(value)) {
|
|
120
|
+
if (this.empty) this.result = value;
|
|
121
|
+
else if (value < this.result) this.result = value;
|
|
122
|
+
this.empty = false;
|
|
123
|
+
} else if (value != null) this.invalid = true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
getResult() {
|
|
127
|
+
if (this.empty || this.invalid) return null;
|
|
128
|
+
return this.result;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
Min.prototype.result = 0;
|
|
133
|
+
Min.prototype.empty = true;
|
|
134
|
+
|
|
135
|
+
class LastValue {
|
|
136
|
+
process(value) {
|
|
137
|
+
this.result = value;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
getResult() {
|
|
141
|
+
return this.result;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
LastValue.prototype.result = null;
|
package/src/widgets/Sandbox.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ interface SandboxProps extends Cx.PureContainerProps {
|
|
|
8
8
|
|
|
9
9
|
accessKey?: Cx.StringProp;
|
|
10
10
|
|
|
11
|
-
recordName?:
|
|
12
|
-
recordAlias?:
|
|
13
|
-
immutable?:
|
|
11
|
+
recordName?: Cx.RecordAlias;
|
|
12
|
+
recordAlias?: Cx.RecordAlias;
|
|
13
|
+
immutable?: Cx.BooleanProp;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export class Sandbox extends Cx.Widget<SandboxProps> {}
|
|
@@ -590,7 +590,7 @@ class LookupComponent extends VDOM.Component {
|
|
|
590
590
|
if (this.props.multiple) {
|
|
591
591
|
let readOnly = data.disabled || data.readOnly;
|
|
592
592
|
if (isNonEmptyArray(data.records)) {
|
|
593
|
-
let valueTextFormatter =
|
|
593
|
+
let valueTextFormatter = widget.onGetRecordDisplayText ?? ((record) => record[widget.valueTextField]);
|
|
594
594
|
text = data.records.map((v, i) => (
|
|
595
595
|
<div
|
|
596
596
|
key={i}
|
|
@@ -136,6 +136,7 @@ interface GridColumnConfig {
|
|
|
136
136
|
|
|
137
137
|
/** Options for data sorting. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator */
|
|
138
138
|
sortOptions?: CollatorOptions;
|
|
139
|
+
colSpan?: NumberProp;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
interface GridRowLineConfig {
|