@progress/kendo-react-inputs 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823
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 +2 -1
- package/dist/es/maskedtextbox/MaskedTextBox.d.ts +7 -7
- package/dist/es/maskedtextbox/MaskedTextBox.js +7 -6
- package/dist/es/maskedtextbox/parsing/parsers.d.ts +2 -2
- package/dist/es/maskedtextbox/parsing/parsers.js +28 -32
- 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.d.ts +1 -1
- package/dist/es/numerictextbox/utils/index.js +5 -5
- 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 +7 -6
- 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/parsers.d.ts +2 -2
- package/dist/npm/maskedtextbox/parsing/parsers.js +28 -32
- 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.d.ts +1 -1
- package/dist/npm/numerictextbox/utils/index.js +61 -61
- 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
|
@@ -35,16 +35,20 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
35
35
|
__extends(ColorGradientWithoutContext, _super);
|
|
36
36
|
function ColorGradientWithoutContext(props) {
|
|
37
37
|
var _this = _super.call(this, props) || this;
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
_this.wrapper = null;
|
|
38
42
|
/**
|
|
39
43
|
* @hidden
|
|
40
44
|
*/
|
|
41
45
|
_this.onHexChange = function (hex, value, event) {
|
|
42
46
|
if (_this.isUncontrolled) {
|
|
43
|
-
var hsva = color_parser_1.getHSV(value);
|
|
44
|
-
_this.setState({ hsva: hsva, backgroundColor: color_parser_1.getColorFromHue(hsva.h), rgba: color_parser_1.getRGBA(value), hex: hex });
|
|
47
|
+
var hsva = (0, color_parser_1.getHSV)(value);
|
|
48
|
+
_this.setState({ hsva: hsva, backgroundColor: (0, color_parser_1.getColorFromHue)(hsva.h), rgba: (0, color_parser_1.getRGBA)(value), hex: hex });
|
|
45
49
|
}
|
|
46
50
|
else {
|
|
47
|
-
color_cache_1.cacheHex(_this.state.guid, value, hex);
|
|
51
|
+
(0, color_cache_1.cacheHex)(_this.state.guid, value, hex);
|
|
48
52
|
}
|
|
49
53
|
_this.dispatchChangeEvent(value, event, event.nativeEvent);
|
|
50
54
|
};
|
|
@@ -52,14 +56,14 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
52
56
|
* @hidden
|
|
53
57
|
*/
|
|
54
58
|
_this.onRgbaChange = function (rgba, event) {
|
|
55
|
-
var value = color_parser_1.getColorFromRGBA(rgba);
|
|
59
|
+
var value = (0, color_parser_1.getColorFromRGBA)(rgba);
|
|
56
60
|
if (_this.isUncontrolled) {
|
|
57
|
-
var hsva = color_parser_1.getHSV(value);
|
|
58
|
-
var hex = color_parser_1.parseColor(value, 'hex');
|
|
59
|
-
_this.setState({ hsva: hsva, backgroundColor: color_parser_1.getColorFromHue(hsva.h), rgba: rgba, hex: hex });
|
|
61
|
+
var hsva = (0, color_parser_1.getHSV)(value);
|
|
62
|
+
var hex = (0, color_parser_1.parseColor)(value, 'hex');
|
|
63
|
+
_this.setState({ hsva: hsva, backgroundColor: (0, color_parser_1.getColorFromHue)(hsva.h), rgba: rgba, hex: hex });
|
|
60
64
|
}
|
|
61
65
|
else {
|
|
62
|
-
color_cache_1.cacheRgba(_this.state.guid, value, rgba);
|
|
66
|
+
(0, color_cache_1.cacheRgba)(_this.state.guid, value, rgba);
|
|
63
67
|
}
|
|
64
68
|
_this.dispatchChangeEvent(value, event.syntheticEvent, event.nativeEvent);
|
|
65
69
|
};
|
|
@@ -101,8 +105,8 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
101
105
|
var gradientRectMetrics = _this.getGradientRectMetrics();
|
|
102
106
|
var deltaX = event.clientX - gradientRectMetrics.left;
|
|
103
107
|
var deltaY = event.clientY - gradientRectMetrics.top;
|
|
104
|
-
var left = misc_1.fitIntoBounds(deltaX, 0, gradientRectMetrics.width);
|
|
105
|
-
var top = misc_1.fitIntoBounds(deltaY, 0, gradientRectMetrics.height);
|
|
108
|
+
var left = (0, misc_1.fitIntoBounds)(deltaX, 0, gradientRectMetrics.width);
|
|
109
|
+
var top = (0, misc_1.fitIntoBounds)(deltaY, 0, gradientRectMetrics.height);
|
|
106
110
|
var hsva = Object.assign({}, _this.state.hsva, { s: left / gradientRectMetrics.width, v: 1 - top / gradientRectMetrics.height });
|
|
107
111
|
_this.handleHsvaChange(hsva, event, event.nativeEvent);
|
|
108
112
|
};
|
|
@@ -118,11 +122,11 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
118
122
|
* @hidden
|
|
119
123
|
*/
|
|
120
124
|
_this.focus = function () {
|
|
121
|
-
kendo_react_common_1.focusFirstFocusableChild(_this.wrapper);
|
|
125
|
+
(0, kendo_react_common_1.focusFirstFocusableChild)(_this.wrapper);
|
|
122
126
|
};
|
|
123
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
124
|
-
var value = props.value || props.defaultValue || color_parser_1.parseColor(DEFAULT_SELECTED_COLOR, FORMAT);
|
|
125
|
-
_this.state = Object.assign({}, ColorGradientWithoutContext.getStateFromValue(value), { isFirstRender: true, guid: kendo_react_common_1.guid() });
|
|
127
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
128
|
+
var value = props.value || props.defaultValue || (0, color_parser_1.parseColor)(DEFAULT_SELECTED_COLOR, FORMAT);
|
|
129
|
+
_this.state = Object.assign({}, ColorGradientWithoutContext.getStateFromValue(value), { isFirstRender: true, guid: (0, kendo_react_common_1.guid)() });
|
|
126
130
|
return _this;
|
|
127
131
|
}
|
|
128
132
|
/**
|
|
@@ -148,7 +152,7 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
148
152
|
* @hidden
|
|
149
153
|
*/
|
|
150
154
|
ColorGradientWithoutContext.prototype.componentWillUnmount = function () {
|
|
151
|
-
color_cache_1.removeCachedColor(this.state.guid);
|
|
155
|
+
(0, color_cache_1.removeCachedColor)(this.state.guid);
|
|
152
156
|
};
|
|
153
157
|
/**
|
|
154
158
|
* @hidden
|
|
@@ -167,8 +171,8 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
167
171
|
var gradientRectMetrics = this.getGradientRectMetrics();
|
|
168
172
|
var top_1 = (1 - this.state.hsva.v) * gradientRectMetrics.height;
|
|
169
173
|
var left = this.state.hsva.s * gradientRectMetrics.width;
|
|
170
|
-
style.top = top_1
|
|
171
|
-
style.left = left
|
|
174
|
+
style.top = "".concat(top_1, "px");
|
|
175
|
+
style.left = "".concat(left, "px");
|
|
172
176
|
}
|
|
173
177
|
return React.createElement("div", { className: "k-hsv-draghandle k-draghandle", style: style });
|
|
174
178
|
};
|
|
@@ -176,13 +180,13 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
176
180
|
* @hidden
|
|
177
181
|
*/
|
|
178
182
|
ColorGradientWithoutContext.prototype.handleHsvaChange = function (hsva, syntheticEvent, nativeEvent) {
|
|
179
|
-
var value = color_parser_1.getColorFromHSV(hsva);
|
|
183
|
+
var value = (0, color_parser_1.getColorFromHSV)(hsva);
|
|
180
184
|
if (this.isUncontrolled) {
|
|
181
|
-
var hex = color_parser_1.parseColor(value, 'hex');
|
|
182
|
-
this.setState({ hsva: hsva, backgroundColor: color_parser_1.getColorFromHue(hsva.h), rgba: color_parser_1.getRGBA(value), hex: hex });
|
|
185
|
+
var hex = (0, color_parser_1.parseColor)(value, 'hex');
|
|
186
|
+
this.setState({ hsva: hsva, backgroundColor: (0, color_parser_1.getColorFromHue)(hsva.h), rgba: (0, color_parser_1.getRGBA)(value), hex: hex });
|
|
183
187
|
}
|
|
184
188
|
else {
|
|
185
|
-
color_cache_1.cacheHsva(this.state.guid, value, hsva);
|
|
189
|
+
(0, color_cache_1.cacheHsva)(this.state.guid, value, hsva);
|
|
186
190
|
}
|
|
187
191
|
this.dispatchChangeEvent(value, syntheticEvent, nativeEvent);
|
|
188
192
|
};
|
|
@@ -198,14 +202,14 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
198
202
|
* @hidden
|
|
199
203
|
*/
|
|
200
204
|
ColorGradientWithoutContext.getStateFromValue = function (value, componentGuid) {
|
|
201
|
-
if (!misc_1.isPresent(color_parser_1.parseColor(value, 'hex'))) {
|
|
205
|
+
if (!(0, misc_1.isPresent)((0, color_parser_1.parseColor)(value, 'hex'))) {
|
|
202
206
|
// Validate/sanitize the input.
|
|
203
207
|
value = DEFAULT_SELECTED_COLOR;
|
|
204
208
|
}
|
|
205
|
-
var hsva = color_cache_1.getCachedHsva(componentGuid, value) || color_parser_1.getHSV(value);
|
|
206
|
-
var rgba = color_cache_1.getCachedRgba(componentGuid, value) || color_parser_1.getRGBA(value);
|
|
207
|
-
var hex = color_cache_1.getCachedHex(componentGuid, value) || color_parser_1.parseColor(value, 'hex');
|
|
208
|
-
var backgroundColor = color_parser_1.getColorFromHue(hsva.h);
|
|
209
|
+
var hsva = (0, color_cache_1.getCachedHsva)(componentGuid, value) || (0, color_parser_1.getHSV)(value);
|
|
210
|
+
var rgba = (0, color_cache_1.getCachedRgba)(componentGuid, value) || (0, color_parser_1.getRGBA)(value);
|
|
211
|
+
var hex = (0, color_cache_1.getCachedHex)(componentGuid, value) || (0, color_parser_1.parseColor)(value, 'hex');
|
|
212
|
+
var backgroundColor = (0, color_parser_1.getColorFromHue)(hsva.h);
|
|
209
213
|
return { hsva: hsva, backgroundColor: backgroundColor, rgba: rgba, hex: hex };
|
|
210
214
|
};
|
|
211
215
|
/**
|
|
@@ -213,7 +217,7 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
213
217
|
*/
|
|
214
218
|
ColorGradientWithoutContext.prototype.setAlphaSliderBackground = function (backgroundColor) {
|
|
215
219
|
if (this.props.opacity && this.alphaSlider && this.alphaSlider.sliderTrack) {
|
|
216
|
-
this.alphaSlider.sliderTrack.style.background = "linear-gradient(to top, transparent, "
|
|
220
|
+
this.alphaSlider.sliderTrack.style.background = "linear-gradient(to top, transparent, ".concat(backgroundColor, ")");
|
|
217
221
|
}
|
|
218
222
|
};
|
|
219
223
|
Object.defineProperty(ColorGradientWithoutContext.prototype, "isUncontrolled", {
|
|
@@ -237,8 +241,8 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
237
241
|
*/
|
|
238
242
|
ColorGradientWithoutContext.prototype.render = function () {
|
|
239
243
|
var _this = this;
|
|
240
|
-
var className = kendo_react_common_1.classNames('k-colorgradient', { 'k-disabled': this.props.disabled });
|
|
241
|
-
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, onFocus: this.onFocus },
|
|
244
|
+
var className = (0, kendo_react_common_1.classNames)('k-colorgradient', { 'k-disabled': this.props.disabled });
|
|
245
|
+
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: (0, kendo_react_common_1.getTabIndex)(this.props.tabIndex, this.props.disabled), "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, onFocus: this.onFocus },
|
|
242
246
|
React.createElement("div", { className: "k-colorgradient-canvas k-hstack" },
|
|
243
247
|
React.createElement("div", { className: "k-hsv-rectangle", style: { background: this.state.backgroundColor } },
|
|
244
248
|
React.createElement(kendo_react_common_1.Draggable, { onDrag: this.onDrag, onRelease: this.onRelease, ref: function (el) { return _this.gradientWrapper = el ? el.element : undefined; } },
|
|
@@ -248,9 +252,9 @@ var ColorGradientWithoutContext = /** @class */ (function (_super) {
|
|
|
248
252
|
React.createElement("div", { className: "k-hsv-controls k-hstack" },
|
|
249
253
|
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 }),
|
|
250
254
|
this.props.opacity &&
|
|
251
|
-
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; } }))),
|
|
255
|
+
React.createElement(main_1.Slider, { value: (0, 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
256
|
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
|
-
this.props.backgroundColor && (React.createElement(ColorContrastLabels_1.ColorContrastLabels, { bgColor: color_parser_1.getRGBA(this.props.backgroundColor), rgba: this.state.rgba }))));
|
|
257
|
+
this.props.backgroundColor && (React.createElement(ColorContrastLabels_1.ColorContrastLabels, { bgColor: (0, color_parser_1.getRGBA)(this.props.backgroundColor), rgba: this.state.rgba }))));
|
|
254
258
|
};
|
|
255
259
|
ColorGradientWithoutContext.displayName = 'ColorGradient';
|
|
256
260
|
/**
|
|
@@ -284,7 +288,7 @@ exports.ColorGradientWithoutContext = ColorGradientWithoutContext;
|
|
|
284
288
|
*
|
|
285
289
|
* For more information, refer to the [Inputs Props Context]({% slug props-context_inputs %}) article.
|
|
286
290
|
*/
|
|
287
|
-
exports.ColorGradientPropsContext = kendo_react_common_1.createPropsContext();
|
|
291
|
+
exports.ColorGradientPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
288
292
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
289
293
|
/**
|
|
290
294
|
* Represents the [KendoReact ColorGradient component]({% slug overview_colorgradient %}).
|
|
@@ -302,5 +306,5 @@ exports.ColorGradientPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
302
306
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
303
307
|
* ```
|
|
304
308
|
*/
|
|
305
|
-
exports.ColorGradient = kendo_react_common_1.withPropsContext(exports.ColorGradientPropsContext, ColorGradientWithoutContext);
|
|
309
|
+
exports.ColorGradient = (0, kendo_react_common_1.withPropsContext)(exports.ColorGradientPropsContext, ColorGradientWithoutContext);
|
|
306
310
|
exports.ColorGradient.displayName = 'KendoReactColorGradient';
|
|
@@ -62,7 +62,7 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
62
62
|
return _this;
|
|
63
63
|
}
|
|
64
64
|
ColorInput.prototype.render = function () {
|
|
65
|
-
var localizationService = kendo_react_intl_1.provideLocalizationService(this);
|
|
65
|
+
var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
66
66
|
var hexMessage = localizationService.toLanguageString(messages_1.colorGradientR, messages_1.messages[messages_1.colorGradientHex]);
|
|
67
67
|
var rMessage = localizationService.toLanguageString(messages_1.colorGradientR, messages_1.messages[messages_1.colorGradientR]);
|
|
68
68
|
var gMessage = localizationService.toLanguageString(messages_1.colorGradientR, messages_1.messages[messages_1.colorGradientG]);
|
|
@@ -123,5 +123,5 @@ var ColorInput = /** @class */ (function (_super) {
|
|
|
123
123
|
return ColorInput;
|
|
124
124
|
}(React.Component));
|
|
125
125
|
exports.default = ColorInput;
|
|
126
|
-
kendo_react_intl_1.registerForIntl(ColorInput);
|
|
127
|
-
kendo_react_intl_1.registerForLocalization(ColorInput);
|
|
126
|
+
(0, kendo_react_intl_1.registerForIntl)(ColorInput);
|
|
127
|
+
(0, kendo_react_intl_1.registerForLocalization)(ColorInput);
|
|
@@ -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);
|