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.
- package/LICENSE +22 -0
- package/README.MD +189 -0
- package/dist/AggregateExpression.d.ts +13 -0
- package/dist/AggregateExpression.js +70 -0
- package/dist/AvailabilityChart-i_efwXCX.js +488 -0
- package/dist/AvailabilityChart.d.ts +59 -0
- package/dist/AvailabilityChart.js +26 -0
- package/dist/ChartComponent-DTcc6aED.d.ts +80 -0
- package/dist/ChartComponent-DnKLTxWe.js +302 -0
- package/dist/ChartComponentData-D5wuQmmZ.d.ts +47 -0
- package/dist/ChartDataOptions-DBS28b1-.d.ts +38 -0
- package/dist/ChartDataOptions-DRd8NHra.js +49 -0
- package/dist/ChartVisualizationComponent-CG7e5xlc.js +23 -0
- package/dist/ChartVisualizationComponent-DBjiqR1n.d.ts +8 -0
- package/dist/ColorPicker-CH__K8xm.js +120 -0
- package/dist/ColorPicker.d.ts +28 -0
- package/dist/ColorPicker.js +6 -0
- package/dist/Component-CofgyEw0.js +401 -0
- package/dist/Component-Rp30sSAW.d.ts +226 -0
- package/dist/ContextMenu-DABSkTA2.js +197 -0
- package/dist/DateTimeButton-CMcCxc8x.d.ts +16 -0
- package/dist/DateTimeButton-Ca1487GR.js +38 -0
- package/dist/DateTimeButtonRange-DpgfhHQt.js +71 -0
- package/dist/DateTimeButtonRange.d.ts +19 -0
- package/dist/DateTimeButtonRange.js +15 -0
- package/dist/DateTimeButtonSingle-C6cTx5VO.js +48 -0
- package/dist/DateTimeButtonSingle.d.ts +17 -0
- package/dist/DateTimeButtonSingle.js +14 -0
- package/dist/DateTimePicker-BH6qiVfQ.js +532 -0
- package/dist/DateTimePicker.d.ts +69 -0
- package/dist/DateTimePicker.js +13 -0
- package/dist/EllipsisMenu-30FNqoIv.js +116 -0
- package/dist/EllipsisMenu.d.ts +20 -0
- package/dist/EllipsisMenu.js +6 -0
- package/dist/Enums-ChUuTtHV.d.ts +12 -0
- package/dist/EventsTable-a0XLbsMF.js +553 -0
- package/dist/EventsTable.d.ts +34 -0
- package/dist/EventsTable.js +10 -0
- package/dist/GeoProcessGraphic-AVAzyF7k.js +145 -0
- package/dist/GeoProcessGraphic.d.ts +34 -0
- package/dist/GeoProcessGraphic.js +7 -0
- package/dist/Grid-DfFAkeeV.js +874 -0
- package/dist/Grid.d.ts +43 -0
- package/dist/Grid.js +6 -0
- package/dist/GroupedBarChart-BspwM8r2.js +579 -0
- package/dist/GroupedBarChart.d.ts +22 -0
- package/dist/GroupedBarChart.js +17 -0
- package/dist/GroupedBarChartData-BRCyDxbA.js +121 -0
- package/dist/GroupedBarChartData-C0YQydrP.d.ts +20 -0
- package/dist/Heatmap-D8ET8Ue8.js +524 -0
- package/dist/Heatmap.d.ts +31 -0
- package/dist/Heatmap.js +14 -0
- package/dist/Hierarchy-QkWLHkxo.js +260 -0
- package/dist/Hierarchy.d.ts +39 -0
- package/dist/Hierarchy.js +6 -0
- package/dist/HierarchyNavigation-CR6YUilh.js +336 -0
- package/dist/HierarchyNavigation.d.ts +34 -0
- package/dist/HierarchyNavigation.js +6 -0
- package/dist/HistoryPlayback-BmA-54lT.d.ts +68 -0
- package/dist/HistoryPlayback-SjeQbAPq.js +175 -0
- package/dist/Interfaces-BKRQ685G.d.ts +6 -0
- package/dist/Legend-DlSXQXHF.js +497 -0
- package/dist/LineChart-CExEyjZa.js +3181 -0
- package/dist/LineChart.d.ts +163 -0
- package/dist/LineChart.js +18 -0
- package/dist/ModelAutocomplete-TRD16egq.js +100 -0
- package/dist/ModelAutocomplete.d.ts +12 -0
- package/dist/ModelAutocomplete.js +7 -0
- package/dist/ModelSearch-WEa7Ud20.js +189 -0
- package/dist/ModelSearch.d.ts +23 -0
- package/dist/ModelSearch.js +9 -0
- package/dist/PieChart-B1ZXk13Q.js +258 -0
- package/dist/PieChart.d.ts +26 -0
- package/dist/PieChart.js +17 -0
- package/dist/PlaybackControls-Dwt6dif9.js +195 -0
- package/dist/PlaybackControls.d.ts +39 -0
- package/dist/PlaybackControls.js +13 -0
- package/dist/ProcessGraphic-CixT-zZl.js +154 -0
- package/dist/ProcessGraphic.d.ts +31 -0
- package/dist/ProcessGraphic.js +7 -0
- package/dist/README.MD +189 -0
- package/dist/ScatterPlot-DrPoHNDJ.js +924 -0
- package/dist/ScatterPlot.d.ts +115 -0
- package/dist/ScatterPlot.js +17 -0
- package/dist/SingleDateTimePicker-7anflEq8.js +213 -0
- package/dist/SingleDateTimePicker.d.ts +45 -0
- package/dist/SingleDateTimePicker.js +12 -0
- package/dist/Slider-BtSdC4fj.js +186 -0
- package/dist/Slider.d.ts +31 -0
- package/dist/Slider.js +6 -0
- package/dist/TemporalXAxisComponent-CyiM5EH0.d.ts +23 -0
- package/dist/TemporalXAxisComponent-DkyVvASs.js +129 -0
- package/dist/TimezonePicker-ClfP1lBL.js +58 -0
- package/dist/TimezonePicker.d.ts +16 -0
- package/dist/TimezonePicker.js +10 -0
- package/dist/Tooltip-Fa-0Xekn.js +104 -0
- package/dist/TsqExpression.d.ts +36 -0
- package/dist/TsqExpression.js +89 -0
- package/dist/UXClient-DydSPZwM.js +230 -0
- package/dist/UXClient.d.ts +74 -0
- package/dist/UXClient.js +47 -0
- package/dist/Utils-BsPLzJBC.d.ts +104 -0
- package/dist/Utils-C_j8IgZh.js +1138 -0
- package/dist/Utils.d.ts +7 -0
- package/dist/Utils.js +7 -0
- package/dist/_tslib-5_9pMg1F.js +96 -0
- package/dist/package.json +106 -0
- package/dist/pikaday-DMSzaLH6.js +1252 -0
- package/dist/tsiclient.cjs.js +3 -0
- package/dist/tsiclient.cjs.js.LICENSE.txt +19 -0
- package/dist/tsiclient.cjs.js.map +1 -0
- package/dist/tsiclient.css +17323 -0
- package/dist/tsiclient.d.ts +46 -0
- package/dist/tsiclient.esm.js +3 -0
- package/dist/tsiclient.esm.js.LICENSE.txt +19 -0
- package/dist/tsiclient.esm.js.map +1 -0
- package/dist/tsiclient.js +58 -0
- package/dist/tsiclient.min.css +6 -0
- package/dist/tsiclient.min.css.map +1 -0
- package/dist/tsiclient.umd.js +3 -0
- package/dist/tsiclient.umd.js.LICENSE.txt +19 -0
- package/dist/tsiclient.umd.js.map +1 -0
- package/dist/tsiclient.umd.min.js +3 -0
- package/dist/tsiclient.umd.min.js.LICENSE.txt +19 -0
- package/dist/tsiclient.umd.min.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { _ as __extends } from './_tslib-5_9pMg1F.js';
|
|
2
|
+
import * as d3 from 'd3';
|
|
3
|
+
import { C as Component } from './Component-CofgyEw0.js';
|
|
4
|
+
|
|
5
|
+
var ACTIONELEMENTHEIGHT = 28;
|
|
6
|
+
var ACTIONELEMENTMAXWIDTH = 200;
|
|
7
|
+
var ACTIONELEMENTCONTAINERMAXHEIGHT = 200;
|
|
8
|
+
var VERTICALPADDING = 4;
|
|
9
|
+
var ContextMenu = /** @class */ (function (_super) {
|
|
10
|
+
__extends(ContextMenu, _super);
|
|
11
|
+
function ContextMenu(drawChart, renderTarget) {
|
|
12
|
+
var _this = _super.call(this, renderTarget) || this;
|
|
13
|
+
_this.contextMenuVisible = false;
|
|
14
|
+
_this.drawChart = drawChart;
|
|
15
|
+
_this.contextMenuElement = d3.select(renderTarget).insert("div", ":first-child")
|
|
16
|
+
.attr("class", "tsi-contextMenu")
|
|
17
|
+
.style("left", "0px")
|
|
18
|
+
.style("top", "0px");
|
|
19
|
+
return _this;
|
|
20
|
+
}
|
|
21
|
+
ContextMenu.prototype.launchSubMenu = function (parent, subMenuActions, subLevel, top) {
|
|
22
|
+
var container = this.contextMenuElement
|
|
23
|
+
.selectAll(".tsi-actionElementContainer".concat(subLevel))
|
|
24
|
+
.data([{ subLevel: subLevel }]);
|
|
25
|
+
var enteredContainer = container.enter()
|
|
26
|
+
.append('div')
|
|
27
|
+
.attr("class", function (d) { return "tsi-actionElementContainer tsi-actionElementContainer".concat(d.subLevel); })
|
|
28
|
+
.merge(container)
|
|
29
|
+
.style('max-height', "".concat(ACTIONELEMENTCONTAINERMAXHEIGHT, "px"))
|
|
30
|
+
.style('display', 'block');
|
|
31
|
+
this.createActionElements(enteredContainer, subMenuActions, subLevel);
|
|
32
|
+
this.positionAEC(enteredContainer, subMenuActions.length, top, subLevel);
|
|
33
|
+
container.exit().remove();
|
|
34
|
+
};
|
|
35
|
+
ContextMenu.prototype.positionAEC = function (container, subMenuActionsCount, top, subLevel) {
|
|
36
|
+
this.verticalPositionAEC(container, top, subMenuActionsCount, subLevel);
|
|
37
|
+
this.horizontalPositionAEC(container, subLevel);
|
|
38
|
+
};
|
|
39
|
+
ContextMenu.prototype.shouldHorizontalFlip = function (rawLeft) {
|
|
40
|
+
var containerLeft = rawLeft + this.left;
|
|
41
|
+
var totalWidth = d3.select(this.renderTarget).node().getBoundingClientRect().width;
|
|
42
|
+
return ((containerLeft + ACTIONELEMENTMAXWIDTH) > totalWidth);
|
|
43
|
+
};
|
|
44
|
+
ContextMenu.prototype.shouldVerticalFlip = function (rawTop, elementCount) {
|
|
45
|
+
var containerTop = rawTop + this.top;
|
|
46
|
+
var totalHeight = d3.select(this.renderTarget).node().getBoundingClientRect().height;
|
|
47
|
+
var heightOfElements = Math.min(elementCount * ACTIONELEMENTHEIGHT + (VERTICALPADDING * 2), ACTIONELEMENTCONTAINERMAXHEIGHT);
|
|
48
|
+
return ((containerTop + heightOfElements) > totalHeight);
|
|
49
|
+
};
|
|
50
|
+
//determine position relative to the chart as a whole
|
|
51
|
+
ContextMenu.prototype.getRelativeHorizontalPosition = function (node, isLeft) {
|
|
52
|
+
if (isLeft === void 0) { isLeft = true; }
|
|
53
|
+
return node.getBoundingClientRect().x + (isLeft ? 0 : node.getBoundingClientRect().width) - this.renderTarget.getBoundingClientRect().x;
|
|
54
|
+
};
|
|
55
|
+
ContextMenu.prototype.verticalPositionAEC = function (actionElementContainer, rawTop, elementCount, subLevel) {
|
|
56
|
+
var totalHeight = this.contextMenuElement.node().getBoundingClientRect().height;
|
|
57
|
+
if (this.shouldVerticalFlip(rawTop, elementCount)) {
|
|
58
|
+
actionElementContainer.style('bottom', "".concat((totalHeight - rawTop) - (subLevel === 0 ? 0 : ACTIONELEMENTHEIGHT + VERTICALPADDING), "px"))
|
|
59
|
+
.style('top', null);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
actionElementContainer.style('top', "".concat(rawTop - VERTICALPADDING, "px"))
|
|
63
|
+
.style('bottom', null);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
ContextMenu.prototype.horizontalPositionAEC = function (actionElementContainer, subLevel) {
|
|
67
|
+
var leftPosition = 0;
|
|
68
|
+
var rightPosition = 0;
|
|
69
|
+
if (subLevel !== 0) {
|
|
70
|
+
var oneLevelUp = this.contextMenuElement.selectAll(".tsi-actionElementContainer".concat(subLevel - 1));
|
|
71
|
+
if (oneLevelUp.size()) {
|
|
72
|
+
rightPosition = this.getRelativeHorizontalPosition(oneLevelUp.nodes()[0], false) - this.left;
|
|
73
|
+
leftPosition = this.getRelativeHorizontalPosition(oneLevelUp.nodes()[0], true) - this.left;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (this.shouldHorizontalFlip(rightPosition)) {
|
|
77
|
+
actionElementContainer.style('left', null)
|
|
78
|
+
.style('right', "".concat(0 - leftPosition, "px"));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
actionElementContainer.style('left', "".concat(rightPosition, "px"))
|
|
82
|
+
.style('right', null);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
ContextMenu.prototype.getActionElementContainerTop = function (launchedFromActionNode) {
|
|
86
|
+
if (launchedFromActionNode === void 0) { launchedFromActionNode = null; }
|
|
87
|
+
if (launchedFromActionNode === null) {
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
return launchedFromActionNode.getBoundingClientRect().top -
|
|
91
|
+
this.contextMenuElement.node().getBoundingClientRect().top;
|
|
92
|
+
};
|
|
93
|
+
ContextMenu.prototype.removeSubMenusAboveLevel = function (level) {
|
|
94
|
+
d3.select(this.renderTarget).selectAll('.tsi-actionElementContainer').filter(function (subMenuD) {
|
|
95
|
+
return (subMenuD.subLevel > level);
|
|
96
|
+
}).remove();
|
|
97
|
+
};
|
|
98
|
+
ContextMenu.prototype.createActionElements = function (container, actions, subLevel) {
|
|
99
|
+
if (subLevel === void 0) { subLevel = 0; }
|
|
100
|
+
var self = this;
|
|
101
|
+
var actionElements = container.selectAll(".tsi-actionElement")
|
|
102
|
+
.data(actions.map(function (a) {
|
|
103
|
+
a.subLevel = subLevel;
|
|
104
|
+
return a;
|
|
105
|
+
}));
|
|
106
|
+
var actionElementsEntered = actionElements.enter()
|
|
107
|
+
.append("div")
|
|
108
|
+
.attr("class", "tsi-actionElement")
|
|
109
|
+
.classed('tsi-hasSubMenu', function (d) { return d.isNested; })
|
|
110
|
+
.merge(actionElements)
|
|
111
|
+
.text(function (d) { return d.name; })
|
|
112
|
+
.on('mouseenter', function (event, d) {
|
|
113
|
+
var e = actionElementsEntered.nodes();
|
|
114
|
+
var i = e.indexOf(event.currentTarget);
|
|
115
|
+
if (d.isNested) {
|
|
116
|
+
self.launchSubMenu(d3.select(this), d.subActions, subLevel + 1, self.getActionElementContainerTop(this));
|
|
117
|
+
self.subMenuFromActionIndex = i;
|
|
118
|
+
self.subMenuFromSubLevel = d.subLevel;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if ((d.subLevel === self.subMenuFromSubLevel && i !== self.subMenuFromActionIndex) || d.subLevel < self.subMenuFromSubLevel) {
|
|
122
|
+
self.removeSubMenusAboveLevel(d.subLevel);
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
.on("click", function (event, d) {
|
|
126
|
+
if (d.isNested) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (self.endTime) { // if endTime is present, this is a brush action
|
|
130
|
+
var startTime = self.startTime ? self.startTime.toISOString().slice(0, -5) + "Z" : null;
|
|
131
|
+
var endTime = self.endTime ? self.endTime.toISOString().slice(0, -5) + "Z" : null;
|
|
132
|
+
d.action(startTime, endTime);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
var timestamp = self.startTime ? self.startTime.toISOString().slice(0, -5) + "Z" : null;
|
|
136
|
+
d.action(self.ae, self.splitBy, timestamp, event);
|
|
137
|
+
}
|
|
138
|
+
self.hide();
|
|
139
|
+
if (self.onClick)
|
|
140
|
+
self.onClick();
|
|
141
|
+
});
|
|
142
|
+
actionElements.exit().remove();
|
|
143
|
+
};
|
|
144
|
+
ContextMenu.prototype.draw = function (chartComponentData, renderTarget, options, mousePosition, aggKey, splitBy, onClick, startTime, endTime, event) {
|
|
145
|
+
var _this = this;
|
|
146
|
+
if (onClick === void 0) { onClick = null; }
|
|
147
|
+
if (startTime === void 0) { startTime = null; }
|
|
148
|
+
if (endTime === void 0) { endTime = null; }
|
|
149
|
+
this.contextMenuVisible = true;
|
|
150
|
+
if (!endTime) {
|
|
151
|
+
this.actions = chartComponentData.displayState[aggKey].contextMenuActions;
|
|
152
|
+
this.ae = chartComponentData.displayState[aggKey].aggregateExpression;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.actions = options.brushContextMenuActions;
|
|
156
|
+
}
|
|
157
|
+
this.splitBy = splitBy;
|
|
158
|
+
this.startTime = startTime;
|
|
159
|
+
this.endTime = endTime;
|
|
160
|
+
this.onClick = onClick;
|
|
161
|
+
_super.prototype.themify.call(this, this.contextMenuElement, options.theme);
|
|
162
|
+
this.left = mousePosition[0];
|
|
163
|
+
this.top = mousePosition[1];
|
|
164
|
+
this.contextMenuElement
|
|
165
|
+
.style('left', this.left + 'px')
|
|
166
|
+
.style('top', this.top + 'px');
|
|
167
|
+
this.contextMenuElement.selectAll('*').remove();
|
|
168
|
+
this.contextMenuElement.style("display", "block")
|
|
169
|
+
.on('mouseleave', function () {
|
|
170
|
+
_this.removeSubMenusAboveLevel(0);
|
|
171
|
+
});
|
|
172
|
+
var actionContainer = this.contextMenuElement
|
|
173
|
+
.selectAll('.tsi-actionElementContainer0')
|
|
174
|
+
.data([{ subLevel: 0 }]);
|
|
175
|
+
var actionContainerEntered = actionContainer.enter()
|
|
176
|
+
.append('div')
|
|
177
|
+
.attr('class', 'tsi-actionElementContainer tsi-actionElementContainer0');
|
|
178
|
+
this.createActionElements(actionContainerEntered, this.actions);
|
|
179
|
+
this.positionAEC(actionContainerEntered, this.actions.length, 0, 0);
|
|
180
|
+
var self = this;
|
|
181
|
+
d3.select(this.renderTarget).on("click", function (event) {
|
|
182
|
+
if (!d3.select(event.srcElement).classed('tsi-actionElement')) {
|
|
183
|
+
if (onClick) {
|
|
184
|
+
onClick();
|
|
185
|
+
}
|
|
186
|
+
self.hide();
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
ContextMenu.prototype.hide = function () {
|
|
191
|
+
this.contextMenuElement.style("display", "none");
|
|
192
|
+
this.contextMenuVisible = false;
|
|
193
|
+
};
|
|
194
|
+
return ContextMenu;
|
|
195
|
+
}(Component));
|
|
196
|
+
|
|
197
|
+
export { ContextMenu as C };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { C as ChartComponent } from './ChartComponent-DTcc6aED.js';
|
|
2
|
+
|
|
3
|
+
declare class DateTimeButton extends ChartComponent {
|
|
4
|
+
protected dateTimePicker: any;
|
|
5
|
+
private pickerIsVisible;
|
|
6
|
+
protected minMillis: number;
|
|
7
|
+
protected maxMillis: number;
|
|
8
|
+
protected onSet: any;
|
|
9
|
+
protected dateTimeButton: any;
|
|
10
|
+
protected dateTimePickerContainer: any;
|
|
11
|
+
constructor(renderTarget: Element);
|
|
12
|
+
protected buttonDateTimeFormat(millis: any): string;
|
|
13
|
+
render(chartOptions: any, minMillis: any, maxMillis: any, onSet?: any): void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { DateTimeButton as D };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { _ as __extends } 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 ChartComponent } from './ChartComponent-DnKLTxWe.js';
|
|
5
|
+
|
|
6
|
+
var DateTimeButton = /** @class */ (function (_super) {
|
|
7
|
+
__extends(DateTimeButton, _super);
|
|
8
|
+
function DateTimeButton(renderTarget) {
|
|
9
|
+
var _this = _super.call(this, renderTarget) || this;
|
|
10
|
+
_this.pickerIsVisible = false;
|
|
11
|
+
return _this;
|
|
12
|
+
}
|
|
13
|
+
DateTimeButton.prototype.buttonDateTimeFormat = function (millis) {
|
|
14
|
+
return Utils.timeFormat(!this.chartOptions.minutesForTimeLabels, !this.chartOptions.minutesForTimeLabels, this.chartOptions.offset, this.chartOptions.is24HourTime, 0, null, this.chartOptions.dateLocale)(millis);
|
|
15
|
+
};
|
|
16
|
+
DateTimeButton.prototype.render = function (chartOptions, minMillis, maxMillis, onSet) {
|
|
17
|
+
if (onSet === void 0) { onSet = null; }
|
|
18
|
+
this.chartOptions.setOptions(chartOptions);
|
|
19
|
+
this.minMillis = minMillis;
|
|
20
|
+
this.maxMillis = maxMillis;
|
|
21
|
+
this.onSet = onSet ? onSet : function () { };
|
|
22
|
+
var dateTimeContainer = d3.select(this.renderTarget);
|
|
23
|
+
if (!this.dateTimeButton) {
|
|
24
|
+
this.dateTimeButton = dateTimeContainer.append("button")
|
|
25
|
+
.classed('tsi-dateTimeButton', true);
|
|
26
|
+
}
|
|
27
|
+
if (!this.dateTimePickerContainer) {
|
|
28
|
+
this.dateTimePickerContainer = dateTimeContainer.append('div').classed('tsi-dateTimePickerContainer', true)
|
|
29
|
+
.attr('role', 'dialog')
|
|
30
|
+
.attr('aria-label', this.getString('a time selection control dialog'));
|
|
31
|
+
this.dateTimePickerContainer.style('display', 'none');
|
|
32
|
+
}
|
|
33
|
+
_super.prototype.themify.call(this, d3.select(this.renderTarget), this.chartOptions.theme);
|
|
34
|
+
};
|
|
35
|
+
return DateTimeButton;
|
|
36
|
+
}(ChartComponent));
|
|
37
|
+
|
|
38
|
+
export { DateTimeButton as D };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { _ as __extends } from './_tslib-5_9pMg1F.js';
|
|
2
|
+
import * as d3 from 'd3';
|
|
3
|
+
import { D as DateTimeButton } from './DateTimeButton-Ca1487GR.js';
|
|
4
|
+
import { D as DateTimePicker } from './DateTimePicker-BH6qiVfQ.js';
|
|
5
|
+
import { U as Utils } from './Utils-C_j8IgZh.js';
|
|
6
|
+
|
|
7
|
+
var DateTimeButtonRange = /** @class */ (function (_super) {
|
|
8
|
+
__extends(DateTimeButtonRange, _super);
|
|
9
|
+
function DateTimeButtonRange(renderTarget) {
|
|
10
|
+
return _super.call(this, renderTarget) || this;
|
|
11
|
+
}
|
|
12
|
+
DateTimeButtonRange.prototype.setButtonText = function (fromMillis, toMillis, isRelative, quickTime) {
|
|
13
|
+
var fromString = this.buttonDateTimeFormat(fromMillis);
|
|
14
|
+
var tzAbbr = Utils.createTimezoneAbbreviation(this.chartOptions.offset);
|
|
15
|
+
var toString = this.buttonDateTimeFormat(toMillis) + ' (' + tzAbbr + ')';
|
|
16
|
+
if (!isRelative) {
|
|
17
|
+
this.dateTimeButton.text("".concat(fromString, " - ").concat(toString));
|
|
18
|
+
this.dateTimeButton.attr('aria-label', "".concat(this.getString('a button to launch a time selection dialog current selected time is '), " ").concat(fromString, " - ").concat(toString));
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
var quickTimeText = this.dateTimePicker.getQuickTimeText(quickTime);
|
|
22
|
+
var text = quickTimeText !== null ? "".concat(quickTimeText, " (").concat(fromString, " - ").concat(toString, ")") : "".concat(fromString, " - ").concat(this.getString('Latest'), " (").concat(toString, ")");
|
|
23
|
+
this.dateTimeButton.text(text);
|
|
24
|
+
this.dateTimeButton.attr('aria-label', "".concat(this.getString('a button to launch a time selection dialog current selected time is '), " ").concat(text));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
DateTimeButtonRange.prototype.onClose = function () {
|
|
28
|
+
this.dateTimePickerContainer.style("display", "none");
|
|
29
|
+
this.dateTimeButton.node().focus();
|
|
30
|
+
};
|
|
31
|
+
DateTimeButtonRange.prototype.render = function (chartOptions, minMillis, maxMillis, fromMillis, toMillis, onSet, onCancel) {
|
|
32
|
+
var _this = this;
|
|
33
|
+
if (chartOptions === void 0) { chartOptions = {}; }
|
|
34
|
+
if (fromMillis === void 0) { fromMillis = null; }
|
|
35
|
+
if (toMillis === void 0) { toMillis = null; }
|
|
36
|
+
if (onSet === void 0) { onSet = null; }
|
|
37
|
+
if (onCancel === void 0) { onCancel = null; }
|
|
38
|
+
_super.prototype.render.call(this, chartOptions, minMillis, maxMillis, onSet);
|
|
39
|
+
d3.select(this.renderTarget).classed('tsi-dateTimeContainerRange', true);
|
|
40
|
+
this.fromMillis = fromMillis;
|
|
41
|
+
this.toMillis = toMillis;
|
|
42
|
+
this.onCancel = onCancel ? onCancel : function () { };
|
|
43
|
+
if (!this.dateTimePicker) {
|
|
44
|
+
this.dateTimePicker = new DateTimePicker(this.dateTimePickerContainer.node());
|
|
45
|
+
}
|
|
46
|
+
this.setButtonText(fromMillis, toMillis, toMillis === maxMillis, this.toMillis - this.fromMillis);
|
|
47
|
+
this.dateTimeButton.on("click", function () {
|
|
48
|
+
if (_this.dateTimePickerContainer.style("display") !== "none") {
|
|
49
|
+
_this.onClose(); // close if already open
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
_this.chartOptions.dTPIsModal = true;
|
|
53
|
+
_this.dateTimePickerContainer.style("display", "block");
|
|
54
|
+
_this.dateTimePicker.render(_this.chartOptions, minMillis, maxMillis, _this.fromMillis, _this.toMillis, function (fromMillis, toMillis, offset, isRelative, currentQuickTime) {
|
|
55
|
+
_this.chartOptions.offset = offset;
|
|
56
|
+
_this.fromMillis = fromMillis;
|
|
57
|
+
_this.toMillis = toMillis;
|
|
58
|
+
_this.setButtonText(fromMillis, toMillis, isRelative, currentQuickTime);
|
|
59
|
+
_this.onSet(fromMillis, toMillis, offset, isRelative, currentQuickTime);
|
|
60
|
+
_this.onClose();
|
|
61
|
+
}, function () {
|
|
62
|
+
_this.onClose();
|
|
63
|
+
_this.onCancel();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return DateTimeButtonRange;
|
|
69
|
+
}(DateTimeButton));
|
|
70
|
+
|
|
71
|
+
export { DateTimeButtonRange as D };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { D as DateTimeButton } from './DateTimeButton-CMcCxc8x.js';
|
|
2
|
+
import './ChartComponent-DTcc6aED.js';
|
|
3
|
+
import './Enums-ChUuTtHV.js';
|
|
4
|
+
import './Component-Rp30sSAW.js';
|
|
5
|
+
import './Interfaces-BKRQ685G.js';
|
|
6
|
+
import './ChartComponentData-D5wuQmmZ.js';
|
|
7
|
+
import './EllipsisMenu.js';
|
|
8
|
+
|
|
9
|
+
declare class DateTimeButtonRange extends DateTimeButton {
|
|
10
|
+
private onCancel;
|
|
11
|
+
private fromMillis;
|
|
12
|
+
private toMillis;
|
|
13
|
+
constructor(renderTarget: Element);
|
|
14
|
+
private setButtonText;
|
|
15
|
+
private onClose;
|
|
16
|
+
render(chartOptions: any, minMillis: number, maxMillis: number, fromMillis?: number, toMillis?: number, onSet?: any, onCancel?: any): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { DateTimeButtonRange as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { D as default } from './DateTimeButtonRange-DpgfhHQt.js';
|
|
2
|
+
import './_tslib-5_9pMg1F.js';
|
|
3
|
+
import 'd3';
|
|
4
|
+
import './DateTimeButton-Ca1487GR.js';
|
|
5
|
+
import './Utils-C_j8IgZh.js';
|
|
6
|
+
import 'moment-timezone';
|
|
7
|
+
import './ChartComponent-DnKLTxWe.js';
|
|
8
|
+
import './Component-CofgyEw0.js';
|
|
9
|
+
import './Grid-DfFAkeeV.js';
|
|
10
|
+
import 'split.js';
|
|
11
|
+
import './EllipsisMenu-30FNqoIv.js';
|
|
12
|
+
import './DateTimePicker-BH6qiVfQ.js';
|
|
13
|
+
import './pikaday-DMSzaLH6.js';
|
|
14
|
+
import 'moment';
|
|
15
|
+
import './TimezonePicker-ClfP1lBL.js';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { _ as __extends } from './_tslib-5_9pMg1F.js';
|
|
2
|
+
import * as d3 from 'd3';
|
|
3
|
+
import { D as DateTimeButton } from './DateTimeButton-Ca1487GR.js';
|
|
4
|
+
import { S as SingleDateTimePicker } from './SingleDateTimePicker-7anflEq8.js';
|
|
5
|
+
|
|
6
|
+
var DateTimeButtonSingle = /** @class */ (function (_super) {
|
|
7
|
+
__extends(DateTimeButtonSingle, _super);
|
|
8
|
+
function DateTimeButtonSingle(renderTarget) {
|
|
9
|
+
var _this = _super.call(this, renderTarget) || this;
|
|
10
|
+
_this.sDTPOnSet = function (millis) {
|
|
11
|
+
if (millis === void 0) { millis = null; }
|
|
12
|
+
if (millis !== null) {
|
|
13
|
+
_this.dateTimeButton.text(_this.buttonDateTimeFormat(millis));
|
|
14
|
+
_this.selectedMillis = millis;
|
|
15
|
+
_this.onSet(millis);
|
|
16
|
+
}
|
|
17
|
+
_this.closeSDTP();
|
|
18
|
+
};
|
|
19
|
+
return _this;
|
|
20
|
+
}
|
|
21
|
+
DateTimeButtonSingle.prototype.closeSDTP = function () {
|
|
22
|
+
this.dateTimePickerContainer.style("display", "none");
|
|
23
|
+
this.dateTimeButton.node().focus();
|
|
24
|
+
};
|
|
25
|
+
DateTimeButtonSingle.prototype.render = function (chartOptions, minMillis, maxMillis, selectedMillis, onSet) {
|
|
26
|
+
var _this = this;
|
|
27
|
+
if (chartOptions === void 0) { chartOptions = {}; }
|
|
28
|
+
if (selectedMillis === void 0) { selectedMillis = null; }
|
|
29
|
+
if (onSet === void 0) { onSet = null; }
|
|
30
|
+
_super.prototype.render.call(this, chartOptions, minMillis, maxMillis, onSet);
|
|
31
|
+
this.selectedMillis = selectedMillis;
|
|
32
|
+
d3.select(this.renderTarget).classed('tsi-dateTimeContainerSingle', true);
|
|
33
|
+
this.dateTimeButton.text(this.buttonDateTimeFormat(selectedMillis));
|
|
34
|
+
if (!this.dateTimePicker) {
|
|
35
|
+
this.dateTimePicker = new SingleDateTimePicker(this.dateTimePickerContainer.node());
|
|
36
|
+
}
|
|
37
|
+
var targetElement = d3.select(this.renderTarget);
|
|
38
|
+
(targetElement.select(".tsi-dateTimePickerContainer")).selectAll("*");
|
|
39
|
+
this.dateTimeButton.on("click", function () {
|
|
40
|
+
_this.chartOptions.dTPIsModal = true;
|
|
41
|
+
_this.dateTimePickerContainer.style("display", "block");
|
|
42
|
+
_this.dateTimePicker.render(_this.chartOptions, _this.minMillis, _this.maxMillis, _this.selectedMillis, _this.sDTPOnSet);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
return DateTimeButtonSingle;
|
|
46
|
+
}(DateTimeButton));
|
|
47
|
+
|
|
48
|
+
export { DateTimeButtonSingle as D };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { D as DateTimeButton } from './DateTimeButton-CMcCxc8x.js';
|
|
2
|
+
import './ChartComponent-DTcc6aED.js';
|
|
3
|
+
import './Enums-ChUuTtHV.js';
|
|
4
|
+
import './Component-Rp30sSAW.js';
|
|
5
|
+
import './Interfaces-BKRQ685G.js';
|
|
6
|
+
import './ChartComponentData-D5wuQmmZ.js';
|
|
7
|
+
import './EllipsisMenu.js';
|
|
8
|
+
|
|
9
|
+
declare class DateTimeButtonSingle extends DateTimeButton {
|
|
10
|
+
private selectedMillis;
|
|
11
|
+
constructor(renderTarget: Element);
|
|
12
|
+
private closeSDTP;
|
|
13
|
+
private sDTPOnSet;
|
|
14
|
+
render(chartOptions: any, minMillis: number, maxMillis: number, selectedMillis?: number, onSet?: any): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { DateTimeButtonSingle as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { D as default } from './DateTimeButtonSingle-C6cTx5VO.js';
|
|
2
|
+
import './_tslib-5_9pMg1F.js';
|
|
3
|
+
import 'd3';
|
|
4
|
+
import './DateTimeButton-Ca1487GR.js';
|
|
5
|
+
import './Utils-C_j8IgZh.js';
|
|
6
|
+
import 'moment-timezone';
|
|
7
|
+
import './ChartComponent-DnKLTxWe.js';
|
|
8
|
+
import './Component-CofgyEw0.js';
|
|
9
|
+
import './Grid-DfFAkeeV.js';
|
|
10
|
+
import 'split.js';
|
|
11
|
+
import './EllipsisMenu-30FNqoIv.js';
|
|
12
|
+
import './SingleDateTimePicker-7anflEq8.js';
|
|
13
|
+
import './pikaday-DMSzaLH6.js';
|
|
14
|
+
import 'moment';
|