tsichart-core 1.0.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 (126) hide show
  1. package/LICENSE +22 -0
  2. package/README.MD +189 -0
  3. package/dist/AggregateExpression.d.ts +13 -0
  4. package/dist/AggregateExpression.js +70 -0
  5. package/dist/AvailabilityChart-i_efwXCX.js +488 -0
  6. package/dist/AvailabilityChart.d.ts +59 -0
  7. package/dist/AvailabilityChart.js +26 -0
  8. package/dist/ChartComponent-DTcc6aED.d.ts +80 -0
  9. package/dist/ChartComponent-DnKLTxWe.js +302 -0
  10. package/dist/ChartComponentData-D5wuQmmZ.d.ts +47 -0
  11. package/dist/ChartDataOptions-DBS28b1-.d.ts +38 -0
  12. package/dist/ChartDataOptions-DRd8NHra.js +49 -0
  13. package/dist/ChartVisualizationComponent-CG7e5xlc.js +23 -0
  14. package/dist/ChartVisualizationComponent-DBjiqR1n.d.ts +8 -0
  15. package/dist/ColorPicker-CH__K8xm.js +120 -0
  16. package/dist/ColorPicker.d.ts +28 -0
  17. package/dist/ColorPicker.js +6 -0
  18. package/dist/Component-CofgyEw0.js +401 -0
  19. package/dist/Component-Rp30sSAW.d.ts +226 -0
  20. package/dist/ContextMenu-DABSkTA2.js +197 -0
  21. package/dist/DateTimeButton-CMcCxc8x.d.ts +16 -0
  22. package/dist/DateTimeButton-Ca1487GR.js +38 -0
  23. package/dist/DateTimeButtonRange-DpgfhHQt.js +71 -0
  24. package/dist/DateTimeButtonRange.d.ts +19 -0
  25. package/dist/DateTimeButtonRange.js +15 -0
  26. package/dist/DateTimeButtonSingle-C6cTx5VO.js +48 -0
  27. package/dist/DateTimeButtonSingle.d.ts +17 -0
  28. package/dist/DateTimeButtonSingle.js +14 -0
  29. package/dist/DateTimePicker-BH6qiVfQ.js +532 -0
  30. package/dist/DateTimePicker.d.ts +69 -0
  31. package/dist/DateTimePicker.js +13 -0
  32. package/dist/EllipsisMenu-30FNqoIv.js +116 -0
  33. package/dist/EllipsisMenu.d.ts +20 -0
  34. package/dist/EllipsisMenu.js +6 -0
  35. package/dist/Enums-ChUuTtHV.d.ts +12 -0
  36. package/dist/EventsTable-a0XLbsMF.js +553 -0
  37. package/dist/EventsTable.d.ts +34 -0
  38. package/dist/EventsTable.js +10 -0
  39. package/dist/GeoProcessGraphic-AVAzyF7k.js +145 -0
  40. package/dist/GeoProcessGraphic.d.ts +34 -0
  41. package/dist/GeoProcessGraphic.js +7 -0
  42. package/dist/Grid-DfFAkeeV.js +874 -0
  43. package/dist/Grid.d.ts +43 -0
  44. package/dist/Grid.js +6 -0
  45. package/dist/GroupedBarChart-BspwM8r2.js +579 -0
  46. package/dist/GroupedBarChart.d.ts +22 -0
  47. package/dist/GroupedBarChart.js +17 -0
  48. package/dist/GroupedBarChartData-BRCyDxbA.js +121 -0
  49. package/dist/GroupedBarChartData-C0YQydrP.d.ts +20 -0
  50. package/dist/Heatmap-D8ET8Ue8.js +524 -0
  51. package/dist/Heatmap.d.ts +31 -0
  52. package/dist/Heatmap.js +14 -0
  53. package/dist/Hierarchy-QkWLHkxo.js +260 -0
  54. package/dist/Hierarchy.d.ts +39 -0
  55. package/dist/Hierarchy.js +6 -0
  56. package/dist/HierarchyNavigation-CR6YUilh.js +336 -0
  57. package/dist/HierarchyNavigation.d.ts +34 -0
  58. package/dist/HierarchyNavigation.js +6 -0
  59. package/dist/HistoryPlayback-BmA-54lT.d.ts +68 -0
  60. package/dist/HistoryPlayback-SjeQbAPq.js +175 -0
  61. package/dist/Interfaces-BKRQ685G.d.ts +6 -0
  62. package/dist/Legend-DlSXQXHF.js +497 -0
  63. package/dist/LineChart-CExEyjZa.js +3181 -0
  64. package/dist/LineChart.d.ts +163 -0
  65. package/dist/LineChart.js +18 -0
  66. package/dist/ModelAutocomplete-TRD16egq.js +100 -0
  67. package/dist/ModelAutocomplete.d.ts +12 -0
  68. package/dist/ModelAutocomplete.js +7 -0
  69. package/dist/ModelSearch-WEa7Ud20.js +189 -0
  70. package/dist/ModelSearch.d.ts +23 -0
  71. package/dist/ModelSearch.js +9 -0
  72. package/dist/PieChart-B1ZXk13Q.js +258 -0
  73. package/dist/PieChart.d.ts +26 -0
  74. package/dist/PieChart.js +17 -0
  75. package/dist/PlaybackControls-Dwt6dif9.js +195 -0
  76. package/dist/PlaybackControls.d.ts +39 -0
  77. package/dist/PlaybackControls.js +13 -0
  78. package/dist/ProcessGraphic-CixT-zZl.js +154 -0
  79. package/dist/ProcessGraphic.d.ts +31 -0
  80. package/dist/ProcessGraphic.js +7 -0
  81. package/dist/README.MD +189 -0
  82. package/dist/ScatterPlot-DrPoHNDJ.js +924 -0
  83. package/dist/ScatterPlot.d.ts +115 -0
  84. package/dist/ScatterPlot.js +17 -0
  85. package/dist/SingleDateTimePicker-7anflEq8.js +213 -0
  86. package/dist/SingleDateTimePicker.d.ts +45 -0
  87. package/dist/SingleDateTimePicker.js +12 -0
  88. package/dist/Slider-BtSdC4fj.js +186 -0
  89. package/dist/Slider.d.ts +31 -0
  90. package/dist/Slider.js +6 -0
  91. package/dist/TemporalXAxisComponent-CyiM5EH0.d.ts +23 -0
  92. package/dist/TemporalXAxisComponent-DkyVvASs.js +129 -0
  93. package/dist/TimezonePicker-ClfP1lBL.js +58 -0
  94. package/dist/TimezonePicker.d.ts +16 -0
  95. package/dist/TimezonePicker.js +10 -0
  96. package/dist/Tooltip-Fa-0Xekn.js +104 -0
  97. package/dist/TsqExpression.d.ts +36 -0
  98. package/dist/TsqExpression.js +89 -0
  99. package/dist/UXClient-DydSPZwM.js +230 -0
  100. package/dist/UXClient.d.ts +74 -0
  101. package/dist/UXClient.js +47 -0
  102. package/dist/Utils-BsPLzJBC.d.ts +104 -0
  103. package/dist/Utils-C_j8IgZh.js +1138 -0
  104. package/dist/Utils.d.ts +7 -0
  105. package/dist/Utils.js +7 -0
  106. package/dist/_tslib-5_9pMg1F.js +96 -0
  107. package/dist/package.json +106 -0
  108. package/dist/pikaday-DMSzaLH6.js +1252 -0
  109. package/dist/tsiclient.cjs.js +3 -0
  110. package/dist/tsiclient.cjs.js.LICENSE.txt +19 -0
  111. package/dist/tsiclient.cjs.js.map +1 -0
  112. package/dist/tsiclient.css +17323 -0
  113. package/dist/tsiclient.d.ts +46 -0
  114. package/dist/tsiclient.esm.js +3 -0
  115. package/dist/tsiclient.esm.js.LICENSE.txt +19 -0
  116. package/dist/tsiclient.esm.js.map +1 -0
  117. package/dist/tsiclient.js +58 -0
  118. package/dist/tsiclient.min.css +6 -0
  119. package/dist/tsiclient.min.css.map +1 -0
  120. package/dist/tsiclient.umd.js +3 -0
  121. package/dist/tsiclient.umd.js.LICENSE.txt +19 -0
  122. package/dist/tsiclient.umd.js.map +1 -0
  123. package/dist/tsiclient.umd.min.js +3 -0
  124. package/dist/tsiclient.umd.min.js.LICENSE.txt +19 -0
  125. package/dist/tsiclient.umd.min.js.map +1 -0
  126. package/package.json +106 -0
