UNPKG

1.9 kBJavaScriptView Raw
1import { a as __extends } from './tslib.es6-863e3717.js';
2import { U as Utils } from './Utils-5f9f1f09.js';
3import { select } from 'd3';
4import { C as ChartComponent } from './ChartComponent-63d99ac0.js';
5
6var 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 = 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, select(this.renderTarget), this.chartOptions.theme);
34 };
35 return DateTimeButton;
36}(ChartComponent));
37
38export { DateTimeButton as D };