@progress/kendo-react-inputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206061009
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 +1 -0
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +7 -7
- package/dist/es/maskedtextbox/MaskedTextBox.js +7 -6
- 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.js +4 -4
- 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 +6 -5
- 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/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.js +60 -60
- 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
|
@@ -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>>;
|
|
@@ -145,8 +145,8 @@ export var Checkbox = React.forwardRef(function (directProps, target) {
|
|
|
145
145
|
var dir = useDir(elementRef, props.dir);
|
|
146
146
|
var checkboxClasses = classNames({ 'k-disabled': disabled }, className);
|
|
147
147
|
var inputProps = __assign(__assign({ type: 'checkbox', className: classNames('k-checkbox', (_a = {},
|
|
148
|
-
_a["k-checkbox-"
|
|
149
|
-
_a["k-rounded-"
|
|
148
|
+
_a["k-checkbox-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
149
|
+
_a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
150
150
|
_a['k-indeterminate'] = indeterminateProp,
|
|
151
151
|
_a['k-invalid k-invalid'] = !(isValid || validityStyles !== undefined || validityStyles === true),
|
|
152
152
|
_a)), ref: elementRef, name: name, id: id || calculatedId, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, checked: Boolean(checkedProp), disabled: disabled, tabIndex: getTabIndex(tabIndex, disabled), role: 'checkbox', required: required !== undefined ? required : false, 'aria-checked': currentChecked || checkedProp ?
|
|
@@ -35,9 +35,9 @@ var ColorContrastLabels = /** @class */ (function (_super) {
|
|
|
35
35
|
var contrast = getContrastFromTwoRGBAs(this.props.rgba, this.props.bgColor);
|
|
36
36
|
var requiredAAContrast = (4.5).toFixed(1);
|
|
37
37
|
var requiredAAAContrast = (7.0).toFixed(1);
|
|
38
|
-
var contrastText = contrastRatioMessage
|
|
39
|
-
var aaText = AALevelMessage
|
|
40
|
-
var aaaText = AAALevelMessage
|
|
38
|
+
var contrastText = "".concat(contrastRatioMessage, ": ").concat(contrast.toFixed(2));
|
|
39
|
+
var aaText = "".concat(AALevelMessage, ": ").concat(requiredAAContrast);
|
|
40
|
+
var aaaText = "".concat(AAALevelMessage, ": ").concat(requiredAAAContrast);
|
|
41
41
|
var success = (React.createElement("span", { className: "k-contrast-validation k-text-success" },
|
|
42
42
|
passMessage,
|
|
43
43
|
" ",
|
|
@@ -32,6 +32,10 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
32
32
|
__extends(ColorGradientWithoutContext, _super);
|
|
33
33
|
function ColorGradientWithoutContext(props) {
|
|
34
34
|
var _this = _super.call(this, props) || this;
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
_this.wrapper = null;
|
|
35
39
|
/**
|
|
36
40
|
* @hidden
|
|
37
41
|
*/
|
|
@@ -164,8 +168,8 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
164
168
|
var gradientRectMetrics = this.getGradientRectMetrics();
|
|
165
169
|
var top_1 = (1 - this.state.hsva.v) * gradientRectMetrics.height;
|
|
166
170
|
var left = this.state.hsva.s * gradientRectMetrics.width;
|
|
167
|
-
style.top = top_1
|
|
168
|
-
style.left = left
|
|
171
|
+
style.top = "".concat(top_1, "px");
|
|
172
|
+
style.left = "".concat(left, "px");
|
|
169
173
|
}
|
|
170
174
|
return React.createElement("div", { className: "k-hsv-draghandle k-draghandle", style: style });
|
|
171
175
|
};
|
|
@@ -210,7 +214,7 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
210
214
|
*/
|
|
211
215
|
ColorGradientWithoutContext.prototype.setAlphaSliderBackground = function (backgroundColor) {
|
|
212
216
|
if (this.props.opacity && this.alphaSlider && this.alphaSlider.sliderTrack) {
|
|
213
|
-
this.alphaSlider.sliderTrack.style.background = "linear-gradient(to top, transparent, "
|
|
217
|
+
this.alphaSlider.sliderTrack.style.background = "linear-gradient(to top, transparent, ".concat(backgroundColor, ")");
|
|
214
218
|
}
|
|
215
219
|
};
|
|
216
220
|
Object.defineProperty(ColorGradientWithoutContext.prototype, "isUncontrolled", {
|
|
@@ -67,12 +67,15 @@ export declare class ColorPaletteWithoutContext extends React.Component<ColorPal
|
|
|
67
67
|
* @hidden
|
|
68
68
|
*/
|
|
69
69
|
static getDerivedStateFromProps(props: ColorPaletteProps, state: ColorPaletteState): {
|
|
70
|
+
selectedColor: undefined;
|
|
71
|
+
isFirstRender?: undefined;
|
|
72
|
+
} | {
|
|
70
73
|
selectedColor: string;
|
|
71
74
|
isFirstRender?: undefined;
|
|
72
75
|
} | {
|
|
73
76
|
isFirstRender: boolean;
|
|
74
77
|
selectedColor?: undefined;
|
|
75
|
-
};
|
|
78
|
+
} | null;
|
|
76
79
|
private onKeyDown;
|
|
77
80
|
private onColorClick;
|
|
78
81
|
private onFocus;
|
|
@@ -43,6 +43,7 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
43
43
|
* @hidden
|
|
44
44
|
*/
|
|
45
45
|
_this.wrapper = null;
|
|
46
|
+
_this.paletteService = null;
|
|
46
47
|
_this.guid = guid();
|
|
47
48
|
/**
|
|
48
49
|
* @hidden
|
|
@@ -83,9 +84,12 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
83
84
|
_this.dispatchChangeEvent(color, event);
|
|
84
85
|
};
|
|
85
86
|
_this.onFocus = function (nativeEvent) {
|
|
87
|
+
if (!_this.paletteService) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
86
90
|
_this.setState({ focusedColor: _this.state.selectedColor || _this.paletteService.colorRows[0][0] });
|
|
87
91
|
if (_this.props.onFocus) {
|
|
88
|
-
_this.props.onFocus.call(undefined,
|
|
92
|
+
_this.props.onFocus.call(undefined, nativeEvent);
|
|
89
93
|
}
|
|
90
94
|
};
|
|
91
95
|
_this.onBlur = function () {
|
|
@@ -142,6 +146,9 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
142
146
|
return null;
|
|
143
147
|
};
|
|
144
148
|
ColorPaletteWithoutContext.prototype.handleCellNavigation = function (horizontalStep, verticalStep) {
|
|
149
|
+
if (!this.paletteService) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
145
152
|
if (this.focusedColorCooridanates) {
|
|
146
153
|
var newCoords = this.paletteService.getNextCell(this.focusedColorCooridanates, horizontalStep, verticalStep);
|
|
147
154
|
this.setState({ focusedColor: this.paletteService.getColorAt(newCoords) });
|
|
@@ -161,7 +168,7 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
161
168
|
};
|
|
162
169
|
Object.defineProperty(ColorPaletteWithoutContext.prototype, "focusedColorCooridanates", {
|
|
163
170
|
get: function () {
|
|
164
|
-
return this.state.focusedColor ? this.paletteService.getCellCoordsFor(this.state.focusedColor) : undefined;
|
|
171
|
+
return this.state.focusedColor && this.paletteService ? this.paletteService.getCellCoordsFor(this.state.focusedColor) : undefined;
|
|
165
172
|
},
|
|
166
173
|
enumerable: false,
|
|
167
174
|
configurable: true
|
|
@@ -216,7 +223,7 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
216
223
|
});
|
|
217
224
|
};
|
|
218
225
|
ColorPaletteWithoutContext.prototype.createCellId = function (cellCoords) {
|
|
219
|
-
return this.guid
|
|
226
|
+
return "".concat(this.guid, "_").concat(cellCoords.row, "_").concat(cellCoords.col);
|
|
220
227
|
};
|
|
221
228
|
ColorPaletteWithoutContext.displayName = 'ColorPalette';
|
|
222
229
|
/**
|
|
@@ -26,4 +26,4 @@ export declare const ColorPickerPropsContext: React.Context<(p: ColorPickerProps
|
|
|
26
26
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
export declare const ColorPicker: React.ForwardRefExoticComponent<ColorPickerProps & React.RefAttributes<ColorPickerHandle>>;
|
|
29
|
+
export declare const ColorPicker: React.ForwardRefExoticComponent<ColorPickerProps & React.RefAttributes<ColorPickerHandle | null>>;
|
|
@@ -197,9 +197,9 @@ export var ColorPicker = React.forwardRef(function (directProps, target) {
|
|
|
197
197
|
var dir = useDir(focusableElementRef, props.dir);
|
|
198
198
|
var isValid = valid !== false;
|
|
199
199
|
return (React.createElement("span", { id: props.id, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, className: classNames('k-colorpicker', 'k-picker', 'k-icon-picker', (_a = {},
|
|
200
|
-
_a["k-picker-"
|
|
201
|
-
_a["k-picker-"
|
|
202
|
-
_a["k-rounded-"
|
|
200
|
+
_a["k-picker-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
201
|
+
_a["k-picker-".concat(fillMode)] = fillMode,
|
|
202
|
+
_a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
203
203
|
_a['k-invalid'] = !isValid,
|
|
204
204
|
_a['k-disabled'] = disabled,
|
|
205
205
|
_a['k-focus'] = focused,
|
|
@@ -210,7 +210,7 @@ export var ColorPicker = React.forwardRef(function (directProps, target) {
|
|
|
210
210
|
'k-icon-color-preview': (icon || iconClassName)
|
|
211
211
|
}) },
|
|
212
212
|
(iconClassName || icon) && React.createElement("span", { className: classNames('k-color-preview-icon', iconClassName, (_b = {},
|
|
213
|
-
_b["k-icon k-i-"
|
|
213
|
+
_b["k-icon k-i-".concat(icon)] = (icon && !iconClassName),
|
|
214
214
|
_b)) }),
|
|
215
215
|
React.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: value } })))), button: (React.createElement(Button, { tabIndex: -1, type: "button", onClick: onClickHandler, className: "k-input-button", rounded: null, icon: 'arrow-s', "aria-label": localization.toLanguageString(colorPickerDropdownButtonAriaLabel, messages[colorPickerDropdownButtonAriaLabel]) })), content: (React.createElement(React.Fragment, null,
|
|
216
216
|
(view === 'combo' || view === 'gradient') && (React.createElement(ColorGradient, __assign({}, gradientSettings, { tabIndex: 0, ref: gradientRef, value: value, onChange: onChangeHandler }))),
|
|
@@ -68,4 +68,4 @@ export interface FlatColorPickerHandle {
|
|
|
68
68
|
/**
|
|
69
69
|
* Represents the FlatColorPicker component.
|
|
70
70
|
*/
|
|
71
|
-
export declare const FlatColorPicker: React.ForwardRefExoticComponent<FlatColorPickerProps & React.RefAttributes<FlatColorPickerHandle>>;
|
|
71
|
+
export declare const FlatColorPicker: React.ForwardRefExoticComponent<FlatColorPickerProps & React.RefAttributes<FlatColorPickerHandle | null>>;
|
|
@@ -60,30 +60,31 @@ export var FlatColorPicker = React.forwardRef(function (props, ref) {
|
|
|
60
60
|
return (React.createElement("div", { id: props.id, style: props.style, ref: flatColorPickerRef, tabIndex: getTabIndex(props.tabIndex, props.disabled), className: classNames('k-flatcolorpicker k-coloreditor', {
|
|
61
61
|
'k-disabled': props.disabled
|
|
62
62
|
}, props.className), onBlur: handleFlatColorPickerBlur },
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
React.createElement("div", { className: "k-coloreditor-header
|
|
66
|
-
React.createElement(
|
|
67
|
-
React.createElement(
|
|
68
|
-
React.createElement(
|
|
69
|
-
|
|
70
|
-
React.createElement(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
React.createElement(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
React.createElement("
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
React.createElement(
|
|
86
|
-
|
|
63
|
+
React.createElement(React.Fragment, null,
|
|
64
|
+
props.header ||
|
|
65
|
+
React.createElement("div", { className: "k-coloreditor-header k-hstack" },
|
|
66
|
+
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
67
|
+
React.createElement(ButtonGroup, null,
|
|
68
|
+
React.createElement(Button, { type: "button", togglable: true, fillMode: 'flat', selected: colorGradientView, onClick: function () { return handleViewChange('ColorGradient'); } },
|
|
69
|
+
React.createElement("span", { className: "k-icon k-i-color-canvas" })),
|
|
70
|
+
React.createElement(Button, { type: "button", togglable: true, fillMode: 'flat', selected: !colorGradientView, onClick: function () { return handleViewChange('ColorPalette'); } },
|
|
71
|
+
React.createElement("span", { className: "k-icon k-i-palette" })))),
|
|
72
|
+
React.createElement("div", { className: "k-spacer" }),
|
|
73
|
+
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
74
|
+
(props.showClearButton && defaultProps.showClearButton) &&
|
|
75
|
+
React.createElement(Button, { type: "button", fillMode: 'flat', onClick: handleResetColor },
|
|
76
|
+
React.createElement("span", { className: "k-icon k-i-reset-color" })),
|
|
77
|
+
(props.showPreview && defaultProps.showPreview) &&
|
|
78
|
+
React.createElement("div", { className: "k-coloreditor-preview k-vstack" },
|
|
79
|
+
React.createElement("span", { className: "k-coloreditor-preview-color k-color-preview", style: { background: colorValue } }),
|
|
80
|
+
React.createElement("span", { className: "k-coloreditor-current-color k-color-preview", style: { background: prevColor }, onClick: handlePrevColorClick })))),
|
|
81
|
+
React.createElement("div", { className: "k-coloreditor-views k-vstack" }, colorGradientView
|
|
82
|
+
? React.createElement(ColorGradient, { ref: colorGradientRef, value: colorValue, onChange: handleColorChange, onFocus: handleFocus })
|
|
83
|
+
: React.createElement(ColorPalette, { value: colorValue, onChange: handleColorChange, onFocus: handleFocus })),
|
|
84
|
+
(props.showButtons && defaultProps.showButtons) &&
|
|
85
|
+
React.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-end" },
|
|
86
|
+
React.createElement(Button, { type: "button", className: "k-coloreditor-cancel", onClick: handleCancelBtnClick }, messages[flatColorPickerCancelBtn]),
|
|
87
|
+
React.createElement(Button, { type: "button", className: "k-coloreditor-apply k-primary", onClick: handleApplyBtnClick }, messages[flatColorPickerApplyBtn])))));
|
|
87
88
|
});
|
|
88
89
|
var propTypes = {
|
|
89
90
|
id: PropTypes.string,
|
|
@@ -23,7 +23,7 @@ export default class HexInput extends React.Component<HexInputProps, HexInputSta
|
|
|
23
23
|
static getDerivedStateFromProps(props: HexInputProps, state: HexInputState): {
|
|
24
24
|
hex: string;
|
|
25
25
|
originalHex: string;
|
|
26
|
-
};
|
|
26
|
+
} | null;
|
|
27
27
|
private onChange;
|
|
28
28
|
private onBlur;
|
|
29
29
|
}
|
|
@@ -10,7 +10,7 @@ export var parseColor = function (value, format, safe) {
|
|
|
10
10
|
var allowedFormats = ['hex', 'rgba']; // TODO: constant?
|
|
11
11
|
// Angular supports third type: name : const allowedFormats: Array<string> = ['hex', 'rgba', 'name'];
|
|
12
12
|
if (allowedFormats.indexOf(format) === -1) {
|
|
13
|
-
throw new Error("Unsupported color output format '"
|
|
13
|
+
throw new Error("Unsupported color output format '".concat(format, "'. The available options are 'hex' or 'rgba'."));
|
|
14
14
|
}
|
|
15
15
|
if (!isPresent(value)) {
|
|
16
16
|
return;
|
|
@@ -105,7 +105,7 @@ export var getRGBFromRGBA = function (foregroundColor, backgroundColor) {
|
|
|
105
105
|
* Returns the relative luminance.
|
|
106
106
|
*/
|
|
107
107
|
export var getLuminance = function (rgb) {
|
|
108
|
-
var a = [rgb.r, rgb.g, rgb.b].map(function (v) {
|
|
108
|
+
var a = [rgb.r || 0, rgb.g || 0, rgb.b || 0].map(function (v) {
|
|
109
109
|
v /= 255;
|
|
110
110
|
return v <= 0.03928
|
|
111
111
|
? v / 12.92
|
|
@@ -19,11 +19,11 @@ export var svgPath = function (points, command) {
|
|
|
19
19
|
var d = points.reduce(function (acc, point, i, a) {
|
|
20
20
|
return i === 0 ?
|
|
21
21
|
// if first point
|
|
22
|
-
"M "
|
|
22
|
+
"M ".concat(point[0], ",").concat(point[1]) :
|
|
23
23
|
// else
|
|
24
|
-
acc
|
|
24
|
+
"".concat(acc, " ").concat(command(point, i, a));
|
|
25
25
|
}, '');
|
|
26
|
-
return "<path d=\""
|
|
26
|
+
return "<path d=\"".concat(d, "\" fill=\"none\" stroke=\"white\" stroke-width=\"1\"/>");
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* @hidden
|
|
@@ -99,5 +99,5 @@ export var bezierCommand = function (controlPointCalc) { return function (point,
|
|
|
99
99
|
var _a = controlPointCalc(a[i - 1], a[i - 2], point), cpsX = _a[0], cpsY = _a[1];
|
|
100
100
|
// end control point
|
|
101
101
|
var _b = controlPointCalc(point, a[i - 1], a[i + 1], true), cpeX = _b[0], cpeY = _b[1];
|
|
102
|
-
return "C "
|
|
102
|
+
return "C ".concat(cpsX, ",").concat(cpsY, " ").concat(cpeX, ",").concat(cpeY, " ").concat(point[0], ",").concat(point[1]);
|
|
103
103
|
}; };
|
|
@@ -15,8 +15,8 @@ export var SliderTooltip = function (props) {
|
|
|
15
15
|
var top_1 = props.position === 'right'
|
|
16
16
|
? (anchorRect.height / 2) - (rect.height / 2)
|
|
17
17
|
: -(rect.height * 1.5);
|
|
18
|
-
tooltipRef.current.style.left = left
|
|
19
|
-
tooltipRef.current.style.top = top_1
|
|
18
|
+
tooltipRef.current.style.left = "".concat(left, "px");
|
|
19
|
+
tooltipRef.current.style.top = "".concat(top_1, "px");
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
var handleAnimationStart = function () {
|
|
@@ -35,7 +35,7 @@ export var SliderTooltip = function (props) {
|
|
|
35
35
|
if (!tooltipRef.current) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
tooltipRef.current.style.opacity = ""
|
|
38
|
+
tooltipRef.current.style.opacity = "".concat(props.show ? progress : 1 - progress);
|
|
39
39
|
};
|
|
40
40
|
React.useEffect(position);
|
|
41
41
|
useAnimation({
|
|
@@ -12,9 +12,13 @@ var noop = function () { };
|
|
|
12
12
|
*/
|
|
13
13
|
var SwitchController = /** @class */ (function () {
|
|
14
14
|
function SwitchController(updateView, onChange) {
|
|
15
|
-
var _this = this;
|
|
16
15
|
if (updateView === void 0) { updateView = noop; }
|
|
17
16
|
if (onChange === void 0) { onChange = noop; }
|
|
17
|
+
var _this = this;
|
|
18
|
+
this._checked = false;
|
|
19
|
+
this.reverse = false;
|
|
20
|
+
this.lastPressX = 0;
|
|
21
|
+
this.originalPressX = 0;
|
|
18
22
|
this.overrideChecked = function (checked) {
|
|
19
23
|
_this._checked = checked;
|
|
20
24
|
};
|
package/dist/es/input/Input.js
CHANGED
|
@@ -46,6 +46,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
46
46
|
__extends(InputWithoutContext, _super);
|
|
47
47
|
function InputWithoutContext(props) {
|
|
48
48
|
var _this = _super.call(this, props) || this;
|
|
49
|
+
_this._input = null;
|
|
49
50
|
_this._inputId = guid();
|
|
50
51
|
/**
|
|
51
52
|
* @hidden
|
|
@@ -36,7 +36,7 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
36
36
|
includeLiterals: PropTypes.Requireable<boolean>;
|
|
37
37
|
maskValidation: PropTypes.Requireable<boolean>;
|
|
38
38
|
mask: PropTypes.Requireable<string>;
|
|
39
|
-
rules: (props: MaskedTextBoxProps, propName: string, componentName: string) => Error;
|
|
39
|
+
rules: (props: MaskedTextBoxProps, propName: string, componentName: string) => Error | null;
|
|
40
40
|
selection: PropTypes.Requireable<PropTypes.InferProps<{
|
|
41
41
|
start: PropTypes.Validator<number>;
|
|
42
42
|
end: PropTypes.Validator<number>;
|
|
@@ -48,9 +48,9 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
48
48
|
valid: PropTypes.Requireable<boolean>;
|
|
49
49
|
validityStyles: PropTypes.Requireable<boolean>;
|
|
50
50
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
|
-
size: PropTypes.Requireable<"small" | "medium" | "large">;
|
|
52
|
-
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large">;
|
|
53
|
-
fillMode: PropTypes.Requireable<"flat" | "
|
|
51
|
+
size: PropTypes.Requireable<"small" | "medium" | "large" | null | undefined>;
|
|
52
|
+
rounded: PropTypes.Requireable<"small" | "medium" | "full" | "large" | null | undefined>;
|
|
53
|
+
fillMode: PropTypes.Requireable<"flat" | "outline" | "solid" | null | undefined>;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* @hidden
|
|
@@ -65,9 +65,9 @@ export declare class MaskedTextBoxWithoutContext extends React.Component<MaskedT
|
|
|
65
65
|
};
|
|
66
66
|
required: boolean;
|
|
67
67
|
validityStyles: boolean;
|
|
68
|
-
size: "small" | "medium" | "large";
|
|
69
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
70
|
-
fillMode: "flat" | "
|
|
68
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
69
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
70
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
71
71
|
};
|
|
72
72
|
/**
|
|
73
73
|
* @hidden
|
|
@@ -41,7 +41,7 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
41
41
|
* @hidden
|
|
42
42
|
*/
|
|
43
43
|
_this.state = {};
|
|
44
|
-
_this._inputId = "k-"
|
|
44
|
+
_this._inputId = "k-".concat(guid());
|
|
45
45
|
_this._service = new MaskingService();
|
|
46
46
|
_this._isPasted = false;
|
|
47
47
|
_this._selection = [null, null];
|
|
@@ -286,9 +286,9 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
286
286
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
287
287
|
var style = this.props.style || {};
|
|
288
288
|
var component = (React.createElement("span", { dir: this.props.dir, className: classNames('k-maskedtextbox k-input', (_a = {},
|
|
289
|
-
_a["k-input-"
|
|
290
|
-
_a["k-input-"
|
|
291
|
-
_a["k-rounded-"
|
|
289
|
+
_a["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
290
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
291
|
+
_a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
292
292
|
_a['k-invalid'] = !isValid,
|
|
293
293
|
_a['k-required'] = this.required,
|
|
294
294
|
_a['k-disabled'] = this.props.disabled,
|
|
@@ -305,14 +305,15 @@ var MaskedTextBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
305
305
|
});
|
|
306
306
|
if (this.props.onChange) {
|
|
307
307
|
this._valueDuringOnChange = maskedValue;
|
|
308
|
-
|
|
308
|
+
var ev = {
|
|
309
309
|
syntheticEvent: event,
|
|
310
310
|
nativeEvent: event.nativeEvent,
|
|
311
311
|
selectionStart: this._selection[0],
|
|
312
312
|
selectionEnd: this._selection[1],
|
|
313
313
|
target: this,
|
|
314
314
|
value: this.value
|
|
315
|
-
}
|
|
315
|
+
};
|
|
316
|
+
this.props.onChange.call(undefined, ev);
|
|
316
317
|
this._valueDuringOnChange = undefined;
|
|
317
318
|
}
|
|
318
319
|
};
|
|
@@ -32,7 +32,7 @@ var Result = /** @class */ (function () {
|
|
|
32
32
|
return this.map(function (vs, _) { return r.chain(function (v, __) { return vs.concat([v]); }); });
|
|
33
33
|
};
|
|
34
34
|
Result.prototype.toString = function () {
|
|
35
|
-
return "Result({ value: '"
|
|
35
|
+
return "Result({ value: '".concat(this.value, "', rest: ").concat(this.rest, " })");
|
|
36
36
|
};
|
|
37
37
|
return Result;
|
|
38
38
|
}());
|
|
@@ -11,4 +11,4 @@ export declare const NumericTextBoxPropsContext: React.Context<(p: NumericTextBo
|
|
|
11
11
|
/**
|
|
12
12
|
* Represents the [KendoReact NumericTextBox component]({% slug overview_numerictextbox %}).
|
|
13
13
|
*/
|
|
14
|
-
export declare const NumericTextBox: React.ForwardRefExoticComponent<NumericTextBoxProps & React.RefAttributes<NumericTextBoxHandle>>;
|
|
14
|
+
export declare const NumericTextBox: React.ForwardRefExoticComponent<NumericTextBoxProps & React.RefAttributes<NumericTextBoxHandle | null>>;
|
|
@@ -261,9 +261,9 @@ export var NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
261
261
|
var isValid = !validityStylesGetter() || validityGetter().valid;
|
|
262
262
|
var numerictextbox = (React.createElement("span", { dir: props.dir, style: !props.label
|
|
263
263
|
? __assign({ width: props.width }, props.style) : props.style, className: classNames('k-input', 'k-numerictextbox', (_a = {},
|
|
264
|
-
_a["k-input-"
|
|
265
|
-
_a["k-input-"
|
|
266
|
-
_a["k-rounded-"
|
|
264
|
+
_a["k-input-".concat(kendoThemeMaps.sizeMap[props.size] || props.size)] = props.size,
|
|
265
|
+
_a["k-input-".concat(props.fillMode)] = props.fillMode,
|
|
266
|
+
_a["k-rounded-".concat(kendoThemeMaps.roundedMap[props.rounded] || props.rounded)] = props.rounded,
|
|
267
267
|
_a['k-invalid'] = !isValid,
|
|
268
268
|
_a['k-required'] = props.required,
|
|
269
269
|
_a['k-disabled'] = props.disabled,
|
|
@@ -233,7 +233,7 @@ export var getFormatSymbols = function (format, intlService) {
|
|
|
233
233
|
var zeroResult = intlService.formatNumber(ZERO_NUMBER, format);
|
|
234
234
|
var oneResult = intlService.formatNumber(ONE_NUMBER, format);
|
|
235
235
|
var symbols = intlService.numberSymbols();
|
|
236
|
-
var sanitizeRegex = new RegExp("[\\d\\"
|
|
236
|
+
var sanitizeRegex = new RegExp("[\\d\\".concat(symbols.decimal).concat(symbols.group, "]"), 'g');
|
|
237
237
|
var resultWithDuplicates = [positiveResult, negativeResult, zeroResult, oneResult]
|
|
238
238
|
.map(function (result) { return result.replace(sanitizeRegex, ''); })
|
|
239
239
|
.join('');
|
|
@@ -327,9 +327,9 @@ export var sanitizeNumber = function (state, format, intlService) {
|
|
|
327
327
|
var restrictedSymbols = getFormatSymbols(format, intlService);
|
|
328
328
|
var currentLooseValueAsString = String(newState.currentLooseValue);
|
|
329
329
|
var prevLooseValueAsString = String(prevLooseValue);
|
|
330
|
-
var sanitizeRegex = new RegExp("[^\\d\\"
|
|
331
|
-
var sanitizeGroupRegex = new RegExp("[^\\d\\"
|
|
332
|
-
var allSymbolsRegex = new RegExp("[\\d\\"
|
|
330
|
+
var sanitizeRegex = new RegExp("[^\\d\\".concat(symbols.decimal, "]"), 'g');
|
|
331
|
+
var sanitizeGroupRegex = new RegExp("[^\\d\\".concat(symbols.decimal, "\\").concat(symbols.group, "]"), 'g');
|
|
332
|
+
var allSymbolsRegex = new RegExp("[\\d\\".concat(symbols.decimal, "\\").concat(symbols.group, "]"));
|
|
333
333
|
var sanitizedString = currentLooseValueAsString.replace(sanitizeRegex, '');
|
|
334
334
|
var numberStart = getFirstNumberIndex(currentLooseValueAsString, DIGITS_REGEX);
|
|
335
335
|
var numberEnd = numberStart === -1 ? -1 : getLastNumberIndex(currentLooseValueAsString, DIGITS_REGEX);
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-inputs',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1654509130,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -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-"
|
|
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
|
|
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 + "
|
|
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 + "
|
|
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 + "
|
|
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 + "
|
|
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 + "
|
|
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 + "
|
|
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>>;
|