@progress/kendo-react-progressbars 7.2.4-develop.2 → 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.
package/index.js CHANGED
@@ -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
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),s=require("prop-types"),u=require("@progress/kendo-react-common"),G=require("@progress/kendo-react-animation");function J(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 t=J(W),Q=1e-5,X=3,Y=400,Z=0,ee=e=>{const a=e.toString().split(".");return a.length===1?`${a[0]}`:`${a[0]}.${a[1].substr(0,X)}`},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),Q),F={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,a)=>{u.validatePackage(F);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:j,progressStyle:_,progressClassName:R}=e,f=t.useRef(null),O=t.useCallback(()=>{f.current&&f.current.focus()},[]);t.useImperativeHandle(a,()=>({element:f.current,focus:O}));const b=e.value||h.value,p=e.value===null,v=u.useRtl(f,e.dir),C=N==="vertical",o={className:u.classNames("k-progressbar k-chunk-progressbar",{"k-progressbar-horizontal":!C,"k-progressbar-vertical":C,"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 w=[];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 P=E[l],T=P?R:j,U={...{width:C?void 0:c,height:C?c:void 0},...P?_:D};w.push(t.createElement("li",{key:l,className:u.classNames("k-progressbar-chunk",{"k-first":l===0,"k-last":l===g-1,"k-selected":P},T),style:U}))}return t.createElement(t.Fragment,null,w)};return t.createElement("div",{...o},t.createElement("ul",{className:"k-progressbar-chunks k-reset"},t.createElement(y,{count:r||h.chunkCount})))});A.propTypes={chunkCount:s.number,ariaLabel:s.string,disabled:s.bool,reverse:s.bool,max:s.number,min:s.number,value:s.number,tabIndex:s.number,emptyStyle:s.object,emptyClassName:s.string,progressStyle:s.object,progressClassName:s.string};const h={chunkCount:5,min:0,max:100,value:0,disabled:!1,reverse:!1};A.defaultProps=h;A.displayName="KendoChunkProgressBar";const se=e=>{const a=t.useRef();return t.useEffect(()=>{a.current=e}),a.current},M=t.forwardRef((e,a)=>{u.validatePackage(F);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:j,emptyStyle:_,emptyClassName:R,progressStyle:f,progressClassName:O}=e,b=t.useRef(null),p=t.useRef(null),v=t.useRef(null),C=t.useCallback(()=>{b.current&&b.current.focus()},[]);t.useImperativeHandle(a,()=>({element:b.current,progressStatusElement:p.current,progressStatusWrapElement:v.current,focus:C}));const o=e.value||x.value,y=se(o),g=e.value===null,w=u.useRtl(b,e.dir),c=N==="vertical",$=ee(o),B={value:o},E=I?e.label?t.createElement("span",{className:"k-progress-status"},t.createElement(e.label,{...B})):t.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:w,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:j},P=u.classNames("k-progress-status-wrap",{"k-progress-start":k==="start","k-progress-center":k==="center","k-progress-end":k==="end"||k===void 0}),T=typeof r!="boolean"&&r!==void 0?r.duration:r?Y:Z,z=t.useCallback(()=>{const S=K(d,m,y);q(p,v,S,c)},[c,m,d,y]),V=t.useCallback(S=>{const H=K(d,m,y+(o-y)*S);q(p,v,H,c)},[d,m,y,o,c]),U=t.useCallback(()=>{const S=K(d,m,o);q(p,v,S,c)},[c,m,d,o]);return G.useAnimation({duration:T,onStart:z,onUpdate:V,onEnd:U},[o,T]),t.createElement("div",{...l},t.createElement("span",{className:P+(R?" "+R:""),style:_},E),t.createElement("div",{className:"k-progressbar-value k-selected",style:f,ref:p},t.createElement("span",{className:P+(O?" "+O:""),ref:v},E)))});M.propTypes={animation:s.any,ariaLabel:s.string,disabled:s.bool,reverse:s.bool,label:s.any,labelVisible:s.bool,labelPlacement:s.oneOf(["start","center","end"]),max:s.number,min:s.number,value:s.number,tabIndex:s.number,emptyStyle:s.object,emptyClassName:s.string,progressStyle:s.object,progressClassName:s.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;
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 r=require("./chunkprogressbar/ChunkProgressBar.js"),e=require("./progressbar/ProgressBar.js");exports.ChunkProgressBar=r.ChunkProgressBar;exports.ProgressBar=e.ProgressBar;
package/index.mjs CHANGED
@@ -1,272 +1,14 @@
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
- *-------------------------------------------------------------------------------------------*/
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
+ */
5
8
  "use client";
6
- import * as e from "react";
7
- import r from "prop-types";
8
- import { validatePackage as H, useRtl as W, classNames as L, getTabIndex as q } from "@progress/kendo-react-common";
9
- import { useAnimation as Q } from "@progress/kendo-react-animation";
10
- const X = 1e-5, Y = 3, Z = 400, ee = 0, se = (s) => {
11
- const t = s.toString().split(".");
12
- return t.length === 1 ? `${t[0]}` : `${t[0]}.${t[1].substr(0, Y)}`;
13
- }, K = (s, t, a) => {
14
- const n = Math.abs((t - s) / 100);
15
- return Math.abs((a - s) / n);
16
- }, _ = (s, t, a, n) => {
17
- const u = Math.max(a, 0.01), h = 100 / u * 100;
18
- s.current && t.current && (s.current.style.width = n ? "100%" : `${u}%`, t.current.style.width = n ? "100%" : `${h}%`, s.current.style.height = n ? `${u}%` : "100%", t.current.style.height = n ? `${h}%` : "100%");
19
- }, re = (s, t, a) => Math.max((a - s) / (t - s), X), G = {
20
- name: "@progress/kendo-react-progressbars",
21
- productName: "KendoReact",
22
- productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
23
- publishDate: 1709197903,
24
- version: "",
25
- licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
26
- }, j = e.forwardRef((s, t) => {
27
- H(G);
28
- const {
29
- chunkCount: a = y.chunkCount,
30
- className: n,
31
- disabled: u,
32
- orientation: h,
33
- min: S = y.min,
34
- max: g = y.max,
35
- reverse: i = y.reverse,
36
- style: m,
37
- tabIndex: M,
38
- emptyStyle: T,
39
- emptyClassName: O,
40
- progressStyle: D,
41
- progressClassName: I
42
- } = s, k = e.useRef(null), R = e.useCallback(
43
- () => {
44
- k.current && k.current.focus();
45
- },
46
- []
47
- );
48
- e.useImperativeHandle(t, () => ({
49
- element: k.current,
50
- focus: R
51
- }));
52
- const d = s.value || y.value, b = s.value === null, v = W(k, s.dir), N = h === "vertical", o = {
53
- className: L(
54
- "k-progressbar k-chunk-progressbar",
55
- {
56
- "k-progressbar-horizontal": !N,
57
- "k-progressbar-vertical": N,
58
- "k-progressbar-reverse": i,
59
- "k-progressbar-indeterminate": b,
60
- "k-disabled": u
61
- },
62
- n
63
- ),
64
- ref: k,
65
- dir: v,
66
- tabIndex: q(M, u),
67
- role: "progressbar",
68
- "aria-label": s.ariaLabel,
69
- "aria-valuemin": S,
70
- "aria-valuemax": g,
71
- "aria-valuenow": b ? void 0 : d,
72
- "aria-disabled": u,
73
- style: m
74
- }, f = ({ count: p }) => {
75
- let w = [];
76
- const c = 100 / p + "%", $ = re(S, g, d), U = Math.floor($ * p), E = Array(p).fill(!1);
77
- for (let l = 0; l < U; l++)
78
- E[l] = !0;
79
- for (let l = 0; l < p; ++l) {
80
- const C = E[l], A = C ? I : O, B = { ...{
81
- width: N ? void 0 : c,
82
- height: N ? c : void 0
83
- }, ...C ? D : T };
84
- w.push(
85
- /* @__PURE__ */ e.createElement(
86
- "li",
87
- {
88
- key: l,
89
- className: L(
90
- "k-progressbar-chunk",
91
- {
92
- "k-first": l === 0,
93
- "k-last": l === p - 1,
94
- "k-selected": C
95
- },
96
- A
97
- ),
98
- style: B
99
- }
100
- )
101
- );
102
- }
103
- return /* @__PURE__ */ e.createElement(e.Fragment, null, w);
104
- };
105
- return /* @__PURE__ */ e.createElement("div", { ...o }, /* @__PURE__ */ e.createElement("ul", { className: "k-progressbar-chunks k-reset" }, /* @__PURE__ */ e.createElement(f, { count: a || y.chunkCount })));
106
- });
107
- j.propTypes = {
108
- chunkCount: r.number,
109
- ariaLabel: r.string,
110
- disabled: r.bool,
111
- reverse: r.bool,
112
- max: r.number,
113
- min: r.number,
114
- value: r.number,
115
- tabIndex: r.number,
116
- emptyStyle: r.object,
117
- emptyClassName: r.string,
118
- progressStyle: r.object,
119
- progressClassName: r.string
120
- };
121
- const y = {
122
- chunkCount: 5,
123
- min: 0,
124
- max: 100,
125
- value: 0,
126
- disabled: !1,
127
- reverse: !1
128
- };
129
- j.defaultProps = y;
130
- j.displayName = "KendoChunkProgressBar";
131
- const te = (s) => {
132
- const t = e.useRef();
133
- return e.useEffect(() => {
134
- t.current = s;
135
- }), t.current;
136
- }, z = e.forwardRef((s, t) => {
137
- H(G);
138
- const {
139
- animation: a,
140
- disabled: n,
141
- reverse: u = x.reverse,
142
- orientation: h,
143
- labelVisible: S,
144
- labelPlacement: g,
145
- max: i = x.max,
146
- min: m = x.min,
147
- tabIndex: M,
148
- className: T,
149
- style: O,
150
- emptyStyle: D,
151
- emptyClassName: I,
152
- progressStyle: k,
153
- progressClassName: R
154
- } = s, d = e.useRef(null), b = e.useRef(null), v = e.useRef(null), N = e.useCallback(
155
- () => {
156
- d.current && d.current.focus();
157
- },
158
- []
159
- );
160
- e.useImperativeHandle(
161
- t,
162
- () => ({
163
- element: d.current,
164
- progressStatusElement: b.current,
165
- progressStatusWrapElement: v.current,
166
- focus: N
167
- })
168
- );
169
- const o = s.value || x.value, f = te(o), p = s.value === null, w = W(d, s.dir), c = h === "vertical", $ = se(o), U = {
170
- value: o
171
- }, E = S ? s.label ? /* @__PURE__ */ e.createElement("span", { className: "k-progress-status" }, /* @__PURE__ */ e.createElement(s.label, { ...U })) : /* @__PURE__ */ e.createElement("span", { className: "k-progress-status" }, $) : void 0, l = {
172
- className: L(
173
- "k-progressbar",
174
- {
175
- "k-progressbar-horizontal": !c,
176
- "k-progressbar-vertical": c,
177
- "k-progressbar-reverse": u,
178
- "k-progressbar-indeterminate": p,
179
- "k-disabled": n
180
- },
181
- T
182
- ),
183
- ref: d,
184
- dir: w,
185
- tabIndex: q(M, n),
186
- role: "progressbar",
187
- "aria-label": s.ariaLabel,
188
- "aria-valuemin": m,
189
- "aria-valuemax": i,
190
- "aria-valuenow": p ? void 0 : o,
191
- "aria-disabled": n,
192
- style: O
193
- }, C = L("k-progress-status-wrap", {
194
- "k-progress-start": g === "start",
195
- "k-progress-center": g === "center",
196
- "k-progress-end": g === "end" || g === void 0
197
- }), A = typeof a != "boolean" && a !== void 0 ? a.duration : a ? Z : ee, V = e.useCallback(
198
- () => {
199
- const P = K(m, i, f);
200
- _(b, v, P, c);
201
- },
202
- [c, i, m, f]
203
- ), F = e.useCallback(
204
- (P) => {
205
- const J = K(m, i, f + (o - f) * P);
206
- _(b, v, J, c);
207
- },
208
- [m, i, f, o, c]
209
- ), B = e.useCallback(
210
- () => {
211
- const P = K(m, i, o);
212
- _(b, v, P, c);
213
- },
214
- [c, i, m, o]
215
- );
216
- return Q(
217
- {
218
- duration: A,
219
- onStart: V,
220
- onUpdate: F,
221
- onEnd: B
222
- },
223
- [o, A]
224
- ), /* @__PURE__ */ e.createElement("div", { ...l }, /* @__PURE__ */ e.createElement("span", { className: C + (I ? " " + I : ""), style: D }, E), /* @__PURE__ */ e.createElement(
225
- "div",
226
- {
227
- className: "k-progressbar-value k-selected",
228
- style: k,
229
- ref: b
230
- },
231
- /* @__PURE__ */ e.createElement(
232
- "span",
233
- {
234
- className: C + (R ? " " + R : ""),
235
- ref: v
236
- },
237
- E
238
- )
239
- ));
240
- });
241
- z.propTypes = {
242
- animation: r.any,
243
- ariaLabel: r.string,
244
- disabled: r.bool,
245
- reverse: r.bool,
246
- label: r.any,
247
- labelVisible: r.bool,
248
- labelPlacement: r.oneOf(["start", "center", "end"]),
249
- max: r.number,
250
- min: r.number,
251
- value: r.number,
252
- tabIndex: r.number,
253
- emptyStyle: r.object,
254
- emptyClassName: r.string,
255
- progressStyle: r.object,
256
- progressClassName: r.string
257
- };
258
- const x = {
259
- animation: !1,
260
- min: 0,
261
- max: 100,
262
- value: 0,
263
- disabled: !1,
264
- reverse: !1,
265
- labelVisible: !0
266
- };
267
- z.defaultProps = x;
268
- z.displayName = "KendoProgressBar";
9
+ import { ChunkProgressBar as o } from "./chunkprogressbar/ChunkProgressBar.mjs";
10
+ import { ProgressBar as t } from "./progressbar/ProgressBar.mjs";
269
11
  export {
270
- j as ChunkProgressBar,
271
- z as ProgressBar
12
+ o as ChunkProgressBar,
13
+ t as ProgressBar
272
14
  };
@@ -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 e={name:"@progress/kendo-react-progressbars",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
@@ -0,0 +1,19 @@
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 e = {
10
+ name: "@progress/kendo-react-progressbars",
11
+ productName: "KendoReact",
12
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
+ publishDate: 1709713928,
14
+ version: "",
15
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
+ };
17
+ export {
18
+ e as packageMetadata
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-progressbars",
3
- "version": "7.2.4-develop.2",
3
+ "version": "7.2.4-develop.4",
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": "7.2.4-develop.2",
27
- "@progress/kendo-react-common": "7.2.4-develop.2",
26
+ "@progress/kendo-react-animation": "7.2.4-develop.4",
27
+ "@progress/kendo-react-common": "7.2.4-develop.4",
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
  },
@@ -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 F=require("react"),a=require("prop-types"),H=require("@progress/kendo-react-animation"),f=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 u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(u,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return u.default=t,Object.freeze(u)}const e=J(F),P=e.forwardRef((t,u)=>{f.validatePackage(G.packageMetadata);const{animation:r,disabled:i,reverse:I=v.reverse,orientation:x,labelVisible:T,labelPlacement:k,max:l=v.max,min:o=v.min,tabIndex:q,className:A,style:j,emptyStyle:M,emptyClassName:y,progressStyle:_,progressClassName:N}=t,m=e.useRef(null),d=e.useRef(null),b=e.useRef(null),w=e.useCallback(()=>{m.current&&m.current.focus()},[]);e.useImperativeHandle(u,()=>({element:m.current,progressStatusElement:d.current,progressStatusWrapElement:b.current,focus:w}));const s=t.value||v.value,p=K.usePrevious(s),S=t.value===null,D=f.useRtl(m,t.dir),n=x==="vertical",L=c.truncateNumber(s),V={value:s},E=T?t.label?e.createElement("span",{className:"k-progress-status"},e.createElement(t.label,{...V})):e.createElement("span",{className:"k-progress-status"},L):void 0,h={className:f.classNames("k-progressbar",{"k-progressbar-horizontal":!n,"k-progressbar-vertical":n,"k-progressbar-reverse":I,"k-progressbar-indeterminate":S,"k-disabled":i},A),ref:m,dir:D,tabIndex:f.getTabIndex(q,i),role:"progressbar","aria-label":t.ariaLabel,"aria-valuemin":o,"aria-valuemax":l,"aria-valuenow":S?void 0:s,"aria-disabled":i,style:j},R=f.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 r!="boolean"&&r!==void 0?r.duration:r?C.DEFAULT_ANIMATION_DURATION:C.NO_ANIMATION,U=e.useCallback(()=>{const g=c.calculatePercentage(o,l,p);c.updateProgress(d,b,g,n)},[n,l,o,p]),B=e.useCallback(g=>{const W=c.calculatePercentage(o,l,p+(s-p)*g);c.updateProgress(d,b,W,n)},[o,l,p,s,n]),z=e.useCallback(()=>{const g=c.calculatePercentage(o,l,s);c.updateProgress(d,b,g,n)},[n,l,o,s]);return H.useAnimation({duration:O,onStart:U,onUpdate:B,onEnd:z},[s,O]),e.createElement("div",{...h},e.createElement("span",{className:R+(y?" "+y:""),style:M},E),e.createElement("div",{className:"k-progressbar-value k-selected",style:_,ref:d},e.createElement("span",{className:R+(N?" "+N:""),ref:b},E)))});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 v={animation:!1,min:0,max:100,value:0,disabled:!1,reverse:!1,labelVisible:!0};P.defaultProps=v;P.displayName="KendoProgressBar";exports.ProgressBar=P;
@@ -0,0 +1,152 @@
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 e from "react";
10
+ import a from "prop-types";
11
+ import { useAnimation as H } from "@progress/kendo-react-animation";
12
+ import { validatePackage as K, useRtl as q, classNames as R, getTabIndex as G } from "@progress/kendo-react-common";
13
+ import { truncateNumber as J, updateProgress as f, calculatePercentage as v } from "../common/utils.mjs";
14
+ import { usePrevious as Q } from "./hooks/usePrevious.mjs";
15
+ import { DEFAULT_ANIMATION_DURATION as X, NO_ANIMATION as Y } from "../common/constants.mjs";
16
+ import { packageMetadata as Z } from "../package-metadata.mjs";
17
+ const k = e.forwardRef((t, S) => {
18
+ K(Z);
19
+ const {
20
+ animation: b,
21
+ disabled: g,
22
+ reverse: C = p.reverse,
23
+ orientation: A,
24
+ labelVisible: T,
25
+ labelPlacement: d,
26
+ max: l = p.max,
27
+ min: n = p.min,
28
+ tabIndex: L,
29
+ className: O,
30
+ style: V,
31
+ emptyStyle: h,
32
+ emptyClassName: N,
33
+ progressStyle: w,
34
+ progressClassName: y
35
+ } = t, o = e.useRef(null), i = e.useRef(null), c = e.useRef(null), U = e.useCallback(
36
+ () => {
37
+ o.current && o.current.focus();
38
+ },
39
+ []
40
+ );
41
+ e.useImperativeHandle(
42
+ S,
43
+ () => ({
44
+ element: o.current,
45
+ progressStatusElement: i.current,
46
+ progressStatusWrapElement: c.current,
47
+ focus: U
48
+ })
49
+ );
50
+ const r = t.value || p.value, m = Q(r), P = t.value === null, D = q(o, t.dir), s = A === "vertical", M = J(r), _ = {
51
+ value: r
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: R(
54
+ "k-progressbar",
55
+ {
56
+ "k-progressbar-horizontal": !s,
57
+ "k-progressbar-vertical": s,
58
+ "k-progressbar-reverse": C,
59
+ "k-progressbar-indeterminate": P,
60
+ "k-disabled": g
61
+ },
62
+ O
63
+ ),
64
+ ref: o,
65
+ dir: D,
66
+ tabIndex: G(L, g),
67
+ role: "progressbar",
68
+ "aria-label": t.ariaLabel,
69
+ "aria-valuemin": n,
70
+ "aria-valuemax": l,
71
+ "aria-valuenow": P ? void 0 : r,
72
+ "aria-disabled": g,
73
+ style: V
74
+ }, x = R("k-progress-status-wrap", {
75
+ "k-progress-start": d === "start",
76
+ "k-progress-center": d === "center",
77
+ "k-progress-end": d === "end" || d === void 0
78
+ }), I = typeof b != "boolean" && b !== void 0 ? b.duration : b ? X : Y, B = e.useCallback(
79
+ () => {
80
+ const u = v(n, l, m);
81
+ f(i, c, u, s);
82
+ },
83
+ [s, l, n, m]
84
+ ), W = e.useCallback(
85
+ (u) => {
86
+ const F = v(n, l, m + (r - m) * u);
87
+ f(i, c, F, s);
88
+ },
89
+ [n, l, m, r, s]
90
+ ), z = e.useCallback(
91
+ () => {
92
+ const u = v(n, l, r);
93
+ f(i, c, u, s);
94
+ },
95
+ [s, l, n, r]
96
+ );
97
+ return H(
98
+ {
99
+ duration: I,
100
+ onStart: B,
101
+ onUpdate: W,
102
+ onEnd: z
103
+ },
104
+ [r, I]
105
+ ), /* @__PURE__ */ e.createElement("div", { ...j }, /* @__PURE__ */ e.createElement("span", { className: x + (N ? " " + N : ""), style: h }, E), /* @__PURE__ */ e.createElement(
106
+ "div",
107
+ {
108
+ className: "k-progressbar-value k-selected",
109
+ style: w,
110
+ ref: i
111
+ },
112
+ /* @__PURE__ */ e.createElement(
113
+ "span",
114
+ {
115
+ className: x + (y ? " " + y : ""),
116
+ ref: c
117
+ },
118
+ E
119
+ )
120
+ ));
121
+ });
122
+ k.propTypes = {
123
+ animation: a.any,
124
+ ariaLabel: a.string,
125
+ disabled: a.bool,
126
+ reverse: a.bool,
127
+ label: a.any,
128
+ labelVisible: a.bool,
129
+ labelPlacement: a.oneOf(["start", "center", "end"]),
130
+ max: a.number,
131
+ min: a.number,
132
+ value: a.number,
133
+ tabIndex: a.number,
134
+ emptyStyle: a.object,
135
+ emptyClassName: a.string,
136
+ progressStyle: a.object,
137
+ progressClassName: a.string
138
+ };
139
+ const p = {
140
+ animation: !1,
141
+ min: 0,
142
+ max: 100,
143
+ value: 0,
144
+ disabled: !1,
145
+ reverse: !1,
146
+ labelVisible: !0
147
+ };
148
+ k.defaultProps = p;
149
+ k.displayName = "KendoProgressBar";
150
+ export {
151
+ k as ProgressBar
152
+ };
@@ -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("react");function o(e){const t=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(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const c=o(u),s=e=>{const t=c.useRef();return c.useEffect(()=>{t.current=e}),t.current};exports.usePrevious=s;
@@ -0,0 +1,18 @@
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 r from "react";
10
+ const s = (t) => {
11
+ const e = r.useRef();
12
+ return r.useEffect(() => {
13
+ e.current = t;
14
+ }), e.current;
15
+ };
16
+ export {
17
+ s as usePrevious
18
+ };
@@ -1,21 +0,0 @@
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
- import * as React from 'react';
6
- import { ChunkProgressBarHandle } from './interfaces/ChunkProgressBarHandle';
7
- import { ChunkProgressBarProps } from './interfaces/ChunkProgressBarProps';
8
- /**
9
- * Represents the [KendoReact ChunkProgressBar component]({% slug overview_chunkprogressbar %}).
10
- *
11
- * @example
12
- * ```jsx
13
- * const App = () => {
14
- * return (
15
- * <ChunkProgressBar value={40}/>
16
- * );
17
- * };
18
- * ReactDOM.render(<App />, document.querySelector('my-app'));
19
- * ```
20
- */
21
- export declare const ChunkProgressBar: React.ForwardRefExoticComponent<ChunkProgressBarProps & React.RefAttributes<ChunkProgressBarHandle | null>>;
@@ -1,17 +0,0 @@
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
- /**
6
- * The ChunkProgressBar ref.
7
- */
8
- export interface ChunkProgressBarHandle {
9
- /**
10
- * The ChunkProgressBar element.
11
- */
12
- element: HTMLDivElement | null;
13
- /**
14
- * Focus the ChunkProgressBar.
15
- */
16
- focus: () => void;
17
- }
@@ -1,14 +0,0 @@
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
- import { BaseProps } from '../../common/BaseProps';
6
- /**
7
- * Represents the props of the [KendoReact ChunkProgressBar component]({% slug overview_chunkprogressbar %}).
8
- */
9
- export interface ChunkProgressBarProps extends BaseProps {
10
- /**
11
- * Sets the number of chunks into which the ChunkProgressBar will be split. Defaults to `5`.
12
- */
13
- chunkCount?: number;
14
- }