@progress/kendo-react-inputs 4.11.0-dev.202110291059 → 4.11.0-dev.202111060921
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/colors/ColorContrastLabels.js +1 -2
- package/dist/es/colors/ColorGradient.js +7 -6
- package/dist/es/colors/ColorInput.d.ts +4 -0
- package/dist/es/colors/ColorInput.js +44 -13
- package/dist/es/colors/ColorPalette.js +5 -5
- package/dist/es/colors/HexInput.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/colors/ColorContrastLabels.js +1 -2
- package/dist/npm/colors/ColorGradient.js +7 -6
- package/dist/npm/colors/ColorInput.d.ts +4 -0
- package/dist/npm/colors/ColorInput.js +44 -13
- package/dist/npm/colors/ColorPalette.js +5 -5
- package/dist/npm/colors/HexInput.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +11 -11
|
@@ -44,8 +44,7 @@ var ColorContrastLabels = /** @class */ (function (_super) {
|
|
|
44
44
|
failMessage,
|
|
45
45
|
" ",
|
|
46
46
|
React.createElement("span", { className: "k-icon k-i-close" })));
|
|
47
|
-
return (React.createElement("div", { className: "k-vbox k-color-contrast" },
|
|
48
|
-
React.createElement("span", { className: "k-separator" }),
|
|
47
|
+
return (React.createElement("div", { className: "k-vbox k-colorgradient-color-contrast" },
|
|
49
48
|
React.createElement("div", { className: "k-contrast-ratio" },
|
|
50
49
|
React.createElement("span", { className: "k-contrast-ratio-text" }, contrastText),
|
|
51
50
|
contrast >= 4.5 ? (React.createElement("span", { className: "k-contrast-validation k-text-success" },
|
|
@@ -169,7 +169,7 @@ var ColorGradient = /** @class */ (function (_super) {
|
|
|
169
169
|
style.top = top_1 + "px";
|
|
170
170
|
style.left = left + "px";
|
|
171
171
|
}
|
|
172
|
-
return React.createElement("div", { className: "k-draghandle", style: style });
|
|
172
|
+
return React.createElement("div", { className: "k-hsv-draghandle k-draghandle", style: style });
|
|
173
173
|
};
|
|
174
174
|
/**
|
|
175
175
|
* @hidden
|
|
@@ -236,17 +236,18 @@ var ColorGradient = /** @class */ (function (_super) {
|
|
|
236
236
|
*/
|
|
237
237
|
ColorGradient.prototype.render = function () {
|
|
238
238
|
var _this = this;
|
|
239
|
-
var className = classNames('k-
|
|
239
|
+
var className = classNames('k-colorgradient', { 'k-state-disabled': this.props.disabled });
|
|
240
240
|
return (React.createElement("div", { id: this.props.id, className: className, "aria-disabled": this.props.disabled ? 'true' : undefined, style: this.props.style, ref: function (el) { return _this.wrapper = el; }, tabIndex: getTabIndex(this.props.tabIndex, this.props.disabled), "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy },
|
|
241
|
-
React.createElement("div", { className: "k-
|
|
241
|
+
React.createElement("div", { className: "k-colorgradient-canvas k-hstack" },
|
|
242
242
|
React.createElement("div", { className: "k-hsv-rectangle", style: { background: this.state.backgroundColor } },
|
|
243
243
|
React.createElement(Draggable, { onDrag: this.onDrag, onRelease: this.onRelease, ref: function (el) { return _this.gradientWrapper = el ? el.element : undefined; } },
|
|
244
244
|
React.createElement("div", { className: "k-hsv-gradient", style: { touchAction: 'none' }, onClick: this.onGradientWrapperClick }, this.renderRectangleDragHandle())),
|
|
245
245
|
this.props.backgroundColor && !this.state.isFirstRender &&
|
|
246
246
|
React.createElement(ColorContrastSvg, { metrics: this.gradientWrapper ? this.getGradientRectMetrics() : undefined, hsva: this.state.hsva, backgroundColor: this.props.backgroundColor })),
|
|
247
|
-
React.createElement("div", { className: "k-
|
|
248
|
-
React.createElement(Slider, { value: this.state.hsva.h, buttons: false, vertical: true, min: 0, max: 360, step: 5, onChange: this.onHueSliderChange, className: "k-hue-slider", disabled: this.props.disabled }),
|
|
249
|
-
this.props.opacity &&
|
|
247
|
+
React.createElement("div", { className: "k-hsv-controls k-hstack" },
|
|
248
|
+
React.createElement(Slider, { value: this.state.hsva.h, buttons: false, vertical: true, min: 0, max: 360, step: 5, onChange: this.onHueSliderChange, className: "k-hue-slider k-colorgradient-slider", disabled: this.props.disabled }),
|
|
249
|
+
this.props.opacity &&
|
|
250
|
+
React.createElement(Slider, { value: isPresent(this.state.hsva.a) ? this.state.hsva.a * 100 : 100, buttons: false, vertical: true, min: 0, max: 100, step: 1, onChange: this.onAlphaSliderChange, className: "k-alpha-slider k-colorgradient-slider", disabled: this.props.disabled, ref: function (el) { return _this.alphaSlider = el; } }))),
|
|
250
251
|
React.createElement(ColorInput, { rgba: this.state.rgba, onRgbaChange: this.onRgbaChange, hex: this.state.hex, onHexChange: this.onHexChange, opacity: this.props.opacity, disabled: this.props.disabled }),
|
|
251
252
|
this.props.backgroundColor && (React.createElement(ColorContrastLabels, { bgColor: getRGBA(this.props.backgroundColor), rgba: this.state.rgba }))));
|
|
252
253
|
};
|
|
@@ -16,10 +16,14 @@ export interface ColorInputProps {
|
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
18
|
export default class ColorInput extends React.Component<ColorInputProps, {}> {
|
|
19
|
+
state: {
|
|
20
|
+
inputMode: string;
|
|
21
|
+
};
|
|
19
22
|
render(): JSX.Element;
|
|
20
23
|
private onRgbaRChange;
|
|
21
24
|
private onRgbaGChange;
|
|
22
25
|
private onRgbaBChange;
|
|
23
26
|
private onRgbaAChange;
|
|
24
27
|
private dispatchRgbaChange;
|
|
28
|
+
private onToggleModeChange;
|
|
25
29
|
}
|
|
@@ -25,8 +25,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
import * as React from 'react';
|
|
26
26
|
import { NumericTextBox } from '../main';
|
|
27
27
|
import HexInput from './HexInput';
|
|
28
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
29
|
+
import { Label } from '@progress/kendo-react-labels';
|
|
28
30
|
import { registerForIntl, registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
29
31
|
import { messages, colorGradientR, colorGradientHex, colorGradientA, colorGradientB, colorGradientG } from '../messages';
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
var modes = ['rgb', 'rgba', 'hex'];
|
|
30
36
|
/**
|
|
31
37
|
* @hidden
|
|
32
38
|
*/
|
|
@@ -34,6 +40,9 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
34
40
|
__extends(ColorInput, _super);
|
|
35
41
|
function ColorInput() {
|
|
36
42
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
43
|
+
_this.state = {
|
|
44
|
+
inputMode: modes[1]
|
|
45
|
+
};
|
|
37
46
|
_this.onRgbaRChange = function (event) {
|
|
38
47
|
_this.dispatchRgbaChange({ r: event.value }, event);
|
|
39
48
|
};
|
|
@@ -55,19 +64,30 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
55
64
|
var gMessage = localizationService.toLanguageString(colorGradientR, messages[colorGradientG]);
|
|
56
65
|
var bMessage = localizationService.toLanguageString(colorGradientR, messages[colorGradientB]);
|
|
57
66
|
var aMessage = localizationService.toLanguageString(colorGradientR, messages[colorGradientA]);
|
|
58
|
-
return (React.createElement("div", { className: "k-
|
|
59
|
-
React.createElement("div", { className: "k-
|
|
60
|
-
React.createElement(
|
|
61
|
-
|
|
62
|
-
React.createElement(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
React.createElement(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
return (React.createElement("div", { className: "k-colorgradient-inputs k-hstack" },
|
|
68
|
+
React.createElement("div", { className: "k-vstack" },
|
|
69
|
+
React.createElement(Button, { look: 'flat', icon: 'arrows-kpi', className: "k-colorgradient-toggle-mode k-icon-button", onClick: this.onToggleModeChange.bind(this) })),
|
|
70
|
+
this.state.inputMode === 'hex' &&
|
|
71
|
+
React.createElement("div", { className: "k-vstack k-flex-1" },
|
|
72
|
+
React.createElement("span", { className: "k-hex-value k-textbox" },
|
|
73
|
+
React.createElement(HexInput, { hex: this.props.hex, onHexChange: this.props.onHexChange, disabled: this.props.disabled })),
|
|
74
|
+
React.createElement(Label, { className: "k-colorgradient-input-label" }, hexMessage)),
|
|
75
|
+
(this.state.inputMode === 'rgb' || this.state.inputMode === 'rgba') &&
|
|
76
|
+
React.createElement(React.Fragment, null,
|
|
77
|
+
React.createElement("div", { className: "k-vstack" },
|
|
78
|
+
React.createElement(NumericTextBox, { value: this.props.rgba.r, min: 0, max: 255, spinners: false, format: "n", onChange: this.onRgbaRChange, disabled: this.props.disabled }),
|
|
79
|
+
React.createElement(Label, { className: "k-colorgradient-input-label" }, rMessage)),
|
|
80
|
+
React.createElement("div", { className: "k-vstack" },
|
|
81
|
+
React.createElement(NumericTextBox, { value: this.props.rgba.g, min: 0, max: 255, spinners: false, format: "n", onChange: this.onRgbaGChange, disabled: this.props.disabled }),
|
|
82
|
+
React.createElement(Label, { className: "k-colorgradient-input-label" }, gMessage)),
|
|
83
|
+
React.createElement("div", { className: "k-vstack" },
|
|
84
|
+
React.createElement(NumericTextBox, { value: this.props.rgba.b, min: 0, max: 255, spinners: false, format: "n", onChange: this.onRgbaBChange, disabled: this.props.disabled }),
|
|
85
|
+
React.createElement(Label, { className: "k-colorgradient-input-label" }, bMessage))),
|
|
86
|
+
this.state.inputMode === 'rgba' &&
|
|
87
|
+
React.createElement("div", { className: "k-vstack" },
|
|
88
|
+
this.props.opacity &&
|
|
89
|
+
React.createElement(NumericTextBox, { value: this.props.rgba.a, min: 0, max: 1, step: 0.01, spinners: false, format: "n2", onChange: this.onRgbaAChange, disabled: this.props.disabled }),
|
|
90
|
+
this.props.opacity && (React.createElement(Label, { className: "k-colorgradient-input-label" }, aMessage)))));
|
|
71
91
|
};
|
|
72
92
|
ColorInput.prototype.dispatchRgbaChange = function (newValue, event) {
|
|
73
93
|
var rgba = __assign({}, this.props.rgba);
|
|
@@ -85,6 +105,17 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
85
105
|
}
|
|
86
106
|
this.props.onRgbaChange(rgba, event);
|
|
87
107
|
};
|
|
108
|
+
;
|
|
109
|
+
ColorInput.prototype.onToggleModeChange = function () {
|
|
110
|
+
var index = modes.length - 1 === modes.indexOf(this.state.inputMode) ? 0 : modes.indexOf(this.state.inputMode) + 1;
|
|
111
|
+
if (!this.props.opacity) {
|
|
112
|
+
var nextIndex = modes[index] === 'rgba' ? index + 1 : index;
|
|
113
|
+
this.setState({ inputMode: modes[nextIndex] });
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.setState({ inputMode: modes[index] });
|
|
117
|
+
}
|
|
118
|
+
};
|
|
88
119
|
return ColorInput;
|
|
89
120
|
}(React.Component));
|
|
90
121
|
export default ColorInput;
|
|
@@ -116,11 +116,11 @@ var ColorPalette = /** @class */ (function (_super) {
|
|
|
116
116
|
svc.setColorMatrix(paletteInfo.colors, paletteInfo.columns);
|
|
117
117
|
var selectedCellCoords = svc.getCellCoordsFor(this.state.selectedColor);
|
|
118
118
|
var focusedCellCoords = svc.getCellCoordsFor(this.state.focusedColor);
|
|
119
|
-
var className = classNames('k-
|
|
119
|
+
var className = classNames('k-colorpalette', { 'k-state-disabled': this.props.disabled });
|
|
120
120
|
if (paletteInfo.colors.length) {
|
|
121
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: getTabIndex(this.props.tabIndex, this.props.disabled), ref: function (el) { return _this.wrapper = el; } },
|
|
122
|
-
React.createElement("div", { role: "grid" },
|
|
123
|
-
React.createElement("table", { className: "k-
|
|
122
|
+
React.createElement("div", { className: "k-colorpalette-table-wrap", role: "grid" },
|
|
123
|
+
React.createElement("table", { className: "k-colorpalette-table k-palette", role: "presentation" },
|
|
124
124
|
React.createElement("tbody", null, this.renderRows(svc.colorRows, selectedCellCoords, focusedCellCoords))))));
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
@@ -215,9 +215,9 @@ var ColorPalette = /** @class */ (function (_super) {
|
|
|
215
215
|
var height = tileSize.height + 'px';
|
|
216
216
|
return columns.map(function (color, i) {
|
|
217
217
|
var isSelected = rowIsSelected && selectedColumn === i;
|
|
218
|
-
var className = classNames('k-
|
|
218
|
+
var className = classNames('k-colorpalette-tile', {
|
|
219
219
|
'k-state-selected': isSelected,
|
|
220
|
-
'k-state-
|
|
220
|
+
'k-state-focus': rowIsFocused && focusedColumn === i
|
|
221
221
|
});
|
|
222
222
|
return (React.createElement("td", { className: className, "aria-label": color, "aria-selected": isSelected ? true : _this.props.disabled ? undefined : false, style: { backgroundColor: color, width: width, height: height, minWidth: width }, onClick: function (event) { return _this.onColorClick(color, event); }, id: _this.createCellId({ row: rowIndex, col: i }), key: i }));
|
|
223
223
|
});
|
|
@@ -38,7 +38,7 @@ var HexInput = /** @class */ (function (_super) {
|
|
|
38
38
|
return _this;
|
|
39
39
|
}
|
|
40
40
|
HexInput.prototype.render = function () {
|
|
41
|
-
return (React.createElement("input", { value: this.state.hex, className: "k-
|
|
41
|
+
return (React.createElement("input", { value: this.state.hex, className: "k-input", onChange: this.onChange, onBlur: this.onBlur, disabled: this.props.disabled }));
|
|
42
42
|
};
|
|
43
43
|
HexInput.getDerivedStateFromProps = function (props, state) {
|
|
44
44
|
if (props.hex !== state.originalHex) {
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-inputs',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1636189475,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -46,8 +46,7 @@ var ColorContrastLabels = /** @class */ (function (_super) {
|
|
|
46
46
|
failMessage,
|
|
47
47
|
" ",
|
|
48
48
|
React.createElement("span", { className: "k-icon k-i-close" })));
|
|
49
|
-
return (React.createElement("div", { className: "k-vbox k-color-contrast" },
|
|
50
|
-
React.createElement("span", { className: "k-separator" }),
|
|
49
|
+
return (React.createElement("div", { className: "k-vbox k-colorgradient-color-contrast" },
|
|
51
50
|
React.createElement("div", { className: "k-contrast-ratio" },
|
|
52
51
|
React.createElement("span", { className: "k-contrast-ratio-text" }, contrastText),
|
|
53
52
|
contrast >= 4.5 ? (React.createElement("span", { className: "k-contrast-validation k-text-success" },
|
|
@@ -171,7 +171,7 @@ var ColorGradient = /** @class */ (function (_super) {
|
|
|
171
171
|
style.top = top_1 + "px";
|
|
172
172
|
style.left = left + "px";
|
|
173
173
|
}
|
|
174
|
-
return React.createElement("div", { className: "k-draghandle", style: style });
|
|
174
|
+
return React.createElement("div", { className: "k-hsv-draghandle k-draghandle", style: style });
|
|
175
175
|
};
|
|
176
176
|
/**
|
|
177
177
|
* @hidden
|
|
@@ -238,17 +238,18 @@ var ColorGradient = /** @class */ (function (_super) {
|
|
|
238
238
|
*/
|
|
239
239
|
ColorGradient.prototype.render = function () {
|
|
240
240
|
var _this = this;
|
|
241
|
-
var className = kendo_react_common_1.classNames('k-
|
|
241
|
+
var className = kendo_react_common_1.classNames('k-colorgradient', { 'k-state-disabled': this.props.disabled });
|
|
242
242
|
return (React.createElement("div", { id: this.props.id, className: className, "aria-disabled": this.props.disabled ? 'true' : undefined, style: this.props.style, ref: function (el) { return _this.wrapper = el; }, tabIndex: kendo_react_common_1.getTabIndex(this.props.tabIndex, this.props.disabled), "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy },
|
|
243
|
-
React.createElement("div", { className: "k-
|
|
243
|
+
React.createElement("div", { className: "k-colorgradient-canvas k-hstack" },
|
|
244
244
|
React.createElement("div", { className: "k-hsv-rectangle", style: { background: this.state.backgroundColor } },
|
|
245
245
|
React.createElement(kendo_react_common_1.Draggable, { onDrag: this.onDrag, onRelease: this.onRelease, ref: function (el) { return _this.gradientWrapper = el ? el.element : undefined; } },
|
|
246
246
|
React.createElement("div", { className: "k-hsv-gradient", style: { touchAction: 'none' }, onClick: this.onGradientWrapperClick }, this.renderRectangleDragHandle())),
|
|
247
247
|
this.props.backgroundColor && !this.state.isFirstRender &&
|
|
248
248
|
React.createElement(ColorContrastSvg_1.ColorContrastSvg, { metrics: this.gradientWrapper ? this.getGradientRectMetrics() : undefined, hsva: this.state.hsva, backgroundColor: this.props.backgroundColor })),
|
|
249
|
-
React.createElement("div", { className: "k-
|
|
250
|
-
React.createElement(main_1.Slider, { value: this.state.hsva.h, buttons: false, vertical: true, min: 0, max: 360, step: 5, onChange: this.onHueSliderChange, className: "k-hue-slider", disabled: this.props.disabled }),
|
|
251
|
-
this.props.opacity &&
|
|
249
|
+
React.createElement("div", { className: "k-hsv-controls k-hstack" },
|
|
250
|
+
React.createElement(main_1.Slider, { value: this.state.hsva.h, buttons: false, vertical: true, min: 0, max: 360, step: 5, onChange: this.onHueSliderChange, className: "k-hue-slider k-colorgradient-slider", disabled: this.props.disabled }),
|
|
251
|
+
this.props.opacity &&
|
|
252
|
+
React.createElement(main_1.Slider, { value: misc_1.isPresent(this.state.hsva.a) ? this.state.hsva.a * 100 : 100, buttons: false, vertical: true, min: 0, max: 100, step: 1, onChange: this.onAlphaSliderChange, className: "k-alpha-slider k-colorgradient-slider", disabled: this.props.disabled, ref: function (el) { return _this.alphaSlider = el; } }))),
|
|
252
253
|
React.createElement(ColorInput_1.default, { rgba: this.state.rgba, onRgbaChange: this.onRgbaChange, hex: this.state.hex, onHexChange: this.onHexChange, opacity: this.props.opacity, disabled: this.props.disabled }),
|
|
253
254
|
this.props.backgroundColor && (React.createElement(ColorContrastLabels_1.ColorContrastLabels, { bgColor: color_parser_1.getRGBA(this.props.backgroundColor), rgba: this.state.rgba }))));
|
|
254
255
|
};
|
|
@@ -16,10 +16,14 @@ export interface ColorInputProps {
|
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
18
|
export default class ColorInput extends React.Component<ColorInputProps, {}> {
|
|
19
|
+
state: {
|
|
20
|
+
inputMode: string;
|
|
21
|
+
};
|
|
19
22
|
render(): JSX.Element;
|
|
20
23
|
private onRgbaRChange;
|
|
21
24
|
private onRgbaGChange;
|
|
22
25
|
private onRgbaBChange;
|
|
23
26
|
private onRgbaAChange;
|
|
24
27
|
private dispatchRgbaChange;
|
|
28
|
+
private onToggleModeChange;
|
|
25
29
|
}
|
|
@@ -27,8 +27,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
var React = require("react");
|
|
28
28
|
var main_1 = require("../main");
|
|
29
29
|
var HexInput_1 = require("./HexInput");
|
|
30
|
+
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
31
|
+
var kendo_react_labels_1 = require("@progress/kendo-react-labels");
|
|
30
32
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
31
33
|
var messages_1 = require("../messages");
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
var modes = ['rgb', 'rgba', 'hex'];
|
|
32
38
|
/**
|
|
33
39
|
* @hidden
|
|
34
40
|
*/
|
|
@@ -36,6 +42,9 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
36
42
|
__extends(ColorInput, _super);
|
|
37
43
|
function ColorInput() {
|
|
38
44
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
45
|
+
_this.state = {
|
|
46
|
+
inputMode: modes[1]
|
|
47
|
+
};
|
|
39
48
|
_this.onRgbaRChange = function (event) {
|
|
40
49
|
_this.dispatchRgbaChange({ r: event.value }, event);
|
|
41
50
|
};
|
|
@@ -57,19 +66,30 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
57
66
|
var gMessage = localizationService.toLanguageString(messages_1.colorGradientR, messages_1.messages[messages_1.colorGradientG]);
|
|
58
67
|
var bMessage = localizationService.toLanguageString(messages_1.colorGradientR, messages_1.messages[messages_1.colorGradientB]);
|
|
59
68
|
var aMessage = localizationService.toLanguageString(messages_1.colorGradientR, messages_1.messages[messages_1.colorGradientA]);
|
|
60
|
-
return (React.createElement("div", { className: "k-
|
|
61
|
-
React.createElement("div", { className: "k-
|
|
62
|
-
React.createElement(
|
|
63
|
-
|
|
64
|
-
React.createElement(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
React.createElement(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
return (React.createElement("div", { className: "k-colorgradient-inputs k-hstack" },
|
|
70
|
+
React.createElement("div", { className: "k-vstack" },
|
|
71
|
+
React.createElement(kendo_react_buttons_1.Button, { look: 'flat', icon: 'arrows-kpi', className: "k-colorgradient-toggle-mode k-icon-button", onClick: this.onToggleModeChange.bind(this) })),
|
|
72
|
+
this.state.inputMode === 'hex' &&
|
|
73
|
+
React.createElement("div", { className: "k-vstack k-flex-1" },
|
|
74
|
+
React.createElement("span", { className: "k-hex-value k-textbox" },
|
|
75
|
+
React.createElement(HexInput_1.default, { hex: this.props.hex, onHexChange: this.props.onHexChange, disabled: this.props.disabled })),
|
|
76
|
+
React.createElement(kendo_react_labels_1.Label, { className: "k-colorgradient-input-label" }, hexMessage)),
|
|
77
|
+
(this.state.inputMode === 'rgb' || this.state.inputMode === 'rgba') &&
|
|
78
|
+
React.createElement(React.Fragment, null,
|
|
79
|
+
React.createElement("div", { className: "k-vstack" },
|
|
80
|
+
React.createElement(main_1.NumericTextBox, { value: this.props.rgba.r, min: 0, max: 255, spinners: false, format: "n", onChange: this.onRgbaRChange, disabled: this.props.disabled }),
|
|
81
|
+
React.createElement(kendo_react_labels_1.Label, { className: "k-colorgradient-input-label" }, rMessage)),
|
|
82
|
+
React.createElement("div", { className: "k-vstack" },
|
|
83
|
+
React.createElement(main_1.NumericTextBox, { value: this.props.rgba.g, min: 0, max: 255, spinners: false, format: "n", onChange: this.onRgbaGChange, disabled: this.props.disabled }),
|
|
84
|
+
React.createElement(kendo_react_labels_1.Label, { className: "k-colorgradient-input-label" }, gMessage)),
|
|
85
|
+
React.createElement("div", { className: "k-vstack" },
|
|
86
|
+
React.createElement(main_1.NumericTextBox, { value: this.props.rgba.b, min: 0, max: 255, spinners: false, format: "n", onChange: this.onRgbaBChange, disabled: this.props.disabled }),
|
|
87
|
+
React.createElement(kendo_react_labels_1.Label, { className: "k-colorgradient-input-label" }, bMessage))),
|
|
88
|
+
this.state.inputMode === 'rgba' &&
|
|
89
|
+
React.createElement("div", { className: "k-vstack" },
|
|
90
|
+
this.props.opacity &&
|
|
91
|
+
React.createElement(main_1.NumericTextBox, { value: this.props.rgba.a, min: 0, max: 1, step: 0.01, spinners: false, format: "n2", onChange: this.onRgbaAChange, disabled: this.props.disabled }),
|
|
92
|
+
this.props.opacity && (React.createElement(kendo_react_labels_1.Label, { className: "k-colorgradient-input-label" }, aMessage)))));
|
|
73
93
|
};
|
|
74
94
|
ColorInput.prototype.dispatchRgbaChange = function (newValue, event) {
|
|
75
95
|
var rgba = __assign({}, this.props.rgba);
|
|
@@ -87,6 +107,17 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
87
107
|
}
|
|
88
108
|
this.props.onRgbaChange(rgba, event);
|
|
89
109
|
};
|
|
110
|
+
;
|
|
111
|
+
ColorInput.prototype.onToggleModeChange = function () {
|
|
112
|
+
var index = modes.length - 1 === modes.indexOf(this.state.inputMode) ? 0 : modes.indexOf(this.state.inputMode) + 1;
|
|
113
|
+
if (!this.props.opacity) {
|
|
114
|
+
var nextIndex = modes[index] === 'rgba' ? index + 1 : index;
|
|
115
|
+
this.setState({ inputMode: modes[nextIndex] });
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this.setState({ inputMode: modes[index] });
|
|
119
|
+
}
|
|
120
|
+
};
|
|
90
121
|
return ColorInput;
|
|
91
122
|
}(React.Component));
|
|
92
123
|
exports.default = ColorInput;
|
|
@@ -118,11 +118,11 @@ var ColorPalette = /** @class */ (function (_super) {
|
|
|
118
118
|
svc.setColorMatrix(paletteInfo.colors, paletteInfo.columns);
|
|
119
119
|
var selectedCellCoords = svc.getCellCoordsFor(this.state.selectedColor);
|
|
120
120
|
var focusedCellCoords = svc.getCellCoordsFor(this.state.focusedColor);
|
|
121
|
-
var className = kendo_react_common_1.classNames('k-
|
|
121
|
+
var className = kendo_react_common_1.classNames('k-colorpalette', { 'k-state-disabled': this.props.disabled });
|
|
122
122
|
if (paletteInfo.colors.length) {
|
|
123
123
|
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; } },
|
|
124
|
-
React.createElement("div", { role: "grid" },
|
|
125
|
-
React.createElement("table", { className: "k-
|
|
124
|
+
React.createElement("div", { className: "k-colorpalette-table-wrap", role: "grid" },
|
|
125
|
+
React.createElement("table", { className: "k-colorpalette-table k-palette", role: "presentation" },
|
|
126
126
|
React.createElement("tbody", null, this.renderRows(svc.colorRows, selectedCellCoords, focusedCellCoords))))));
|
|
127
127
|
}
|
|
128
128
|
else {
|
|
@@ -217,9 +217,9 @@ var ColorPalette = /** @class */ (function (_super) {
|
|
|
217
217
|
var height = tileSize.height + 'px';
|
|
218
218
|
return columns.map(function (color, i) {
|
|
219
219
|
var isSelected = rowIsSelected && selectedColumn === i;
|
|
220
|
-
var className = kendo_react_common_1.classNames('k-
|
|
220
|
+
var className = kendo_react_common_1.classNames('k-colorpalette-tile', {
|
|
221
221
|
'k-state-selected': isSelected,
|
|
222
|
-
'k-state-
|
|
222
|
+
'k-state-focus': rowIsFocused && focusedColumn === i
|
|
223
223
|
});
|
|
224
224
|
return (React.createElement("td", { className: className, "aria-label": color, "aria-selected": isSelected ? true : _this.props.disabled ? undefined : false, style: { backgroundColor: color, width: width, height: height, minWidth: width }, onClick: function (event) { return _this.onColorClick(color, event); }, id: _this.createCellId({ row: rowIndex, col: i }), key: i }));
|
|
225
225
|
});
|
|
@@ -40,7 +40,7 @@ var HexInput = /** @class */ (function (_super) {
|
|
|
40
40
|
return _this;
|
|
41
41
|
}
|
|
42
42
|
HexInput.prototype.render = function () {
|
|
43
|
-
return (React.createElement("input", { value: this.state.hex, className: "k-
|
|
43
|
+
return (React.createElement("input", { value: this.state.hex, className: "k-input", onChange: this.onChange, onBlur: this.onBlur, disabled: this.props.disabled }));
|
|
44
44
|
};
|
|
45
45
|
HexInput.getDerivedStateFromProps = function (props, state) {
|
|
46
46
|
if (props.hex !== state.originalHex) {
|
|
@@ -7,7 +7,7 @@ exports.packageMetadata = {
|
|
|
7
7
|
name: '@progress/kendo-react-inputs',
|
|
8
8
|
productName: 'KendoReact',
|
|
9
9
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
10
|
-
publishDate:
|
|
10
|
+
publishDate: 1636189475,
|
|
11
11
|
version: '',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
13
13
|
};
|