@progress/kendo-react-inputs 8.3.0-develop.1 → 8.3.0-develop.11

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,32 +8,32 @@
8
8
  "use client";
9
9
  import * as d from "react";
10
10
  import e from "prop-types";
11
- import { MaskingService as P } from "./masking.service.mjs";
12
- import { defaultRules as v, maskingChanged as _, returnFalse as m } from "./utils.mjs";
13
- import { validatePackage as C, useCustomComponent as g, classNames as S, kendoThemeMaps as y, getTabIndex as x, createPropsContext as E, withIdHOC as V, withPropsContext as O } from "@progress/kendo-react-common";
14
- import { FloatingLabel as M } from "@progress/kendo-react-labels";
15
- import { packageMetadata as I } from "../package-metadata.mjs";
11
+ import { MaskingService as k } from "./masking.service.mjs";
12
+ import { defaultRules as v, maskingChanged as E, returnFalse as m } from "./utils.mjs";
13
+ import { validatePackage as O, useCustomComponent as g, classNames as y, uMaskedTextBox as b, getTabIndex as V, createPropsContext as w, withIdHOC as M, withPropsContext as I, withUnstyledHOC as D } from "@progress/kendo-react-common";
14
+ import { FloatingLabel as H } from "@progress/kendo-react-labels";
15
+ import { packageMetadata as q } from "../package-metadata.mjs";
16
16
  const l = class l extends d.Component {
17
- constructor(s) {
18
- super(s), this.state = {}, this._inputId = `k-${this.props.id}`, this._service = new P(), this._isPasted = !1, this._selection = [null, null], this._input = null, this.focus = () => {
17
+ constructor(i) {
18
+ super(i), this.state = {}, this._inputId = `k_${this.props.id}`, this._service = new k(), this._isPasted = !1, this._selection = [null, null], this._input = null, this.focus = () => {
19
19
  this._input && this._input.focus();
20
20
  }, this.pasteHandler = (t) => {
21
- const { selectionStart: i, selectionEnd: r } = t.target;
22
- r !== i && (this._isPasted = !0, this._selection = [i || 0, r || 0]);
21
+ const { selectionStart: r, selectionEnd: s } = t.target;
22
+ s !== r && (this._isPasted = !0, this._selection = [r || 0, s || 0]);
23
23
  }, this.onChangeHandler = (t) => {
24
- const i = t.currentTarget, r = i.value, o = this._selection[0] || 0, a = this._selection[1] || 0;
24
+ const r = t.currentTarget, s = r.value, o = this._selection[0] || 0, a = this._selection[1] || 0;
25
25
  if (!this.props.mask) {
26
- this._isPasted = !1, this._selection = [null, null], this.triggerOnChange(r, t);
26
+ this._isPasted = !1, this._selection = [null, null], this.triggerOnChange(s, t);
27
27
  return;
28
28
  }
29
29
  const p = this.value;
30
30
  let n;
31
31
  if (this._isPasted) {
32
32
  this._isPasted = !1;
33
- const u = p.length - a, h = r.length - u;
34
- n = this._service.maskInRange(r.slice(o, h), p, o, a);
33
+ const u = p.length - a, h = s.length - u;
34
+ n = this._service.maskInRange(s.slice(o, h), p, o, a);
35
35
  } else
36
- n = this._service.maskInput(r, p, i.selectionStart || 0);
36
+ n = this._service.maskInput(s, p, r.selectionStart || 0);
37
37
  this._selection = [n.selection, n.selection], this.triggerOnChange(n.value, t);
38
38
  }, this.focusHandler = (t) => {
39
39
  this.state.focused || (this.setState({ focused: !0 }), this.props.onFocus && this.props.onFocus.call(void 0, {
@@ -51,7 +51,7 @@ const l = class l extends d.Component {
51
51
  this.element && this.element.setCustomValidity(
52
52
  this.validity.valid ? "" : this.props.validationMessage || ""
53
53
  );
54
- }, C(I);
54
+ }, O(q);
55
55
  }
56
56
  /**
57
57
  * Gets the element of the MaskedTextBox.
@@ -103,10 +103,10 @@ const l = class l extends d.Component {
103
103
  * Represents the validity state into which the MaskedTextBox is set.
104
104
  */
105
105
  get validity() {
106
- const s = this.value, t = this._service.validationValue(s), i = this.props.validationMessage !== void 0, r = this.props.valid !== void 0 ? this.props.valid : (!this.required || !!t) && (!this.props.maskValidation || !this.props.prompt || s.indexOf(this.props.prompt) === -1);
106
+ const i = this.value, t = this._service.validationValue(i), r = this.props.validationMessage !== void 0, s = this.props.valid !== void 0 ? this.props.valid : (!this.required || !!t) && (!this.props.maskValidation || !this.props.prompt || i.indexOf(this.props.prompt) === -1);
107
107
  return {
108
- customError: i,
109
- valid: r,
108
+ customError: r,
109
+ valid: s,
110
110
  valueMissing: !t
111
111
  };
112
112
  }
@@ -131,13 +131,13 @@ const l = class l extends d.Component {
131
131
  /**
132
132
  * @hidden
133
133
  */
134
- componentDidUpdate(s, t) {
134
+ componentDidUpdate(i, t) {
135
135
  if (this.element && this.state.focused && t.focused) {
136
- let [i, r] = this._selection;
137
- const o = s.selection, a = this.props.selection;
138
- (!o && a || o && a && (o.start !== a.start || o.end !== a.end)) && (i = a.start, r = a.end), i !== null && r !== null && this.element.setSelectionRange(i, r);
136
+ let [r, s] = this._selection;
137
+ const o = i.selection, a = this.props.selection;
138
+ (!o && a || o && a && (o.start !== a.start || o.end !== a.end)) && (r = a.start, s = a.end), r !== null && s !== null && this.element.setSelectionRange(r, s);
139
139
  }
140
- _(s, this.props) && this.updateService(), this.setValidity();
140
+ E(i, this.props) && this.updateService(), this.setValidity();
141
141
  }
142
142
  /**
143
143
  * @hidden
@@ -150,32 +150,32 @@ const l = class l extends d.Component {
150
150
  */
151
151
  render() {
152
152
  const {
153
- size: s = l.defaultProps.size,
153
+ size: i = l.defaultProps.size,
154
154
  fillMode: t = l.defaultProps.fillMode,
155
- rounded: i = l.defaultProps.rounded,
156
- autoFocus: r = l.defaultProps.autoFocus
157
- } = this.props, o = this.props.id || this._inputId, a = !this.validityStyles || this.validity.valid, p = this.props.style || {}, {
158
- prefix: n = l.defaultProps.prefix,
159
- suffix: u = l.defaultProps.suffix
160
- } = this.props, [h] = g(n), [b] = g(u), f = /* @__PURE__ */ d.createElement(
155
+ rounded: r = l.defaultProps.rounded,
156
+ autoFocus: s = l.defaultProps.autoFocus,
157
+ unstyled: o,
158
+ className: a
159
+ } = this.props, p = this.props.id || this._inputId, n = !this.validityStyles || this.validity.valid, u = this.props.style || {}, h = o && o.uMaskedTextBox, {
160
+ prefix: P = l.defaultProps.prefix,
161
+ suffix: C = l.defaultProps.suffix
162
+ } = this.props, [_] = g(P), [x] = g(C), f = /* @__PURE__ */ d.createElement(
161
163
  "span",
162
164
  {
163
165
  dir: this.props.dir,
164
- className: S(
165
- "k-maskedtextbox k-input",
166
+ className: y(b.wrapper(
166
167
  {
167
- [`k-input-${y.sizeMap[s] || s}`]: s,
168
- [`k-input-${t}`]: t,
169
- [`k-rounded-${y.roundedMap[i] || i}`]: i,
170
- "k-invalid": !a,
171
- "k-required": this.required,
172
- "k-disabled": this.props.disabled
173
- },
174
- this.props.className
175
- ),
176
- style: this.props.label ? p : { width: this.props.width, ...p }
168
+ c: h,
169
+ invalid: !n,
170
+ disabled: this.props.disabled,
171
+ size: i,
172
+ fillMode: t,
173
+ rounded: r
174
+ }
175
+ ), a),
176
+ style: this.props.label ? u : { width: this.props.width, ...u }
177
177
  },
178
- /* @__PURE__ */ d.createElement(h, null),
178
+ /* @__PURE__ */ d.createElement(_, null),
179
179
  /* @__PURE__ */ d.createElement(
180
180
  "input",
181
181
  {
@@ -183,22 +183,22 @@ const l = class l extends d.Component {
183
183
  autoComplete: "off",
184
184
  autoCorrect: "off",
185
185
  autoCapitalize: "off",
186
- autoFocus: r,
186
+ autoFocus: s,
187
187
  spellCheck: !1,
188
- className: "k-input-inner",
188
+ className: y(b.input({ c: h })),
189
189
  value: this.value,
190
- id: o,
190
+ id: p,
191
191
  "aria-labelledby": this.props.ariaLabelledBy,
192
192
  "aria-describedby": this.props.ariaDescribedBy,
193
193
  "aria-placeholder": this.props.mask,
194
194
  name: this.props.name,
195
- tabIndex: x(this.props.tabIndex, this.props.disabled, !0),
195
+ tabIndex: V(this.props.tabIndex, this.props.disabled, !0),
196
196
  accessKey: this.props.accessKey,
197
197
  title: this.props.title,
198
198
  disabled: this.props.disabled || void 0,
199
199
  readOnly: this.props.readonly || void 0,
200
200
  placeholder: this.props.placeholder,
201
- ref: (k) => this._input = k,
201
+ ref: (S) => this._input = S,
202
202
  onChange: this.onChangeHandler,
203
203
  onPaste: this.pasteHandler,
204
204
  onFocus: this.focusHandler,
@@ -207,15 +207,15 @@ const l = class l extends d.Component {
207
207
  onDrop: m
208
208
  }
209
209
  ),
210
- /* @__PURE__ */ d.createElement(b, null)
210
+ /* @__PURE__ */ d.createElement(x, null)
211
211
  );
212
212
  return this.props.label ? /* @__PURE__ */ d.createElement(
213
- M,
213
+ H,
214
214
  {
215
215
  label: this.props.label,
216
- editorId: o,
216
+ editorId: p,
217
217
  editorValue: this.value,
218
- editorValid: a,
218
+ editorValid: n,
219
219
  editorDisabled: this.props.disabled,
220
220
  editorPlaceholder: this.props.placeholder,
221
221
  children: f,
@@ -224,12 +224,12 @@ const l = class l extends d.Component {
224
224
  }
225
225
  ) : f;
226
226
  }
227
- triggerOnChange(s, t) {
227
+ triggerOnChange(i, t) {
228
228
  if (this.setState({
229
- value: s
229
+ value: i
230
230
  }), this.props.onChange) {
231
- this._valueDuringOnChange = s;
232
- const i = {
231
+ this._valueDuringOnChange = i;
232
+ const r = {
233
233
  syntheticEvent: t,
234
234
  nativeEvent: t.nativeEvent,
235
235
  selectionStart: this._selection[0],
@@ -237,17 +237,17 @@ const l = class l extends d.Component {
237
237
  target: this,
238
238
  value: this.value
239
239
  };
240
- this.props.onChange.call(void 0, i), this._valueDuringOnChange = void 0;
240
+ this.props.onChange.call(void 0, r), this._valueDuringOnChange = void 0;
241
241
  }
242
242
  }
243
- updateService(s) {
243
+ updateService(i) {
244
244
  const t = Object.assign({
245
245
  includeLiterals: this.props.includeLiterals,
246
246
  mask: this.props.mask,
247
247
  prompt: this.props.prompt,
248
248
  promptPlaceholder: this.props.promptPlaceholder,
249
249
  rules: this.rules
250
- }, s);
250
+ }, i);
251
251
  this._service.update(t);
252
252
  }
253
253
  get rules() {
@@ -280,10 +280,10 @@ l.displayName = "MaskedTextBox", l.propTypes = {
280
280
  includeLiterals: e.bool,
281
281
  maskValidation: e.bool,
282
282
  mask: e.string,
283
- rules: function(s, t, i) {
284
- const r = s.rules;
285
- return r !== void 0 && !Object.entries(r).some((a) => typeof a != "string" || !(r[a] instanceof RegExp)) ? new Error(
286
- "Invalid prop `" + t + "` supplied to `" + i + "`. Validation failed."
283
+ rules: function(i, t, r) {
284
+ const s = i.rules;
285
+ return s !== void 0 && !Object.entries(s).some((a) => typeof a != "string" || !(s[a] instanceof RegExp)) ? new Error(
286
+ "Invalid prop `" + t + "` supplied to `" + r + "`. Validation failed."
287
287
  ) : null;
288
288
  },
289
289
  selection: e.shape({
@@ -309,18 +309,18 @@ l.displayName = "MaskedTextBox", l.propTypes = {
309
309
  rules: v,
310
310
  required: !1,
311
311
  validityStyles: !0,
312
- prefix: (s) => null,
313
- suffix: (s) => null,
312
+ prefix: (i) => null,
313
+ suffix: (i) => null,
314
314
  size: "medium",
315
315
  rounded: "medium",
316
316
  fillMode: "solid",
317
317
  autoFocus: !1
318
318
  };
319
319
  let c = l;
320
- const q = E(), w = V(O(q, c));
321
- w.displayName = "KendoReactMaskedTextBox";
320
+ const B = w(), F = M(I(B, D(c)));
321
+ F.displayName = "KendoReactMaskedTextBox";
322
322
  export {
323
- w as MaskedTextBox,
324
- q as MaskedTextBoxPropsContext,
323
+ F as MaskedTextBox,
324
+ B as MaskedTextBoxPropsContext,
325
325
  c as MaskedTextBoxWithoutContext
326
326
  };
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-inputs",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1723203490,
13
+ publishDate: 1724738460,
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-inputs",
3
- "version": "8.3.0-develop.1",
3
+ "version": "8.3.0-develop.11",
4
4
  "description": "React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -25,13 +25,13 @@
25
25
  "@progress/kendo-drawing": "^1.20.1",
26
26
  "@progress/kendo-inputs-common": "^3.1.0",
27
27
  "@progress/kendo-licensing": "^1.3.4",
28
- "@progress/kendo-react-animation": "8.3.0-develop.1",
29
- "@progress/kendo-react-buttons": "8.3.0-develop.1",
30
- "@progress/kendo-react-common": "8.3.0-develop.1",
31
- "@progress/kendo-react-dialogs": "8.3.0-develop.1",
32
- "@progress/kendo-react-intl": "8.3.0-develop.1",
33
- "@progress/kendo-react-labels": "8.3.0-develop.1",
34
- "@progress/kendo-react-popup": "8.3.0-develop.1",
28
+ "@progress/kendo-react-animation": "8.3.0-develop.11",
29
+ "@progress/kendo-react-buttons": "8.3.0-develop.11",
30
+ "@progress/kendo-react-common": "8.3.0-develop.11",
31
+ "@progress/kendo-react-dialogs": "8.3.0-develop.11",
32
+ "@progress/kendo-react-intl": "8.3.0-develop.11",
33
+ "@progress/kendo-react-labels": "8.3.0-develop.11",
34
+ "@progress/kendo-react-popup": "8.3.0-develop.11",
35
35
  "@progress/kendo-svg-icons": "^3.0.0",
36
36
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
37
37
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
@@ -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"),t=require("prop-types"),a=require("@progress/kendo-react-common"),w=require("../package-metadata.js");function _(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const l in n)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(s,l,r.get?r:{enumerable:!0,get:()=>n[l]})}}return s.default=n,Object.freeze(s)}const e=_(D),E=a.createPropsContext(),g=e.forwardRef((n,s)=>{a.validatePackage(w.packageMetadata);const l=a.usePropsContext(E,n),{ariaDescribedBy:r,checked:k,children:h,className:x,disabled:o,id:v,size:d=H.size,label:m,labelPlacement:F,name:I,style:N,tabIndex:O,value:b,valid:j,onChange:y,onFocus:p,onBlur:f,...z}=l,i=e.useRef(null),C=e.useCallback(()=>{i.current&&i.current.focus()},[]),u=e.useCallback(()=>({element:i.current,focus:C}),[C]);e.useImperativeHandle(s,u);const P=a.useId(),M=e.useCallback(c=>{a.dispatchEvent(y,c,u(),{value:b})},[y,b,o]),T=e.useCallback(c=>{p&&!o&&a.dispatchEvent(p,c,u(),void 0)},[p,o]),S=e.useCallback(c=>{f&&!o&&a.dispatchEvent(f,c,u(),void 0)},[f,o]),q={type:"radio",id:v||P,name:I,className:a.classNames("k-radio",{[`k-radio-${a.kendoThemeMaps.sizeMap[d]||d}`]:d,"k-invalid":j===!1,"k-checked":k},x),ref:i,disabled:o,tabIndex:a.getTabIndex(O,o),checked:k,style:N,"aria-describedby":r,value:b,onChange:M,onFocus:T,onBlur:S,...z},B=e.createElement(e.Fragment,null,m!==void 0?e.createElement("label",{className:"k-radio-label",htmlFor:v||P,style:{userSelect:"none"},"aria-label":m},m):null),R=e.createElement("span",{className:"k-radio-wrap"},e.createElement("input",{...q}));return F==="before"?e.createElement(e.Fragment,null,B,R,h):e.createElement(e.Fragment,null,R,B,h)});g.propTypes={ariaDescribedBy:t.string,checked:t.bool,className:t.string,disabled:t.bool,id:t.string,size:t.oneOf([null,"small","medium","large"]),label:t.string,labelPlacement:t.string,name:t.string,style:t.object,tabIndex:t.number,value:t.any,valid:t.bool,onChange:t.func,onFocus:t.func,onBlur:t.func};const H={size:"medium"};g.displayName="KendoRadioButton";exports.RadioButton=g;exports.RadioButtonPropsContext=E;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),t=require("prop-types"),a=require("@progress/kendo-react-common"),H=require("../package-metadata.js");function K(n){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(l,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return l.default=n,Object.freeze(l)}const e=K(_),N=a.createPropsContext(),g=e.forwardRef((n,l)=>{a.validatePackage(H.packageMetadata);const s=a.usePropsContext(N,n),{ariaDescribedBy:r,checked:y,children:v,className:x,disabled:o,id:B,size:F=L.size,label:d,labelPlacement:I,name:O,style:j,tabIndex:z,value:m,valid:S,onChange:h,onFocus:b,onBlur:p,...T}=s,C=a.useUnstyled(),f=C&&C.uRadioButton,u=e.useRef(null),R=e.useCallback(()=>{u.current&&u.current.focus()},[]),i=e.useCallback(()=>({element:u.current,focus:R}),[R]);e.useImperativeHandle(l,i);const P=a.useId(),q=e.useCallback(c=>{a.dispatchEvent(h,c,i(),{value:m})},[h,m,o]),D=e.useCallback(c=>{b&&!o&&a.dispatchEvent(b,c,i(),void 0)},[b,o]),M=e.useCallback(c=>{p&&!o&&a.dispatchEvent(p,c,i(),void 0)},[p,o]),w={type:"radio",id:B||P,name:O,className:a.classNames(a.uRadioButton.input({c:f,size:F,invalid:S===!1,checked:y}),x),ref:u,disabled:o,tabIndex:a.getTabIndex(z,o),checked:y,style:j,"aria-describedby":r,value:m,onChange:q,onFocus:D,onBlur:M,...T},k=e.createElement(e.Fragment,null,d!==void 0?e.createElement("label",{className:a.classNames(a.uRadioButton.label({c:f})),htmlFor:B||P,style:{userSelect:"none"},"aria-label":d},d):null),E=e.createElement("span",{className:a.classNames(a.uRadioButton.wrap({c:f}))},e.createElement("input",{...w}));return I==="before"?e.createElement(e.Fragment,null,k,E,v):e.createElement(e.Fragment,null,E,k,v)});g.propTypes={ariaDescribedBy:t.string,checked:t.bool,className:t.string,disabled:t.bool,id:t.string,size:t.oneOf([null,"small","medium","large"]),label:t.string,labelPlacement:t.string,name:t.string,style:t.object,tabIndex:t.number,value:t.any,valid:t.bool,onChange:t.func,onFocus:t.func,onBlur:t.func};const L={size:"medium"};g.displayName="KendoRadioButton";exports.RadioButton=g;exports.RadioButtonPropsContext=N;
@@ -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;