@progress/kendo-react-inputs 4.13.0-dev.202111291459 → 4.13.0-dev.202111300702
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/dist/es/checkbox/Checkbox.d.ts +7 -0
- package/dist/es/checkbox/Checkbox.js +10 -2
- package/dist/es/colors/ColorGradient.d.ts +34 -14
- package/dist/es/colors/ColorGradient.js +50 -35
- package/dist/es/colors/ColorPalette.d.ts +33 -14
- package/dist/es/colors/ColorPalette.js +47 -33
- package/dist/es/colors/ColorPicker.d.ts +7 -0
- package/dist/es/colors/ColorPicker.js +10 -2
- package/dist/es/input/Input.d.ts +40 -4
- package/dist/es/input/Input.js +37 -21
- package/dist/es/main.d.ts +6 -6
- package/dist/es/main.js +6 -6
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +69 -4
- package/dist/es/maskedtextbox/MaskedTextBox.js +42 -27
- package/dist/es/numerictextbox/NumericTextBox.d.ts +7 -0
- package/dist/es/numerictextbox/NumericTextBox.js +10 -2
- package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.d.ts +3 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.d.ts +13 -0
- package/dist/es/radiobutton/RadioButton.js +16 -2
- package/dist/es/radiobutton/RadioGroup.d.ts +13 -0
- package/dist/es/radiobutton/RadioGroup.js +16 -2
- package/dist/es/range-slider/RangeSlider.d.ts +11 -1
- package/dist/es/range-slider/RangeSlider.js +14 -3
- package/dist/es/rating/Rating.d.ts +11 -1
- package/dist/es/rating/Rating.js +14 -3
- package/dist/es/slider/Slider.d.ts +24 -4
- package/dist/es/slider/Slider.js +31 -16
- package/dist/es/switch/Switch.d.ts +40 -4
- package/dist/es/switch/Switch.js +39 -24
- package/dist/es/textarea/TextArea.d.ts +11 -0
- package/dist/es/textarea/TextArea.js +14 -2
- package/dist/es/utils.d.ts +4 -0
- package/dist/es/utils.js +20 -0
- package/dist/npm/checkbox/Checkbox.d.ts +7 -0
- package/dist/npm/checkbox/Checkbox.js +9 -1
- package/dist/npm/colors/ColorGradient.d.ts +34 -14
- package/dist/npm/colors/ColorGradient.js +49 -34
- package/dist/npm/colors/ColorPalette.d.ts +33 -14
- package/dist/npm/colors/ColorPalette.js +46 -32
- package/dist/npm/colors/ColorPicker.d.ts +7 -0
- package/dist/npm/colors/ColorPicker.js +9 -1
- package/dist/npm/input/Input.d.ts +40 -4
- package/dist/npm/input/Input.js +36 -20
- package/dist/npm/main.d.ts +6 -6
- package/dist/npm/main.js +18 -6
- package/dist/npm/maskedtextbox/MaskedTextBox.d.ts +69 -4
- package/dist/npm/maskedtextbox/MaskedTextBox.js +41 -26
- package/dist/npm/numerictextbox/NumericTextBox.d.ts +7 -0
- package/dist/npm/numerictextbox/NumericTextBox.js +9 -1
- package/dist/npm/numerictextbox/interfaces/NumericTextBoxProps.d.ts +3 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.d.ts +13 -0
- package/dist/npm/radiobutton/RadioButton.js +15 -1
- package/dist/npm/radiobutton/RadioGroup.d.ts +13 -0
- package/dist/npm/radiobutton/RadioGroup.js +15 -1
- package/dist/npm/range-slider/RangeSlider.d.ts +11 -1
- package/dist/npm/range-slider/RangeSlider.js +13 -2
- package/dist/npm/rating/Rating.d.ts +11 -1
- package/dist/npm/rating/Rating.js +13 -2
- package/dist/npm/slider/Slider.d.ts +24 -4
- package/dist/npm/slider/Slider.js +30 -15
- package/dist/npm/switch/Switch.d.ts +40 -4
- package/dist/npm/switch/Switch.js +38 -23
- package/dist/npm/textarea/TextArea.d.ts +11 -0
- package/dist/npm/textarea/TextArea.js +13 -1
- package/dist/npm/utils.d.ts +4 -0
- package/dist/npm/utils.js +23 -0
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +16 -11
package/dist/es/input/Input.js
CHANGED
|
@@ -33,16 +33,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
33
33
|
};
|
|
34
34
|
import * as React from 'react';
|
|
35
35
|
import * as PropTypes from 'prop-types';
|
|
36
|
-
import { guid, classNames } from '@progress/kendo-react-common';
|
|
36
|
+
import { guid, classNames, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
|
|
37
37
|
import { FloatingLabel } from '@progress/kendo-react-labels';
|
|
38
38
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
39
39
|
import { packageMetadata } from '../package-metadata';
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
__extends(Input, _super);
|
|
45
|
-
function Input(props) {
|
|
40
|
+
/** @hidden */
|
|
41
|
+
var InputWithoutContext = /** @class */ (function (_super) {
|
|
42
|
+
__extends(InputWithoutContext, _super);
|
|
43
|
+
function InputWithoutContext(props) {
|
|
46
44
|
var _this = _super.call(this, props) || this;
|
|
47
45
|
_this._inputId = guid();
|
|
48
46
|
/**
|
|
@@ -103,11 +101,11 @@ var Input = /** @class */ (function (_super) {
|
|
|
103
101
|
};
|
|
104
102
|
validatePackage(packageMetadata);
|
|
105
103
|
_this.state = {
|
|
106
|
-
value: _this.props.defaultValue ||
|
|
104
|
+
value: _this.props.defaultValue || InputWithoutContext.defaultProps.defaultValue
|
|
107
105
|
};
|
|
108
106
|
return _this;
|
|
109
107
|
}
|
|
110
|
-
Object.defineProperty(
|
|
108
|
+
Object.defineProperty(InputWithoutContext.prototype, "element", {
|
|
111
109
|
/**
|
|
112
110
|
* Gets the native input element of the Input component.
|
|
113
111
|
*/
|
|
@@ -117,7 +115,7 @@ var Input = /** @class */ (function (_super) {
|
|
|
117
115
|
enumerable: true,
|
|
118
116
|
configurable: true
|
|
119
117
|
});
|
|
120
|
-
Object.defineProperty(
|
|
118
|
+
Object.defineProperty(InputWithoutContext.prototype, "value", {
|
|
121
119
|
/**
|
|
122
120
|
* Gets the value of the Input.
|
|
123
121
|
*/
|
|
@@ -131,7 +129,7 @@ var Input = /** @class */ (function (_super) {
|
|
|
131
129
|
enumerable: true,
|
|
132
130
|
configurable: true
|
|
133
131
|
});
|
|
134
|
-
Object.defineProperty(
|
|
132
|
+
Object.defineProperty(InputWithoutContext.prototype, "name", {
|
|
135
133
|
/**
|
|
136
134
|
* Gets the `name` property of the Input.
|
|
137
135
|
*/
|
|
@@ -141,7 +139,7 @@ var Input = /** @class */ (function (_super) {
|
|
|
141
139
|
enumerable: true,
|
|
142
140
|
configurable: true
|
|
143
141
|
});
|
|
144
|
-
Object.defineProperty(
|
|
142
|
+
Object.defineProperty(InputWithoutContext.prototype, "validity", {
|
|
145
143
|
/**
|
|
146
144
|
* Represents the validity state into which the Input is set.
|
|
147
145
|
*/
|
|
@@ -167,14 +165,14 @@ var Input = /** @class */ (function (_super) {
|
|
|
167
165
|
enumerable: true,
|
|
168
166
|
configurable: true
|
|
169
167
|
});
|
|
170
|
-
Object.defineProperty(
|
|
168
|
+
Object.defineProperty(InputWithoutContext.prototype, "validityStyles", {
|
|
171
169
|
/**
|
|
172
170
|
* @hidden
|
|
173
171
|
*/
|
|
174
172
|
get: function () {
|
|
175
173
|
return this.props.validityStyles !== undefined
|
|
176
174
|
? this.props.validityStyles
|
|
177
|
-
:
|
|
175
|
+
: InputWithoutContext.defaultProps.validityStyles;
|
|
178
176
|
},
|
|
179
177
|
enumerable: true,
|
|
180
178
|
configurable: true
|
|
@@ -182,19 +180,19 @@ var Input = /** @class */ (function (_super) {
|
|
|
182
180
|
/**
|
|
183
181
|
* @hidden
|
|
184
182
|
*/
|
|
185
|
-
|
|
183
|
+
InputWithoutContext.prototype.componentDidMount = function () {
|
|
186
184
|
this.forceUpdate();
|
|
187
185
|
};
|
|
188
186
|
/**
|
|
189
187
|
* @hidden
|
|
190
188
|
*/
|
|
191
|
-
|
|
189
|
+
InputWithoutContext.prototype.componentDidUpdate = function () {
|
|
192
190
|
this.setValidity();
|
|
193
191
|
};
|
|
194
192
|
/**
|
|
195
193
|
* @hidden
|
|
196
194
|
*/
|
|
197
|
-
|
|
195
|
+
InputWithoutContext.prototype.render = function () {
|
|
198
196
|
var _this = this;
|
|
199
197
|
var _a = this.props, className = _a.className, label = _a.label, id = _a.id, validationMessage = _a.validationMessage, defaultValue = _a.defaultValue, valid = _a.valid,
|
|
200
198
|
// Removed to support direct use in Form Field component
|
|
@@ -211,10 +209,11 @@ var Input = /** @class */ (function (_super) {
|
|
|
211
209
|
(React.createElement(FloatingLabel, { label: label, editorId: inputId, editorValue: String(this.value), editorValid: isValid, editorDisabled: props.disabled, editorPlaceholder: props.placeholder, children: textbox, style: style, dir: props.dir }))
|
|
212
210
|
: textbox;
|
|
213
211
|
};
|
|
212
|
+
InputWithoutContext.displayName = 'Input';
|
|
214
213
|
/**
|
|
215
214
|
* @hidden
|
|
216
215
|
*/
|
|
217
|
-
|
|
216
|
+
InputWithoutContext.propTypes = {
|
|
218
217
|
label: PropTypes.string,
|
|
219
218
|
validationMessage: PropTypes.string,
|
|
220
219
|
required: PropTypes.bool,
|
|
@@ -226,11 +225,28 @@ var Input = /** @class */ (function (_super) {
|
|
|
226
225
|
/**
|
|
227
226
|
* @hidden
|
|
228
227
|
*/
|
|
229
|
-
|
|
228
|
+
InputWithoutContext.defaultProps = {
|
|
230
229
|
defaultValue: '',
|
|
231
230
|
required: false,
|
|
232
231
|
validityStyles: true
|
|
233
232
|
};
|
|
234
|
-
return
|
|
233
|
+
return InputWithoutContext;
|
|
235
234
|
}(React.Component));
|
|
236
|
-
export {
|
|
235
|
+
export { InputWithoutContext };
|
|
236
|
+
/**
|
|
237
|
+
* Represents the PropsContext of the `Input` component.
|
|
238
|
+
* Used for global configuration of all `Input` instances.
|
|
239
|
+
*
|
|
240
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
241
|
+
*/
|
|
242
|
+
export var InputPropsContext = createPropsContext();
|
|
243
|
+
;
|
|
244
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
245
|
+
/**
|
|
246
|
+
* Represents the [KendoReact Input component]({% slug overview_textbox %}).
|
|
247
|
+
*
|
|
248
|
+
* Accepts properties of type [InputProps]({% slug api_inputs_inputprops %}).
|
|
249
|
+
* Obtaining the `ref` returns an object of type [InputHandle]({% slug api_inputs_inputhandle %}).
|
|
250
|
+
*/
|
|
251
|
+
export var Input = withPropsContext(InputPropsContext, InputWithoutContext);
|
|
252
|
+
Input.displayName = 'KendoReactInput';
|
package/dist/es/main.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { FormComponentValidity } from '@progress/kendo-react-common';
|
|
|
2
2
|
export { FormComponentValidity };
|
|
3
3
|
import { InputChangeEvent } from './input/interfaces/InputChangeEvent';
|
|
4
4
|
export { InputChangeEvent };
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export { ColorGradient, ColorGradientHandle, ColorGradientPropsContext, ColorGradientState } from './colors/ColorGradient';
|
|
6
|
+
export { ColorPalette, ColorPaletteHandle, ColorPalettePropsContext, ColorPaletteState } from './colors/ColorPalette';
|
|
7
7
|
export * from './colors/ColorPicker';
|
|
8
8
|
export * from './colors/interfaces/ColorGradientChangeEvent';
|
|
9
9
|
export * from './colors/interfaces/ColorGradientProps';
|
|
@@ -17,8 +17,8 @@ export * from './colors/interfaces/ColorPickerPaletteSettings';
|
|
|
17
17
|
export * from './colors/interfaces/ColorPickerPopupSettings';
|
|
18
18
|
export * from './colors/interfaces/ColorPickerProps';
|
|
19
19
|
export * from './colors/FlatColorPicker';
|
|
20
|
-
export
|
|
21
|
-
export
|
|
20
|
+
export { Input, InputHandle, InputProps, InputPropsContext, InputState } from './input/Input';
|
|
21
|
+
export { MaskedTextBox, MaskedTextBoxHandle, MaskedTextBoxPropsContext } from './maskedtextbox/MaskedTextBox';
|
|
22
22
|
export * from './maskedtextbox/MaskedTextBoxProps';
|
|
23
23
|
export * from './numerictextbox/NumericTextBox';
|
|
24
24
|
export * from './numerictextbox/interfaces/NumericTextBoxHandle';
|
|
@@ -26,11 +26,11 @@ export * from './numerictextbox/interfaces/NumericTextBoxChangeEvent';
|
|
|
26
26
|
export * from './numerictextbox/interfaces/NumericTextBoxBlurEvent';
|
|
27
27
|
export * from './numerictextbox/interfaces/NumericTextBoxFocusEvent';
|
|
28
28
|
export * from './numerictextbox/interfaces/NumericTextBoxProps';
|
|
29
|
-
export
|
|
29
|
+
export { Slider, SliderHandle, SliderProps, SliderPropsContext, SliderChangeEvent } from './slider/Slider';
|
|
30
30
|
export * from './slider/SliderLabel';
|
|
31
31
|
export * from './range-slider/RangeSlider';
|
|
32
32
|
export * from './interfaces/ToggleBaseProps';
|
|
33
|
-
export
|
|
33
|
+
export { Switch, SwitchHandle, SwitchProps, SwitchPropsContext, SwitchState, SwitchChangeEvent } from './switch/Switch';
|
|
34
34
|
export * from './checkbox/interfaces/CheckboxProps';
|
|
35
35
|
export * from './checkbox/interfaces/CheckboxChangeEvent';
|
|
36
36
|
export * from './checkbox/interfaces/CheckboxFocusEvent';
|
package/dist/es/main.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { ColorGradient, ColorGradientPropsContext } from './colors/ColorGradient';
|
|
2
|
+
export { ColorPalette, ColorPalettePropsContext } from './colors/ColorPalette';
|
|
3
3
|
export * from './colors/ColorPicker';
|
|
4
4
|
export * from './colors/FlatColorPicker';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export { Input, InputPropsContext } from './input/Input';
|
|
6
|
+
export { MaskedTextBox, MaskedTextBoxPropsContext } from './maskedtextbox/MaskedTextBox';
|
|
7
7
|
export * from './numerictextbox/NumericTextBox';
|
|
8
|
-
export
|
|
8
|
+
export { Slider, SliderPropsContext } from './slider/Slider';
|
|
9
9
|
export * from './slider/SliderLabel';
|
|
10
10
|
export * from './range-slider/RangeSlider';
|
|
11
|
-
export
|
|
11
|
+
export { Switch, SwitchPropsContext } from './switch/Switch';
|
|
12
12
|
export * from './checkbox/Checkbox';
|
|
13
13
|
export * from './radiobutton/RadioGroup';
|
|
14
14
|
export * from './radiobutton/RadioButton';
|
|
@@ -9,10 +9,9 @@ interface MaskedTextBoxState {
|
|
|
9
9
|
focused?: boolean;
|
|
10
10
|
value?: string;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare class MaskedTextBox extends React.Component<MaskedTextBoxProps, MaskedTextBoxState> implements FormComponent {
|
|
12
|
+
/** @hidden */
|
|
13
|
+
export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedTextBoxProps, MaskedTextBoxState> implements FormComponent {
|
|
14
|
+
static displayName: string;
|
|
16
15
|
/**
|
|
17
16
|
* @hidden
|
|
18
17
|
*/
|
|
@@ -156,4 +155,70 @@ export declare class MaskedTextBox extends React.Component<MaskedTextBoxProps, M
|
|
|
156
155
|
private readonly rules;
|
|
157
156
|
private setValidity;
|
|
158
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Represents the PropsContext of the `MaskedTextBox` component.
|
|
160
|
+
* Used for global configuration of all `MaskedTextBox` instances.
|
|
161
|
+
*
|
|
162
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
163
|
+
*/
|
|
164
|
+
export declare const MaskedTextBoxPropsContext: React.Context<(p: MaskedTextBoxProps) => MaskedTextBoxProps>;
|
|
165
|
+
/**
|
|
166
|
+
* Represent the `ref` of the MaskedTextBox component.
|
|
167
|
+
*/
|
|
168
|
+
export interface MaskedTextBoxHandle extends Pick<MaskedTextBoxWithoutContext, keyof MaskedTextBoxWithoutContext> {
|
|
169
|
+
/**
|
|
170
|
+
* Gets the element of the MaskedTextBox.
|
|
171
|
+
*
|
|
172
|
+
* ```jsx
|
|
173
|
+
* class App extends React.Component {
|
|
174
|
+
* constructor(props) {
|
|
175
|
+
* super(props);
|
|
176
|
+
* }
|
|
177
|
+
* element = null;
|
|
178
|
+
* render() {
|
|
179
|
+
* return (
|
|
180
|
+
* <div>
|
|
181
|
+
* <MaskedTextBox
|
|
182
|
+
* ref={(component) =>
|
|
183
|
+
* this.element = component ? component.element : null}
|
|
184
|
+
* />
|
|
185
|
+
* <button onClick={() => console.log(this.element)}>console.log the element</button>
|
|
186
|
+
* </div>
|
|
187
|
+
* );
|
|
188
|
+
* }
|
|
189
|
+
* }
|
|
190
|
+
*
|
|
191
|
+
* ReactDOM.render(
|
|
192
|
+
* <App />,
|
|
193
|
+
* document.getElementsByTagName('my-app')[0]
|
|
194
|
+
* );
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
element: HTMLInputElement | null;
|
|
198
|
+
/**
|
|
199
|
+
* Gets the `name` property of the MaskedTextBox.
|
|
200
|
+
*/
|
|
201
|
+
name: string | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Gets the raw value without the mask of the MaskedTextBox.
|
|
204
|
+
*/
|
|
205
|
+
rawValue: string;
|
|
206
|
+
/**
|
|
207
|
+
* Represents the validity state into which the MaskedTextBox is set.
|
|
208
|
+
*/
|
|
209
|
+
validity: FormComponentValidity;
|
|
210
|
+
/**
|
|
211
|
+
* Gets the value with the mask of the MaskedTextBox.
|
|
212
|
+
*/
|
|
213
|
+
value: string;
|
|
214
|
+
}
|
|
215
|
+
/** @hidden */
|
|
216
|
+
export declare type MaskedTextBox = MaskedTextBoxHandle;
|
|
217
|
+
/**
|
|
218
|
+
* Represents the props of the [KendoReact MaskedTextBox component]({% slug overview_maskedtextbox %}).
|
|
219
|
+
*
|
|
220
|
+
* Accepts properties of type [MaskedTextBoxProps]({% slug api_inputs_maskedtextboxprops %}).
|
|
221
|
+
* Obtaining the `ref` returns an object of type [MaskedTextBoxHandle]({% slug api_inputs_maskedtextboxhandle %}).
|
|
222
|
+
*/
|
|
223
|
+
export declare const MaskedTextBox: React.ForwardRefExoticComponent<MaskedTextBoxProps & React.RefAttributes<any>>;
|
|
159
224
|
export {};
|
|
@@ -26,16 +26,14 @@ import * as React from 'react';
|
|
|
26
26
|
import * as PropTypes from 'prop-types';
|
|
27
27
|
import { MaskingService } from './masking.service';
|
|
28
28
|
import { defaultRules, maskingChanged, returnFalse } from './utils';
|
|
29
|
-
import { guid, classNames, getTabIndex } from '@progress/kendo-react-common';
|
|
29
|
+
import { guid, classNames, getTabIndex, withPropsContext, createPropsContext } from '@progress/kendo-react-common';
|
|
30
30
|
import { FloatingLabel } from '@progress/kendo-react-labels';
|
|
31
31
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
32
32
|
import { packageMetadata } from '../package-metadata';
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
__extends(MaskedTextBox, _super);
|
|
38
|
-
function MaskedTextBox(props) {
|
|
33
|
+
/** @hidden */
|
|
34
|
+
var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
35
|
+
__extends(MaskedTextBoxWithoutContext, _super);
|
|
36
|
+
function MaskedTextBoxWithoutContext(props) {
|
|
39
37
|
var _this = _super.call(this, props) || this;
|
|
40
38
|
/**
|
|
41
39
|
* @hidden
|
|
@@ -121,7 +119,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
121
119
|
validatePackage(packageMetadata);
|
|
122
120
|
return _this;
|
|
123
121
|
}
|
|
124
|
-
Object.defineProperty(
|
|
122
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "element", {
|
|
125
123
|
/**
|
|
126
124
|
* Gets the element of the MaskedTextBox.
|
|
127
125
|
*
|
|
@@ -159,7 +157,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
159
157
|
enumerable: true,
|
|
160
158
|
configurable: true
|
|
161
159
|
});
|
|
162
|
-
Object.defineProperty(
|
|
160
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "value", {
|
|
163
161
|
/**
|
|
164
162
|
* Gets the value with the mask of the MaskedTextBox.
|
|
165
163
|
*/
|
|
@@ -181,7 +179,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
181
179
|
enumerable: true,
|
|
182
180
|
configurable: true
|
|
183
181
|
});
|
|
184
|
-
Object.defineProperty(
|
|
182
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "rawValue", {
|
|
185
183
|
/**
|
|
186
184
|
* Gets the raw value without the mask of the MaskedTextBox.
|
|
187
185
|
*/
|
|
@@ -191,7 +189,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
191
189
|
enumerable: true,
|
|
192
190
|
configurable: true
|
|
193
191
|
});
|
|
194
|
-
Object.defineProperty(
|
|
192
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "validity", {
|
|
195
193
|
/**
|
|
196
194
|
* Represents the validity state into which the MaskedTextBox is set.
|
|
197
195
|
*/
|
|
@@ -211,31 +209,31 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
211
209
|
enumerable: true,
|
|
212
210
|
configurable: true
|
|
213
211
|
});
|
|
214
|
-
Object.defineProperty(
|
|
212
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "validityStyles", {
|
|
215
213
|
/**
|
|
216
214
|
* @hidden
|
|
217
215
|
*/
|
|
218
216
|
get: function () {
|
|
219
217
|
return this.props.validityStyles !== undefined
|
|
220
218
|
? this.props.validityStyles
|
|
221
|
-
:
|
|
219
|
+
: MaskedTextBoxWithoutContext.defaultProps.validityStyles;
|
|
222
220
|
},
|
|
223
221
|
enumerable: true,
|
|
224
222
|
configurable: true
|
|
225
223
|
});
|
|
226
|
-
Object.defineProperty(
|
|
224
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "required", {
|
|
227
225
|
/**
|
|
228
226
|
* @hidden
|
|
229
227
|
*/
|
|
230
228
|
get: function () {
|
|
231
229
|
return this.props.required !== undefined
|
|
232
230
|
? this.props.required
|
|
233
|
-
:
|
|
231
|
+
: MaskedTextBoxWithoutContext.defaultProps.required;
|
|
234
232
|
},
|
|
235
233
|
enumerable: true,
|
|
236
234
|
configurable: true
|
|
237
235
|
});
|
|
238
|
-
Object.defineProperty(
|
|
236
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "name", {
|
|
239
237
|
/**
|
|
240
238
|
* Gets the `name` property of the MaskedTextBox.
|
|
241
239
|
*/
|
|
@@ -248,7 +246,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
248
246
|
/**
|
|
249
247
|
* @hidden
|
|
250
248
|
*/
|
|
251
|
-
|
|
249
|
+
MaskedTextBoxWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
252
250
|
if (this.element && this.state.focused && prevState.focused) {
|
|
253
251
|
var _a = this._selection, start = _a[0], end = _a[1];
|
|
254
252
|
var prevSelection = prevProps.selection;
|
|
@@ -271,14 +269,14 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
271
269
|
/**
|
|
272
270
|
* @hidden
|
|
273
271
|
*/
|
|
274
|
-
|
|
272
|
+
MaskedTextBoxWithoutContext.prototype.componentDidMount = function () {
|
|
275
273
|
this.updateService();
|
|
276
274
|
this.setValidity();
|
|
277
275
|
};
|
|
278
276
|
/**
|
|
279
277
|
* @hidden
|
|
280
278
|
*/
|
|
281
|
-
|
|
279
|
+
MaskedTextBoxWithoutContext.prototype.render = function () {
|
|
282
280
|
var _this = this;
|
|
283
281
|
var inputId = this.props.id || this._inputId;
|
|
284
282
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
@@ -294,7 +292,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
294
292
|
? (React.createElement(FloatingLabel, { label: this.props.label, editorId: inputId, editorValue: this.value, editorValid: isValid, editorDisabled: this.props.disabled, editorPlaceholder: this.props.placeholder, children: component, style: { width: this.props.width }, dir: this.props.dir }))
|
|
295
293
|
: component;
|
|
296
294
|
};
|
|
297
|
-
|
|
295
|
+
MaskedTextBoxWithoutContext.prototype.triggerOnChange = function (maskedValue, event) {
|
|
298
296
|
this.setState({
|
|
299
297
|
value: maskedValue
|
|
300
298
|
});
|
|
@@ -311,7 +309,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
311
309
|
this._valueDuringOnChange = undefined;
|
|
312
310
|
}
|
|
313
311
|
};
|
|
314
|
-
|
|
312
|
+
MaskedTextBoxWithoutContext.prototype.updateService = function (extra) {
|
|
315
313
|
var config = Object.assign({
|
|
316
314
|
includeLiterals: this.props.includeLiterals,
|
|
317
315
|
mask: this.props.mask,
|
|
@@ -321,17 +319,18 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
321
319
|
}, extra); // tslint:disable-line:align
|
|
322
320
|
this._service.update(config);
|
|
323
321
|
};
|
|
324
|
-
Object.defineProperty(
|
|
322
|
+
Object.defineProperty(MaskedTextBoxWithoutContext.prototype, "rules", {
|
|
325
323
|
get: function () {
|
|
326
324
|
return Object.assign({}, defaultRules, this.props.rules);
|
|
327
325
|
},
|
|
328
326
|
enumerable: true,
|
|
329
327
|
configurable: true
|
|
330
328
|
});
|
|
329
|
+
MaskedTextBoxWithoutContext.displayName = 'MaskedTextBox';
|
|
331
330
|
/**
|
|
332
331
|
* @hidden
|
|
333
332
|
*/
|
|
334
|
-
|
|
333
|
+
MaskedTextBoxWithoutContext.propTypes = {
|
|
335
334
|
value: PropTypes.string,
|
|
336
335
|
defaultValue: PropTypes.string,
|
|
337
336
|
placeholder: PropTypes.string,
|
|
@@ -364,8 +363,8 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
364
363
|
return new Error('Invalid prop `' + propName + '` supplied to' +
|
|
365
364
|
' `' + componentName + '`. Validation failed.');
|
|
366
365
|
}
|
|
367
|
-
return null;
|
|
368
366
|
}
|
|
367
|
+
return null;
|
|
369
368
|
},
|
|
370
369
|
selection: PropTypes.shape({
|
|
371
370
|
start: PropTypes.number.isRequired,
|
|
@@ -382,7 +381,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
382
381
|
/**
|
|
383
382
|
* @hidden
|
|
384
383
|
*/
|
|
385
|
-
|
|
384
|
+
MaskedTextBoxWithoutContext.defaultProps = {
|
|
386
385
|
prompt: '_',
|
|
387
386
|
promptPlaceholder: ' ',
|
|
388
387
|
includeLiterals: false,
|
|
@@ -391,6 +390,22 @@ var MaskedTextBox = /** @class */ (function (_super) {
|
|
|
391
390
|
required: false,
|
|
392
391
|
validityStyles: true
|
|
393
392
|
};
|
|
394
|
-
return
|
|
393
|
+
return MaskedTextBoxWithoutContext;
|
|
395
394
|
}(React.Component));
|
|
396
|
-
export {
|
|
395
|
+
export { MaskedTextBoxWithoutContext };
|
|
396
|
+
/**
|
|
397
|
+
* Represents the PropsContext of the `MaskedTextBox` component.
|
|
398
|
+
* Used for global configuration of all `MaskedTextBox` instances.
|
|
399
|
+
*
|
|
400
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
401
|
+
*/
|
|
402
|
+
export var MaskedTextBoxPropsContext = createPropsContext();
|
|
403
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
404
|
+
/**
|
|
405
|
+
* Represents the props of the [KendoReact MaskedTextBox component]({% slug overview_maskedtextbox %}).
|
|
406
|
+
*
|
|
407
|
+
* Accepts properties of type [MaskedTextBoxProps]({% slug api_inputs_maskedtextboxprops %}).
|
|
408
|
+
* Obtaining the `ref` returns an object of type [MaskedTextBoxHandle]({% slug api_inputs_maskedtextboxhandle %}).
|
|
409
|
+
*/
|
|
410
|
+
export var MaskedTextBox = withPropsContext(MaskedTextBoxPropsContext, MaskedTextBoxWithoutContext);
|
|
411
|
+
MaskedTextBox.displayName = 'KendoReactMaskedTextBox';
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { NumericTextBoxProps } from './interfaces/NumericTextBoxProps';
|
|
3
3
|
import { NumericTextBoxHandle } from './interfaces/NumericTextBoxHandle';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the PropsContext of the `NumericTextBox` component.
|
|
6
|
+
* Used for global configuration of all `NumericTextBox` instances.
|
|
7
|
+
*
|
|
8
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NumericTextBoxPropsContext: React.Context<(p: NumericTextBoxProps) => NumericTextBoxProps>;
|
|
4
11
|
/**
|
|
5
12
|
* Represents the [KendoReact NumericTextBox component]({% slug overview_numerictextbox %}).
|
|
6
13
|
*/
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { useInternationalization, useLocalization } from '@progress/kendo-react-intl';
|
|
4
|
-
import { classNames, guid, getTabIndex, dispatchEvent } from '@progress/kendo-react-common';
|
|
4
|
+
import { classNames, guid, getTabIndex, dispatchEvent, createPropsContext, usePropsContext } from '@progress/kendo-react-common';
|
|
5
5
|
import { FloatingLabel } from '@progress/kendo-react-labels';
|
|
6
6
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
7
7
|
import { packageMetadata } from '../package-metadata';
|
|
8
8
|
import { numericIncreaseValue, messages, numericDecreaseValue } from '../messages';
|
|
9
9
|
import { formatValue, sanitizeNumber, rangeValue, increaseValue, decreaseValue, getStateOrPropsValue, getInitialState } from './utils';
|
|
10
10
|
var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
11
|
+
/**
|
|
12
|
+
* Represents the PropsContext of the `NumericTextBox` component.
|
|
13
|
+
* Used for global configuration of all `NumericTextBox` instances.
|
|
14
|
+
*
|
|
15
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
16
|
+
*/
|
|
17
|
+
export var NumericTextBoxPropsContext = createPropsContext();
|
|
11
18
|
/**
|
|
12
19
|
* Represents the [KendoReact NumericTextBox component]({% slug overview_numerictextbox %}).
|
|
13
20
|
*/
|
|
14
|
-
export var NumericTextBox = React.forwardRef(function (
|
|
21
|
+
export var NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
15
22
|
validatePackage(packageMetadata);
|
|
23
|
+
var props = usePropsContext(NumericTextBoxPropsContext, directProps);
|
|
16
24
|
var calculatedId = React.useMemo(function () { return guid(); }, []);
|
|
17
25
|
var inputId = props.id || calculatedId;
|
|
18
26
|
var intlService = useInternationalization();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormComponentProps } from '@progress/kendo-react-common';
|
|
2
3
|
import { NumberFormatOptions } from '@progress/kendo-react-intl';
|
|
3
4
|
import { NumericTextBoxChangeEvent } from './NumericTextBoxChangeEvent';
|
|
@@ -121,5 +122,7 @@ export interface NumericTextBoxProps extends FormComponentProps {
|
|
|
121
122
|
* The event handler that will be fired when NumericTextBox is blurred.
|
|
122
123
|
*/
|
|
123
124
|
onBlur?: (event: NumericTextBoxBlurEvent) => void;
|
|
125
|
+
/** @hidden */
|
|
126
|
+
children?: React.ReactNode;
|
|
124
127
|
}
|
|
125
128
|
export {};
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-inputs',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1638254513,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -7,4 +7,17 @@ export interface RadioButtonHandle {
|
|
|
7
7
|
element: HTMLInputElement | null;
|
|
8
8
|
focus: any;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents the PropsContext of the `RadioButton` component.
|
|
12
|
+
* Used for global configuration of all `RadioButton` instances.
|
|
13
|
+
*
|
|
14
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
15
|
+
*/
|
|
16
|
+
export declare const RadioButtonPropsContext: React.Context<(p: RadioButtonProps) => RadioButtonProps>;
|
|
17
|
+
/**
|
|
18
|
+
* Represents the [KendoReact RadioButton component]({% slug overview_radiobutton %}).
|
|
19
|
+
*
|
|
20
|
+
* Accepts properties of type [RadioButtonProps]({% slug api_inputs_radiobuttonprops %}).
|
|
21
|
+
* Obtaining the `ref` returns an object of type [RadioButtonHandle]({% slug api_inputs_radiobuttonhandle %}).
|
|
22
|
+
*/
|
|
10
23
|
export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<RadioButtonHandle>>;
|
|
@@ -20,11 +20,25 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
};
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import * as PropTypes from 'prop-types';
|
|
23
|
-
import { guid, classNames, dispatchEvent, getTabIndex } from '@progress/kendo-react-common';
|
|
23
|
+
import { guid, classNames, dispatchEvent, getTabIndex, createPropsContext, usePropsContext } from '@progress/kendo-react-common';
|
|
24
24
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
25
25
|
import { packageMetadata } from '../package-metadata';
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Represents the PropsContext of the `RadioButton` component.
|
|
28
|
+
* Used for global configuration of all `RadioButton` instances.
|
|
29
|
+
*
|
|
30
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
31
|
+
*/
|
|
32
|
+
export var RadioButtonPropsContext = createPropsContext();
|
|
33
|
+
/**
|
|
34
|
+
* Represents the [KendoReact RadioButton component]({% slug overview_radiobutton %}).
|
|
35
|
+
*
|
|
36
|
+
* Accepts properties of type [RadioButtonProps]({% slug api_inputs_radiobuttonprops %}).
|
|
37
|
+
* Obtaining the `ref` returns an object of type [RadioButtonHandle]({% slug api_inputs_radiobuttonhandle %}).
|
|
38
|
+
*/
|
|
39
|
+
export var RadioButton = React.forwardRef(function (directProps, target) {
|
|
27
40
|
validatePackage(packageMetadata);
|
|
41
|
+
var props = usePropsContext(RadioButtonPropsContext, directProps);
|
|
28
42
|
var ariaDescribedBy = props.ariaDescribedBy, checked = props.checked, children = props.children, className = props.className, disabled = props.disabled, id = props.id, label = props.label, labelPlacement = props.labelPlacement, name = props.name, style = props.style, tabIndex = props.tabIndex, value = props.value, valid = props.valid, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, others = __rest(props, ["ariaDescribedBy", "checked", "children", "className", "disabled", "id", "label", "labelPlacement", "name", "style", "tabIndex", "value", "valid", "onChange", "onFocus", "onBlur"]);
|
|
29
43
|
var elementRef = React.useRef(null);
|
|
30
44
|
var focusElement = React.useCallback(function () {
|
|
@@ -7,4 +7,17 @@ export interface RadioGroupHandle {
|
|
|
7
7
|
element: HTMLUListElement | null;
|
|
8
8
|
focus: any;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents the PropsContext of the `RadioGroup` component.
|
|
12
|
+
* Used for global configuration of all `RadioGroup` instances.
|
|
13
|
+
*
|
|
14
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
15
|
+
*/
|
|
16
|
+
export declare const RadioGroupPropsContext: React.Context<(p: RadioGroupProps) => RadioGroupProps>;
|
|
17
|
+
/**
|
|
18
|
+
* Represents the [KendoReact RadioGroup component]({% slug overview_radiogroup %}).
|
|
19
|
+
*
|
|
20
|
+
* Accepts properties of type [RadioGroupProps]({% slug api_inputs_radiogroupprops %}).
|
|
21
|
+
* Obtaining the `ref` returns an object of type [RadioGroupHandle]({% slug api_inputs_radiogrouphandle %}).
|
|
22
|
+
*/
|
|
10
23
|
export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<RadioGroupHandle>>;
|
|
@@ -12,11 +12,25 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import * as PropTypes from 'prop-types';
|
|
14
14
|
import { RadioButton } from './RadioButton';
|
|
15
|
-
import { useRtl, guid, classNames, focusFirstFocusableChild, dispatchEvent } from '@progress/kendo-react-common';
|
|
15
|
+
import { useRtl, guid, classNames, focusFirstFocusableChild, dispatchEvent, createPropsContext, usePropsContext } from '@progress/kendo-react-common';
|
|
16
16
|
import { validatePackage } from '@progress/kendo-react-common';
|
|
17
17
|
import { packageMetadata } from '../package-metadata';
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Represents the PropsContext of the `RadioGroup` component.
|
|
20
|
+
* Used for global configuration of all `RadioGroup` instances.
|
|
21
|
+
*
|
|
22
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
23
|
+
*/
|
|
24
|
+
export var RadioGroupPropsContext = createPropsContext();
|
|
25
|
+
/**
|
|
26
|
+
* Represents the [KendoReact RadioGroup component]({% slug overview_radiogroup %}).
|
|
27
|
+
*
|
|
28
|
+
* Accepts properties of type [RadioGroupProps]({% slug api_inputs_radiogroupprops %}).
|
|
29
|
+
* Obtaining the `ref` returns an object of type [RadioGroupHandle]({% slug api_inputs_radiogrouphandle %}).
|
|
30
|
+
*/
|
|
31
|
+
export var RadioGroup = React.forwardRef(function (directProps, target) {
|
|
19
32
|
validatePackage(packageMetadata);
|
|
33
|
+
var props = usePropsContext(RadioGroupPropsContext, directProps);
|
|
20
34
|
var ariaLabelledBy = props.ariaLabelledBy, ariaDescribedBy = props.ariaDescribedBy, className = props.className, data = props.data, defaultValue = props.defaultValue, disabled = props.disabled, name = props.name, labelPlacement = props.labelPlacement, layout = props.layout, style = props.style, value = props.value, valid = props.valid, _a = props.item, Item = _a === void 0 ? defaultProps.item : _a, onChange = props.onChange, onFocus = props.onFocus;
|
|
21
35
|
var elementRef = React.useRef(null);
|
|
22
36
|
var focusElement = React.useCallback(function () {
|