UNPKG

@progress/kendo-editor-react-wrapper

Version:

Kendo UI Editor wrapper for React

2 lines 3.82 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.KendoEditorReactWrapper=e(require("react")):t.KendoEditorReactWrapper=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2);e.Editor=o.default},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},r.apply(this,arguments)},i=this&&this.__rest||function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&(n[o[r]]=t[o[r]]);return n};Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),c=n(3),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.componentDidMount=function(){var e=this.domNode,n=this.props,o=(n.children,n.widgetRef,i(n,["children","widgetRef"]));e&&(this.widgetInstance=new kendo.ui.Editor(e,o),t.prototype.componentDidMount.call(this))},e.prototype.render=function(){if(this.didMount){var t=this.props,e=(t.children,t.widgetRef,i(t,["children","widgetRef"]));this.widgetInstance.setOptions(e),this.widgetInstance.value(e.value)}var n=s.Children.toArray(this.props.children).shift();return n?s.cloneElement(n,r({},n.props,{ref:this.elementRef})):s.createElement("textarea",{ref:this.elementRef})},e}(c.default);e.default=u},function(t,e,n){"use strict";var o=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.didMount=!1,e.elementRef=function(t){e.domNode=t},e.exposeWidget=function(){e.props.widgetRef&&"function"==typeof e.props.widgetRef&&e.props.widgetRef(e.widgetInstance)},e.overrideDestroy=function(){e.widgetDestroy=e.widgetInstance.destroy,e.widgetInstance.destroy=function(){e.destroyed=!e.destroyed,e.widgetDestroy.call(e.widgetInstance)}},e}return o(e,t),e.prototype.componentDidMount=function(){this.exposeWidget(),this.overrideDestroy(),this.didMount=!0},e.prototype.componentWillUnmount=function(){this.destroyed||this.widgetDestroy.call(this.widgetInstance),this.exposeWidget()},e}(r.PureComponent);e.default=i}])}); //# sourceMappingURL=kendo-editor-react-wrapper.min.js.map