@progress/kendo-react-inputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823

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.
Files changed (105) hide show
  1. package/dist/cdn/js/kendo-react-inputs.js +1 -1
  2. package/dist/es/checkbox/Checkbox.d.ts +1 -1
  3. package/dist/es/checkbox/Checkbox.js +2 -2
  4. package/dist/es/colors/ColorContrastLabels.js +3 -3
  5. package/dist/es/colors/ColorGradient.d.ts +1 -1
  6. package/dist/es/colors/ColorGradient.js +7 -3
  7. package/dist/es/colors/ColorPalette.d.ts +4 -1
  8. package/dist/es/colors/ColorPalette.js +10 -3
  9. package/dist/es/colors/ColorPicker.d.ts +1 -1
  10. package/dist/es/colors/ColorPicker.js +4 -4
  11. package/dist/es/colors/FlatColorPicker.d.ts +1 -1
  12. package/dist/es/colors/FlatColorPicker.js +25 -24
  13. package/dist/es/colors/HexInput.d.ts +1 -1
  14. package/dist/es/colors/utils/color-parser.js +2 -2
  15. package/dist/es/colors/utils/svg-calc.js +4 -4
  16. package/dist/es/common/SliderTooltip.js +3 -3
  17. package/dist/es/common/SwitchController.js +5 -1
  18. package/dist/es/common/SwitchModel.d.ts +1 -1
  19. package/dist/es/input/Input.js +2 -1
  20. package/dist/es/maskedtextbox/MaskedTextBox.d.ts +7 -7
  21. package/dist/es/maskedtextbox/MaskedTextBox.js +7 -6
  22. package/dist/es/maskedtextbox/parsing/parsers.d.ts +2 -2
  23. package/dist/es/maskedtextbox/parsing/parsers.js +28 -32
  24. package/dist/es/maskedtextbox/parsing/result.js +1 -1
  25. package/dist/es/numerictextbox/NumericTextBox.d.ts +1 -1
  26. package/dist/es/numerictextbox/NumericTextBox.js +3 -3
  27. package/dist/es/numerictextbox/utils/index.d.ts +1 -1
  28. package/dist/es/numerictextbox/utils/index.js +5 -5
  29. package/dist/es/package-metadata.js +1 -1
  30. package/dist/es/radiobutton/RadioButton.d.ts +1 -1
  31. package/dist/es/radiobutton/RadioButton.js +1 -1
  32. package/dist/es/radiobutton/RadioGroup.d.ts +1 -1
  33. package/dist/es/range-slider/RangeSlider.d.ts +1 -1
  34. package/dist/es/range-slider/RangeSlider.js +7 -7
  35. package/dist/es/rating/Rating.d.ts +1 -1
  36. package/dist/es/rating/Rating.js +15 -12
  37. package/dist/es/rating/RatingItem.d.ts +1 -1
  38. package/dist/es/rating/models/index.d.ts +4 -0
  39. package/dist/es/slider/Slider.d.ts +2 -2
  40. package/dist/es/slider/Slider.js +2 -0
  41. package/dist/es/slider/SliderLabel.js +2 -2
  42. package/dist/es/switch/Switch.d.ts +6 -6
  43. package/dist/es/switch/Switch.js +7 -4
  44. package/dist/es/textarea/TextArea.d.ts +1 -1
  45. package/dist/es/textarea/TextArea.js +4 -4
  46. package/dist/es/utils.js +9 -5
  47. package/dist/npm/checkbox/Checkbox.d.ts +1 -1
  48. package/dist/npm/checkbox/Checkbox.js +14 -14
  49. package/dist/npm/colors/ColorContrastLabels.js +6 -6
  50. package/dist/npm/colors/ColorContrastSvg.js +6 -6
  51. package/dist/npm/colors/ColorGradient.d.ts +1 -1
  52. package/dist/npm/colors/ColorGradient.js +37 -33
  53. package/dist/npm/colors/ColorInput.js +3 -3
  54. package/dist/npm/colors/ColorPalette.d.ts +4 -1
  55. package/dist/npm/colors/ColorPalette.js +19 -12
  56. package/dist/npm/colors/ColorPicker.d.ts +1 -1
  57. package/dist/npm/colors/ColorPicker.js +13 -13
  58. package/dist/npm/colors/FlatColorPicker.d.ts +1 -1
  59. package/dist/npm/colors/FlatColorPicker.js +27 -26
  60. package/dist/npm/colors/HexInput.d.ts +1 -1
  61. package/dist/npm/colors/HexInput.js +3 -3
  62. package/dist/npm/colors/Picker.js +1 -1
  63. package/dist/npm/colors/utils/color-palette.service.js +6 -6
  64. package/dist/npm/colors/utils/color-parser.js +26 -26
  65. package/dist/npm/colors/utils/misc.js +1 -1
  66. package/dist/npm/colors/utils/svg-calc.js +4 -4
  67. package/dist/npm/common/SliderTooltip.js +4 -4
  68. package/dist/npm/common/SwitchController.js +5 -1
  69. package/dist/npm/common/SwitchModel.d.ts +1 -1
  70. package/dist/npm/input/Input.js +7 -6
  71. package/dist/npm/main.js +5 -1
  72. package/dist/npm/maskedtextbox/MaskedTextBox.d.ts +7 -7
  73. package/dist/npm/maskedtextbox/MaskedTextBox.js +13 -12
  74. package/dist/npm/maskedtextbox/masking.service.js +19 -19
  75. package/dist/npm/maskedtextbox/parsing/parsers.d.ts +2 -2
  76. package/dist/npm/maskedtextbox/parsing/parsers.js +28 -32
  77. package/dist/npm/maskedtextbox/parsing/result.js +1 -1
  78. package/dist/npm/numerictextbox/NumericTextBox.d.ts +1 -1
  79. package/dist/npm/numerictextbox/NumericTextBox.js +31 -31
  80. package/dist/npm/numerictextbox/utils/index.d.ts +1 -1
  81. package/dist/npm/numerictextbox/utils/index.js +61 -61
  82. package/dist/npm/package-metadata.js +1 -1
  83. package/dist/npm/radiobutton/RadioButton.d.ts +1 -1
  84. package/dist/npm/radiobutton/RadioButton.js +10 -10
  85. package/dist/npm/radiobutton/RadioGroup.d.ts +1 -1
  86. package/dist/npm/radiobutton/RadioGroup.js +10 -10
  87. package/dist/npm/range-slider/RangeSlider.d.ts +1 -1
  88. package/dist/npm/range-slider/RangeSlider.js +17 -17
  89. package/dist/npm/rating/Rating.d.ts +1 -1
  90. package/dist/npm/rating/Rating.js +36 -33
  91. package/dist/npm/rating/RatingItem.d.ts +1 -1
  92. package/dist/npm/rating/RatingItem.js +2 -2
  93. package/dist/npm/rating/models/index.d.ts +4 -0
  94. package/dist/npm/rating/rating-reducer.js +4 -4
  95. package/dist/npm/rating/utils/index.js +5 -5
  96. package/dist/npm/slider/Slider.d.ts +2 -2
  97. package/dist/npm/slider/Slider.js +9 -7
  98. package/dist/npm/slider/SliderLabel.js +3 -3
  99. package/dist/npm/switch/Switch.d.ts +6 -6
  100. package/dist/npm/switch/Switch.js +17 -14
  101. package/dist/npm/textarea/TextArea.d.ts +1 -1
  102. package/dist/npm/textarea/TextArea.js +13 -13
  103. package/dist/npm/utils.js +9 -5
  104. package/dist/systemjs/kendo-react-inputs.js +1 -1
  105. package/package.json +15 -15
