@3mo/date-time-fields
Version:
Date time fields let people select dates, date-ranges, and times.
36 lines (35 loc) • 919 B
JavaScript
import { __decorate } from "tslib";
import { component, html, property, style } from '@a11d/lit';
import { Localizer } from '@3mo/localization';
import { FieldText } from '@3mo/text-fields';
Localizer.dictionaries.add('de', {
'Time': 'Uhrzeit',
});
// TODO: Migrate to Temporal.PlainTime
/**
* @element mo-field-time
*
* @i18n "Time"
*/
let FieldTime = class FieldTime extends FieldText {
constructor() {
super(...arguments);
this.label = t('Time');
}
get inputType() {
return 'time';
}
get startSlotTemplate() {
return html `
<mo-icon slot='start' @click=${() => this.focus()} icon='schedule' ${style({ color: 'var(--mo-color-gray)' })}></mo-icon>
${super.startSlotTemplate}
`;
}
};
__decorate([
property()
], FieldTime.prototype, "label", void 0);
FieldTime = __decorate([
component('mo-field-time')
], FieldTime);
export { FieldTime };