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