@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
|
@@ -123,6 +123,16 @@ export interface RangeSliderChangeEvent {
|
|
|
123
123
|
syntheticEvent: React.SyntheticEvent<any> | DraggableDragEvent;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
* Represents the RangeSlider component.
|
|
126
|
+
* Represents the PropsContext of the `RangeSlider` component.
|
|
127
|
+
* Used for global configuration of all `RangeSlider` instances.
|
|
128
|
+
*
|
|
129
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
130
|
+
*/
|
|
131
|
+
export declare const RangeSliderPropsContext: React.Context<(p: RangeSliderProps) => RangeSliderProps>;
|
|
132
|
+
/**
|
|
133
|
+
* Represents the [KendoReact RangeSlider component]({% slug overview_rangeslider %}).
|
|
134
|
+
*
|
|
135
|
+
* Accepts properties of type [RangeSliderProps]({% slug api_inputs_rangesliderprops %}).
|
|
136
|
+
* Obtaining the `ref` returns an object of type [RangeSliderHandle]({% slug api_inputs_rangesliderhandle %}).
|
|
127
137
|
*/
|
|
128
138
|
export declare const RangeSlider: React.ForwardRefExoticComponent<RangeSliderProps & React.RefAttributes<RangeSliderHandle>>;
|
|
@@ -34,11 +34,22 @@ var useRange = function (defaultValue, args, callback) {
|
|
|
34
34
|
return [state, handleDispatchAction];
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* Represents the RangeSlider component.
|
|
37
|
+
* Represents the PropsContext of the `RangeSlider` component.
|
|
38
|
+
* Used for global configuration of all `RangeSlider` instances.
|
|
39
|
+
*
|
|
40
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
38
41
|
*/
|
|
39
|
-
exports.
|
|
42
|
+
exports.RangeSliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
43
|
+
/**
|
|
44
|
+
* Represents the [KendoReact RangeSlider component]({% slug overview_rangeslider %}).
|
|
45
|
+
*
|
|
46
|
+
* Accepts properties of type [RangeSliderProps]({% slug api_inputs_rangesliderprops %}).
|
|
47
|
+
* Obtaining the `ref` returns an object of type [RangeSliderHandle]({% slug api_inputs_rangesliderhandle %}).
|
|
48
|
+
*/
|
|
49
|
+
exports.RangeSlider = React.forwardRef(function (directProps, ref) {
|
|
40
50
|
var _a, _b, _c, _d;
|
|
41
51
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
52
|
+
var props = kendo_react_common_1.usePropsContext(exports.RangeSliderPropsContext, directProps);
|
|
42
53
|
var target = React.useRef(null);
|
|
43
54
|
var sliderRef = React.useRef(null);
|
|
44
55
|
var sliderSelectionRef = React.useRef(null);
|
|
@@ -143,6 +143,16 @@ export interface RatingChangeEvent {
|
|
|
143
143
|
syntheticEvent: React.SyntheticEvent<any>;
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
146
|
-
* Represents the Rating component.
|
|
146
|
+
* Represents the PropsContext of the `Rating` component.
|
|
147
|
+
* Used for global configuration of all `Rating` instances.
|
|
148
|
+
*
|
|
149
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
150
|
+
*/
|
|
151
|
+
export declare const RatingPropsContext: React.Context<(p: RatingProps) => RatingProps>;
|
|
152
|
+
/**
|
|
153
|
+
* Represents the [KendoReact Rating component]({% slug overview_rating %}).
|
|
154
|
+
*
|
|
155
|
+
* Accepts properties of type [RatingProps]({% slug api_inputs_ratingprops %}).
|
|
156
|
+
* Obtaining the `ref` returns an object of type [RatingHandle]({% slug api_inputs_ratinghandle %}).
|
|
147
157
|
*/
|
|
148
158
|
export declare const Rating: React.ForwardRefExoticComponent<RatingProps & React.RefAttributes<RatingHandle>>;
|
|
@@ -32,10 +32,21 @@ var useRating = function (defaultValue, args, callback) {
|
|
|
32
32
|
return [state, handleDispatchAction];
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* Represents the Rating component.
|
|
35
|
+
* Represents the PropsContext of the `Rating` component.
|
|
36
|
+
* Used for global configuration of all `Rating` instances.
|
|
37
|
+
*
|
|
38
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
36
39
|
*/
|
|
37
|
-
exports.
|
|
40
|
+
exports.RatingPropsContext = kendo_react_common_1.createPropsContext();
|
|
41
|
+
/**
|
|
42
|
+
* Represents the [KendoReact Rating component]({% slug overview_rating %}).
|
|
43
|
+
*
|
|
44
|
+
* Accepts properties of type [RatingProps]({% slug api_inputs_ratingprops %}).
|
|
45
|
+
* Obtaining the `ref` returns an object of type [RatingHandle]({% slug api_inputs_ratinghandle %}).
|
|
46
|
+
*/
|
|
47
|
+
exports.Rating = React.forwardRef(function (directProps, ref) {
|
|
38
48
|
var _a, _b, _c, _d;
|
|
49
|
+
var props = kendo_react_common_1.usePropsContext(exports.RatingPropsContext, directProps);
|
|
39
50
|
var target = React.useRef(null);
|
|
40
51
|
var ratingRef = React.useRef(null);
|
|
41
52
|
var dir = kendo_react_common_1.useDir(ratingRef, props.dir);
|
|
@@ -100,10 +100,9 @@ interface SliderState {
|
|
|
100
100
|
focused: boolean;
|
|
101
101
|
dir?: Direction;
|
|
102
102
|
}
|
|
103
|
-
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
export declare class Slider extends React.Component<SliderProps, SliderState> {
|
|
103
|
+
/** @hidden */
|
|
104
|
+
export declare class SliderWithoutContext extends React.Component<SliderProps, SliderState> {
|
|
105
|
+
static displayName: string;
|
|
107
106
|
/**
|
|
108
107
|
* @hidden
|
|
109
108
|
*/
|
|
@@ -164,4 +163,25 @@ export declare class Slider extends React.Component<SliderProps, SliderState> {
|
|
|
164
163
|
private drag;
|
|
165
164
|
private change;
|
|
166
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Represents the PropsContext of the `Slider` component.
|
|
168
|
+
* Used for global configuration of all `Slider` instances.
|
|
169
|
+
*
|
|
170
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
171
|
+
*/
|
|
172
|
+
export declare const SliderPropsContext: React.Context<(p: SliderProps) => SliderProps>;
|
|
173
|
+
/**
|
|
174
|
+
* Represent the `ref` of the Slider component.
|
|
175
|
+
*/
|
|
176
|
+
export interface SliderHandle extends Pick<SliderWithoutContext, keyof SliderWithoutContext> {
|
|
177
|
+
}
|
|
178
|
+
/** @hidden */
|
|
179
|
+
export declare type Slider = SliderHandle;
|
|
180
|
+
/**
|
|
181
|
+
* Represents the [KendoReact Slider component]({% slug overview_slider %}).
|
|
182
|
+
*
|
|
183
|
+
* Accepts properties of type [SliderProps]({% slug api_inputs_sliderprops %}).
|
|
184
|
+
* Obtaining the `ref` returns an object of type [SliderHandle]({% slug api_inputs_sliderhandle %}).
|
|
185
|
+
*/
|
|
186
|
+
export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<any>>;
|
|
167
187
|
export {};
|
|
@@ -32,12 +32,10 @@ var messages_1 = require("./../messages");
|
|
|
32
32
|
var SliderLabel_1 = require("./SliderLabel");
|
|
33
33
|
var kendo_react_common_2 = require("@progress/kendo-react-common");
|
|
34
34
|
var package_metadata_1 = require("../package-metadata");
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
__extends(Slider, _super);
|
|
40
|
-
function Slider(props) {
|
|
35
|
+
/** @hidden */
|
|
36
|
+
var SliderWithoutContext = /** @class */ (function (_super) {
|
|
37
|
+
__extends(SliderWithoutContext, _super);
|
|
38
|
+
function SliderWithoutContext(props) {
|
|
41
39
|
var _this = _super.call(this, props) || this;
|
|
42
40
|
/**
|
|
43
41
|
* @hidden
|
|
@@ -147,7 +145,7 @@ var Slider = /** @class */ (function (_super) {
|
|
|
147
145
|
/**
|
|
148
146
|
* @hidden
|
|
149
147
|
*/
|
|
150
|
-
|
|
148
|
+
SliderWithoutContext.getDerivedStateFromProps = function (props, state) {
|
|
151
149
|
var value = props.value !== undefined ? props.value : state.value;
|
|
152
150
|
var min = props.min, max = props.max;
|
|
153
151
|
return value === undefined ? null :
|
|
@@ -156,7 +154,7 @@ var Slider = /** @class */ (function (_super) {
|
|
|
156
154
|
/**
|
|
157
155
|
* @hidden
|
|
158
156
|
*/
|
|
159
|
-
|
|
157
|
+
SliderWithoutContext.prototype.componentDidMount = function () {
|
|
160
158
|
if (!this.state.dir && window && this._element) {
|
|
161
159
|
// Note: getComputedStyle forces reflow
|
|
162
160
|
var direction = window.getComputedStyle(this._element).direction;
|
|
@@ -168,7 +166,7 @@ var Slider = /** @class */ (function (_super) {
|
|
|
168
166
|
/**
|
|
169
167
|
* @hidden
|
|
170
168
|
*/
|
|
171
|
-
|
|
169
|
+
SliderWithoutContext.prototype.render = function () {
|
|
172
170
|
var _this = this;
|
|
173
171
|
var _a, _b;
|
|
174
172
|
var lS = kendo_react_intl_1.provideLocalizationService(this);
|
|
@@ -215,7 +213,7 @@ var Slider = /** @class */ (function (_super) {
|
|
|
215
213
|
_b.zIndex = 1,
|
|
216
214
|
_b) }))))))));
|
|
217
215
|
};
|
|
218
|
-
Object.defineProperty(
|
|
216
|
+
Object.defineProperty(SliderWithoutContext.prototype, "sliderTrack", {
|
|
219
217
|
/**
|
|
220
218
|
* @hidden
|
|
221
219
|
*/
|
|
@@ -225,15 +223,16 @@ var Slider = /** @class */ (function (_super) {
|
|
|
225
223
|
enumerable: true,
|
|
226
224
|
configurable: true
|
|
227
225
|
});
|
|
228
|
-
|
|
226
|
+
SliderWithoutContext.prototype.change = function (e, value) {
|
|
229
227
|
value = Math.min(Math.max(value, this.props.min), this.props.max);
|
|
230
228
|
this.setState({ value: value });
|
|
231
229
|
kendo_react_common_1.dispatchEvent(this.props.onChange, e, this, { value: value });
|
|
232
230
|
};
|
|
231
|
+
SliderWithoutContext.displayName = 'Slider';
|
|
233
232
|
/**
|
|
234
233
|
* @hidden
|
|
235
234
|
*/
|
|
236
|
-
|
|
235
|
+
SliderWithoutContext.propTypes = {
|
|
237
236
|
min: PropTypes.number.isRequired,
|
|
238
237
|
max: PropTypes.number.isRequired,
|
|
239
238
|
value: PropTypes.number,
|
|
@@ -243,7 +242,23 @@ var Slider = /** @class */ (function (_super) {
|
|
|
243
242
|
ariaDescribedBy: PropTypes.string
|
|
244
243
|
// TODO: validation when buttons is set to true, but no step is provided
|
|
245
244
|
};
|
|
246
|
-
return
|
|
245
|
+
return SliderWithoutContext;
|
|
247
246
|
}(React.Component));
|
|
248
|
-
exports.
|
|
249
|
-
|
|
247
|
+
exports.SliderWithoutContext = SliderWithoutContext;
|
|
248
|
+
/**
|
|
249
|
+
* Represents the PropsContext of the `Slider` component.
|
|
250
|
+
* Used for global configuration of all `Slider` instances.
|
|
251
|
+
*
|
|
252
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
253
|
+
*/
|
|
254
|
+
exports.SliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
255
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
256
|
+
/**
|
|
257
|
+
* Represents the [KendoReact Slider component]({% slug overview_slider %}).
|
|
258
|
+
*
|
|
259
|
+
* Accepts properties of type [SliderProps]({% slug api_inputs_sliderprops %}).
|
|
260
|
+
* Obtaining the `ref` returns an object of type [SliderHandle]({% slug api_inputs_sliderhandle %}).
|
|
261
|
+
*/
|
|
262
|
+
exports.Slider = kendo_react_common_1.withPropsContext(exports.SliderPropsContext, SliderWithoutContext);
|
|
263
|
+
exports.Slider.displayName = 'KendoReactSlider';
|
|
264
|
+
kendo_react_intl_1.registerForLocalization(SliderWithoutContext);
|
|
@@ -93,10 +93,9 @@ export interface SwitchState {
|
|
|
93
93
|
checked: boolean;
|
|
94
94
|
focused: boolean;
|
|
95
95
|
}
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
export declare class Switch extends React.Component<SwitchProps, SwitchState> implements FormComponent {
|
|
96
|
+
/** @hidden */
|
|
97
|
+
export declare class SwitchWithoutContext extends React.Component<SwitchProps, SwitchState> implements FormComponent {
|
|
98
|
+
static displayName: string;
|
|
100
99
|
/**
|
|
101
100
|
* Gets the value of the Switch.
|
|
102
101
|
*/
|
|
@@ -203,3 +202,40 @@ export declare class Switch extends React.Component<SwitchProps, SwitchState> im
|
|
|
203
202
|
private handleWrapperFocus;
|
|
204
203
|
private handleWrapperBlur;
|
|
205
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Represents the PropsContext of the `Switch` component.
|
|
207
|
+
* Used for global configuration of all `Switch` instances.
|
|
208
|
+
*
|
|
209
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
210
|
+
*/
|
|
211
|
+
export declare const SwitchPropsContext: React.Context<(p: SwitchProps) => SwitchProps>;
|
|
212
|
+
/**
|
|
213
|
+
* Represent the `ref` of the Switch component.
|
|
214
|
+
*/
|
|
215
|
+
export interface SwitchHandle extends Pick<SwitchWithoutContext, keyof SwitchWithoutContext> {
|
|
216
|
+
/**
|
|
217
|
+
* Returns the HTML element of the Switch component.
|
|
218
|
+
*/
|
|
219
|
+
element: HTMLSpanElement | null;
|
|
220
|
+
/**
|
|
221
|
+
* Gets the `name` property of the Switch.
|
|
222
|
+
*/
|
|
223
|
+
name: string | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* Represents the validity state into which the Switch is set.
|
|
226
|
+
*/
|
|
227
|
+
validity: FormComponentValidity;
|
|
228
|
+
/**
|
|
229
|
+
* Gets the value of the Switch.
|
|
230
|
+
*/
|
|
231
|
+
value: boolean;
|
|
232
|
+
}
|
|
233
|
+
/** @hidden */
|
|
234
|
+
export declare type Switch = SwitchHandle;
|
|
235
|
+
/**
|
|
236
|
+
* Represents the [KendoReact Switch component]({% slug overview_switch %}).
|
|
237
|
+
*
|
|
238
|
+
* Accepts properties of type [SwitchProps]({% slug api_inputs_switchprops %}).
|
|
239
|
+
* Obtaining the `ref` returns an object of type [SwitchHandle]({% slug api_inputs_switchhandle %}).
|
|
240
|
+
*/
|
|
241
|
+
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<any>>;
|
|
@@ -35,15 +35,13 @@ var SWITCH_CONTAINER = 'k-switch-container';
|
|
|
35
35
|
var SWITCH_HANDLE = 'k-switch-handle';
|
|
36
36
|
var SWITCH_LABEL_ON = 'k-switch-label-on';
|
|
37
37
|
var SWITCH_LABEL_OFF = 'k-switch-label-off';
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var Switch = /** @class */ (function (_super) {
|
|
42
|
-
__extends(Switch, _super);
|
|
38
|
+
/** @hidden */
|
|
39
|
+
var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
40
|
+
__extends(SwitchWithoutContext, _super);
|
|
43
41
|
/**
|
|
44
42
|
* @hidden
|
|
45
43
|
*/
|
|
46
|
-
function
|
|
44
|
+
function SwitchWithoutContext(props) {
|
|
47
45
|
var _this = _super.call(this, props) || this;
|
|
48
46
|
/**
|
|
49
47
|
* @hidden
|
|
@@ -128,12 +126,12 @@ var Switch = /** @class */ (function (_super) {
|
|
|
128
126
|
};
|
|
129
127
|
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
130
128
|
_this.state = {
|
|
131
|
-
checked: props.defaultChecked ||
|
|
129
|
+
checked: props.defaultChecked || SwitchWithoutContext.defaultProps.defaultChecked,
|
|
132
130
|
focused: false
|
|
133
131
|
};
|
|
134
132
|
return _this;
|
|
135
133
|
}
|
|
136
|
-
Object.defineProperty(
|
|
134
|
+
Object.defineProperty(SwitchWithoutContext.prototype, "value", {
|
|
137
135
|
/**
|
|
138
136
|
* Gets the value of the Switch.
|
|
139
137
|
*/
|
|
@@ -147,14 +145,14 @@ var Switch = /** @class */ (function (_super) {
|
|
|
147
145
|
enumerable: true,
|
|
148
146
|
configurable: true
|
|
149
147
|
});
|
|
150
|
-
Object.defineProperty(
|
|
148
|
+
Object.defineProperty(SwitchWithoutContext.prototype, "element", {
|
|
151
149
|
get: function () {
|
|
152
150
|
return this._element;
|
|
153
151
|
},
|
|
154
152
|
enumerable: true,
|
|
155
153
|
configurable: true
|
|
156
154
|
});
|
|
157
|
-
Object.defineProperty(
|
|
155
|
+
Object.defineProperty(SwitchWithoutContext.prototype, "actionElement", {
|
|
158
156
|
/**
|
|
159
157
|
* @hidden
|
|
160
158
|
*/
|
|
@@ -164,7 +162,7 @@ var Switch = /** @class */ (function (_super) {
|
|
|
164
162
|
enumerable: true,
|
|
165
163
|
configurable: true
|
|
166
164
|
});
|
|
167
|
-
Object.defineProperty(
|
|
165
|
+
Object.defineProperty(SwitchWithoutContext.prototype, "name", {
|
|
168
166
|
/**
|
|
169
167
|
* Gets the `name` property of the Switch.
|
|
170
168
|
*/
|
|
@@ -174,7 +172,7 @@ var Switch = /** @class */ (function (_super) {
|
|
|
174
172
|
enumerable: true,
|
|
175
173
|
configurable: true
|
|
176
174
|
});
|
|
177
|
-
Object.defineProperty(
|
|
175
|
+
Object.defineProperty(SwitchWithoutContext.prototype, "validity", {
|
|
178
176
|
/**
|
|
179
177
|
* Represents the validity state into which the Switch is set.
|
|
180
178
|
*/
|
|
@@ -195,26 +193,26 @@ var Switch = /** @class */ (function (_super) {
|
|
|
195
193
|
enumerable: true,
|
|
196
194
|
configurable: true
|
|
197
195
|
});
|
|
198
|
-
Object.defineProperty(
|
|
196
|
+
Object.defineProperty(SwitchWithoutContext.prototype, "validityStyles", {
|
|
199
197
|
/**
|
|
200
198
|
* @hidden
|
|
201
199
|
*/
|
|
202
200
|
get: function () {
|
|
203
201
|
return this.props.validityStyles !== undefined
|
|
204
202
|
? this.props.validityStyles
|
|
205
|
-
:
|
|
203
|
+
: SwitchWithoutContext.defaultProps.validityStyles;
|
|
206
204
|
},
|
|
207
205
|
enumerable: true,
|
|
208
206
|
configurable: true
|
|
209
207
|
});
|
|
210
|
-
Object.defineProperty(
|
|
208
|
+
Object.defineProperty(SwitchWithoutContext.prototype, "required", {
|
|
211
209
|
/**
|
|
212
210
|
* @hidden
|
|
213
211
|
*/
|
|
214
212
|
get: function () {
|
|
215
213
|
return this.props.required !== undefined
|
|
216
214
|
? this.props.required
|
|
217
|
-
:
|
|
215
|
+
: SwitchWithoutContext.defaultProps.required;
|
|
218
216
|
},
|
|
219
217
|
enumerable: true,
|
|
220
218
|
configurable: true
|
|
@@ -222,7 +220,7 @@ var Switch = /** @class */ (function (_super) {
|
|
|
222
220
|
/**
|
|
223
221
|
* @hidden
|
|
224
222
|
*/
|
|
225
|
-
|
|
223
|
+
SwitchWithoutContext.prototype.componentDidMount = function () {
|
|
226
224
|
this.setValidity();
|
|
227
225
|
// Due to dynamic dir calculation
|
|
228
226
|
this.forceUpdate();
|
|
@@ -230,13 +228,13 @@ var Switch = /** @class */ (function (_super) {
|
|
|
230
228
|
/**
|
|
231
229
|
* @hidden
|
|
232
230
|
*/
|
|
233
|
-
|
|
231
|
+
SwitchWithoutContext.prototype.componentDidUpdate = function () {
|
|
234
232
|
this.setValidity();
|
|
235
233
|
};
|
|
236
234
|
/**
|
|
237
235
|
* @hidden
|
|
238
236
|
*/
|
|
239
|
-
|
|
237
|
+
SwitchWithoutContext.prototype.render = function () {
|
|
240
238
|
var _this = this;
|
|
241
239
|
var focused = this.state.focused;
|
|
242
240
|
var _a = this.props, dir = _a.dir, disabled = _a.disabled, id = _a.id, offLabel = _a.offLabel, onLabel = _a.onLabel, tabIndex = _a.tabIndex;
|
|
@@ -266,10 +264,11 @@ var Switch = /** @class */ (function (_super) {
|
|
|
266
264
|
React.createElement("span", { className: SWITCH_LABEL_OFF }, offLabel),
|
|
267
265
|
React.createElement("span", { className: SWITCH_HANDLE }))));
|
|
268
266
|
};
|
|
267
|
+
SwitchWithoutContext.displayName = 'Switch';
|
|
269
268
|
/**
|
|
270
269
|
* @hidden
|
|
271
270
|
*/
|
|
272
|
-
|
|
271
|
+
SwitchWithoutContext.propTypes = {
|
|
273
272
|
accessKey: PropTypes.string,
|
|
274
273
|
checked: PropTypes.bool,
|
|
275
274
|
className: PropTypes.string,
|
|
@@ -293,7 +292,7 @@ var Switch = /** @class */ (function (_super) {
|
|
|
293
292
|
/**
|
|
294
293
|
* @hidden
|
|
295
294
|
*/
|
|
296
|
-
|
|
295
|
+
SwitchWithoutContext.defaultProps = {
|
|
297
296
|
disabled: false,
|
|
298
297
|
defaultChecked: false,
|
|
299
298
|
offLabel: 'OFF',
|
|
@@ -303,6 +302,22 @@ var Switch = /** @class */ (function (_super) {
|
|
|
303
302
|
required: false,
|
|
304
303
|
validityStyles: true
|
|
305
304
|
};
|
|
306
|
-
return
|
|
305
|
+
return SwitchWithoutContext;
|
|
307
306
|
}(React.Component));
|
|
308
|
-
exports.
|
|
307
|
+
exports.SwitchWithoutContext = SwitchWithoutContext;
|
|
308
|
+
/**
|
|
309
|
+
* Represents the PropsContext of the `Switch` component.
|
|
310
|
+
* Used for global configuration of all `Switch` instances.
|
|
311
|
+
*
|
|
312
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
313
|
+
*/
|
|
314
|
+
exports.SwitchPropsContext = kendo_react_common_1.createPropsContext();
|
|
315
|
+
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
316
|
+
/**
|
|
317
|
+
* Represents the [KendoReact Switch component]({% slug overview_switch %}).
|
|
318
|
+
*
|
|
319
|
+
* Accepts properties of type [SwitchProps]({% slug api_inputs_switchprops %}).
|
|
320
|
+
* Obtaining the `ref` returns an object of type [SwitchHandle]({% slug api_inputs_switchhandle %}).
|
|
321
|
+
*/
|
|
322
|
+
exports.Switch = kendo_react_common_1.withPropsContext(exports.SwitchPropsContext, SwitchWithoutContext);
|
|
323
|
+
exports.Switch.displayName = 'KendoReactSwitch';
|
|
@@ -8,9 +8,20 @@ export interface TextAreaHandle {
|
|
|
8
8
|
focus: any;
|
|
9
9
|
name?: string | null;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Represents the PropsContext of the `TextArea` component.
|
|
13
|
+
* Used for global configuration of all `TextArea` instances.
|
|
14
|
+
*
|
|
15
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TextAreaPropsContext: React.Context<(p: TextAreaProps) => TextAreaProps>;
|
|
11
18
|
/**
|
|
12
19
|
* Represents the [KendoReact TextArea component]({% slug overview_textarea %}).
|
|
13
20
|
*
|
|
21
|
+
*
|
|
22
|
+
* Accepts properties of type [TextAreaProps]({% slug api_inputs_textareaprops %}).
|
|
23
|
+
* Obtaining the `ref` returns an object of type [TextAreaHandle]({% slug api_inputs_textareahandle %}).
|
|
24
|
+
*
|
|
14
25
|
* @example
|
|
15
26
|
* ```jsx
|
|
16
27
|
* class App extends React.Component {
|
|
@@ -23,9 +23,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
var React = require("react");
|
|
24
24
|
var PropTypes = require("prop-types");
|
|
25
25
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
26
|
+
/**
|
|
27
|
+
* Represents the PropsContext of the `TextArea` component.
|
|
28
|
+
* Used for global configuration of all `TextArea` instances.
|
|
29
|
+
*
|
|
30
|
+
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
31
|
+
*/
|
|
32
|
+
exports.TextAreaPropsContext = kendo_react_common_1.createPropsContext();
|
|
26
33
|
/**
|
|
27
34
|
* Represents the [KendoReact TextArea component]({% slug overview_textarea %}).
|
|
28
35
|
*
|
|
36
|
+
*
|
|
37
|
+
* Accepts properties of type [TextAreaProps]({% slug api_inputs_textareaprops %}).
|
|
38
|
+
* Obtaining the `ref` returns an object of type [TextAreaHandle]({% slug api_inputs_textareahandle %}).
|
|
39
|
+
*
|
|
29
40
|
* @example
|
|
30
41
|
* ```jsx
|
|
31
42
|
* class App extends React.Component {
|
|
@@ -36,7 +47,8 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
36
47
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
37
48
|
* ```
|
|
38
49
|
*/
|
|
39
|
-
exports.TextArea = React.forwardRef(function (
|
|
50
|
+
exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
51
|
+
var props = kendo_react_common_1.usePropsContext(exports.TextAreaPropsContext, directProps);
|
|
40
52
|
var _a = props, ariaDescribedBy = _a.ariaDescribedBy, ariaLabelledBy = _a.ariaLabelledBy, autoSize = _a.autoSize, className = _a.className, defaultValue = _a.defaultValue, disabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, rows = _a.rows, id = _a.id, name = _a.name, placeholder = _a.placeholder, style = _a.style, tabIndex = _a.tabIndex, value = _a.value, valid = _a.valid, validationMessage = _a.validationMessage, validityStyles = _a.validityStyles, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur,
|
|
41
53
|
// Removed to support direct use in Form Field component
|
|
42
54
|
visited = _a.visited, touched = _a.touched, modified = _a.modified, others = __rest(_a, ["ariaDescribedBy", "ariaLabelledBy", "autoSize", "className", "defaultValue", "disabled", "readOnly", "required", "rows", "id", "name", "placeholder", "style", "tabIndex", "value", "valid", "validationMessage", "validityStyles", "onChange", "onFocus", "onBlur", "visited", "touched", "modified"]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Polyfill for PropTypes.null
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
function nullable(subRequirement) {
|
|
8
|
+
var check = function (required, props, key) {
|
|
9
|
+
var rest = [];
|
|
10
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
11
|
+
rest[_i - 3] = arguments[_i];
|
|
12
|
+
}
|
|
13
|
+
if (props[key] === null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
var sub = required ? subRequirement.isRequired : subRequirement;
|
|
17
|
+
return sub.apply(void 0, [props, key].concat(rest));
|
|
18
|
+
};
|
|
19
|
+
var fn = check.bind(null, false);
|
|
20
|
+
fn.isRequired = check.bind(null, true);
|
|
21
|
+
return fn;
|
|
22
|
+
}
|
|
23
|
+
exports.nullable = nullable;
|