@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
|
@@ -24,7 +24,7 @@ var package_metadata_1 = require("../package-metadata");
|
|
|
24
24
|
*
|
|
25
25
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
26
26
|
*/
|
|
27
|
-
exports.RadioGroupPropsContext = kendo_react_common_1.createPropsContext();
|
|
27
|
+
exports.RadioGroupPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
28
28
|
/**
|
|
29
29
|
* Represents the [KendoReact RadioGroup component]({% slug overview_radiogroup %}).
|
|
30
30
|
*
|
|
@@ -32,13 +32,13 @@ exports.RadioGroupPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
32
32
|
* Obtaining the `ref` returns an object of type [RadioGroupHandle]({% slug api_inputs_radiogrouphandle %}).
|
|
33
33
|
*/
|
|
34
34
|
exports.RadioGroup = React.forwardRef(function (directProps, target) {
|
|
35
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
36
|
-
var props = kendo_react_common_1.usePropsContext(exports.RadioGroupPropsContext, directProps);
|
|
35
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
36
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.RadioGroupPropsContext, directProps);
|
|
37
37
|
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;
|
|
38
38
|
var elementRef = React.useRef(null);
|
|
39
39
|
var focusElement = React.useCallback(function () {
|
|
40
40
|
if (elementRef.current) {
|
|
41
|
-
kendo_react_common_1.focusFirstFocusableChild(elementRef.current);
|
|
41
|
+
(0, kendo_react_common_1.focusFirstFocusableChild)(elementRef.current);
|
|
42
42
|
}
|
|
43
43
|
}, []);
|
|
44
44
|
var getImperativeHandle = React.useCallback(function () { return ({
|
|
@@ -55,20 +55,20 @@ exports.RadioGroup = React.forwardRef(function (directProps, target) {
|
|
|
55
55
|
setStateChecked(currentValue);
|
|
56
56
|
}
|
|
57
57
|
if (onChange && !disabled) {
|
|
58
|
-
kendo_react_common_1.dispatchEvent(onChange, event.syntheticEvent, getImperativeHandle(), { value: currentValue });
|
|
58
|
+
(0, kendo_react_common_1.dispatchEvent)(onChange, event.syntheticEvent, getImperativeHandle(), { value: currentValue });
|
|
59
59
|
}
|
|
60
60
|
}, [setStateChecked, onChange, disabled]);
|
|
61
61
|
var handleFocus = React.useCallback(function (event) {
|
|
62
62
|
if (onFocus && !disabled) {
|
|
63
|
-
kendo_react_common_1.dispatchEvent(onFocus, event.syntheticEvent, getImperativeHandle(), undefined);
|
|
63
|
+
(0, kendo_react_common_1.dispatchEvent)(onFocus, event.syntheticEvent, getImperativeHandle(), undefined);
|
|
64
64
|
}
|
|
65
65
|
}, [onFocus, disabled]);
|
|
66
|
-
var radioGroupName = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
|
|
67
|
-
var radioGroupClasses = kendo_react_common_1.classNames('k-radio-list', {
|
|
66
|
+
var radioGroupName = React.useMemo(function () { return (0, kendo_react_common_1.guid)(); }, []);
|
|
67
|
+
var radioGroupClasses = (0, kendo_react_common_1.classNames)('k-radio-list', {
|
|
68
68
|
'k-list-horizontal': layout === 'horizontal',
|
|
69
69
|
'k-list-vertical': layout === 'vertical' || layout === undefined
|
|
70
70
|
}, className);
|
|
71
|
-
var dir = kendo_react_common_1.useRtl(elementRef, props.dir);
|
|
71
|
+
var dir = (0, kendo_react_common_1.useRtl)(elementRef, props.dir);
|
|
72
72
|
var radioOptions = (data && data.map(function (option, index) {
|
|
73
73
|
var isCurrentlyChecked = checkedRadioValue === option.value;
|
|
74
74
|
var noOptionChecked = checkedRadioValue === null || checkedRadioValue === undefined;
|
|
@@ -77,7 +77,7 @@ exports.RadioGroup = React.forwardRef(function (directProps, target) {
|
|
|
77
77
|
: (noOptionChecked && index === 0) || isCurrentlyChecked
|
|
78
78
|
? 0
|
|
79
79
|
: -1, index: index, name: name || radioGroupName, onChange: handleChange, onFocus: handleFocus });
|
|
80
|
-
return (React.createElement(Item, { className: kendo_react_common_1.classNames('k-radio-item', { 'k-disabled': radioButtonProps.disabled || disabled }), key: index, role: 'radio' },
|
|
80
|
+
return (React.createElement(Item, { className: (0, kendo_react_common_1.classNames)('k-radio-item', { 'k-disabled': radioButtonProps.disabled || disabled }), key: index, role: 'radio' },
|
|
81
81
|
React.createElement(RadioButton_1.RadioButton, __assign({}, radioButtonProps))));
|
|
82
82
|
}));
|
|
83
83
|
return (React.createElement("ul", { role: "radiogroup", className: radioGroupClasses, ref: elementRef, dir: dir, style: style, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }, radioOptions));
|
|
@@ -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>>;
|
|
@@ -26,7 +26,7 @@ var package_metadata_1 = require("../package-metadata");
|
|
|
26
26
|
var useRange = function (defaultValue, args, callback) {
|
|
27
27
|
var _a = React.useState(defaultValue), state = _a[0], setState = _a[1];
|
|
28
28
|
var handleDispatchAction = React.useCallback(function (action) {
|
|
29
|
-
var newState = range_raducer_1.rangeReducer(args.state || state, __assign(__assign({}, action), args));
|
|
29
|
+
var newState = (0, range_raducer_1.rangeReducer)(args.state || state, __assign(__assign({}, action), args));
|
|
30
30
|
if (callback) {
|
|
31
31
|
callback(newState, action.event);
|
|
32
32
|
}
|
|
@@ -40,7 +40,7 @@ var useRange = function (defaultValue, args, callback) {
|
|
|
40
40
|
*
|
|
41
41
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
42
42
|
*/
|
|
43
|
-
exports.RangeSliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
43
|
+
exports.RangeSliderPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
44
44
|
/**
|
|
45
45
|
* Represents the [KendoReact RangeSlider component]({% slug overview_rangeslider %}).
|
|
46
46
|
*
|
|
@@ -49,8 +49,8 @@ exports.RangeSliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
49
49
|
*/
|
|
50
50
|
exports.RangeSlider = React.forwardRef(function (directProps, ref) {
|
|
51
51
|
var _a, _b;
|
|
52
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
53
|
-
var props = kendo_react_common_1.usePropsContext(exports.RangeSliderPropsContext, directProps);
|
|
52
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
53
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.RangeSliderPropsContext, directProps);
|
|
54
54
|
var target = React.useRef(null);
|
|
55
55
|
var sliderRef = React.useRef(null);
|
|
56
56
|
var sliderSelectionRef = React.useRef(null);
|
|
@@ -70,7 +70,7 @@ exports.RangeSlider = React.forwardRef(function (directProps, ref) {
|
|
|
70
70
|
var min = React.useMemo(function () { return props.min; }, [props.min]);
|
|
71
71
|
var max = React.useMemo(function () { return props.max; }, [props.max]);
|
|
72
72
|
var step = React.useMemo(function () { return props.step !== undefined ? props.step : defaultProps.step; }, [props.step, defaultProps.step]);
|
|
73
|
-
var dir = kendo_react_common_1.useDir(sliderRef, props.dir);
|
|
73
|
+
var dir = (0, kendo_react_common_1.useDir)(sliderRef, props.dir);
|
|
74
74
|
var handleChange = function (newValue, event) {
|
|
75
75
|
if (props.onChange && target.current) {
|
|
76
76
|
props.onChange.call(undefined, {
|
|
@@ -96,7 +96,7 @@ exports.RangeSlider = React.forwardRef(function (directProps, ref) {
|
|
|
96
96
|
var trackStyles = React.useMemo(function () { return props.vertical
|
|
97
97
|
? { marginTop: '0.5rem', marginBottom: '0.5rem' }
|
|
98
98
|
: { marginLeft: '0.5rem', marginRight: '0.5rem' }; }, [props.vertical]);
|
|
99
|
-
var localization = kendo_react_intl_1.useLocalization();
|
|
99
|
+
var localization = (0, kendo_react_intl_1.useLocalization)();
|
|
100
100
|
var calcNewDistance = React.useCallback(function (event) {
|
|
101
101
|
if (!sliderTrackWrapRef.current) {
|
|
102
102
|
return;
|
|
@@ -214,8 +214,8 @@ exports.RangeSlider = React.forwardRef(function (directProps, ref) {
|
|
|
214
214
|
dispatchStateValue({ type: action, payload: payload, event: event });
|
|
215
215
|
setCurrentDrag('');
|
|
216
216
|
};
|
|
217
|
-
kendo_react_common_1.useDraggable(sliderTrackWrapRef, { onPress: handleTrackPress, onDrag: handleTrackDrag, onRelease: handleTrackRelease });
|
|
218
|
-
return (React.createElement("div", { role: "slider", id: props.id, style: props.style, ref: sliderRef, dir: dir, className: kendo_react_common_1.classNames('k-widget k-slider', {
|
|
217
|
+
(0, kendo_react_common_1.useDraggable)(sliderTrackWrapRef, { onPress: handleTrackPress, onDrag: handleTrackDrag, onRelease: handleTrackRelease });
|
|
218
|
+
return (React.createElement("div", { role: "slider", id: props.id, style: props.style, ref: sliderRef, dir: dir, className: (0, kendo_react_common_1.classNames)('k-widget k-slider', {
|
|
219
219
|
'k-rtl': dir === 'rtl',
|
|
220
220
|
'k-disabled': props.disabled,
|
|
221
221
|
'k-slider-vertical': props.vertical,
|
|
@@ -232,17 +232,17 @@ exports.RangeSlider = React.forwardRef(function (directProps, ref) {
|
|
|
232
232
|
React.createElement("div", { ref: sliderTrackRef, className: "k-slider-track", style: props.vertical
|
|
233
233
|
? { bottom: 0, height: '100%' }
|
|
234
234
|
: (_a = {}, _a[dir === 'rtl' ? 'right' : 'left'] = 0, _a.width = '100%', _a) },
|
|
235
|
-
(percentStart !== null && percentEnd !== null) && React.createElement("div", { "data-selection": true, ref: sliderSelectionRef, title: value.start
|
|
235
|
+
(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
|
|
236
236
|
? { height: (percentEnd - percentStart) + '%', bottom: percentStart + '%' }
|
|
237
237
|
: (_b = {},
|
|
238
238
|
_b[dir === 'rtl' ? 'right' : 'left'] = percentStart + '%',
|
|
239
239
|
_b.width = (percentEnd - percentStart) + '%',
|
|
240
240
|
_b) }),
|
|
241
|
-
React.createElement("a", { ref: startHandle, role: "slider", tabIndex: kendo_react_common_1.getTabIndex(props.startTabIndex, props.disabled, undefined), "aria-valuemin": min, "aria-valuemax": Math.max(max, value.end), "aria-valuenow": value.start, "aria-disabled": props.disabled ? 'true' : undefined, className: "k-draghandle", title: localization.toLanguageString(messages_1.sliderDragTitle, messages_1.messages[messages_1.sliderDragTitle]), style: props.vertical
|
|
241
|
+
React.createElement("a", { ref: startHandle, role: "slider", tabIndex: (0, kendo_react_common_1.getTabIndex)(props.startTabIndex, props.disabled, undefined), "aria-valuemin": min, "aria-valuemax": Math.max(max, value.end), "aria-valuenow": value.start, "aria-disabled": props.disabled ? 'true' : undefined, className: "k-draghandle", title: localization.toLanguageString(messages_1.sliderDragTitle, messages_1.messages[messages_1.sliderDragTitle]), style: props.vertical
|
|
242
242
|
? { bottom: 'calc(' + percentStart + '%)', zIndex: 1 }
|
|
243
243
|
: dir === 'rtl' ? { right: 'calc(' + percentStart + '% - 13px)', zIndex: 1 }
|
|
244
244
|
: { left: 'calc(' + percentStart + '%)', zIndex: 1 }, onKeyDown: handleStartKeyDown }),
|
|
245
|
-
React.createElement("a", { ref: endHandle, role: "slider", tabIndex: kendo_react_common_1.getTabIndex(props.endTabIndex, props.disabled, undefined), "aria-valuemin": Math.min(min, value.start), "aria-valuemax": max, "aria-valuenow": value.end, "aria-disabled": props.disabled ? 'true' : undefined, className: "k-draghandle", title: localization.toLanguageString(messages_1.sliderDragTitle, messages_1.messages[messages_1.sliderDragTitle]), style: props.vertical
|
|
245
|
+
React.createElement("a", { ref: endHandle, role: "slider", tabIndex: (0, kendo_react_common_1.getTabIndex)(props.endTabIndex, props.disabled, undefined), "aria-valuemin": Math.min(min, value.start), "aria-valuemax": max, "aria-valuenow": value.end, "aria-disabled": props.disabled ? 'true' : undefined, className: "k-draghandle", title: localization.toLanguageString(messages_1.sliderDragTitle, messages_1.messages[messages_1.sliderDragTitle]), style: props.vertical
|
|
246
246
|
? { bottom: 'calc(' + percentEnd + '%)', zIndex: 1 }
|
|
247
247
|
: dir === 'rtl' ? { right: 'calc(' + percentEnd + '% - 13px)', zIndex: 1 }
|
|
248
248
|
: { left: 'calc(' + percentEnd + '%)', zIndex: 1 }, onKeyDown: handleEndKeyDown })))));
|
|
@@ -255,7 +255,7 @@ var propTypes = {
|
|
|
255
255
|
var min = props.min;
|
|
256
256
|
var max = props.max;
|
|
257
257
|
if (start > end || start > max || start < min || end > max || end < min || end < start) {
|
|
258
|
-
return new Error("Invalid prop + "
|
|
258
|
+
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 "));
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
return null;
|
|
@@ -267,7 +267,7 @@ var propTypes = {
|
|
|
267
267
|
var min = props.min;
|
|
268
268
|
var max = props.max;
|
|
269
269
|
if (start > end || start > max || start < min || end > max || end < min || end < start) {
|
|
270
|
-
return new Error("Invalid prop + "
|
|
270
|
+
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 "));
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
return null;
|
|
@@ -279,10 +279,10 @@ var propTypes = {
|
|
|
279
279
|
var min = props.min;
|
|
280
280
|
var max = props.max;
|
|
281
281
|
if (min === undefined) {
|
|
282
|
-
return new Error("Invalid prop + "
|
|
282
|
+
return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n ").concat(propName, " value can not be undefined.\n "));
|
|
283
283
|
}
|
|
284
284
|
if (prop && min >= max) {
|
|
285
|
-
return new Error("Invalid prop + "
|
|
285
|
+
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 "));
|
|
286
286
|
}
|
|
287
287
|
return null;
|
|
288
288
|
},
|
|
@@ -291,10 +291,10 @@ var propTypes = {
|
|
|
291
291
|
var min = props.min;
|
|
292
292
|
var max = props.max;
|
|
293
293
|
if (max === undefined) {
|
|
294
|
-
return new Error("Invalid prop + "
|
|
294
|
+
return new Error("Invalid prop + ".concat(propName, " supplied to ").concat(componentName, ".\n ").concat(propName, " value can not be undefined.\n "));
|
|
295
295
|
}
|
|
296
296
|
if (prop && max <= min) {
|
|
297
|
-
return new Error("Invalid prop + "
|
|
297
|
+
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 "));
|
|
298
298
|
}
|
|
299
299
|
return null;
|
|
300
300
|
},
|
|
@@ -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>>;
|
|
@@ -24,7 +24,7 @@ var utils_1 = require("./utils");
|
|
|
24
24
|
var useRating = function (defaultValue, args, callback) {
|
|
25
25
|
var _a = React.useState(defaultValue), state = _a[0], setState = _a[1];
|
|
26
26
|
var handleDispatchAction = function (action) {
|
|
27
|
-
var newState = rating_reducer_1.ratingReducer(args.state || state, __assign(__assign({}, action), args));
|
|
27
|
+
var newState = (0, rating_reducer_1.ratingReducer)(args.state || state, __assign(__assign({}, action), args));
|
|
28
28
|
if (callback) {
|
|
29
29
|
callback(newState, action.event);
|
|
30
30
|
}
|
|
@@ -38,7 +38,7 @@ var useRating = function (defaultValue, args, callback) {
|
|
|
38
38
|
*
|
|
39
39
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
40
40
|
*/
|
|
41
|
-
exports.RatingPropsContext = kendo_react_common_1.createPropsContext();
|
|
41
|
+
exports.RatingPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
42
42
|
/**
|
|
43
43
|
* Represents the [KendoReact Rating component]({% slug overview_rating %}).
|
|
44
44
|
*
|
|
@@ -47,10 +47,10 @@ exports.RatingPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
47
47
|
*/
|
|
48
48
|
exports.Rating = React.forwardRef(function (directProps, ref) {
|
|
49
49
|
var _a, _b, _c, _d;
|
|
50
|
-
var props = kendo_react_common_1.usePropsContext(exports.RatingPropsContext, directProps);
|
|
50
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.RatingPropsContext, directProps);
|
|
51
51
|
var target = React.useRef(null);
|
|
52
52
|
var ratingRef = React.useRef(null);
|
|
53
|
-
var dir = kendo_react_common_1.useDir(ratingRef, props.dir);
|
|
53
|
+
var dir = (0, kendo_react_common_1.useDir)(ratingRef, props.dir);
|
|
54
54
|
React.useImperativeHandle(target, function () { return ({
|
|
55
55
|
element: ratingRef.current,
|
|
56
56
|
props: props
|
|
@@ -95,19 +95,20 @@ exports.Rating = React.forwardRef(function (directProps, ref) {
|
|
|
95
95
|
}
|
|
96
96
|
if (precision === 'half') {
|
|
97
97
|
var rect = event.target.element.getBoundingClientRect();
|
|
98
|
-
var isFirstHalf = utils_1.calcIsFirstHalf(dir ? dir : 'ltr', rect, event.syntheticEvent.clientX);
|
|
99
|
-
var payload = isFirstHalf ? utils_1.toRound(event.target.value - (step / 2), base) : event.target.value;
|
|
98
|
+
var isFirstHalf = (0, utils_1.calcIsFirstHalf)(dir ? dir : 'ltr', rect, event.syntheticEvent.clientX);
|
|
99
|
+
var payload = isFirstHalf ? (0, utils_1.toRound)(event.target.value - (step / 2), base) : event.target.value;
|
|
100
100
|
dispatchStateValue({ type: rating_reducer_1.RATING_ACTION.select, payload: payload, event: event.syntheticEvent });
|
|
101
101
|
}
|
|
102
102
|
else {
|
|
103
103
|
dispatchStateValue({ type: rating_reducer_1.RATING_ACTION.select, payload: event.target.value, event: event.syntheticEvent });
|
|
104
104
|
}
|
|
105
105
|
if (props.onClick) {
|
|
106
|
-
|
|
106
|
+
var ev = {
|
|
107
107
|
value: value,
|
|
108
108
|
target: target.current,
|
|
109
109
|
syntheticEvent: event.syntheticEvent
|
|
110
|
-
}
|
|
110
|
+
};
|
|
111
|
+
props.onClick.call(undefined, ev);
|
|
111
112
|
}
|
|
112
113
|
}, [props.onClick, dispatchStateValue, value]);
|
|
113
114
|
var handleKeyDown = React.useCallback(function (syntheticEvent) {
|
|
@@ -158,18 +159,20 @@ exports.Rating = React.forwardRef(function (directProps, ref) {
|
|
|
158
159
|
}, [props.onKeyDown, dispatchStateValue, value]);
|
|
159
160
|
var handleFocus = React.useCallback(function (syntheticEvent) {
|
|
160
161
|
if (props.onFocus) {
|
|
161
|
-
|
|
162
|
+
var ev = {
|
|
162
163
|
target: target.current,
|
|
163
164
|
syntheticEvent: syntheticEvent
|
|
164
|
-
}
|
|
165
|
+
};
|
|
166
|
+
props.onFocus.call(undefined, ev);
|
|
165
167
|
}
|
|
166
168
|
}, [props.onFocus]);
|
|
167
169
|
var handleBlur = React.useCallback(function (syntheticEvent) {
|
|
168
170
|
if (props.onBlur) {
|
|
169
|
-
|
|
171
|
+
var ev = {
|
|
170
172
|
target: target.current,
|
|
171
173
|
syntheticEvent: syntheticEvent
|
|
172
|
-
}
|
|
174
|
+
};
|
|
175
|
+
props.onBlur.call(undefined, ev);
|
|
173
176
|
}
|
|
174
177
|
}, [props.onBlur]);
|
|
175
178
|
var handleItemMouseMove = React.useCallback(function (event) {
|
|
@@ -178,7 +181,7 @@ exports.Rating = React.forwardRef(function (directProps, ref) {
|
|
|
178
181
|
}
|
|
179
182
|
if (precision === 'half') {
|
|
180
183
|
var rect = event.target.element.getBoundingClientRect();
|
|
181
|
-
var isFirstHalf = utils_1.calcIsFirstHalf(dir ? dir : 'ltr', rect, event.syntheticEvent.clientX);
|
|
184
|
+
var isFirstHalf = (0, utils_1.calcIsFirstHalf)(dir ? dir : 'ltr', rect, event.syntheticEvent.clientX);
|
|
182
185
|
var payload = isFirstHalf ? event.target.value - (step / 2) : event.target.value;
|
|
183
186
|
dispatchStateHover({ type: rating_reducer_1.RATING_ACTION.select, payload: payload, event: event.syntheticEvent });
|
|
184
187
|
}
|
|
@@ -190,38 +193,38 @@ exports.Rating = React.forwardRef(function (directProps, ref) {
|
|
|
190
193
|
dispatchStateHover({ type: rating_reducer_1.RATING_ACTION.reset, event: event.syntheticEvent });
|
|
191
194
|
}, []);
|
|
192
195
|
var items = [];
|
|
193
|
-
var remainder = utils_1.getRemainder(utils_1.toRound(max - min, base), step);
|
|
194
|
-
for (var i = min; i <= max; i = utils_1.toRound(i + step, base)) {
|
|
195
|
-
var itemValue = utils_1.toRound(i + remainder, base);
|
|
196
|
+
var remainder = (0, utils_1.getRemainder)((0, utils_1.toRound)(max - min, base), step);
|
|
197
|
+
for (var i = min; i <= max; i = (0, utils_1.toRound)(i + step, base)) {
|
|
198
|
+
var itemValue = (0, utils_1.toRound)(i + remainder, base);
|
|
196
199
|
var half = precision === 'half'
|
|
197
|
-
? utils_1.isHalf(itemValue, hoveredValue !== null ? hoveredValue : (value !== null ? value : 0), step)
|
|
200
|
+
? (0, utils_1.isHalf)(itemValue, hoveredValue !== null ? hoveredValue : (value !== null ? value : 0), step)
|
|
198
201
|
: false;
|
|
199
|
-
var selectedValue = utils_1.isSelected(itemValue, value, step, selection);
|
|
200
|
-
var selected = utils_1.isSelected(itemValue, hoveredValue !== null ? hoveredValue : value, step, selection);
|
|
201
|
-
var hovered = utils_1.isSelected(itemValue, hoveredValue, step, selection);
|
|
202
|
-
items.push(React.createElement(Item, { key: itemValue, value: itemValue, dir: dir, title: String(half ? utils_1.toRound(itemValue - (step / 2), base) : itemValue), icon: props.icon, half: half, selected: selectedValue || selected, hovered: hovered, onClick: handleItemClick, onMouseMove: handleItemMouseMove, onMouseLeave: handleMouseLeave },
|
|
202
|
+
var selectedValue = (0, utils_1.isSelected)(itemValue, value, step, selection);
|
|
203
|
+
var selected = (0, utils_1.isSelected)(itemValue, hoveredValue !== null ? hoveredValue : value, step, selection);
|
|
204
|
+
var hovered = (0, utils_1.isSelected)(itemValue, hoveredValue, step, selection);
|
|
205
|
+
items.push(React.createElement(Item, { key: itemValue, value: itemValue, dir: dir, title: String(half ? (0, utils_1.toRound)(itemValue - (step / 2), base) : itemValue), icon: props.icon, half: half, selected: selectedValue || selected, hovered: hovered, onClick: handleItemClick, onMouseMove: handleItemMouseMove, onMouseLeave: handleMouseLeave },
|
|
203
206
|
half && (React.createElement("span", { className: 'k-rating-precision-complement', style: (_a = { width: '12px' }, _a[dir === 'rtl' ? 'right' : 'left'] = '50%', _a) },
|
|
204
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-icon', (_b = {
|
|
207
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon', (_b = {
|
|
205
208
|
'k-i-star-outline': !props.icon
|
|
206
209
|
},
|
|
207
|
-
_b[props.icon
|
|
210
|
+
_b["".concat(props.icon, "-outline")] = props.icon,
|
|
208
211
|
_b)) }))),
|
|
209
212
|
half && (React.createElement("span", { className: 'k-rating-precision-part', style: { width: '12px' } },
|
|
210
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-icon', (_c = {
|
|
213
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon', (_c = {
|
|
211
214
|
'k-i-star': !props.icon
|
|
212
215
|
},
|
|
213
|
-
_c[""
|
|
216
|
+
_c["".concat(props.icon)] = props.icon,
|
|
214
217
|
_c)) }))),
|
|
215
218
|
half && (React.createElement("span", { style: { width: '24px', height: '24px', display: 'block' } })),
|
|
216
|
-
!half && (React.createElement("span", { className: kendo_react_common_1.classNames('k-icon', (_d = {
|
|
219
|
+
!half && (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon', (_d = {
|
|
217
220
|
'k-i-star': !props.icon && (hovered || (selected && !hovered)),
|
|
218
221
|
'k-i-star-outline': !props.icon && (!hovered)
|
|
219
222
|
},
|
|
220
|
-
_d[""
|
|
221
|
-
_d[props.icon
|
|
223
|
+
_d["".concat(props.icon)] = props.icon && (hovered || (selected && !hovered)),
|
|
224
|
+
_d["".concat(props.icon, "-outline")] = props.icon && (!hovered),
|
|
222
225
|
_d)) }))));
|
|
223
226
|
}
|
|
224
|
-
return (React.createElement("span", { id: props.id, style: props.style, ref: ratingRef, role: "slider", dir: dir, tabIndex: kendo_react_common_1.getTabIndex(props.tabIndex, props.disabled, undefined), className: kendo_react_common_1.classNames('k-rating k-widget', {
|
|
227
|
+
return (React.createElement("span", { id: props.id, style: props.style, ref: ratingRef, role: "slider", dir: dir, tabIndex: (0, kendo_react_common_1.getTabIndex)(props.tabIndex, props.disabled, undefined), className: (0, kendo_react_common_1.classNames)('k-rating k-widget', {
|
|
225
228
|
'k-rtl': dir === 'rtl',
|
|
226
229
|
'k-state-readonly': readonly,
|
|
227
230
|
'k-disabled': disabled
|
|
@@ -239,10 +242,10 @@ var propTypes = {
|
|
|
239
242
|
value: function (props, propName, componentName) {
|
|
240
243
|
if (props.value && props.min && props.max && props.step) {
|
|
241
244
|
var correctValue = props.precision === 'half'
|
|
242
|
-
? utils_1.isCorrectValue(props.min, props.max, props.step / 2, props.value)
|
|
243
|
-
: utils_1.isCorrectValue(props.min, props.max, props.step, props.value);
|
|
245
|
+
? (0, utils_1.isCorrectValue)(props.min, props.max, props.step / 2, props.value)
|
|
246
|
+
: (0, utils_1.isCorrectValue)(props.min, props.max, props.step, props.value);
|
|
244
247
|
if (!correctValue && props.precision === 'half') {
|
|
245
|
-
return new Error("Invalid prop + "
|
|
248
|
+
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 "));
|
|
246
249
|
}
|
|
247
250
|
}
|
|
248
251
|
return null;
|
|
@@ -252,7 +255,7 @@ var propTypes = {
|
|
|
252
255
|
max: PropTypes.number,
|
|
253
256
|
step: function (props, propName, componentName) {
|
|
254
257
|
if (props.step !== undefined && props.step <= 0) {
|
|
255
|
-
return new Error("Invalid prop + "
|
|
258
|
+
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 "));
|
|
256
259
|
}
|
|
257
260
|
return null;
|
|
258
261
|
},
|
|
@@ -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>>;
|
|
@@ -10,7 +10,7 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
10
10
|
exports.RatingItem = React.forwardRef(function (props, ref) {
|
|
11
11
|
var target = React.useRef(null);
|
|
12
12
|
var element = React.useRef(null);
|
|
13
|
-
var dir = kendo_react_common_1.useDir(element, props.dir);
|
|
13
|
+
var dir = (0, kendo_react_common_1.useDir)(element, props.dir);
|
|
14
14
|
React.useImperativeHandle(target, function () { return ({
|
|
15
15
|
element: element.current,
|
|
16
16
|
props: props,
|
|
@@ -74,7 +74,7 @@ exports.RatingItem = React.forwardRef(function (props, ref) {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
}, [props.onMouseLeave]);
|
|
77
|
-
return (React.createElement("span", { id: props.id, ref: element, dir: dir, "data-half": props.half, tabIndex: props.tabIndex, title: props.title, style: props.style, className: kendo_react_common_1.classNames('k-rating-item', {
|
|
77
|
+
return (React.createElement("span", { id: props.id, ref: element, dir: dir, "data-half": props.half, tabIndex: props.tabIndex, title: props.title, style: props.style, className: (0, kendo_react_common_1.classNames)('k-rating-item', {
|
|
78
78
|
'k-rtl': dir === 'rtl',
|
|
79
79
|
'k-selected': props.selected,
|
|
80
80
|
'k-hover': props.hovered
|
|
@@ -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.
|
|
@@ -29,7 +29,7 @@ var ratingReducer = function (state, action) {
|
|
|
29
29
|
}
|
|
30
30
|
return action.payload >= action.min
|
|
31
31
|
? action.payload < action.max
|
|
32
|
-
? utils_1.toRound(action.payload, action.step)
|
|
32
|
+
? (0, utils_1.toRound)(action.payload, action.step)
|
|
33
33
|
: action.max
|
|
34
34
|
: action.min;
|
|
35
35
|
case RATING_ACTION.deselect:
|
|
@@ -42,14 +42,14 @@ var ratingReducer = function (state, action) {
|
|
|
42
42
|
return action.min;
|
|
43
43
|
}
|
|
44
44
|
return state + action.step < action.max
|
|
45
|
-
? utils_1.toRound(state + action.step, action.step)
|
|
45
|
+
? (0, utils_1.toRound)(state + action.step, action.step)
|
|
46
46
|
: action.max;
|
|
47
47
|
case RATING_ACTION.decrease:
|
|
48
48
|
if (action.step === undefined) {
|
|
49
49
|
return state;
|
|
50
50
|
}
|
|
51
|
-
return utils_1.toRound(state - action.step, action.step) >= action.min
|
|
52
|
-
? utils_1.toRound(state - action.step, action.step)
|
|
51
|
+
return (0, utils_1.toRound)(state - action.step, action.step) >= action.min
|
|
52
|
+
? (0, utils_1.toRound)(state - action.step, action.step)
|
|
53
53
|
: action.min;
|
|
54
54
|
case RATING_ACTION.min:
|
|
55
55
|
if (action.step === undefined) {
|
|
@@ -27,7 +27,7 @@ exports.getRemainder = getRemainder;
|
|
|
27
27
|
* @hidden
|
|
28
28
|
*/
|
|
29
29
|
var isHalf = function (index, value, step) {
|
|
30
|
-
return (exports.toRound(index - step, step) < value) && (value < index);
|
|
30
|
+
return ((0, exports.toRound)(index - step, step) < value) && (value < index);
|
|
31
31
|
};
|
|
32
32
|
exports.isHalf = isHalf;
|
|
33
33
|
/**
|
|
@@ -38,13 +38,13 @@ var isSelected = function (index, value, step, selection) {
|
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
40
40
|
if (selection === 'continues') {
|
|
41
|
-
return exports.isHalf(index, value, step)
|
|
42
|
-
? exports.toRound(index - step / 2, step / 2) <= value
|
|
41
|
+
return (0, exports.isHalf)(index, value, step)
|
|
42
|
+
? (0, exports.toRound)(index - step / 2, step / 2) <= value
|
|
43
43
|
: index <= value;
|
|
44
44
|
}
|
|
45
45
|
if (selection === 'single') {
|
|
46
|
-
return exports.isHalf(index, value, step)
|
|
47
|
-
? exports.toRound(index - step / 2, step / 2) === value
|
|
46
|
+
return (0, exports.isHalf)(index, value, step)
|
|
47
|
+
? (0, exports.toRound)(index - step / 2, step / 2) === value
|
|
48
48
|
: index === value;
|
|
49
49
|
}
|
|
50
50
|
return false;
|
|
@@ -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;
|
|
@@ -49,6 +49,8 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
49
49
|
focused: false,
|
|
50
50
|
dir: _this.props.dir
|
|
51
51
|
};
|
|
52
|
+
_this._sliderTrack = null;
|
|
53
|
+
_this._element = null;
|
|
52
54
|
/**
|
|
53
55
|
* @hidden
|
|
54
56
|
*/
|
|
@@ -139,7 +141,7 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
139
141
|
var percentage = (distance / size);
|
|
140
142
|
_this.change(e, _this.props.min + percentage * (_this.props.max - _this.props.min));
|
|
141
143
|
};
|
|
142
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
144
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
143
145
|
return _this;
|
|
144
146
|
}
|
|
145
147
|
/**
|
|
@@ -169,7 +171,7 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
169
171
|
SliderWithoutContext.prototype.render = function () {
|
|
170
172
|
var _a;
|
|
171
173
|
var _this = this;
|
|
172
|
-
var lS = kendo_react_intl_1.provideLocalizationService(this);
|
|
174
|
+
var lS = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
173
175
|
var percentValue = ((this.state.value - this.props.min) / (this.props.max - this.props.min)) * 100;
|
|
174
176
|
var trackStyles = this.props.vertical
|
|
175
177
|
? { marginTop: '0.5rem', marginBottom: '0.5rem' }
|
|
@@ -177,7 +179,7 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
177
179
|
var sliderItemsStyle = this.props.vertical
|
|
178
180
|
? { paddingTop: 0, height: '100%' }
|
|
179
181
|
: {};
|
|
180
|
-
return (React.createElement("div", { ref: function (el) { return _this._element = el; }, "aria-valuemin": this.props.min, "aria-valuemax": this.props.max, "aria-valuenow": this.state.value, "aria-disabled": this.props.disabled ? 'true' : undefined, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, dir: this.state.dir, role: "slider", id: this.props.id, style: __assign({ gap: 0 }, this.props.style), tabIndex: kendo_react_common_1.getTabIndex(this.props.tabIndex, this.props.disabled, undefined), onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, className: kendo_react_common_1.classNames('k-slider k-widget', {
|
|
182
|
+
return (React.createElement("div", { ref: function (el) { return _this._element = el; }, "aria-valuemin": this.props.min, "aria-valuemax": this.props.max, "aria-valuenow": this.state.value, "aria-disabled": this.props.disabled ? 'true' : undefined, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, dir: this.state.dir, role: "slider", id: this.props.id, style: __assign({ gap: 0 }, this.props.style), tabIndex: (0, kendo_react_common_1.getTabIndex)(this.props.tabIndex, this.props.disabled, undefined), onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, className: (0, kendo_react_common_1.classNames)('k-slider k-widget', {
|
|
181
183
|
'k-focus': this.state.focused,
|
|
182
184
|
'k-disabled': this.props.disabled,
|
|
183
185
|
'k-slider-horizontal': !this.props.vertical,
|
|
@@ -217,7 +219,7 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
217
219
|
SliderWithoutContext.prototype.change = function (e, value) {
|
|
218
220
|
value = Math.min(Math.max(value, this.props.min), this.props.max);
|
|
219
221
|
this.setState({ value: value });
|
|
220
|
-
kendo_react_common_1.dispatchEvent(this.props.onChange, e, this, { value: value });
|
|
222
|
+
(0, kendo_react_common_1.dispatchEvent)(this.props.onChange, e, this, { value: value });
|
|
221
223
|
};
|
|
222
224
|
SliderWithoutContext.displayName = 'Slider';
|
|
223
225
|
/**
|
|
@@ -242,7 +244,7 @@ exports.SliderWithoutContext = SliderWithoutContext;
|
|
|
242
244
|
*
|
|
243
245
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
244
246
|
*/
|
|
245
|
-
exports.SliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
247
|
+
exports.SliderPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
246
248
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
247
249
|
/**
|
|
248
250
|
* Represents the [KendoReact Slider component]({% slug overview_slider %}).
|
|
@@ -250,6 +252,6 @@ exports.SliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
250
252
|
* Accepts properties of type [SliderProps]({% slug api_inputs_sliderprops %}).
|
|
251
253
|
* Obtaining the `ref` returns an object of type [SliderHandle]({% slug api_inputs_sliderhandle %}).
|
|
252
254
|
*/
|
|
253
|
-
exports.Slider = kendo_react_common_1.withPropsContext(exports.SliderPropsContext, SliderWithoutContext);
|
|
255
|
+
exports.Slider = (0, kendo_react_common_1.withPropsContext)(exports.SliderPropsContext, SliderWithoutContext);
|
|
254
256
|
exports.Slider.displayName = 'KendoReactSlider';
|
|
255
|
-
kendo_react_intl_1.registerForLocalization(SliderWithoutContext);
|
|
257
|
+
(0, kendo_react_intl_1.registerForLocalization)(SliderWithoutContext);
|
|
@@ -24,10 +24,10 @@ exports.SLIDER_LABEL_ATTRIBUTE = 'data-slider-label';
|
|
|
24
24
|
var SliderLabel = function (props) {
|
|
25
25
|
var _a, _b;
|
|
26
26
|
var sliderLabelRef = React.useRef(null);
|
|
27
|
-
var dir = kendo_react_common_1.useDir(sliderLabelRef);
|
|
27
|
+
var dir = (0, kendo_react_common_1.useDir)(sliderLabelRef);
|
|
28
28
|
var style = props.vertical
|
|
29
|
-
? { bottom: props.position
|
|
30
|
-
: (_a = {}, _a[dir === 'rtl' ? 'right' : 'left'] = props.position
|
|
29
|
+
? { bottom: "".concat(props.position, "%"), height: '1px', width: '100%' }
|
|
30
|
+
: (_a = {}, _a[dir === 'rtl' ? 'right' : 'left'] = "".concat(props.position, "%"), _a.width = '1px', _a.height = '-webkit-fill-available', _a);
|
|
31
31
|
return (React.createElement("li", { ref: sliderLabelRef, role: "presentation", className: "k-tick k-tick-large", title: props.title, style: __assign({ zIndex: 1, position: 'absolute' }, style) },
|
|
32
32
|
React.createElement("span", __assign({}, (_b = {}, _b[exports.SLIDER_LABEL_ATTRIBUTE] = true, _b), { className: "k-label", onClick: props.onClick }), props.children)));
|
|
33
33
|
};
|
|
@@ -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;
|