UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

2 lines (1 loc) 4.33 kB
"use strict";var e=require("primevue/basecomponent"),n=require("vue");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r={name:"ProgressBar",extends:t(e).default,props:{value:{type:Number,default:null},mode:{type:String,default:"determinate"},showValue:{type:Boolean,default:!0}},computed:{containerClass(){return["p-progressbar p-component",{"p-progressbar-determinate":this.determinate,"p-progressbar-indeterminate":this.indeterminate}]},progressStyle(){return{width:this.value+"%",display:"flex"}},indeterminate(){return"indeterminate"===this.mode},determinate(){return"determinate"===this.mode}}};const a=["aria-valuenow"];!function(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("\n.p-progressbar {\n position: relative;\n overflow: hidden;\n}\n.p-progressbar-determinate .p-progressbar-value {\n height: 100%;\n width: 0%;\n position: absolute;\n display: none;\n border: 0 none;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n}\n.p-progressbar-determinate .p-progressbar-label {\n display: inline-flex;\n}\n.p-progressbar-determinate .p-progressbar-value-animate {\n transition: width 1s ease-in-out;\n}\n.p-progressbar-indeterminate .p-progressbar-value::before {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n}\n.p-progressbar-indeterminate .p-progressbar-value::after {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n -webkit-animation-delay: 1.15s;\n animation-delay: 1.15s;\n}\n@-webkit-keyframes p-progressbar-indeterminate-anim {\n0% {\n left: -35%;\n right: 100%;\n}\n60% {\n left: 100%;\n right: -90%;\n}\n100% {\n left: 100%;\n right: -90%;\n}\n}\n@keyframes p-progressbar-indeterminate-anim {\n0% {\n left: -35%;\n right: 100%;\n}\n60% {\n left: 100%;\n right: -90%;\n}\n100% {\n left: 100%;\n right: -90%;\n}\n}\n@-webkit-keyframes p-progressbar-indeterminate-anim-short {\n0% {\n left: -200%;\n right: 100%;\n}\n60% {\n left: 107%;\n right: -8%;\n}\n100% {\n left: 107%;\n right: -8%;\n}\n}\n@keyframes p-progressbar-indeterminate-anim-short {\n0% {\n left: -200%;\n right: 100%;\n}\n60% {\n left: 107%;\n right: -8%;\n}\n100% {\n left: 107%;\n right: -8%;\n}\n}\n"),r.render=function(e,t,r,i,o,s){return n.openBlock(),n.createElementBlock("div",n.mergeProps({role:"progressbar",class:s.containerClass,"aria-valuemin":"0","aria-valuenow":r.value,"aria-valuemax":"100"},e.ptm("root")),[s.determinate?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,class:"p-progressbar-value p-progressbar-value-animate",style:s.progressStyle},e.ptm("value")),[null!=r.value&&0!==r.value&&r.showValue?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,class:"p-progressbar-label"},e.ptm("label")),[n.renderSlot(e.$slots,"default",{},(()=>[n.createTextVNode(n.toDisplayString(r.value+"%"),1)]))],16)):n.createCommentVNode("",!0)],16)):n.createCommentVNode("",!0),s.indeterminate?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:1,class:"p-progressbar-indeterminate-container"},e.ptm("root")),[n.createElementVNode("div",n.mergeProps({class:"p-progressbar-value p-progressbar-value-animate"},e.ptm("value")),null,16)],16)):n.createCommentVNode("",!0)],16,a)},module.exports=r;