@progress/kendo-react-inputs 8.2.1-develop.5 → 8.3.0-develop.10
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/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/index.d.mts +16 -3
- package/index.d.ts +16 -3
- package/input/Input.js +1 -1
- package/input/Input.mjs +84 -77
- package/input/InputPrefix.js +1 -1
- package/input/InputPrefix.mjs +19 -11
- package/input/InputSuffix.js +1 -1
- package/input/InputSuffix.mjs +19 -11
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +69 -69
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +80 -80
- package/radiobutton/RadioGroup.js +1 -1
- package/radiobutton/RadioGroup.mjs +76 -71
- package/textbox/Textbox.js +1 -1
- package/textbox/Textbox.mjs +82 -84
|
@@ -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
|
|
12
|
-
import { defaultRules as v, maskingChanged as
|
|
13
|
-
import { validatePackage as
|
|
14
|
-
import { FloatingLabel as
|
|
15
|
-
import { packageMetadata as
|
|
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(
|
|
18
|
-
super(
|
|
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:
|
|
22
|
-
|
|
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
|
|
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(
|
|
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 =
|
|
34
|
-
n = this._service.maskInRange(
|
|
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(
|
|
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
|
-
},
|
|
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
|
|
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:
|
|
109
|
-
valid:
|
|
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(
|
|
134
|
+
componentDidUpdate(i, t) {
|
|
135
135
|
if (this.element && this.state.focused && t.focused) {
|
|
136
|
-
let [
|
|
137
|
-
const o =
|
|
138
|
-
(!o && a || o && a && (o.start !== a.start || o.end !== a.end)) && (
|
|
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
|
-
|
|
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:
|
|
153
|
+
size: i = l.defaultProps.size,
|
|
154
154
|
fillMode: t = l.defaultProps.fillMode,
|
|
155
|
-
rounded:
|
|
156
|
-
autoFocus:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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:
|
|
165
|
-
"k-maskedtextbox k-input",
|
|
166
|
+
className: y(b.wrapper(
|
|
166
167
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
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(
|
|
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:
|
|
186
|
+
autoFocus: s,
|
|
187
187
|
spellCheck: !1,
|
|
188
|
-
className:
|
|
188
|
+
className: y(b.input({ c: h })),
|
|
189
189
|
value: this.value,
|
|
190
|
-
id:
|
|
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:
|
|
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: (
|
|
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(
|
|
210
|
+
/* @__PURE__ */ d.createElement(x, null)
|
|
211
211
|
);
|
|
212
212
|
return this.props.label ? /* @__PURE__ */ d.createElement(
|
|
213
|
-
|
|
213
|
+
H,
|
|
214
214
|
{
|
|
215
215
|
label: this.props.label,
|
|
216
|
-
editorId:
|
|
216
|
+
editorId: p,
|
|
217
217
|
editorValue: this.value,
|
|
218
|
-
editorValid:
|
|
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(
|
|
227
|
+
triggerOnChange(i, t) {
|
|
228
228
|
if (this.setState({
|
|
229
|
-
value:
|
|
229
|
+
value: i
|
|
230
230
|
}), this.props.onChange) {
|
|
231
|
-
this._valueDuringOnChange =
|
|
232
|
-
const
|
|
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,
|
|
240
|
+
this.props.onChange.call(void 0, r), this._valueDuringOnChange = void 0;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
updateService(
|
|
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
|
-
},
|
|
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(
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
"Invalid prop `" + t + "` supplied to `" +
|
|
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: (
|
|
313
|
-
suffix: (
|
|
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
|
|
321
|
-
|
|
320
|
+
const B = w(), F = M(I(B, D(c)));
|
|
321
|
+
F.displayName = "KendoReactMaskedTextBox";
|
|
322
322
|
export {
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
F as MaskedTextBox,
|
|
324
|
+
B as MaskedTextBoxPropsContext,
|
|
325
325
|
c as MaskedTextBoxWithoutContext
|
|
326
326
|
};
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-inputs",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1724427503,
|
|
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
|
+
"version": "8.3.0-develop.10",
|
|
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.
|
|
29
|
-
"@progress/kendo-react-buttons": "8.
|
|
30
|
-
"@progress/kendo-react-common": "8.
|
|
31
|
-
"@progress/kendo-react-dialogs": "8.
|
|
32
|
-
"@progress/kendo-react-intl": "8.
|
|
33
|
-
"@progress/kendo-react-labels": "8.
|
|
34
|
-
"@progress/kendo-react-popup": "8.
|
|
28
|
+
"@progress/kendo-react-animation": "8.3.0-develop.10",
|
|
29
|
+
"@progress/kendo-react-buttons": "8.3.0-develop.10",
|
|
30
|
+
"@progress/kendo-react-common": "8.3.0-develop.10",
|
|
31
|
+
"@progress/kendo-react-dialogs": "8.3.0-develop.10",
|
|
32
|
+
"@progress/kendo-react-intl": "8.3.0-develop.10",
|
|
33
|
+
"@progress/kendo-react-labels": "8.3.0-develop.10",
|
|
34
|
+
"@progress/kendo-react-popup": "8.3.0-develop.10",
|
|
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
|
|
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
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
ariaDescribedBy:
|
|
17
|
-
checked:
|
|
18
|
-
children:
|
|
19
|
-
className:
|
|
20
|
-
disabled:
|
|
21
|
-
id:
|
|
22
|
-
size:
|
|
23
|
-
label:
|
|
24
|
-
labelPlacement:
|
|
25
|
-
name:
|
|
26
|
-
style:
|
|
27
|
-
tabIndex:
|
|
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:
|
|
30
|
-
onChange:
|
|
31
|
-
onFocus:
|
|
32
|
-
onBlur:
|
|
33
|
-
...
|
|
34
|
-
} =
|
|
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
|
-
),
|
|
39
|
+
), s = e.useCallback(
|
|
40
40
|
() => ({
|
|
41
41
|
element: l.current,
|
|
42
|
-
focus:
|
|
42
|
+
focus: C
|
|
43
43
|
}),
|
|
44
|
-
[
|
|
44
|
+
[C]
|
|
45
45
|
);
|
|
46
|
-
e.useImperativeHandle(
|
|
47
|
-
const
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
[
|
|
57
|
-
),
|
|
58
|
-
(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
[
|
|
67
|
-
),
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
[
|
|
77
|
-
),
|
|
76
|
+
[i, t]
|
|
77
|
+
), O = {
|
|
78
78
|
type: "radio",
|
|
79
|
-
id:
|
|
80
|
-
name:
|
|
81
|
-
className:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
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:
|
|
92
|
-
tabIndex:
|
|
93
|
-
checked:
|
|
94
|
-
style:
|
|
95
|
-
"aria-describedby":
|
|
91
|
+
disabled: t,
|
|
92
|
+
tabIndex: J(D, t),
|
|
93
|
+
checked: p,
|
|
94
|
+
style: w,
|
|
95
|
+
"aria-describedby": F,
|
|
96
96
|
value: c,
|
|
97
|
-
onChange:
|
|
98
|
-
onFocus:
|
|
99
|
-
onBlur:
|
|
100
|
-
...
|
|
101
|
-
},
|
|
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:
|
|
105
|
-
htmlFor:
|
|
104
|
+
className: m(b.label({ c: u })),
|
|
105
|
+
htmlFor: g || v,
|
|
106
106
|
style: { userSelect: "none" },
|
|
107
|
-
"aria-label":
|
|
107
|
+
"aria-label": o
|
|
108
108
|
},
|
|
109
|
-
|
|
110
|
-
) : null),
|
|
111
|
-
return
|
|
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
|
-
|
|
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
|
|
131
|
+
const W = {
|
|
132
132
|
size: "medium"
|
|
133
133
|
};
|
|
134
|
-
|
|
134
|
+
P.displayName = "KendoRadioButton";
|
|
135
135
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
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
|
|
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;
|