UNPKG

@progress/kendo-react-editor

Version:
30 lines 1.28 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var kendo_react_inputs_1 = require("@progress/kendo-react-inputs"); var kendo_editor_common_1 = require("@progress/kendo-editor-common"); /** * @hidden */ exports.ApplyColorTool = function (props) { var view = props.view, style = props.style, colorPickerProps = props.colorPickerProps, commandName = props.commandName; var onChange = React.useCallback(function (event) { if (view) { kendo_editor_common_1.applyInlineStyle({ style: style, value: event.value }, commandName)(view.state, view.dispatch); view.focus(); } }, [view, style, commandName]); return (React.createElement(kendo_react_inputs_1.ColorPicker, __assign({ onChange: onChange, onActiveColorClick: onChange }, colorPickerProps))); }; //# sourceMappingURL=applyColor.js.map