@progress/kendo-react-progressbars 8.1.0-develop.22 → 8.1.0-develop.24
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/chunkprogressbar/ChunkProgressBar.js +1 -1
- package/chunkprogressbar/ChunkProgressBar.mjs +19 -20
- package/dist/cdn/js/kendo-react-progressbars.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +3 -3
- package/progressbar/ProgressBar.js +1 -1
- package/progressbar/ProgressBar.mjs +47 -48
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
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(
|
|
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(r){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(l,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}return l.default=r,Object.freeze(l)}const s=F(D),g=s.forwardRef((r,l)=>{u.validatePackage(A.packageMetadata);const{chunkCount:a=n.chunkCount,className:i,disabled:d=n.disabled,orientation:N,min:k=n.min,max:p=n.max,reverse:P=n.reverse,style:S,tabIndex:x,emptyStyle:R,emptyClassName:j,progressStyle:E,progressClassName:O}=r,o=s.useRef(null),q=s.useCallback(()=>{o.current&&o.current.focus()},[]);s.useImperativeHandle(l,()=>({element:o.current,focus:q}));const f=r.value||n.value,y=r.value===null,w=u.useRtl(o,r.dir),m=N==="vertical",I={className:u.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!m,"k-progressbar-vertical":m,"k-progressbar-reverse":P,"k-progressbar-indeterminate":y,"k-disabled":d},i),ref:o,dir:w,tabIndex:u.getTabIndex(x,d),role:"progressbar","aria-label":r.ariaLabel,"aria-valuemin":k,"aria-valuemax":p,"aria-valuenow":y?void 0:f,"aria-disabled":d,style:S},M=({count:c})=>{let v=[];const h=100/c+"%",T=L.calculateRatio(k,p,f),z=Math.floor(T*c),C=Array(c).fill(!1);for(let t=0;t<z;t++)C[t]=!0;for(let t=0;t<c;++t){const b=C[t],B=b?O:j,_={...{width:m?void 0:h,height:m?h:void 0},...b?E:R};v.push(s.createElement("li",{key:t,className:u.classNames("k-progressbar-chunk",{"k-first":t===0,"k-last":t===c-1,"k-selected":b},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:a})))});g.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 n={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};g.displayName="KendoChunkProgressBar";exports.ChunkProgressBar=g;
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as s from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { validatePackage as H, useRtl as K, classNames as
|
|
11
|
+
import { validatePackage as H, useRtl as K, classNames as f, getTabIndex as V } from "@progress/kendo-react-common";
|
|
12
12
|
import { calculateRatio as q } from "../common/utils.mjs";
|
|
13
13
|
import { packageMetadata as D } from "../package-metadata.mjs";
|
|
14
|
-
const
|
|
14
|
+
const v = s.forwardRef((t, y) => {
|
|
15
15
|
H(D);
|
|
16
16
|
const {
|
|
17
17
|
chunkCount: h = a.chunkCount,
|
|
18
18
|
className: C,
|
|
19
|
-
disabled: c,
|
|
19
|
+
disabled: c = a.disabled,
|
|
20
20
|
orientation: x,
|
|
21
21
|
min: m = a.min,
|
|
22
|
-
max:
|
|
22
|
+
max: u = a.max,
|
|
23
23
|
reverse: N = a.reverse,
|
|
24
24
|
style: P,
|
|
25
25
|
tabIndex: S,
|
|
@@ -37,14 +37,14 @@ const u = s.forwardRef((t, y) => {
|
|
|
37
37
|
element: l.current,
|
|
38
38
|
focus: T
|
|
39
39
|
}));
|
|
40
|
-
const
|
|
41
|
-
className:
|
|
40
|
+
const d = t.value || a.value, p = t.value === null, j = K(l, t.dir), o = x === "vertical", z = {
|
|
41
|
+
className: f(
|
|
42
42
|
"k-progressbar k-chunk-progressbar",
|
|
43
43
|
{
|
|
44
44
|
"k-progressbar-horizontal": !o,
|
|
45
45
|
"k-progressbar-vertical": o,
|
|
46
46
|
"k-progressbar-reverse": N,
|
|
47
|
-
"k-progressbar-indeterminate":
|
|
47
|
+
"k-progressbar-indeterminate": p,
|
|
48
48
|
"k-disabled": c
|
|
49
49
|
},
|
|
50
50
|
C
|
|
@@ -55,26 +55,26 @@ const u = s.forwardRef((t, y) => {
|
|
|
55
55
|
role: "progressbar",
|
|
56
56
|
"aria-label": t.ariaLabel,
|
|
57
57
|
"aria-valuemin": m,
|
|
58
|
-
"aria-valuemax":
|
|
59
|
-
"aria-valuenow":
|
|
58
|
+
"aria-valuemax": u,
|
|
59
|
+
"aria-valuenow": p ? void 0 : d,
|
|
60
60
|
"aria-disabled": c,
|
|
61
61
|
style: P
|
|
62
62
|
}, B = ({ count: n }) => {
|
|
63
63
|
let b = [];
|
|
64
|
-
const
|
|
64
|
+
const k = 100 / n + "%", L = q(m, u, d), M = Math.floor(L * n), g = Array(n).fill(!1);
|
|
65
65
|
for (let r = 0; r < M; r++)
|
|
66
|
-
|
|
66
|
+
g[r] = !0;
|
|
67
67
|
for (let r = 0; r < n; ++r) {
|
|
68
|
-
const i =
|
|
69
|
-
width: o ? void 0 :
|
|
70
|
-
height: o ?
|
|
68
|
+
const i = g[r], A = i ? w : E, F = { ...{
|
|
69
|
+
width: o ? void 0 : k,
|
|
70
|
+
height: o ? k : void 0
|
|
71
71
|
}, ...i ? I : R };
|
|
72
72
|
b.push(
|
|
73
73
|
/* @__PURE__ */ s.createElement(
|
|
74
74
|
"li",
|
|
75
75
|
{
|
|
76
76
|
key: r,
|
|
77
|
-
className:
|
|
77
|
+
className: f(
|
|
78
78
|
"k-progressbar-chunk",
|
|
79
79
|
{
|
|
80
80
|
"k-first": r === 0,
|
|
@@ -90,9 +90,9 @@ const u = s.forwardRef((t, y) => {
|
|
|
90
90
|
}
|
|
91
91
|
return /* @__PURE__ */ s.createElement(s.Fragment, null, b);
|
|
92
92
|
};
|
|
93
|
-
return /* @__PURE__ */ s.createElement("div", { ...z }, /* @__PURE__ */ s.createElement("ul", { className: "k-progressbar-chunks k-reset" }, /* @__PURE__ */ s.createElement(B, { count: h
|
|
93
|
+
return /* @__PURE__ */ s.createElement("div", { ...z }, /* @__PURE__ */ s.createElement("ul", { className: "k-progressbar-chunks k-reset" }, /* @__PURE__ */ s.createElement(B, { count: h })));
|
|
94
94
|
});
|
|
95
|
-
|
|
95
|
+
v.propTypes = {
|
|
96
96
|
chunkCount: e.number,
|
|
97
97
|
ariaLabel: e.string,
|
|
98
98
|
disabled: e.bool,
|
|
@@ -114,8 +114,7 @@ const a = {
|
|
|
114
114
|
disabled: !1,
|
|
115
115
|
reverse: !1
|
|
116
116
|
};
|
|
117
|
-
|
|
118
|
-
u.displayName = "KendoChunkProgressBar";
|
|
117
|
+
v.displayName = "KendoChunkProgressBar";
|
|
119
118
|
export {
|
|
120
|
-
|
|
119
|
+
v as ChunkProgressBar
|
|
121
120
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
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=
|
|
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,r,a)=>{const s=Math.abs((r-e)/100);return Math.abs((a-e)/s)},i=(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%")},c={name:"@progress/kendo-react-progressbars",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},u=l.forwardRef(((e,r)=>{s.validatePackage(c);const{chunkCount:a=m.chunkCount,className:t,disabled:n=m.disabled,orientation:o,min:i=m.min,max:u=m.max,reverse:d=m.reverse,style:b,tabIndex:p,emptyStyle:g,emptyClassName:k,progressStyle:v,progressClassName:f}=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||m.value,x=null===e.value,C=s.useRtl(y,e.dir),E="vertical"===o,R={className:s.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!E,"k-progressbar-vertical":E,"k-progressbar-reverse":d,"k-progressbar-indeterminate":x,"k-disabled":n},t),ref:y,dir:C,tabIndex:s.getTabIndex(p,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":i,"aria-valuemax":u,"aria-valuenow":x?void 0:N,"aria-disabled":n,style:b},P=({count:e})=>{let r=[];const a=100/e+"%",t=((e,r,a)=>Math.max((a-e)/(r-e),1e-5))(i,u,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?f:k,c={width:E?void 0:a,height:E?a:void 0,...n?v: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",{...R},l.createElement("ul",{className:"k-progressbar-chunks k-reset"},l.createElement(P,{count:a})))}));u.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 m={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};u.displayName="KendoChunkProgressBar";const d=l.forwardRef(((e,r)=>{s.validatePackage(c);const{animation:a=b.animation,disabled:n=b.disabled,reverse:u=b.reverse,orientation:m,labelVisible:d=b.labelVisible,labelPlacement:p,max:g=b.max,min:k=b.min,tabIndex:v,className:f,style:y,emptyStyle:h,emptyClassName:N,progressStyle:x,progressClassName:C}=e,E=l.useRef(null),R=l.useRef(null),P=l.useRef(null),w=l.useCallback((()=>{E.current&&E.current.focus()}),[]);l.useImperativeHandle(r,(()=>({element:E.current,progressStatusElement:R.current,progressStatusWrapElement:P.current,focus:w})));const I=e.value||b.value,S=(e=>{const r=l.useRef();return l.useEffect((()=>{r.current=e})),r.current})(I),j=null===e.value,O=s.useRtl(E,e.dir),T="vertical"===m,K=(e=>{const r=e.toString().split(".");return 1===r.length?`${r[0]}`:`${r[0]}.${r[1].substr(0,3)}`})(I),$={value:I},M=d?e.label?l.createElement("span",{className:"k-progress-status"},l.createElement(e.label,{...$})):l.createElement("span",{className:"k-progress-status"},K):void 0,D={className:s.classNames("k-progressbar",{"k-progressbar-horizontal":!T,"k-progressbar-vertical":T,"k-progressbar-reverse":u,"k-progressbar-indeterminate":j,"k-disabled":n},f),ref:E,dir:O,tabIndex:s.getTabIndex(v,n),role:"progressbar","aria-label":e.ariaLabel,"aria-valuemin":k,"aria-valuemax":g,"aria-valuenow":j?void 0:I,"aria-disabled":n,style:y},L=s.classNames("k-progress-status-wrap",{"k-progress-start":"start"===p,"k-progress-center":"center"===p,"k-progress-end":"end"===p||void 0===p}),q="boolean"!=typeof a&&void 0!==a?a.duration:a?400:0,A=l.useCallback((()=>{const e=o(k,g,S);i(R,P,e,T)}),[T,g,k,S]),B=l.useCallback((e=>{const r=o(k,g,S+(I-S)*e);i(R,P,r,T)}),[k,g,S,I,T]),U=l.useCallback((()=>{const e=o(k,g,I);i(R,P,e,T)}),[T,g,k,I]);return t.useAnimation({duration:q,onStart:A,onUpdate:B,onEnd:U},[I,q]),l.createElement("div",{...D},l.createElement("span",{className:L+(N?" "+N:""),style:h},M),l.createElement("div",{className:"k-progressbar-value k-selected",style:x,ref:R},l.createElement("span",{className:L+(C?" "+C:""),ref:P},M)))}));d.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};d.displayName="KendoProgressBar",e.ChunkProgressBar=u,e.ProgressBar=d}));
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-progressbars",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1719230959,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-progressbars",
|
|
3
|
-
"version": "8.1.0-develop.
|
|
3
|
+
"version": "8.1.0-develop.24",
|
|
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",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-animation": "8.1.0-develop.
|
|
27
|
-
"@progress/kendo-react-common": "8.1.0-develop.
|
|
26
|
+
"@progress/kendo-react-animation": "8.1.0-develop.24",
|
|
27
|
+
"@progress/kendo-react-common": "8.1.0-develop.24",
|
|
28
28
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
29
29
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
30
30
|
},
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),a=require("prop-types"),H=require("@progress/kendo-react-animation"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),a=require("prop-types"),H=require("@progress/kendo-react-animation"),v=require("@progress/kendo-react-common"),c=require("../common/utils.js"),K=require("./hooks/usePrevious.js"),C=require("../common/constants.js"),G=require("../package-metadata.js");function J(t){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(m,s,u.get?u:{enumerable:!0,get:()=>t[s]})}}return m.default=t,Object.freeze(m)}const e=J(F),y=e.forwardRef((t,m)=>{v.validatePackage(G.packageMetadata);const{animation:s=i.animation,disabled:u=i.disabled,reverse:I=i.reverse,orientation:x,labelVisible:T=i.labelVisible,labelPlacement:k,max:l=i.max,min:o=i.min,tabIndex:q,className:A,style:j,emptyStyle:M,emptyClassName:N,progressStyle:V,progressClassName:P}=t,d=e.useRef(null),b=e.useRef(null),p=e.useRef(null),_=e.useCallback(()=>{d.current&&d.current.focus()},[]);e.useImperativeHandle(m,()=>({element:d.current,progressStatusElement:b.current,progressStatusWrapElement:p.current,focus:_}));const r=t.value||i.value,g=K.usePrevious(r),S=t.value===null,w=v.useRtl(d,t.dir),n=x==="vertical",D=c.truncateNumber(r),L={value:r},E=T?t.label?e.createElement("span",{className:"k-progress-status"},e.createElement(t.label,{...L})):e.createElement("span",{className:"k-progress-status"},D):void 0,h={className:v.classNames("k-progressbar",{"k-progressbar-horizontal":!n,"k-progressbar-vertical":n,"k-progressbar-reverse":I,"k-progressbar-indeterminate":S,"k-disabled":u},A),ref:d,dir:w,tabIndex:v.getTabIndex(q,u),role:"progressbar","aria-label":t.ariaLabel,"aria-valuemin":o,"aria-valuemax":l,"aria-valuenow":S?void 0:r,"aria-disabled":u,style:j},R=v.classNames("k-progress-status-wrap",{"k-progress-start":k==="start","k-progress-center":k==="center","k-progress-end":k==="end"||k===void 0}),O=typeof s!="boolean"&&s!==void 0?s.duration:s?C.DEFAULT_ANIMATION_DURATION:C.NO_ANIMATION,U=e.useCallback(()=>{const f=c.calculatePercentage(o,l,g);c.updateProgress(b,p,f,n)},[n,l,o,g]),B=e.useCallback(f=>{const W=c.calculatePercentage(o,l,g+(r-g)*f);c.updateProgress(b,p,W,n)},[o,l,g,r,n]),z=e.useCallback(()=>{const f=c.calculatePercentage(o,l,r);c.updateProgress(b,p,f,n)},[n,l,o,r]);return H.useAnimation({duration:O,onStart:U,onUpdate:B,onEnd:z},[r,O]),e.createElement("div",{...h},e.createElement("span",{className:R+(N?" "+N:""),style:M},E),e.createElement("div",{className:"k-progressbar-value k-selected",style:V,ref:b},e.createElement("span",{className:R+(P?" "+P:""),ref:p},E)))});y.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};y.displayName="KendoProgressBar";exports.ProgressBar=y;
|
|
@@ -9,117 +9,117 @@
|
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import a from "prop-types";
|
|
11
11
|
import { useAnimation as H } from "@progress/kendo-react-animation";
|
|
12
|
-
import { validatePackage as K, useRtl as q, classNames as
|
|
12
|
+
import { validatePackage as K, useRtl as q, classNames as I, getTabIndex as G } from "@progress/kendo-react-common";
|
|
13
13
|
import { truncateNumber as J, updateProgress as f, calculatePercentage as v } from "../common/utils.mjs";
|
|
14
14
|
import { usePrevious as Q } from "./hooks/usePrevious.mjs";
|
|
15
15
|
import { DEFAULT_ANIMATION_DURATION as X, NO_ANIMATION as Y } from "../common/constants.mjs";
|
|
16
16
|
import { packageMetadata as Z } from "../package-metadata.mjs";
|
|
17
|
-
const
|
|
17
|
+
const R = e.forwardRef((t, S) => {
|
|
18
18
|
K(Z);
|
|
19
19
|
const {
|
|
20
|
-
animation: b,
|
|
21
|
-
disabled: g,
|
|
22
|
-
reverse: C =
|
|
20
|
+
animation: b = o.animation,
|
|
21
|
+
disabled: g = o.disabled,
|
|
22
|
+
reverse: C = o.reverse,
|
|
23
23
|
orientation: A,
|
|
24
|
-
labelVisible: T,
|
|
24
|
+
labelVisible: T = o.labelVisible,
|
|
25
25
|
labelPlacement: d,
|
|
26
|
-
max: l =
|
|
27
|
-
min: n =
|
|
28
|
-
tabIndex:
|
|
29
|
-
className:
|
|
30
|
-
style:
|
|
26
|
+
max: l = o.max,
|
|
27
|
+
min: n = o.min,
|
|
28
|
+
tabIndex: V,
|
|
29
|
+
className: L,
|
|
30
|
+
style: O,
|
|
31
31
|
emptyStyle: h,
|
|
32
|
-
emptyClassName:
|
|
32
|
+
emptyClassName: k,
|
|
33
33
|
progressStyle: w,
|
|
34
|
-
progressClassName:
|
|
35
|
-
} = t,
|
|
34
|
+
progressClassName: N
|
|
35
|
+
} = t, i = e.useRef(null), c = e.useRef(null), m = e.useRef(null), U = e.useCallback(
|
|
36
36
|
() => {
|
|
37
|
-
|
|
37
|
+
i.current && i.current.focus();
|
|
38
38
|
},
|
|
39
39
|
[]
|
|
40
40
|
);
|
|
41
41
|
e.useImperativeHandle(
|
|
42
42
|
S,
|
|
43
43
|
() => ({
|
|
44
|
-
element:
|
|
45
|
-
progressStatusElement:
|
|
46
|
-
progressStatusWrapElement:
|
|
44
|
+
element: i.current,
|
|
45
|
+
progressStatusElement: c.current,
|
|
46
|
+
progressStatusWrapElement: m.current,
|
|
47
47
|
focus: U
|
|
48
48
|
})
|
|
49
49
|
);
|
|
50
|
-
const r = t.value ||
|
|
50
|
+
const r = t.value || o.value, u = Q(r), y = t.value === null, D = q(i, t.dir), s = A === "vertical", M = J(r), _ = {
|
|
51
51
|
value: r
|
|
52
52
|
}, E = T ? t.label ? /* @__PURE__ */ e.createElement("span", { className: "k-progress-status" }, /* @__PURE__ */ e.createElement(t.label, { ..._ })) : /* @__PURE__ */ e.createElement("span", { className: "k-progress-status" }, M) : void 0, j = {
|
|
53
|
-
className:
|
|
53
|
+
className: I(
|
|
54
54
|
"k-progressbar",
|
|
55
55
|
{
|
|
56
56
|
"k-progressbar-horizontal": !s,
|
|
57
57
|
"k-progressbar-vertical": s,
|
|
58
58
|
"k-progressbar-reverse": C,
|
|
59
|
-
"k-progressbar-indeterminate":
|
|
59
|
+
"k-progressbar-indeterminate": y,
|
|
60
60
|
"k-disabled": g
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
L
|
|
63
63
|
),
|
|
64
|
-
ref:
|
|
64
|
+
ref: i,
|
|
65
65
|
dir: D,
|
|
66
|
-
tabIndex: G(
|
|
66
|
+
tabIndex: G(V, g),
|
|
67
67
|
role: "progressbar",
|
|
68
68
|
"aria-label": t.ariaLabel,
|
|
69
69
|
"aria-valuemin": n,
|
|
70
70
|
"aria-valuemax": l,
|
|
71
|
-
"aria-valuenow":
|
|
71
|
+
"aria-valuenow": y ? void 0 : r,
|
|
72
72
|
"aria-disabled": g,
|
|
73
|
-
style:
|
|
74
|
-
},
|
|
73
|
+
style: O
|
|
74
|
+
}, P = I("k-progress-status-wrap", {
|
|
75
75
|
"k-progress-start": d === "start",
|
|
76
76
|
"k-progress-center": d === "center",
|
|
77
77
|
"k-progress-end": d === "end" || d === void 0
|
|
78
|
-
}),
|
|
78
|
+
}), x = typeof b != "boolean" && b !== void 0 ? b.duration : b ? X : Y, B = e.useCallback(
|
|
79
79
|
() => {
|
|
80
|
-
const
|
|
81
|
-
f(
|
|
80
|
+
const p = v(n, l, u);
|
|
81
|
+
f(c, m, p, s);
|
|
82
82
|
},
|
|
83
|
-
[s, l, n,
|
|
83
|
+
[s, l, n, u]
|
|
84
84
|
), W = e.useCallback(
|
|
85
|
-
(
|
|
86
|
-
const F = v(n, l,
|
|
87
|
-
f(
|
|
85
|
+
(p) => {
|
|
86
|
+
const F = v(n, l, u + (r - u) * p);
|
|
87
|
+
f(c, m, F, s);
|
|
88
88
|
},
|
|
89
|
-
[n, l,
|
|
89
|
+
[n, l, u, r, s]
|
|
90
90
|
), z = e.useCallback(
|
|
91
91
|
() => {
|
|
92
|
-
const
|
|
93
|
-
f(
|
|
92
|
+
const p = v(n, l, r);
|
|
93
|
+
f(c, m, p, s);
|
|
94
94
|
},
|
|
95
95
|
[s, l, n, r]
|
|
96
96
|
);
|
|
97
97
|
return H(
|
|
98
98
|
{
|
|
99
|
-
duration:
|
|
99
|
+
duration: x,
|
|
100
100
|
onStart: B,
|
|
101
101
|
onUpdate: W,
|
|
102
102
|
onEnd: z
|
|
103
103
|
},
|
|
104
|
-
[r,
|
|
105
|
-
), /* @__PURE__ */ e.createElement("div", { ...j }, /* @__PURE__ */ e.createElement("span", { className:
|
|
104
|
+
[r, x]
|
|
105
|
+
), /* @__PURE__ */ e.createElement("div", { ...j }, /* @__PURE__ */ e.createElement("span", { className: P + (k ? " " + k : ""), style: h }, E), /* @__PURE__ */ e.createElement(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
108
|
className: "k-progressbar-value k-selected",
|
|
109
109
|
style: w,
|
|
110
|
-
ref:
|
|
110
|
+
ref: c
|
|
111
111
|
},
|
|
112
112
|
/* @__PURE__ */ e.createElement(
|
|
113
113
|
"span",
|
|
114
114
|
{
|
|
115
|
-
className:
|
|
116
|
-
ref:
|
|
115
|
+
className: P + (N ? " " + N : ""),
|
|
116
|
+
ref: m
|
|
117
117
|
},
|
|
118
118
|
E
|
|
119
119
|
)
|
|
120
120
|
));
|
|
121
121
|
});
|
|
122
|
-
|
|
122
|
+
R.propTypes = {
|
|
123
123
|
animation: a.any,
|
|
124
124
|
ariaLabel: a.string,
|
|
125
125
|
disabled: a.bool,
|
|
@@ -136,7 +136,7 @@ k.propTypes = {
|
|
|
136
136
|
progressStyle: a.object,
|
|
137
137
|
progressClassName: a.string
|
|
138
138
|
};
|
|
139
|
-
const
|
|
139
|
+
const o = {
|
|
140
140
|
animation: !1,
|
|
141
141
|
min: 0,
|
|
142
142
|
max: 100,
|
|
@@ -145,8 +145,7 @@ const p = {
|
|
|
145
145
|
reverse: !1,
|
|
146
146
|
labelVisible: !0
|
|
147
147
|
};
|
|
148
|
-
|
|
149
|
-
k.displayName = "KendoProgressBar";
|
|
148
|
+
R.displayName = "KendoProgressBar";
|
|
150
149
|
export {
|
|
151
|
-
|
|
150
|
+
R as ProgressBar
|
|
152
151
|
};
|