@progress/kendo-react-progressbars 7.2.4-develop.3 → 7.2.4-develop.4

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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),e=require("prop-types"),u=require("@progress/kendo-react-common"),L=require("../common/utils.js"),A=require("../package-metadata.js");function F(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(l,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return l.default=t,Object.freeze(l)}const s=F(D),d=s.forwardRef((t,l)=>{u.validatePackage(A.packageMetadata);const{chunkCount:n=a.chunkCount,className:i,disabled:b,orientation:P,min:p=a.min,max:g=a.max,reverse:N=a.reverse,style:S,tabIndex:x,emptyStyle:R,emptyClassName:j,progressStyle:E,progressClassName:O}=t,o=s.useRef(null),q=s.useCallback(()=>{o.current&&o.current.focus()},[]);s.useImperativeHandle(l,()=>({element:o.current,focus:q}));const f=t.value||a.value,y=t.value===null,w=u.useRtl(o,t.dir),m=P==="vertical",I={className:u.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!m,"k-progressbar-vertical":m,"k-progressbar-reverse":N,"k-progressbar-indeterminate":y,"k-disabled":b},i),ref:o,dir:w,tabIndex:u.getTabIndex(x,b),role:"progressbar","aria-label":t.ariaLabel,"aria-valuemin":p,"aria-valuemax":g,"aria-valuenow":y?void 0:f,"aria-disabled":b,style:S},M=({count:c})=>{let v=[];const h=100/c+"%",T=L.calculateRatio(p,g,f),z=Math.floor(T*c),C=Array(c).fill(!1);for(let r=0;r<z;r++)C[r]=!0;for(let r=0;r<c;++r){const k=C[r],B=k?O:j,_={...{width:m?void 0:h,height:m?h:void 0},...k?E:R};v.push(s.createElement("li",{key:r,className:u.classNames("k-progressbar-chunk",{"k-first":r===0,"k-last":r===c-1,"k-selected":k},B),style:_}))}return s.createElement(s.Fragment,null,v)};return s.createElement("div",{...I},s.createElement("ul",{className:"k-progressbar-chunks k-reset"},s.createElement(M,{count:n||a.chunkCount})))});d.propTypes={chunkCount:e.number,ariaLabel:e.string,disabled:e.bool,reverse:e.bool,max:e.number,min:e.number,value:e.number,tabIndex:e.number,emptyStyle:e.object,emptyClassName:e.string,progressStyle:e.object,progressClassName:e.string};const a={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};d.defaultProps=a;d.displayName="KendoChunkProgressBar";exports.ChunkProgressBar=d;
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as s from "react";
10
+ import e from "prop-types";
11
+ import { validatePackage as H, useRtl as K, classNames as v, getTabIndex as V } from "@progress/kendo-react-common";
12
+ import { calculateRatio as q } from "../common/utils.mjs";
13
+ import { packageMetadata as D } from "../package-metadata.mjs";
14
+ const u = s.forwardRef((t, y) => {
15
+ H(D);
16
+ const {
17
+ chunkCount: h = a.chunkCount,
18
+ className: C,
19
+ disabled: c,
20
+ orientation: x,
21
+ min: m = a.min,
22
+ max: d = a.max,
23
+ reverse: N = a.reverse,
24
+ style: P,
25
+ tabIndex: S,
26
+ emptyStyle: R,
27
+ emptyClassName: E,
28
+ progressStyle: I,
29
+ progressClassName: w
30
+ } = t, l = s.useRef(null), T = s.useCallback(
31
+ () => {
32
+ l.current && l.current.focus();
33
+ },
34
+ []
35
+ );
36
+ s.useImperativeHandle(y, () => ({
37
+ element: l.current,
38
+ focus: T
39
+ }));
40
+ const p = t.value || a.value, k = t.value === null, j = K(l, t.dir), o = x === "vertical", z = {
41
+ className: v(
42
+ "k-progressbar k-chunk-progressbar",
43
+ {
44
+ "k-progressbar-horizontal": !o,
45
+ "k-progressbar-vertical": o,
46
+ "k-progressbar-reverse": N,
47
+ "k-progressbar-indeterminate": k,
48
+ "k-disabled": c
49
+ },
50
+ C
51
+ ),
52
+ ref: l,
53
+ dir: j,
54
+ tabIndex: V(S, c),
55
+ role: "progressbar",
56
+ "aria-label": t.ariaLabel,
57
+ "aria-valuemin": m,
58
+ "aria-valuemax": d,
59
+ "aria-valuenow": k ? void 0 : p,
60
+ "aria-disabled": c,
61
+ style: P
62
+ }, B = ({ count: n }) => {
63
+ let b = [];
64
+ const g = 100 / n + "%", L = q(m, d, p), M = Math.floor(L * n), f = Array(n).fill(!1);
65
+ for (let r = 0; r < M; r++)
66
+ f[r] = !0;
67
+ for (let r = 0; r < n; ++r) {
68
+ const i = f[r], A = i ? w : E, F = { ...{
69
+ width: o ? void 0 : g,
70
+ height: o ? g : void 0
71
+ }, ...i ? I : R };
72
+ b.push(
73
+ /* @__PURE__ */ s.createElement(
74
+ "li",
75
+ {
76
+ key: r,
77
+ className: v(
78
+ "k-progressbar-chunk",
79
+ {
80
+ "k-first": r === 0,
81
+ "k-last": r === n - 1,
82
+ "k-selected": i
83
+ },
84
+ A
85
+ ),
86
+ style: F
87
+ }
88
+ )
89
+ );
90
+ }
91
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, b);
92
+ };
93
+ return /* @__PURE__ */ s.createElement("div", { ...z }, /* @__PURE__ */ s.createElement("ul", { className: "k-progressbar-chunks k-reset" }, /* @__PURE__ */ s.createElement(B, { count: h || a.chunkCount })));
94
+ });
95
+ u.propTypes = {
96
+ chunkCount: e.number,
97
+ ariaLabel: e.string,
98
+ disabled: e.bool,
99
+ reverse: e.bool,
100
+ max: e.number,
101
+ min: e.number,
102
+ value: e.number,
103
+ tabIndex: e.number,
104
+ emptyStyle: e.object,
105
+ emptyClassName: e.string,
106
+ progressStyle: e.object,
107
+ progressClassName: e.string
108
+ };
109
+ const a = {
110
+ chunkCount: 5,
111
+ min: 0,
112
+ max: 100,
113
+ value: 0,
114
+ disabled: !1,
115
+ reverse: !1
116
+ };
117
+ u.defaultProps = a;
118
+ u.displayName = "KendoChunkProgressBar";
119
+ export {
120
+ u as ChunkProgressBar
121
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=1e-5,I=3,N=400,t=0;exports.DEFAULT_ANIMATION_DURATION=N;exports.LABEL_DECIMALS=I;exports.MIN_RATIO=A;exports.NO_ANIMATION=t;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ const A = 1e-5, I = 3, N = 400, t = 0;
10
+ export {
11
+ N as DEFAULT_ANIMATION_DURATION,
12
+ I as LABEL_DECIMALS,
13
+ A as MIN_RATIO,
14
+ t as NO_ANIMATION
15
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./constants.js"),s=e=>{const t=e.toString().split(".");return t.length===1?`${t[0]}`:`${t[0]}.${t[1].substr(0,u.LABEL_DECIMALS)}`},o=(e,t,n)=>{const r=Math.abs((t-e)/100);return Math.abs((n-e)/r)},l=(e,t,n,r)=>{const c=Math.max(n,.01),a=100/c*100;e.current&&t.current&&(e.current.style.width=r?"100%":`${c}%`,t.current.style.width=r?"100%":`${a}%`,e.current.style.height=r?`${c}%`:"100%",t.current.style.height=r?`${a}%`:"100%")},h=(e,t,n)=>Math.max((n-e)/(t-e),u.MIN_RATIO);exports.calculatePercentage=o;exports.calculateRatio=h;exports.truncateNumber=s;exports.updateProgress=l;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import { LABEL_DECIMALS as a, MIN_RATIO as s } from "./constants.mjs";
10
+ const h = (e) => {
11
+ const t = e.toString().split(".");
12
+ return t.length === 1 ? `${t[0]}` : `${t[0]}.${t[1].substr(0, a)}`;
13
+ }, l = (e, t, r) => {
14
+ const n = Math.abs((t - e) / 100);
15
+ return Math.abs((r - e) / n);
16
+ }, $ = (e, t, r, n) => {
17
+ const c = Math.max(r, 0.01), u = 100 / c * 100;
18
+ e.current && t.current && (e.current.style.width = n ? "100%" : `${c}%`, t.current.style.width = n ? "100%" : `${u}%`, e.current.style.height = n ? `${c}%` : "100%", t.current.style.height = n ? `${u}%` : "100%");
19
+ }, g = (e, t, r) => Math.max((r - e) / (t - e), s);
20
+ export {
21
+ l as calculatePercentage,
22
+ g as calculateRatio,
23
+ h as truncateNumber,
24
+ $ as updateProgress
25
+ };
@@ -1,5 +1,8 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- (function(c,x){typeof exports=="object"&&typeof module!="undefined"?x(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"],x):(c=typeof globalThis!="undefined"?globalThis:c||self,x(c.KendoReactProgressbars={},c.React,c.PropTypes,c.KendoReactCommon,c.KendoReactAnimation))})(this,function(c,x,a,i,J){"use strict";"use client";function Q(e){const s=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(s,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return s.default=e,Object.freeze(s)}const t=Q(x),X=1e-5,Y=3,Z=400,T=0,ee=e=>{const s=e.toString().split(".");return s.length===1?`${s[0]}`:`${s[0]}.${s[1].substr(0,Y)}`},_=(e,s,r)=>{const n=Math.abs((s-e)/100);return Math.abs((r-e)/n)},$=(e,s,r,n)=>{const m=Math.max(r,.01),y=100/m*100;e.current&&s.current&&(e.current.style.width=n?"100%":`${m}%`,s.current.style.width=n?"100%":`${y}%`,e.current.style.height=n?`${m}%`:"100%",s.current.style.height=n?`${y}%`:"100%")},te=(e,s,r)=>Math.max((r-e)/(s-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=t.forwardRef((e,s)=>{i.validatePackage(H);const{chunkCount:r=k.chunkCount,className:n,disabled:m,orientation:y,min:L=k.min,max:p=k.max,reverse:d=k.reverse,style:b,tabIndex:B,emptyStyle:P,emptyClassName:U,progressStyle:q,progressClassName:R}=e,h=t.useRef(null),j=t.useCallback(()=>{h.current&&h.current.focus()},[]);t.useImperativeHandle(s,()=>({element:h.current,focus:j}));const g=e.value||k.value,f=e.value===null,N=i.useRtl(h,e.dir),S=y==="vertical",o={className:i.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!S,"k-progressbar-vertical":S,"k-progressbar-reverse":d,"k-progressbar-indeterminate":f,"k-disabled":m},n),ref:h,dir:N,tabIndex:i.getTabIndex(B,m),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":L,"aria-valuemax":p,"aria-valuenow":f?void 0:g,"aria-disabled":m,style:b},E=({count:v})=>{let D=[];const u=100/v+"%",z=te(L,p,g),V=Math.floor(z*v),O=Array(v).fill(!1);for(let l=0;l<V;l++)O[l]=!0;for(let l=0;l<v;++l){const C=O[l],K=C?R:U,F={...{width:S?void 0:u,height:S?u:void 0},...C?q:P};D.push(t.createElement("li",{key:l,className:i.classNames("k-progressbar-chunk",{"k-first":l===0,"k-last":l===v-1,"k-selected":C},K),style:F}))}return t.createElement(t.Fragment,null,D)};return t.createElement("div",{...o},t.createElement("ul",{className:"k-progressbar-chunks k-reset"},t.createElement(E,{count:r||k.chunkCount})))});A.propTypes={chunkCount:a.number,ariaLabel:a.string,disabled:a.bool,reverse:a.bool,max:a.number,min:a.number,value:a.number,tabIndex:a.number,emptyStyle:a.object,emptyClassName:a.string,progressStyle:a.object,progressClassName:a.string};const k={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};A.defaultProps=k,A.displayName="KendoChunkProgressBar";const ae=e=>{const s=t.useRef();return t.useEffect(()=>{s.current=e}),s.current},M=t.forwardRef((e,s)=>{i.validatePackage(H);const{animation:r,disabled:n,reverse:m=I.reverse,orientation:y,labelVisible:L,labelPlacement:p,max:d=I.max,min:b=I.min,tabIndex:B,className:P,style:U,emptyStyle:q,emptyClassName:R,progressStyle:h,progressClassName:j}=e,g=t.useRef(null),f=t.useRef(null),N=t.useRef(null),S=t.useCallback(()=>{g.current&&g.current.focus()},[]);t.useImperativeHandle(s,()=>({element:g.current,progressStatusElement:f.current,progressStatusWrapElement:N.current,focus:S}));const o=e.value||I.value,E=ae(o),v=e.value===null,D=i.useRtl(g,e.dir),u=y==="vertical",z=ee(o),V={value:o},O=L?e.label?t.createElement("span",{className:"k-progress-status"},t.createElement(e.label,{...V})):t.createElement("span",{className:"k-progress-status"},z):void 0,l={className:i.classNames("k-progressbar",{"k-progressbar-horizontal":!u,"k-progressbar-vertical":u,"k-progressbar-reverse":m,"k-progressbar-indeterminate":v,"k-disabled":n},P),ref:g,dir:D,tabIndex:i.getTabIndex(B,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":b,"aria-valuemax":d,"aria-valuenow":v?void 0:o,"aria-disabled":n,style:U},C=i.classNames("k-progress-status-wrap",{"k-progress-start":p==="start","k-progress-center":p==="center","k-progress-end":p==="end"||p===void 0}),K=typeof r!="boolean"&&r!==void 0?r.duration:r?Z:T,W=t.useCallback(()=>{const w=_(b,d,E);$(f,N,w,u)},[u,d,b,E]),G=t.useCallback(w=>{const se=_(b,d,E+(o-E)*w);$(f,N,se,u)},[b,d,E,o,u]),F=t.useCallback(()=>{const w=_(b,d,o);$(f,N,w,u)},[u,d,b,o]);return J.useAnimation({duration:K,onStart:W,onUpdate:G,onEnd:F},[o,K]),t.createElement("div",{...l},t.createElement("span",{className:C+(R?" "+R:""),style:q},O),t.createElement("div",{className:"k-progressbar-value k-selected",style:h,ref:f},t.createElement("span",{className:C+(j?" "+j:""),ref:N},O)))});M.propTypes={animation:a.any,ariaLabel:a.string,disabled:a.bool,reverse:a.bool,label:a.any,labelVisible:a.bool,labelPlacement:a.oneOf(["start","center","end"]),max:a.number,min:a.number,value:a.number,tabIndex:a.number,emptyStyle:a.object,emptyClassName:a.string,progressStyle:a.object,progressClassName:a.string};const I={animation:!1,min:0,max:100,value:0,disabled:!1,reverse:!1,labelVisible:!0};M.defaultProps=I,M.displayName="KendoProgressBar",c.ChunkProgressBar=A,c.ProgressBar=M,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-animation")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-animation"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactProgressbars={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactAnimation)}(this,(function(e,r,a,s,t){"use strict";function n(e){var r=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:function(){return e[a]}})}})),r.default=e,Object.freeze(r)}var l=n(r);const o=e=>{const r=e.toString().split(".");return 1===r.length?`${r[0]}`:`${r[0]}.${r[1].substr(0,3)}`},i=(e,r,a)=>{const s=Math.abs((r-e)/100);return Math.abs((a-e)/s)},c=(e,r,a,s)=>{const t=Math.max(a,.01),n=100/t*100;e.current&&r.current&&(e.current.style.width=s?"100%":`${t}%`,r.current.style.width=s?"100%":`${n}%`,e.current.style.height=s?`${t}%`:"100%",r.current.style.height=s?`${n}%`:"100%")},u={name:"@progress/kendo-react-progressbars",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},m=l.forwardRef(((e,r)=>{s.validatePackage(u);const{chunkCount:a=d.chunkCount,className:t,disabled:n,orientation:o,min:i=d.min,max:c=d.max,reverse:m=d.reverse,style:p,tabIndex:b,emptyStyle:g,emptyClassName:k,progressStyle:f,progressClassName:v}=e,y=l.useRef(null),h=l.useCallback((()=>{y.current&&y.current.focus()}),[]);l.useImperativeHandle(r,(()=>({element:y.current,focus:h})));const N=e.value||d.value,C=null===e.value,x=s.useRtl(y,e.dir),E="vertical"===o,P={className:s.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!E,"k-progressbar-vertical":E,"k-progressbar-reverse":m,"k-progressbar-indeterminate":C,"k-disabled":n},t),ref:y,dir:x,tabIndex:s.getTabIndex(b,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":i,"aria-valuemax":c,"aria-valuenow":C?void 0:N,"aria-disabled":n,style:p},R=({count:e})=>{let r=[];const a=100/e+"%",t=((e,r,a)=>Math.max((a-e)/(r-e),1e-5))(i,c,N),n=Math.floor(t*e),o=Array(e).fill(!1);for(let e=0;e<n;e++)o[e]=!0;for(let t=0;t<e;++t){const n=o[t],i=n?v:k,c={width:E?void 0:a,height:E?a:void 0,...n?f:g};r.push(l.createElement("li",{key:t,className:s.classNames("k-progressbar-chunk",{"k-first":0===t,"k-last":t===e-1,"k-selected":n},i),style:c}))}return l.createElement(l.Fragment,null,r)};return l.createElement("div",{...P},l.createElement("ul",{className:"k-progressbar-chunks k-reset"},l.createElement(R,{count:a||d.chunkCount})))}));m.propTypes={chunkCount:a.number,ariaLabel:a.string,disabled:a.bool,reverse:a.bool,max:a.number,min:a.number,value:a.number,tabIndex:a.number,emptyStyle:a.object,emptyClassName:a.string,progressStyle:a.object,progressClassName:a.string};const d={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};m.defaultProps=d,m.displayName="KendoChunkProgressBar";const p=l.forwardRef(((e,r)=>{s.validatePackage(u);const{animation:a,disabled:n,reverse:m=b.reverse,orientation:d,labelVisible:p,labelPlacement:g,max:k=b.max,min:f=b.min,tabIndex:v,className:y,style:h,emptyStyle:N,emptyClassName:C,progressStyle:x,progressClassName:E}=e,P=l.useRef(null),R=l.useRef(null),w=l.useRef(null),I=l.useCallback((()=>{P.current&&P.current.focus()}),[]);l.useImperativeHandle(r,(()=>({element:P.current,progressStatusElement:R.current,progressStatusWrapElement:w.current,focus:I})));const S=e.value||b.value,j=(e=>{const r=l.useRef();return l.useEffect((()=>{r.current=e})),r.current})(S),O=null===e.value,T=s.useRtl(P,e.dir),K="vertical"===d,$=o(S),M={value:S},D=p?e.label?l.createElement("span",{className:"k-progress-status"},l.createElement(e.label,{...M})):l.createElement("span",{className:"k-progress-status"},$):void 0,L={className:s.classNames("k-progressbar",{"k-progressbar-horizontal":!K,"k-progressbar-vertical":K,"k-progressbar-reverse":m,"k-progressbar-indeterminate":O,"k-disabled":n},y),ref:P,dir:T,tabIndex:s.getTabIndex(v,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":f,"aria-valuemax":k,"aria-valuenow":O?void 0:S,"aria-disabled":n,style:h},q=s.classNames("k-progress-status-wrap",{"k-progress-start":"start"===g,"k-progress-center":"center"===g,"k-progress-end":"end"===g||void 0===g}),A="boolean"!=typeof a&&void 0!==a?a.duration:a?400:0,B=l.useCallback((()=>{const e=i(f,k,j);c(R,w,e,K)}),[K,k,f,j]),U=l.useCallback((e=>{const r=i(f,k,j+(S-j)*e);c(R,w,r,K)}),[f,k,j,S,K]),z=l.useCallback((()=>{const e=i(f,k,S);c(R,w,e,K)}),[K,k,f,S]);return t.useAnimation({duration:A,onStart:B,onUpdate:U,onEnd:z},[S,A]),l.createElement("div",{...L},l.createElement("span",{className:q+(C?" "+C:""),style:N},D),l.createElement("div",{className:"k-progressbar-value k-selected",style:x,ref:R},l.createElement("span",{className:q+(E?" "+E:""),ref:w},D)))}));p.propTypes={animation:a.any,ariaLabel:a.string,disabled:a.bool,reverse:a.bool,label:a.any,labelVisible:a.bool,labelPlacement:a.oneOf(["start","center","end"]),max:a.number,min:a.number,value:a.number,tabIndex:a.number,emptyStyle:a.object,emptyClassName:a.string,progressStyle:a.object,progressClassName:a.string};const b={animation:!1,min:0,max:100,value:0,disabled:!1,reverse:!1,labelVisible:!0};p.defaultProps=b,p.displayName="KendoProgressBar",e.ChunkProgressBar=m,e.ProgressBar=p}));
package/index.d.mts CHANGED
@@ -1,5 +1,213 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export * from './index';
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as React_2 from 'react';
9
+
10
+ /**
11
+ * @hidden
12
+ */
13
+ declare interface BaseProps {
14
+ /**
15
+ * Sets one of the two visually distinct types of progress bar.
16
+ *
17
+ * @hidden
18
+ */
19
+ type?: 'linear' | 'circular';
20
+ /**
21
+ * Sets the value of the progress bar. Has to be between `min` and `max` values. Defaults to `0`.
22
+ * Set `null` to enable the indeterminate state of the progress bar.
23
+ * See examples ([here]({% slug overview_progressbar %})) and ([here]({% slug overview_chunkprogressbar %})).
24
+ */
25
+ value?: number | null;
26
+ /**
27
+ * The minimum value of the progress bar. Defaults to `0`.
28
+ */
29
+ min?: number;
30
+ /**
31
+ * The maximum value of the progress bar. Defaults to `100`.
32
+ */
33
+ max?: number;
34
+ /**
35
+ * Represents the `dir` HTML attribute. This is used to switch from LTR to RTL.
36
+ */
37
+ dir?: string;
38
+ /**
39
+ * The accessible label of the component.
40
+ */
41
+ ariaLabel?: string;
42
+ /**
43
+ * Sets the disabled state of the progress bar.
44
+ * See examples ([here]({% slug progressbar_disabled %})) and ([here]({% slug chunkprogressbar_disabled %})).
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Defines the orientation of the progress bar.
49
+ * See examples ([here]({% slug progressbar_orientation %})) and ([here]({% slug chunkprogressbar_orientation %})).
50
+ * Defaults to `horizontal`.
51
+ */
52
+ orientation?: 'horizontal' | 'vertical';
53
+ /**
54
+ * If set to `true`, the progress bar will be reversed.
55
+ * See examples ([here]({% slug progressbar_direction %})) and ([here]({% slug chunkprogressbar_direction %})).
56
+ * Defaults to `false`.
57
+ */
58
+ reverse?: boolean;
59
+ /**
60
+ * Specifies a list of CSS classes that will be added to the progress bar element.
61
+ */
62
+ className?: string;
63
+ /**
64
+ * Sets additional CSS styles to the progress bar.
65
+ */
66
+ style?: React.CSSProperties;
67
+ /**
68
+ * The styles that are applied to the inner element which represents the empty portion of the progress bar.
69
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
70
+ */
71
+ emptyStyle?: React.CSSProperties;
72
+ /**
73
+ * Sets additional classes to the inner element which represents the empty portion of the progress bar.
74
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
75
+ */
76
+ emptyClassName?: string;
77
+ /**
78
+ * The styles that are applied to the inner element which represents the full portion of the progress bar.
79
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
80
+ */
81
+ progressStyle?: React.CSSProperties;
82
+ /**
83
+ * Sets additional classes to the inner element which represents the full portion of the progress bar.
84
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
85
+ */
86
+ progressClassName?: string;
87
+ /**
88
+ * Sets the `tabIndex` property of the progress bar.
89
+ */
90
+ tabIndex?: number;
91
+ }
92
+
93
+ /**
94
+ * Represents the [KendoReact ChunkProgressBar component]({% slug overview_chunkprogressbar %}).
95
+ *
96
+ * @example
97
+ * ```jsx
98
+ * const App = () => {
99
+ * return (
100
+ * <ChunkProgressBar value={40}/>
101
+ * );
102
+ * };
103
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
104
+ * ```
105
+ */
106
+ export declare const ChunkProgressBar: React_2.ForwardRefExoticComponent<ChunkProgressBarProps & React_2.RefAttributes<ChunkProgressBarHandle | null>>;
107
+
108
+ /**
109
+ * The ChunkProgressBar ref.
110
+ */
111
+ declare interface ChunkProgressBarHandle {
112
+ /**
113
+ * The ChunkProgressBar element.
114
+ */
115
+ element: HTMLDivElement | null;
116
+ /**
117
+ * Focus the ChunkProgressBar.
118
+ */
119
+ focus: () => void;
120
+ }
121
+
122
+ /**
123
+ * Represents the props of the [KendoReact ChunkProgressBar component]({% slug overview_chunkprogressbar %}).
124
+ */
125
+ export declare interface ChunkProgressBarProps extends BaseProps {
126
+ /**
127
+ * Sets the number of chunks into which the ChunkProgressBar will be split. Defaults to `5`.
128
+ */
129
+ chunkCount?: number;
130
+ }
131
+
132
+ /**
133
+ * An interface for the ProgressBar label.
134
+ */
135
+ export declare interface LabelProps {
136
+ /**
137
+ * Represents the current value of the ProgressBar.
138
+ */
139
+ value?: number | null;
140
+ }
141
+
142
+ /**
143
+ * Represents the [KendoReact ProgressBar component]({% slug overview_progressbar %}).
144
+ *
145
+ * @example
146
+ * ```jsx
147
+ * const App = () => {
148
+ * return (
149
+ * <ProgressBar value={75}/>
150
+ * );
151
+ * };
152
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
153
+ * ```
154
+ */
155
+ export declare const ProgressBar: React_2.ForwardRefExoticComponent<ProgressBarProps & React_2.RefAttributes<ProgressBarHandle | null>>;
156
+
157
+ /**
158
+ * Specifies the animation settings of the ProgressBar.
159
+ */
160
+ export declare interface ProgressBarAnimation {
161
+ /**
162
+ * Specifies the duration of the ProgressBar animation. Defaults to `400`.
163
+ */
164
+ duration: number;
165
+ }
166
+
167
+ /**
168
+ * The ProgressBar ref.
169
+ */
170
+ export declare interface ProgressBarHandle {
171
+ /**
172
+ * The ProgressBar element.
173
+ */
174
+ element: HTMLDivElement | null;
175
+ /**
176
+ * The progress status element.
177
+ */
178
+ progressStatusElement: HTMLDivElement | null;
179
+ /**
180
+ * The progress status wrap element.
181
+ */
182
+ progressStatusWrapElement: HTMLSpanElement | null;
183
+ /**
184
+ * Focus the ProgressBar.
185
+ */
186
+ focus: () => void;
187
+ }
188
+
189
+ /**
190
+ * Represents the props of the [KendoReact ProgressBar component]({% slug overview_progressbar %}).
191
+ */
192
+ export declare interface ProgressBarProps extends BaseProps {
193
+ /**
194
+ * Specifies the animation settings of the ProgressBar. Defaults to `false`.
195
+ * If boolean, enables or disables the default animation.
196
+ * Use ProgressBarAnimation to set slide animation with customizable duration option. Accepts a number in milliseconds.
197
+ */
198
+ animation?: boolean | ProgressBarAnimation;
199
+ /**
200
+ * Overrides the default label ([see example]({% slug progressbar_label %})).
201
+ */
202
+ label?: React.ComponentType<LabelProps>;
203
+ /**
204
+ * Sets the visibility of the progress status label. Defaults to `true`.
205
+ */
206
+ labelVisible?: boolean;
207
+ /**
208
+ * Sets the position of the progress status label. Defaults to `end` ([see example]({% slug progressbar_label %})).
209
+ */
210
+ labelPlacement?: 'start' | 'center' | 'end';
211
+ }
212
+
213
+ export { }
package/index.d.ts CHANGED
@@ -1,11 +1,213 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export * from './chunkprogressbar/ChunkProgressBar';
6
- export * from './chunkprogressbar/interfaces/ChunkProgressBarProps';
7
- export * from './progressbar/ProgressBar';
8
- export * from './progressbar/interfaces/ProgressBarHandle';
9
- export * from './progressbar/interfaces/ProgressBarProps';
10
- export * from './progressbar/interfaces/ProgressBarAnimation';
11
- export * from './progressbar/interfaces/LabelProps';
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as React_2 from 'react';
9
+
10
+ /**
11
+ * @hidden
12
+ */
13
+ declare interface BaseProps {
14
+ /**
15
+ * Sets one of the two visually distinct types of progress bar.
16
+ *
17
+ * @hidden
18
+ */
19
+ type?: 'linear' | 'circular';
20
+ /**
21
+ * Sets the value of the progress bar. Has to be between `min` and `max` values. Defaults to `0`.
22
+ * Set `null` to enable the indeterminate state of the progress bar.
23
+ * See examples ([here]({% slug overview_progressbar %})) and ([here]({% slug overview_chunkprogressbar %})).
24
+ */
25
+ value?: number | null;
26
+ /**
27
+ * The minimum value of the progress bar. Defaults to `0`.
28
+ */
29
+ min?: number;
30
+ /**
31
+ * The maximum value of the progress bar. Defaults to `100`.
32
+ */
33
+ max?: number;
34
+ /**
35
+ * Represents the `dir` HTML attribute. This is used to switch from LTR to RTL.
36
+ */
37
+ dir?: string;
38
+ /**
39
+ * The accessible label of the component.
40
+ */
41
+ ariaLabel?: string;
42
+ /**
43
+ * Sets the disabled state of the progress bar.
44
+ * See examples ([here]({% slug progressbar_disabled %})) and ([here]({% slug chunkprogressbar_disabled %})).
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Defines the orientation of the progress bar.
49
+ * See examples ([here]({% slug progressbar_orientation %})) and ([here]({% slug chunkprogressbar_orientation %})).
50
+ * Defaults to `horizontal`.
51
+ */
52
+ orientation?: 'horizontal' | 'vertical';
53
+ /**
54
+ * If set to `true`, the progress bar will be reversed.
55
+ * See examples ([here]({% slug progressbar_direction %})) and ([here]({% slug chunkprogressbar_direction %})).
56
+ * Defaults to `false`.
57
+ */
58
+ reverse?: boolean;
59
+ /**
60
+ * Specifies a list of CSS classes that will be added to the progress bar element.
61
+ */
62
+ className?: string;
63
+ /**
64
+ * Sets additional CSS styles to the progress bar.
65
+ */
66
+ style?: React.CSSProperties;
67
+ /**
68
+ * The styles that are applied to the inner element which represents the empty portion of the progress bar.
69
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
70
+ */
71
+ emptyStyle?: React.CSSProperties;
72
+ /**
73
+ * Sets additional classes to the inner element which represents the empty portion of the progress bar.
74
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
75
+ */
76
+ emptyClassName?: string;
77
+ /**
78
+ * The styles that are applied to the inner element which represents the full portion of the progress bar.
79
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
80
+ */
81
+ progressStyle?: React.CSSProperties;
82
+ /**
83
+ * Sets additional classes to the inner element which represents the full portion of the progress bar.
84
+ * See examples ([here]({% slug progressbar_appearance %})) and ([here]({% slug chunkprogressbar_appearance %})).
85
+ */
86
+ progressClassName?: string;
87
+ /**
88
+ * Sets the `tabIndex` property of the progress bar.
89
+ */
90
+ tabIndex?: number;
91
+ }
92
+
93
+ /**
94
+ * Represents the [KendoReact ChunkProgressBar component]({% slug overview_chunkprogressbar %}).
95
+ *
96
+ * @example
97
+ * ```jsx
98
+ * const App = () => {
99
+ * return (
100
+ * <ChunkProgressBar value={40}/>
101
+ * );
102
+ * };
103
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
104
+ * ```
105
+ */
106
+ export declare const ChunkProgressBar: React_2.ForwardRefExoticComponent<ChunkProgressBarProps & React_2.RefAttributes<ChunkProgressBarHandle | null>>;
107
+
108
+ /**
109
+ * The ChunkProgressBar ref.
110
+ */
111
+ declare interface ChunkProgressBarHandle {
112
+ /**
113
+ * The ChunkProgressBar element.
114
+ */
115
+ element: HTMLDivElement | null;
116
+ /**
117
+ * Focus the ChunkProgressBar.
118
+ */
119
+ focus: () => void;
120
+ }
121
+
122
+ /**
123
+ * Represents the props of the [KendoReact ChunkProgressBar component]({% slug overview_chunkprogressbar %}).
124
+ */
125
+ export declare interface ChunkProgressBarProps extends BaseProps {
126
+ /**
127
+ * Sets the number of chunks into which the ChunkProgressBar will be split. Defaults to `5`.
128
+ */
129
+ chunkCount?: number;
130
+ }
131
+
132
+ /**
133
+ * An interface for the ProgressBar label.
134
+ */
135
+ export declare interface LabelProps {
136
+ /**
137
+ * Represents the current value of the ProgressBar.
138
+ */
139
+ value?: number | null;
140
+ }
141
+
142
+ /**
143
+ * Represents the [KendoReact ProgressBar component]({% slug overview_progressbar %}).
144
+ *
145
+ * @example
146
+ * ```jsx
147
+ * const App = () => {
148
+ * return (
149
+ * <ProgressBar value={75}/>
150
+ * );
151
+ * };
152
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
153
+ * ```
154
+ */
155
+ export declare const ProgressBar: React_2.ForwardRefExoticComponent<ProgressBarProps & React_2.RefAttributes<ProgressBarHandle | null>>;
156
+
157
+ /**
158
+ * Specifies the animation settings of the ProgressBar.
159
+ */
160
+ export declare interface ProgressBarAnimation {
161
+ /**
162
+ * Specifies the duration of the ProgressBar animation. Defaults to `400`.
163
+ */
164
+ duration: number;
165
+ }
166
+
167
+ /**
168
+ * The ProgressBar ref.
169
+ */
170
+ export declare interface ProgressBarHandle {
171
+ /**
172
+ * The ProgressBar element.
173
+ */
174
+ element: HTMLDivElement | null;
175
+ /**
176
+ * The progress status element.
177
+ */
178
+ progressStatusElement: HTMLDivElement | null;
179
+ /**
180
+ * The progress status wrap element.
181
+ */
182
+ progressStatusWrapElement: HTMLSpanElement | null;
183
+ /**
184
+ * Focus the ProgressBar.
185
+ */
186
+ focus: () => void;
187
+ }
188
+
189
+ /**
190
+ * Represents the props of the [KendoReact ProgressBar component]({% slug overview_progressbar %}).
191
+ */
192
+ export declare interface ProgressBarProps extends BaseProps {
193
+ /**
194
+ * Specifies the animation settings of the ProgressBar. Defaults to `false`.
195
+ * If boolean, enables or disables the default animation.
196
+ * Use ProgressBarAnimation to set slide animation with customizable duration option. Accepts a number in milliseconds.
197
+ */
198
+ animation?: boolean | ProgressBarAnimation;
199
+ /**
200
+ * Overrides the default label ([see example]({% slug progressbar_label %})).
201
+ */
202
+ label?: React.ComponentType<LabelProps>;
203
+ /**
204
+ * Sets the visibility of the progress status label. Defaults to `true`.
205
+ */
206
+ labelVisible?: boolean;
207
+ /**
208
+ * Sets the position of the progress status label. Defaults to `end` ([see example]({% slug progressbar_label %})).
209
+ */
210
+ labelPlacement?: 'start' | 'center' | 'end';
211
+ }
212
+
213
+ export { }