@hpcc-js/marshaller 2.28.5 → 2.28.7
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 +43 -43
- package/dist/index.es6.js +22 -22
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/package.json +16 -16
- package/src/__package__.ts +3 -3
- package/src/dashy.css +239 -239
- package/src/dashy.ts +521 -521
- package/src/ddl1/DDLApi.ts +229 -229
- package/src/ddl1/FlyoutButton.ts +120 -120
- package/src/ddl1/Graph.ts +93 -93
- package/src/ddl1/HTML.ts +77 -77
- package/src/ddl1/HipieDDL.ts +2437 -2437
- package/src/ddl1/HipieDDLMixin.ts +380 -380
- package/src/ddl1/Tabbed.ts +91 -91
- package/src/ddl1/TargetMarshaller.ts +57 -57
- package/src/ddl2/PopupManager.ts +89 -89
- package/src/ddl2/activities/activity.ts +431 -431
- package/src/ddl2/activities/databomb.ts +237 -237
- package/src/ddl2/activities/datasource.ts +52 -52
- package/src/ddl2/activities/dspicker.ts +106 -106
- package/src/ddl2/activities/filter.ts +542 -542
- package/src/ddl2/activities/form.ts +153 -153
- package/src/ddl2/activities/groupby.ts +439 -439
- package/src/ddl2/activities/hipiepipeline.ts +114 -114
- package/src/ddl2/activities/limit.ts +49 -49
- package/src/ddl2/activities/logicalfile.ts +62 -62
- package/src/ddl2/activities/nullview.ts +12 -12
- package/src/ddl2/activities/project.ts +764 -764
- package/src/ddl2/activities/rest.ts +568 -568
- package/src/ddl2/activities/roxie.ts +490 -490
- package/src/ddl2/activities/sampledata.json +16264 -16264
- package/src/ddl2/activities/sort.ts +176 -176
- package/src/ddl2/activities/wuresult.ts +395 -395
- package/src/ddl2/dashboard.css +13 -13
- package/src/ddl2/dashboard.ts +330 -330
- package/src/ddl2/dashboardDockPanel.ts +123 -123
- package/src/ddl2/dashboardGrid.ts +202 -202
- package/src/ddl2/ddl.ts +410 -410
- package/src/ddl2/ddleditor.ts +60 -60
- package/src/ddl2/dsTable.ts +238 -238
- package/src/ddl2/dvTable.ts +31 -31
- package/src/ddl2/graphadapter.ts +297 -297
- package/src/ddl2/javascriptadapter.ts +354 -354
- package/src/ddl2/model/element.ts +398 -398
- package/src/ddl2/model/visualization.ts +351 -351
- package/src/ddl2/model/vizChartPanel.ts +149 -149
- package/src/ddl2/pipelinePanel.css +4 -4
- package/src/ddl2/pipelinePanel.ts +465 -465
- package/src/index.ts +26 -26
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
import { PropertyExt, publish } from "@hpcc-js/common";
|
|
2
|
-
import { DDL2 } from "@hpcc-js/ddl-shim";
|
|
3
|
-
import { hashSum } from "@hpcc-js/util";
|
|
4
|
-
import { ascending as d3Ascending, descending as d3Descending } from "d3-array";
|
|
5
|
-
import { Activity, IActivityError, ReferencedFields } from "./activity";
|
|
6
|
-
|
|
7
|
-
export class SortColumn extends PropertyExt {
|
|
8
|
-
private _owner: Sort;
|
|
9
|
-
|
|
10
|
-
@publish(null, "set", "Sort Field", function (this: SortColumn) { return this.fieldIDs(); }, {
|
|
11
|
-
optional: true,
|
|
12
|
-
validate: (w: SortColumn): boolean => w.fieldIDs().indexOf(w.fieldID()) >= 0
|
|
13
|
-
})
|
|
14
|
-
fieldID: publish<this, string>;
|
|
15
|
-
fieldID_valid: () => boolean;
|
|
16
|
-
@publish(false, "boolean", "Sort Field")
|
|
17
|
-
descending: publish<this, boolean>;
|
|
18
|
-
|
|
19
|
-
validate(prefix: string): IActivityError[] {
|
|
20
|
-
const retVal: IActivityError[] = [];
|
|
21
|
-
if (!this.fieldID_valid()) {
|
|
22
|
-
retVal.push({
|
|
23
|
-
source: `${prefix}.fieldID`,
|
|
24
|
-
msg: `Invalid fieldID: ${this.fieldID()}`,
|
|
25
|
-
hint: `expected ${JSON.stringify(this.fieldIDs())}`
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return retVal;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
constructor() {
|
|
32
|
-
super();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
owner(): Sort;
|
|
36
|
-
owner(_: Sort): this;
|
|
37
|
-
owner(_?: Sort): Sort | this {
|
|
38
|
-
if (!arguments.length) return this._owner;
|
|
39
|
-
this._owner = _;
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
valid(): boolean {
|
|
44
|
-
return !!this.fieldID();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
toDDL(): DDL2.ISortCondition {
|
|
48
|
-
return {
|
|
49
|
-
fieldID: this.fieldID(),
|
|
50
|
-
descending: this.descending()
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
fromDDL(ddl: DDL2.ISortCondition): this {
|
|
55
|
-
return this
|
|
56
|
-
.fieldID(ddl.fieldID)
|
|
57
|
-
.descending(ddl.descending)
|
|
58
|
-
;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
static fromDDL(ddl: DDL2.ISortCondition): SortColumn {
|
|
62
|
-
return new SortColumn().fromDDL(ddl);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
hash(): string {
|
|
66
|
-
return hashSum({
|
|
67
|
-
sortColumn: this.fieldID(),
|
|
68
|
-
descending: this.descending()
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
fieldIDs() {
|
|
73
|
-
return this._owner.fieldIDs();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
field(id: string): DDL2.IField | undefined {
|
|
77
|
-
return this._owner.inFields().filter(field =>
|
|
78
|
-
field.id === id
|
|
79
|
-
)[0];
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
SortColumn.prototype._class += " SortColumn";
|
|
83
|
-
|
|
84
|
-
// ===========================================================================
|
|
85
|
-
export class Sort extends Activity {
|
|
86
|
-
static Column = SortColumn;
|
|
87
|
-
|
|
88
|
-
@publish([], "propertyArray", "Source Columns", null, { autoExpand: SortColumn })
|
|
89
|
-
column: publish<this, SortColumn[]>;
|
|
90
|
-
|
|
91
|
-
validate(): IActivityError[] {
|
|
92
|
-
let retVal: IActivityError[] = [];
|
|
93
|
-
for (const sb of this.validSortBy()) {
|
|
94
|
-
retVal = retVal.concat(sb.validate("Sort.column"));
|
|
95
|
-
}
|
|
96
|
-
return retVal;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
constructor() {
|
|
100
|
-
super();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
toDDL(): DDL2.ISort {
|
|
104
|
-
return {
|
|
105
|
-
type: "sort",
|
|
106
|
-
conditions: this.conditions()
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
fromDDL(ddl: DDL2.ISort): this {
|
|
111
|
-
this.conditions(ddl.conditions);
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
static fromDDL(ddl: DDL2.ISort) {
|
|
116
|
-
return new Sort().fromDDL(ddl);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
conditions(): DDL2.ISortCondition[];
|
|
120
|
-
conditions(_: DDL2.ISortCondition[]): this;
|
|
121
|
-
conditions(_?: DDL2.ISortCondition[]): DDL2.ISortCondition[] | this {
|
|
122
|
-
if (!arguments.length) return this.validSortBy().map(column => column.toDDL());
|
|
123
|
-
this.column(_.map(condition => SortColumn.fromDDL(condition)));
|
|
124
|
-
return this;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Activitiy ---
|
|
128
|
-
hash(): string {
|
|
129
|
-
return hashSum({
|
|
130
|
-
Sort: this.column().map(sb => sb.hash())
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
referencedFields(refs: ReferencedFields): void {
|
|
135
|
-
super.referencedFields(refs);
|
|
136
|
-
super.resolveInFields(refs, this.validSortBy().map(sortBy => sortBy.fieldID()));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
validSortBy(): SortColumn[] {
|
|
140
|
-
return this.column().filter(sortBy => sortBy.fieldID());
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
exists(): boolean {
|
|
144
|
-
return this.validSortBy().length > 0;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
fieldIDs(): string[] {
|
|
148
|
-
return this.inFields().map(field => field.id);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
computeData(): ReadonlyArray<object> {
|
|
152
|
-
const data = super.computeData();
|
|
153
|
-
const sortByArr: Array<{ compare: (l, r) => number, id: string }> = [];
|
|
154
|
-
for (const sortBy of this.validSortBy()) {
|
|
155
|
-
sortByArr.push({
|
|
156
|
-
compare: sortBy.descending() ? d3Descending : d3Ascending,
|
|
157
|
-
id: sortBy.fieldID()
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (sortByArr.length) {
|
|
162
|
-
return [...data].sort((l: any, r: any) => {
|
|
163
|
-
for (const item of sortByArr) {
|
|
164
|
-
const retVal2 = item.compare(l[item.id], r[item.id]);
|
|
165
|
-
if (retVal2 !== 0) {
|
|
166
|
-
return retVal2;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return 0;
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
return data;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
Sort.prototype._class += " Sort";
|
|
1
|
+
import { PropertyExt, publish } from "@hpcc-js/common";
|
|
2
|
+
import { DDL2 } from "@hpcc-js/ddl-shim";
|
|
3
|
+
import { hashSum } from "@hpcc-js/util";
|
|
4
|
+
import { ascending as d3Ascending, descending as d3Descending } from "d3-array";
|
|
5
|
+
import { Activity, IActivityError, ReferencedFields } from "./activity";
|
|
6
|
+
|
|
7
|
+
export class SortColumn extends PropertyExt {
|
|
8
|
+
private _owner: Sort;
|
|
9
|
+
|
|
10
|
+
@publish(null, "set", "Sort Field", function (this: SortColumn) { return this.fieldIDs(); }, {
|
|
11
|
+
optional: true,
|
|
12
|
+
validate: (w: SortColumn): boolean => w.fieldIDs().indexOf(w.fieldID()) >= 0
|
|
13
|
+
})
|
|
14
|
+
fieldID: publish<this, string>;
|
|
15
|
+
fieldID_valid: () => boolean;
|
|
16
|
+
@publish(false, "boolean", "Sort Field")
|
|
17
|
+
descending: publish<this, boolean>;
|
|
18
|
+
|
|
19
|
+
validate(prefix: string): IActivityError[] {
|
|
20
|
+
const retVal: IActivityError[] = [];
|
|
21
|
+
if (!this.fieldID_valid()) {
|
|
22
|
+
retVal.push({
|
|
23
|
+
source: `${prefix}.fieldID`,
|
|
24
|
+
msg: `Invalid fieldID: ${this.fieldID()}`,
|
|
25
|
+
hint: `expected ${JSON.stringify(this.fieldIDs())}`
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return retVal;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
owner(): Sort;
|
|
36
|
+
owner(_: Sort): this;
|
|
37
|
+
owner(_?: Sort): Sort | this {
|
|
38
|
+
if (!arguments.length) return this._owner;
|
|
39
|
+
this._owner = _;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
valid(): boolean {
|
|
44
|
+
return !!this.fieldID();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
toDDL(): DDL2.ISortCondition {
|
|
48
|
+
return {
|
|
49
|
+
fieldID: this.fieldID(),
|
|
50
|
+
descending: this.descending()
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fromDDL(ddl: DDL2.ISortCondition): this {
|
|
55
|
+
return this
|
|
56
|
+
.fieldID(ddl.fieldID)
|
|
57
|
+
.descending(ddl.descending)
|
|
58
|
+
;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static fromDDL(ddl: DDL2.ISortCondition): SortColumn {
|
|
62
|
+
return new SortColumn().fromDDL(ddl);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
hash(): string {
|
|
66
|
+
return hashSum({
|
|
67
|
+
sortColumn: this.fieldID(),
|
|
68
|
+
descending: this.descending()
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
fieldIDs() {
|
|
73
|
+
return this._owner.fieldIDs();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
field(id: string): DDL2.IField | undefined {
|
|
77
|
+
return this._owner.inFields().filter(field =>
|
|
78
|
+
field.id === id
|
|
79
|
+
)[0];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
SortColumn.prototype._class += " SortColumn";
|
|
83
|
+
|
|
84
|
+
// ===========================================================================
|
|
85
|
+
export class Sort extends Activity {
|
|
86
|
+
static Column = SortColumn;
|
|
87
|
+
|
|
88
|
+
@publish([], "propertyArray", "Source Columns", null, { autoExpand: SortColumn })
|
|
89
|
+
column: publish<this, SortColumn[]>;
|
|
90
|
+
|
|
91
|
+
validate(): IActivityError[] {
|
|
92
|
+
let retVal: IActivityError[] = [];
|
|
93
|
+
for (const sb of this.validSortBy()) {
|
|
94
|
+
retVal = retVal.concat(sb.validate("Sort.column"));
|
|
95
|
+
}
|
|
96
|
+
return retVal;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
constructor() {
|
|
100
|
+
super();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
toDDL(): DDL2.ISort {
|
|
104
|
+
return {
|
|
105
|
+
type: "sort",
|
|
106
|
+
conditions: this.conditions()
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
fromDDL(ddl: DDL2.ISort): this {
|
|
111
|
+
this.conditions(ddl.conditions);
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static fromDDL(ddl: DDL2.ISort) {
|
|
116
|
+
return new Sort().fromDDL(ddl);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
conditions(): DDL2.ISortCondition[];
|
|
120
|
+
conditions(_: DDL2.ISortCondition[]): this;
|
|
121
|
+
conditions(_?: DDL2.ISortCondition[]): DDL2.ISortCondition[] | this {
|
|
122
|
+
if (!arguments.length) return this.validSortBy().map(column => column.toDDL());
|
|
123
|
+
this.column(_.map(condition => SortColumn.fromDDL(condition)));
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Activitiy ---
|
|
128
|
+
hash(): string {
|
|
129
|
+
return hashSum({
|
|
130
|
+
Sort: this.column().map(sb => sb.hash())
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
referencedFields(refs: ReferencedFields): void {
|
|
135
|
+
super.referencedFields(refs);
|
|
136
|
+
super.resolveInFields(refs, this.validSortBy().map(sortBy => sortBy.fieldID()));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
validSortBy(): SortColumn[] {
|
|
140
|
+
return this.column().filter(sortBy => sortBy.fieldID());
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
exists(): boolean {
|
|
144
|
+
return this.validSortBy().length > 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
fieldIDs(): string[] {
|
|
148
|
+
return this.inFields().map(field => field.id);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
computeData(): ReadonlyArray<object> {
|
|
152
|
+
const data = super.computeData();
|
|
153
|
+
const sortByArr: Array<{ compare: (l, r) => number, id: string }> = [];
|
|
154
|
+
for (const sortBy of this.validSortBy()) {
|
|
155
|
+
sortByArr.push({
|
|
156
|
+
compare: sortBy.descending() ? d3Descending : d3Ascending,
|
|
157
|
+
id: sortBy.fieldID()
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (sortByArr.length) {
|
|
162
|
+
return [...data].sort((l: any, r: any) => {
|
|
163
|
+
for (const item of sortByArr) {
|
|
164
|
+
const retVal2 = item.compare(l[item.id], r[item.id]);
|
|
165
|
+
if (retVal2 !== 0) {
|
|
166
|
+
return retVal2;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return 0;
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
return data;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
Sort.prototype._class += " Sort";
|