UNPKG

@vime/core

Version:

Customizable, extensible, accessible and framework agnostic media player.

32 lines (26 loc) 1.04 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-86498cbd.js'); const formatters = require('./formatters-571a926a.js'); const withComponentRegistry = require('./withComponentRegistry-90ec334c.js'); const timeCss = ".time{display:flex;align-items:center;color:var(--vm-time-color);font-size:var(--vm-time-font-size);font-weight:var(--vm-time-font-weight)}"; const Time = class { constructor(hostRef) { index.registerInstance(this, hostRef); /** * The length of time in seconds. */ this.seconds = 0; /** * Whether the time should always show the hours unit, even if the time is less than * 1 hour (eg: `20:35` -> `00:20:35`). */ this.alwaysShowHours = false; withComponentRegistry.withComponentRegistry(this); } render() { return (index.h("div", { class: "time", "aria-label": this.label }, formatters.formatTime(Math.max(0, this.seconds), this.alwaysShowHours))); } }; Time.style = timeCss; exports.vm_time = Time;