@@ -20,4 +20,4 @@ export declare const RadioButtonPropsContext: React.Context<(p: RadioButtonProps
20
20
  * Accepts properties of type [RadioButtonProps]({% slug api_inputs_radiobuttonprops %}).
21
21
  * Obtaining the `ref` returns an object of type [RadioButtonHandle]({% slug api_inputs_radiobuttonhandle %}).
22
22
  */
23
- export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<RadioButtonHandle>>;
23
+ export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<RadioButtonHandle | null>>;
@@ -69,7 +69,7 @@ export var RadioButton = React.forwardRef(function (directProps, target) {
69
69
  }
70
70
  }, [onBlur, disabled]);
71
71
  var inputProps = __assign({ type: 'radio', id: id || calculatedId, name: name, className: classNames('k-radio', (_a = {},
72
- _a["k-radio-" + (kendoThemeMaps.sizeMap[size] || size)] = size,
72
+ _a["k-radio-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
73
73
  _a['k-invalid'] = valid === false,
74
74
  _a), className), ref: elementRef, disabled: disabled, tabIndex: getTabIndex(tabIndex, disabled), checked: checked, style: style, 'aria-describedby': ariaDescribedBy, value: value, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur }, others);
75
75
  var radioButtonLabel = (React.createElement(React.Fragment, null, label !== undefined ? (React.createElement("label", { className: 'k-radio-label', htmlFor: id || calculatedId, style: { userSelect: 'none' }, "aria-label": label }, label)) : null));
@@ -20,4 +20,4 @@ export declare const RadioGroupPropsContext: React.Context<(p: RadioGroupProps)
20
20
  * Accepts properties of type [RadioGroupProps]({% slug api_inputs_radiogroupprops %}).
21
21
  * Obtaining the `ref` returns an object of type [RadioGroupHandle]({% slug api_inputs_radiogrouphandle %}).
22
22
  */
23
- export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<RadioGroupHandle>>;
23
+ export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<RadioGroupHandle | null>>;
@@ -135,4 +135,4 @@ export declare const RangeSliderPropsContext: React.Context<(p: RangeSliderProps
135
135
  * Accepts properties of type [RangeSliderProps]({% slug api_inputs_rangesliderprops %}).
136
136
  * Obtaining the `ref` returns an object of type [RangeSliderHandle]({% slug api_inputs_rangesliderhandle %}).
137
137
  */
138
- export declare const RangeSlider: React.ForwardRefExoticComponent<RangeSliderProps & React.RefAttributes<RangeSliderHandle>>;
138
+ export declare const RangeSlider: React.ForwardRefExoticComponent<RangeSliderProps & React.RefAttributes<RangeSliderHandle | null>>;
@@ -229,7 +229,7 @@ export var RangeSlider = React.forwardRef(function (directProps, ref) {
229
229
  React.createElement("div", { ref: sliderTrackRef, className: "k-slider-track", style: props.vertical
230
230
  ? { bottom: 0, height: '100%' }
231
231
  : (_a = {}, _a[dir === 'rtl' ? 'right' : 'left'] = 0, _a.width = '100%', _a) },
232
- (percentStart !== null && percentEnd !== null) && React.createElement("div", { "data-selection": true, ref: sliderSelectionRef, title: value.start + " - " + value.end, className: "k-slider-selection", style: props.vertical
232
+ (percentStart !== null && percentEnd !== null) && React.createElement("div", { "data-selection": true, ref: sliderSelectionRef, title: "".concat(value.start, " - ").concat(value.end), className: "k-slider-selection", style: props.vertical
233
233
  ? { height: (percentEnd - percentStart) + '%', bottom: percentStart + '%' }
234
234
  : (_b = {},
235
235
  _b[dir === 'rtl' ? 'right' : 'left'] = percentStart + '%',
@@ -252,7 +252,7 @@ var propTypes = {
252
252
  var min = props.min;
253
253
  var max = props.max;
254
254
  if (start > end || start > max || start < min || end > max || end < min || end < start) {
255
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n The { start, end } value must be between the min & max value and { start, end } must be start < end.\n ");
255
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n The { start, end } value must be between the min & max value and { start, end } must be start < end.\n "));
256
256
  }
257
257
  }
258
258
  return null;
@@ -264,7 +264,7 @@ var propTypes = {
264
264
  var min = props.min;
265
265
  var max = props.max;
266
266
  if (start > end || start > max || start < min || end > max || end < min || end < start) {
267
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n The { start, end } value must be between the min & max value and { start, end } must be start < end.\n ");
267
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n The { start, end } value must be between the min & max value and { start, end } must be start < end.\n "));
268
268
  }
269
269
  }
270
270
  return null;
@@ -276,10 +276,10 @@ var propTypes = {
276
276
  var min = props.min;
277
277
  var max = props.max;
278
278
  if (min === undefined) {
279
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n " + propName + " value can not be undefined.\n ");
279
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n ").concat(propName, " value can not be undefined.\n "));
280
280
  }
281
281
  if (prop && min >= max) {
282
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n " + propName + " value can not be equal to or bigger than the max value.\n ");
282
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n ").concat(propName, " value can not be equal to or bigger than the max value.\n "));
283
283
  }
284
284
  return null;
285
285
  },
@@ -288,10 +288,10 @@ var propTypes = {
288
288
  var min = props.min;
289
289
  var max = props.max;
290
290
  if (max === undefined) {
291
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n " + propName + " value can not be undefined.\n ");
291
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n ").concat(propName, " value can not be undefined.\n "));
292
292
  }
293
293
  if (prop && max <= min) {
294
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n " + propName + " value can not be equal to or smaller than the min value.\n ");
294
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n ").concat(propName, " value can not be equal to or smaller than the min value.\n "));
295
295
  }
296
296
  return null;
297
297
  },
@@ -155,4 +155,4 @@ export declare const RatingPropsContext: React.Context<(p: RatingProps) => Ratin
155
155
  * Accepts properties of type [RatingProps]({% slug api_inputs_ratingprops %}).
156
156
  * Obtaining the `ref` returns an object of type [RatingHandle]({% slug api_inputs_ratinghandle %}).
157
157
  */
158
- export declare const Rating: React.ForwardRefExoticComponent<RatingProps & React.RefAttributes<RatingHandle>>;
158
+ export declare const Rating: React.ForwardRefExoticComponent<RatingProps & React.RefAttributes<RatingHandle | null>>;
@@ -100,11 +100,12 @@ export var Rating = React.forwardRef(function (directProps, ref) {
100
100
  dispatchStateValue({ type: RATING_ACTION.select, payload: event.target.value, event: event.syntheticEvent });
101
101
  }
102
102
  if (props.onClick) {
103
- props.onClick.call(undefined, {
103
+ var ev = {
104
104
  value: value,
105
105
  target: target.current,
106
106
  syntheticEvent: event.syntheticEvent
107
- });
107
+ };
108
+ props.onClick.call(undefined, ev);
108
109
  }
109
110
  }, [props.onClick, dispatchStateValue, value]);
110
111
  var handleKeyDown = React.useCallback(function (syntheticEvent) {
@@ -155,18 +156,20 @@ export var Rating = React.forwardRef(function (directProps, ref) {
155
156
  }, [props.onKeyDown, dispatchStateValue, value]);
156
157
  var handleFocus = React.useCallback(function (syntheticEvent) {
157
158
  if (props.onFocus) {
158
- props.onFocus.call(undefined, {
159
+ var ev = {
159
160
  target: target.current,
160
161
  syntheticEvent: syntheticEvent
161
- });
162
+ };
163
+ props.onFocus.call(undefined, ev);
162
164
  }
163
165
  }, [props.onFocus]);
164
166
  var handleBlur = React.useCallback(function (syntheticEvent) {
165
167
  if (props.onBlur) {
166
- props.onBlur.call(undefined, {
168
+ var ev = {
167
169
  target: target.current,
168
170
  syntheticEvent: syntheticEvent
169
- });
171
+ };
172
+ props.onBlur.call(undefined, ev);
170
173
  }
171
174
  }, [props.onBlur]);
172
175
  var handleItemMouseMove = React.useCallback(function (event) {
@@ -201,21 +204,21 @@ export var Rating = React.forwardRef(function (directProps, ref) {
201
204
  React.createElement("span", { className: classNames('k-icon', (_b = {
202
205
  'k-i-star-outline': !props.icon
203
206
  },
204
- _b[props.icon + "-outline"] = props.icon,
207
+ _b["".concat(props.icon, "-outline")] = props.icon,
205
208
  _b)) }))),
206
209
  half && (React.createElement("span", { className: 'k-rating-precision-part', style: { width: '12px' } },
207
210
  React.createElement("span", { className: classNames('k-icon', (_c = {
208
211
  'k-i-star': !props.icon
209
212
  },
210
- _c["" + props.icon] = props.icon,
213
+ _c["".concat(props.icon)] = props.icon,
211
214
  _c)) }))),
212
215
  half && (React.createElement("span", { style: { width: '24px', height: '24px', display: 'block' } })),
213
216
  !half && (React.createElement("span", { className: classNames('k-icon', (_d = {
214
217
  'k-i-star': !props.icon && (hovered || (selected && !hovered)),
215
218
  'k-i-star-outline': !props.icon && (!hovered)
216
219
  },
217
- _d["" + props.icon] = props.icon && (hovered || (selected && !hovered)),
218
- _d[props.icon + "-outline"] = props.icon && (!hovered),
220
+ _d["".concat(props.icon)] = props.icon && (hovered || (selected && !hovered)),
221
+ _d["".concat(props.icon, "-outline")] = props.icon && (!hovered),
219
222
  _d)) }))));
220
223
  }
221
224
  return (React.createElement("span", { id: props.id, style: props.style, ref: ratingRef, role: "slider", dir: dir, tabIndex: getTabIndex(props.tabIndex, props.disabled, undefined), className: classNames('k-rating k-widget', {
@@ -239,7 +242,7 @@ var propTypes = {
239
242
  ? isCorrectValue(props.min, props.max, props.step / 2, props.value)
240
243
  : isCorrectValue(props.min, props.max, props.step, props.value);
241
244
  if (!correctValue && props.precision === 'half') {
242
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n The value of the { value } property is not correct, please check your values.\n ");
245
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n The value of the { value } property is not correct, please check your values.\n "));
243
246
  }
244
247
  }
245
248
  return null;
@@ -249,7 +252,7 @@ var propTypes = {
249
252
  max: PropTypes.number,
250
253
  step: function (props, propName, componentName) {
251
254
  if (props.step !== undefined && props.step <= 0) {
252
- return new Error("Invalid prop + " + propName + " supplied to " + componentName + ".\n The value of the { step } property is cannot be equal or less than \"0\", please check your values.\n ");
255
+ return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n The value of the { step } property is cannot be equal or less than \"0\", please check your values.\n "));
253
256
  }
254
257
  return null;
255
258
  },
@@ -101,4 +101,4 @@ export interface RatingItemHandle {
101
101
  /**
102
102
  * Represents the RatingItem component.
103
103
  */
104
- export declare const RatingItem: React.ForwardRefExoticComponent<RatingItemProps & React.RefAttributes<RatingItemHandle>>;
104
+ export declare const RatingItem: React.ForwardRefExoticComponent<RatingItemProps & React.RefAttributes<RatingItemHandle | null>>;
@@ -13,6 +13,10 @@ export interface RatingItemMouseEvent {
13
13
  * The event of the RatingItemMouseEvent.
14
14
  */
15
15
  syntheticEvent: React.MouseEvent<any>;
16
+ /**
17
+ * @hidden
18
+ */
19
+ value?: number | null;
16
20
  }
17
21
  /**
18
22
  * Represents the return type of the RatingItemKeyboardEvent.
@@ -121,14 +121,14 @@ export declare class SliderWithoutContext extends React.Component<SliderProps, S
121
121
  */
122
122
  static getDerivedStateFromProps(props: SliderProps, state: SliderState): {
123
123
  value: number;
124
- };
124
+ } | null;
125
125
  /**
126
126
  * @hidden
127
127
  */
128
128
  state: {
129
129
  value: number;
130
130
  focused: boolean;
131
- dir: Direction;
131
+ dir: Direction | undefined;
132
132
  };
133
133
  private _sliderTrack;
134
134
  private _element;
@@ -46,6 +46,8 @@ var SliderWithoutContext = /** @class */ (function (_super) {
46
46
  focused: false,
47
47
  dir: _this.props.dir
48
48
  };
49
+ _this._sliderTrack = null;
50
+ _this._element = null;
49
51
  /**
50
52
  * @hidden
51
53
  */
@@ -23,8 +23,8 @@ export var SliderLabel = function (props) {
23
23
  var sliderLabelRef = React.useRef(null);
24
24
  var dir = useDir(sliderLabelRef);
25
25
  var style = props.vertical
26
- ? { bottom: props.position + "%", height: '1px', width: '100%' }
27
- : (_a = {}, _a[dir === 'rtl' ? 'right' : 'left'] = props.position + "%", _a.width = '1px', _a.height = '-webkit-fill-available', _a);
26
+ ? { bottom: "".concat(props.position, "%"), height: '1px', width: '100%' }
27
+ : (_a = {}, _a[dir === 'rtl' ? 'right' : 'left'] = "".concat(props.position, "%"), _a.width = '1px', _a.height = '-webkit-fill-available', _a);
28
28
  return (React.createElement("li", { ref: sliderLabelRef, role: "presentation", className: "k-tick k-tick-large", title: props.title, style: __assign({ zIndex: 1, position: 'absolute' }, style) },
29
29
  React.createElement("span", __assign({}, (_b = {}, _b[SLIDER_LABEL_ATTRIBUTE] = true, _b), { className: "k-label", onClick: props.onClick }), props.children)));
30
30
  };
@@ -174,9 +174,9 @@ export declare class SwitchWithoutContext extends React.Component<SwitchProps, S
174
174
  className: PropTypes.Requireable<string>;
175
175
  disabled: PropTypes.Requireable<boolean>;
176
176
  defaultChecked: PropTypes.Requireable<boolean>;
177
- size: PropTypes.Requireable<"small" | "medium" | "large">;
178
- trackRounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
179
- thumbRounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
177
+ size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
178
+ trackRounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
179
+ thumbRounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
180
180
  dir: PropTypes.Requireable<string>;
181
181
  id: PropTypes.Requireable<string>;
182
182
  ariaLabelledBy: PropTypes.Requireable<string>;
@@ -198,9 +198,9 @@ export declare class SwitchWithoutContext extends React.Component<SwitchProps, S
198
198
  static defaultProps: {
199
199
  disabled: boolean;
200
200
  defaultChecked: boolean;
201
- size: "small" | "medium" | "large";
202
- trackRounded: "small" | "medium" | "full" | "large";
203
- thumbRounded: "small" | "medium" | "full" | "large";
201
+ size: "small" | "medium" | "large" | null | undefined;
202
+ trackRounded: "small" | "medium" | "full" | "large" | null | undefined;
203
+ thumbRounded: "small" | "medium" | "full" | "large" | null | undefined;
204
204
  offLabel: string;
205
205
  onBlur: () => void;
206
206
  onFocus: () => void;
@@ -67,6 +67,9 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
67
67
  dispatchEvent(_this.props.onChange, event, _this, { value: value });
68
68
  _this.valueDuringOnChange = undefined;
69
69
  };
70
+ _this._element = null;
71
+ _this._wrapper = null;
72
+ _this._input = null;
70
73
  _this._id = guid();
71
74
  _this.defaultValidationMessage = provideLocalizationService(_this);
72
75
  /**
@@ -238,8 +241,8 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
238
241
  this.dir = dir || (this._wrapper && getComputedStyle(this._wrapper).direction) || undefined;
239
242
  var isValid = !this.validityStyles || this.validity.valid;
240
243
  var switchClassName = classNames('k-switch', (_a = {},
241
- _a["k-switch-" + (kendoThemeMaps.sizeMap[size] || size)] = size,
242
- _a["k-rounded-" + (kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
244
+ _a["k-switch-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
245
+ _a["k-rounded-".concat(kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
243
246
  _a['k-switch-on'] = this.value,
244
247
  _a['k-switch-off'] = !this.value,
245
248
  _a['k-focus'] = focused,
@@ -254,7 +257,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
254
257
  _this._wrapper = span;
255
258
  }, className: switchClassName, dir: this.dir, onKeyDown: this.handleKeyDown, onClick: this.handleClick, onBlur: this.handleWrapperBlur, onFocus: this.handleWrapperFocus },
256
259
  React.createElement("span", __assign({ className: classNames('k-switch-track', (_b = {},
257
- _b["k-rounded-" + (kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
260
+ _b["k-rounded-".concat(kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
258
261
  _b)), id: id || this._id, role: 'switch' }, ariaAttributes, { "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, ref: function (span) {
259
262
  _this._element = span;
260
263
  }, tabIndex: getTabIndex(tabIndex, disabled, undefined), accessKey: this.props.accessKey }),
@@ -263,7 +266,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
263
266
  React.createElement("span", { className: 'k-switch-label-off' }, offLabel),
264
267
  React.createElement("span", { className: 'k-switch-thumb-wrap' },
265
268
  React.createElement("span", { className: classNames('k-switch-thumb', (_c = {},
266
- _c["k-rounded-" + thumbRounded] = thumbRounded,
269
+ _c["k-rounded-".concat(thumbRounded)] = thumbRounded,
267
270
  _c)) })))));
268
271
  };
269
272
  SwitchWithoutContext.displayName = 'Switch';
@@ -32,4 +32,4 @@ export declare const TextAreaPropsContext: React.Context<(p: TextAreaProps) => T
32
32
  * ReactDOM.render(<App />, document.querySelector('my-app'));
33
33
  * ```
34
34
  */
35
- export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaHandle>>;
35
+ export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaHandle | null>>;
@@ -87,7 +87,7 @@ export var TextArea = React.forwardRef(function (directProps, target) {
87
87
  }, [isValid, validationMessage]);
88
88
  React.useLayoutEffect(function () {
89
89
  if (elementRef.current) {
90
- setTextAreaHeight(elementRef.current.scrollHeight + "px");
90
+ setTextAreaHeight("".concat(elementRef.current.scrollHeight, "px"));
91
91
  }
92
92
  }, [currentValue]);
93
93
  var handleChange = React.useCallback(function (event) {
@@ -112,9 +112,9 @@ export var TextArea = React.forwardRef(function (directProps, target) {
112
112
  }, [onBlur, disabled]);
113
113
  var textAreaProps = __assign(__assign({ id: id || calculatedId, name: name, className: 'k-input-inner !k-overflow-auto', ref: elementRef, disabled: disabled, rows: rows, placeholder: placeholder, readOnly: readOnly, required: required, tabIndex: getTabIndex(tabIndex, disabled), style: autoSize ? { resize: 'none', overflow: 'hidden', height: textAreaHeight } : {}, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-multiline': true, 'aria-disabled': disabled || undefined, value: isControlled ? value : stateValue }, others), { onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur });
114
114
  return (React.createElement("span", { className: classNames('k-input', 'k-textarea', (_a = {},
115
- _a["k-input-" + (kendoThemeMaps.sizeMap[size] || size)] = size,
116
- _a["k-input-" + fillMode] = fillMode,
117
- _a["k-rounded-" + (kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
115
+ _a["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
116
+ _a["k-input-".concat(fillMode)] = fillMode,
117
+ _a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
118
118
  _a['k-invalid'] = !(isValid || validityStyles !== undefined || validityStyles === true),
119
119
  _a['k-required'] = required,
120
120
  _a['k-disabled'] = disabled,
package/dist/es/utils.js CHANGED
@@ -1,7 +1,11 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
2
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
3
- to[j] = from[i];
4
- return to;
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
5
9
  };
6
10
  // Polyfill for PropTypes.null
7
11
  /**
@@ -17,7 +21,7 @@ export function nullable(subRequirement) {
17
21
  return null;
18
22
  }
19
23
  var sub = required ? subRequirement.isRequired : subRequirement;
20
- return sub.apply(void 0, __spreadArray([props, key], rest));
24
+ return sub.apply(void 0, __spreadArray([props, key], rest, false));
21
25
  };
22
26
  var fn = check.bind(null, false);
23
27
  fn.isRequired = check.bind(null, true);
@@ -29,4 +29,4 @@ export declare const CheckboxPropsContext: React.Context<(p: CheckboxProps) => C
29
29
  * ReactDOM.render(<App />, document.querySelector('my-app'));
30
30
  * ```
31
31
  */
32
- export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<CheckboxHandle>>;
32
+ export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<CheckboxHandle | null>>;
@@ -36,7 +36,7 @@ var messages_1 = require("./../messages");
36
36
  *
37
37
  * For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
38
38
  */
39
- exports.CheckboxPropsContext = kendo_react_common_1.createPropsContext();
39
+ exports.CheckboxPropsContext = (0, kendo_react_common_1.createPropsContext)();
40
40
  /**
41
41
  * Represents the [KendoReact Checkbox component]({% slug overview_checkbox %}).
42
42
  *
@@ -52,8 +52,8 @@ exports.CheckboxPropsContext = kendo_react_common_1.createPropsContext();
52
52
  */
53
53
  exports.Checkbox = React.forwardRef(function (directProps, target) {
54
54
  var _a;
55
- kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
56
- var props = kendo_react_common_1.usePropsContext(exports.CheckboxPropsContext, directProps);
55
+ (0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
56
+ var props = (0, kendo_react_common_1.usePropsContext)(exports.CheckboxPropsContext, directProps);
57
57
  var _b = props, ariaDescribedBy = _b.ariaDescribedBy, ariaLabelledBy = _b.ariaLabelledBy, checked = _b.checked, className = _b.className, children = _b.children, defaultChecked = _b.defaultChecked, disabled = _b.disabled, defaultValue = _b.defaultValue, id = _b.id, size = _b.size, rounded = _b.rounded, label = _b.label, labelPlacement = _b.labelPlacement, name = _b.name, labelOptional = _b.labelOptional, onChange = _b.onChange, onFocus = _b.onFocus, onBlur = _b.onBlur, tabIndex = _b.tabIndex, value = _b.value, required = _b.required, valid = _b.valid, validationMessage = _b.validationMessage, validityStyles = _b.validityStyles,
58
58
  // Removed to support direct use in Form Field component
59
59
  visited = _b.visited, touched = _b.touched, modified = _b.modified, others = __rest(_b, ["ariaDescribedBy", "ariaLabelledBy", "checked", "className", "children", "defaultChecked", "disabled", "defaultValue", "id", "size", "rounded", "label", "labelPlacement", "name", "labelOptional", "onChange", "onFocus", "onBlur", "tabIndex", "value", "required", "valid", "validationMessage", "validityStyles", "visited", "touched", "modified"]);
@@ -80,8 +80,8 @@ exports.Checkbox = React.forwardRef(function (directProps, target) {
80
80
  var checkedProp = useValueAsChecked ? currentValue : currentChecked;
81
81
  var valueProp = (useValueAsChecked || isValueControlled) ? (value === null ? value : undefined) : value || currentValue;
82
82
  var indeterminateProp = checkedProp === null || valueProp === null;
83
- var calculatedId = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
84
- var localizationService = kendo_react_intl_1.useLocalization();
83
+ var calculatedId = React.useMemo(function () { return (0, kendo_react_common_1.guid)(); }, []);
84
+ var localizationService = (0, kendo_react_intl_1.useLocalization)();
85
85
  var localizeMessage = function (message) {
86
86
  return localizationService.toLanguageString(message, messages_1.messages[message]);
87
87
  };
@@ -107,7 +107,7 @@ exports.Checkbox = React.forwardRef(function (directProps, target) {
107
107
  }
108
108
  }
109
109
  if (onChange && !disabled) {
110
- kendo_react_common_1.dispatchEvent(onChange, e, __assign(__assign({}, getImperativeHandle()), { value: val }), { value: val });
110
+ (0, kendo_react_common_1.dispatchEvent)(onChange, e, __assign(__assign({}, getImperativeHandle()), { value: val }), { value: val });
111
111
  }
112
112
  }, [isCheckedControlled, disabled, onChange, isValueControlled, getImperativeHandle]);
113
113
  var handleChange = React.useCallback(function (e) {
@@ -137,22 +137,22 @@ exports.Checkbox = React.forwardRef(function (directProps, target) {
137
137
  }, [disabled]);
138
138
  var handleFocus = React.useCallback(function (e) {
139
139
  if (onFocus && !disabled) {
140
- kendo_react_common_1.dispatchEvent(onFocus, e, getImperativeHandle(), undefined);
140
+ (0, kendo_react_common_1.dispatchEvent)(onFocus, e, getImperativeHandle(), undefined);
141
141
  }
142
142
  }, [onFocus, disabled, getImperativeHandle]);
143
143
  var handleBlur = React.useCallback(function (e) {
144
144
  if (onBlur && !disabled) {
145
- kendo_react_common_1.dispatchEvent(onBlur, e, getImperativeHandle(), undefined);
145
+ (0, kendo_react_common_1.dispatchEvent)(onBlur, e, getImperativeHandle(), undefined);
146
146
  }
147
147
  }, [onBlur, disabled, getImperativeHandle]);
148
- var dir = kendo_react_common_1.useDir(elementRef, props.dir);
149
- var checkboxClasses = kendo_react_common_1.classNames({ 'k-disabled': disabled }, className);
150
- var inputProps = __assign(__assign({ type: 'checkbox', className: kendo_react_common_1.classNames('k-checkbox', (_a = {},
151
- _a["k-checkbox-" + (kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
152
- _a["k-rounded-" + (kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
148
+ var dir = (0, kendo_react_common_1.useDir)(elementRef, props.dir);
149
+ var checkboxClasses = (0, kendo_react_common_1.classNames)({ 'k-disabled': disabled }, className);
150
+ var inputProps = __assign(__assign({ type: 'checkbox', className: (0, kendo_react_common_1.classNames)('k-checkbox', (_a = {},
151
+ _a["k-checkbox-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
152
+ _a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
153
153
  _a['k-indeterminate'] = indeterminateProp,
154
154
  _a['k-invalid k-invalid'] = !(isValid || validityStyles !== undefined || validityStyles === true),
155
- _a)), ref: elementRef, name: name, id: id || calculatedId, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, checked: Boolean(checkedProp), disabled: disabled, tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled), role: 'checkbox', required: required !== undefined ? required : false, 'aria-checked': currentChecked || checkedProp ?
155
+ _a)), ref: elementRef, name: name, id: id || calculatedId, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, checked: Boolean(checkedProp), disabled: disabled, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled), role: 'checkbox', required: required !== undefined ? required : false, 'aria-checked': currentChecked || checkedProp ?
156
156
  true :
157
157
  indeterminateProp ?
158
158
  'mixed' :
@@ -29,18 +29,18 @@ var ColorContrastLabels = /** @class */ (function (_super) {
29
29
  return _super !== null && _super.apply(this, arguments) || this;
30
30
  }
31
31
  ColorContrastLabels.prototype.render = function () {
32
- var localizationService = kendo_react_intl_1.provideLocalizationService(this);
32
+ var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
33
33
  var contrastRatioMessage = localizationService.toLanguageString(messages_1.colorGradientContrastRatio, messages_1.messages[messages_1.colorGradientContrastRatio]);
34
34
  var AALevelMessage = localizationService.toLanguageString(messages_1.colorGradientAALevel, messages_1.messages[messages_1.colorGradientAALevel]);
35
35
  var AAALevelMessage = localizationService.toLanguageString(messages_1.colorGradientAAALevel, messages_1.messages[messages_1.colorGradientAAALevel]);
36
36
  var passMessage = localizationService.toLanguageString(messages_1.colorGradientPass, messages_1.messages[messages_1.colorGradientPass]);
37
37
  var failMessage = localizationService.toLanguageString(messages_1.colorGradientFail, messages_1.messages[messages_1.colorGradientFail]);
38
- var contrast = color_parser_1.getContrastFromTwoRGBAs(this.props.rgba, this.props.bgColor);
38
+ var contrast = (0, color_parser_1.getContrastFromTwoRGBAs)(this.props.rgba, this.props.bgColor);
39
39
  var requiredAAContrast = (4.5).toFixed(1);
40
40
  var requiredAAAContrast = (7.0).toFixed(1);
41
- var contrastText = contrastRatioMessage + ": " + contrast.toFixed(2);
42
- var aaText = AALevelMessage + ": " + requiredAAContrast;
43
- var aaaText = AAALevelMessage + ": " + requiredAAAContrast;
41
+ var contrastText = "".concat(contrastRatioMessage, ": ").concat(contrast.toFixed(2));
42
+ var aaText = "".concat(AALevelMessage, ": ").concat(requiredAAContrast);
43
+ var aaaText = "".concat(AAALevelMessage, ": ").concat(requiredAAAContrast);
44
44
  var success = (React.createElement("span", { className: "k-contrast-validation k-text-success" },
45
45
  passMessage,
46
46
  " ",
@@ -66,4 +66,4 @@ var ColorContrastLabels = /** @class */ (function (_super) {
66
66
  return ColorContrastLabels;
67
67
  }(React.Component));
68
68
  exports.ColorContrastLabels = ColorContrastLabels;
69
- kendo_react_intl_1.registerForLocalization(ColorContrastLabels);
69
+ (0, kendo_react_intl_1.registerForLocalization)(ColorContrastLabels);
@@ -37,7 +37,7 @@ var ColorContrastSvg = /** @class */ (function (_super) {
37
37
  var findValue = function (contrast, saturation, low, high, comparer) {
38
38
  var mid = (low + high) / 2;
39
39
  var hsva = Object.assign({}, _this.props.hsva, { s: saturation / gradientRectMetrics.width, v: 1 - mid / gradientRectMetrics.height });
40
- var currentContrast = color_parser_1.getContrastFromTwoRGBAs(color_parser_1.getRGBA(color_parser_1.getColorFromHSV(hsva)), color_parser_1.getRGBA(_this.props.backgroundColor || ''));
40
+ var currentContrast = (0, color_parser_1.getContrastFromTwoRGBAs)((0, color_parser_1.getRGBA)((0, color_parser_1.getColorFromHSV)(hsva)), (0, color_parser_1.getRGBA)(_this.props.backgroundColor || ''));
41
41
  if (low + 0.5 > high) {
42
42
  if (currentContrast < contrast + 1 && currentContrast > contrast - 1) {
43
43
  return mid;
@@ -62,11 +62,11 @@ var ColorContrastSvg = /** @class */ (function (_super) {
62
62
  }
63
63
  return points;
64
64
  };
65
- var bezierCommandCalc = svg_calc_1.bezierCommand(svg_calc_1.controlPoint(svg_calc_1.line));
66
- return svg_calc_1.svgPath(getPaths(AA_CONTRAST, STEP_COUNT), bezierCommandCalc) +
67
- svg_calc_1.svgPath(getPaths(AA_CONTRAST, STEP_COUNT, true), bezierCommandCalc) +
68
- svg_calc_1.svgPath(getPaths(AAA_CONTRAST, STEP_COUNT), bezierCommandCalc) +
69
- svg_calc_1.svgPath(getPaths(AAA_CONTRAST, STEP_COUNT, true), bezierCommandCalc);
65
+ var bezierCommandCalc = (0, svg_calc_1.bezierCommand)((0, svg_calc_1.controlPoint)(svg_calc_1.line));
66
+ return (0, svg_calc_1.svgPath)(getPaths(AA_CONTRAST, STEP_COUNT), bezierCommandCalc) +
67
+ (0, svg_calc_1.svgPath)(getPaths(AA_CONTRAST, STEP_COUNT, true), bezierCommandCalc) +
68
+ (0, svg_calc_1.svgPath)(getPaths(AAA_CONTRAST, STEP_COUNT), bezierCommandCalc) +
69
+ (0, svg_calc_1.svgPath)(getPaths(AAA_CONTRAST, STEP_COUNT, true), bezierCommandCalc);
70
70
  };
71
71
  ColorContrastSvg.prototype.shouldComponentUpdate = function (nextProps) {
72
72
  if (nextProps.hsva.h === this.props.hsva.h &&
@@ -56,7 +56,7 @@ export declare class ColorGradientWithoutContext extends React.Component<ColorGr
56
56
  backgroundColor: string;
57
57
  rgba: any;
58
58
  hex: any;
59
- };
59
+ } | null;
60
60
  /**
61
61
  * @hidden
62
62
  */