@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
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCorrectValue = exports.calcIsFirstHalf = exports.isSelected = exports.isHalf = exports.getRemainder = exports.toRound = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
var toRound = function (num, base) {
|
|
7
8
|
if (num % 1) {
|
|
8
9
|
var percent = Math.pow(10, (base.toString().split('.')[1] || base.toString().split('.')[0]).length);
|
|
9
10
|
return Math.round(num * percent) / percent;
|
|
10
11
|
}
|
|
11
12
|
return num;
|
|
12
13
|
};
|
|
14
|
+
exports.toRound = toRound;
|
|
13
15
|
// Opting out of JS `modulo` calculation due to floating-point problems in JS
|
|
14
16
|
// We're looking for the reminder - R.
|
|
15
17
|
// x / y = a + R
|
|
@@ -19,44 +21,48 @@ exports.toRound = function (num, base) {
|
|
|
19
21
|
/**
|
|
20
22
|
* @hidden
|
|
21
23
|
*/
|
|
22
|
-
|
|
24
|
+
var getRemainder = function (x, y) { return x - (y * Math.floor(x / y)); };
|
|
25
|
+
exports.getRemainder = getRemainder;
|
|
23
26
|
/**
|
|
24
27
|
* @hidden
|
|
25
28
|
*/
|
|
26
|
-
|
|
27
|
-
return (exports.toRound(index - step, step) < value) && (value < index);
|
|
29
|
+
var isHalf = function (index, value, step) {
|
|
30
|
+
return ((0, exports.toRound)(index - step, step) < value) && (value < index);
|
|
28
31
|
};
|
|
32
|
+
exports.isHalf = isHalf;
|
|
29
33
|
/**
|
|
30
34
|
* @hidden
|
|
31
35
|
*/
|
|
32
|
-
|
|
36
|
+
var isSelected = function (index, value, step, selection) {
|
|
33
37
|
if (value === null) {
|
|
34
38
|
return false;
|
|
35
39
|
}
|
|
36
40
|
if (selection === 'continues') {
|
|
37
|
-
return exports.isHalf(index, value, step)
|
|
38
|
-
? 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
|
|
39
43
|
: index <= value;
|
|
40
44
|
}
|
|
41
45
|
if (selection === 'single') {
|
|
42
|
-
return exports.isHalf(index, value, step)
|
|
43
|
-
? 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
|
|
44
48
|
: index === value;
|
|
45
49
|
}
|
|
46
50
|
return false;
|
|
47
51
|
};
|
|
52
|
+
exports.isSelected = isSelected;
|
|
48
53
|
/**
|
|
49
54
|
* @hidden
|
|
50
55
|
*/
|
|
51
|
-
|
|
56
|
+
var calcIsFirstHalf = function (dir, rect, clientX) {
|
|
52
57
|
return dir === 'ltr'
|
|
53
58
|
? clientX < (rect.x + (rect.width / 2))
|
|
54
59
|
: clientX > (rect.x + (rect.width / 2));
|
|
55
60
|
};
|
|
61
|
+
exports.calcIsFirstHalf = calcIsFirstHalf;
|
|
56
62
|
/**
|
|
57
63
|
* @hidden
|
|
58
64
|
*/
|
|
59
|
-
|
|
65
|
+
var isCorrectValue = function (min, max, step, value) {
|
|
60
66
|
for (var i = min; i <= max; i += step) {
|
|
61
67
|
if (value === i) {
|
|
62
68
|
return true;
|
|
@@ -64,3 +70,4 @@ exports.isCorrectValue = function (min, max, step, value) {
|
|
|
64
70
|
}
|
|
65
71
|
return false;
|
|
66
72
|
};
|
|
73
|
+
exports.isCorrectValue = isCorrectValue;
|
|
@@ -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;
|
|
@@ -152,7 +152,7 @@ export declare class SliderWithoutContext extends React.Component<SliderProps, S
|
|
|
152
152
|
/**
|
|
153
153
|
* @hidden
|
|
154
154
|
*/
|
|
155
|
-
|
|
155
|
+
get sliderTrack(): HTMLDivElement | null;
|
|
156
156
|
private isLabel;
|
|
157
157
|
private onFocus;
|
|
158
158
|
private onBlur;
|
|
@@ -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 __());
|
|
@@ -24,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
26
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Slider = exports.SliderPropsContext = exports.SliderWithoutContext = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var PropTypes = require("prop-types");
|
|
29
32
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -46,6 +49,8 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
46
49
|
focused: false,
|
|
47
50
|
dir: _this.props.dir
|
|
48
51
|
};
|
|
52
|
+
_this._sliderTrack = null;
|
|
53
|
+
_this._element = null;
|
|
49
54
|
/**
|
|
50
55
|
* @hidden
|
|
51
56
|
*/
|
|
@@ -136,7 +141,7 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
136
141
|
var percentage = (distance / size);
|
|
137
142
|
_this.change(e, _this.props.min + percentage * (_this.props.max - _this.props.min));
|
|
138
143
|
};
|
|
139
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
144
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
140
145
|
return _this;
|
|
141
146
|
}
|
|
142
147
|
/**
|
|
@@ -164,9 +169,9 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
164
169
|
* @hidden
|
|
165
170
|
*/
|
|
166
171
|
SliderWithoutContext.prototype.render = function () {
|
|
167
|
-
var _this = this;
|
|
168
172
|
var _a;
|
|
169
|
-
var
|
|
173
|
+
var _this = this;
|
|
174
|
+
var lS = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
170
175
|
var percentValue = ((this.state.value - this.props.min) / (this.props.max - this.props.min)) * 100;
|
|
171
176
|
var trackStyles = this.props.vertical
|
|
172
177
|
? { marginTop: '0.5rem', marginBottom: '0.5rem' }
|
|
@@ -174,7 +179,7 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
174
179
|
var sliderItemsStyle = this.props.vertical
|
|
175
180
|
? { paddingTop: 0, height: '100%' }
|
|
176
181
|
: {};
|
|
177
|
-
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', {
|
|
178
183
|
'k-focus': this.state.focused,
|
|
179
184
|
'k-disabled': this.props.disabled,
|
|
180
185
|
'k-slider-horizontal': !this.props.vertical,
|
|
@@ -208,13 +213,13 @@ var SliderWithoutContext = /** @class */ (function (_super) {
|
|
|
208
213
|
get: function () {
|
|
209
214
|
return this._sliderTrack;
|
|
210
215
|
},
|
|
211
|
-
enumerable:
|
|
216
|
+
enumerable: false,
|
|
212
217
|
configurable: true
|
|
213
218
|
});
|
|
214
219
|
SliderWithoutContext.prototype.change = function (e, value) {
|
|
215
220
|
value = Math.min(Math.max(value, this.props.min), this.props.max);
|
|
216
221
|
this.setState({ value: value });
|
|
217
|
-
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 });
|
|
218
223
|
};
|
|
219
224
|
SliderWithoutContext.displayName = 'Slider';
|
|
220
225
|
/**
|
|
@@ -239,7 +244,7 @@ exports.SliderWithoutContext = SliderWithoutContext;
|
|
|
239
244
|
*
|
|
240
245
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
241
246
|
*/
|
|
242
|
-
exports.SliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
247
|
+
exports.SliderPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
243
248
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
244
249
|
/**
|
|
245
250
|
* Represents the [KendoReact Slider component]({% slug overview_slider %}).
|
|
@@ -247,6 +252,6 @@ exports.SliderPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
247
252
|
* Accepts properties of type [SliderProps]({% slug api_inputs_sliderprops %}).
|
|
248
253
|
* Obtaining the `ref` returns an object of type [SliderHandle]({% slug api_inputs_sliderhandle %}).
|
|
249
254
|
*/
|
|
250
|
-
exports.Slider = kendo_react_common_1.withPropsContext(exports.SliderPropsContext, SliderWithoutContext);
|
|
255
|
+
exports.Slider = (0, kendo_react_common_1.withPropsContext)(exports.SliderPropsContext, SliderWithoutContext);
|
|
251
256
|
exports.Slider.displayName = 'KendoReactSlider';
|
|
252
|
-
kendo_react_intl_1.registerForLocalization(SliderWithoutContext);
|
|
257
|
+
(0, kendo_react_intl_1.registerForLocalization)(SliderWithoutContext);
|
|
@@ -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.SliderLabel = exports.SLIDER_LABEL_ATTRIBUTE = void 0;
|
|
14
15
|
var React = require("react");
|
|
15
16
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
16
17
|
/**
|
|
@@ -20,13 +21,14 @@ exports.SLIDER_LABEL_ATTRIBUTE = 'data-slider-label';
|
|
|
20
21
|
/**
|
|
21
22
|
* Represents the KendoReact SliderLabel component.
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
var SliderLabel = function (props) {
|
|
24
25
|
var _a, _b;
|
|
25
26
|
var sliderLabelRef = React.useRef(null);
|
|
26
|
-
var dir = kendo_react_common_1.useDir(sliderLabelRef);
|
|
27
|
+
var dir = (0, kendo_react_common_1.useDir)(sliderLabelRef);
|
|
27
28
|
var style = props.vertical
|
|
28
|
-
? { bottom: props.position
|
|
29
|
-
: (_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);
|
|
30
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) },
|
|
31
32
|
React.createElement("span", __assign({}, (_b = {}, _b[exports.SLIDER_LABEL_ATTRIBUTE] = true, _b), { className: "k-label", onClick: props.onClick }), props.children)));
|
|
32
33
|
};
|
|
34
|
+
exports.SliderLabel = SliderLabel;
|
|
@@ -137,28 +137,28 @@ export declare class SwitchWithoutContext extends React.Component<SwitchProps, S
|
|
|
137
137
|
/**
|
|
138
138
|
* Gets the value of the Switch.
|
|
139
139
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
get value(): boolean;
|
|
141
|
+
get element(): HTMLSpanElement | null;
|
|
142
142
|
/**
|
|
143
143
|
* @hidden
|
|
144
144
|
*/
|
|
145
|
-
|
|
145
|
+
get actionElement(): HTMLSpanElement | null;
|
|
146
146
|
/**
|
|
147
147
|
* Gets the `name` property of the Switch.
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
get name(): string | undefined;
|
|
150
150
|
/**
|
|
151
151
|
* Represents the validity state into which the Switch is set.
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
get validity(): FormComponentValidity;
|
|
154
154
|
/**
|
|
155
155
|
* @hidden
|
|
156
156
|
*/
|
|
157
|
-
protected
|
|
157
|
+
protected get validityStyles(): boolean;
|
|
158
158
|
/**
|
|
159
159
|
* @hidden
|
|
160
160
|
*/
|
|
161
|
-
protected
|
|
161
|
+
protected get required(): boolean;
|
|
162
162
|
/**
|
|
163
163
|
* @hidden
|
|
164
164
|
*/
|
|
@@ -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" | "
|
|
179
|
-
thumbRounded: PropTypes.Requireable<"small" | "medium" | "
|
|
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" | "
|
|
203
|
-
thumbRounded: "small" | "medium" | "
|
|
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;
|
|
@@ -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 __());
|
|
@@ -24,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
26
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Switch = exports.SwitchPropsContext = exports.SwitchWithoutContext = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var PropTypes = require("prop-types");
|
|
29
32
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -64,11 +67,14 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
64
67
|
_this.toggle = function (value, event) {
|
|
65
68
|
_this.setState({ checked: value });
|
|
66
69
|
_this.valueDuringOnChange = value;
|
|
67
|
-
kendo_react_common_1.dispatchEvent(_this.props.onChange, event, _this, { value: value });
|
|
70
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onChange, event, _this, { value: value });
|
|
68
71
|
_this.valueDuringOnChange = undefined;
|
|
69
72
|
};
|
|
70
|
-
_this.
|
|
71
|
-
_this.
|
|
73
|
+
_this._element = null;
|
|
74
|
+
_this._wrapper = null;
|
|
75
|
+
_this._input = null;
|
|
76
|
+
_this._id = (0, kendo_react_common_1.guid)();
|
|
77
|
+
_this.defaultValidationMessage = (0, kendo_react_intl_1.provideLocalizationService)(_this);
|
|
72
78
|
/**
|
|
73
79
|
* @hidden
|
|
74
80
|
*/
|
|
@@ -120,7 +126,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
120
126
|
onBlur.call(undefined, event);
|
|
121
127
|
}
|
|
122
128
|
};
|
|
123
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
129
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
124
130
|
_this.state = {
|
|
125
131
|
checked: props.defaultChecked || SwitchWithoutContext.defaultProps.defaultChecked,
|
|
126
132
|
focused: false
|
|
@@ -138,14 +144,14 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
138
144
|
? this.props.checked
|
|
139
145
|
: this.state.checked;
|
|
140
146
|
},
|
|
141
|
-
enumerable:
|
|
147
|
+
enumerable: false,
|
|
142
148
|
configurable: true
|
|
143
149
|
});
|
|
144
150
|
Object.defineProperty(SwitchWithoutContext.prototype, "element", {
|
|
145
151
|
get: function () {
|
|
146
152
|
return this._element;
|
|
147
153
|
},
|
|
148
|
-
enumerable:
|
|
154
|
+
enumerable: false,
|
|
149
155
|
configurable: true
|
|
150
156
|
});
|
|
151
157
|
Object.defineProperty(SwitchWithoutContext.prototype, "actionElement", {
|
|
@@ -155,7 +161,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
155
161
|
get: function () {
|
|
156
162
|
return this._wrapper;
|
|
157
163
|
},
|
|
158
|
-
enumerable:
|
|
164
|
+
enumerable: false,
|
|
159
165
|
configurable: true
|
|
160
166
|
});
|
|
161
167
|
Object.defineProperty(SwitchWithoutContext.prototype, "name", {
|
|
@@ -165,7 +171,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
165
171
|
get: function () {
|
|
166
172
|
return this.props.name;
|
|
167
173
|
},
|
|
168
|
-
enumerable:
|
|
174
|
+
enumerable: false,
|
|
169
175
|
configurable: true
|
|
170
176
|
});
|
|
171
177
|
Object.defineProperty(SwitchWithoutContext.prototype, "validity", {
|
|
@@ -186,7 +192,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
186
192
|
valueMissing: this.value === null
|
|
187
193
|
};
|
|
188
194
|
},
|
|
189
|
-
enumerable:
|
|
195
|
+
enumerable: false,
|
|
190
196
|
configurable: true
|
|
191
197
|
});
|
|
192
198
|
Object.defineProperty(SwitchWithoutContext.prototype, "validityStyles", {
|
|
@@ -198,7 +204,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
198
204
|
? this.props.validityStyles
|
|
199
205
|
: SwitchWithoutContext.defaultProps.validityStyles;
|
|
200
206
|
},
|
|
201
|
-
enumerable:
|
|
207
|
+
enumerable: false,
|
|
202
208
|
configurable: true
|
|
203
209
|
});
|
|
204
210
|
Object.defineProperty(SwitchWithoutContext.prototype, "required", {
|
|
@@ -210,7 +216,7 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
210
216
|
? this.props.required
|
|
211
217
|
: SwitchWithoutContext.defaultProps.required;
|
|
212
218
|
},
|
|
213
|
-
enumerable:
|
|
219
|
+
enumerable: false,
|
|
214
220
|
configurable: true
|
|
215
221
|
});
|
|
216
222
|
/**
|
|
@@ -231,15 +237,15 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
231
237
|
* @hidden
|
|
232
238
|
*/
|
|
233
239
|
SwitchWithoutContext.prototype.render = function () {
|
|
234
|
-
var _this = this;
|
|
235
240
|
var _a, _b, _c;
|
|
241
|
+
var _this = this;
|
|
236
242
|
var focused = this.state.focused;
|
|
237
243
|
var _d = this.props, dir = _d.dir, disabled = _d.disabled, trackRounded = _d.trackRounded, thumbRounded = _d.thumbRounded, size = _d.size, id = _d.id, offLabel = _d.offLabel, onLabel = _d.onLabel, tabIndex = _d.tabIndex;
|
|
238
244
|
this.dir = dir || (this._wrapper && getComputedStyle(this._wrapper).direction) || undefined;
|
|
239
245
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
240
|
-
var switchClassName = kendo_react_common_1.classNames('k-switch', (_a = {},
|
|
241
|
-
_a["k-switch-"
|
|
242
|
-
_a["k-rounded-"
|
|
246
|
+
var switchClassName = (0, kendo_react_common_1.classNames)('k-switch', (_a = {},
|
|
247
|
+
_a["k-switch-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
248
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
|
|
243
249
|
_a['k-switch-on'] = this.value,
|
|
244
250
|
_a['k-switch-off'] = !this.value,
|
|
245
251
|
_a['k-focus'] = focused,
|
|
@@ -253,17 +259,17 @@ var SwitchWithoutContext = /** @class */ (function (_super) {
|
|
|
253
259
|
return (React.createElement("span", { ref: function (span) {
|
|
254
260
|
_this._wrapper = span;
|
|
255
261
|
}, className: switchClassName, dir: this.dir, onKeyDown: this.handleKeyDown, onClick: this.handleClick, onBlur: this.handleWrapperBlur, onFocus: this.handleWrapperFocus },
|
|
256
|
-
React.createElement("span", __assign({ className: kendo_react_common_1.classNames('k-switch-track', (_b = {},
|
|
257
|
-
_b["k-rounded-"
|
|
262
|
+
React.createElement("span", __assign({ className: (0, kendo_react_common_1.classNames)('k-switch-track', (_b = {},
|
|
263
|
+
_b["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[trackRounded] || trackRounded)] = trackRounded,
|
|
258
264
|
_b)), id: id || this._id, role: 'switch' }, ariaAttributes, { "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, ref: function (span) {
|
|
259
265
|
_this._element = span;
|
|
260
|
-
}, tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled, undefined), accessKey: this.props.accessKey }),
|
|
266
|
+
}, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled, undefined), accessKey: this.props.accessKey }),
|
|
261
267
|
this.dummyInput(this.value),
|
|
262
268
|
React.createElement("span", { className: 'k-switch-label-on' }, onLabel),
|
|
263
269
|
React.createElement("span", { className: 'k-switch-label-off' }, offLabel),
|
|
264
270
|
React.createElement("span", { className: 'k-switch-thumb-wrap' },
|
|
265
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-switch-thumb', (_c = {},
|
|
266
|
-
_c["k-rounded-"
|
|
271
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-switch-thumb', (_c = {},
|
|
272
|
+
_c["k-rounded-".concat(thumbRounded)] = thumbRounded,
|
|
267
273
|
_c)) })))));
|
|
268
274
|
};
|
|
269
275
|
SwitchWithoutContext.displayName = 'Switch';
|
|
@@ -319,7 +325,7 @@ exports.SwitchWithoutContext = SwitchWithoutContext;
|
|
|
319
325
|
*
|
|
320
326
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
321
327
|
*/
|
|
322
|
-
exports.SwitchPropsContext = kendo_react_common_1.createPropsContext();
|
|
328
|
+
exports.SwitchPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
323
329
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
324
330
|
/**
|
|
325
331
|
* Represents the [KendoReact Switch component]({% slug overview_switch %}).
|
|
@@ -327,5 +333,5 @@ exports.SwitchPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
327
333
|
* Accepts properties of type [SwitchProps]({% slug api_inputs_switchprops %}).
|
|
328
334
|
* Obtaining the `ref` returns an object of type [SwitchHandle]({% slug api_inputs_switchhandle %}).
|
|
329
335
|
*/
|
|
330
|
-
exports.Switch = kendo_react_common_1.withPropsContext(exports.SwitchPropsContext, SwitchWithoutContext);
|
|
336
|
+
exports.Switch = (0, kendo_react_common_1.withPropsContext)(exports.SwitchPropsContext, SwitchWithoutContext);
|
|
331
337
|
exports.Switch.displayName = 'KendoReactSwitch';
|
|
@@ -32,4 +32,4 @@ export declare const TextAreaPropsContext: React.Context<(p: TextAreaProps) => T
|
|
|
32
32
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaHandle>>;
|
|
35
|
+
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaHandle | null>>;
|
|
@@ -15,11 +15,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.TextArea = exports.TextAreaPropsContext = void 0;
|
|
23
26
|
var React = require("react");
|
|
24
27
|
var PropTypes = require("prop-types");
|
|
25
28
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -29,7 +32,7 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
29
32
|
*
|
|
30
33
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
31
34
|
*/
|
|
32
|
-
exports.TextAreaPropsContext = kendo_react_common_1.createPropsContext();
|
|
35
|
+
exports.TextAreaPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
33
36
|
/**
|
|
34
37
|
* Represents the [KendoReact TextArea component]({% slug overview_textarea %}).
|
|
35
38
|
*
|
|
@@ -49,7 +52,7 @@ exports.TextAreaPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
49
52
|
*/
|
|
50
53
|
exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
51
54
|
var _a;
|
|
52
|
-
var props = kendo_react_common_1.usePropsContext(exports.TextAreaPropsContext, directProps);
|
|
55
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.TextAreaPropsContext, directProps);
|
|
53
56
|
var _b = props, size = _b.size, rounded = _b.rounded, fillMode = _b.fillMode, ariaDescribedBy = _b.ariaDescribedBy, ariaLabelledBy = _b.ariaLabelledBy, autoSize = _b.autoSize, className = _b.className, defaultValue = _b.defaultValue, disabled = _b.disabled, readOnly = _b.readOnly, required = _b.required, rows = _b.rows, id = _b.id, name = _b.name, placeholder = _b.placeholder, style = _b.style, tabIndex = _b.tabIndex, value = _b.value, valid = _b.valid, validationMessage = _b.validationMessage, validityStyles = _b.validityStyles, onChange = _b.onChange, onFocus = _b.onFocus, onBlur = _b.onBlur,
|
|
54
57
|
// Removed to support direct use in Form Field component
|
|
55
58
|
visited = _b.visited, touched = _b.touched, modified = _b.modified, others = __rest(_b, ["size", "rounded", "fillMode", "ariaDescribedBy", "ariaLabelledBy", "autoSize", "className", "defaultValue", "disabled", "readOnly", "required", "rows", "id", "name", "placeholder", "style", "tabIndex", "value", "valid", "validationMessage", "validityStyles", "onChange", "onFocus", "onBlur", "visited", "touched", "modified"]);
|
|
@@ -69,8 +72,8 @@ exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
|
69
72
|
React.useImperativeHandle(target, getImperativeHandle);
|
|
70
73
|
var _c = React.useState(defaultValue), stateValue = _c[0], setStateValue = _c[1];
|
|
71
74
|
var _d = React.useState('auto'), textAreaHeight = _d[0], setTextAreaHeight = _d[1];
|
|
72
|
-
var calculatedId = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
|
|
73
|
-
var dir = kendo_react_common_1.useDir(elementRef, props.dir);
|
|
75
|
+
var calculatedId = React.useMemo(function () { return (0, kendo_react_common_1.guid)(); }, []);
|
|
76
|
+
var dir = (0, kendo_react_common_1.useDir)(elementRef, props.dir);
|
|
74
77
|
var isControlled = value !== undefined;
|
|
75
78
|
var currentValue = isControlled ? value : stateValue;
|
|
76
79
|
var isValid = valid !== undefined ?
|
|
@@ -87,7 +90,7 @@ exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
|
87
90
|
}, [isValid, validationMessage]);
|
|
88
91
|
React.useLayoutEffect(function () {
|
|
89
92
|
if (elementRef.current) {
|
|
90
|
-
setTextAreaHeight(elementRef.current.scrollHeight
|
|
93
|
+
setTextAreaHeight("".concat(elementRef.current.scrollHeight, "px"));
|
|
91
94
|
}
|
|
92
95
|
}, [currentValue]);
|
|
93
96
|
var handleChange = React.useCallback(function (event) {
|
|
@@ -97,24 +100,24 @@ exports.TextArea = React.forwardRef(function (directProps, target) {
|
|
|
97
100
|
setStateValue(newValue);
|
|
98
101
|
}
|
|
99
102
|
if (onChange && !disabled) {
|
|
100
|
-
kendo_react_common_1.dispatchEvent(onChange, event, getImperativeHandle(), { value: newValue });
|
|
103
|
+
(0, kendo_react_common_1.dispatchEvent)(onChange, event, getImperativeHandle(), { value: newValue });
|
|
101
104
|
}
|
|
102
105
|
}, [setStateValue, onChange, disabled, isControlled]);
|
|
103
106
|
var handleFocus = React.useCallback(function (event) {
|
|
104
107
|
if (onFocus && !disabled) {
|
|
105
|
-
kendo_react_common_1.dispatchEvent(onFocus, event, getImperativeHandle(), undefined);
|
|
108
|
+
(0, kendo_react_common_1.dispatchEvent)(onFocus, event, getImperativeHandle(), undefined);
|
|
106
109
|
}
|
|
107
110
|
}, [onFocus, disabled]);
|
|
108
111
|
var handleBlur = React.useCallback(function (event) {
|
|
109
112
|
if (onBlur && !disabled) {
|
|
110
|
-
kendo_react_common_1.dispatchEvent(onBlur, event, getImperativeHandle(), undefined);
|
|
113
|
+
(0, kendo_react_common_1.dispatchEvent)(onBlur, event, getImperativeHandle(), undefined);
|
|
111
114
|
}
|
|
112
115
|
}, [onBlur, disabled]);
|
|
113
|
-
var textAreaProps = __assign({ id: id || calculatedId, name: name, className: 'k-input-inner !k-overflow-auto', ref: elementRef, disabled: disabled, rows: rows, placeholder: placeholder, readOnly: readOnly, required: required, tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled), style: autoSize ? { resize: 'none', overflow: 'hidden', height: textAreaHeight } : {}, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-multiline': true, 'aria-disabled': disabled || undefined, value: isControlled ? value : stateValue }, others, { onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur });
|
|
114
|
-
return (React.createElement("span", { className: kendo_react_common_1.classNames('k-input', 'k-textarea', (_a = {},
|
|
115
|
-
_a["k-input-"
|
|
116
|
-
_a["k-input-"
|
|
117
|
-
_a["k-rounded-"
|
|
116
|
+
var textAreaProps = __assign(__assign({ id: id || calculatedId, name: name, className: 'k-input-inner !k-overflow-auto', ref: elementRef, disabled: disabled, rows: rows, placeholder: placeholder, readOnly: readOnly, required: required, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled), style: autoSize ? { resize: 'none', overflow: 'hidden', height: textAreaHeight } : {}, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-multiline': true, 'aria-disabled': disabled || undefined, value: isControlled ? value : stateValue }, others), { onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur });
|
|
117
|
+
return (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-input', 'k-textarea', (_a = {},
|
|
118
|
+
_a["k-input-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
119
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
120
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
118
121
|
_a['k-invalid'] = !(isValid || validityStyles !== undefined || validityStyles === true),
|
|
119
122
|
_a['k-required'] = required,
|
|
120
123
|
_a['k-disabled'] = disabled,
|
package/dist/npm/utils.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.nullable = void 0;
|
|
3
13
|
// Polyfill for PropTypes.null
|
|
4
14
|
/**
|
|
5
15
|
* @hidden
|
|
@@ -14,7 +24,7 @@ function nullable(subRequirement) {
|
|
|
14
24
|
return null;
|
|
15
25
|
}
|
|
16
26
|
var sub = required ? subRequirement.isRequired : subRequirement;
|
|
17
|
-
return sub.apply(void 0, [props, key]
|
|
27
|
+
return sub.apply(void 0, __spreadArray([props, key], rest, false));
|
|
18
28
|
};
|
|
19
29
|
var fn = check.bind(null, false);
|
|
20
30
|
fn.isRequired = check.bind(null, true);
|