@hpcc-js/api 2.8.60 → 2.10.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/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common'], factory) :
4
- (global = global || self, factory(global['@hpcc-js/api'] = {}, global['@hpcc-js/common']));
5
- }(this, (function (exports, common) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/api"] = {}, global["@hpcc-js/common"]));
5
+ })(this, (function (exports, common) { 'use strict';
6
6
 
7
7
  var PKG_NAME = "@hpcc-js/api";
8
- var PKG_VERSION = "2.8.60";
9
- var BUILD_VERSION = "2.101.0";
8
+ var PKG_VERSION = "2.10.0";
9
+ var BUILD_VERSION = "2.103.0";
10
10
 
11
11
  function I1DChart() {
12
12
  }
@@ -14,10 +14,8 @@
14
14
  I1DChart.prototype._palette = common.Palette.rainbow("default");
15
15
  // Events ---
16
16
  I1DChart.prototype.click = function (row, column, selected) {
17
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
18
17
  };
19
18
  I1DChart.prototype.dblclick = function (row, column, selected) {
20
- console.log("Double click: " + JSON.stringify(row) + ", " + column + ", " + selected);
21
19
  };
22
20
 
23
21
  function I2DChart() {
@@ -35,10 +33,8 @@
35
33
  };
36
34
  // Events ---
37
35
  I2DChart.prototype.click = function (row, column, selected) {
38
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
39
36
  };
40
37
  I2DChart.prototype.dblclick = function (row, column, selected) {
41
- console.log("Double click: " + JSON.stringify(row) + ", " + column + ", " + selected);
42
38
  };
43
39
 
44
40
  function I2DAggrChart() {
@@ -55,10 +51,8 @@
55
51
  };
56
52
  // Events ---
57
53
  I2DAggrChart.prototype.click = function (row, column, selected) {
58
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
59
54
  };
60
55
  I2DAggrChart.prototype.dblclick = function (row, column, selected) {
61
- console.log("Double click: " + JSON.stringify(row) + ", " + column + ", " + selected);
62
56
  };
63
57
 
64
58
  function IGraph() {
@@ -66,124 +60,85 @@
66
60
  IGraph.prototype._dataFamily = "graph";
67
61
  // Events ---
68
62
  IGraph.prototype.vertex_click = function (_row, _col, _sel, more) {
69
- if (more && more.vertex) {
70
- console.log("Vertex click: " + more.vertex.id());
71
- }
63
+ if (more && more.vertex) ;
72
64
  };
73
65
  IGraph.prototype.vertex_dblclick = function (_row, _col, _sel, more) {
74
- if (more && more.vertex) {
75
- console.log("Vertex double click: " + more.vertex.id());
76
- }
66
+ if (more && more.vertex) ;
77
67
  };
78
68
  IGraph.prototype.edge_click = function (_row, _col, _sel, more) {
79
- if (more && more.edge) {
80
- console.log("Edge click: " + more.edge.id());
81
- }
69
+ if (more && more.edge) ;
82
70
  };
83
71
  IGraph.prototype.edge_dblclick = function (_row, _col, _sel, more) {
84
- if (more && more.edge) {
85
- console.log("Edge double click: " + more.edge.id());
86
- }
72
+ if (more && more.edge) ;
87
73
  };
88
74
 
89
75
  function instanceOfIHighlight(w) {
90
76
  return typeof w.highlightColumn === "function";
91
77
  }
92
78
 
93
- /*! *****************************************************************************
94
- Copyright (c) Microsoft Corporation.
95
-
96
- Permission to use, copy, modify, and/or distribute this software for any
97
- purpose with or without fee is hereby granted.
98
-
99
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
100
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
101
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
102
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
103
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
104
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
105
- PERFORMANCE OF THIS SOFTWARE.
106
- ***************************************************************************** */
107
- /* global Reflect, Promise */
108
-
109
- var extendStatics = function(d, b) {
110
- extendStatics = Object.setPrototypeOf ||
111
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
112
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
113
- return extendStatics(d, b);
114
- };
115
-
116
- function __extends(d, b) {
117
- if (typeof b !== "function" && b !== null)
118
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
119
- extendStatics(d, b);
120
- function __() { this.constructor = d; }
121
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
79
+ // Use old school class declaration as this is a mixin ---
80
+ function IInput() {
122
81
  }
123
-
124
- var IInput = /** @class */ (function (_super) {
125
- __extends(IInput, _super);
126
- function IInput() {
127
- return _super.call(this) || this;
128
- }
129
- // Implementation ---
130
- IInput.prototype.isValid = function () {
131
- if (this.validate()) {
132
- var re = new RegExp(this.validate());
133
- if (!re.test(this.value())) {
134
- return false;
135
- }
136
- }
137
- return true;
138
- };
139
- IInput.prototype.hasValue = function () {
140
- if (typeof this.type === "function") {
141
- switch (this.type()) {
142
- case "radio":
143
- /* falls through */
144
- case "checkbox":
145
- if (this.value() && this.value() !== "false") {
146
- return true;
147
- }
148
- break;
149
- default:
150
- if (this.value()) {
151
- return true;
152
- }
153
- break;
154
- }
82
+ IInput.prototype = Object.create(common.Widget.prototype);
83
+ IInput.prototype.constructor = IInput;
84
+ // abstract target(): any;
85
+ // abstract target(_: any): this;
86
+ // Implementation ---
87
+ IInput.prototype.isValid = function () {
88
+ if (this.validate()) {
89
+ var re = new RegExp(this.validate());
90
+ if (!re.test(this.value())) {
155
91
  return false;
156
92
  }
157
- return this.value() !== "";
158
- };
159
- // Events ---
160
- IInput.prototype.blur = function (_w) {
161
- };
162
- IInput.prototype.keyup = function (_w) {
163
- };
164
- IInput.prototype.focus = function (_w) {
165
- };
166
- IInput.prototype.click = function (_w) {
167
- };
168
- IInput.prototype.dblclick = function (_w) {
169
- };
170
- IInput.prototype.change = function (_w, complete) {
171
- };
172
- IInput.prototype.resetValue = function (w) {
173
- w.value(w._inputElement[0].node().value);
174
- };
175
- IInput.prototype.disable = function (disable) {
176
- this._inputElement.forEach(function (e, idx) {
177
- e.attr("disabled", disable ? "disabled" : null);
178
- });
179
- };
180
- IInput.prototype.setFocus = function () {
181
- if (this._inputElement.length) {
182
- this._inputElement[0].node().focus();
93
+ }
94
+ return true;
95
+ };
96
+ IInput.prototype.hasValue = function () {
97
+ if (typeof this.type === "function") {
98
+ switch (this.type()) {
99
+ case "radio":
100
+ /* falls through */
101
+ case "checkbox":
102
+ if (this.value() && this.value() !== "false") {
103
+ return true;
104
+ }
105
+ break;
106
+ default:
107
+ if (this.value()) {
108
+ return true;
109
+ }
110
+ break;
183
111
  }
184
- };
185
- return IInput;
186
- }(common.Widget));
112
+ return false;
113
+ }
114
+ return this.value() !== "";
115
+ };
116
+ // Events ---
117
+ IInput.prototype.blur = function (_w) {
118
+ };
119
+ IInput.prototype.keyup = function (_w) {
120
+ };
121
+ IInput.prototype.focus = function (_w) {
122
+ };
123
+ IInput.prototype.click = function (_w) {
124
+ };
125
+ IInput.prototype.dblclick = function (_w) {
126
+ };
127
+ IInput.prototype.change = function (_w, complete) {
128
+ };
129
+ IInput.prototype.resetValue = function (w) {
130
+ w.value(w._inputElement[0].node().value);
131
+ };
132
+ IInput.prototype.disable = function (disable) {
133
+ this._inputElement.forEach(function (e, idx) {
134
+ e.attr("disabled", disable ? "disabled" : null);
135
+ });
136
+ };
137
+ IInput.prototype.setFocus = function () {
138
+ if (this._inputElement.length) {
139
+ this._inputElement[0].node().focus();
140
+ }
141
+ };
187
142
  IInput.prototype.publish("name", "", "string", "HTML name for the input");
188
143
  IInput.prototype.publish("label", "", "string", "Descriptive label");
189
144
  IInput.prototype.publish("value", "", "string", "Input Current Value");
@@ -204,10 +159,8 @@
204
159
  };
205
160
  // Events ---
206
161
  INDChart.prototype.click = function (row, column, selected) {
207
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
208
162
  };
209
163
  INDChart.prototype.dblclick = function (row, column, selected) {
210
- console.log("Double click: " + JSON.stringify(row) + ", " + column + ", " + selected);
211
164
  };
212
165
 
213
166
  // Based on https://github.com/GordonSmith/d3-tip forked from https://github.com/Caged/d3-tip
@@ -593,155 +546,154 @@
593
546
  }
594
547
  }
595
548
 
596
- var css_248z = ".d3-tip{line-height:1;font-weight:700;padding:12px;background:rgba(0,0,0,.66);color:#fff;border-radius:2px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:\" \";box-sizing:border-box;display:inline-block;border:4px solid rgba(0,0,0,.66);position:absolute;pointer-events:none!important;width:8px;height:8px;margin:0}.d3-tip.n:after{top:100%;left:calc(50% - 4px);border-top-width:8px;border-right-color:transparent}.d3-tip.e:after,.d3-tip.n:after{border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{top:calc(50% - 4px);left:-12px;border-top-color:transparent;border-right-width:8px}.d3-tip.s{margin-top:8px}.d3-tip.s:after{top:-12px;left:calc(50% - 4px);border-bottom-width:8px;border-left-color:transparent}.d3-tip.s:after,.d3-tip.w:after{border-top-color:transparent;border-right-color:transparent}.d3-tip.w:after{top:calc(50% - 4px);left:100%;border-bottom-color:transparent;border-left-width:8px}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:rgba(0,0,0,.66);opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table td,.d3-tip .ITooltip-series-table th{padding:6px;text-align:left;border:1px solid #d1d1d1}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;width:10px;margin-right:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #a3a3a3}";
549
+ var css_248z = ".d3-tip{background:rgba(0,0,0,.66);border-radius:2px;color:#fff;font-weight:700;line-height:1;padding:12px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{border:4px solid rgba(0,0,0,.66);box-sizing:border-box;content:\" \";display:inline-block;height:8px;margin:0;pointer-events:none!important;position:absolute;width:8px}.d3-tip.n:after{border-right-color:transparent;border-top-width:8px;left:calc(50% - 4px);top:100%}.d3-tip.e:after,.d3-tip.n:after{border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{border-right-width:8px;border-top-color:transparent;left:-12px;top:calc(50% - 4px)}.d3-tip.s{margin-top:8px}.d3-tip.s:after{border-bottom-width:8px;border-left-color:transparent;left:calc(50% - 4px);top:-12px}.d3-tip.s:after,.d3-tip.w:after{border-right-color:transparent;border-top-color:transparent}.d3-tip.w:after{border-bottom-color:transparent;border-left-width:8px;left:100%;top:calc(50% - 4px)}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:rgba(0,0,0,.66);opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table td,.d3-tip .ITooltip-series-table th{border:1px solid #d1d1d1;padding:6px;text-align:left}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;margin-right:10px;width:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #a3a3a3}";
597
550
  styleInject(css_248z);
598
551
 
599
- var ITooltip = /** @class */ (function (_super) {
600
- __extends(ITooltip, _super);
601
- function ITooltip() {
602
- var _this = _super.call(this) || this;
603
- _this.tooltip = tip();
604
- _this._valueFormatter = common.format(_this.tooltipValueFormat());
605
- if (_this.layerEnter) {
606
- var layerEnter_1 = _this.layerEnter;
607
- _this.layerEnter = function (_base, svgElement, _domElement) {
608
- if (!this._parentOverlay) {
609
- this._parentOverlay = _base._parentOverlay;
610
- }
611
- this.tooltipEnter(svgElement);
612
- layerEnter_1.apply(this, arguments);
613
- };
614
- var layerUpdate_1 = _this.layerUpdate;
615
- _this.layerUpdate = function (_base) {
616
- layerUpdate_1.apply(this, arguments);
617
- this.tooltipUpdate();
618
- };
619
- var layerExit_1 = _this.layerExit;
620
- _this.layerExit = function (_base) {
621
- this.tooltipExit();
622
- layerExit_1.apply(this, arguments);
623
- };
624
- }
625
- else {
626
- var enter_1 = _this.enter;
627
- _this.enter = function (_domNode, element) {
628
- this.tooltipEnter(element);
629
- enter_1.apply(this, arguments);
630
- };
631
- var update_1 = _this.update;
632
- _this.update = function (_domNode, _element) {
633
- update_1.apply(this, arguments);
634
- this.tooltipUpdate();
635
- };
636
- var exit_1 = _this.exit;
637
- _this.exit = function (_domNode, _element) {
638
- this.tooltipExit();
639
- exit_1.apply(this, arguments);
640
- };
641
- }
642
- return _this;
643
- }
644
- ITooltip.prototype.tooltipEnter = function (element) {
645
- var overlayElement = this.parentOverlay();
646
- if (!overlayElement.empty()) {
647
- this.tooltip.rootElement(overlayElement.node().parentNode);
648
- }
649
- element.call(this.tooltip);
650
- };
651
- ITooltip.prototype.tooltipUpdate = function () {
652
- var _this = this;
653
- this.tooltip.offset(function () {
654
- if (event && _this.tooltipFollowMouse()) {
655
- var d3tipElement = document.querySelector(".d3-tip"); // d3Tip offers no reference to the '.d3-tip' element...?
656
- d3tipElement.style.display = "block";
657
- d3tipElement.style.left = _this.tooltipOffset() + (event.clientX) + "px";
658
- d3tipElement.style.top = event.clientY + "px";
659
- return [];
552
+ // Use old school class declaration as this is a mixin ---
553
+ function ITooltip() {
554
+ this.tooltip = tip();
555
+ this._valueFormatter = common.format(this.tooltipValueFormat());
556
+ if (this.layerEnter) {
557
+ var layerEnter_1 = this.layerEnter;
558
+ this.layerEnter = function (_base, svgElement, _domElement) {
559
+ if (!this._parentOverlay) {
560
+ this._parentOverlay = _base._parentOverlay;
660
561
  }
661
- switch (_this.tooltip.direction()()) {
662
- case "e":
663
- return [0, _this.tooltipOffset()];
664
- default:
665
- return [-_this.tooltipOffset(), 0];
666
- }
667
- });
668
- var classed = this.tooltip.attr("class");
669
- if (classed) {
670
- classed = classed.split(" notick").join("") + (this.tooltipTick() ? "" : " notick") + (this.tooltipStyle() === "none" ? " hidden" : "");
671
- classed = classed.split(" ")
672
- .filter(function (_class) {
673
- return _class.indexOf("ITooltip-tooltipStyle-") !== 0;
674
- })
675
- .join(" ");
676
- classed += " ITooltip-tooltipStyle-" + this.tooltipStyle();
677
- this.tooltip
678
- .attr("class", classed);
679
- }
680
- };
681
- ITooltip.prototype.tooltipExit = function () {
682
- if (this.tooltip) {
683
- this.tooltip.destroy();
684
- }
685
- };
686
- ITooltip.prototype._tooltipHTML = function (d) {
687
- return d;
688
- };
689
- ITooltip.prototype.tooltipHTML = function (_) {
690
- return this.tooltip.html(_);
691
- };
692
- ITooltip.prototype.tooltipFormat = function (opts) {
693
- if (opts === void 0) { opts = {}; }
694
- opts.label = opts.label === undefined ? "" : opts.label;
695
- opts.series = opts.series || "";
696
- if (opts.value instanceof Date) {
697
- opts.value = opts.value || "";
698
- }
699
- else {
700
- opts.value = this._valueFormatter(opts.value) || "";
562
+ this.tooltipEnter(svgElement);
563
+ layerEnter_1.apply(this, arguments);
564
+ };
565
+ var layerUpdate_1 = this.layerUpdate;
566
+ this.layerUpdate = function (_base) {
567
+ layerUpdate_1.apply(this, arguments);
568
+ this.tooltipUpdate();
569
+ };
570
+ var layerExit_1 = this.layerExit;
571
+ this.layerExit = function (_base) {
572
+ this.tooltipExit();
573
+ layerExit_1.apply(this, arguments);
574
+ };
575
+ }
576
+ else {
577
+ var enter_1 = this.enter;
578
+ this.enter = function (_domNode, element) {
579
+ this.tooltipEnter(element);
580
+ enter_1.apply(this, arguments);
581
+ };
582
+ var update_1 = this.update;
583
+ this.update = function (_domNode, _element) {
584
+ update_1.apply(this, arguments);
585
+ this.tooltipUpdate();
586
+ };
587
+ var exit_1 = this.exit;
588
+ this.exit = function (_domNode, _element) {
589
+ this.tooltipExit();
590
+ exit_1.apply(this, arguments);
591
+ };
592
+ }
593
+ }
594
+ ITooltip.prototype = Object.create(common.Widget.prototype);
595
+ ITooltip.prototype.constructor = ITooltip;
596
+ // abstract target(): any;
597
+ // abstract target(_: any): this;
598
+ ITooltip.prototype.tooltipEnter = function (element) {
599
+ var overlayElement = this.parentOverlay();
600
+ if (!overlayElement.empty()) {
601
+ this.tooltip.rootElement(overlayElement.node().parentNode);
602
+ }
603
+ element.call(this.tooltip);
604
+ };
605
+ ITooltip.prototype.tooltipUpdate = function () {
606
+ var _this = this;
607
+ this.tooltip.offset(function () {
608
+ if (event && _this.tooltipFollowMouse()) {
609
+ var d3tipElement = document.querySelector(".d3-tip"); // d3Tip offers no reference to the '.d3-tip' element...?
610
+ d3tipElement.style.display = "block";
611
+ d3tipElement.style.left = _this.tooltipOffset() + (event.clientX) + "px";
612
+ d3tipElement.style.top = event.clientY + "px";
613
+ return [];
701
614
  }
702
- switch (this.tooltipStyle()) {
703
- case "none":
704
- break;
705
- case "series-table":
706
- var html_1 = '<table class="ITooltip-series-table">'
707
- + "<thead>"
708
- + '<tr><th colspan="2">' + opts.label + "</th></tr>"
709
- + "</thead>"
710
- + "<tbody>";
711
- opts.arr.forEach(function (row) {
712
- html_1 += "<tr>";
713
- html_1 += "<td>";
714
- html_1 += '<div class="series-table-row-color" style="background-color:' + row.color + '"></div>';
715
- html_1 += '<div class="series-table-row-label">' + row.label + "</div>";
716
- html_1 += "</td>";
717
- html_1 += '<td><div class="series-table-row-value">' + row.value + "</div></td>";
718
- html_1 += "</tr>";
719
- });
720
- html_1 += "</tbody>";
721
- html_1 += "</table>";
722
- return html_1;
615
+ switch (_this.tooltip.direction()()) {
616
+ case "e":
617
+ return [0, _this.tooltipOffset()];
723
618
  default:
724
- if (opts.series) {
725
- return "<span style='color:" + this.tooltipSeriesColor() + "'>" + opts.series + "</span> / <span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
726
- }
727
- if (opts.label !== "") {
728
- return "<span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
729
- }
730
- return "<span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
619
+ return [-_this.tooltipOffset(), 0];
731
620
  }
732
- };
733
- ITooltip.prototype.tooltipKeyValueFormat = function (titleKey, obj) {
734
- var body = "";
735
- for (var key in obj) {
736
- if (key !== titleKey) {
737
- var value = obj && obj[key] ? obj[key] : "";
738
- body += "<tr><td style=\"" + (this.tooltipLabelColor_exists() ? "color:" + this.tooltipLabelColor() : "") + "\">" + key + "</td><td style=\"font-weight:normal\">" + value + "</td></tr>";
621
+ });
622
+ var classed = this.tooltip.attr("class");
623
+ if (classed) {
624
+ classed = classed.split(" notick").join("") + (this.tooltipTick() ? "" : " notick") + (this.tooltipStyle() === "none" ? " hidden" : "");
625
+ classed = classed.split(" ")
626
+ .filter(function (_class) {
627
+ return _class.indexOf("ITooltip-tooltipStyle-") !== 0;
628
+ })
629
+ .join(" ");
630
+ classed += " ITooltip-tooltipStyle-" + this.tooltipStyle();
631
+ this.tooltip
632
+ .attr("class", classed);
633
+ }
634
+ };
635
+ ITooltip.prototype.tooltipExit = function () {
636
+ if (this.tooltip) {
637
+ this.tooltip.destroy();
638
+ }
639
+ };
640
+ ITooltip.prototype._tooltipHTML = function (d) {
641
+ return d;
642
+ };
643
+ ITooltip.prototype.tooltipHTML = function (_) {
644
+ return this.tooltip.html(_);
645
+ };
646
+ ITooltip.prototype.tooltipFormat = function (opts) {
647
+ if (opts === void 0) { opts = {}; }
648
+ opts.label = opts.label === undefined ? "" : opts.label;
649
+ opts.series = opts.series || "";
650
+ if (opts.value instanceof Date) {
651
+ opts.value = opts.value || "";
652
+ }
653
+ else {
654
+ opts.value = this._valueFormatter(opts.value) || "";
655
+ }
656
+ switch (this.tooltipStyle()) {
657
+ case "none":
658
+ break;
659
+ case "series-table":
660
+ var html_1 = '<table class="ITooltip-series-table">'
661
+ + "<thead>"
662
+ + '<tr><th colspan="2">' + opts.label + "</th></tr>"
663
+ + "</thead>"
664
+ + "<tbody>";
665
+ opts.arr.forEach(function (row) {
666
+ html_1 += "<tr>";
667
+ html_1 += "<td>";
668
+ html_1 += '<div class="series-table-row-color" style="background-color:' + row.color + '"></div>';
669
+ html_1 += '<div class="series-table-row-label">' + row.label + "</div>";
670
+ html_1 += "</td>";
671
+ html_1 += '<td><div class="series-table-row-value">' + row.value + "</div></td>";
672
+ html_1 += "</tr>";
673
+ });
674
+ html_1 += "</tbody>";
675
+ html_1 += "</table>";
676
+ return html_1;
677
+ default:
678
+ if (opts.series) {
679
+ return "<span style='color:" + this.tooltipSeriesColor() + "'>" + opts.series + "</span> / <span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
680
+ }
681
+ if (opts.label !== "") {
682
+ return "<span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
739
683
  }
684
+ return "<span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
685
+ }
686
+ };
687
+ ITooltip.prototype.tooltipKeyValueFormat = function (titleKey, obj) {
688
+ var body = "";
689
+ for (var key in obj) {
690
+ if (key !== titleKey) {
691
+ var value = obj && obj[key] ? obj[key] : "";
692
+ body += "<tr><td style=\"".concat(this.tooltipLabelColor_exists() ? "color:" + this.tooltipLabelColor() : "", "\">").concat(key, "</td><td style=\"font-weight:normal\">").concat(value, "</td></tr>");
740
693
  }
741
- return "<table>\n <thead>\n <tr><th colspan=\"2\" style=\"font-weight:bold;font-size:16px\">" + obj[titleKey] + "</th></tr>\n </thead>\n <tbody>\n " + body + "\n </tbody>\n </table>";
742
- };
743
- return ITooltip;
744
- }(common.Widget));
694
+ }
695
+ return "<table>\n <thead>\n <tr><th colspan=\"2\" style=\"font-weight:bold;font-size:16px\">".concat(obj[titleKey], "</th></tr>\n </thead>\n <tbody>\n ").concat(body, "\n </tbody>\n </table>");
696
+ };
745
697
  ITooltip.prototype.publish("tooltipStyle", "default", "set", "Style mode", ["default", "none", "series-table"], {});
746
698
  ITooltip.prototype.publish("tooltipFollowMouse", false, "boolean", "If true, the tooltip will follow mouse movement", null, {});
747
699
  ITooltip.prototype.publish("tooltipValueFormat", ",.2f", "string", "Number format of tooltip value(s)", null, {});
@@ -759,18 +711,15 @@
759
711
  return retVal;
760
712
  };
761
713
 
762
- var ITree = /** @class */ (function () {
763
- function ITree() {
764
- }
765
- // Events ---
766
- ITree.prototype.click = function (row, column, selected) {
767
- console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
768
- };
769
- ITree.prototype.dblclick = function (row, column, selected) {
770
- console.log("Double click: " + JSON.stringify(row) + ", " + column + ", " + selected);
771
- };
772
- return ITree;
773
- }());
714
+ // Use old school class declaration as this is a mixin ---
715
+ function ITree() {
716
+ }
717
+ ITree.prototype.constructor = ITree;
718
+ // Events ---
719
+ ITree.prototype.click = function (row, column, selected) {
720
+ };
721
+ ITree.prototype.dblclick = function (row, column, selected) {
722
+ };
774
723
  ITree.prototype._palette = common.Palette.ordinal("default");
775
724
 
776
725
  exports.BUILD_VERSION = BUILD_VERSION;
@@ -788,5 +737,5 @@
788
737
 
789
738
  Object.defineProperty(exports, '__esModule', { value: true });
790
739
 
791
- })));
740
+ }));
792
741
  //# sourceMappingURL=index.js.map