tsiclient
Version:
<a href="https://tsiclientsample.azurewebsites.net"><img src="https://insights.timeseries.azure.com/favicons/android-chrome-192x192.png" align="left" hspace="10" vspace="6" height="100px"></a>
39 lines (36 loc) • 1.9 kB
JavaScript
import { a as __extends } from './tslib.es6-2b6b18f1.js';
import { U as Utils } from './Utils-660910c0.js';
import { select } from 'd3';
import { C as ChartComponent } from './ChartComponent-837ef9b4.js';
var DateTimeButton = /** @class */ (function (_super) {
__extends(DateTimeButton, _super);
function DateTimeButton(renderTarget) {
var _this = _super.call(this, renderTarget) || this;
_this.pickerIsVisible = false;
return _this;
}
DateTimeButton.prototype.buttonDateTimeFormat = function (millis) {
return Utils.timeFormat(!this.chartOptions.minutesForTimeLabels, !this.chartOptions.minutesForTimeLabels, this.chartOptions.offset, this.chartOptions.is24HourTime, 0, null, this.chartOptions.dateLocale)(millis);
};
DateTimeButton.prototype.render = function (chartOptions, minMillis, maxMillis, onSet) {
if (onSet === void 0) { onSet = null; }
this.chartOptions.setOptions(chartOptions);
this.minMillis = minMillis;
this.maxMillis = maxMillis;
this.onSet = onSet ? onSet : function () { };
var dateTimeContainer = select(this.renderTarget);
if (!this.dateTimeButton) {
this.dateTimeButton = dateTimeContainer.append("button")
.classed('tsi-dateTimeButton', true);
}
if (!this.dateTimePickerContainer) {
this.dateTimePickerContainer = dateTimeContainer.append('div').classed('tsi-dateTimePickerContainer', true)
.attr('role', 'dialog')
.attr('aria-label', this.getString('a time selection control dialog'));
this.dateTimePickerContainer.style('display', 'none');
}
_super.prototype.themify.call(this, select(this.renderTarget), this.chartOptions.theme);
};
return DateTimeButton;
}(ChartComponent));
export { DateTimeButton as D };