import { customElement, MimicElement } from '@roenlie/mimic-lit/element'; import { sharedStyles } from '@roenlie/mimic-lit/styles'; import { tTerm } from '@roenlie/mimic-localize/directive'; import { css, html } from 'lit'; import { property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import { ifDefined } from 'lit/directives/if-defined.js'; import { styleMap } from 'lit/directives/style-map.js'; import { when } from 'lit/directives/when.js'; import { labelFontStyles } from '../../utilities/font-styles.js'; /** * @slot - A label to show inside the indicator. * * @csspart base - The component's internal wrapper. * @csspart indicator - The progress bar indicator. * @csspart label - The progress bar label. * * @cssproperty --height - The progress bar's height. * @cssproperty --track-color - The track color. * @cssproperty --indicator-color - The indicator color. * @cssproperty --label-color - The label color. */ @customElement('mm-progress-bar') export class MMProgressBar extends MimicElement { //#region properties /** The current progress, 0 to 100. */ public get value() { return this._value; } @property({ type: Number, reflect: true }) public set value(v: number) { const old = this._value; this._value = Math.max(Math.min(v, 100), 0); this.requestUpdate('value', old); } /** When true, percentage is ignored, the label is hidden, and the progress bar is drawn in an indeterminate state. */ @property({ type: Boolean, reflect: true }) public indeterminate = false; /** The locale to render the component in. */ @property() public override lang: string; /** A custom label for the progress bar's aria label. */ @property() public label = ''; /** Sets the border radius style */ @property() public shape: 'pill' | 'sharp' = 'sharp'; protected _value = 0; //#endregion //#region controllers //#endregion //#region lifecycle //#endregion //#region logic //#endregion //#region template public override render() { return html`