@progress/kendo-react-inputs 5.4.0-dev.202205200719 → 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 +9 -7
- package/dist/es/checkbox/interfaces/CheckboxBlurEvent.js +1 -0
- package/dist/es/checkbox/interfaces/CheckboxChangeEvent.js +1 -0
- package/dist/es/checkbox/interfaces/CheckboxFocusEvent.js +1 -0
- package/dist/es/checkbox/interfaces/CheckboxProps.js +1 -0
- package/dist/es/colors/ColorContrastLabels.js +6 -4
- package/dist/es/colors/ColorContrastSvg.js +3 -1
- package/dist/es/colors/ColorGradient.d.ts +3 -3
- package/dist/es/colors/ColorGradient.js +11 -5
- package/dist/es/colors/ColorInput.js +3 -1
- package/dist/es/colors/ColorPalette.d.ts +6 -3
- package/dist/es/colors/ColorPalette.js +15 -6
- 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/HexInput.js +3 -1
- package/dist/es/colors/Picker.js +1 -1
- package/dist/es/colors/interfaces/ColorGradientChangeEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorGradientProps.js +1 -0
- package/dist/es/colors/interfaces/ColorPaletteChangeEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPaletteProps.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerActiveColorClick.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerBlurEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerChangeEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerFocusEvent.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerGradientSettings.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerPaletteSettings.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerPopupSettings.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerProps.js +1 -0
- package/dist/es/colors/interfaces/ColorPickerView.js +1 -0
- package/dist/es/colors/interfaces/PickerPopupSettings.js +1 -0
- package/dist/es/colors/interfaces/PickerProps.js +1 -0
- package/dist/es/colors/models/hsva.js +1 -0
- package/dist/es/colors/models/output-format.js +1 -0
- package/dist/es/colors/models/rgb.js +1 -0
- package/dist/es/colors/models/rgba.js +1 -0
- package/dist/es/colors/models/table-cell.js +1 -0
- package/dist/es/colors/models/tile-size.js +1 -0
- package/dist/es/colors/utils/color-parser.d.ts +1 -1
- package/dist/es/colors/utils/color-parser.js +2 -2
- package/dist/es/colors/utils/misc.d.ts +1 -1
- package/dist/es/colors/utils/svg-calc.js +4 -4
- package/dist/es/common/SliderTooltip.js +3 -3
- package/dist/es/common/SwitchController.d.ts +3 -3
- package/dist/es/common/SwitchController.js +7 -3
- package/dist/es/common/SwitchModel.d.ts +1 -1
- package/dist/es/input/Input.d.ts +5 -5
- package/dist/es/input/Input.js +14 -9
- package/dist/es/input/interfaces/InputChangeEvent.js +1 -0
- package/dist/es/interfaces/Direction.js +1 -0
- package/dist/es/interfaces/ToggleBaseProps.js +1 -0
- package/dist/es/main.js +31 -0
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +15 -15
- package/dist/es/maskedtextbox/MaskedTextBox.js +19 -16
- package/dist/es/maskedtextbox/MaskedTextBoxProps.js +1 -0
- package/dist/es/maskedtextbox/masking.service.d.ts +4 -4
- package/dist/es/maskedtextbox/masking.service.js +4 -4
- package/dist/es/maskedtextbox/parsing/result.js +1 -1
- package/dist/es/messages/index.d.ts +22 -22
- package/dist/es/numerictextbox/NumericTextBox.d.ts +1 -1
- package/dist/es/numerictextbox/NumericTextBox.js +3 -3
- package/dist/es/numerictextbox/interfaces/NumericTextBoxBlurEvent.js +1 -0
- package/dist/es/numerictextbox/interfaces/NumericTextBoxChangeEvent.js +1 -0
- package/dist/es/numerictextbox/interfaces/NumericTextBoxFocusEvent.js +1 -0
- package/dist/es/numerictextbox/interfaces/NumericTextBoxHandle.js +1 -0
- package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.js +1 -0
- package/dist/es/numerictextbox/interfaces/NumericTextBoxState.js +1 -0
- package/dist/es/numerictextbox/utils/index.d.ts +7 -7
- 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 +5 -3
- package/dist/es/radiobutton/RadioGroup.d.ts +1 -1
- package/dist/es/radiobutton/RadioGroup.js +1 -1
- package/dist/es/radiobutton/interfaces/RadioButtonBlurEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioButtonChangeEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioButtonFocusEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioButtonProps.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioGroupChangeEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioGroupFocusEvent.js +1 -0
- package/dist/es/radiobutton/interfaces/RadioGroupProps.js +1 -0
- package/dist/es/range-slider/RangeSlider.d.ts +1 -1
- package/dist/es/range-slider/RangeSlider.js +8 -8
- package/dist/es/range-slider/range-raducer.js +12 -12
- package/dist/es/rating/Rating.d.ts +1 -1
- package/dist/es/rating/Rating.js +16 -13
- package/dist/es/rating/RatingItem.d.ts +1 -1
- package/dist/es/rating/models/index.d.ts +4 -0
- package/dist/es/rating/models/index.js +1 -0
- package/dist/es/rating/utils/index.d.ts +1 -1
- package/dist/es/slider/Slider.d.ts +3 -3
- package/dist/es/slider/Slider.js +7 -3
- package/dist/es/slider/SliderLabel.js +2 -2
- package/dist/es/switch/Switch.d.ts +13 -13
- package/dist/es/switch/Switch.js +18 -13
- package/dist/es/textarea/TextArea.d.ts +1 -1
- package/dist/es/textarea/TextArea.js +9 -7
- package/dist/es/textarea/interfaces/TextAreaBlurEvent.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaChangeEvent.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaFocusEvent.js +1 -0
- package/dist/es/textarea/interfaces/TextAreaProps.js +1 -0
- package/dist/es/utils.js +10 -1
- package/dist/npm/checkbox/Checkbox.d.ts +1 -1
- package/dist/npm/checkbox/Checkbox.js +20 -17
- package/dist/npm/colors/ColorContrastLabels.js +10 -7
- package/dist/npm/colors/ColorContrastSvg.js +10 -7
- package/dist/npm/colors/ColorGradient.d.ts +3 -3
- package/dist/npm/colors/ColorGradient.js +42 -35
- package/dist/npm/colors/ColorInput.js +6 -4
- package/dist/npm/colors/ColorPalette.d.ts +6 -3
- package/dist/npm/colors/ColorPalette.js +25 -15
- package/dist/npm/colors/ColorPicker.d.ts +1 -1
- package/dist/npm/colors/ColorPicker.js +14 -13
- package/dist/npm/colors/FlatColorPicker.d.ts +1 -1
- package/dist/npm/colors/FlatColorPicker.js +28 -26
- package/dist/npm/colors/HexInput.d.ts +1 -1
- package/dist/npm/colors/HexInput.js +6 -4
- package/dist/npm/colors/Picker.js +4 -2
- package/dist/npm/colors/models/palette-presets.js +1 -0
- package/dist/npm/colors/utils/color-cache.js +1 -0
- package/dist/npm/colors/utils/color-palette.service.js +7 -6
- package/dist/npm/colors/utils/color-parser.d.ts +1 -1
- package/dist/npm/colors/utils/color-parser.js +47 -36
- package/dist/npm/colors/utils/misc.d.ts +1 -1
- package/dist/npm/colors/utils/misc.js +6 -3
- package/dist/npm/colors/utils/svg-calc.js +13 -8
- package/dist/npm/common/SliderTooltip.js +7 -5
- package/dist/npm/common/SwitchController.d.ts +3 -3
- package/dist/npm/common/SwitchController.js +7 -3
- package/dist/npm/common/SwitchModel.d.ts +1 -1
- package/dist/npm/input/Input.d.ts +5 -5
- package/dist/npm/input/Input.js +20 -14
- package/dist/npm/main.js +69 -26
- package/dist/npm/maskedtextbox/MaskedTextBox.d.ts +15 -15
- package/dist/npm/maskedtextbox/MaskedTextBox.js +26 -22
- package/dist/npm/maskedtextbox/masking.service.d.ts +4 -4
- package/dist/npm/maskedtextbox/masking.service.js +24 -23
- package/dist/npm/maskedtextbox/parsing/combinators.js +5 -2
- package/dist/npm/maskedtextbox/parsing/parsers.js +15 -7
- package/dist/npm/maskedtextbox/parsing/result.js +2 -1
- package/dist/npm/maskedtextbox/parsing/stream.js +1 -0
- package/dist/npm/maskedtextbox/utils.js +1 -0
- package/dist/npm/messages/index.d.ts +22 -22
- package/dist/npm/messages/index.js +2 -1
- package/dist/npm/numerictextbox/NumericTextBox.d.ts +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +32 -31
- package/dist/npm/numerictextbox/utils/index.d.ts +7 -7
- package/dist/npm/numerictextbox/utils/index.js +117 -88
- package/dist/npm/package-metadata.js +2 -1
- package/dist/npm/radiobutton/RadioButton.d.ts +1 -1
- package/dist/npm/radiobutton/RadioButton.js +15 -12
- package/dist/npm/radiobutton/RadioGroup.d.ts +1 -1
- package/dist/npm/radiobutton/RadioGroup.js +12 -11
- package/dist/npm/range-slider/RangeSlider.d.ts +1 -1
- package/dist/npm/range-slider/RangeSlider.js +18 -17
- package/dist/npm/range-slider/range-raducer.js +15 -13
- package/dist/npm/rating/Rating.d.ts +1 -1
- package/dist/npm/rating/Rating.js +37 -33
- package/dist/npm/rating/RatingItem.d.ts +1 -1
- package/dist/npm/rating/RatingItem.js +3 -2
- package/dist/npm/rating/models/index.d.ts +4 -0
- package/dist/npm/rating/rating-reducer.js +7 -5
- package/dist/npm/rating/utils/index.d.ts +1 -1
- package/dist/npm/rating/utils/index.js +18 -11
- package/dist/npm/slider/Slider.d.ts +3 -3
- package/dist/npm/slider/Slider.js +15 -10
- package/dist/npm/slider/SliderLabel.js +6 -4
- package/dist/npm/switch/Switch.d.ts +13 -13
- package/dist/npm/switch/Switch.js +29 -23
- package/dist/npm/textarea/TextArea.d.ts +1 -1
- package/dist/npm/textarea/TextArea.js +18 -15
- package/dist/npm/utils.js +11 -1
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +15 -15
- package/dist/es/switch/util.d.ts +0 -8
- package/dist/es/switch/util.js +0 -46
- package/dist/npm/switch/util.d.ts +0 -8
- package/dist/npm/switch/util.js +0 -48
|
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Picker = void 0;
|
|
14
15
|
var React = require("react");
|
|
15
16
|
var kendo_react_popup_1 = require("@progress/kendo-react-popup");
|
|
16
17
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -25,7 +26,7 @@ var POPUP_VERTICAL_ALIGN = 'top';
|
|
|
25
26
|
/**
|
|
26
27
|
* @hidden
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
+
var Picker = function (props) {
|
|
29
30
|
var popupSettings = props.popupSettings || {};
|
|
30
31
|
var horizontalAlign = props.dir === 'rtl' ? 'right' : 'left';
|
|
31
32
|
var anchorAlign = React.useMemo(function () { return ({ horizontal: horizontalAlign, vertical: ANCHOR_VERTICAL_ALIGN }); }, [horizontalAlign]);
|
|
@@ -33,6 +34,7 @@ exports.Picker = function (props) {
|
|
|
33
34
|
return (React.createElement(React.Fragment, null,
|
|
34
35
|
props.input,
|
|
35
36
|
props.button,
|
|
36
|
-
React.createElement(kendo_react_popup_1.Popup, __assign({ style: __assign({}, (popupSettings || {}).style, { direction: props.dir }) }, popupSettings, { anchor: props.popupAnchor, anchorAlign: anchorAlign, popupAlign: popupAlign, show: props.open, onOpen: props.onOpen, onClose: props.onClose, className: kendo_react_common_1.classNames('k-reset', popupSettings.className) }), props.content)));
|
|
37
|
+
React.createElement(kendo_react_popup_1.Popup, __assign({ style: __assign(__assign({}, (popupSettings || {}).style), { direction: props.dir }) }, popupSettings, { anchor: props.popupAnchor, anchorAlign: anchorAlign, popupAlign: popupAlign, show: props.open, onOpen: props.onOpen, onClose: props.onClose, className: (0, kendo_react_common_1.classNames)('k-reset', popupSettings.className) }), props.content)));
|
|
37
38
|
};
|
|
39
|
+
exports.Picker = Picker;
|
|
38
40
|
exports.Picker.displayName = 'KendoPickerComponent';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCachedRgba = exports.getCachedHsva = exports.getCachedHex = exports.removeCachedColor = exports.cacheHex = exports.cacheRgba = exports.cacheHsva = void 0;
|
|
3
4
|
var cache = {};
|
|
4
5
|
/**
|
|
5
6
|
* @hidden
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColorPaletteService = void 0;
|
|
3
4
|
var misc_1 = require("./misc");
|
|
4
5
|
var kendo_drawing_1 = require("@progress/kendo-drawing");
|
|
5
6
|
/**
|
|
@@ -11,7 +12,7 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
11
12
|
}
|
|
12
13
|
ColorPaletteService.prototype.setColorMatrix = function (palette, columns) {
|
|
13
14
|
this.colorRows = [];
|
|
14
|
-
if (!(misc_1.isPresent(palette) && palette.length)) {
|
|
15
|
+
if (!((0, misc_1.isPresent)(palette) && palette.length)) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
columns = columns || palette.length;
|
|
@@ -22,12 +23,12 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
22
23
|
};
|
|
23
24
|
ColorPaletteService.prototype.getCellCoordsFor = function (color) {
|
|
24
25
|
var _this = this;
|
|
25
|
-
if (!misc_1.isPresent(color)) {
|
|
26
|
+
if (!(0, misc_1.isPresent)(color)) {
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
var parsedColor = color ? kendo_drawing_1.parseColor(color, true) : color;
|
|
29
|
+
var parsedColor = color ? (0, kendo_drawing_1.parseColor)(color, true) : color;
|
|
29
30
|
var colors = [color];
|
|
30
|
-
if (misc_1.isPresent(parsedColor)) {
|
|
31
|
+
if ((0, misc_1.isPresent)(parsedColor)) {
|
|
31
32
|
colors.push(parsedColor.toCss(), parsedColor.toCssRgba());
|
|
32
33
|
}
|
|
33
34
|
var _loop_1 = function (row) {
|
|
@@ -50,13 +51,13 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
ColorPaletteService.prototype.getColorAt = function (cellCoords) {
|
|
53
|
-
if (!(misc_1.isPresent(cellCoords) && misc_1.isPresent(this.colorRows[cellCoords.row]))) {
|
|
54
|
+
if (!((0, misc_1.isPresent)(cellCoords) && (0, misc_1.isPresent)(this.colorRows[cellCoords.row]))) {
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
57
|
return this.colorRows[cellCoords.row][cellCoords.col];
|
|
57
58
|
};
|
|
58
59
|
ColorPaletteService.prototype.getNextCell = function (current, horizontalStep, verticalStep) {
|
|
59
|
-
if (!(misc_1.isPresent(current) && misc_1.isPresent(current.row) && misc_1.isPresent(current.col))) {
|
|
60
|
+
if (!((0, misc_1.isPresent)(current) && (0, misc_1.isPresent)(current.row) && (0, misc_1.isPresent)(current.col))) {
|
|
60
61
|
return { row: 0, col: 0 };
|
|
61
62
|
}
|
|
62
63
|
var row = this.clampIndex(current.row + verticalStep, this.colorRows.length - 1);
|
|
@@ -7,7 +7,7 @@ import { RGBA } from '../models/rgba';
|
|
|
7
7
|
*
|
|
8
8
|
* Returns the hex or RGBA string representation of the color.
|
|
9
9
|
*/
|
|
10
|
-
export declare const parseColor: (value: string, format: OutputFormat, safe?: boolean) => string;
|
|
10
|
+
export declare const parseColor: (value: string, format: OutputFormat, safe?: boolean) => string | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContrastFromTwoRGBAs = exports.getContrast = exports.getLuminance = exports.getRGBFromRGBA = exports.getColorFromRGBA = exports.getColorFromHue = exports.getColorFromHSV = exports.getRGBA = exports.getHSV = exports.parseColor = void 0;
|
|
3
4
|
var kendo_drawing_1 = require("@progress/kendo-drawing");
|
|
4
5
|
var misc_1 = require("./misc");
|
|
5
6
|
/**
|
|
@@ -7,107 +8,114 @@ var misc_1 = require("./misc");
|
|
|
7
8
|
*
|
|
8
9
|
* Returns the hex or RGBA string representation of the color.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
var parseColor = function (value, format, safe) {
|
|
11
12
|
if (safe === void 0) { safe = true; }
|
|
12
13
|
var allowedFormats = ['hex', 'rgba']; // TODO: constant?
|
|
13
14
|
// Angular supports third type: name : const allowedFormats: Array<string> = ['hex', 'rgba', 'name'];
|
|
14
15
|
if (allowedFormats.indexOf(format) === -1) {
|
|
15
|
-
throw new Error("Unsupported color output format '"
|
|
16
|
+
throw new Error("Unsupported color output format '".concat(format, "'. The available options are 'hex' or 'rgba'."));
|
|
16
17
|
}
|
|
17
|
-
if (!misc_1.isPresent(value)) {
|
|
18
|
+
if (!(0, misc_1.isPresent)(value)) {
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
|
-
var parsedColor = kendo_drawing_1.parseColor(value.trim(), safe);
|
|
21
|
-
if (!misc_1.isPresent(parsedColor)) {
|
|
21
|
+
var parsedColor = (0, kendo_drawing_1.parseColor)(value.trim(), safe);
|
|
22
|
+
if (!(0, misc_1.isPresent)(parsedColor)) {
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
25
|
return format === 'hex' ? parsedColor.toCss() : parsedColor.toCssRgba();
|
|
25
26
|
};
|
|
27
|
+
exports.parseColor = parseColor;
|
|
26
28
|
/**
|
|
27
29
|
* @hidden
|
|
28
30
|
*
|
|
29
31
|
* Returns an HSV object representation of the color string.
|
|
30
32
|
*/
|
|
31
|
-
|
|
33
|
+
var getHSV = function (value, safe) {
|
|
32
34
|
if (safe === void 0) { safe = true; }
|
|
33
|
-
var parsed = kendo_drawing_1.parseColor(value, safe);
|
|
34
|
-
if (!misc_1.isPresent(parsed)) {
|
|
35
|
+
var parsed = (0, kendo_drawing_1.parseColor)(value, safe);
|
|
36
|
+
if (!(0, misc_1.isPresent)(parsed)) {
|
|
35
37
|
return {};
|
|
36
38
|
}
|
|
37
39
|
return parsed.toHSV();
|
|
38
40
|
};
|
|
41
|
+
exports.getHSV = getHSV;
|
|
39
42
|
/**
|
|
40
43
|
* @hidden
|
|
41
44
|
*
|
|
42
45
|
* Returns an RGBA object representation of the color string.
|
|
43
46
|
*/
|
|
44
|
-
|
|
47
|
+
var getRGBA = function (value, safe) {
|
|
45
48
|
if (safe === void 0) { safe = true; }
|
|
46
|
-
var parsed = kendo_drawing_1.parseColor(value, safe);
|
|
47
|
-
if (!misc_1.isPresent(parsed)) {
|
|
49
|
+
var parsed = (0, kendo_drawing_1.parseColor)(value, safe);
|
|
50
|
+
if (!(0, misc_1.isPresent)(parsed)) {
|
|
48
51
|
return {};
|
|
49
52
|
}
|
|
50
53
|
return parsed.toBytes();
|
|
51
54
|
};
|
|
55
|
+
exports.getRGBA = getRGBA;
|
|
52
56
|
/**
|
|
53
57
|
* @hidden
|
|
54
58
|
*
|
|
55
59
|
* Returns the RGBA string representation of the color.
|
|
56
60
|
*/
|
|
57
|
-
|
|
58
|
-
var hue = misc_1.fitIntoBounds(hsva.h, 0, 359.9);
|
|
59
|
-
var saturation = misc_1.fitIntoBounds(hsva.s, 0, 1);
|
|
60
|
-
var value = misc_1.fitIntoBounds(hsva.v, 0, 1);
|
|
61
|
-
var alpha = misc_1.fitIntoBounds(hsva.a, 0, 1);
|
|
61
|
+
var getColorFromHSV = function (hsva) {
|
|
62
|
+
var hue = (0, misc_1.fitIntoBounds)(hsva.h, 0, 359.9);
|
|
63
|
+
var saturation = (0, misc_1.fitIntoBounds)(hsva.s, 0, 1);
|
|
64
|
+
var value = (0, misc_1.fitIntoBounds)(hsva.v, 0, 1);
|
|
65
|
+
var alpha = (0, misc_1.fitIntoBounds)(hsva.a, 0, 1);
|
|
62
66
|
return kendo_drawing_1.Color.fromHSV(hue, saturation, value, alpha).toCssRgba();
|
|
63
67
|
};
|
|
68
|
+
exports.getColorFromHSV = getColorFromHSV;
|
|
64
69
|
/**
|
|
65
70
|
* @hidden
|
|
66
71
|
*
|
|
67
72
|
* Returns the RGBA string representation of the color based on the `hue` and
|
|
68
73
|
* assuming the `value`, `saturation`, and `alpha` have a value of `1`.
|
|
69
74
|
*/
|
|
70
|
-
|
|
71
|
-
return exports.getColorFromHSV({ h: hue, s: 1, v: 1, a: 1 });
|
|
75
|
+
var getColorFromHue = function (hue) {
|
|
76
|
+
return (0, exports.getColorFromHSV)({ h: hue, s: 1, v: 1, a: 1 });
|
|
72
77
|
};
|
|
78
|
+
exports.getColorFromHue = getColorFromHue;
|
|
73
79
|
/**
|
|
74
80
|
* @hidden
|
|
75
81
|
*
|
|
76
82
|
* Returns the RGBA string representation of the color.
|
|
77
83
|
*/
|
|
78
|
-
|
|
79
|
-
var red = misc_1.fitIntoBounds(rgba.r, 0, 255);
|
|
80
|
-
var green = misc_1.fitIntoBounds(rgba.g, 0, 255);
|
|
81
|
-
var blue = misc_1.fitIntoBounds(rgba.b, 0, 255);
|
|
82
|
-
var alpha = misc_1.fitIntoBounds(rgba.a, 0, 1);
|
|
84
|
+
var getColorFromRGBA = function (rgba) {
|
|
85
|
+
var red = (0, misc_1.fitIntoBounds)(rgba.r, 0, 255);
|
|
86
|
+
var green = (0, misc_1.fitIntoBounds)(rgba.g, 0, 255);
|
|
87
|
+
var blue = (0, misc_1.fitIntoBounds)(rgba.b, 0, 255);
|
|
88
|
+
var alpha = (0, misc_1.fitIntoBounds)(rgba.a, 0, 1);
|
|
83
89
|
return kendo_drawing_1.Color.fromBytes(red, green, blue, alpha).toCssRgba();
|
|
84
90
|
};
|
|
91
|
+
exports.getColorFromRGBA = getColorFromRGBA;
|
|
85
92
|
/**
|
|
86
93
|
* @hidden
|
|
87
94
|
*
|
|
88
95
|
* Returns the RGB object representation of the color based on the background color.
|
|
89
96
|
*/
|
|
90
|
-
|
|
91
|
-
var r1 = misc_1.fitIntoBounds(foregroundColor.r, 0, 255);
|
|
92
|
-
var g1 = misc_1.fitIntoBounds(foregroundColor.g, 0, 255);
|
|
93
|
-
var b1 = misc_1.fitIntoBounds(foregroundColor.b, 0, 255);
|
|
94
|
-
var a1 = misc_1.fitIntoBounds(foregroundColor.a, 0, 1);
|
|
95
|
-
var r2 = misc_1.fitIntoBounds(backgroundColor.r, 0, 255);
|
|
96
|
-
var g2 = misc_1.fitIntoBounds(backgroundColor.g, 0, 255);
|
|
97
|
-
var b2 = misc_1.fitIntoBounds(backgroundColor.b, 0, 255);
|
|
97
|
+
var getRGBFromRGBA = function (foregroundColor, backgroundColor) {
|
|
98
|
+
var r1 = (0, misc_1.fitIntoBounds)(foregroundColor.r, 0, 255);
|
|
99
|
+
var g1 = (0, misc_1.fitIntoBounds)(foregroundColor.g, 0, 255);
|
|
100
|
+
var b1 = (0, misc_1.fitIntoBounds)(foregroundColor.b, 0, 255);
|
|
101
|
+
var a1 = (0, misc_1.fitIntoBounds)(foregroundColor.a, 0, 1);
|
|
102
|
+
var r2 = (0, misc_1.fitIntoBounds)(backgroundColor.r, 0, 255);
|
|
103
|
+
var g2 = (0, misc_1.fitIntoBounds)(backgroundColor.g, 0, 255);
|
|
104
|
+
var b2 = (0, misc_1.fitIntoBounds)(backgroundColor.b, 0, 255);
|
|
98
105
|
return {
|
|
99
106
|
r: Math.round(((1 - a1) * r2) + (a1 * r1)),
|
|
100
107
|
g: Math.round(((1 - a1) * g2) + (a1 * g1)),
|
|
101
108
|
b: Math.round(((1 - a1) * b2) + (a1 * b1))
|
|
102
109
|
};
|
|
103
110
|
};
|
|
111
|
+
exports.getRGBFromRGBA = getRGBFromRGBA;
|
|
104
112
|
/**
|
|
105
113
|
* @hidden
|
|
106
114
|
*
|
|
107
115
|
* Returns the relative luminance.
|
|
108
116
|
*/
|
|
109
|
-
|
|
110
|
-
var a = [rgb.r, rgb.g, rgb.b].map(function (v) {
|
|
117
|
+
var getLuminance = function (rgb) {
|
|
118
|
+
var a = [rgb.r || 0, rgb.g || 0, rgb.b || 0].map(function (v) {
|
|
111
119
|
v /= 255;
|
|
112
120
|
return v <= 0.03928
|
|
113
121
|
? v / 12.92
|
|
@@ -115,22 +123,25 @@ exports.getLuminance = function (rgb) {
|
|
|
115
123
|
});
|
|
116
124
|
return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
|
|
117
125
|
};
|
|
126
|
+
exports.getLuminance = getLuminance;
|
|
118
127
|
/**
|
|
119
128
|
* @hidden
|
|
120
129
|
*
|
|
121
130
|
* Returns the color contrast.
|
|
122
131
|
*/
|
|
123
|
-
|
|
132
|
+
var getContrast = function (luminance1, luminance2) {
|
|
124
133
|
var brightest = Math.max(luminance1, luminance2);
|
|
125
134
|
var darkest = Math.min(luminance1, luminance2);
|
|
126
135
|
return (brightest + 0.05)
|
|
127
136
|
/ (darkest + 0.05);
|
|
128
137
|
};
|
|
138
|
+
exports.getContrast = getContrast;
|
|
129
139
|
/**
|
|
130
140
|
* @hidden
|
|
131
141
|
*
|
|
132
142
|
* Returns the color contrast from two RGBA colors.
|
|
133
143
|
*/
|
|
134
|
-
|
|
135
|
-
return exports.getContrast(exports.getLuminance(exports.getRGBFromRGBA(a, b)), exports.getLuminance(exports.getRGBFromRGBA(b, { r: 0, g: 0, b: 0, a: 1 })));
|
|
144
|
+
var getContrastFromTwoRGBAs = function (a, b) {
|
|
145
|
+
return (0, exports.getContrast)((0, exports.getLuminance)((0, exports.getRGBFromRGBA)(a, b)), (0, exports.getLuminance)((0, exports.getRGBFromRGBA)(b, { r: 0, g: 0, b: 0, a: 1 })));
|
|
136
146
|
};
|
|
147
|
+
exports.getContrastFromTwoRGBAs = getContrastFromTwoRGBAs;
|
|
@@ -12,4 +12,4 @@ export declare const isPresent: (value: any) => boolean;
|
|
|
12
12
|
* @param min The inclusive lower bound number.
|
|
13
13
|
* @param max The inclusive upper bound number.
|
|
14
14
|
*/
|
|
15
|
-
export declare const fitIntoBounds: (contender: number, min: number, max: number) => number;
|
|
15
|
+
export declare const fitIntoBounds: (contender: number | undefined, min: number, max: number) => number;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fitIntoBounds = exports.isPresent = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
var isPresent = function (value) { return value !== null && value !== undefined; };
|
|
8
|
+
exports.isPresent = isPresent;
|
|
7
9
|
/**
|
|
8
10
|
* @hidden
|
|
9
11
|
*
|
|
@@ -14,9 +16,10 @@ exports.isPresent = function (value) { return value !== null && value !== undefi
|
|
|
14
16
|
* @param min The inclusive lower bound number.
|
|
15
17
|
* @param max The inclusive upper bound number.
|
|
16
18
|
*/
|
|
17
|
-
|
|
18
|
-
if (!exports.isPresent(contender) || isNaN(contender)) {
|
|
19
|
+
var fitIntoBounds = function (contender, min, max) {
|
|
20
|
+
if (!(0, exports.isPresent)(contender) || isNaN(contender)) {
|
|
19
21
|
return min;
|
|
20
22
|
}
|
|
21
23
|
return contender <= min ? min : contender >= max ? max : contender;
|
|
22
24
|
};
|
|
25
|
+
exports.fitIntoBounds = fitIntoBounds;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bezierCommand = exports.controlPoint = exports.line = exports.svgPath = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*
|
|
@@ -13,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
14
|
* @output (string) a svg path command.
|
|
14
15
|
* @output (string) a Svg <path> element
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
var svgPath = function (points, command) {
|
|
17
18
|
if (points.length === 0) {
|
|
18
19
|
return '';
|
|
19
20
|
}
|
|
@@ -21,12 +22,13 @@ exports.svgPath = function (points, command) {
|
|
|
21
22
|
var d = points.reduce(function (acc, point, i, a) {
|
|
22
23
|
return i === 0 ?
|
|
23
24
|
// if first point
|
|
24
|
-
"M "
|
|
25
|
+
"M ".concat(point[0], ",").concat(point[1]) :
|
|
25
26
|
// else
|
|
26
|
-
acc
|
|
27
|
+
"".concat(acc, " ").concat(command(point, i, a));
|
|
27
28
|
}, '');
|
|
28
|
-
return "<path d=\""
|
|
29
|
+
return "<path d=\"".concat(d, "\" fill=\"none\" stroke=\"white\" stroke-width=\"1\"/>");
|
|
29
30
|
};
|
|
31
|
+
exports.svgPath = svgPath;
|
|
30
32
|
/**
|
|
31
33
|
* @hidden
|
|
32
34
|
*
|
|
@@ -36,7 +38,7 @@ exports.svgPath = function (points, command) {
|
|
|
36
38
|
* @param pointB (array) [x,y] Represents the end point coordinates.
|
|
37
39
|
* @output (object) { length: (integer), angle: (integer) }
|
|
38
40
|
*/
|
|
39
|
-
|
|
41
|
+
var line = function (pointA, pointB) {
|
|
40
42
|
var lengthX = pointB[0] - pointA[0];
|
|
41
43
|
var lengthY = pointB[1] - pointA[1];
|
|
42
44
|
return {
|
|
@@ -44,6 +46,7 @@ exports.line = function (pointA, pointB) {
|
|
|
44
46
|
angle: Math.atan2(lengthY, lengthX)
|
|
45
47
|
};
|
|
46
48
|
};
|
|
49
|
+
exports.line = line;
|
|
47
50
|
/**
|
|
48
51
|
* @hidden
|
|
49
52
|
*
|
|
@@ -60,7 +63,7 @@ exports.line = function (pointA, pointB) {
|
|
|
60
63
|
* @param reverse (boolean, optional) Sets the direction.
|
|
61
64
|
* @output (array) [x, y] coordinates of a control point.
|
|
62
65
|
*/
|
|
63
|
-
|
|
66
|
+
var controlPoint = function (lineCalc) {
|
|
64
67
|
return function (current, previous, next, reverse) {
|
|
65
68
|
// when 'current' is the first or last point of the array
|
|
66
69
|
// 'previous' and 'next' are undefined
|
|
@@ -79,6 +82,7 @@ exports.controlPoint = function (lineCalc) {
|
|
|
79
82
|
return [x, y];
|
|
80
83
|
};
|
|
81
84
|
};
|
|
85
|
+
exports.controlPoint = controlPoint;
|
|
82
86
|
/**
|
|
83
87
|
* @hidden
|
|
84
88
|
*
|
|
@@ -96,10 +100,11 @@ exports.controlPoint = function (lineCalc) {
|
|
|
96
100
|
* @param a (array) Represents the complete array of points coordinates.
|
|
97
101
|
* @output (string) 'C x2,y2 x1,y1 x,y' Cubic bezier command.
|
|
98
102
|
*/
|
|
99
|
-
|
|
103
|
+
var bezierCommand = function (controlPointCalc) { return function (point, i, a) {
|
|
100
104
|
// start control point
|
|
101
105
|
var _a = controlPointCalc(a[i - 1], a[i - 2], point), cpsX = _a[0], cpsY = _a[1];
|
|
102
106
|
// end control point
|
|
103
107
|
var _b = controlPointCalc(point, a[i - 1], a[i + 1], true), cpeX = _b[0], cpeY = _b[1];
|
|
104
|
-
return "C "
|
|
108
|
+
return "C ".concat(cpsX, ",").concat(cpsY, " ").concat(cpeX, ",").concat(cpeY, " ").concat(point[0], ",").concat(point[1]);
|
|
105
109
|
}; };
|
|
110
|
+
exports.bezierCommand = bezierCommand;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SliderTooltip = void 0;
|
|
3
4
|
var React = require("react");
|
|
4
5
|
var kendo_react_animation_1 = require("@progress/kendo-react-animation");
|
|
5
6
|
/**
|
|
6
7
|
* @hidden
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
var SliderTooltip = function (props) {
|
|
9
10
|
var tooltipRef = React.useRef(null);
|
|
10
11
|
var position = function () {
|
|
11
12
|
if (props.anchor && props.anchor.current && tooltipRef.current) {
|
|
@@ -17,8 +18,8 @@ exports.SliderTooltip = function (props) {
|
|
|
17
18
|
var top_1 = props.position === 'right'
|
|
18
19
|
? (anchorRect.height / 2) - (rect.height / 2)
|
|
19
20
|
: -(rect.height * 1.5);
|
|
20
|
-
tooltipRef.current.style.left = left
|
|
21
|
-
tooltipRef.current.style.top = top_1
|
|
21
|
+
tooltipRef.current.style.left = "".concat(left, "px");
|
|
22
|
+
tooltipRef.current.style.top = "".concat(top_1, "px");
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
var handleAnimationStart = function () {
|
|
@@ -37,10 +38,10 @@ exports.SliderTooltip = function (props) {
|
|
|
37
38
|
if (!tooltipRef.current) {
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
|
-
tooltipRef.current.style.opacity = ""
|
|
41
|
+
tooltipRef.current.style.opacity = "".concat(props.show ? progress : 1 - progress);
|
|
41
42
|
};
|
|
42
43
|
React.useEffect(position);
|
|
43
|
-
kendo_react_animation_1.useAnimation({
|
|
44
|
+
(0, kendo_react_animation_1.useAnimation)({
|
|
44
45
|
appear: true,
|
|
45
46
|
duration: 300,
|
|
46
47
|
onStart: handleAnimationStart,
|
|
@@ -50,3 +51,4 @@ exports.SliderTooltip = function (props) {
|
|
|
50
51
|
return (React.createElement("div", { ref: tooltipRef, className: "k-tooltip", style: { position: 'absolute' } },
|
|
51
52
|
React.createElement("div", { className: "k-tooltip-content" }, props.children)));
|
|
52
53
|
};
|
|
54
|
+
exports.SliderTooltip = SliderTooltip;
|
|
@@ -18,14 +18,14 @@ declare class SwitchController {
|
|
|
18
18
|
overrideChecked: (checked: boolean) => void;
|
|
19
19
|
updateState({ wrapperOffset, handleOffset, checked, animate, coords, handleMargin, reverse }: any): void;
|
|
20
20
|
change: (checked: boolean, event?: any) => void;
|
|
21
|
-
|
|
21
|
+
get isChecked(): boolean;
|
|
22
22
|
addAnimation: (model: any) => any;
|
|
23
23
|
onPress: (event: any) => void;
|
|
24
24
|
onRelease: (event: any) => void;
|
|
25
25
|
onDrag: (event: any) => void;
|
|
26
26
|
updateModel(position: any, animate?: boolean): SwitchModel;
|
|
27
27
|
private limit;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
get constrain(): number;
|
|
29
|
+
get checked(): boolean;
|
|
30
30
|
}
|
|
31
31
|
export default SwitchController;
|
|
@@ -17,6 +17,10 @@ var SwitchController = /** @class */ (function () {
|
|
|
17
17
|
if (updateView === void 0) { updateView = noop; }
|
|
18
18
|
if (onChange === void 0) { onChange = noop; }
|
|
19
19
|
var _this = this;
|
|
20
|
+
this._checked = false;
|
|
21
|
+
this.reverse = false;
|
|
22
|
+
this.lastPressX = 0;
|
|
23
|
+
this.originalPressX = 0;
|
|
20
24
|
this.overrideChecked = function (checked) {
|
|
21
25
|
_this._checked = checked;
|
|
22
26
|
};
|
|
@@ -93,7 +97,7 @@ var SwitchController = /** @class */ (function () {
|
|
|
93
97
|
get: function () {
|
|
94
98
|
return this._checked;
|
|
95
99
|
},
|
|
96
|
-
enumerable:
|
|
100
|
+
enumerable: false,
|
|
97
101
|
configurable: true
|
|
98
102
|
});
|
|
99
103
|
SwitchController.prototype.updateModel = function (position, animate) {
|
|
@@ -105,14 +109,14 @@ var SwitchController = /** @class */ (function () {
|
|
|
105
109
|
get: function () {
|
|
106
110
|
return this.wrapperOffset - this.handleOffset - this.handleMargin;
|
|
107
111
|
},
|
|
108
|
-
enumerable:
|
|
112
|
+
enumerable: false,
|
|
109
113
|
configurable: true
|
|
110
114
|
});
|
|
111
115
|
Object.defineProperty(SwitchController.prototype, "checked", {
|
|
112
116
|
get: function () {
|
|
113
117
|
return this._checked;
|
|
114
118
|
},
|
|
115
|
-
enumerable:
|
|
119
|
+
enumerable: false,
|
|
116
120
|
configurable: true
|
|
117
121
|
});
|
|
118
122
|
return SwitchController;
|
|
@@ -77,23 +77,23 @@ export declare class InputWithoutContext extends React.Component<InputProps, Inp
|
|
|
77
77
|
/**
|
|
78
78
|
* Gets the native input element of the Input component.
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
get element(): HTMLInputElement | null;
|
|
81
81
|
/**
|
|
82
82
|
* Gets the value of the Input.
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
get value(): string | string[] | number | undefined;
|
|
85
85
|
/**
|
|
86
86
|
* Gets the `name` property of the Input.
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
get name(): string | undefined;
|
|
89
89
|
/**
|
|
90
90
|
* Represents the validity state into which the Input is set.
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
get validity(): FormComponentValidity;
|
|
93
93
|
/**
|
|
94
94
|
* @hidden
|
|
95
95
|
*/
|
|
96
|
-
protected
|
|
96
|
+
protected get validityStyles(): boolean;
|
|
97
97
|
/**
|
|
98
98
|
* @hidden
|
|
99
99
|
*/
|
package/dist/npm/input/Input.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -28,11 +30,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
28
30
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
29
31
|
t[p] = s[p];
|
|
30
32
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
31
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
32
|
-
|
|
33
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
34
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35
|
+
t[p[i]] = s[p[i]];
|
|
36
|
+
}
|
|
33
37
|
return t;
|
|
34
38
|
};
|
|
35
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.Input = exports.InputPropsContext = exports.InputWithoutContext = void 0;
|
|
36
41
|
var React = require("react");
|
|
37
42
|
var PropTypes = require("prop-types");
|
|
38
43
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -44,7 +49,8 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
44
49
|
__extends(InputWithoutContext, _super);
|
|
45
50
|
function InputWithoutContext(props) {
|
|
46
51
|
var _this = _super.call(this, props) || this;
|
|
47
|
-
_this.
|
|
52
|
+
_this._input = null;
|
|
53
|
+
_this._inputId = (0, kendo_react_common_1.guid)();
|
|
48
54
|
/**
|
|
49
55
|
* @hidden
|
|
50
56
|
*/
|
|
@@ -101,7 +107,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
109
|
};
|
|
104
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
110
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
105
111
|
_this.state = {
|
|
106
112
|
value: _this.props.defaultValue || InputWithoutContext.defaultProps.defaultValue
|
|
107
113
|
};
|
|
@@ -114,7 +120,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
114
120
|
get: function () {
|
|
115
121
|
return this._input;
|
|
116
122
|
},
|
|
117
|
-
enumerable:
|
|
123
|
+
enumerable: false,
|
|
118
124
|
configurable: true
|
|
119
125
|
});
|
|
120
126
|
Object.defineProperty(InputWithoutContext.prototype, "value", {
|
|
@@ -128,7 +134,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
128
134
|
? this.props.value
|
|
129
135
|
: this.state.value;
|
|
130
136
|
},
|
|
131
|
-
enumerable:
|
|
137
|
+
enumerable: false,
|
|
132
138
|
configurable: true
|
|
133
139
|
});
|
|
134
140
|
Object.defineProperty(InputWithoutContext.prototype, "name", {
|
|
@@ -138,7 +144,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
138
144
|
get: function () {
|
|
139
145
|
return this.props.name;
|
|
140
146
|
},
|
|
141
|
-
enumerable:
|
|
147
|
+
enumerable: false,
|
|
142
148
|
configurable: true
|
|
143
149
|
});
|
|
144
150
|
Object.defineProperty(InputWithoutContext.prototype, "validity", {
|
|
@@ -158,13 +164,13 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
158
164
|
typeMismatch: this._input ? this._input.validity.typeMismatch : false,
|
|
159
165
|
valueMissing: this._input ? this._input.validity.valueMissing : false
|
|
160
166
|
};
|
|
161
|
-
return __assign({}, result, { customError: this.props.validationMessage !== undefined, valid: this.props.valid !== undefined
|
|
167
|
+
return __assign(__assign({}, result), { customError: this.props.validationMessage !== undefined, valid: this.props.valid !== undefined
|
|
162
168
|
? this.props.valid
|
|
163
169
|
: this._input
|
|
164
170
|
? !this.isInvalid(result)
|
|
165
171
|
: true });
|
|
166
172
|
},
|
|
167
|
-
enumerable:
|
|
173
|
+
enumerable: false,
|
|
168
174
|
configurable: true
|
|
169
175
|
});
|
|
170
176
|
Object.defineProperty(InputWithoutContext.prototype, "validityStyles", {
|
|
@@ -176,7 +182,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
176
182
|
? this.props.validityStyles
|
|
177
183
|
: InputWithoutContext.defaultProps.validityStyles;
|
|
178
184
|
},
|
|
179
|
-
enumerable:
|
|
185
|
+
enumerable: false,
|
|
180
186
|
configurable: true
|
|
181
187
|
});
|
|
182
188
|
/**
|
|
@@ -201,7 +207,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
201
207
|
visited = _a.visited, touched = _a.touched, modified = _a.modified, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy, validityStyles = _a.validityStyles, style = _a.style, props = __rest(_a, ["className", "label", "id", "validationMessage", "defaultValue", "valid", "visited", "touched", "modified", "ariaLabelledBy", "ariaDescribedBy", "validityStyles", "style"]);
|
|
202
208
|
var inputId = id || this._inputId;
|
|
203
209
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
204
|
-
var inputClassName = kendo_react_common_1.classNames(className, 'k-input k-input-md k-rounded-md k-input-solid');
|
|
210
|
+
var inputClassName = (0, kendo_react_common_1.classNames)(className, 'k-input k-input-md k-rounded-md k-input-solid');
|
|
205
211
|
var textbox = (React.createElement("input", __assign({ "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }, props, { style: !label
|
|
206
212
|
? style
|
|
207
213
|
: undefined, value: this.value, id: inputId, className: inputClassName, onChange: this.handleChange, onAnimationStart: this.handleAutoFill, ref: function (el) {
|
|
@@ -241,7 +247,7 @@ exports.InputWithoutContext = InputWithoutContext;
|
|
|
241
247
|
*
|
|
242
248
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
243
249
|
*/
|
|
244
|
-
exports.InputPropsContext = kendo_react_common_1.createPropsContext();
|
|
250
|
+
exports.InputPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
245
251
|
;
|
|
246
252
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
247
253
|
/**
|
|
@@ -250,5 +256,5 @@ exports.InputPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
250
256
|
* Accepts properties of type [InputProps]({% slug api_inputs_inputprops %}).
|
|
251
257
|
* Obtaining the `ref` returns an object of type [InputHandle]({% slug api_inputs_inputhandle %}).
|
|
252
258
|
*/
|
|
253
|
-
exports.Input = kendo_react_common_1.withPropsContext(exports.InputPropsContext, InputWithoutContext);
|
|
259
|
+
exports.Input = (0, kendo_react_common_1.withPropsContext)(exports.InputPropsContext, InputWithoutContext);
|
|
254
260
|
exports.Input.displayName = 'KendoReactInput';
|