@@ -0,0 +1,163 @@
1
+ import { T as TemporalXAxisComponent } from './TemporalXAxisComponent-CyiM5EH0.js';
2
+ import { C as ChartComponentData } from './ChartComponentData-D5wuQmmZ.js';
3
+ import './ChartVisualizationComponent-DBjiqR1n.js';
4
+ import './ChartComponent-DTcc6aED.js';
5
+ import './Enums-ChUuTtHV.js';
6
+ import './Component-Rp30sSAW.js';
7
+ import './Interfaces-BKRQ685G.js';
8
+ import './EllipsisMenu.js';
9
+
10
+ declare class LineChartData extends ChartComponentData {
11
+ timeMap: any;
12
+ get yExtents(): Array<any>;
13
+ private _yExtents;
14
+ setYExtents(idx: number, value: [number, number]): void;
15
+ resetYExtents(): void;
16
+ setTimeMap(): void;
17
+ constructor();
18
+ mergeDataToDisplayStateAndTimeArrays(data: any, aggregateExpressionOptions?: any): void;
19
+ }
20
+
21
+ declare class LineChart extends TemporalXAxisComponent {
22
+ private targetElement;
23
+ private focus;
24
+ private horizontalValueBox;
25
+ private verticalValueBox;
26
+ private horizontalValueBar;
27
+ private contextMenu;
28
+ private brushContextMenu;
29
+ private setDisplayStateFromData;
30
+ private minBrushWidth;
31
+ private strokeOpacity;
32
+ private nonFocusStrokeOpactiy;
33
+ chartComponentData: LineChartData;
34
+ private surpressBrushTimeSet;
35
+ private hasStackedButton;
36
+ private stackedButton;
37
+ private visibleAggCount;
38
+ private swimLaneLabelGroup;
39
+ private horizontalLabelOffset;
40
+ private tooltip;
41
+ private height;
42
+ private xLowerBound;
43
+ private xUpperBound;
44
+ private y;
45
+ private yMap;
46
+ private line;
47
+ private areaPath;
48
+ private envelope;
49
+ private voronoi;
50
+ private possibleTimesArray;
51
+ private colorMap;
52
+ private markers;
53
+ private seriesLabelsMarker;
54
+ private markerGuidMap;
55
+ private isDroppingMarker;
56
+ private activeMarker;
57
+ private brush;
58
+ private brushElem;
59
+ brushStartTime: Date;
60
+ brushEndTime: Date;
61
+ private brushStartPosition;
62
+ private brushEndPosition;
63
+ private hasBrush;
64
+ private isClearingBrush;
65
+ private previousAggregateData;
66
+ private previousIncludeDots;
67
+ private voronoiDiagram;
68
+ private voronoiRegion;
69
+ private mx;
70
+ private my;
71
+ private focusedAggKey;
72
+ private focusedSplitby;
73
+ private plotComponents;
74
+ private isFirstMarkerDrop;
75
+ private xOffset;
76
+ private swimlaneYExtents;
77
+ private swimLaneContents;
78
+ private originalSwimLanes;
79
+ private originalSwimLaneOptions;
80
+ constructor(renderTarget: Element);
81
+ LineChart(): void;
82
+ getBrushPositions(): {
83
+ leftPos: any;
84
+ rightPos: any;
85
+ };
86
+ private resetValueElementsFocus;
87
+ private hideFocusElements;
88
+ private voronoiMouseout;
89
+ private createMarkerInstructions;
90
+ private destroyMarkerInstructions;
91
+ triggerLineFocus: (aggKey: string, splitBy: string) => void;
92
+ private getMouseoverFunction;
93
+ private getMouseoutFunction;
94
+ private focusOnlyHoveredSeries;
95
+ private discreteEventsMouseover;
96
+ private discreteEventsMouseout;
97
+ private mismatchingChartType;
98
+ private categoricalMouseover;
99
+ private categoricalMouseout;
100
+ private setHorizontalValuePosAndText;
101
+ private setVerticalValueAndPosition;
102
+ private voronoiMouseover;
103
+ private getYExtent;
104
+ private getFilteredValues;
105
+ private getFilteredAndSticky;
106
+ stickyOrUnstickySeries: (aggKey: any, splitBy: any) => void;
107
+ unstickySeries: (aggKey: any, splitby?: any) => void;
108
+ private stickySeries;
109
+ private getHandleHeight;
110
+ private getXPosition;
111
+ setBrushStartTime(startTime: any): void;
112
+ setBrushEndTime(endTime: any): void;
113
+ setBrush(): void;
114
+ private findClosestValidTime;
115
+ private getMarkerMarginLeft;
116
+ exportMarkers(): void;
117
+ private createOnMarkerChange;
118
+ private renderMarker;
119
+ private sortMarkers;
120
+ private getAllLinesTransitionsComplete;
121
+ private importMarkers;
122
+ private createSeriesLabelsMarker;
123
+ private renderSeriesLabelsMarker;
124
+ private renderAllMarkers;
125
+ private focusOnEllipsis;
126
+ private filteredValueExist;
127
+ addMarker: () => void;
128
+ private voronoiExists;
129
+ private voronoiMousemove;
130
+ private voronoiContextMenu;
131
+ private voronoiClick;
132
+ private getValueOfVisible;
133
+ private brushBrush;
134
+ private brushEnd;
135
+ private focusMarkerLabel;
136
+ labelMouseout: () => void;
137
+ labelMouseover: (aggregateKey: string, splitBy?: string) => void;
138
+ private drawBrushRange;
139
+ private getSVGLeftOffset;
140
+ updateBrushRange(): void;
141
+ deleteBrushRange(): void;
142
+ getYExtents(): any[];
143
+ private nextStackedState;
144
+ private clearBrush;
145
+ private getVisibleNumerics;
146
+ private getSwimlaneOffsets;
147
+ private setSwimLaneYExtents;
148
+ private getEventsCollapsedSwimlaneHeight;
149
+ private createYOffsets;
150
+ private heightNonNumeric;
151
+ private getGroupYExtent;
152
+ private getAggAxisType;
153
+ private adjustSwimLanes;
154
+ private overwriteSwimLanes;
155
+ private getHorizontalMarkersWithYScales;
156
+ private getAdditionalOffsetFromHorizontalMargin;
157
+ private drawHorizontalMarkers;
158
+ private createSwimlaneLabels;
159
+ render(data: any, options: any, aggregateExpressionOptions: any): void;
160
+ private createPlot;
161
+ }
162
+
163
+ export { LineChart as default };
@@ -0,0 +1,18 @@
1
+ export { L as default } from './LineChart-CExEyjZa.js';
2
+ import './_tslib-5_9pMg1F.js';
3
+ import 'd3';
4
+ import 'd3-voronoi';
5
+ import './Utils-C_j8IgZh.js';
6
+ import 'moment-timezone';
7
+ import './Legend-DlSXQXHF.js';
8
+ import './Component-CofgyEw0.js';
9
+ import './TemporalXAxisComponent-DkyVvASs.js';
10
+ import './ChartVisualizationComponent-CG7e5xlc.js';
11
+ import './ChartComponent-DnKLTxWe.js';
12
+ import './Grid-DfFAkeeV.js';
13
+ import 'split.js';
14
+ import './EllipsisMenu-30FNqoIv.js';
15
+ import './ChartDataOptions-DRd8NHra.js';
16
+ import './ContextMenu-DABSkTA2.js';
17
+ import './Tooltip-Fa-0Xekn.js';
18
+ import 'd3-interpolate-path';
@@ -0,0 +1,100 @@
1
+ import { _ as __extends } from './_tslib-5_9pMg1F.js';
2
+ import * as d3 from 'd3';
3
+ import 'awesomplete';
4
+ import { a as ChartOptions, C as Component } from './Component-CofgyEw0.js';
5
+ import { U as Utils } from './Utils-C_j8IgZh.js';
6
+
7
+ var ModelAutocomplete = /** @class */ (function (_super) {
8
+ __extends(ModelAutocomplete, _super);
9
+ function ModelAutocomplete(renderTarget) {
10
+ var _this = _super.call(this, renderTarget) || this;
11
+ _this.chartOptions = new ChartOptions(); // TODO handle onkeyup and oninput in chart options
12
+ return _this;
13
+ }
14
+ ModelAutocomplete.prototype.render = function (environmentFqdn, getToken, chartOptions) {
15
+ var _this = this;
16
+ this.chartOptions.setOptions(chartOptions);
17
+ var targetElement = d3.select(this.renderTarget);
18
+ targetElement.html("");
19
+ var wrapper = targetElement
20
+ .append("div")
21
+ .attr("class", "tsi-modelAutocompleteWrapper");
22
+ _super.prototype.themify.call(this, wrapper, this.chartOptions.theme);
23
+ var inputWrapper = wrapper.append("div").attr("class", "tsi-search");
24
+ inputWrapper.append("i").classed("tsi-search-icon", true);
25
+ var input = inputWrapper
26
+ .append("input")
27
+ .attr("class", "tsi-searchInput")
28
+ .attr("aria-label", this.getString("Search Time Series Instances"))
29
+ .attr("aria-describedby", "tsi-search-desc")
30
+ .attr("role", "combobox")
31
+ .attr("aria-owns", "tsi-search-results")
32
+ .attr("aria-expanded", "false")
33
+ .attr("aria-haspopup", "listbox")
34
+ .attr("placeholder", this.getString("Search Time Series Instances") + "...");
35
+ var clear = inputWrapper
36
+ .append("div")
37
+ .attr("class", "tsi-clear")
38
+ .attr("tabindex", "0")
39
+ .attr("role", "button")
40
+ .attr("aria-label", "Clear Search")
41
+ .on("click keydown", function (event) {
42
+ if (Utils.isKeyDownAndNotEnter(event)) {
43
+ return;
44
+ }
45
+ input.node().value = "";
46
+ noSuggest = true;
47
+ input.dispatch("input");
48
+ self.ap.close();
49
+ d3.select(this).classed("tsi-shown", false);
50
+ });
51
+ inputWrapper
52
+ .append("span")
53
+ .attr("id", "tsi-search-desc")
54
+ .style("display", "none")
55
+ .text(this.getString("Search suggestion instruction"));
56
+ inputWrapper
57
+ .append("div")
58
+ .attr("class", "tsi-search-results-info")
59
+ .attr("aria-live", "assertive");
60
+ var Awesomplete = window.Awesomplete;
61
+ this.ap = new Awesomplete(input.node(), { minChars: 1 });
62
+ var noSuggest = false;
63
+ var justAwesompleted = false;
64
+ input.node().addEventListener("awesomplete-selectcomplete", function (event) {
65
+ noSuggest = true;
66
+ input.dispatch("input");
67
+ _this.ap.close();
68
+ justAwesompleted = true;
69
+ });
70
+ input.on("keydown", function (event) {
71
+ _this.chartOptions.onKeydown(event, _this.ap);
72
+ });
73
+ input.node().addEventListener("keyup", function (event) {
74
+ if (justAwesompleted) {
75
+ justAwesompleted = false;
76
+ return;
77
+ }
78
+ var key = event.which || event.keyCode;
79
+ if (key === 13) {
80
+ noSuggest = true;
81
+ input.dispatch("input");
82
+ }
83
+ });
84
+ var searchText;
85
+ var self = this;
86
+ input.on("input", function (event) {
87
+ searchText = this.value;
88
+ if (searchText.replace(/ /g, "") && !noSuggest) ;
89
+ else {
90
+ self.ap.close();
91
+ }
92
+ self.chartOptions.onInput(searchText, noSuggest ? { which: 13 } : event);
93
+ noSuggest = false;
94
+ clear.classed("tsi-shown", searchText.length);
95
+ });
96
+ };
97
+ return ModelAutocomplete;
98
+ }(Component));
99
+
100
+ export { ModelAutocomplete as M };
@@ -0,0 +1,12 @@
1
+ import { C as Component } from './Component-Rp30sSAW.js';
2
+ import './Enums-ChUuTtHV.js';
3
+ import './Interfaces-BKRQ685G.js';
4
+
5
+ declare class ModelAutocomplete extends Component {
6
+ chartOptions: any;
7
+ ap: any;
8
+ constructor(renderTarget: Element);
9
+ render(environmentFqdn: string, getToken: any, chartOptions: any): void;
10
+ }
11
+
12
+ export { ModelAutocomplete as default };
@@ -0,0 +1,7 @@
1
+ export { M as default } from './ModelAutocomplete-TRD16egq.js';
2
+ import './_tslib-5_9pMg1F.js';
3
+ import 'd3';
4
+ import 'awesomplete';
5
+ import './Component-CofgyEw0.js';
6
+ import './Utils-C_j8IgZh.js';
7
+ import 'moment-timezone';
@@ -0,0 +1,189 @@
1
+ import { _ as __extends, a as __assign } from './_tslib-5_9pMg1F.js';
2
+ import * as d3 from 'd3';
3
+ import { U as Utils } from './Utils-C_j8IgZh.js';
4
+ import { C as Component } from './Component-CofgyEw0.js';
5
+ import 'awesomplete';
6
+ import { H as Hierarchy } from './Hierarchy-QkWLHkxo.js';
7
+ import { M as ModelAutocomplete } from './ModelAutocomplete-TRD16egq.js';
8
+
9
+ var ModelSearch = /** @class */ (function (_super) {
10
+ __extends(ModelSearch, _super);
11
+ function ModelSearch(renderTarget) {
12
+ var _this = _super.call(this, renderTarget) || this;
13
+ _this.usedContinuationTokens = {};
14
+ _this.currentResultIndex = -1;
15
+ _this.stripHits = function (str) {
16
+ return str
17
+ .split("<hit>")
18
+ .map(function (h) {
19
+ return h
20
+ .split("</hit>")
21
+ .map(function (h2) { return Utils.strip(h2); })
22
+ .join("</hit>");
23
+ })
24
+ .join("<hit>");
25
+ };
26
+ d3.select("html").on("click." + Utils.guid(), function (event) {
27
+ if (_this.clickedInstance &&
28
+ event.target != _this.clickedInstance &&
29
+ _this.contextMenu) {
30
+ _this.closeContextMenu();
31
+ _this.clickedInstance = null;
32
+ }
33
+ });
34
+ return _this;
35
+ }
36
+ ModelSearch.prototype.ModelSearch = function () { };
37
+ ModelSearch.prototype.render = function (environmentFqdn, getToken, hierarchyData, chartOptions) {
38
+ var _this = this;
39
+ this.chartOptions.setOptions(chartOptions);
40
+ var self = this;
41
+ var continuationToken, searchText;
42
+ var targetElement = d3.select(this.renderTarget);
43
+ targetElement.html("");
44
+ this.wrapper = targetElement
45
+ .append("div")
46
+ .attr("class", "tsi-modelSearchWrapper");
47
+ _super.prototype.themify.call(this, this.wrapper, this.chartOptions.theme);
48
+ var inputWrapper = this.wrapper
49
+ .append("div")
50
+ .attr("class", "tsi-modelSearchInputWrapper");
51
+ var autocompleteOnInput = function (st, event) {
52
+ self.usedContinuationTokens = {};
53
+ // blow results away if no text
54
+ if (st.length === 0) {
55
+ searchText = st;
56
+ self.instanceResults.html("");
57
+ self.currentResultIndex = -1;
58
+ hierarchyElement.node().style.display = "block";
59
+ showMore.node().style.display = "none";
60
+ noResults.style("display", "none");
61
+ }
62
+ else if (event.which === 13 || event.keyCode === 13) {
63
+ hierarchyElement.node().style.display = "none";
64
+ self.instanceResults.html("");
65
+ self.currentResultIndex = -1;
66
+ noResults.style("display", "none");
67
+ searchInstances();
68
+ searchText = st;
69
+ }
70
+ };
71
+ var modelAutocomplete = new ModelAutocomplete(inputWrapper.node());
72
+ modelAutocomplete.render(environmentFqdn, getToken, __assign({ onInput: autocompleteOnInput, onKeydown: function (event, ap) {
73
+ _this.handleKeydown(event, ap);
74
+ } }, chartOptions));
75
+ modelAutocomplete.ap;
76
+ var results = this.wrapper
77
+ .append("div")
78
+ .attr("class", "tsi-modelSearchResults")
79
+ .on("scroll", function () {
80
+ self.closeContextMenu();
81
+ var that = this;
82
+ if (that.scrollTop + that.clientHeight + 150 >
83
+ self.instanceResults.node().clientHeight &&
84
+ searchText.length !== 0) {
85
+ searchInstances(searchText, continuationToken);
86
+ }
87
+ });
88
+ var noResults = results
89
+ .append("div")
90
+ .text(this.getString("No results"))
91
+ .classed("tsi-noResults", true)
92
+ .style("display", "none");
93
+ var instanceResultsWrapper = results
94
+ .append("div")
95
+ .attr("class", "tsi-modelSearchInstancesWrapper");
96
+ this.instanceResults = instanceResultsWrapper
97
+ .append("div")
98
+ .attr("class", "tsi-modelSearchInstances");
99
+ var showMore = instanceResultsWrapper
100
+ .append("div")
101
+ .attr("class", "tsi-showMore")
102
+ .text(this.getString("Show more") + "...")
103
+ .on("click", function () { return searchInstances(searchText, continuationToken); })
104
+ .style("display", "none");
105
+ var hierarchyElement = this.wrapper
106
+ .append("div")
107
+ .attr("class", "tsi-hierarchyWrapper");
108
+ var hierarchy = new Hierarchy(hierarchyElement.node());
109
+ hierarchy.render(hierarchyData, __assign(__assign({}, this.chartOptions), { withContextMenu: true }));
110
+ var searchInstances = function (searchText, ct) {
111
+ if (ct === void 0) { ct = null; }
112
+ var self = _this;
113
+ if (ct === "END")
114
+ return;
115
+ if (ct === null || !self.usedContinuationTokens[ct]) {
116
+ self.usedContinuationTokens[ct] = true;
117
+ }
118
+ };
119
+ getToken().then(function (token) {
120
+ });
121
+ // get types
122
+ getToken().then(function (token) {
123
+ });
124
+ };
125
+ ModelSearch.prototype.handleKeydown = function (event, ap) {
126
+ if (!ap.isOpened) {
127
+ var results = this.instanceResults.selectAll(".tsi-modelResultWrapper");
128
+ if (results.size()) {
129
+ if (event.keyCode === 40 &&
130
+ this.currentResultIndex < results.nodes().length - 1) {
131
+ this.currentResultIndex++;
132
+ results.nodes()[this.currentResultIndex].focus();
133
+ }
134
+ else if (event.keyCode === 38) {
135
+ this.currentResultIndex--;
136
+ if (this.currentResultIndex <= -1) {
137
+ this.currentResultIndex = -1;
138
+ ap.input.focus();
139
+ }
140
+ else {
141
+ results.nodes()[this.currentResultIndex].focus();
142
+ }
143
+ }
144
+ }
145
+ }
146
+ };
147
+ ModelSearch.prototype.closeContextMenu = function () {
148
+ if (this.contextMenu) {
149
+ this.contextMenu.remove();
150
+ }
151
+ d3.selectAll(".tsi-resultSelected").classed("tsi-resultSelected", false);
152
+ };
153
+ ModelSearch.prototype.getInstanceHtml = function (i) {
154
+ var _this = this;
155
+ return "<div class=\"tsi-modelResult\">\n <div class=\"tsi-modelPK\">\n ".concat(i.highlights.name
156
+ ? this.stripHits(i.highlights.name)
157
+ : this.stripHits(i.highlights.timeSeriesIds
158
+ ? i.highlights.timeSeriesIds.join(" ")
159
+ : i.highlights.timeSeriesId.join(" ")), "\n </div>\n <div class=\"tsi-modelHighlights\">\n ").concat(this.stripHits(i.highlights.description &&
160
+ i.highlights.description.length
161
+ ? i.highlights.description
162
+ : this.getString("No description")), "\n <br/><table>\n ").concat(i.highlights.name
163
+ ? "<tr><td>" +
164
+ this.getString("Time Series ID") +
165
+ "</td><td>" +
166
+ this.stripHits(i.highlights.timeSeriesIds
167
+ ? i.highlights.timeSeriesIds.join(" ")
168
+ : i.highlights.timeSeriesId.join(" ")) +
169
+ "</td></tr>"
170
+ : "", " \n ").concat(i.highlights.instanceFieldNames
171
+ .map(function (ifn, idx) {
172
+ var val = i.highlights.instanceFieldValues[idx];
173
+ if (ifn.indexOf("<hit>") !== -1 ||
174
+ val.indexOf("<hit>") !== -1) {
175
+ return val.length === 0
176
+ ? ""
177
+ : "<tr><td>" +
178
+ _this.stripHits(ifn) +
179
+ "</td><td>" +
180
+ _this.stripHits(val) +
181
+ "</tr>";
182
+ }
183
+ })
184
+ .join(""), "\n </table>\n </div>\n </div>");
185
+ };
186
+ return ModelSearch;
187
+ }(Component));
188
+
189
+ export { ModelSearch as M };
@@ -0,0 +1,23 @@
1
+ import { C as Component } from './Component-Rp30sSAW.js';
2
+ import './Enums-ChUuTtHV.js';
3
+ import './Interfaces-BKRQ685G.js';
4
+
5
+ declare class ModelSearch extends Component {
6
+ private hierarchies;
7
+ private clickedInstance;
8
+ private wrapper;
9
+ private types;
10
+ private instanceResults;
11
+ private usedContinuationTokens;
12
+ private contextMenu;
13
+ private currentResultIndex;
14
+ constructor(renderTarget: Element);
15
+ ModelSearch(): void;
16
+ render(environmentFqdn: string, getToken: any, hierarchyData: any, chartOptions: any): void;
17
+ handleKeydown(event: any, ap: any): void;
18
+ private closeContextMenu;
19
+ private stripHits;
20
+ private getInstanceHtml;
21
+ }
22
+
23
+ export { ModelSearch as default };
@@ -0,0 +1,9 @@
1
+ export { M as default } from './ModelSearch-WEa7Ud20.js';
2
+ import './_tslib-5_9pMg1F.js';
3
+ import 'd3';
4
+ import './Utils-C_j8IgZh.js';
5
+ import 'moment-timezone';
6
+ import './Component-CofgyEw0.js';
7
+ import 'awesomplete';
8
+ import './Hierarchy-QkWLHkxo.js';
9
+ import './ModelAutocomplete-TRD16egq.js';