@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
|
@@ -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;
|
|
@@ -46,7 +46,8 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
46
46
|
* @hidden
|
|
47
47
|
*/
|
|
48
48
|
_this.wrapper = null;
|
|
49
|
-
_this.
|
|
49
|
+
_this.paletteService = null;
|
|
50
|
+
_this.guid = (0, kendo_react_common_1.guid)();
|
|
50
51
|
/**
|
|
51
52
|
* @hidden
|
|
52
53
|
*/
|
|
@@ -86,15 +87,18 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
86
87
|
_this.dispatchChangeEvent(color, event);
|
|
87
88
|
};
|
|
88
89
|
_this.onFocus = function (nativeEvent) {
|
|
90
|
+
if (!_this.paletteService) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
89
93
|
_this.setState({ focusedColor: _this.state.selectedColor || _this.paletteService.colorRows[0][0] });
|
|
90
94
|
if (_this.props.onFocus) {
|
|
91
|
-
_this.props.onFocus.call(undefined,
|
|
95
|
+
_this.props.onFocus.call(undefined, nativeEvent);
|
|
92
96
|
}
|
|
93
97
|
};
|
|
94
98
|
_this.onBlur = function () {
|
|
95
99
|
_this.setState({ focusedColor: undefined });
|
|
96
100
|
};
|
|
97
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
101
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
98
102
|
// The empty string for the `value` prop means no selection but controlled mode.
|
|
99
103
|
_this.state = {
|
|
100
104
|
selectedColor: _this.props.value !== undefined ? _this.props.value : _this.props.defaultValue,
|
|
@@ -112,9 +116,9 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
112
116
|
svc.setColorMatrix(paletteInfo.colors, paletteInfo.columns);
|
|
113
117
|
var selectedCellCoords = svc.getCellCoordsFor(this.state.selectedColor);
|
|
114
118
|
var focusedCellCoords = svc.getCellCoordsFor(this.state.focusedColor);
|
|
115
|
-
var className = kendo_react_common_1.classNames('k-colorpalette', { 'k-disabled': this.props.disabled });
|
|
119
|
+
var className = (0, kendo_react_common_1.classNames)('k-colorpalette', { 'k-disabled': this.props.disabled });
|
|
116
120
|
if (paletteInfo.colors.length) {
|
|
117
|
-
return (React.createElement("div", { id: this.props.id, className: className, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, "aria-disabled": this.props.disabled ? 'true' : undefined, "aria-activedescendant": selectedCellCoords && this.createCellId(selectedCellCoords), "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, tabIndex: kendo_react_common_1.getTabIndex(this.props.tabIndex, this.props.disabled), ref: function (el) { return _this.wrapper = el; } },
|
|
121
|
+
return (React.createElement("div", { id: this.props.id, className: className, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, "aria-disabled": this.props.disabled ? 'true' : undefined, "aria-activedescendant": selectedCellCoords && this.createCellId(selectedCellCoords), "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, tabIndex: (0, kendo_react_common_1.getTabIndex)(this.props.tabIndex, this.props.disabled), ref: function (el) { return _this.wrapper = el; } },
|
|
118
122
|
React.createElement("div", { className: "k-colorpalette-table-wrap", role: "grid" },
|
|
119
123
|
React.createElement("table", { className: "k-colorpalette-table k-palette", role: "presentation" },
|
|
120
124
|
React.createElement("tbody", null, this.renderRows(svc.colorRows, selectedCellCoords, focusedCellCoords))))));
|
|
@@ -145,6 +149,9 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
145
149
|
return null;
|
|
146
150
|
};
|
|
147
151
|
ColorPaletteWithoutContext.prototype.handleCellNavigation = function (horizontalStep, verticalStep) {
|
|
152
|
+
if (!this.paletteService) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
148
155
|
if (this.focusedColorCooridanates) {
|
|
149
156
|
var newCoords = this.paletteService.getNextCell(this.focusedColorCooridanates, horizontalStep, verticalStep);
|
|
150
157
|
this.setState({ focusedColor: this.paletteService.getColorAt(newCoords) });
|
|
@@ -160,11 +167,11 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
160
167
|
this.dispatchChangeEvent(this.state.focusedColor, event);
|
|
161
168
|
};
|
|
162
169
|
ColorPaletteWithoutContext.prototype.dispatchChangeEvent = function (value, event) {
|
|
163
|
-
kendo_react_common_1.dispatchEvent(this.props.onChange, event, this, { value: value, rgbaValue: color_parser_1.parseColor(value, 'rgba') });
|
|
170
|
+
(0, kendo_react_common_1.dispatchEvent)(this.props.onChange, event, this, { value: value, rgbaValue: (0, color_parser_1.parseColor)(value, 'rgba') });
|
|
164
171
|
};
|
|
165
172
|
Object.defineProperty(ColorPaletteWithoutContext.prototype, "focusedColorCooridanates", {
|
|
166
173
|
get: function () {
|
|
167
|
-
return this.state.focusedColor ? this.paletteService.getCellCoordsFor(this.state.focusedColor) : undefined;
|
|
174
|
+
return this.state.focusedColor && this.paletteService ? this.paletteService.getCellCoordsFor(this.state.focusedColor) : undefined;
|
|
168
175
|
},
|
|
169
176
|
enumerable: false,
|
|
170
177
|
configurable: true
|
|
@@ -179,7 +186,7 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
179
186
|
ColorPaletteWithoutContext.prototype.getPaletteInfo = function () {
|
|
180
187
|
if (typeof this.props.palette === 'string') {
|
|
181
188
|
var preset = palette_presets_1.PALETTEPRESETS[this.props.palette];
|
|
182
|
-
if (misc_1.isPresent(preset)) {
|
|
189
|
+
if ((0, misc_1.isPresent)(preset)) {
|
|
183
190
|
return {
|
|
184
191
|
colors: preset.colors,
|
|
185
192
|
columns: this.props.columns || preset.columns || exports.DEFAULT_COLUMNS_COUNT
|
|
@@ -211,7 +218,7 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
211
218
|
var height = tileSize.height + 'px';
|
|
212
219
|
return columns.map(function (color, i) {
|
|
213
220
|
var isSelected = rowIsSelected && selectedColumn === i;
|
|
214
|
-
var className = kendo_react_common_1.classNames('k-colorpalette-tile', {
|
|
221
|
+
var className = (0, kendo_react_common_1.classNames)('k-colorpalette-tile', {
|
|
215
222
|
'k-selected': isSelected,
|
|
216
223
|
'k-focus': rowIsFocused && focusedColumn === i
|
|
217
224
|
});
|
|
@@ -219,7 +226,7 @@ var ColorPaletteWithoutContext = /** @class */ (function (_super) {
|
|
|
219
226
|
});
|
|
220
227
|
};
|
|
221
228
|
ColorPaletteWithoutContext.prototype.createCellId = function (cellCoords) {
|
|
222
|
-
return this.guid
|
|
229
|
+
return "".concat(this.guid, "_").concat(cellCoords.row, "_").concat(cellCoords.col);
|
|
223
230
|
};
|
|
224
231
|
ColorPaletteWithoutContext.displayName = 'ColorPalette';
|
|
225
232
|
/**
|
|
@@ -255,7 +262,7 @@ exports.ColorPaletteWithoutContext = ColorPaletteWithoutContext;
|
|
|
255
262
|
*
|
|
256
263
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
257
264
|
*/
|
|
258
|
-
exports.ColorPalettePropsContext = kendo_react_common_1.createPropsContext();
|
|
265
|
+
exports.ColorPalettePropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
259
266
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
260
267
|
/**
|
|
261
268
|
* Represents the [KendoReact ColorPalette component]({% slug overview_colorpalette %}).
|
|
@@ -272,5 +279,5 @@ exports.ColorPalettePropsContext = kendo_react_common_1.createPropsContext();
|
|
|
272
279
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
273
280
|
* ```
|
|
274
281
|
*/
|
|
275
|
-
exports.ColorPalette = kendo_react_common_1.withPropsContext(exports.ColorPalettePropsContext, ColorPaletteWithoutContext);
|
|
282
|
+
exports.ColorPalette = (0, kendo_react_common_1.withPropsContext)(exports.ColorPalettePropsContext, ColorPaletteWithoutContext);
|
|
276
283
|
exports.ColorPalette.displayName = 'KendoReactColorPalette';
|
|
@@ -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>>;
|
|
@@ -48,7 +48,7 @@ var isControlled = function (prop) {
|
|
|
48
48
|
*
|
|
49
49
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
50
50
|
*/
|
|
51
|
-
exports.ColorPickerPropsContext = kendo_react_common_1.createPropsContext();
|
|
51
|
+
exports.ColorPickerPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
52
52
|
/**
|
|
53
53
|
* Represents the [KendoReact ColorPicker component]({% slug overview_colorpicker %}).
|
|
54
54
|
*
|
|
@@ -64,9 +64,9 @@ exports.ColorPickerPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
64
64
|
*/
|
|
65
65
|
exports.ColorPicker = React.forwardRef(function (directProps, target) {
|
|
66
66
|
var _a, _b;
|
|
67
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
68
|
-
var props = kendo_react_common_1.usePropsContext(exports.ColorPickerPropsContext, directProps);
|
|
69
|
-
var localization = kendo_react_intl_1.useLocalization();
|
|
67
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
68
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.ColorPickerPropsContext, directProps);
|
|
69
|
+
var localization = (0, kendo_react_intl_1.useLocalization)();
|
|
70
70
|
var _c = props.size, size = _c === void 0 ? defaultProps.size : _c, _d = props.rounded, rounded = _d === void 0 ? defaultProps.rounded : _d, _e = props.fillMode, fillMode = _e === void 0 ? defaultProps.fillMode : _e, popupSettings = props.popupSettings, gradientSettings = props.gradientSettings, paletteSettings = props.paletteSettings, valid = props.valid, disabled = props.disabled, tabIndex = props.tabIndex, view = props.view, icon = props.icon, iconClassName = props.iconClassName, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onActiveColorClick = props.onActiveColorClick;
|
|
71
71
|
var focusableElementRef = React.useRef(null);
|
|
72
72
|
var gradientRef = React.useRef(null);
|
|
@@ -197,23 +197,23 @@ exports.ColorPicker = React.forwardRef(function (directProps, target) {
|
|
|
197
197
|
}
|
|
198
198
|
}, [isValueControlled, onChange]);
|
|
199
199
|
var onPaletteChangeHandler = React.useCallback(function (event) { return onChangeHandler(event, true); }, [isControlled, onChangeHandler]);
|
|
200
|
-
var dir = kendo_react_common_1.useDir(focusableElementRef, props.dir);
|
|
200
|
+
var dir = (0, kendo_react_common_1.useDir)(focusableElementRef, props.dir);
|
|
201
201
|
var isValid = valid !== false;
|
|
202
|
-
return (React.createElement("span", { id: props.id, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, className: kendo_react_common_1.classNames('k-colorpicker', 'k-picker', 'k-icon-picker', (_a = {},
|
|
203
|
-
_a["k-picker-"
|
|
204
|
-
_a["k-picker-"
|
|
205
|
-
_a["k-rounded-"
|
|
202
|
+
return (React.createElement("span", { id: props.id, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, className: (0, kendo_react_common_1.classNames)('k-colorpicker', 'k-picker', 'k-icon-picker', (_a = {},
|
|
203
|
+
_a["k-picker-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
204
|
+
_a["k-picker-".concat(fillMode)] = fillMode,
|
|
205
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
206
206
|
_a['k-invalid'] = !isValid,
|
|
207
207
|
_a['k-disabled'] = disabled,
|
|
208
208
|
_a['k-focus'] = focused,
|
|
209
|
-
_a)), ref: focusableElementRef, tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled), title: props.title, onKeyDown: onKeyDownHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, dir: dir },
|
|
209
|
+
_a)), ref: focusableElementRef, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled), title: props.title, onKeyDown: onKeyDownHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, dir: dir },
|
|
210
210
|
React.createElement(Picker_1.Picker, { dir: dir, open: open, onOpen: onOpenHandler, popupAnchor: focusableElementRef.current || undefined, popupSettings: __assign({}, popupSettings), input: (React.createElement("span", { onClick: onActiveColorClickHandler, className: 'k-input-inner' },
|
|
211
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-value-icon', 'k-color-preview', {
|
|
211
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-value-icon', 'k-color-preview', {
|
|
212
212
|
'k-no-color': !value,
|
|
213
213
|
'k-icon-color-preview': (icon || iconClassName)
|
|
214
214
|
}) },
|
|
215
|
-
(iconClassName || icon) && React.createElement("span", { className: kendo_react_common_1.classNames('k-color-preview-icon', iconClassName, (_b = {},
|
|
216
|
-
_b["k-icon k-i-"
|
|
215
|
+
(iconClassName || icon) && React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-color-preview-icon', iconClassName, (_b = {},
|
|
216
|
+
_b["k-icon k-i-".concat(icon)] = (icon && !iconClassName),
|
|
217
217
|
_b)) }),
|
|
218
218
|
React.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: value } })))), button: (React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, type: "button", onClick: onClickHandler, className: "k-input-button", rounded: null, icon: 'arrow-s', "aria-label": localization.toLanguageString(messages_1.colorPickerDropdownButtonAriaLabel, messages_1.messages[messages_1.colorPickerDropdownButtonAriaLabel]) })), content: (React.createElement(React.Fragment, null,
|
|
219
219
|
(view === 'combo' || view === 'gradient') && (React.createElement(ColorGradient_1.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>>;
|
|
@@ -14,7 +14,7 @@ var messages_1 = require("../messages");
|
|
|
14
14
|
* Represents the FlatColorPicker component.
|
|
15
15
|
*/
|
|
16
16
|
exports.FlatColorPicker = React.forwardRef(function (props, ref) {
|
|
17
|
-
kendo_react_common_1.validatePackage(package_metadata_1.packageMetadata);
|
|
17
|
+
(0, kendo_react_common_1.validatePackage)(package_metadata_1.packageMetadata);
|
|
18
18
|
var target = React.useRef(null);
|
|
19
19
|
var flatColorPickerRef = React.useRef(null);
|
|
20
20
|
var colorGradientRef = React.useRef(null);
|
|
@@ -60,33 +60,34 @@ exports.FlatColorPicker = React.forwardRef(function (props, ref) {
|
|
|
60
60
|
var handleFlatColorPickerBlur = React.useCallback(function () {
|
|
61
61
|
setPrevColor(colorValue);
|
|
62
62
|
}, [colorValue]);
|
|
63
|
-
return (React.createElement("div", { id: props.id, style: props.style, ref: flatColorPickerRef, tabIndex: kendo_react_common_1.getTabIndex(props.tabIndex, props.disabled), className: kendo_react_common_1.classNames('k-flatcolorpicker k-coloreditor', {
|
|
63
|
+
return (React.createElement("div", { id: props.id, style: props.style, ref: flatColorPickerRef, tabIndex: (0, kendo_react_common_1.getTabIndex)(props.tabIndex, props.disabled), className: (0, kendo_react_common_1.classNames)('k-flatcolorpicker k-coloreditor', {
|
|
64
64
|
'k-disabled': props.disabled
|
|
65
65
|
}, props.className), onBlur: handleFlatColorPickerBlur },
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
React.createElement("div", { className: "k-coloreditor-header
|
|
69
|
-
React.createElement(
|
|
70
|
-
React.createElement(kendo_react_buttons_1.
|
|
71
|
-
React.createElement(
|
|
72
|
-
|
|
73
|
-
React.createElement(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
(
|
|
77
|
-
|
|
78
|
-
React.createElement(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
React.createElement("
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
React.createElement(
|
|
89
|
-
|
|
66
|
+
React.createElement(React.Fragment, null,
|
|
67
|
+
props.header ||
|
|
68
|
+
React.createElement("div", { className: "k-coloreditor-header k-hstack" },
|
|
69
|
+
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
70
|
+
React.createElement(kendo_react_buttons_1.ButtonGroup, null,
|
|
71
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", togglable: true, fillMode: 'flat', selected: colorGradientView, onClick: function () { return handleViewChange('ColorGradient'); } },
|
|
72
|
+
React.createElement("span", { className: "k-icon k-i-color-canvas" })),
|
|
73
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", togglable: true, fillMode: 'flat', selected: !colorGradientView, onClick: function () { return handleViewChange('ColorPalette'); } },
|
|
74
|
+
React.createElement("span", { className: "k-icon k-i-palette" })))),
|
|
75
|
+
React.createElement("div", { className: "k-spacer" }),
|
|
76
|
+
React.createElement("div", { className: "k-coloreditor-header-actions k-hstack" },
|
|
77
|
+
(props.showClearButton && defaultProps.showClearButton) &&
|
|
78
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", fillMode: 'flat', onClick: handleResetColor },
|
|
79
|
+
React.createElement("span", { className: "k-icon k-i-reset-color" })),
|
|
80
|
+
(props.showPreview && defaultProps.showPreview) &&
|
|
81
|
+
React.createElement("div", { className: "k-coloreditor-preview k-vstack" },
|
|
82
|
+
React.createElement("span", { className: "k-coloreditor-preview-color k-color-preview", style: { background: colorValue } }),
|
|
83
|
+
React.createElement("span", { className: "k-coloreditor-current-color k-color-preview", style: { background: prevColor }, onClick: handlePrevColorClick })))),
|
|
84
|
+
React.createElement("div", { className: "k-coloreditor-views k-vstack" }, colorGradientView
|
|
85
|
+
? React.createElement(main_1.ColorGradient, { ref: colorGradientRef, value: colorValue, onChange: handleColorChange, onFocus: handleFocus })
|
|
86
|
+
: React.createElement(main_1.ColorPalette, { value: colorValue, onChange: handleColorChange, onFocus: handleFocus })),
|
|
87
|
+
(props.showButtons && defaultProps.showButtons) &&
|
|
88
|
+
React.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-end" },
|
|
89
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", className: "k-coloreditor-cancel", onClick: handleCancelBtnClick }, messages_1.messages[messages_1.flatColorPickerCancelBtn]),
|
|
90
|
+
React.createElement(kendo_react_buttons_1.Button, { type: "button", className: "k-coloreditor-apply k-primary", onClick: handleApplyBtnClick }, messages_1.messages[messages_1.flatColorPickerApplyBtn])))));
|
|
90
91
|
});
|
|
91
92
|
var propTypes = {
|
|
92
93
|
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
|
}
|
|
@@ -28,14 +28,14 @@ var HexInput = /** @class */ (function (_super) {
|
|
|
28
28
|
var _this = _super.call(this, props) || this;
|
|
29
29
|
_this.onChange = function (event) {
|
|
30
30
|
var hex = event.target.value;
|
|
31
|
-
var value = color_parser_1.parseColor(hex, 'rgba');
|
|
31
|
+
var value = (0, color_parser_1.parseColor)(hex, 'rgba');
|
|
32
32
|
_this.setState({ hex: hex });
|
|
33
|
-
if (misc_1.isPresent(value)) {
|
|
33
|
+
if ((0, misc_1.isPresent)(value)) {
|
|
34
34
|
_this.props.onHexChange(hex, value, event);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
_this.onBlur = function () {
|
|
38
|
-
if (!misc_1.isPresent(color_parser_1.parseColor(_this.state.hex, 'rgba'))) {
|
|
38
|
+
if (!(0, misc_1.isPresent)((0, color_parser_1.parseColor)(_this.state.hex, 'rgba'))) {
|
|
39
39
|
_this.setState({ hex: _this.state.originalHex });
|
|
40
40
|
}
|
|
41
41
|
};
|
|
@@ -34,7 +34,7 @@ var Picker = function (props) {
|
|
|
34
34
|
return (React.createElement(React.Fragment, null,
|
|
35
35
|
props.input,
|
|
36
36
|
props.button,
|
|
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: 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)));
|
|
38
38
|
};
|
|
39
39
|
exports.Picker = Picker;
|
|
40
40
|
exports.Picker.displayName = 'KendoPickerComponent';
|
|
@@ -12,7 +12,7 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
12
12
|
}
|
|
13
13
|
ColorPaletteService.prototype.setColorMatrix = function (palette, columns) {
|
|
14
14
|
this.colorRows = [];
|
|
15
|
-
if (!(misc_1.isPresent(palette) && palette.length)) {
|
|
15
|
+
if (!((0, misc_1.isPresent)(palette) && palette.length)) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
columns = columns || palette.length;
|
|
@@ -23,12 +23,12 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
23
23
|
};
|
|
24
24
|
ColorPaletteService.prototype.getCellCoordsFor = function (color) {
|
|
25
25
|
var _this = this;
|
|
26
|
-
if (!misc_1.isPresent(color)) {
|
|
26
|
+
if (!(0, misc_1.isPresent)(color)) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
var parsedColor = color ? kendo_drawing_1.parseColor(color, true) : color;
|
|
29
|
+
var parsedColor = color ? (0, kendo_drawing_1.parseColor)(color, true) : color;
|
|
30
30
|
var colors = [color];
|
|
31
|
-
if (misc_1.isPresent(parsedColor)) {
|
|
31
|
+
if ((0, misc_1.isPresent)(parsedColor)) {
|
|
32
32
|
colors.push(parsedColor.toCss(), parsedColor.toCssRgba());
|
|
33
33
|
}
|
|
34
34
|
var _loop_1 = function (row) {
|
|
@@ -51,13 +51,13 @@ var ColorPaletteService = /** @class */ (function () {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
ColorPaletteService.prototype.getColorAt = function (cellCoords) {
|
|
54
|
-
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]))) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
return this.colorRows[cellCoords.row][cellCoords.col];
|
|
58
58
|
};
|
|
59
59
|
ColorPaletteService.prototype.getNextCell = function (current, horizontalStep, verticalStep) {
|
|
60
|
-
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))) {
|
|
61
61
|
return { row: 0, col: 0 };
|
|
62
62
|
}
|
|
63
63
|
var row = this.clampIndex(current.row + verticalStep, this.colorRows.length - 1);
|
|
@@ -13,13 +13,13 @@ var parseColor = function (value, format, safe) {
|
|
|
13
13
|
var allowedFormats = ['hex', 'rgba']; // TODO: constant?
|
|
14
14
|
// Angular supports third type: name : const allowedFormats: Array<string> = ['hex', 'rgba', 'name'];
|
|
15
15
|
if (allowedFormats.indexOf(format) === -1) {
|
|
16
|
-
throw new Error("Unsupported color output format '"
|
|
16
|
+
throw new Error("Unsupported color output format '".concat(format, "'. The available options are 'hex' or 'rgba'."));
|
|
17
17
|
}
|
|
18
|
-
if (!misc_1.isPresent(value)) {
|
|
18
|
+
if (!(0, misc_1.isPresent)(value)) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
var parsedColor = kendo_drawing_1.parseColor(value.trim(), safe);
|
|
22
|
-
if (!misc_1.isPresent(parsedColor)) {
|
|
21
|
+
var parsedColor = (0, kendo_drawing_1.parseColor)(value.trim(), safe);
|
|
22
|
+
if (!(0, misc_1.isPresent)(parsedColor)) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
return format === 'hex' ? parsedColor.toCss() : parsedColor.toCssRgba();
|
|
@@ -32,8 +32,8 @@ exports.parseColor = parseColor;
|
|
|
32
32
|
*/
|
|
33
33
|
var getHSV = function (value, safe) {
|
|
34
34
|
if (safe === void 0) { safe = true; }
|
|
35
|
-
var parsed = kendo_drawing_1.parseColor(value, safe);
|
|
36
|
-
if (!misc_1.isPresent(parsed)) {
|
|
35
|
+
var parsed = (0, kendo_drawing_1.parseColor)(value, safe);
|
|
36
|
+
if (!(0, misc_1.isPresent)(parsed)) {
|
|
37
37
|
return {};
|
|
38
38
|
}
|
|
39
39
|
return parsed.toHSV();
|
|
@@ -46,8 +46,8 @@ exports.getHSV = getHSV;
|
|
|
46
46
|
*/
|
|
47
47
|
var getRGBA = function (value, safe) {
|
|
48
48
|
if (safe === void 0) { safe = true; }
|
|
49
|
-
var parsed = kendo_drawing_1.parseColor(value, safe);
|
|
50
|
-
if (!misc_1.isPresent(parsed)) {
|
|
49
|
+
var parsed = (0, kendo_drawing_1.parseColor)(value, safe);
|
|
50
|
+
if (!(0, misc_1.isPresent)(parsed)) {
|
|
51
51
|
return {};
|
|
52
52
|
}
|
|
53
53
|
return parsed.toBytes();
|
|
@@ -59,10 +59,10 @@ exports.getRGBA = getRGBA;
|
|
|
59
59
|
* Returns the RGBA string representation of the color.
|
|
60
60
|
*/
|
|
61
61
|
var getColorFromHSV = function (hsva) {
|
|
62
|
-
var hue = misc_1.fitIntoBounds(hsva.h, 0, 359.9);
|
|
63
|
-
var saturation = misc_1.fitIntoBounds(hsva.s, 0, 1);
|
|
64
|
-
var value = misc_1.fitIntoBounds(hsva.v, 0, 1);
|
|
65
|
-
var alpha = misc_1.fitIntoBounds(hsva.a, 0, 1);
|
|
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);
|
|
66
66
|
return kendo_drawing_1.Color.fromHSV(hue, saturation, value, alpha).toCssRgba();
|
|
67
67
|
};
|
|
68
68
|
exports.getColorFromHSV = getColorFromHSV;
|
|
@@ -73,7 +73,7 @@ exports.getColorFromHSV = getColorFromHSV;
|
|
|
73
73
|
* assuming the `value`, `saturation`, and `alpha` have a value of `1`.
|
|
74
74
|
*/
|
|
75
75
|
var getColorFromHue = function (hue) {
|
|
76
|
-
return exports.getColorFromHSV({ h: hue, s: 1, v: 1, a: 1 });
|
|
76
|
+
return (0, exports.getColorFromHSV)({ h: hue, s: 1, v: 1, a: 1 });
|
|
77
77
|
};
|
|
78
78
|
exports.getColorFromHue = getColorFromHue;
|
|
79
79
|
/**
|
|
@@ -82,10 +82,10 @@ exports.getColorFromHue = getColorFromHue;
|
|
|
82
82
|
* Returns the RGBA string representation of the color.
|
|
83
83
|
*/
|
|
84
84
|
var getColorFromRGBA = function (rgba) {
|
|
85
|
-
var red = misc_1.fitIntoBounds(rgba.r, 0, 255);
|
|
86
|
-
var green = misc_1.fitIntoBounds(rgba.g, 0, 255);
|
|
87
|
-
var blue = misc_1.fitIntoBounds(rgba.b, 0, 255);
|
|
88
|
-
var alpha = misc_1.fitIntoBounds(rgba.a, 0, 1);
|
|
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);
|
|
89
89
|
return kendo_drawing_1.Color.fromBytes(red, green, blue, alpha).toCssRgba();
|
|
90
90
|
};
|
|
91
91
|
exports.getColorFromRGBA = getColorFromRGBA;
|
|
@@ -95,13 +95,13 @@ exports.getColorFromRGBA = getColorFromRGBA;
|
|
|
95
95
|
* Returns the RGB object representation of the color based on the background color.
|
|
96
96
|
*/
|
|
97
97
|
var getRGBFromRGBA = function (foregroundColor, backgroundColor) {
|
|
98
|
-
var r1 = misc_1.fitIntoBounds(foregroundColor.r, 0, 255);
|
|
99
|
-
var g1 = misc_1.fitIntoBounds(foregroundColor.g, 0, 255);
|
|
100
|
-
var b1 = misc_1.fitIntoBounds(foregroundColor.b, 0, 255);
|
|
101
|
-
var a1 = misc_1.fitIntoBounds(foregroundColor.a, 0, 1);
|
|
102
|
-
var r2 = misc_1.fitIntoBounds(backgroundColor.r, 0, 255);
|
|
103
|
-
var g2 = misc_1.fitIntoBounds(backgroundColor.g, 0, 255);
|
|
104
|
-
var b2 = misc_1.fitIntoBounds(backgroundColor.b, 0, 255);
|
|
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);
|
|
105
105
|
return {
|
|
106
106
|
r: Math.round(((1 - a1) * r2) + (a1 * r1)),
|
|
107
107
|
g: Math.round(((1 - a1) * g2) + (a1 * g1)),
|
|
@@ -115,7 +115,7 @@ exports.getRGBFromRGBA = getRGBFromRGBA;
|
|
|
115
115
|
* Returns the relative luminance.
|
|
116
116
|
*/
|
|
117
117
|
var getLuminance = function (rgb) {
|
|
118
|
-
var a = [rgb.r, rgb.g, rgb.b].map(function (v) {
|
|
118
|
+
var a = [rgb.r || 0, rgb.g || 0, rgb.b || 0].map(function (v) {
|
|
119
119
|
v /= 255;
|
|
120
120
|
return v <= 0.03928
|
|
121
121
|
? v / 12.92
|
|
@@ -142,6 +142,6 @@ exports.getContrast = getContrast;
|
|
|
142
142
|
* Returns the color contrast from two RGBA colors.
|
|
143
143
|
*/
|
|
144
144
|
var getContrastFromTwoRGBAs = function (a, b) {
|
|
145
|
-
return exports.getContrast(exports.getLuminance(exports.getRGBFromRGBA(a, b)), exports.getLuminance(exports.getRGBFromRGBA(b, { r: 0, g: 0, b: 0, a: 1 })));
|
|
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 })));
|
|
146
146
|
};
|
|
147
147
|
exports.getContrastFromTwoRGBAs = getContrastFromTwoRGBAs;
|
|
@@ -17,7 +17,7 @@ exports.isPresent = isPresent;
|
|
|
17
17
|
* @param max The inclusive upper bound number.
|
|
18
18
|
*/
|
|
19
19
|
var fitIntoBounds = function (contender, min, max) {
|
|
20
|
-
if (!exports.isPresent(contender) || isNaN(contender)) {
|
|
20
|
+
if (!(0, exports.isPresent)(contender) || isNaN(contender)) {
|
|
21
21
|
return min;
|
|
22
22
|
}
|
|
23
23
|
return contender <= min ? min : contender >= max ? max : contender;
|
|
@@ -22,11 +22,11 @@ var svgPath = function (points, command) {
|
|
|
22
22
|
var d = points.reduce(function (acc, point, i, a) {
|
|
23
23
|
return i === 0 ?
|
|
24
24
|
// if first point
|
|
25
|
-
"M "
|
|
25
|
+
"M ".concat(point[0], ",").concat(point[1]) :
|
|
26
26
|
// else
|
|
27
|
-
acc
|
|
27
|
+
"".concat(acc, " ").concat(command(point, i, a));
|
|
28
28
|
}, '');
|
|
29
|
-
return "<path d=\""
|
|
29
|
+
return "<path d=\"".concat(d, "\" fill=\"none\" stroke=\"white\" stroke-width=\"1\"/>");
|
|
30
30
|
};
|
|
31
31
|
exports.svgPath = svgPath;
|
|
32
32
|
/**
|
|
@@ -105,6 +105,6 @@ var bezierCommand = function (controlPointCalc) { return function (point, i, a)
|
|
|
105
105
|
var _a = controlPointCalc(a[i - 1], a[i - 2], point), cpsX = _a[0], cpsY = _a[1];
|
|
106
106
|
// end control point
|
|
107
107
|
var _b = controlPointCalc(point, a[i - 1], a[i + 1], true), cpeX = _b[0], cpeY = _b[1];
|
|
108
|
-
return "C "
|
|
108
|
+
return "C ".concat(cpsX, ",").concat(cpsY, " ").concat(cpeX, ",").concat(cpeY, " ").concat(point[0], ",").concat(point[1]);
|
|
109
109
|
}; };
|
|
110
110
|
exports.bezierCommand = bezierCommand;
|
|
@@ -18,8 +18,8 @@ var SliderTooltip = function (props) {
|
|
|
18
18
|
var top_1 = props.position === 'right'
|
|
19
19
|
? (anchorRect.height / 2) - (rect.height / 2)
|
|
20
20
|
: -(rect.height * 1.5);
|
|
21
|
-
tooltipRef.current.style.left = left
|
|
22
|
-
tooltipRef.current.style.top = top_1
|
|
21
|
+
tooltipRef.current.style.left = "".concat(left, "px");
|
|
22
|
+
tooltipRef.current.style.top = "".concat(top_1, "px");
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
var handleAnimationStart = function () {
|
|
@@ -38,10 +38,10 @@ var SliderTooltip = function (props) {
|
|
|
38
38
|
if (!tooltipRef.current) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
tooltipRef.current.style.opacity = ""
|
|
41
|
+
tooltipRef.current.style.opacity = "".concat(props.show ? progress : 1 - progress);
|
|
42
42
|
};
|
|
43
43
|
React.useEffect(position);
|
|
44
|
-
kendo_react_animation_1.useAnimation({
|
|
44
|
+
(0, kendo_react_animation_1.useAnimation)({
|
|
45
45
|
appear: true,
|
|
46
46
|
duration: 300,
|
|
47
47
|
onStart: handleAnimationStart,
|
|
@@ -14,9 +14,13 @@ var noop = function () { };
|
|
|
14
14
|
*/
|
|
15
15
|
var SwitchController = /** @class */ (function () {
|
|
16
16
|
function SwitchController(updateView, onChange) {
|
|
17
|
-
var _this = this;
|
|
18
17
|
if (updateView === void 0) { updateView = noop; }
|
|
19
18
|
if (onChange === void 0) { onChange = noop; }
|
|
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
|
};
|
package/dist/npm/input/Input.js
CHANGED
|
@@ -49,7 +49,8 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
49
49
|
__extends(InputWithoutContext, _super);
|
|
50
50
|
function InputWithoutContext(props) {
|
|
51
51
|
var _this = _super.call(this, props) || this;
|
|
52
|
-
_this.
|
|
52
|
+
_this._input = null;
|
|
53
|
+
_this._inputId = (0, kendo_react_common_1.guid)();
|
|
53
54
|
/**
|
|
54
55
|
* @hidden
|
|
55
56
|
*/
|
|
@@ -106,7 +107,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
};
|
|
109
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
110
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
110
111
|
_this.state = {
|
|
111
112
|
value: _this.props.defaultValue || InputWithoutContext.defaultProps.defaultValue
|
|
112
113
|
};
|
|
@@ -206,7 +207,7 @@ var InputWithoutContext = /** @class */ (function (_super) {
|
|
|
206
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"]);
|
|
207
208
|
var inputId = id || this._inputId;
|
|
208
209
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
209
|
-
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');
|
|
210
211
|
var textbox = (React.createElement("input", __assign({ "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }, props, { style: !label
|
|
211
212
|
? style
|
|
212
213
|
: undefined, value: this.value, id: inputId, className: inputClassName, onChange: this.handleChange, onAnimationStart: this.handleAutoFill, ref: function (el) {
|
|
@@ -246,7 +247,7 @@ exports.InputWithoutContext = InputWithoutContext;
|
|
|
246
247
|
*
|
|
247
248
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
248
249
|
*/
|
|
249
|
-
exports.InputPropsContext = kendo_react_common_1.createPropsContext();
|
|
250
|
+
exports.InputPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
250
251
|
;
|
|
251
252
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
252
253
|
/**
|
|
@@ -255,5 +256,5 @@ exports.InputPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
255
256
|
* Accepts properties of type [InputProps]({% slug api_inputs_inputprops %}).
|
|
256
257
|
* Obtaining the `ref` returns an object of type [InputHandle]({% slug api_inputs_inputhandle %}).
|
|
257
258
|
*/
|
|
258
|
-
exports.Input = kendo_react_common_1.withPropsContext(exports.InputPropsContext, InputWithoutContext);
|
|
259
|
+
exports.Input = (0, kendo_react_common_1.withPropsContext)(exports.InputPropsContext, InputWithoutContext);
|
|
259
260
|
exports.Input.displayName = 'KendoReactInput';
|
package/dist/npm/main.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|