@progress/kendo-react-progressbars 7.0.0-develop.11 → 7.0.0-develop.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-progressbars.js +1 -1
- package/index.js +1 -1
- package/index.mjs +2 -1
- package/package.json +3 -3
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
(function(o,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-animation")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-animation"],C):(o=typeof globalThis<"u"?globalThis:o||self,C(o.KendoReactProgressbars={},o.React,o.PropTypes,o.KendoReactCommon,o.KendoReactAnimation))})(this,function(o,C,J,i,Q){"use strict";function F(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const s=F(C),r=F(J),X=1e-5,Y=3,Z=400,ee=0,se=e=>{const t=e.toString().split(".");return t.length===1?`${t[0]}`:`${t[0]}.${t[1].substr(0,Y)}`},D=(e,t,a)=>{const n=Math.abs((t-e)/100);return Math.abs((a-e)/n)},_=(e,t,a,n)=>{const m=Math.max(a,.01),P=100/m*100;e.current&&t.current&&(e.current.style.width=n?"100%":`${m}%`,t.current.style.width=n?"100%":`${P}%`,e.current.style.height=n?`${m}%`:"100%",t.current.style.height=n?`${P}%`:"100%")},re=(e,t,a)=>Math.max((a-e)/(t-e),X),H={name:"@progress/kendo-react-progressbars",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},O=s.forwardRef((e,t)=>{i.validatePackage(H);const{chunkCount:a=y.chunkCount,className:n,disabled:m,orientation:P,min:A=y.min,max:v=y.max,reverse:d=y.reverse,style:p,tabIndex:K,emptyStyle:$,emptyClassName:B,progressStyle:U,progressClassName:M}=e,k=s.useRef(null),L=s.useCallback(()=>{k.current&&k.current.focus()},[]);s.useImperativeHandle(t,()=>({element:k.current,focus:L}));const b=e.value||y.value,g=e.value===null,h=i.useRtl(k,e.dir),E=P==="vertical",c={className:i.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!E,"k-progressbar-vertical":E,"k-progressbar-reverse":d,"k-progressbar-indeterminate":g,"k-disabled":m},n),ref:k,dir:h,tabIndex:i.getTabIndex(K,m),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":A,"aria-valuemax":v,"aria-valuenow":g?void 0:b,"aria-disabled":m,style:p},N=({count:f})=>{let R=[];const u=100/f+"%",q=re(A,v,b),z=Math.floor(q*f),I=Array(f).fill(!1);for(let l=0;l<z;l++)I[l]=!0;for(let l=0;l<f;++l){const S=I[l],j=S?M:B,V={...{width:E?void 0:u,height:E?u:void 0},...S?U:$};R.push(s.createElement("li",{key:l,className:i.classNames("k-progress-chunk",{"k-first":l===0,"k-last":l===f-1,"k-selected":S},j),style:V}))}return s.createElement(s.Fragment,null,R)};return s.createElement("div",{...c},s.createElement("ul",{className:"k-progressbar-chunks k-reset"},s.createElement(N,{count:a||y.chunkCount})))});O.propTypes={chunkCount:r.number,ariaLabel:r.string,disabled:r.bool,reverse:r.bool,max:r.number,min:r.number,value:r.number,tabIndex:r.number,emptyStyle:r.object,emptyClassName:r.string,progressStyle:r.object,progressClassName:r.string};const y={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};O.defaultProps=y,O.displayName="KendoChunkProgressBar";const te=e=>{const t=s.useRef();return s.useEffect(()=>{t.current=e}),t.current},w=s.forwardRef((e,t)=>{i.validatePackage(H);const{animation:a,disabled:n,reverse:m=x.reverse,orientation:P,labelVisible:A,labelPlacement:v,max:d=x.max,min:p=x.min,tabIndex:K,className:$,style:B,emptyStyle:U,emptyClassName:M,progressStyle:k,progressClassName:L}=e,b=s.useRef(null),g=s.useRef(null),h=s.useRef(null),E=s.useCallback(()=>{b.current&&b.current.focus()},[]);s.useImperativeHandle(t,()=>({element:b.current,progressStatusElement:g.current,progressStatusWrapElement:h.current,focus:E}));const c=e.value||x.value,N=te(c),f=e.value===null,R=i.useRtl(b,e.dir),u=P==="vertical",q=se(c),z={value:c},I=A?e.label?s.createElement("span",{className:"k-progress-status"},s.createElement(e.label,{...z})):s.createElement("span",{className:"k-progress-status"},q):void 0,l={className:i.classNames("k-progressbar",{"k-progressbar-horizontal":!u,"k-progressbar-vertical":u,"k-progressbar-reverse":m,"k-progressbar-indeterminate":f,"k-disabled":n},$),ref:b,dir:R,tabIndex:i.getTabIndex(K,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":p,"aria-valuemax":d,"aria-valuenow":f?void 0:c,"aria-disabled":n,style:B},S=i.classNames("k-progress-status-wrap",{"k-progress-start":v==="start","k-progress-center":v==="center","k-progress-end":v==="end"||v===void 0}),j=typeof a!="boolean"&&a!==void 0?a.duration:a?Z:ee,W=s.useCallback(()=>{const T=D(p,d,N);_(g,h,T,u)},[u,d,p,N]),G=s.useCallback(T=>{const ae=D(p,d,N+(c-N)*T);_(g,h,ae,u)},[p,d,N,c,u]),V=s.useCallback(()=>{const T=D(p,d,c);_(g,h,T,u)},[u,d,p,c]);return Q.useAnimation({duration:j,onStart:W,onUpdate:G,onEnd:V},[c,j]),s.createElement("div",{...l},s.createElement("span",{className:S+(M?" "+M:""),style:U},I),s.createElement("div",{className:"k-progressbar-value k-selected",style:k,ref:g},s.createElement("span",{className:S+(L?" "+L:""),ref:h},I)))});w.propTypes={animation:r.any,ariaLabel:r.string,disabled:r.bool,reverse:r.bool,label:r.any,labelVisible:r.bool,labelPlacement:r.oneOf(["start","center","end"]),max:r.number,min:r.number,value:r.number,tabIndex:r.number,emptyStyle:r.object,emptyClassName:r.string,progressStyle:r.object,progressClassName:r.string};const x={animation:!1,min:0,max:100,value:0,disabled:!1,reverse:!1,labelVisible:!0};w.defaultProps=x,w.displayName="KendoProgressBar",o.ChunkProgressBar=O,o.ProgressBar=w,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
(function(o,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-animation")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-animation"],C):(o=typeof globalThis<"u"?globalThis:o||self,C(o.KendoReactProgressbars={},o.React,o.PropTypes,o.KendoReactCommon,o.KendoReactAnimation))})(this,function(o,C,J,i,Q){"use strict";"use client";function F(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const s=F(C),r=F(J),X=1e-5,Y=3,Z=400,ee=0,se=e=>{const t=e.toString().split(".");return t.length===1?`${t[0]}`:`${t[0]}.${t[1].substr(0,Y)}`},D=(e,t,a)=>{const n=Math.abs((t-e)/100);return Math.abs((a-e)/n)},_=(e,t,a,n)=>{const m=Math.max(a,.01),P=100/m*100;e.current&&t.current&&(e.current.style.width=n?"100%":`${m}%`,t.current.style.width=n?"100%":`${P}%`,e.current.style.height=n?`${m}%`:"100%",t.current.style.height=n?`${P}%`:"100%")},re=(e,t,a)=>Math.max((a-e)/(t-e),X),H={name:"@progress/kendo-react-progressbars",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},O=s.forwardRef((e,t)=>{i.validatePackage(H);const{chunkCount:a=y.chunkCount,className:n,disabled:m,orientation:P,min:A=y.min,max:v=y.max,reverse:d=y.reverse,style:p,tabIndex:K,emptyStyle:$,emptyClassName:B,progressStyle:U,progressClassName:M}=e,k=s.useRef(null),L=s.useCallback(()=>{k.current&&k.current.focus()},[]);s.useImperativeHandle(t,()=>({element:k.current,focus:L}));const b=e.value||y.value,g=e.value===null,h=i.useRtl(k,e.dir),E=P==="vertical",c={className:i.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!E,"k-progressbar-vertical":E,"k-progressbar-reverse":d,"k-progressbar-indeterminate":g,"k-disabled":m},n),ref:k,dir:h,tabIndex:i.getTabIndex(K,m),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":A,"aria-valuemax":v,"aria-valuenow":g?void 0:b,"aria-disabled":m,style:p},N=({count:f})=>{let R=[];const u=100/f+"%",q=re(A,v,b),z=Math.floor(q*f),I=Array(f).fill(!1);for(let l=0;l<z;l++)I[l]=!0;for(let l=0;l<f;++l){const S=I[l],j=S?M:B,V={...{width:E?void 0:u,height:E?u:void 0},...S?U:$};R.push(s.createElement("li",{key:l,className:i.classNames("k-progress-chunk",{"k-first":l===0,"k-last":l===f-1,"k-selected":S},j),style:V}))}return s.createElement(s.Fragment,null,R)};return s.createElement("div",{...c},s.createElement("ul",{className:"k-progressbar-chunks k-reset"},s.createElement(N,{count:a||y.chunkCount})))});O.propTypes={chunkCount:r.number,ariaLabel:r.string,disabled:r.bool,reverse:r.bool,max:r.number,min:r.number,value:r.number,tabIndex:r.number,emptyStyle:r.object,emptyClassName:r.string,progressStyle:r.object,progressClassName:r.string};const y={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};O.defaultProps=y,O.displayName="KendoChunkProgressBar";const te=e=>{const t=s.useRef();return s.useEffect(()=>{t.current=e}),t.current},w=s.forwardRef((e,t)=>{i.validatePackage(H);const{animation:a,disabled:n,reverse:m=x.reverse,orientation:P,labelVisible:A,labelPlacement:v,max:d=x.max,min:p=x.min,tabIndex:K,className:$,style:B,emptyStyle:U,emptyClassName:M,progressStyle:k,progressClassName:L}=e,b=s.useRef(null),g=s.useRef(null),h=s.useRef(null),E=s.useCallback(()=>{b.current&&b.current.focus()},[]);s.useImperativeHandle(t,()=>({element:b.current,progressStatusElement:g.current,progressStatusWrapElement:h.current,focus:E}));const c=e.value||x.value,N=te(c),f=e.value===null,R=i.useRtl(b,e.dir),u=P==="vertical",q=se(c),z={value:c},I=A?e.label?s.createElement("span",{className:"k-progress-status"},s.createElement(e.label,{...z})):s.createElement("span",{className:"k-progress-status"},q):void 0,l={className:i.classNames("k-progressbar",{"k-progressbar-horizontal":!u,"k-progressbar-vertical":u,"k-progressbar-reverse":m,"k-progressbar-indeterminate":f,"k-disabled":n},$),ref:b,dir:R,tabIndex:i.getTabIndex(K,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":p,"aria-valuemax":d,"aria-valuenow":f?void 0:c,"aria-disabled":n,style:B},S=i.classNames("k-progress-status-wrap",{"k-progress-start":v==="start","k-progress-center":v==="center","k-progress-end":v==="end"||v===void 0}),j=typeof a!="boolean"&&a!==void 0?a.duration:a?Z:ee,W=s.useCallback(()=>{const T=D(p,d,N);_(g,h,T,u)},[u,d,p,N]),G=s.useCallback(T=>{const ae=D(p,d,N+(c-N)*T);_(g,h,ae,u)},[p,d,N,c,u]),V=s.useCallback(()=>{const T=D(p,d,c);_(g,h,T,u)},[u,d,p,c]);return Q.useAnimation({duration:j,onStart:W,onUpdate:G,onEnd:V},[c,j]),s.createElement("div",{...l},s.createElement("span",{className:S+(M?" "+M:""),style:U},I),s.createElement("div",{className:"k-progressbar-value k-selected",style:k,ref:g},s.createElement("span",{className:S+(L?" "+L:""),ref:h},I)))});w.propTypes={animation:r.any,ariaLabel:r.string,disabled:r.bool,reverse:r.bool,label:r.any,labelVisible:r.bool,labelPlacement:r.oneOf(["start","center","end"]),max:r.number,min:r.number,value:r.number,tabIndex:r.number,emptyStyle:r.object,emptyClassName:r.string,progressStyle:r.object,progressClassName:r.string};const x={animation:!1,min:0,max:100,value:0,disabled:!1,reverse:!1,labelVisible:!0};w.defaultProps=x,w.displayName="KendoProgressBar",o.ChunkProgressBar=O,o.ProgressBar=w,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
package/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),J=require("prop-types"),u=require("@progress/kendo-react-common"),Q=require("@progress/kendo-react-animation");function F(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const s=F(G),t=F(J),X=1e-5,Y=3,Z=400,ee=0,se=e=>{const a=e.toString().split(".");return a.length===1?`${a[0]}`:`${a[0]}.${a[1].substr(0,Y)}`},K=(e,a,r)=>{const n=Math.abs((a-e)/100);return Math.abs((r-e)/n)},q=(e,a,r,n)=>{const i=Math.max(r,.01),N=100/i*100;e.current&&a.current&&(e.current.style.width=n?"100%":`${i}%`,a.current.style.width=n?"100%":`${N}%`,e.current.style.height=n?`${i}%`:"100%",a.current.style.height=n?`${N}%`:"100%")},te=(e,a,r)=>Math.max((r-e)/(a-e),X),H={name:"@progress/kendo-react-progressbars",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},A=s.forwardRef((e,a)=>{u.validatePackage(H);const{chunkCount:r=h.chunkCount,className:n,disabled:i,orientation:N,min:I=h.min,max:k=h.max,reverse:m=h.reverse,style:d,tabIndex:L,emptyStyle:D,emptyClassName:_,progressStyle:j,progressClassName:R}=e,f=s.useRef(null),O=s.useCallback(()=>{f.current&&f.current.focus()},[]);s.useImperativeHandle(a,()=>({element:f.current,focus:O}));const b=e.value||h.value,p=e.value===null,v=u.useRtl(f,e.dir),P=N==="vertical",o={className:u.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!P,"k-progressbar-vertical":P,"k-progressbar-reverse":m,"k-progressbar-indeterminate":p,"k-disabled":i},n),ref:f,dir:v,tabIndex:u.getTabIndex(L,i),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":I,"aria-valuemax":k,"aria-valuenow":p?void 0:b,"aria-disabled":i,style:d},y=({count:g})=>{let T=[];const c=100/g+"%",$=te(I,k,b),B=Math.floor($*g),E=Array(g).fill(!1);for(let l=0;l<B;l++)E[l]=!0;for(let l=0;l<g;++l){const C=E[l],w=C?R:_,U={...{width:P?void 0:c,height:P?c:void 0},...C?j:D};T.push(s.createElement("li",{key:l,className:u.classNames("k-progress-chunk",{"k-first":l===0,"k-last":l===g-1,"k-selected":C},w),style:U}))}return s.createElement(s.Fragment,null,T)};return s.createElement("div",{...o},s.createElement("ul",{className:"k-progressbar-chunks k-reset"},s.createElement(y,{count:r||h.chunkCount})))});A.propTypes={chunkCount:t.number,ariaLabel:t.string,disabled:t.bool,reverse:t.bool,max:t.number,min:t.number,value:t.number,tabIndex:t.number,emptyStyle:t.object,emptyClassName:t.string,progressStyle:t.object,progressClassName:t.string};const h={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};A.defaultProps=h;A.displayName="KendoChunkProgressBar";const ae=e=>{const a=s.useRef();return s.useEffect(()=>{a.current=e}),a.current},M=s.forwardRef((e,a)=>{u.validatePackage(H);const{animation:r,disabled:n,reverse:i=x.reverse,orientation:N,labelVisible:I,labelPlacement:k,max:m=x.max,min:d=x.min,tabIndex:L,className:D,style:_,emptyStyle:j,emptyClassName:R,progressStyle:f,progressClassName:O}=e,b=s.useRef(null),p=s.useRef(null),v=s.useRef(null),P=s.useCallback(()=>{b.current&&b.current.focus()},[]);s.useImperativeHandle(a,()=>({element:b.current,progressStatusElement:p.current,progressStatusWrapElement:v.current,focus:P}));const o=e.value||x.value,y=ae(o),g=e.value===null,T=u.useRtl(b,e.dir),c=N==="vertical",$=se(o),B={value:o},E=I?e.label?s.createElement("span",{className:"k-progress-status"},s.createElement(e.label,{...B})):s.createElement("span",{className:"k-progress-status"},$):void 0,l={className:u.classNames("k-progressbar",{"k-progressbar-horizontal":!c,"k-progressbar-vertical":c,"k-progressbar-reverse":i,"k-progressbar-indeterminate":g,"k-disabled":n},D),ref:b,dir:T,tabIndex:u.getTabIndex(L,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":d,"aria-valuemax":m,"aria-valuenow":g?void 0:o,"aria-disabled":n,style:_},C=u.classNames("k-progress-status-wrap",{"k-progress-start":k==="start","k-progress-center":k==="center","k-progress-end":k==="end"||k===void 0}),w=typeof r!="boolean"&&r!==void 0?r.duration:r?Z:ee,z=s.useCallback(()=>{const S=K(d,m,y);q(p,v,S,c)},[c,m,d,y]),V=s.useCallback(S=>{const W=K(d,m,y+(o-y)*S);q(p,v,W,c)},[d,m,y,o,c]),U=s.useCallback(()=>{const S=K(d,m,o);q(p,v,S,c)},[c,m,d,o]);return Q.useAnimation({duration:w,onStart:z,onUpdate:V,onEnd:U},[o,w]),s.createElement("div",{...l},s.createElement("span",{className:C+(R?" "+R:""),style:j},E),s.createElement("div",{className:"k-progressbar-value k-selected",style:f,ref:p},s.createElement("span",{className:C+(O?" "+O:""),ref:v},E)))});M.propTypes={animation:t.any,ariaLabel:t.string,disabled:t.bool,reverse:t.bool,label:t.any,labelVisible:t.bool,labelPlacement:t.oneOf(["start","center","end"]),max:t.number,min:t.number,value:t.number,tabIndex:t.number,emptyStyle:t.object,emptyClassName:t.string,progressStyle:t.object,progressClassName:t.string};const x={animation:!1,min:0,max:100,value:0,disabled:!1,reverse:!1,labelVisible:!0};M.defaultProps=x;M.displayName="KendoProgressBar";exports.ChunkProgressBar=A;exports.ProgressBar=M;
|
|
5
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),J=require("prop-types"),u=require("@progress/kendo-react-common"),Q=require("@progress/kendo-react-animation");function F(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const s=F(G),t=F(J),X=1e-5,Y=3,Z=400,ee=0,se=e=>{const a=e.toString().split(".");return a.length===1?`${a[0]}`:`${a[0]}.${a[1].substr(0,Y)}`},K=(e,a,r)=>{const n=Math.abs((a-e)/100);return Math.abs((r-e)/n)},q=(e,a,r,n)=>{const i=Math.max(r,.01),N=100/i*100;e.current&&a.current&&(e.current.style.width=n?"100%":`${i}%`,a.current.style.width=n?"100%":`${N}%`,e.current.style.height=n?`${i}%`:"100%",a.current.style.height=n?`${N}%`:"100%")},te=(e,a,r)=>Math.max((r-e)/(a-e),X),H={name:"@progress/kendo-react-progressbars",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},A=s.forwardRef((e,a)=>{u.validatePackage(H);const{chunkCount:r=h.chunkCount,className:n,disabled:i,orientation:N,min:I=h.min,max:k=h.max,reverse:m=h.reverse,style:d,tabIndex:L,emptyStyle:D,emptyClassName:_,progressStyle:j,progressClassName:R}=e,f=s.useRef(null),O=s.useCallback(()=>{f.current&&f.current.focus()},[]);s.useImperativeHandle(a,()=>({element:f.current,focus:O}));const b=e.value||h.value,p=e.value===null,v=u.useRtl(f,e.dir),P=N==="vertical",o={className:u.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!P,"k-progressbar-vertical":P,"k-progressbar-reverse":m,"k-progressbar-indeterminate":p,"k-disabled":i},n),ref:f,dir:v,tabIndex:u.getTabIndex(L,i),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":I,"aria-valuemax":k,"aria-valuenow":p?void 0:b,"aria-disabled":i,style:d},y=({count:g})=>{let T=[];const c=100/g+"%",$=te(I,k,b),B=Math.floor($*g),E=Array(g).fill(!1);for(let l=0;l<B;l++)E[l]=!0;for(let l=0;l<g;++l){const C=E[l],w=C?R:_,U={...{width:P?void 0:c,height:P?c:void 0},...C?j:D};T.push(s.createElement("li",{key:l,className:u.classNames("k-progress-chunk",{"k-first":l===0,"k-last":l===g-1,"k-selected":C},w),style:U}))}return s.createElement(s.Fragment,null,T)};return s.createElement("div",{...o},s.createElement("ul",{className:"k-progressbar-chunks k-reset"},s.createElement(y,{count:r||h.chunkCount})))});A.propTypes={chunkCount:t.number,ariaLabel:t.string,disabled:t.bool,reverse:t.bool,max:t.number,min:t.number,value:t.number,tabIndex:t.number,emptyStyle:t.object,emptyClassName:t.string,progressStyle:t.object,progressClassName:t.string};const h={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};A.defaultProps=h;A.displayName="KendoChunkProgressBar";const ae=e=>{const a=s.useRef();return s.useEffect(()=>{a.current=e}),a.current},M=s.forwardRef((e,a)=>{u.validatePackage(H);const{animation:r,disabled:n,reverse:i=x.reverse,orientation:N,labelVisible:I,labelPlacement:k,max:m=x.max,min:d=x.min,tabIndex:L,className:D,style:_,emptyStyle:j,emptyClassName:R,progressStyle:f,progressClassName:O}=e,b=s.useRef(null),p=s.useRef(null),v=s.useRef(null),P=s.useCallback(()=>{b.current&&b.current.focus()},[]);s.useImperativeHandle(a,()=>({element:b.current,progressStatusElement:p.current,progressStatusWrapElement:v.current,focus:P}));const o=e.value||x.value,y=ae(o),g=e.value===null,T=u.useRtl(b,e.dir),c=N==="vertical",$=se(o),B={value:o},E=I?e.label?s.createElement("span",{className:"k-progress-status"},s.createElement(e.label,{...B})):s.createElement("span",{className:"k-progress-status"},$):void 0,l={className:u.classNames("k-progressbar",{"k-progressbar-horizontal":!c,"k-progressbar-vertical":c,"k-progressbar-reverse":i,"k-progressbar-indeterminate":g,"k-disabled":n},D),ref:b,dir:T,tabIndex:u.getTabIndex(L,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":d,"aria-valuemax":m,"aria-valuenow":g?void 0:o,"aria-disabled":n,style:_},C=u.classNames("k-progress-status-wrap",{"k-progress-start":k==="start","k-progress-center":k==="center","k-progress-end":k==="end"||k===void 0}),w=typeof r!="boolean"&&r!==void 0?r.duration:r?Z:ee,z=s.useCallback(()=>{const S=K(d,m,y);q(p,v,S,c)},[c,m,d,y]),V=s.useCallback(S=>{const W=K(d,m,y+(o-y)*S);q(p,v,W,c)},[d,m,y,o,c]),U=s.useCallback(()=>{const S=K(d,m,o);q(p,v,S,c)},[c,m,d,o]);return Q.useAnimation({duration:w,onStart:z,onUpdate:V,onEnd:U},[o,w]),s.createElement("div",{...l},s.createElement("span",{className:C+(R?" "+R:""),style:j},E),s.createElement("div",{className:"k-progressbar-value k-selected",style:f,ref:p},s.createElement("span",{className:C+(O?" "+O:""),ref:v},E)))});M.propTypes={animation:t.any,ariaLabel:t.string,disabled:t.bool,reverse:t.bool,label:t.any,labelVisible:t.bool,labelPlacement:t.oneOf(["start","center","end"]),max:t.number,min:t.number,value:t.number,tabIndex:t.number,emptyStyle:t.object,emptyClassName:t.string,progressStyle:t.object,progressClassName:t.string};const x={animation:!1,min:0,max:100,value:0,disabled:!1,reverse:!1,labelVisible:!0};M.defaultProps=x;M.displayName="KendoProgressBar";exports.ChunkProgressBar=A;exports.ProgressBar=M;
|
package/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use client";
|
|
5
6
|
import * as e from "react";
|
|
6
7
|
import * as r from "prop-types";
|
|
7
8
|
import { validatePackage as H, useRtl as W, classNames as L, getTabIndex as q } from "@progress/kendo-react-common";
|
|
@@ -19,7 +20,7 @@ const X = 1e-5, Y = 3, Z = 400, ee = 0, se = (s) => {
|
|
|
19
20
|
name: "@progress/kendo-react-progressbars",
|
|
20
21
|
productName: "KendoReact",
|
|
21
22
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
22
|
-
publishDate:
|
|
23
|
+
publishDate: 1702024467,
|
|
23
24
|
version: "",
|
|
24
25
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
25
26
|
}, j = e.forwardRef((s, t) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-progressbars",
|
|
3
|
-
"version": "7.0.0-develop.
|
|
3
|
+
"version": "7.0.0-develop.13",
|
|
4
4
|
"description": "React ProgressBars offer a customizable interface for users to track and display the progress of a task. KendoReact ProgressBars package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"sideEffects": false,
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@progress/kendo-licensing": "^1.3.0",
|
|
20
|
-
"@progress/kendo-react-animation": "7.0.0-develop.
|
|
21
|
-
"@progress/kendo-react-common": "7.0.0-develop.
|
|
20
|
+
"@progress/kendo-react-animation": "7.0.0-develop.13",
|
|
21
|
+
"@progress/kendo-react-common": "7.0.0-develop.13",
|
|
22
22
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
23
23
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
24
24
|
},
|