@hpcc-js/marshaller 2.28.11 → 3.1.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.
Files changed (172) hide show
  1. package/dist/index.js +2 -18051
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.umd.cjs +3 -0
  4. package/dist/index.umd.cjs.map +1 -0
  5. package/package.json +46 -46
  6. package/src/__package__.ts +3 -3
  7. package/src/dashy.css +45 -34
  8. package/src/dashy.ts +20 -18
  9. package/src/ddl1/FlyoutButton.ts +3 -2
  10. package/src/ddl1/Graph.ts +8 -5
  11. package/src/ddl1/HTML.ts +1 -1
  12. package/src/ddl1/HipieDDL.ts +5 -1
  13. package/src/ddl1/HipieDDLMixin.ts +31 -20
  14. package/src/ddl1/Tabbed.ts +1 -1
  15. package/src/ddl1/TargetMarshaller.ts +1 -1
  16. package/src/ddl2/PopupManager.ts +2 -2
  17. package/src/ddl2/activities/activity.ts +1 -1
  18. package/src/ddl2/activities/databomb.ts +3 -3
  19. package/src/ddl2/activities/datasource.ts +25 -18
  20. package/src/ddl2/activities/dspicker.ts +38 -29
  21. package/src/ddl2/activities/filter.ts +79 -56
  22. package/src/ddl2/activities/form.ts +29 -20
  23. package/src/ddl2/activities/groupby.ts +55 -37
  24. package/src/ddl2/activities/hipiepipeline.ts +61 -74
  25. package/src/ddl2/activities/limit.ts +8 -6
  26. package/src/ddl2/activities/logicalfile.ts +14 -10
  27. package/src/ddl2/activities/nullview.ts +1 -1
  28. package/src/ddl2/activities/project.ts +78 -50
  29. package/src/ddl2/activities/rest.ts +95 -70
  30. package/src/ddl2/activities/roxie.ts +55 -41
  31. package/src/ddl2/activities/sort.ts +23 -14
  32. package/src/ddl2/activities/wuresult.ts +78 -54
  33. package/src/ddl2/dashboard.css +8 -8
  34. package/src/ddl2/dashboard.ts +17 -17
  35. package/src/ddl2/dashboardDockPanel.ts +3 -3
  36. package/src/ddl2/dashboardGrid.ts +4 -4
  37. package/src/ddl2/ddl.ts +19 -21
  38. package/src/ddl2/dsTable.ts +22 -18
  39. package/src/ddl2/dvTable.ts +1 -1
  40. package/src/ddl2/graphadapter.ts +11 -11
  41. package/src/ddl2/javascriptadapter.ts +4 -4
  42. package/src/ddl2/model/element.ts +56 -42
  43. package/src/ddl2/model/visualization.ts +92 -70
  44. package/src/ddl2/pipelinePanel.ts +26 -18
  45. package/src/index.ts +25 -25
  46. package/types/__package__.d.ts +3 -4
  47. package/types/dashy.d.ts +9 -7
  48. package/types/ddl2/PopupManager.d.ts +2 -3
  49. package/types/ddl2/activities/activity.d.ts +0 -1
  50. package/types/ddl2/activities/databomb.d.ts +3 -4
  51. package/types/ddl2/activities/datasource.d.ts +12 -10
  52. package/types/ddl2/activities/dspicker.d.ts +11 -8
  53. package/types/ddl2/activities/filter.d.ts +45 -26
  54. package/types/ddl2/activities/form.d.ts +19 -10
  55. package/types/ddl2/activities/groupby.d.ts +29 -15
  56. package/types/ddl2/activities/hipiepipeline.d.ts +27 -20
  57. package/types/ddl2/activities/limit.d.ts +6 -5
  58. package/types/ddl2/activities/logicalfile.d.ts +10 -7
  59. package/types/ddl2/activities/nullview.d.ts +1 -2
  60. package/types/ddl2/activities/project.d.ts +42 -21
  61. package/types/ddl2/activities/rest.d.ts +49 -30
  62. package/types/ddl2/activities/roxie.d.ts +28 -18
  63. package/types/ddl2/activities/sort.d.ts +13 -7
  64. package/types/ddl2/activities/wuresult.d.ts +24 -16
  65. package/types/ddl2/dashboard.d.ts +3 -4
  66. package/types/ddl2/dashboardDockPanel.d.ts +2 -3
  67. package/types/ddl2/dashboardGrid.d.ts +3 -4
  68. package/types/ddl2/ddl.d.ts +11 -12
  69. package/types/ddl2/ddleditor.d.ts +2 -2
  70. package/types/ddl2/dsTable.d.ts +2 -3
  71. package/types/ddl2/dvTable.d.ts +1 -2
  72. package/types/ddl2/graphadapter.d.ts +4 -5
  73. package/types/ddl2/javascriptadapter.d.ts +2 -3
  74. package/types/ddl2/model/element.d.ts +22 -14
  75. package/types/ddl2/model/visualization.d.ts +28 -20
  76. package/types/ddl2/model/vizChartPanel.d.ts +0 -1
  77. package/types/ddl2/pipelinePanel.d.ts +5 -3
  78. package/types/index.d.ts +25 -26
  79. package/dist/index.es6.js +0 -17994
  80. package/dist/index.es6.js.map +0 -1
  81. package/dist/index.min.js +0 -3
  82. package/dist/index.min.js.map +0 -1
  83. package/types/__package__.d.ts.map +0 -1
  84. package/types/dashy.d.ts.map +0 -1
  85. package/types/ddl1/DDLApi.d.ts +0 -179
  86. package/types/ddl1/DDLApi.d.ts.map +0 -1
  87. package/types/ddl1/FlyoutButton.d.ts +0 -24
  88. package/types/ddl1/FlyoutButton.d.ts.map +0 -1
  89. package/types/ddl1/Graph.d.ts +0 -22
  90. package/types/ddl1/Graph.d.ts.map +0 -1
  91. package/types/ddl1/HTML.d.ts +0 -12
  92. package/types/ddl1/HTML.d.ts.map +0 -1
  93. package/types/ddl1/HipieDDL.d.ts +0 -100
  94. package/types/ddl1/HipieDDL.d.ts.map +0 -1
  95. package/types/ddl1/HipieDDLMixin.d.ts +0 -77
  96. package/types/ddl1/HipieDDLMixin.d.ts.map +0 -1
  97. package/types/ddl1/Tabbed.d.ts +0 -12
  98. package/types/ddl1/Tabbed.d.ts.map +0 -1
  99. package/types/ddl1/TargetMarshaller.d.ts +0 -5
  100. package/types/ddl1/TargetMarshaller.d.ts.map +0 -1
  101. package/types/ddl2/PopupManager.d.ts.map +0 -1
  102. package/types/ddl2/activities/activity.d.ts.map +0 -1
  103. package/types/ddl2/activities/databomb.d.ts.map +0 -1
  104. package/types/ddl2/activities/datasource.d.ts.map +0 -1
  105. package/types/ddl2/activities/dspicker.d.ts.map +0 -1
  106. package/types/ddl2/activities/filter.d.ts.map +0 -1
  107. package/types/ddl2/activities/form.d.ts.map +0 -1
  108. package/types/ddl2/activities/groupby.d.ts.map +0 -1
  109. package/types/ddl2/activities/hipiepipeline.d.ts.map +0 -1
  110. package/types/ddl2/activities/limit.d.ts.map +0 -1
  111. package/types/ddl2/activities/logicalfile.d.ts.map +0 -1
  112. package/types/ddl2/activities/nullview.d.ts.map +0 -1
  113. package/types/ddl2/activities/project.d.ts.map +0 -1
  114. package/types/ddl2/activities/rest.d.ts.map +0 -1
  115. package/types/ddl2/activities/roxie.d.ts.map +0 -1
  116. package/types/ddl2/activities/sort.d.ts.map +0 -1
  117. package/types/ddl2/activities/wuresult.d.ts.map +0 -1
  118. package/types/ddl2/dashboard.d.ts.map +0 -1
  119. package/types/ddl2/dashboardDockPanel.d.ts.map +0 -1
  120. package/types/ddl2/dashboardGrid.d.ts.map +0 -1
  121. package/types/ddl2/ddl.d.ts.map +0 -1
  122. package/types/ddl2/ddleditor.d.ts.map +0 -1
  123. package/types/ddl2/dsTable.d.ts.map +0 -1
  124. package/types/ddl2/dvTable.d.ts.map +0 -1
  125. package/types/ddl2/graphadapter.d.ts.map +0 -1
  126. package/types/ddl2/javascriptadapter.d.ts.map +0 -1
  127. package/types/ddl2/model/element.d.ts.map +0 -1
  128. package/types/ddl2/model/visualization.d.ts.map +0 -1
  129. package/types/ddl2/model/vizChartPanel.d.ts.map +0 -1
  130. package/types/ddl2/pipelinePanel.d.ts.map +0 -1
  131. package/types/index.d.ts.map +0 -1
  132. package/types-3.4/__package__.d.ts +0 -4
  133. package/types-3.4/dashy.d.ts +0 -54
  134. package/types-3.4/ddl1/DDLApi.d.ts +0 -179
  135. package/types-3.4/ddl1/FlyoutButton.d.ts +0 -24
  136. package/types-3.4/ddl1/Graph.d.ts +0 -22
  137. package/types-3.4/ddl1/HTML.d.ts +0 -12
  138. package/types-3.4/ddl1/HipieDDL.d.ts +0 -100
  139. package/types-3.4/ddl1/HipieDDLMixin.d.ts +0 -77
  140. package/types-3.4/ddl1/Tabbed.d.ts +0 -12
  141. package/types-3.4/ddl1/TargetMarshaller.d.ts +0 -5
  142. package/types-3.4/ddl2/PopupManager.d.ts +0 -20
  143. package/types-3.4/ddl2/activities/activity.d.ts +0 -106
  144. package/types-3.4/ddl2/activities/databomb.d.ts +0 -46
  145. package/types-3.4/ddl2/activities/datasource.d.ts +0 -24
  146. package/types-3.4/ddl2/activities/dspicker.d.ts +0 -29
  147. package/types-3.4/ddl2/activities/filter.d.ts +0 -113
  148. package/types-3.4/ddl2/activities/form.d.ts +0 -40
  149. package/types-3.4/ddl2/activities/groupby.d.ts +0 -85
  150. package/types-3.4/ddl2/activities/hipiepipeline.d.ts +0 -37
  151. package/types-3.4/ddl2/activities/limit.d.ts +0 -15
  152. package/types-3.4/ddl2/activities/logicalfile.d.ts +0 -19
  153. package/types-3.4/ddl2/activities/nullview.d.ts +0 -6
  154. package/types-3.4/ddl2/activities/project.d.ts +0 -122
  155. package/types-3.4/ddl2/activities/rest.d.ts +0 -142
  156. package/types-3.4/ddl2/activities/roxie.d.ts +0 -112
  157. package/types-3.4/ddl2/activities/sort.d.ts +0 -38
  158. package/types-3.4/ddl2/activities/wuresult.d.ts +0 -87
  159. package/types-3.4/ddl2/dashboard.d.ts +0 -53
  160. package/types-3.4/ddl2/dashboardDockPanel.d.ts +0 -19
  161. package/types-3.4/ddl2/dashboardGrid.d.ts +0 -29
  162. package/types-3.4/ddl2/ddl.d.ts +0 -44
  163. package/types-3.4/ddl2/ddleditor.d.ts +0 -14
  164. package/types-3.4/ddl2/dsTable.d.ts +0 -21
  165. package/types-3.4/ddl2/dvTable.d.ts +0 -10
  166. package/types-3.4/ddl2/graphadapter.d.ts +0 -30
  167. package/types-3.4/ddl2/javascriptadapter.d.ts +0 -31
  168. package/types-3.4/ddl2/model/element.d.ts +0 -99
  169. package/types-3.4/ddl2/model/visualization.d.ts +0 -48
  170. package/types-3.4/ddl2/model/vizChartPanel.d.ts +0 -44
  171. package/types-3.4/ddl2/pipelinePanel.d.ts +0 -16
  172. package/types-3.4/index.d.ts +0 -27
