@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.
- package/dist/cdn/js/kendo-react-inputs.js +1 -1
- package/dist/es/checkbox/Checkbox.d.ts +1 -1
- package/dist/es/checkbox/Checkbox.js +2 -2
- package/dist/es/colors/ColorContrastLabels.js +3 -3
- package/dist/es/colors/ColorGradient.d.ts +1 -1
- package/dist/es/colors/ColorGradient.js +7 -3
- package/dist/es/colors/ColorPalette.d.ts +4 -1
- package/dist/es/colors/ColorPalette.js +10 -3
- package/dist/es/colors/ColorPicker.d.ts +1 -1
- package/dist/es/colors/ColorPicker.js +4 -4
- package/dist/es/colors/FlatColorPicker.d.ts +1 -1
- package/dist/es/colors/FlatColorPicker.js +25 -24
- package/dist/es/colors/HexInput.d.ts +1 -1
- package/dist/es/colors/utils/color-parser.js +2 -2
- package/dist/es/colors/utils/svg-calc.js +4 -4
- package/dist/es/common/SliderTooltip.js +3 -3
- package/dist/es/common/SwitchController.js +5 -1
- package/dist/es/common/SwitchModel.d.ts +1 -1
- package/dist/es/input/Input.js +2 -1
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +7 -7
- package/dist/es/maskedtextbox/MaskedTextBox.js +7 -6
- package/dist/es/maskedtextbox/parsing/parsers.d.ts +2 -2
- package/dist/es/maskedtextbox/parsing/parsers.js +28 -32
- package/dist/es/maskedtextbox/parsing/result.js +1 -1
- package/dist/es/numerictextbox/NumericTextBox.d.ts +1 -1
- package/dist/es/numerictextbox/NumericTextBox.js +3 -3
- package/dist/es/numerictextbox/utils/index.d.ts +1 -1
- package/dist/es/numerictextbox/utils/index.js +5 -5
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/radiobutton/RadioButton.d.ts +1 -1
- package/dist/es/radiobutton/RadioButton.js +1 -1
- package/dist/es/radiobutton/RadioGroup.d.ts +1 -1
- package/dist/es/range-slider/RangeSlider.d.ts +1 -1
- package/dist/es/range-slider/RangeSlider.js +7 -7
- package/dist/es/rating/Rating.d.ts +1 -1
- package/dist/es/rating/Rating.js +15 -12
- package/dist/es/rating/RatingItem.d.ts +1 -1
- package/dist/es/rating/models/index.d.ts +4 -0
- package/dist/es/slider/Slider.d.ts +2 -2
- package/dist/es/slider/Slider.js +2 -0
- package/dist/es/slider/SliderLabel.js +2 -2
- package/dist/es/switch/Switch.d.ts +6 -6
- package/dist/es/switch/Switch.js +7 -4
- package/dist/es/textarea/TextArea.d.ts +1 -1
- package/dist/es/textarea/TextArea.js +4 -4
- package/dist/es/utils.js +9 -5
- package/dist/npm/checkbox/Checkbox.d.ts +1 -1
- package/dist/npm/checkbox/Checkbox.js +14 -14
- package/dist/npm/colors/ColorContrastLabels.js +6 -6
- package/dist/npm/colors/ColorContrastSvg.js +6 -6
- package/dist/npm/colors/ColorGradient.d.ts +1 -1
- package/dist/npm/colors/ColorGradient.js +37 -33
- package/dist/npm/colors/ColorInput.js +3 -3
- package/dist/npm/colors/ColorPalette.d.ts +4 -1
- package/dist/npm/colors/ColorPalette.js +19 -12
- package/dist/npm/colors/ColorPicker.d.ts +1 -1
- package/dist/npm/colors/ColorPicker.js +13 -13
- package/dist/npm/colors/FlatColorPicker.d.ts +1 -1
- package/dist/npm/colors/FlatColorPicker.js +27 -26
- package/dist/npm/colors/HexInput.d.ts +1 -1
- package/dist/npm/colors/HexInput.js +3 -3
- package/dist/npm/colors/Picker.js +1 -1
- package/dist/npm/colors/utils/color-palette.service.js +6 -6
- package/dist/npm/colors/utils/color-parser.js +26 -26
- package/dist/npm/colors/utils/misc.js +1 -1
- package/dist/npm/colors/utils/svg-calc.js +4 -4
- package/dist/npm/common/SliderTooltip.js +4 -4
- package/dist/npm/common/SwitchController.js +5 -1
- package/dist/npm/common/SwitchModel.d.ts +1 -1
- package/dist/npm/input/Input.js +7 -6
- package/dist/npm/main.js +5 -1
- package/dist/npm/maskedtextbox/MaskedTextBox.d.ts +7 -7
- package/dist/npm/maskedtextbox/MaskedTextBox.js +13 -12
- package/dist/npm/maskedtextbox/masking.service.js +19 -19
- package/dist/npm/maskedtextbox/parsing/parsers.d.ts +2 -2
- package/dist/npm/maskedtextbox/parsing/parsers.js +28 -32
- package/dist/npm/maskedtextbox/parsing/result.js +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.d.ts +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +31 -31
- package/dist/npm/numerictextbox/utils/index.d.ts +1 -1
- package/dist/npm/numerictextbox/utils/index.js +61 -61
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/radiobutton/RadioButton.d.ts +1 -1
- package/dist/npm/radiobutton/RadioButton.js +10 -10
- package/dist/npm/radiobutton/RadioGroup.d.ts +1 -1
- package/dist/npm/radiobutton/RadioGroup.js +10 -10
- package/dist/npm/range-slider/RangeSlider.d.ts +1 -1
- package/dist/npm/range-slider/RangeSlider.js +17 -17
- package/dist/npm/rating/Rating.d.ts +1 -1
- package/dist/npm/rating/Rating.js +36 -33
- package/dist/npm/rating/RatingItem.d.ts +1 -1
- package/dist/npm/rating/RatingItem.js +2 -2
- package/dist/npm/rating/models/index.d.ts +4 -0
- package/dist/npm/rating/rating-reducer.js +4 -4
- package/dist/npm/rating/utils/index.js +5 -5
- package/dist/npm/slider/Slider.d.ts +2 -2
- package/dist/npm/slider/Slider.js +9 -7
- package/dist/npm/slider/SliderLabel.js +3 -3
- package/dist/npm/switch/Switch.d.ts +6 -6
- package/dist/npm/switch/Switch.js +17 -14
- package/dist/npm/textarea/TextArea.d.ts +1 -1
- package/dist/npm/textarea/TextArea.js +13 -13
- package/dist/npm/utils.js +9 -5
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +15 -15
|
@@ -67,11 +67,14 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
67
67
|
_this.toggle = function (value, event) {
|
|
68
68
|
_this.setState({ checked: value });
|
|
69
69
|
_this.valueDuringOnChange = value;
|
|
70
|
-
kendo_react_common_1.dispatchEvent(_this.props.onChange, event, _this, { value: value });
|
|
70
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onChange, event, _this, { value: value });
|
|
71
71
|
_this.valueDuringOnChange = undefined;
|
|
72
72
|
};
|
|
73
|
-
_this.
|
|
74
|
-
_this.
|
|
73
|
+
_this._element = null;
|
|
74
|
+
_this._wrapper = null;
|
|
75
|
+
_this._input = null;
|
|
76
|
+
_this._id = (0, kendo_react_common_1.guid)();
|
|
77
|
+
_this.defaultValidationMessage = (0, kendo_react_intl_1.provideLocalizationService)(_this);
|
|
75
78
|
/**
|
|
76
79
|
* @hidden
|
|
77
80
|
*/
|
|
@@ -123,7 +126,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
123
126
|
onBlur.call(undefined, event);
|
|
124
127
|
}
|
|
125
128
|
};
|
|
126
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
129
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
127
130
|
_this.state = {
|
|
128
131
|
checked: props.defaultChecked || SwitchWithoutContext.defaultProps.defaultChecked,
|
|
129
132
|
focused: false
|
|
@@ -240,9 +243,9 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
240
243
|
var _d = this.props, dir = _d.dir, disabled = _d.disabled, trackRounded = _d.trackRounded, thumbRounded = _d.thumbRounded, size = _d.size, id = _d.id, offLabel = _d.offLabel, onLabel = _d.onLabel, tabIndex = _d.tabIndex;
|
|
241
244
|
this.dir = dir || (this._wrapper && getComputedStyle(this._wrapper).direction) || undefined;
|
|
242
245
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
243
|
-
var switchClassName = kendo_react_common_1.classNames('k-switch', (_a = {},
|
|
244
|
-
_a["k-switch-"
|
|
245
|
-
_a["k-rounded-"
|
|
246
|
+
var switchClassName = (0, kendo_react_common_1.classNames)('k-switch', (_a = {},
|
|
247
|
+
_a["k-switch-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
248
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
|
|
246
249
|
_a['k-switch-on'] = this.value,
|
|
247
250
|
_a['k-switch-off'] = !this.value,
|
|
248
251
|
_a['k-focus'] = focused,
|
|
@@ -256,17 +259,17 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
256
259
|
return (React.createElement("span", { ref: function (span) {
|
|
257
260
|
_this._wrapper = span;
|
|
258
261
|
}, className: switchClassName, dir: this.dir, onKeyDown: this.handleKeyDown, onClick: this.handleClick, onBlur: this.handleWrapperBlur, onFocus: this.handleWrapperFocus },
|
|
259
|
-
React.createElement("span", __assign({ className: kendo_react_common_1.classNames('k-switch-track', (_b = {},
|
|
260
|
-
_b["k-rounded-"
|
|
262
|
+
React.createElement("span", __assign({ className: (0, kendo_react_common_1.classNames)('k-switch-track', (_b = {},
|
|
263
|
+
_b["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
|
|
261
264
|
_b)), id: id || this._id, role: 'switch' }, ariaAttributes, { "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, ref: function (span) {
|
|
262
265
|
_this._element = span;
|
|
263
|
-
}, tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled, undefined), accessKey: this.props.accessKey }),
|
|
266
|
+
}, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled, undefined), accessKey: this.props.accessKey }),
|
|
264
267
|
this.dummyInput(this.value),
|
|
265
268
|
React.createElement("span", { className: 'k-switch-label-on' }, onLabel),
|
|
266
269
|
React.createElement("span", { className: 'k-switch-label-off' }, offLabel),
|
|
267
270
|
React.createElement("span", { className: 'k-switch-thumb-wrap' },
|
|
268
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-switch-thumb', (_c = {},
|
|
269
|
-
_c["k-rounded-"
|
|
271
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-switch-thumb', (_c = {},
|
|
272
|
+
_c["k-rounded-".concat(thumbRounded)] = thumbRounded,
|
|
270
273
|
_c)) })))));
|
|
271
274
|
};
|
|
272
275
|
SwitchWithoutContext.displayName = 'Switch';
|
|
@@ -322,7 +325,7 @@ exports.SwitchWithoutContext = SwitchWithoutContext;
|
|
|
322
325
|
*
|
|
323
326
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
324
327
|
*/
|
|
325
|
-
exports.SwitchPropsContext = kendo_react_common_1.createPropsContext();
|
|
328
|
+
exports.SwitchPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
326
329
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
327
330
|
/**
|
|
328
331
|
* Represents the [KendoReact Switch component]({% slug overview_switch %}).
|
|
@@ -330,5 +333,5 @@ exports.SwitchPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
330
333
|
* Accepts properties of type [SwitchProps]({% slug api_inputs_switchprops %}).
|
|
331
334
|
* Obtaining the `ref` returns an object of type [SwitchHandle]({% slug api_inputs_switchhandle %}).
|
|
332
335
|
*/
|
|
333
|
-
exports.Switch = kendo_react_common_1.withPropsContext(exports.SwitchPropsContext, SwitchWithoutContext);
|
|
336
|
+
exports.Switch = (0, kendo_react_common_1.withPropsContext)(exports.SwitchPropsContext, SwitchWithoutContext);
|
|
334
337
|
exports.Switch.displayName = 'KendoReactSwitch';
|
|
@@ -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>>;
|
|
@@ -32,7 +32,7 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
32
32
|
*
|
|
33
33
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
34
34
|
*/
|
|
35
|
-
exports.TextAreaPropsContext = kendo_react_common_1.createPropsContext();
|
|
35
|
+
exports.TextAreaPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
36
36
|
/**
|
|
37
37
|
* Represents the [KendoReact TextArea component]({% slug overview_textarea %}).
|
|
38
38
|
*
|
|
@@ -52,7 +52,7 @@ exports.TextAreaPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
52
52
|
*/
|
|
53
53
|
exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
54
54
|
var _a;
|
|
55
|
-
var props = kendo_react_common_1.usePropsContext(exports.TextAreaPropsContext, directProps);
|
|
55
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.TextAreaPropsContext, directProps);
|
|
56
56
|
var _b = props, size = _b.size, rounded = _b.rounded, fillMode = _b.fillMode, ariaDescribedBy = _b.ariaDescribedBy, ariaLabelledBy = _b.ariaLabelledBy, autoSize = _b.autoSize, className = _b.className, defaultValue = _b.defaultValue, disabled = _b.disabled, readOnly = _b.readOnly, required = _b.required, rows = _b.rows, id = _b.id, name = _b.name, placeholder = _b.placeholder, style = _b.style, tabIndex = _b.tabIndex, value = _b.value, valid = _b.valid, validationMessage = _b.validationMessage, validityStyles = _b.validityStyles, onChange = _b.onChange, onFocus = _b.onFocus, onBlur = _b.onBlur,
|
|
57
57
|
// Removed to support direct use in Form Field component
|
|
58
58
|
visited = _b.visited, touched = _b.touched, modified = _b.modified, others = __rest(_b, ["size", "rounded", "fillMode", "ariaDescribedBy", "ariaLabelledBy", "autoSize", "className", "defaultValue", "disabled", "readOnly", "required", "rows", "id", "name", "placeholder", "style", "tabIndex", "value", "valid", "validationMessage", "validityStyles", "onChange", "onFocus", "onBlur", "visited", "touched", "modified"]);
|
|
@@ -72,8 +72,8 @@ exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
|
72
72
|
React.useImperativeHandle(target, getImperativeHandle);
|
|
73
73
|
var _c = React.useState(defaultValue), stateValue = _c[0], setStateValue = _c[1];
|
|
74
74
|
var _d = React.useState('auto'), textAreaHeight = _d[0], setTextAreaHeight = _d[1];
|
|
75
|
-
var calculatedId = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
|
|
76
|
-
var dir = kendo_react_common_1.useDir(elementRef, props.dir);
|
|
75
|
+
var calculatedId = React.useMemo(function () { return (0, kendo_react_common_1.guid)(); }, []);
|
|
76
|
+
var dir = (0, kendo_react_common_1.useDir)(elementRef, props.dir);
|
|
77
77
|
var isControlled = value !== undefined;
|
|
78
78
|
var currentValue = isControlled ? value : stateValue;
|
|
79
79
|
var isValid = valid !== undefined ?
|
|
@@ -90,7 +90,7 @@ exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
|
90
90
|
}, [isValid, validationMessage]);
|
|
91
91
|
React.useLayoutEffect(function () {
|
|
92
92
|
if (elementRef.current) {
|
|
93
|
-
setTextAreaHeight(elementRef.current.scrollHeight
|
|
93
|
+
setTextAreaHeight("".concat(elementRef.current.scrollHeight, "px"));
|
|
94
94
|
}
|
|
95
95
|
}, [currentValue]);
|
|
96
96
|
var handleChange = React.useCallback(function (event) {
|
|
@@ -100,24 +100,24 @@ exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
|
100
100
|
setStateValue(newValue);
|
|
101
101
|
}
|
|
102
102
|
if (onChange && !disabled) {
|
|
103
|
-
kendo_react_common_1.dispatchEvent(onChange, event, getImperativeHandle(), { value: newValue });
|
|
103
|
+
(0, kendo_react_common_1.dispatchEvent)(onChange, event, getImperativeHandle(), { value: newValue });
|
|
104
104
|
}
|
|
105
105
|
}, [setStateValue, onChange, disabled, isControlled]);
|
|
106
106
|
var handleFocus = React.useCallback(function (event) {
|
|
107
107
|
if (onFocus && !disabled) {
|
|
108
|
-
kendo_react_common_1.dispatchEvent(onFocus, event, getImperativeHandle(), undefined);
|
|
108
|
+
(0, kendo_react_common_1.dispatchEvent)(onFocus, event, getImperativeHandle(), undefined);
|
|
109
109
|
}
|
|
110
110
|
}, [onFocus, disabled]);
|
|
111
111
|
var handleBlur = React.useCallback(function (event) {
|
|
112
112
|
if (onBlur && !disabled) {
|
|
113
|
-
kendo_react_common_1.dispatchEvent(onBlur, event, getImperativeHandle(), undefined);
|
|
113
|
+
(0, kendo_react_common_1.dispatchEvent)(onBlur, event, getImperativeHandle(), undefined);
|
|
114
114
|
}
|
|
115
115
|
}, [onBlur, disabled]);
|
|
116
|
-
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: kendo_react_common_1.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 });
|
|
117
|
-
return (React.createElement("span", { className: kendo_react_common_1.classNames('k-input', 'k-textarea', (_a = {},
|
|
118
|
-
_a["k-input-"
|
|
119
|
-
_a["k-input-"
|
|
120
|
-
_a["k-rounded-"
|
|
116
|
+
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: (0, kendo_react_common_1.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 });
|
|
117
|
+
return (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-input', 'k-textarea', (_a = {},
|
|
118
|
+
_a["k-input-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
119
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
120
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
121
121
|
_a['k-invalid'] = !(isValid || validityStyles !== undefined || validityStyles === true),
|
|
122
122
|
_a['k-required'] = required,
|
|
123
123
|
_a['k-disabled'] = disabled,
|
package/dist/npm/utils.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
-
for (var i = 0,
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6
10
|
};
|
|
7
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
12
|
exports.nullable = void 0;
|
|
@@ -20,7 +24,7 @@ function nullable(subRequirement) {
|
|
|
20
24
|
return null;
|
|
21
25
|
}
|
|
22
26
|
var sub = required ? subRequirement.isRequired : subRequirement;
|
|
23
|
-
return sub.apply(void 0, __spreadArray([props, key], rest));
|
|
27
|
+
return sub.apply(void 0, __spreadArray([props, key], rest, false));
|
|
24
28
|
};
|
|
25
29
|
var fn = check.bind(null, false);
|
|
26
30
|
fn.isRequired = check.bind(null, true);
|