@progress/kendo-react-inputs 8.3.0-develop.3 → 8.3.0-develop.5

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.
@@ -8,109 +8,109 @@
8
8
  "use client";
9
9
  import * as e from "react";
10
10
  import a from "prop-types";
11
- import { createPropsContext as j, validatePackage as K, usePropsContext as L, useId as O, dispatchEvent as u, classNames as S, kendoThemeMaps as $, getTabIndex as q } from "@progress/kendo-react-common";
12
- import { packageMetadata as A } from "../package-metadata.mjs";
13
- const G = j(), C = e.forwardRef((y, B) => {
14
- K(A);
15
- const P = L(G, y), {
16
- ariaDescribedBy: x,
17
- checked: m,
18
- children: b,
19
- className: E,
20
- disabled: n,
21
- id: p,
22
- size: s = J.size,
23
- label: r,
24
- labelPlacement: F,
25
- name: I,
26
- style: N,
27
- tabIndex: R,
11
+ import { createPropsContext as S, validatePackage as U, usePropsContext as q, useUnstyled as A, useId as G, dispatchEvent as d, classNames as m, uRadioButton as b, getTabIndex as J } from "@progress/kendo-react-common";
12
+ import { packageMetadata as Q } from "../package-metadata.mjs";
13
+ const V = S(), P = e.forwardRef((R, x) => {
14
+ U(Q);
15
+ const E = q(V, R), {
16
+ ariaDescribedBy: F,
17
+ checked: p,
18
+ children: f,
19
+ className: I,
20
+ disabled: t,
21
+ id: g,
22
+ size: N = W.size,
23
+ label: o,
24
+ labelPlacement: z,
25
+ name: T,
26
+ style: w,
27
+ tabIndex: D,
28
28
  value: c,
29
- valid: z,
30
- onChange: f,
31
- onFocus: i,
32
- onBlur: d,
33
- ...T
34
- } = P, l = e.useRef(null), g = e.useCallback(
29
+ valid: H,
30
+ onChange: h,
31
+ onFocus: r,
32
+ onBlur: i,
33
+ ...j
34
+ } = E, y = A(), u = y && y.uRadioButton, l = e.useRef(null), C = e.useCallback(
35
35
  () => {
36
36
  l.current && l.current.focus();
37
37
  },
38
38
  []
39
- ), o = e.useCallback(
39
+ ), s = e.useCallback(
40
40
  () => ({
41
41
  element: l.current,
42
- focus: g
42
+ focus: C
43
43
  }),
44
- [g]
44
+ [C]
45
45
  );
46
- e.useImperativeHandle(B, o);
47
- const k = O(), M = e.useCallback(
48
- (t) => {
49
- u(
50
- f,
51
- t,
52
- o(),
46
+ e.useImperativeHandle(x, s);
47
+ const v = G(), K = e.useCallback(
48
+ (n) => {
49
+ d(
50
+ h,
51
+ n,
52
+ s(),
53
53
  { value: c }
54
54
  );
55
55
  },
56
- [f, c, n]
57
- ), w = e.useCallback(
58
- (t) => {
59
- i && !n && u(
60
- i,
61
- t,
62
- o(),
56
+ [h, c, t]
57
+ ), L = e.useCallback(
58
+ (n) => {
59
+ r && !t && d(
60
+ r,
61
+ n,
62
+ s(),
63
63
  void 0
64
64
  );
65
65
  },
66
- [i, n]
67
- ), D = e.useCallback(
68
- (t) => {
69
- d && !n && u(
70
- d,
71
- t,
72
- o(),
66
+ [r, t]
67
+ ), M = e.useCallback(
68
+ (n) => {
69
+ i && !t && d(
70
+ i,
71
+ n,
72
+ s(),
73
73
  void 0
74
74
  );
75
75
  },
76
- [d, n]
77
- ), H = {
76
+ [i, t]
77
+ ), O = {
78
78
  type: "radio",
79
- id: p || k,
80
- name: I,
81
- className: S(
82
- "k-radio",
83
- {
84
- [`k-radio-${$.sizeMap[s] || s}`]: s,
85
- "k-invalid": z === !1,
86
- "k-checked": m
87
- },
88
- E
79
+ id: g || v,
80
+ name: T,
81
+ className: m(
82
+ b.input({
83
+ c: u,
84
+ size: N,
85
+ invalid: H === !1,
86
+ checked: p
87
+ }),
88
+ I
89
89
  ),
90
90
  ref: l,
91
- disabled: n,
92
- tabIndex: q(R, n),
93
- checked: m,
94
- style: N,
95
- "aria-describedby": x,
91
+ disabled: t,
92
+ tabIndex: J(D, t),
93
+ checked: p,
94
+ style: w,
95
+ "aria-describedby": F,
96
96
  value: c,
97
- onChange: M,
98
- onFocus: w,
99
- onBlur: D,
100
- ...T
101
- }, h = /* @__PURE__ */ e.createElement(e.Fragment, null, r !== void 0 ? /* @__PURE__ */ e.createElement(
97
+ onChange: K,
98
+ onFocus: L,
99
+ onBlur: M,
100
+ ...j
101
+ }, B = /* @__PURE__ */ e.createElement(e.Fragment, null, o !== void 0 ? /* @__PURE__ */ e.createElement(
102
102
  "label",
103
103
  {
104
- className: "k-radio-label",
105
- htmlFor: p || k,
104
+ className: m(b.label({ c: u })),
105
+ htmlFor: g || v,
106
106
  style: { userSelect: "none" },
107
- "aria-label": r
107
+ "aria-label": o
108
108
  },
109
- r
110
- ) : null), v = /* @__PURE__ */ e.createElement("span", { className: "k-radio-wrap" }, /* @__PURE__ */ e.createElement("input", { ...H }));
111
- return F === "before" ? /* @__PURE__ */ e.createElement(e.Fragment, null, h, v, b) : /* @__PURE__ */ e.createElement(e.Fragment, null, v, h, b);
109
+ o
110
+ ) : null), k = /* @__PURE__ */ e.createElement("span", { className: m(b.wrap({ c: u })) }, /* @__PURE__ */ e.createElement("input", { ...O }));
111
+ return z === "before" ? /* @__PURE__ */ e.createElement(e.Fragment, null, B, k, f) : /* @__PURE__ */ e.createElement(e.Fragment, null, k, B, f);
112
112
  });
113
- C.propTypes = {
113
+ P.propTypes = {
114
114
  ariaDescribedBy: a.string,
115
115
  checked: a.bool,
116
116
  className: a.string,
@@ -128,11 +128,11 @@ C.propTypes = {
128
128
  onFocus: a.func,
129
129
  onBlur: a.func
130
130
  };
131
- const J = {
131
+ const W = {
132
132
  size: "medium"
133
133
  };
134
- C.displayName = "KendoRadioButton";
134
+ P.displayName = "KendoRadioButton";
135
135
  export {
136
- C as RadioButton,
137
- G as RadioButtonPropsContext
136
+ P as RadioButton,
137
+ V as RadioButtonPropsContext
138
138
  };
@@ -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 H=require("react"),e=require("prop-types"),L=require("./RadioButton.js"),s=require("@progress/kendo-react-common"),K=require("../package-metadata.js");function A(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const n in l)if(n!=="default"){const d=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(c,n,d.get?d:{enumerable:!0,get:()=>l[n]})}}return c.default=l,Object.freeze(c)}const t=A(H),E=s.createPropsContext(),y=t.forwardRef((l,c)=>{s.validatePackage(K.packageMetadata);const n=s.usePropsContext(E,l),{id:d,ariaLabelledBy:N,ariaDescribedBy:O,className:j,data:g,defaultValue:B,disabled:o,name:G,labelPlacement:I,layout:u,style:F,value:k,valid:S,item:q=J.item,onChange:b,onFocus:m}=n,i=t.useRef(null),C=t.useCallback(()=>{i.current&&s.focusFirstFocusableChild(i.current)},[]),p=t.useCallback(()=>({element:i.current,focus:C}),[C]);t.useImperativeHandle(c,p);const[x,v]=t.useState(B),h=k!==void 0,f=h?k:x,D=t.useCallback(a=>{let r=a.value;!h&&!o&&v(r),b&&!o&&s.dispatchEvent(b,a.syntheticEvent,p(),{value:r})},[v,b,o]),M=t.useCallback(a=>{m&&!o&&s.dispatchEvent(m,a.syntheticEvent,p(),void 0)},[m,o]),T=s.useId(),V=s.classNames("k-radio-list",{"k-list-horizontal":u==="horizontal","k-list-vertical":u==="vertical"||u===void 0},j),z=s.useRtl(i,n.dir),_=g&&g.map((a,r)=>{const P=f===a.value,w=f==null,R={...a,valid:S,checked:P,disabled:!!(a.disabled||o),labelPlacement:a.labelPlacement?a.labelPlacement:I,tabIndex:a.tabIndex?a.tabIndex:w&&r===0||P?0:-1,index:r,name:G||T,onChange:D,onFocus:M};return t.createElement(q,{className:s.classNames("k-radio-list-item",{"k-disabled":R.disabled||o}),key:r,role:"none"},t.createElement(L.RadioButton,{...R}))});return t.createElement("ul",{id:d,role:"radiogroup",className:V,ref:i,dir:z,style:F,"aria-labelledby":N,"aria-describedby":O},_)}),J={item:l=>t.createElement("li",{...l})};y.propTypes={ariaLabelledBy:e.string,ariaDescribedBy:e.string,className:e.string,data:e.arrayOf(e.object),defaultValue:e.any,dir:e.string,disabled:e.bool,labelPlacement:e.string,layout:e.string,name:e.string,style:e.object,value:e.any,onChange:e.func,onFocus:e.func};y.displayName="KendoRadioGroup";exports.RadioGroup=y;exports.RadioGroupPropsContext=E;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),e=require("prop-types"),U=require("./RadioButton.js"),a=require("@progress/kendo-react-common"),A=require("../package-metadata.js");function J(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const n in o)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(c,n,i.get?i:{enumerable:!0,get:()=>o[n]})}}return c.default=o,Object.freeze(c)}const s=J(K),N=a.createPropsContext(),y=s.forwardRef((o,c)=>{a.validatePackage(A.packageMetadata);const n=a.usePropsContext(N,o),{id:i,ariaLabelledBy:O,ariaDescribedBy:j,className:B,data:g,defaultValue:I,disabled:l,name:F,labelPlacement:S,layout:d,style:q,value:C,valid:x,item:D=Q.item,onChange:b,onFocus:m}=n,v=a.useUnstyled(),h=v&&v.uRadioGroup,u=s.useRef(null),R=s.useCallback(()=>{u.current&&a.focusFirstFocusableChild(u.current)},[]),p=s.useCallback(()=>({element:u.current,focus:R}),[R]);s.useImperativeHandle(c,p);const[M,k]=s.useState(I),P=C!==void 0,f=P?C:M,T=s.useCallback(t=>{let r=t.value;!P&&!l&&k(r),b&&!l&&a.dispatchEvent(b,t.syntheticEvent,p(),{value:r})},[k,b,l]),V=s.useCallback(t=>{m&&!l&&a.dispatchEvent(m,t.syntheticEvent,p(),void 0)},[m,l]),z=a.useId(),_=a.classNames(a.uRadioGroup.ul({c:h,horizontal:d==="horizontal",vertical:d==="vertical"||d===void 0}),B),w=a.useRtl(u,n.dir),H=g&&g.map((t,r)=>{const G=f===t.value,L=f==null,E={...t,valid:x,checked:G,disabled:!!(t.disabled||l),labelPlacement:t.labelPlacement?t.labelPlacement:S,tabIndex:t.tabIndex?t.tabIndex:L&&r===0||G?0:-1,index:r,name:F||z,onChange:T,onFocus:V};return s.createElement(D,{className:a.classNames(a.uRadioGroup.item({c:h,disabled:E.disabled||l})),key:r,role:"none"},s.createElement(U.RadioButton,{...E}))});return s.createElement("ul",{id:i,role:"radiogroup",className:_,ref:u,dir:w,style:q,"aria-labelledby":O,"aria-describedby":j},H)}),Q={item:o=>s.createElement("li",{...o})};y.propTypes={ariaLabelledBy:e.string,ariaDescribedBy:e.string,className:e.string,data:e.arrayOf(e.object),defaultValue:e.any,dir:e.string,disabled:e.bool,labelPlacement:e.string,layout:e.string,name:e.string,style:e.object,value:e.any,onChange:e.func,onFocus:e.func};y.displayName="KendoRadioGroup";exports.RadioGroup=y;exports.RadioGroupPropsContext=N;
@@ -8,110 +8,115 @@
8
8
  "use client";
9
9
  import * as t from "react";
10
10
  import e from "prop-types";
11
- import { RadioButton as M } from "./RadioButton.mjs";
12
- import { createPropsContext as q, validatePackage as A, usePropsContext as J, focusFirstFocusableChild as Q, dispatchEvent as v, useId as U, classNames as g, useRtl as W } from "@progress/kendo-react-common";
13
- import { packageMetadata as X } from "../package-metadata.mjs";
14
- const Y = q(), P = t.forwardRef((r, R) => {
15
- A(X);
16
- const m = J(Y, r), {
17
- id: E,
18
- ariaLabelledBy: I,
19
- ariaDescribedBy: N,
20
- className: B,
11
+ import { RadioButton as A } from "./RadioButton.mjs";
12
+ import { createPropsContext as J, validatePackage as Q, usePropsContext as W, useUnstyled as X, focusFirstFocusableChild as Y, dispatchEvent as P, useId as Z, classNames as R, uRadioGroup as E, useRtl as _ } from "@progress/kendo-react-common";
13
+ import { packageMetadata as $ } from "../package-metadata.mjs";
14
+ const ee = J(), G = t.forwardRef((n, I) => {
15
+ Q($);
16
+ const m = W(ee, n), {
17
+ id: N,
18
+ ariaLabelledBy: B,
19
+ ariaDescribedBy: F,
20
+ className: x,
21
21
  data: b,
22
- defaultValue: F,
23
- disabled: l,
24
- name: x,
25
- labelPlacement: G,
26
- layout: n,
27
- style: V,
22
+ defaultValue: V,
23
+ disabled: s,
24
+ name: O,
25
+ labelPlacement: j,
26
+ layout: r,
27
+ style: z,
28
28
  value: p,
29
- valid: O,
30
- item: j = Z.item,
29
+ valid: D,
30
+ item: H = ae.item,
31
31
  onChange: c,
32
- onFocus: i
33
- } = m, o = t.useRef(null), f = t.useCallback(
32
+ onFocus: d
33
+ } = m, f = X(), y = f && f.uRadioGroup, o = t.useRef(null), C = t.useCallback(
34
34
  () => {
35
- o.current && Q(o.current);
35
+ o.current && Y(o.current);
36
36
  },
37
37
  []
38
- ), d = t.useCallback(
38
+ ), i = t.useCallback(
39
39
  () => ({
40
40
  element: o.current,
41
- focus: f
41
+ focus: C
42
42
  }),
43
- [f]
43
+ [C]
44
44
  );
45
- t.useImperativeHandle(R, d);
46
- const [z, y] = t.useState(F), C = p !== void 0, u = C ? p : z, D = t.useCallback(
45
+ t.useImperativeHandle(I, i);
46
+ const [L, h] = t.useState(V), v = p !== void 0, u = v ? p : L, S = t.useCallback(
47
47
  (a) => {
48
- let s = a.value;
49
- !C && !l && y(s), c && !l && v(
48
+ let l = a.value;
49
+ !v && !s && h(l), c && !s && P(
50
50
  c,
51
51
  a.syntheticEvent,
52
- d(),
53
- { value: s }
52
+ i(),
53
+ { value: l }
54
54
  );
55
55
  },
56
- [y, c, l]
57
- ), H = t.useCallback(
56
+ [h, c, s]
57
+ ), T = t.useCallback(
58
58
  (a) => {
59
- i && !l && v(
60
- i,
59
+ d && !s && P(
60
+ d,
61
61
  a.syntheticEvent,
62
- d(),
62
+ i(),
63
63
  void 0
64
64
  );
65
65
  },
66
- [i, l]
67
- ), L = U(), S = g(
68
- "k-radio-list",
69
- {
70
- "k-list-horizontal": n === "horizontal",
71
- "k-list-vertical": n === "vertical" || n === void 0
72
- },
73
- B
74
- ), T = W(o, m.dir), w = b && b.map((a, s) => {
75
- const h = u === a.value, K = u == null, k = {
66
+ [d, s]
67
+ ), w = Z(), K = R(
68
+ E.ul({
69
+ c: y,
70
+ horizontal: r === "horizontal",
71
+ vertical: r === "vertical" || r === void 0
72
+ }),
73
+ x
74
+ ), M = _(o, m.dir), U = b && b.map((a, l) => {
75
+ const g = u === a.value, q = u == null, k = {
76
76
  ...a,
77
- valid: O,
78
- checked: h,
79
- disabled: !!(a.disabled || l),
80
- labelPlacement: a.labelPlacement ? a.labelPlacement : G,
81
- tabIndex: a.tabIndex ? a.tabIndex : K && s === 0 || h ? 0 : -1,
82
- index: s,
83
- name: x || L,
84
- onChange: D,
85
- onFocus: H
77
+ valid: D,
78
+ checked: g,
79
+ disabled: !!(a.disabled || s),
80
+ labelPlacement: a.labelPlacement ? a.labelPlacement : j,
81
+ tabIndex: a.tabIndex ? a.tabIndex : q && l === 0 || g ? 0 : -1,
82
+ index: l,
83
+ name: O || w,
84
+ onChange: S,
85
+ onFocus: T
86
86
  };
87
87
  return /* @__PURE__ */ t.createElement(
88
- j,
88
+ H,
89
89
  {
90
- className: g("k-radio-list-item", { "k-disabled": k.disabled || l }),
91
- key: s,
90
+ className: R(
91
+ E.item({
92
+ c: y,
93
+ disabled: k.disabled || s
94
+ })
95
+ ),
96
+ key: l,
92
97
  role: "none"
93
98
  },
94
- /* @__PURE__ */ t.createElement(M, { ...k })
99
+ /* @__PURE__ */ t.createElement(A, { ...k })
95
100
  );
96
101
  });
97
102
  return /* @__PURE__ */ t.createElement(
98
103
  "ul",
99
104
  {
100
- id: E,
105
+ id: N,
101
106
  role: "radiogroup",
102
- className: S,
107
+ className: K,
103
108
  ref: o,
104
- dir: T,
105
- style: V,
106
- "aria-labelledby": I,
107
- "aria-describedby": N
109
+ dir: M,
110
+ style: z,
111
+ "aria-labelledby": B,
112
+ "aria-describedby": F
108
113
  },
109
- w
114
+ U
110
115
  );
111
- }), Z = {
112
- item: (r) => /* @__PURE__ */ t.createElement("li", { ...r })
116
+ }), ae = {
117
+ item: (n) => /* @__PURE__ */ t.createElement("li", { ...n })
113
118
  };
114
- P.propTypes = {
119
+ G.propTypes = {
115
120
  ariaLabelledBy: e.string,
116
121
  ariaDescribedBy: e.string,
117
122
  className: e.string,
@@ -127,8 +132,8 @@ P.propTypes = {
127
132
  onChange: e.func,
128
133
  onFocus: e.func
129
134
  };
130
- P.displayName = "KendoRadioGroup";
135
+ G.displayName = "KendoRadioGroup";
131
136
  export {
132
- P as RadioGroup,
133
- Y as RadioGroupPropsContext
137
+ G as RadioGroup,
138
+ ee as RadioGroupPropsContext
134
139
  };