123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /*!
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
- * v1.0.0-beta.97
- */
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client/index.js';
- const progressCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:1;inline-size:100%;overflow:hidden;background:var(--calcite-ui-border-3)}.bar{z-index:1;background-color:var(--calcite-ui-brand)}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) * 11) linear infinite}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}";
- const Progress = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
- constructor() {
- super();
- this.__registerHost();
- this.__attachShadow();
- /**
- * Specifies the component type.
- *
- * Use `"indeterminate"` if finding actual progress value is impossible.
- *
- */
- this.type = "determinate";
- /** The component's progress value, with a range of 0.0 - 1.0. */
- this.value = 0;
- /** When `true` and for `"indeterminate"` progress bars, reverses the animation direction. */
- this.reversed = false;
- }
- render() {
- const isDeterminate = this.type === "determinate";
- const barStyles = isDeterminate ? { width: `${this.value * 100}%` } : {};
- return (h("div", { "aria-label": this.label || this.text, "aria-valuemax": 1, "aria-valuemin": 0, "aria-valuenow": this.value, role: "progressbar" }, h("div", { class: "track" }, h("div", { class: {
- bar: true,
- indeterminate: this.type === "indeterminate",
- reversed: this.reversed
- }, style: barStyles })), this.text ? h("div", { class: "text" }, this.text) : null));
- }
- get el() { return this; }
- static get style() { return progressCss; }
- }, [1, "calcite-progress", {
- "type": [513],
- "value": [2],
- "label": [1],
- "text": [1],
- "reversed": [516]
- }]);
- function defineCustomElement() {
- if (typeof customElements === "undefined") {
- return;
- }
- const components = ["calcite-progress"];
- components.forEach(tagName => { switch (tagName) {
- case "calcite-progress":
- if (!customElements.get(tagName)) {
- customElements.define(tagName, Progress);
- }
- break;
- } });
- }
- defineCustomElement();
- export { Progress as P, defineCustomElement as d };
|