@hpcc-js/api 2.9.2 → 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.es6.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Palette, hsl, Widget, select, selection, map, format } from '@hpcc-js/common';
2
2
 
3
3
  var PKG_NAME = "@hpcc-js/api";
4
- var PKG_VERSION = "2.9.2";
5
- var BUILD_VERSION = "2.102.11";
4
+ var PKG_VERSION = "2.10.0";
5
+ var BUILD_VERSION = "2.103.0";
6
6
 
7
7
  function I1DChart() {
8
8
  }
@@ -72,100 +72,69 @@ function instanceOfIHighlight(w) {
72
72
  return typeof w.highlightColumn === "function";
73
73
  }
74
74
 
75
- /*! *****************************************************************************
76
- Copyright (c) Microsoft Corporation.
77
-
78
- Permission to use, copy, modify, and/or distribute this software for any
79
- purpose with or without fee is hereby granted.
80
-
81
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
82
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
83
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
84
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
85
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
86
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
87
- PERFORMANCE OF THIS SOFTWARE.
88
- ***************************************************************************** */
89
- /* global Reflect, Promise */
90
-
91
- var extendStatics = function(d, b) {
92
- extendStatics = Object.setPrototypeOf ||
93
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
94
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
95
- return extendStatics(d, b);
96
- };
97
-
98
- function __extends(d, b) {
99
- if (typeof b !== "function" && b !== null)
100
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
101
- extendStatics(d, b);
102
- function __() { this.constructor = d; }
103
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
75
+ // Use old school class declaration as this is a mixin ---
76
+ function IInput() {
104
77
  }
105
-
106
- var IInput = /** @class */ (function (_super) {
107
- __extends(IInput, _super);
108
- function IInput() {
109
- return _super.call(this) || this;
110
- }
111
- // Implementation ---
112
- IInput.prototype.isValid = function () {
113
- if (this.validate()) {
114
- var re = new RegExp(this.validate());
115
- if (!re.test(this.value())) {
116
- return false;
117
- }
118
- }
119
- return true;
120
- };
121
- IInput.prototype.hasValue = function () {
122
- if (typeof this.type === "function") {
123
- switch (this.type()) {
124
- case "radio":
125
- /* falls through */
126
- case "checkbox":
127
- if (this.value() && this.value() !== "false") {
128
- return true;
129
- }
130
- break;
131
- default:
132
- if (this.value()) {
133
- return true;
134
- }
135
- break;
136
- }
78
+ IInput.prototype = Object.create(Widget.prototype);
79
+ IInput.prototype.constructor = IInput;
80
+ // abstract target(): any;
81
+ // abstract target(_: any): this;
82
+ // Implementation ---
83
+ IInput.prototype.isValid = function () {
84
+ if (this.validate()) {
85
+ var re = new RegExp(this.validate());
86
+ if (!re.test(this.value())) {
137
87
  return false;
138
88
  }
139
- return this.value() !== "";
140
- };
141
- // Events ---
142
- IInput.prototype.blur = function (_w) {
143
- };
144
- IInput.prototype.keyup = function (_w) {
145
- };
146
- IInput.prototype.focus = function (_w) {
147
- };
148
- IInput.prototype.click = function (_w) {
149
- };
150
- IInput.prototype.dblclick = function (_w) {
151
- };
152
- IInput.prototype.change = function (_w, complete) {
153
- };
154
- IInput.prototype.resetValue = function (w) {
155
- w.value(w._inputElement[0].node().value);
156
- };
157
- IInput.prototype.disable = function (disable) {
158
- this._inputElement.forEach(function (e, idx) {
159
- e.attr("disabled", disable ? "disabled" : null);
160
- });
161
- };
162
- IInput.prototype.setFocus = function () {
163
- if (this._inputElement.length) {
164
- this._inputElement[0].node().focus();
89
+ }
90
+ return true;
91
+ };
92
+ IInput.prototype.hasValue = function () {
93
+ if (typeof this.type === "function") {
94
+ switch (this.type()) {
95
+ case "radio":
96
+ /* falls through */
97
+ case "checkbox":
98
+ if (this.value() && this.value() !== "false") {
99
+ return true;
100
+ }
101
+ break;
102
+ default:
103
+ if (this.value()) {
104
+ return true;
105
+ }
106
+ break;
165
107
  }
166
- };
167
- return IInput;
168
- }(Widget));
108
+ return false;
109
+ }
110
+ return this.value() !== "";
111
+ };
112
+ // Events ---
113
+ IInput.prototype.blur = function (_w) {
114
+ };
115
+ IInput.prototype.keyup = function (_w) {
116
+ };
117
+ IInput.prototype.focus = function (_w) {
118
+ };
119
+ IInput.prototype.click = function (_w) {
120
+ };
121
+ IInput.prototype.dblclick = function (_w) {
122
+ };
123
+ IInput.prototype.change = function (_w, complete) {
124
+ };
125
+ IInput.prototype.resetValue = function (w) {
126
+ w.value(w._inputElement[0].node().value);
127
+ };
128
+ IInput.prototype.disable = function (disable) {
129
+ this._inputElement.forEach(function (e, idx) {
130
+ e.attr("disabled", disable ? "disabled" : null);
131
+ });
132
+ };
133
+ IInput.prototype.setFocus = function () {
134
+ if (this._inputElement.length) {
135
+ this._inputElement[0].node().focus();
136
+ }
137
+ };
169
138
  IInput.prototype.publish("name", "", "string", "HTML name for the input");
170
139
  IInput.prototype.publish("label", "", "string", "Descriptive label");
171
140
  IInput.prototype.publish("value", "", "string", "Input Current Value");
@@ -576,152 +545,151 @@ function styleInject(css, ref) {
576
545
  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}";
577
546
  styleInject(css_248z);
578
547
 
579
- var ITooltip = /** @class */ (function (_super) {
580
- __extends(ITooltip, _super);
581
- function ITooltip() {
582
- var _this = _super.call(this) || this;
583
- _this.tooltip = tip();
584
- _this._valueFormatter = format(_this.tooltipValueFormat());
585
- if (_this.layerEnter) {
586
- var layerEnter_1 = _this.layerEnter;
587
- _this.layerEnter = function (_base, svgElement, _domElement) {
588
- if (!this._parentOverlay) {
589
- this._parentOverlay = _base._parentOverlay;
590
- }
591
- this.tooltipEnter(svgElement);
592
- layerEnter_1.apply(this, arguments);
593
- };
594
- var layerUpdate_1 = _this.layerUpdate;
595
- _this.layerUpdate = function (_base) {
596
- layerUpdate_1.apply(this, arguments);
597
- this.tooltipUpdate();
598
- };
599
- var layerExit_1 = _this.layerExit;
600
- _this.layerExit = function (_base) {
601
- this.tooltipExit();
602
- layerExit_1.apply(this, arguments);
603
- };
604
- }
605
- else {
606
- var enter_1 = _this.enter;
607
- _this.enter = function (_domNode, element) {
608
- this.tooltipEnter(element);
609
- enter_1.apply(this, arguments);
610
- };
611
- var update_1 = _this.update;
612
- _this.update = function (_domNode, _element) {
613
- update_1.apply(this, arguments);
614
- this.tooltipUpdate();
615
- };
616
- var exit_1 = _this.exit;
617
- _this.exit = function (_domNode, _element) {
618
- this.tooltipExit();
619
- exit_1.apply(this, arguments);
620
- };
621
- }
622
- return _this;
623
- }
624
- ITooltip.prototype.tooltipEnter = function (element) {
625
- var overlayElement = this.parentOverlay();
626
- if (!overlayElement.empty()) {
627
- this.tooltip.rootElement(overlayElement.node().parentNode);
628
- }
629
- element.call(this.tooltip);
630
- };
631
- ITooltip.prototype.tooltipUpdate = function () {
632
- var _this = this;
633
- this.tooltip.offset(function () {
634
- if (event && _this.tooltipFollowMouse()) {
635
- var d3tipElement = document.querySelector(".d3-tip"); // d3Tip offers no reference to the '.d3-tip' element...?
636
- d3tipElement.style.display = "block";
637
- d3tipElement.style.left = _this.tooltipOffset() + (event.clientX) + "px";
638
- d3tipElement.style.top = event.clientY + "px";
639
- return [];
640
- }
641
- switch (_this.tooltip.direction()()) {
642
- case "e":
643
- return [0, _this.tooltipOffset()];
644
- default:
645
- return [-_this.tooltipOffset(), 0];
548
+ // Use old school class declaration as this is a mixin ---
549
+ function ITooltip() {
550
+ this.tooltip = tip();
551
+ this._valueFormatter = format(this.tooltipValueFormat());
552
+ if (this.layerEnter) {
553
+ var layerEnter_1 = this.layerEnter;
554
+ this.layerEnter = function (_base, svgElement, _domElement) {
555
+ if (!this._parentOverlay) {
556
+ this._parentOverlay = _base._parentOverlay;
646
557
  }
647
- });
648
- var classed = this.tooltip.attr("class");
649
- if (classed) {
650
- classed = classed.split(" notick").join("") + (this.tooltipTick() ? "" : " notick") + (this.tooltipStyle() === "none" ? " hidden" : "");
651
- classed = classed.split(" ")
652
- .filter(function (_class) {
653
- return _class.indexOf("ITooltip-tooltipStyle-") !== 0;
654
- })
655
- .join(" ");
656
- classed += " ITooltip-tooltipStyle-" + this.tooltipStyle();
657
- this.tooltip
658
- .attr("class", classed);
659
- }
660
- };
661
- ITooltip.prototype.tooltipExit = function () {
662
- if (this.tooltip) {
663
- this.tooltip.destroy();
664
- }
665
- };
666
- ITooltip.prototype._tooltipHTML = function (d) {
667
- return d;
668
- };
669
- ITooltip.prototype.tooltipHTML = function (_) {
670
- return this.tooltip.html(_);
671
- };
672
- ITooltip.prototype.tooltipFormat = function (opts) {
673
- if (opts === void 0) { opts = {}; }
674
- opts.label = opts.label === undefined ? "" : opts.label;
675
- opts.series = opts.series || "";
676
- if (opts.value instanceof Date) {
677
- opts.value = opts.value || "";
678
- }
679
- else {
680
- opts.value = this._valueFormatter(opts.value) || "";
558
+ this.tooltipEnter(svgElement);
559
+ layerEnter_1.apply(this, arguments);
560
+ };
561
+ var layerUpdate_1 = this.layerUpdate;
562
+ this.layerUpdate = function (_base) {
563
+ layerUpdate_1.apply(this, arguments);
564
+ this.tooltipUpdate();
565
+ };
566
+ var layerExit_1 = this.layerExit;
567
+ this.layerExit = function (_base) {
568
+ this.tooltipExit();
569
+ layerExit_1.apply(this, arguments);
570
+ };
571
+ }
572
+ else {
573
+ var enter_1 = this.enter;
574
+ this.enter = function (_domNode, element) {
575
+ this.tooltipEnter(element);
576
+ enter_1.apply(this, arguments);
577
+ };
578
+ var update_1 = this.update;
579
+ this.update = function (_domNode, _element) {
580
+ update_1.apply(this, arguments);
581
+ this.tooltipUpdate();
582
+ };
583
+ var exit_1 = this.exit;
584
+ this.exit = function (_domNode, _element) {
585
+ this.tooltipExit();
586
+ exit_1.apply(this, arguments);
587
+ };
588
+ }
589
+ }
590
+ ITooltip.prototype = Object.create(Widget.prototype);
591
+ ITooltip.prototype.constructor = ITooltip;
592
+ // abstract target(): any;
593
+ // abstract target(_: any): this;
594
+ ITooltip.prototype.tooltipEnter = function (element) {
595
+ var overlayElement = this.parentOverlay();
596
+ if (!overlayElement.empty()) {
597
+ this.tooltip.rootElement(overlayElement.node().parentNode);
598
+ }
599
+ element.call(this.tooltip);
600
+ };
601
+ ITooltip.prototype.tooltipUpdate = function () {
602
+ var _this = this;
603
+ this.tooltip.offset(function () {
604
+ if (event && _this.tooltipFollowMouse()) {
605
+ var d3tipElement = document.querySelector(".d3-tip"); // d3Tip offers no reference to the '.d3-tip' element...?
606
+ d3tipElement.style.display = "block";
607
+ d3tipElement.style.left = _this.tooltipOffset() + (event.clientX) + "px";
608
+ d3tipElement.style.top = event.clientY + "px";
609
+ return [];
681
610
  }
682
- switch (this.tooltipStyle()) {
683
- case "none":
684
- break;
685
- case "series-table":
686
- var html_1 = '<table class="ITooltip-series-table">'
687
- + "<thead>"
688
- + '<tr><th colspan="2">' + opts.label + "</th></tr>"
689
- + "</thead>"
690
- + "<tbody>";
691
- opts.arr.forEach(function (row) {
692
- html_1 += "<tr>";
693
- html_1 += "<td>";
694
- html_1 += '<div class="series-table-row-color" style="background-color:' + row.color + '"></div>';
695
- html_1 += '<div class="series-table-row-label">' + row.label + "</div>";
696
- html_1 += "</td>";
697
- html_1 += '<td><div class="series-table-row-value">' + row.value + "</div></td>";
698
- html_1 += "</tr>";
699
- });
700
- html_1 += "</tbody>";
701
- html_1 += "</table>";
702
- return html_1;
611
+ switch (_this.tooltip.direction()()) {
612
+ case "e":
613
+ return [0, _this.tooltipOffset()];
703
614
  default:
704
- if (opts.series) {
705
- 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>";
706
- }
707
- if (opts.label !== "") {
708
- return "<span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
709
- }
710
- return "<span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
615
+ return [-_this.tooltipOffset(), 0];
711
616
  }
712
- };
713
- ITooltip.prototype.tooltipKeyValueFormat = function (titleKey, obj) {
714
- var body = "";
715
- for (var key in obj) {
716
- if (key !== titleKey) {
717
- var value = obj && obj[key] ? obj[key] : "";
718
- body += "<tr><td style=\"".concat(this.tooltipLabelColor_exists() ? "color:" + this.tooltipLabelColor() : "", "\">").concat(key, "</td><td style=\"font-weight:normal\">").concat(value, "</td></tr>");
617
+ });
618
+ var classed = this.tooltip.attr("class");
619
+ if (classed) {
620
+ classed = classed.split(" notick").join("") + (this.tooltipTick() ? "" : " notick") + (this.tooltipStyle() === "none" ? " hidden" : "");
621
+ classed = classed.split(" ")
622
+ .filter(function (_class) {
623
+ return _class.indexOf("ITooltip-tooltipStyle-") !== 0;
624
+ })
625
+ .join(" ");
626
+ classed += " ITooltip-tooltipStyle-" + this.tooltipStyle();
627
+ this.tooltip
628
+ .attr("class", classed);
629
+ }
630
+ };
631
+ ITooltip.prototype.tooltipExit = function () {
632
+ if (this.tooltip) {
633
+ this.tooltip.destroy();
634
+ }
635
+ };
636
+ ITooltip.prototype._tooltipHTML = function (d) {
637
+ return d;
638
+ };
639
+ ITooltip.prototype.tooltipHTML = function (_) {
640
+ return this.tooltip.html(_);
641
+ };
642
+ ITooltip.prototype.tooltipFormat = function (opts) {
643
+ if (opts === void 0) { opts = {}; }
644
+ opts.label = opts.label === undefined ? "" : opts.label;
645
+ opts.series = opts.series || "";
646
+ if (opts.value instanceof Date) {
647
+ opts.value = opts.value || "";
648
+ }
649
+ else {
650
+ opts.value = this._valueFormatter(opts.value) || "";
651
+ }
652
+ switch (this.tooltipStyle()) {
653
+ case "none":
654
+ break;
655
+ case "series-table":
656
+ var html_1 = '<table class="ITooltip-series-table">'
657
+ + "<thead>"
658
+ + '<tr><th colspan="2">' + opts.label + "</th></tr>"
659
+ + "</thead>"
660
+ + "<tbody>";
661
+ opts.arr.forEach(function (row) {
662
+ html_1 += "<tr>";
663
+ html_1 += "<td>";
664
+ html_1 += '<div class="series-table-row-color" style="background-color:' + row.color + '"></div>';
665
+ html_1 += '<div class="series-table-row-label">' + row.label + "</div>";
666
+ html_1 += "</td>";
667
+ html_1 += '<td><div class="series-table-row-value">' + row.value + "</div></td>";
668
+ html_1 += "</tr>";
669
+ });
670
+ html_1 += "</tbody>";
671
+ html_1 += "</table>";
672
+ return html_1;
673
+ default:
674
+ if (opts.series) {
675
+ 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>";
676
+ }
677
+ if (opts.label !== "") {
678
+ return "<span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
719
679
  }
680
+ return "<span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
681
+ }
682
+ };
683
+ ITooltip.prototype.tooltipKeyValueFormat = function (titleKey, obj) {
684
+ var body = "";
685
+ for (var key in obj) {
686
+ if (key !== titleKey) {
687
+ var value = obj && obj[key] ? obj[key] : "";
688
+ body += "<tr><td style=\"".concat(this.tooltipLabelColor_exists() ? "color:" + this.tooltipLabelColor() : "", "\">").concat(key, "</td><td style=\"font-weight:normal\">").concat(value, "</td></tr>");
720
689
  }
721
- 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>");
722
- };
723
- return ITooltip;
724
- }(Widget));
690
+ }
691
+ 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>");
692
+ };
725
693
  ITooltip.prototype.publish("tooltipStyle", "default", "set", "Style mode", ["default", "none", "series-table"], {});
726
694
  ITooltip.prototype.publish("tooltipFollowMouse", false, "boolean", "If true, the tooltip will follow mouse movement", null, {});
727
695
  ITooltip.prototype.publish("tooltipValueFormat", ",.2f", "string", "Number format of tooltip value(s)", null, {});
@@ -739,16 +707,15 @@ ITooltip.prototype.tooltipValueFormat = function (_) {
739
707
  return retVal;
740
708
  };
741
709
 
742
- var ITree = /** @class */ (function () {
743
- function ITree() {
744
- }
745
- // Events ---
746
- ITree.prototype.click = function (row, column, selected) {
747
- };
748
- ITree.prototype.dblclick = function (row, column, selected) {
749
- };
750
- return ITree;
751
- }());
710
+ // Use old school class declaration as this is a mixin ---
711
+ function ITree() {
712
+ }
713
+ ITree.prototype.constructor = ITree;
714
+ // Events ---
715
+ ITree.prototype.click = function (row, column, selected) {
716
+ };
717
+ ITree.prototype.dblclick = function (row, column, selected) {
718
+ };
752
719
  ITree.prototype._palette = Palette.ordinal("default");
753
720
 
754
721
  export { BUILD_VERSION, I1DChart, I2DAggrChart, I2DChart, IGraph, IInput, INDChart, ITooltip, ITree, PKG_NAME, PKG_VERSION, instanceOfIHighlight };