@@ -1,12 +1,11 @@
1
- import { publish } from "@hpcc-js/common";
2
1
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
- import { Activity } from "./activity";
4
- import { Databomb } from "./databomb";
5
- import { Form } from "./form";
6
- import { LogicalFile } from "./logicalfile";
7
- import { RestResult, RestService } from "./rest";
8
- import { RoxieResult, RoxieService } from "./roxie";
9
- import { WU, WUResult } from "./wuresult";
2
+ import { Activity } from "./activity.ts";
3
+ import { Databomb } from "./databomb.ts";
4
+ import { Form } from "./form.ts";
5
+ import { LogicalFile } from "./logicalfile.ts";
6
+ import { RestResult, RestService } from "./rest.ts";
7
+ import { RoxieResult, RoxieService } from "./roxie.ts";
8
+ import { WU, WUResult } from "./wuresult.ts";
10
9
 
11
10
  let datasourceID = 0;
12
11
  export class Datasource extends Activity {
@@ -21,16 +20,8 @@ export type DatasourceRefType = Databomb | Form | LogicalFile | RoxieResult | WU
21
20
  export type DatasourceType = Databomb | Form | LogicalFile | RoxieService | WU | RestService;
22
21
 
23
22
  export class DatasourceRef extends Activity {
24
- @publish(null, "widget", "Datasource Reference", null, { internal: true })
25
- _datasource: DatasourceRefType;
26
- datasource(): DatasourceRefType;
27
- datasource(_: DatasourceRefType): this;
28
- datasource(_?: DatasourceRefType): this | DatasourceRefType {
29
- if (!arguments.length) return this._datasource;
30
- this._datasource = _;
31
- this.sourceActivity(_);
32
- return this;
33
- }
23
+ _origDatasource;
24
+ declare _datasource: DatasourceRefType;
34
25
 
35
26
  constructor() {
36
27
  super();
@@ -50,3 +41,19 @@ export class DatasourceRef extends Activity {
50
41
  }
51
42
  }
52
43
  DatasourceRef.prototype._class += " DatasourceRef";
44
+
45
+ export interface DatasourceRef {
46
+ datasource(): DatasourceRefType;
47
+ datasource(_: DatasourceRefType): this;
48
+ }
49
+
50
+ DatasourceRef.prototype.publish("datasource", null, "widget", "Datasource Reference", null, { internal: true });
51
+
52
+ DatasourceRef.prototype._origDatasource = DatasourceRef.prototype.datasource;
53
+ DatasourceRef.prototype.datasource = function (this: DatasourceRef, _?) {
54
+ const retVal = DatasourceRef.prototype._origDatasource.apply(this, arguments);
55
+ if (_ !== undefined) {
56
+ this.sourceActivity(_);
57
+ }
58
+ return retVal;
59
+ };
@@ -1,39 +1,23 @@
1
- import { publish } from "@hpcc-js/common";
2
1
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
- import { ElementContainer } from "../model/element";
4
- import { ActivitySelection, IActivityError } from "./activity";
5
- import { Databomb, emptyDatabomb } from "./databomb";
6
- import { DatasourceRef, DatasourceRefType } from "./datasource";
7
- import { Form } from "./form";
8
- import { LogicalFile } from "./logicalfile";
9
- import { RestResult, RestResultRef } from "./rest";
10
- import { HipieResultRef, RoxieResult, RoxieService } from "./roxie";
11
- import { WUResult, WUResultRef } from "./wuresult";
2
+ import { ElementContainer } from "../model/element.ts";
3
+ import { ActivitySelection, IActivityError } from "./activity.ts";
4
+ import { Databomb, emptyDatabomb } from "./databomb.ts";
5
+ import { DatasourceRef, DatasourceRefType } from "./datasource.ts";
6
+ import { Form } from "./form.ts";
7
+ import { LogicalFile } from "./logicalfile.ts";
8
+ import { RestResult, RestResultRef } from "./rest.ts";
9
+ import { HipieResultRef, RoxieResult, RoxieService } from "./roxie.ts";
10
+ import { WUResult, WUResultRef } from "./wuresult.ts";
12
11
 
13
12
  let dsPickerID = 0;
14
13
  export class DSPicker extends ActivitySelection {
15
14
  private _nullDatasource = emptyDatabomb;
16
15
 
17
- @publish("", "set", "Activity", function (this: DSPicker) { return this.datasourceIDs(); }, { optional: false })
18
- _datasourceID: string; // DDL2.IDatasourceType;
19
- datasourceID(): string;
20
- datasourceID(_: string): this;
21
- datasourceID(_?: string): this | string {
22
- if (!arguments.length) return this._datasourceID;
23
- if (this._datasourceID !== _) {
24
- this._datasourceID = _;
25
- this.refreshRef(_);
26
- }
27
- return this;
28
- }
16
+ _origDatasourceID;
17
+ _origDatasourceRef;
29
18
 
30
- @publish("", "widget", "Activity")
31
- _datasourceRef: DatasourceRef;
32
- datasourceRef(): DatasourceRef;
33
- datasourceRef(_: DatasourceRef): this;
34
- datasourceRef(_?: DatasourceRef): this | DatasourceRef {
35
- return super.selection.apply(this, arguments);
36
- }
19
+ declare _datasourceID: string; // DDL2.IDatasourceType;
20
+ declare _datasourceRef: DatasourceRef;
37
21
 
38
22
  datasource(): DatasourceRefType {
39
23
  return this.datasourceRef().datasource();
@@ -104,3 +88,28 @@ export class DSPicker extends ActivitySelection {
104
88
  }
105
89
  }
106
90
  DSPicker.prototype._class += " DSPicker";
91
+
92
+ export interface DSPicker {
93
+ datasourceID(): string;
94
+ datasourceID(_: string): this;
95
+ datasourceRef(): DatasourceRef;
96
+ datasourceRef(_: DatasourceRef): this;
97
+ }
98
+
99
+ DSPicker.prototype.publish("datasourceID", "", "set", "Activity", function (this: DSPicker) { return this.datasourceIDs(); }, { optional: false });
100
+ DSPicker.prototype.publish("datasourceRef", "", "widget", "Activity");
101
+
102
+ DSPicker.prototype._origDatasourceID = DSPicker.prototype.datasourceID;
103
+ DSPicker.prototype.datasourceID = function (this: DSPicker, _?) {
104
+ const prev = this._datasourceID;
105
+ const retVal = DSPicker.prototype._origDatasourceID.apply(this, arguments);
106
+ if (_ !== undefined && prev !== _) {
107
+ this.refreshRef(_);
108
+ }
109
+ return retVal;
110
+ };
111
+
112
+ DSPicker.prototype._origDatasourceRef = DSPicker.prototype.datasourceRef;
113
+ DSPicker.prototype.datasourceRef = function (this: DSPicker, _?) {
114
+ return ActivitySelection.prototype.selection.apply(this, arguments);
115
+ };
@@ -1,8 +1,8 @@
1
- import { PropertyExt, publish } from "@hpcc-js/common";
1
+ import { PropertyExt } from "@hpcc-js/common";
2
2
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
3
  import { hashSum } from "@hpcc-js/util";
4
- import { Element, ElementContainer } from "../model/element";
5
- import { Activity, IActivityError, ReferencedFields } from "./activity";
4
+ import { Element, ElementContainer } from "../model/element.ts";
5
+ import { Activity, IActivityError, ReferencedFields } from "./activity.ts";
6
6
 
7
7
  function createFilter(condition: DDL2.IMappingConditionType, lf: string, val: string | number): (localRow: any) => boolean {
8
8
  const isString = typeof val === "string";
@@ -27,27 +27,6 @@ function createFilter(condition: DDL2.IMappingConditionType, lf: string, val: st
27
27
  export class ColumnMapping extends PropertyExt {
28
28
  private _owner: RemoteFilter;
29
29
 
30
- @publish(null, "set", "Filter Fields", function (this: ColumnMapping) { return this.sourceOutFields(); }, {
31
- optional: true,
32
- disable: (w: ColumnMapping): boolean => !w._owner.source(),
33
- validate: (w: ColumnMapping): boolean => w.sourceOutFields().indexOf(w.remoteField()) >= 0
34
- })
35
- remoteField: publish<this, string>;
36
- remoteField_exists: () => boolean;
37
- remoteField_valid: () => boolean;
38
- @publish(null, "set", "Local Fields", function (this: ColumnMapping) { return this.localFields(); }, {
39
- optional: true,
40
- disable: (w: ColumnMapping): boolean => !w._owner.source(),
41
- validate: (w: ColumnMapping): boolean => w.localFields().indexOf(w.localField()) >= 0
42
- })
43
- localField: publish<this, string>;
44
- localField_exists: () => boolean;
45
- localField_valid: () => boolean;
46
- @publish("==", "set", "Filter Fields", ["==", "!=", ">", ">=", "<", "<=", "range", "in"])
47
- condition: publish<this, DDL2.IMappingConditionType>;
48
- @publish(false, "boolean", "Ignore null filters")
49
- nullable: publish<this, boolean>;
50
-
51
30
  validate(prefix: string): IActivityError[] {
52
31
  const retVal: IActivityError[] = [];
53
32
  if (!this.remoteField_valid()) {
@@ -168,19 +147,24 @@ export class ColumnMapping extends PropertyExt {
168
147
  }
169
148
  ColumnMapping.prototype._class += " ColumnMapping";
170
149
 
150
+ export interface ColumnMapping {
151
+ remoteField(): string;
152
+ remoteField(_: string): this;
153
+ remoteField_exists(): boolean;
154
+ remoteField_valid(): boolean;
155
+ localField(): string;
156
+ localField(_: string): this;
157
+ localField_exists(): boolean;
158
+ localField_valid(): boolean;
159
+ condition(): DDL2.IMappingConditionType;
160
+ condition(_: DDL2.IMappingConditionType): this;
161
+ nullable(): boolean;
162
+ nullable(_: boolean): this;
163
+ }
164
+
171
165
  export class RemoteFilter extends PropertyExt {
172
166
  private _owner: Filters;
173
167
 
174
- @publish(null, "set", "Activity", function (this: RemoteFilter) { return this.visualizationIDs(); }, {
175
- optional: true,
176
- validate: (w: RemoteFilter): boolean => w.visualizationIDs().indexOf(w.source()) >= 0
177
- })
178
- source: publish<this, string>;
179
- source_exists: () => boolean;
180
- source_valid: () => boolean;
181
- @publish([], "propertyArray", "Mappings", null, { autoExpand: ColumnMapping })
182
- mappings: publish<this, ColumnMapping[]>;
183
-
184
168
  validate(prefix: string): IActivityError[] {
185
169
  let retVal: IActivityError[] = [];
186
170
  if (!this.source_valid()) {
@@ -303,25 +287,18 @@ export class RemoteFilter extends PropertyExt {
303
287
  }
304
288
  RemoteFilter.prototype._class += " Filter";
305
289
 
290
+ export interface RemoteFilter {
291
+ source(): string;
292
+ source(_: string): this;
293
+ source_exists(): boolean;
294
+ source_valid(): boolean;
295
+ mappings(): ColumnMapping[];
296
+ mappings(_: ColumnMapping[]): this;
297
+ }
298
+
306
299
  export class StaticFilter extends PropertyExt {
307
300
  private _owner: Filters;
308
301
 
309
- @publish(null, "set", "Local Fields", function (this: ColumnMapping) { return this.localFields(); }, {
310
- optional: true,
311
- validate: (w: StaticFilter): boolean => w.localFields().indexOf(w.localField()) >= 0
312
- })
313
- localField: publish<this, string>;
314
- localField_exists: () => boolean;
315
- localField_valid: () => boolean;
316
- @publish("==", "set", "Filter Fields", ["==", "!=", ">", ">=", "<", "<="])
317
- condition: publish<this, DDL2.IMappingConditionType>;
318
- @publish("", "any", "Static Value")
319
- value: publish<this, string | number | boolean>;
320
- value_exists: () => boolean;
321
- value_valid: () => boolean;
322
- @publish("number", "set", "Static Value Type", ["number", "string"])
323
- valueType: publish<this, "number" | "string">;
324
-
325
302
  validate(prefix: string): IActivityError[] {
326
303
  const retVal: IActivityError[] = [];
327
304
  if (!this.localField_valid()) {
@@ -414,18 +391,27 @@ export class StaticFilter extends PropertyExt {
414
391
  }
415
392
  StaticFilter.prototype._class += " StaticFilter";
416
393
 
394
+ export interface StaticFilter {
395
+ localField(): string;
396
+ localField(_: string): this;
397
+ localField_exists(): boolean;
398
+ localField_valid(): boolean;
399
+ condition(): DDL2.IMappingConditionType;
400
+ condition(_: DDL2.IMappingConditionType): this;
401
+ value(): string | number | boolean;
402
+ value(_: string | number | boolean): this;
403
+ value_exists(): boolean;
404
+ value_valid(): boolean;
405
+ valueType(): "number" | "string";
406
+ valueType(_: "number" | "string"): this;
407
+ }
408
+
417
409
  type FilterT = RemoteFilter | StaticFilter;
418
410
 
419
411
  export class Filters extends Activity {
420
412
  static Filter = RemoteFilter;
421
413
  static Mapping = ColumnMapping;
422
414
 
423
- @publish([], "propertyArray", "Remote Filter", null, { autoExpand: RemoteFilter })
424
- remoteFilter: publish<this, RemoteFilter[]>;
425
-
426
- @publish([], "propertyArray", "Static Filter", null, { autoExpand: StaticFilter })
427
- staticFilter: publish<this, StaticFilter[]>;
428
-
429
415
  validate(): IActivityError[] {
430
416
  let retVal: IActivityError[] = [];
431
417
  for (const filter of this.validFilters()) {
@@ -540,3 +526,40 @@ export class Filters extends Activity {
540
526
  }
541
527
  }
542
528
  Filters.prototype._class += " Filters";
529
+
530
+ export interface Filters {
531
+ remoteFilter(): RemoteFilter[];
532
+ remoteFilter(_: RemoteFilter[]): this;
533
+ staticFilter(): StaticFilter[];
534
+ staticFilter(_: StaticFilter[]): this;
535
+ }
536
+
537
+ ColumnMapping.prototype.publish("remoteField", null, "set", "Filter Fields", function (this: ColumnMapping) { return this.sourceOutFields(); }, {
538
+ optional: true,
539
+ disable: (w: ColumnMapping): boolean => !w["_owner"].source(),
540
+ validate: (w: ColumnMapping): boolean => w.sourceOutFields().indexOf(w.remoteField()) >= 0
541
+ });
542
+ ColumnMapping.prototype.publish("localField", null, "set", "Local Fields", function (this: ColumnMapping) { return this.localFields(); }, {
543
+ optional: true,
544
+ disable: (w: ColumnMapping): boolean => !w["_owner"].source(),
545
+ validate: (w: ColumnMapping): boolean => w.localFields().indexOf(w.localField()) >= 0
546
+ });
547
+ ColumnMapping.prototype.publish("condition", "==", "set", "Filter Fields", ["==", "!=", ">", ">=", "<", "<=", "range", "in"]);
548
+ ColumnMapping.prototype.publish("nullable", false, "boolean", "Ignore null filters");
549
+
550
+ RemoteFilter.prototype.publish("source", null, "set", "Activity", function (this: RemoteFilter) { return this.visualizationIDs(); }, {
551
+ optional: true,
552
+ validate: (w: RemoteFilter): boolean => w.visualizationIDs().indexOf(w.source()) >= 0
553
+ });
554
+ RemoteFilter.prototype.publish("mappings", [], "propertyArray", "Mappings", null, { autoExpand: ColumnMapping });
555
+
556
+ StaticFilter.prototype.publish("localField", null, "set", "Local Fields", function (this: ColumnMapping) { return this.localFields(); }, {
557
+ optional: true,
558
+ validate: (w: StaticFilter): boolean => w.localFields().indexOf(w.localField()) >= 0
559
+ });
560
+ StaticFilter.prototype.publish("condition", "==", "set", "Filter Fields", ["==", "!=", ">", ">=", "<", "<="]);
561
+ StaticFilter.prototype.publish("value", "", "any", "Static Value");
562
+ StaticFilter.prototype.publish("valueType", "number", "set", "Static Value Type", ["number", "string"]);
563
+
564
+ Filters.prototype.publish("remoteFilter", [], "propertyArray", "Remote Filter", null, { autoExpand: RemoteFilter });
565
+ Filters.prototype.publish("staticFilter", [], "propertyArray", "Static Filter", null, { autoExpand: StaticFilter });
@@ -1,28 +1,12 @@
1
- import { PropertyExt, publish } from "@hpcc-js/common";
1
+ import { PropertyExt } from "@hpcc-js/common";
2
2
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
- import { Datasource } from "./datasource";
3
+ import { Datasource } from "./datasource.ts";
4
4
 
5
5
  type IField = DDL2.IFieldBoolean | DDL2.IFieldNumber | DDL2.IFieldString | DDL2.IFieldDataset;
6
6
 
7
7
  export class FormField extends PropertyExt {
8
8
  protected _owner: Form;
9
9
 
10
- @publish("", "string", "FormField Label")
11
- fieldID: publish<this, string>;
12
-
13
- @publish("string", "set", "FormField Type", ["boolean", "number", "string", "dataset"])
14
- type: publish<this, "boolean" | "number" | "string" | "dataset">;
15
-
16
- @publish(null, "any", "Default Value", null, { optional: true })
17
- default: publish<this, boolean | number | string | any[]>;
18
-
19
- @publish(null, "any", "Default Value", null, { optional: true })
20
- value: publish<this, boolean | number | string>;
21
- value_exists: () => boolean;
22
-
23
- @publish([], "propertyArray", "Child Fields", null, { autoExpand: FormField, disable: (w: FormField) => w.disableChildField() })
24
- childFields: publish<this, FormField[]>;
25
-
26
10
  disableChildField(): boolean {
27
11
  return this.type() !== "dataset";
28
12
  }
@@ -83,8 +67,6 @@ export class FormField extends PropertyExt {
83
67
  }
84
68
 
85
69
  export class Form extends Datasource {
86
- @publish([], "propertyArray", "Multi Fields", null, { autoExpand: FormField })
87
- formFields: publish<this, FormField[]>;
88
70
 
89
71
  constructor() {
90
72
  super();
@@ -151,3 +133,30 @@ export class Form extends Datasource {
151
133
  }
152
134
  }
153
135
  Form.prototype._class += " Form";
136
+
137
+ export interface FormField {
138
+ type(): "boolean" | "number" | "string" | "dataset";
139
+ type(_: "boolean" | "number" | "string" | "dataset"): this;
140
+ fieldID(): string;
141
+ fieldID(_: string): this;
142
+ default(): boolean | number | string | any[];
143
+ default(_: boolean | number | string | any[]): this;
144
+ value(): boolean | number | string;
145
+ value(_: boolean | number | string): this;
146
+ value_exists(): boolean;
147
+ childFields(): FormField[];
148
+ childFields(_: FormField[]): this;
149
+ }
150
+
151
+ export interface Form {
152
+ formFields(): FormField[];
153
+ formFields(_: FormField[]): this;
154
+ }
155
+
156
+ FormField.prototype.publish("type", "string", "set", "FormField Type", ["boolean", "number", "string", "dataset"]);
157
+ FormField.prototype.publish("fieldID", "", "string", "FormField Label");
158
+ FormField.prototype.publish("default", null, "any", "Default Value", null, { optional: true });
159
+ FormField.prototype.publish("value", null, "any", "Default Value", null, { optional: true });
160
+ FormField.prototype.publish("childFields", [], "propertyArray", "Child Fields", null, { autoExpand: FormField, disable: (w: FormField) => w.disableChildField() });
161
+
162
+ Form.prototype.publish("formFields", [], "propertyArray", "Multi Fields", null, { autoExpand: FormField });
@@ -1,20 +1,13 @@
1
- import { PropertyExt, publish } from "@hpcc-js/common";
1
+ import { PropertyExt } from "@hpcc-js/common";
2
2
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
3
  import { hashSum } from "@hpcc-js/util";
4
4
  import { deviation as d3Deviation, max as d3Max, mean as d3Mean, median as d3Median, min as d3Min, sum as d3Sum, variance as d3Variance } from "d3-array";
5
5
  import { nest as d3Nest } from "d3-collection";
6
- import { Activity, IActivityError, ReferencedFields } from "./activity";
6
+ import { Activity, IActivityError, ReferencedFields } from "./activity.ts";
7
7
 
8
8
  export class GroupByColumn extends PropertyExt {
9
9
  private _owner: GroupBy;
10
10
 
11
- @publish(undefined, "set", "Field", function (this: GroupByColumn) { return this.columns(); }, {
12
- optional: true,
13
- validate: (w: GroupByColumn): boolean => w.columns().indexOf(w.label()) >= 0
14
- })
15
- label: publish<this, string>;
16
- label_valid: () => boolean;
17
-
18
11
  validate(prefix: string): IActivityError[] {
19
12
  const retVal: IActivityError[] = [];
20
13
  if (!this.label_valid()) {
@@ -67,6 +60,12 @@ export class GroupByColumn extends PropertyExt {
67
60
  }
68
61
  GroupByColumn.prototype._class += " GroupByColumn";
69
62
 
63
+ export interface GroupByColumn {
64
+ label(): string;
65
+ label(_: string): this;
66
+ label_valid(): boolean;
67
+ }
68
+
70
69
  // ===========================================================================
71
70
  export type AggrFuncCallback = (item: any) => number;
72
71
  export type AggrFunc = (leaves: any[], callback: AggrFuncCallback) => number;
@@ -89,25 +88,6 @@ export type AggregateType = "count" | "min" | "max" | "sum" | "mean" | "median"
89
88
  export class AggregateField extends PropertyExt {
90
89
  private _owner: GroupBy;
91
90
 
92
- @publish(null, "string", "new Field ID", null, { optional: true, disable: (w: AggregateField) => !w.hasColumn() })
93
- fieldID: publish<this, string>;
94
- @publish("count", "set", "Aggregation Type", ["count", "min", "max", "sum", "mean", "median", "variance", "deviation"], { optional: true, disable: (w: AggregateField) => !w.fieldID() })
95
- aggrType: publish<this, AggregateType>;
96
- @publish(null, "set", "Aggregation Field", function (this: AggregateField) { return this.columns(); }, {
97
- optional: true,
98
- disable: (w: AggregateField) => w.disableAggrColumn(),
99
- validate: (w: AggregateField): boolean => w.columns().indexOf(w.aggrColumn()) >= 0
100
- })
101
- aggrColumn: publish<this, string>;
102
- aggrColumn_valid: () => boolean;
103
- @publish(null, "set", "Base Count Field", function (this: AggregateField) { return this.columns(); }, {
104
- optional: true,
105
- disable: (w: AggregateField) => w.disableBaseCountColumn(),
106
- validate: (w: AggregateField): boolean => w.columns().indexOf(w.baseCountColumn()) >= 0
107
- })
108
- baseCountColumn: publish<this, string>;
109
- baseCountColumn_valid: () => boolean;
110
-
111
91
  disableAggrColumn(): boolean {
112
92
  return !this.fieldID() || !this.aggrType() || this.aggrType() === "count";
113
93
  }
@@ -219,18 +199,22 @@ export class AggregateField extends PropertyExt {
219
199
  }
220
200
  AggregateField.prototype._class += " AggregateField";
221
201
 
202
+ export interface AggregateField {
203
+ fieldID(): string;
204
+ fieldID(_: string): this;
205
+ aggrType(): AggregateType;
206
+ aggrType(_: AggregateType): this;
207
+ aggrColumn(): string;
208
+ aggrColumn(_: string): this;
209
+ aggrColumn_valid(): boolean;
210
+ baseCountColumn(): string;
211
+ baseCountColumn(_: string): this;
212
+ baseCountColumn_valid(): boolean;
213
+ }
214
+
222
215
  // ===========================================================================
223
216
  export class GroupBy extends Activity {
224
217
 
225
- @publish([], "propertyArray", "Source Columns", null, { autoExpand: GroupByColumn })
226
- column: publish<this, GroupByColumn[]>;
227
- @publish([], "propertyArray", "Computed Fields", null, { autoExpand: AggregateField })
228
- computedFields: publish<this, AggregateField[]>;
229
- @publish(false, "boolean", "Show details")
230
- details: publish<this, boolean>;
231
- @publish(false, "boolean", "Show groupBy fileds in details")
232
- fullDetails: publish<this, boolean>;
233
-
234
218
  validate(): IActivityError[] {
235
219
  let retVal: IActivityError[] = [];
236
220
  for (const gbColumn of this.validGroupBy()) {
@@ -437,3 +421,37 @@ export class GroupBy extends Activity {
437
421
  }
438
422
  }
439
423
  GroupBy.prototype._class += " GroupBy";
424
+
425
+ export interface GroupBy {
426
+ column(): GroupByColumn[];
427
+ column(_: GroupByColumn[]): this;
428
+ computedFields(): AggregateField[];
429
+ computedFields(_: AggregateField[]): this;
430
+ details(): boolean;
431
+ details(_: boolean): this;
432
+ fullDetails(): boolean;
433
+ fullDetails(_: boolean): this;
434
+ }
435
+
436
+ GroupByColumn.prototype.publish("label", undefined, "set", "Field", function (this: GroupByColumn) { return this.columns(); }, {
437
+ optional: true,
438
+ validate: (w: GroupByColumn): boolean => w.columns().indexOf(w.label()) >= 0
439
+ });
440
+
441
+ AggregateField.prototype.publish("fieldID", null, "string", "new Field ID", null, { optional: true, disable: (w: AggregateField) => !w.hasColumn() });
442
+ AggregateField.prototype.publish("aggrType", "count", "set", "Aggregation Type", ["count", "min", "max", "sum", "mean", "median", "variance", "deviation"], { optional: true, disable: (w: AggregateField) => !w.fieldID() });
443
+ AggregateField.prototype.publish("aggrColumn", null, "set", "Aggregation Field", function (this: AggregateField) { return this.columns(); }, {
444
+ optional: true,
445
+ disable: (w: AggregateField) => w.disableAggrColumn(),
446
+ validate: (w: AggregateField): boolean => w.columns().indexOf(w.aggrColumn()) >= 0
447
+ });
448
+ AggregateField.prototype.publish("baseCountColumn", null, "set", "Base Count Field", function (this: AggregateField) { return this.columns(); }, {
449
+ optional: true,
450
+ disable: (w: AggregateField) => w.disableBaseCountColumn(),
451
+ validate: (w: AggregateField): boolean => w.columns().indexOf(w.baseCountColumn()) >= 0
452
+ });
453
+
454
+ GroupBy.prototype.publish("column", [], "propertyArray", "Source Columns", null, { autoExpand: GroupByColumn });
455
+ GroupBy.prototype.publish("computedFields", [], "propertyArray", "Computed Fields", null, { autoExpand: AggregateField });
456
+ GroupBy.prototype.publish("details", false, "boolean", "Show details");
457
+ GroupBy.prototype.publish("fullDetails", false, "boolean", "Show groupBy fileds in details");
@@ -1,82 +1,29 @@
1
- import { publish } from "@hpcc-js/common";
2
1
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
- import { ElementContainer } from "../model/element";
4
- import { Activity, ActivityPipeline } from "./activity";
5
- import { DatasourceRefType } from "./datasource";
6
- import { DSPicker } from "./dspicker";
7
- import { Filters } from "./filter";
8
- import { GroupBy } from "./groupby";
9
- import { Limit } from "./limit";
10
- import { Project } from "./project";
11
- import { Sort } from "./sort";
2
+ import { ElementContainer } from "../model/element.ts";
3
+ import { Activity, ActivityPipeline } from "./activity.ts";
4
+ import { DatasourceRefType } from "./datasource.ts";
5
+ import { DSPicker } from "./dspicker.ts";
6
+ import { Filters } from "./filter.ts";
7
+ import { GroupBy } from "./groupby.ts";
8
+ import { Limit } from "./limit.ts";
9
+ import { Project } from "./project.ts";
10
+ import { Sort } from "./sort.ts";
12
11
 
13
12
  export class HipiePipeline extends ActivityPipeline {
14
13
 
15
- @publish(null, "widget", "Data Source 2")
16
- _datasource: DSPicker | DatasourceRefType;
17
- datasource(): DSPicker | DatasourceRefType;
18
- datasource(_: DSPicker | DatasourceRefType): this;
19
- datasource(_?: DSPicker | DatasourceRefType): DSPicker | DatasourceRefType | this {
20
- if (!arguments.length) return this._datasource;
21
- this._datasource = _;
22
- this.updateSequence();
23
- return this;
24
- }
25
-
26
- @publish(null, "widget", "Client Filters")
27
- _filters: Filters;
28
- filters(): Filters;
29
- filters(_: Filters): this;
30
- filters(_?: Filters): Filters | this {
31
- if (!arguments.length) return this._filters;
32
- this._filters = _;
33
- this.updateSequence();
34
- return this;
35
- }
36
-
37
- @publish(null, "widget", "Project")
38
- _project: Project;
39
- project(): Project;
40
- project(_: Project): this;
41
- project(_?: Project): Project | this {
42
- if (!arguments.length) return this._project;
43
- this._project = _;
44
- this.updateSequence();
45
- return this;
46
- }
47
-
48
- @publish(null, "widget", "Group By")
49
- _groupBy: GroupBy;
50
- groupBy(): GroupBy;
51
- groupBy(_: GroupBy): this;
52
- groupBy(_?: GroupBy): GroupBy | this {
53
- if (!arguments.length) return this._groupBy;
54
- this._groupBy = _;
55
- this.updateSequence();
56
- return this;
57
- }
58
-
59
- @publish(null, "widget", "Sort")
60
- _sort: Sort;
61
- sort(): Sort;
62
- sort(_: Sort): this;
63
- sort(_?: Sort): Sort | this {
64
- if (!arguments.length) return this._sort;
65
- this._sort = _;
66
- this.updateSequence();
67
- return this;
68
- }
14
+ _origDatasource;
15
+ _origFilters;
16
+ _origProject;
17
+ _origGroupBy;
18
+ _origSort;
19
+ _origLimit;
69
20
 
70
- @publish(null, "widget", "Limit output")
71
- _limit: Limit;
72
- limit(): Limit;
73
- limit(_: Limit): this;
74
- limit(_?: Limit): Limit | this {
75
- if (!arguments.length) return this._limit;
76
- this._limit = _;
77
- this.updateSequence();
78
- return this;
79
- }
21
+ declare _datasource: DSPicker | DatasourceRefType;
22
+ declare _filters: Filters;
23
+ declare _project: Project;
24
+ declare _groupBy: GroupBy;
25
+ declare _sort: Sort;
26
+ declare _limit: Limit;
80
27
 
81
28
  constructor(private _ec: ElementContainer, viewID: string) {
82
29
  super();
@@ -112,3 +59,43 @@ export class HipiePipeline extends ActivityPipeline {
112
59
  return this.last().outFields();
113
60
  }
114
61
  }
62
+
63
+ export interface HipiePipeline {
64
+ datasource(): DSPicker | DatasourceRefType;
65
+ datasource(_: DSPicker | DatasourceRefType): this;
66
+ filters(): Filters;
67
+ filters(_: Filters): this;
68
+ project(): Project;
69
+ project(_: Project): this;
70
+ groupBy(): GroupBy;
71
+ groupBy(_: GroupBy): this;
72
+ sort(): Sort;
73
+ sort(_: Sort): this;
74
+ limit(): Limit;
75
+ limit(_: Limit): this;
76
+ }
77
+
78
+ HipiePipeline.prototype.publish("datasource", null, "widget", "Data Source 2");
79
+ HipiePipeline.prototype.publish("filters", null, "widget", "Client Filters");
80
+ HipiePipeline.prototype.publish("project", null, "widget", "Project");
81
+ HipiePipeline.prototype.publish("groupBy", null, "widget", "Group By");
82
+ HipiePipeline.prototype.publish("sort", null, "widget", "Sort");
83
+ HipiePipeline.prototype.publish("limit", null, "widget", "Limit output");
84
+
85
+ function wrapHipiePipelineProperty(prop: string) {
86
+ const origKey = `_orig${prop.charAt(0).toUpperCase() + prop.slice(1)}`;
87
+ HipiePipeline.prototype[origKey] = HipiePipeline.prototype[prop];
88
+ HipiePipeline.prototype[prop] = function (_?) {
89
+ const retVal = HipiePipeline.prototype[origKey].apply(this, arguments);
90
+ if (_ !== undefined) {
91
+ this.updateSequence();
92
+ }
93
+ return retVal;
94
+ };
95
+ }
96
+ wrapHipiePipelineProperty("datasource");
97
+ wrapHipiePipelineProperty("filters");
98
+ wrapHipiePipelineProperty("project");
99
+ wrapHipiePipelineProperty("groupBy");
100
+ wrapHipiePipelineProperty("sort");
101
+ wrapHipiePipelineProperty("limit");