@syncfusion/ej2-react-base
Advanced tools
Comparing version 20.1.58 to 20.1.59
@@ -9,4 +9,12 @@ # Changelog | ||
- `EJ2-59569` - Resolved the "Dashboard layout component crash while using cell spacing" issue in react component. | ||
- `#I381890` - "Script error occurred while using the routing in React 18 sample," issue has been resolved. | ||
## 20.1.58 (2022-05-31) | ||
### Common | ||
#### Bug Fixes | ||
- `#I366207` - Resolved the "Dashboard layout component crash while using cell spacing" issue in react component. | ||
## 20.1.57 (2022-05-24) | ||
@@ -36,3 +44,3 @@ | ||
- `I339589` - Resolved the `DropdownButton` issue with react component as target. | ||
- `#I339589` - Resolved the `DropdownButton` issue with react component as target. | ||
@@ -43,5 +51,5 @@ ## 19.1.67 (2021-06-08) | ||
- `F164392` - Resolved the issue with Value is not updated if we update the state in `useEffect()` hook for `Dropdownlist`. | ||
- `#F164392` - Resolved the issue with Value is not updated if we update the state in `useEffect()` hook for `Dropdownlist`. | ||
- `I324905` - Resolved the issue with `editTemplate` methods are reassigned to other columns while reordering and applying `setState`. | ||
- `#I324905` - Resolved the issue with `editTemplate` methods are reassigned to other columns while reordering and applying `setState`. | ||
@@ -52,3 +60,3 @@ ## 19.1.65 (2021-05-25) | ||
- `F165452` - Resolved the issue with destroy event while using toolbar template. | ||
- `#F165452` - Resolved the issue with destroy event while using toolbar template. | ||
@@ -59,3 +67,3 @@ ## 19.1.64 (2021-05-19) | ||
- `F165103` - Resolved the issue with Maximum call stack size exceeded" when updating state variable using `useEffect`. | ||
- `#F165103` - Resolved the issue with Maximum call stack size exceeded" when updating state variable using `useEffect`. | ||
@@ -68,5 +76,5 @@ ## 19.1.57 (2021-04-20) | ||
- `I321145` - Resolved the issue with Data binding not working properly while changing values in complex array. | ||
- `#I321145` - Resolved the issue with Data binding not working properly while changing values in complex array. | ||
- `F164536` - Resolved the Peer dependency warning issue. | ||
- `#F164536` - Resolved the Peer dependency warning issue. | ||
@@ -73,0 +81,0 @@ ## 18.3.35 (2020-10-01) |
/*! | ||
* filename: ej2-react-base.umd.min.js | ||
* version : 20.1.58 | ||
* version : 20.1.59 | ||
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. | ||
@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@syncfusion/ej2-base"],t):t(e.ej={},e.React,e.ReactDOM,e.ej2Base)}(this,function(e,t,r,i){"use strict";function s(e,s){return"string"==typeof e?f(e,s):function(s,o,n,a){var p=e,l=s;"object"==typeof p&&(p=e.template,l=i.extend({},s,e.data||{}));var h;h=a||document.createElement("div");var c=t.createElement(p,l),u=r.createPortal(c,h);if(u.propName=n,o.portals?o.portals.push(u):o.portals=[u],!a)return[h]}}var o=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=["alt","className","disabled","form","id","readOnly","style","tabIndex","title","type","name","onClick","onFocus","onBlur"],a=["accordion","tab","splitter"],p=new RegExp("]"),l=function(e){function s(){var t=null!==e&&e.apply(this,arguments)||this;return t.mountingState=!1,t.attrKeys=[],t.cachedTimeOut=0,t.isAppendCalled=!1,t.initRenderCalled=!1,t.isReactForeceUpdate=!1,t.isReact=!0,t.isshouldComponentUpdateCalled=!1,t.isCreated=!1,t}return o(s,e),s.prototype.componentDidMount=function(){this.refreshChild(!0),this.canDelayUpdate=-1!==a.indexOf(this.getModuleName()),this.renderReactComponent(),this.portals&&this.portals.length&&(this.mountingState=!0,this.renderReactTemplates(),this.mountingState=!1)},s.prototype.componentDidUpdate=function(e){this.isshouldComponentUpdateCalled||!this.initRenderCalled||this.isReactForeceUpdate||(this.isshouldComponentUpdateCalled=!0,e!==this.props&&this.refreshProperties(this.props,!0))},s.prototype.renderReactComponent=function(){var e=this.reactElement;e&&!this.isAppendCalled&&(this.isAppendCalled=!0,this.appendTo(e))},s.prototype.shouldComponentUpdate=function(e){return this.isshouldComponentUpdateCalled=!0,this.initRenderCalled?(this.isAppendCalled||(clearTimeout(this.cachedTimeOut),this.isAppendCalled=!0,this.appendTo(this.reactElement)),this.updateProperties(e),!0):(this.updateProperties(e,!0),!0)},s.prototype.updateProperties=function(e,t){for(var r=this,s=i.extend({},e),o=0,n=Object.keys(e);o<n.length;o++){var a=n[o],p="className"===a;if("children"!==a)if(p||i.isNullOrUndefined(this.htmlattributes[a])||this.htmlattributes[a]===s[a]||(this.htmlattributes[a]=s[a]),this.compareValues(this.props[a],e[a]))delete s[a];else if(-1!==this.attrKeys.indexOf(a))if(p){this.clsName=!0;for(var l=this.props[a].split(" "),h=0;h<l.length;h++)this.element.classList.remove(l[h]);for(var c=s[a].split(" "),u=0;u<c.length;u++)this.element.classList.add(c[u])}else"disabled"!==a&&delete s[a];else"value"===a&&e[a]===this[a]?delete s[a]:"valueTemplate"!==a&&"itemTemplate"!==a&&"headerTemplate"!==a||e[a].toString()!==this[a].toString()?"content"===a&&"function"==typeof s[a]&&delete s[a]:delete s[a]}s.children&&delete s.children,this.initRenderCalled&&(this.canDelayUpdate||this.props.delayUpdate)?setTimeout(function(){r.refreshProperties(s,e,t)}):this.refreshProperties(s,e,t)},s.prototype.refreshProperties=function(e,t,r){Object.keys(e).length&&(r||this.processComplexTemplate(e,this),this.setProperties(e,r)),this.refreshChild(r,t)},s.prototype.processComplexTemplate=function(e,t){var r=t.complexTemplate;if(r)for(var s in r){var o=r[s];e[s]&&i.setValue(o,i.getValue(s,e),e)}},s.prototype.getDefaultAttributes=function(){var e=this;this.isReact=!0;var t=Object.keys(this.props);this.htmlattributes||(this.htmlattributes={}),this.attrKeys=n.concat(this.controlAttributes||[]);for(var r=0,i=t;r<i.length;r++){var o=i[r];-1===o.indexOf("data-")&&-1===o.indexOf("aria-")&&-1===this.attrKeys.indexOf(o)||this.htmlattributes[o]!==this.props[o]&&(this.htmlattributes[o]=this.props[o])}if(!this.htmlattributes.ref){this.htmlattributes.ref=function(t){e.reactElement=t};-1!==["autocomplete","combobox","dropdownlist","dropdowntree","multiselect","listbox","colorpicker","numerictextbox","textbox","uploader","maskedtextbox","slider","datepicker","datetimepicker","daterangepicker","timepicker","checkbox","switch","radio"].indexOf(this.getModuleName())&&(this.htmlattributes.key=""+s.reactUid,s.reactUid++)}if(this.clsName){for(var a=this.element.classList,p=this.htmlattributes.className,l=0;l<a.length;l++)-1==p.indexOf(a[l])&&(this.htmlattributes.className=this.htmlattributes.className+" "+a[l]);this.clsName=!1}return this.htmlattributes},s.prototype.trigger=function(e,t,r){var s=this;if(!0!==this.isDestroyed&&this.modelObserver){if(p.test(e)){var o=i.getValue(e,this);o?(o.call(this,t),r&&r.call(this,t)):r&&r.call(this,t)}"change"!==e&&"input"!==e||this.props.onChange&&t.event&&this.props.onChange.call(void 0,{syntheticEvent:t.event,nativeEvent:{text:t.value},value:t.value,target:this});var n=this.isProtectedOnChange;this.isProtectedOnChange=!1,"created"===e?setTimeout(function(){s.isCreated=!0,s.isDestroyed||s.modelObserver.notify(e,t,r)}):this.modelObserver.notify(e,t,r),this.isProtectedOnChange=n}},s.prototype.compareValues=function(e,t){if(typeof e===typeof t){if(e===t)return!0;if((!i.isNullOrUndefined(e)&&e.constructor)!==(!i.isNullOrUndefined(t)&&t.constructor))return!1;if(e instanceof Date||e instanceof RegExp||e instanceof String||e instanceof Number)return e.toString()===t.toString();if(i.isObject(e)||Array.isArray(e)){var r=e,s=t;return i.isObject(r)&&(r=[e],s=[t]),this.compareObjects(r,s).status}}return!1},s.prototype.compareObjects=function(e,t,r){var i=!0,s=[];if(e.length===t.length)for(var o=0,n=t.length;o<n;o++){var a={},p=e[o],l=t[o],h=Object.keys(l);if(0!==h.length)for(var c=0,u=h;c<u.length;c++){var d=u[c],f=p[d],m=l[d];if("items"===d)for(var y=0;y<m.length;y++)if("richtexteditor"===this.getModuleName()&&"object"==typeof m[y])return{status:!0};if("grid"===this.getModuleName()&&"field"===d&&(a[d]=m),!p.hasOwnProperty(d)||!this.compareValues(f,m)){if(!r)return{status:!1};i=!1,a[d]=m}}else if(l[o]===p[o])i=!0;else{if(!r)return{status:!1};i=!1}Object.keys(a).length&&s.push({index:o,value:a,key:r})}else i=!1;return{status:i,changedProperties:s}},s.prototype.refreshChild=function(e,t){if(this.checkInjectedModules){for(var r=this.getInjectedModules()||[],s=0,o=this.getInjectedServices()||[];s<o.length;s++){var n=o[s];-1===r.indexOf(n)&&r.push(n)}this.injectedModules=r}if(this.directivekeys){var a=[],p=this.validateChildren({},this.directivekeys,t||this.props);if(p&&Object.keys(p).length){if(!e&&this.skipRefresh)for(var l=0,h=this.skipRefresh;l<h.length;l++){delete p[h[l]]}if(this.prevProperties)for(var c=Object.keys(this.prevProperties),u=0;u<c.length;u++){var d=c[u];if(p.hasOwnProperty(d)){var f=this.compareObjects(this.prevProperties[d],p[d],d);if(f.status)delete p[d];else{f.changedProperties.length&&(a=a.concat(f.changedProperties));var m={};m[d]=p[d],this.prevProperties=i.extend(this.prevProperties,m)}}}else this.prevProperties=i.extend({},p,{},!0);if(a.length)if("grid"===this.getModuleName()&&"columns"===d)for(var y=0,v=this.columns;y<v.length;y++){if(i.getValue("field",v[y])===i.getValue(y+".value.field",a)){var g=i.getValue(a[y].key+"."+a[y].index,this);g&&g.setProperties?g.setProperties(a[y].value):i.extend(g,a[y].value)}else this.setProperties(p,e)}else for(var b=0,C=a;b<C.length;b++){var O=C[b],x=i.getValue(O.key+"."+O.index,this);x&&x.setProperties?x.setProperties(O.value):i.extend(x,O.value)}else this.setProperties(p,e)}}},s.prototype.componentWillUnmount=function(){clearTimeout(this.cachedTimeOut);this.initRenderCalled&&this.isAppendCalled&&this.element&&(["dropdowntree","checkbox"].indexOf(this.getModuleName())||document.body.contains(this.element))&&!this.isDestroyed&&this.isCreated&&this.destroy()},s.prototype.appendReactElement=function(e,t){var i=r.createPortal(e,t);this.portals?this.portals.push(i):this.portals=[i]},s.prototype.intForceUpdate=function(e){var s=this,o=i.getValue("flushSync",r),n=t.version.split(".")[0];parseInt(n)>=18&&this.initRenderCalled&&o&&!this.mountingState?o(function(){s.forceUpdate(e)}):this.forceUpdate(e)},s.prototype.renderReactTemplates=function(e){this.isReactForeceUpdate=!0,this.intForceUpdate(e),this.isReactForeceUpdate=!1},s.prototype.clearTemplate=function(e,t,r){var i=this,s=[];e&&e.length?Array.prototype.forEach.call(e,function(e){var r=0,o=0;if(i.portals.forEach(function(t){t.propName===e&&(s.push(o),o++)}),t&&i.portals[s[t[r]]].propName==e)i.portals.splice(t,1),r++;else for(var n=0;n<i.portals.length;n++)i.portals[n].propName==e&&(i.portals.splice(n,1),n--)}):this.portals=[],this.renderReactTemplates(r)},s.prototype.validateChildren=function(e,r,i){for(var s=!1,o=0,n=t.Children.toArray(i.children);o<n.length;o++){var a=n[o],p=this.getChildType(a),l=r[p];if(p&&r){var h=this.getChildProps(t.Children.toArray(a.props.children),l);h.length&&(s=!0,e[a.type.propertyName||p]=h)}}return s?e:null},s.prototype.getChildType=function(e){return e.type&&e.type.isDirective?e.type.moduleName||"":""},s.prototype.getChildProps=function(e,t){for(var r=[],s=0,o=e;s<o.length;s++){var n=o[s],a=!1,p=void 0;"string"==typeof t?(a=!0,p=t):p=Object.keys(t)[0];var l=n.props;if(this.getChildType(n)===p)if(a||!l.children){var h=i.extend({},l,{},!0);this.processComplexTemplate(h,n.type),r.push(h)}else{var c=this.validateChildren(i.extend({},l),t[p],l)||l;c.children&&delete c.children,this.processComplexTemplate(c,n.type),r.push(c)}}return r},s.prototype.getInjectedServices=function(){for(var e=0,r=t.Children.toArray(this.props.children);e<r.length;e++){var i=r[e];if(i.type.isService)return i.props.services}return[]},s.reactUid=1,s}(t.Component),h=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t.prototype.render=function(){return null},t.isDirective=!0,t}(t.PureComponent),u=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){return null},t.isService=!0,t}(t.PureComponent),f=i.getTemplateEngine();i.setTemplateEngine({compile:s}),e.ComponentBase=l,e.applyMixins=function(e,t){t.forEach(function(t){Object.getOwnPropertyNames(t.prototype).forEach(function(r){"isMounted"!==r&&"replaceState"!==r&&(e.prototype[r]=t.prototype[r])})})},e.ComplexBase=c,e.Inject=d,e.compile=s,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@syncfusion/ej2-base"],t):t(e.ej={},e.React,e.ReactDOM,e.ej2Base)}(this,function(e,t,r,i){"use strict";function s(e,s){return"string"==typeof e?f(e,s):function(s,o,n,a){var p=e,l=s;"object"==typeof p&&(p=e.template,l=i.extend({},s,e.data||{}));var h;h=a||document.createElement("div");var c=t.createElement(p,l),u=r.createPortal(c,h);if(u.propName=n,o.portals?o.portals.push(u):o.portals=[u],!a)return[h]}}var o=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),n=["alt","className","disabled","form","id","readOnly","style","tabIndex","title","type","name","onClick","onFocus","onBlur"],a=["accordion","tab","splitter"],p=new RegExp("]"),l=function(e){function s(){var t=null!==e&&e.apply(this,arguments)||this;return t.mountingState=!1,t.attrKeys=[],t.cachedTimeOut=0,t.isAppendCalled=!1,t.initRenderCalled=!1,t.isReactForeceUpdate=!1,t.isReact=!0,t.isshouldComponentUpdateCalled=!1,t.isCreated=!1,t}return o(s,e),s.prototype.componentDidMount=function(){this.refreshChild(!0),this.canDelayUpdate=-1!==a.indexOf(this.getModuleName()),this.renderReactComponent(),this.portals&&this.portals.length&&(this.mountingState=!0,this.renderReactTemplates(),this.mountingState=!1)},s.prototype.componentDidUpdate=function(e){this.isshouldComponentUpdateCalled||!this.initRenderCalled||this.isReactForeceUpdate||(this.isshouldComponentUpdateCalled=!0,e!==this.props&&this.refreshProperties(this.props,!0))},s.prototype.renderReactComponent=function(){var e=this.reactElement;e&&!this.isAppendCalled&&(this.isAppendCalled=!0,this.appendTo(e))},s.prototype.shouldComponentUpdate=function(e){return this.isshouldComponentUpdateCalled=!0,this.initRenderCalled?(this.isAppendCalled||(clearTimeout(this.cachedTimeOut),this.isAppendCalled=!0,this.appendTo(this.reactElement)),this.updateProperties(e),!0):(this.updateProperties(e,!0),!0)},s.prototype.updateProperties=function(e,t){for(var r=this,s=i.extend({},e),o=0,n=Object.keys(e);o<n.length;o++){var a=n[o],p="className"===a;if("children"!==a)if(p||i.isNullOrUndefined(this.htmlattributes[a])||this.htmlattributes[a]===s[a]||(this.htmlattributes[a]=s[a]),this.compareValues(this.props[a],e[a]))delete s[a];else if(-1!==this.attrKeys.indexOf(a))if(p){this.clsName=!0;for(var l=this.props[a].split(" "),h=0;h<l.length;h++)this.element.classList.remove(l[h]);for(var c=s[a].split(" "),u=0;u<c.length;u++)this.element.classList.add(c[u])}else"disabled"!==a&&delete s[a];else"value"===a&&e[a]===this[a]?delete s[a]:"valueTemplate"!==a&&"itemTemplate"!==a&&"headerTemplate"!==a||e[a].toString()!==this[a].toString()?"content"===a&&"function"==typeof s[a]&&delete s[a]:delete s[a]}s.children&&delete s.children,this.initRenderCalled&&(this.canDelayUpdate||this.props.delayUpdate)?setTimeout(function(){r.refreshProperties(s,e,t)}):this.refreshProperties(s,e,t)},s.prototype.refreshProperties=function(e,t,r){Object.keys(e).length&&(r||this.processComplexTemplate(e,this),this.setProperties(e,r)),this.refreshChild(r,t)},s.prototype.processComplexTemplate=function(e,t){var r=t.complexTemplate;if(r)for(var s in r){var o=r[s];e[s]&&i.setValue(o,i.getValue(s,e),e)}},s.prototype.getDefaultAttributes=function(){var e=this;this.isReact=!0;var t=Object.keys(this.props);this.htmlattributes||(this.htmlattributes={}),this.attrKeys=n.concat(this.controlAttributes||[]);for(var r=0,i=t;r<i.length;r++){var o=i[r];-1===o.indexOf("data-")&&-1===o.indexOf("aria-")&&-1===this.attrKeys.indexOf(o)||this.htmlattributes[o]!==this.props[o]&&(this.htmlattributes[o]=this.props[o])}if(!this.htmlattributes.ref){this.htmlattributes.ref=function(t){e.reactElement=t};-1!==["autocomplete","combobox","dropdownlist","dropdowntree","multiselect","listbox","colorpicker","numerictextbox","textbox","uploader","maskedtextbox","slider","datepicker","datetimepicker","daterangepicker","timepicker","checkbox","switch","radio"].indexOf(this.getModuleName())&&(this.htmlattributes.key=""+s.reactUid,s.reactUid++)}if(this.clsName){for(var a=this.element.classList,p=this.htmlattributes.className,l=0;l<a.length;l++)-1==p.indexOf(a[l])&&(this.htmlattributes.className=this.htmlattributes.className+" "+a[l]);this.clsName=!1}return this.htmlattributes},s.prototype.trigger=function(e,t,r){var s=this;if(!0!==this.isDestroyed&&this.modelObserver){if(p.test(e)){var o=i.getValue(e,this);o?(o.call(this,t),r&&r.call(this,t)):r&&r.call(this,t)}"change"!==e&&"input"!==e||this.props.onChange&&t.event&&this.props.onChange.call(void 0,{syntheticEvent:t.event,nativeEvent:{text:t.value},value:t.value,target:this});var n=this.isProtectedOnChange;this.isProtectedOnChange=!1,"created"===e?setTimeout(function(){s.isCreated=!0,s.isDestroyed||s.modelObserver.notify(e,t,r)}):this.modelObserver.notify(e,t,r),this.isProtectedOnChange=n}},s.prototype.compareValues=function(e,t){if(typeof e===typeof t){if(e===t)return!0;if((!i.isNullOrUndefined(e)&&e.constructor)!==(!i.isNullOrUndefined(t)&&t.constructor))return!1;if(e instanceof Date||e instanceof RegExp||e instanceof String||e instanceof Number)return e.toString()===t.toString();if(i.isObject(e)||Array.isArray(e)){var r=e,s=t;return i.isObject(r)&&(r=[e],s=[t]),this.compareObjects(r,s).status}}return!1},s.prototype.compareObjects=function(e,t,r){var i=!0,s=[];if(e.length===t.length)for(var o=0,n=t.length;o<n;o++){var a={},p=e[o],l=t[o],h=Object.keys(l);if(0!==h.length)for(var c=0,u=h;c<u.length;c++){var d=u[c],f=p[d],m=l[d];if("items"===d)for(var y=0;y<m.length;y++)if("richtexteditor"===this.getModuleName()&&"object"==typeof m[y])return{status:!0};if("grid"===this.getModuleName()&&"field"===d&&(a[d]=m),!p.hasOwnProperty(d)||!this.compareValues(f,m)){if(!r)return{status:!1};i=!1,a[d]=m}}else if(l[o]===p[o])i=!0;else{if(!r)return{status:!1};i=!1}Object.keys(a).length&&s.push({index:o,value:a,key:r})}else i=!1;return{status:i,changedProperties:s}},s.prototype.refreshChild=function(e,t){if(this.checkInjectedModules){for(var r=this.getInjectedModules()||[],s=0,o=this.getInjectedServices()||[];s<o.length;s++){var n=o[s];-1===r.indexOf(n)&&r.push(n)}this.injectedModules=r}if(this.directivekeys){var a=[],p=this.validateChildren({},this.directivekeys,t||this.props);if(p&&Object.keys(p).length){if(!e&&this.skipRefresh)for(var l=0,h=this.skipRefresh;l<h.length;l++){delete p[h[l]]}if(this.prevProperties)for(var c=Object.keys(this.prevProperties),u=0;u<c.length;u++){var d=c[u];if(p.hasOwnProperty(d)){var f=this.compareObjects(this.prevProperties[d],p[d],d);if(f.status)delete p[d];else{f.changedProperties.length&&(a=a.concat(f.changedProperties));var m={};m[d]=p[d],this.prevProperties=i.extend(this.prevProperties,m)}}}else this.prevProperties=i.extend({},p,{},!0);if(a.length)if("grid"===this.getModuleName()&&"columns"===d)for(var y=0,v=this.columns;y<v.length;y++){if(i.getValue("field",v[y])===i.getValue(y+".value.field",a)){var g=i.getValue(a[y].key+"."+a[y].index,this);g&&g.setProperties?g.setProperties(a[y].value):i.extend(g,a[y].value)}else this.setProperties(p,e)}else for(var b=0,C=a;b<C.length;b++){var O=C[b],x=i.getValue(O.key+"."+O.index,this);x&&x.setProperties?x.setProperties(O.value):i.extend(x,O.value)}else this.setProperties(p,e)}}},s.prototype.componentWillUnmount=function(){clearTimeout(this.cachedTimeOut);this.initRenderCalled&&this.isAppendCalled&&this.element&&(["dropdowntree","checkbox"].indexOf(this.getModuleName())||document.body.contains(this.element))&&!this.isDestroyed&&this.isCreated&&this.destroy()},s.prototype.appendReactElement=function(e,t){var i=r.createPortal(e,t);this.portals?this.portals.push(i):this.portals=[i]},s.prototype.renderReactTemplates=function(e){this.isReactForeceUpdate=!0,e?this.forceUpdate(e):this.forceUpdate(),this.isReactForeceUpdate=!1},s.prototype.clearTemplate=function(e,t,r){var i=this,s=[];e&&e.length?Array.prototype.forEach.call(e,function(e){var r=0,o=0;if(i.portals.forEach(function(t){t.propName===e&&(s.push(o),o++)}),t&&i.portals[s[t[r]]].propName==e)i.portals.splice(t,1),r++;else for(var n=0;n<i.portals.length;n++)i.portals[n].propName==e&&(i.portals.splice(n,1),n--)}):this.portals=[],this.renderReactTemplates(r)},s.prototype.validateChildren=function(e,r,i){for(var s=!1,o=0,n=t.Children.toArray(i.children);o<n.length;o++){var a=n[o],p=this.getChildType(a),l=r[p];if(p&&r){var h=this.getChildProps(t.Children.toArray(a.props.children),l);h.length&&(s=!0,e[a.type.propertyName||p]=h)}}return s?e:null},s.prototype.getChildType=function(e){return e.type&&e.type.isDirective?e.type.moduleName||"":""},s.prototype.getChildProps=function(e,t){for(var r=[],s=0,o=e;s<o.length;s++){var n=o[s],a=!1,p=void 0;"string"==typeof t?(a=!0,p=t):p=Object.keys(t)[0];var l=n.props;if(this.getChildType(n)===p)if(a||!l.children){var h=i.extend({},l,{},!0);this.processComplexTemplate(h,n.type),r.push(h)}else{var c=this.validateChildren(i.extend({},l),t[p],l)||l;c.children&&delete c.children,this.processComplexTemplate(c,n.type),r.push(c)}}return r},s.prototype.getInjectedServices=function(){for(var e=0,r=t.Children.toArray(this.props.children);e<r.length;e++){var i=r[e];if(i.type.isService)return i.props.services}return[]},s.reactUid=1,s}(t.Component),h=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t.prototype.render=function(){return null},t.isDirective=!0,t}(t.PureComponent),u=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){return null},t.isService=!0,t}(t.PureComponent),f=i.getTemplateEngine();i.setTemplateEngine({compile:s}),e.ComponentBase=l,e.applyMixins=function(e,t){t.forEach(function(t){Object.getOwnPropertyNames(t.prototype).forEach(function(r){"isMounted"!==r&&"replaceState"!==r&&(e.prototype[r]=t.prototype[r])})})},e.ComplexBase=c,e.Inject=d,e.compile=s,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ej2-react-base.umd.min.js.map |
@@ -1,4 +0,3 @@ | ||
import { Children, Component, PureComponent, createElement, version } from 'react'; | ||
import { Children, Component, PureComponent, createElement } from 'react'; | ||
import { createPortal } from 'react-dom'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { extend, getTemplateEngine, getValue, isNullOrUndefined, isObject, setTemplateEngine, setValue } from '@syncfusion/ej2-base'; | ||
@@ -417,21 +416,13 @@ | ||
; | ||
// tslint:disable:no-any | ||
intForceUpdate(callback) { | ||
let flush = getValue('flushSync', ReactDOM); | ||
let version$$1 = version.split('.')[0]; | ||
if (parseInt(version$$1) >= 18 && this.initRenderCalled && flush && !this.mountingState) { | ||
flush(() => { | ||
this.forceUpdate(callback); | ||
}); | ||
// tslint:disable:no-any | ||
renderReactTemplates(callback) { | ||
this.isReactForeceUpdate = true; | ||
if (callback) { | ||
this.forceUpdate(callback); | ||
} | ||
else { | ||
this.forceUpdate(callback); | ||
this.forceUpdate(); | ||
} | ||
} | ||
renderReactTemplates(callback) { | ||
this.isReactForeceUpdate = true; | ||
this.intForceUpdate(callback); | ||
this.isReactForeceUpdate = false; | ||
} | ||
; | ||
// tslint:disable:no-any | ||
@@ -438,0 +429,0 @@ clearTemplate(templateNames, index, callback) { |
@@ -1,4 +0,3 @@ | ||
import { Children, Component, PureComponent, createElement, version } from 'react'; | ||
import { Children, Component, PureComponent, createElement } from 'react'; | ||
import { createPortal } from 'react-dom'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { extend, getTemplateEngine, getValue, isNullOrUndefined, isObject, setTemplateEngine, setValue } from '@syncfusion/ej2-base'; | ||
@@ -441,22 +440,13 @@ | ||
// tslint:disable:no-any | ||
ComponentBase.prototype.intForceUpdate = function (callback) { | ||
var _this = this; | ||
var flush = getValue('flushSync', ReactDOM); | ||
var version$$1 = version.split('.')[0]; | ||
if (parseInt(version$$1) >= 18 && this.initRenderCalled && flush && !this.mountingState) { | ||
flush(function () { | ||
_this.forceUpdate(callback); | ||
}); | ||
// tslint:disable:no-any | ||
ComponentBase.prototype.renderReactTemplates = function (callback) { | ||
this.isReactForeceUpdate = true; | ||
if (callback) { | ||
this.forceUpdate(callback); | ||
} | ||
else { | ||
this.forceUpdate(callback); | ||
this.forceUpdate(); | ||
} | ||
}; | ||
ComponentBase.prototype.renderReactTemplates = function (callback) { | ||
this.isReactForeceUpdate = true; | ||
this.intForceUpdate(callback); | ||
this.isReactForeceUpdate = false; | ||
}; | ||
// tslint:disable:no-any | ||
@@ -463,0 +453,0 @@ ComponentBase.prototype.clearTemplate = function (templateNames, index, callback) { |
/*! | ||
* filename: ej2-react-base.min.js | ||
* version : 20.1.58 | ||
* version : 20.1.59 | ||
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. | ||
@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license. | ||
*/ | ||
this.ej=this.ej||{},this.ej.reactbase=function(e,t,r,i){"use strict";function s(e,t){t.forEach(function(t){Object.getOwnPropertyNames(t.prototype).forEach(function(r){"isMounted"!==r&&"replaceState"!==r&&(e.prototype[r]=t.prototype[r])})})}function o(e,s){return"string"==typeof e?m(e,s):function(s,o,n,a){var p=e,l=s;"object"==typeof p&&(p=e.template,l=i.extend({},s,e.data||{}));var h;h=a||document.createElement("div");var c=t.createElement(p,l),u=r.createPortal(c,h);if(u.propName=n,o.portals?o.portals.push(u):o.portals=[u],!a)return[h]}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),a=["alt","className","disabled","form","id","readOnly","style","tabIndex","title","type","name","onClick","onFocus","onBlur"],p=["accordion","tab","splitter"],l=new RegExp("]"),h=function(e){function s(){var t=null!==e&&e.apply(this,arguments)||this;return t.mountingState=!1,t.attrKeys=[],t.cachedTimeOut=0,t.isAppendCalled=!1,t.initRenderCalled=!1,t.isReactForeceUpdate=!1,t.isReact=!0,t.isshouldComponentUpdateCalled=!1,t.isCreated=!1,t}return n(s,e),s.prototype.componentDidMount=function(){this.refreshChild(!0),this.canDelayUpdate=-1!==p.indexOf(this.getModuleName()),this.renderReactComponent(),this.portals&&this.portals.length&&(this.mountingState=!0,this.renderReactTemplates(),this.mountingState=!1)},s.prototype.componentDidUpdate=function(e){this.isshouldComponentUpdateCalled||!this.initRenderCalled||this.isReactForeceUpdate||(this.isshouldComponentUpdateCalled=!0,e!==this.props&&this.refreshProperties(this.props,!0))},s.prototype.renderReactComponent=function(){var e=this.reactElement;e&&!this.isAppendCalled&&(this.isAppendCalled=!0,this.appendTo(e))},s.prototype.shouldComponentUpdate=function(e){return this.isshouldComponentUpdateCalled=!0,this.initRenderCalled?(this.isAppendCalled||(clearTimeout(this.cachedTimeOut),this.isAppendCalled=!0,this.appendTo(this.reactElement)),this.updateProperties(e),!0):(this.updateProperties(e,!0),!0)},s.prototype.updateProperties=function(e,t){for(var r=this,s=i.extend({},e),o=0,n=Object.keys(e);o<n.length;o++){var a=n[o],p="className"===a;if("children"!==a)if(p||i.isNullOrUndefined(this.htmlattributes[a])||this.htmlattributes[a]===s[a]||(this.htmlattributes[a]=s[a]),this.compareValues(this.props[a],e[a]))delete s[a];else if(-1!==this.attrKeys.indexOf(a))if(p){this.clsName=!0;for(var l=this.props[a].split(" "),h=0;h<l.length;h++)this.element.classList.remove(l[h]);for(var c=s[a].split(" "),u=0;u<c.length;u++)this.element.classList.add(c[u])}else"disabled"!==a&&delete s[a];else"value"===a&&e[a]===this[a]?delete s[a]:"valueTemplate"!==a&&"itemTemplate"!==a&&"headerTemplate"!==a||e[a].toString()!==this[a].toString()?"content"===a&&"function"==typeof s[a]&&delete s[a]:delete s[a]}s.children&&delete s.children,this.initRenderCalled&&(this.canDelayUpdate||this.props.delayUpdate)?setTimeout(function(){r.refreshProperties(s,e,t)}):this.refreshProperties(s,e,t)},s.prototype.refreshProperties=function(e,t,r){Object.keys(e).length&&(r||this.processComplexTemplate(e,this),this.setProperties(e,r)),this.refreshChild(r,t)},s.prototype.processComplexTemplate=function(e,t){var r=t.complexTemplate;if(r)for(var s in r){var o=r[s];e[s]&&i.setValue(o,i.getValue(s,e),e)}},s.prototype.getDefaultAttributes=function(){var e=this;this.isReact=!0;var t=Object.keys(this.props);this.htmlattributes||(this.htmlattributes={}),this.attrKeys=a.concat(this.controlAttributes||[]);for(var r=0,i=t;r<i.length;r++){var o=i[r];-1===o.indexOf("data-")&&-1===o.indexOf("aria-")&&-1===this.attrKeys.indexOf(o)||this.htmlattributes[o]!==this.props[o]&&(this.htmlattributes[o]=this.props[o])}if(this.htmlattributes.ref||(this.htmlattributes.ref=function(t){e.reactElement=t},-1!==["autocomplete","combobox","dropdownlist","dropdowntree","multiselect","listbox","colorpicker","numerictextbox","textbox","uploader","maskedtextbox","slider","datepicker","datetimepicker","daterangepicker","timepicker","checkbox","switch","radio"].indexOf(this.getModuleName())&&(this.htmlattributes.key=""+s.reactUid,s.reactUid++)),this.clsName){for(var n=this.element.classList,p=this.htmlattributes.className,l=0;l<n.length;l++)-1==p.indexOf(n[l])&&(this.htmlattributes.className=this.htmlattributes.className+" "+n[l]);this.clsName=!1}return this.htmlattributes},s.prototype.trigger=function(e,t,r){var s=this;if(!0!==this.isDestroyed&&this.modelObserver){if(l.test(e)){var o=i.getValue(e,this);o?(o.call(this,t),r&&r.call(this,t)):r&&r.call(this,t)}"change"!==e&&"input"!==e||this.props.onChange&&t.event&&this.props.onChange.call(void 0,{syntheticEvent:t.event,nativeEvent:{text:t.value},value:t.value,target:this});var n=this.isProtectedOnChange;this.isProtectedOnChange=!1,"created"===e?setTimeout(function(){s.isCreated=!0,s.isDestroyed||s.modelObserver.notify(e,t,r)}):this.modelObserver.notify(e,t,r),this.isProtectedOnChange=n}},s.prototype.compareValues=function(e,t){if(typeof e===typeof t){if(e===t)return!0;if((!i.isNullOrUndefined(e)&&e.constructor)!==(!i.isNullOrUndefined(t)&&t.constructor))return!1;if(e instanceof Date||e instanceof RegExp||e instanceof String||e instanceof Number)return e.toString()===t.toString();if(i.isObject(e)||Array.isArray(e)){var r=e,s=t;return i.isObject(r)&&(r=[e],s=[t]),this.compareObjects(r,s).status}}return!1},s.prototype.compareObjects=function(e,t,r){var i=!0,s=[];if(e.length===t.length)for(var o=0,n=t.length;o<n;o++){var a={},p=e[o],l=t[o],h=Object.keys(l);if(0!==h.length)for(var c=0,u=h;c<u.length;c++){var d=u[c],f=p[d],m=l[d];if("items"===d)for(var y=0;y<m.length;y++)if("richtexteditor"===this.getModuleName()&&"object"==typeof m[y])return{status:!0};if("grid"===this.getModuleName()&&"field"===d&&(a[d]=m),!p.hasOwnProperty(d)||!this.compareValues(f,m)){if(!r)return{status:!1};i=!1,a[d]=m}}else if(l[o]===p[o])i=!0;else{if(!r)return{status:!1};i=!1}Object.keys(a).length&&s.push({index:o,value:a,key:r})}else i=!1;return{status:i,changedProperties:s}},s.prototype.refreshChild=function(e,t){if(this.checkInjectedModules){for(var r=this.getInjectedModules()||[],s=0,o=this.getInjectedServices()||[];s<o.length;s++){var n=o[s];-1===r.indexOf(n)&&r.push(n)}this.injectedModules=r}if(this.directivekeys){var a=[],p=this.validateChildren({},this.directivekeys,t||this.props);if(p&&Object.keys(p).length){if(!e&&this.skipRefresh)for(var l=0,h=this.skipRefresh;l<h.length;l++)delete p[h[l]];if(this.prevProperties)for(var c=Object.keys(this.prevProperties),u=0;u<c.length;u++){var d=c[u];if(p.hasOwnProperty(d)){var f=this.compareObjects(this.prevProperties[d],p[d],d);if(f.status)delete p[d];else{f.changedProperties.length&&(a=a.concat(f.changedProperties));var m={};m[d]=p[d],this.prevProperties=i.extend(this.prevProperties,m)}}}else this.prevProperties=i.extend({},p,{},!0);if(a.length)if("grid"===this.getModuleName()&&"columns"===d)for(var y=0,v=this.columns;y<v.length;y++)if(i.getValue("field",v[y])===i.getValue(y+".value.field",a)){var g=i.getValue(a[y].key+"."+a[y].index,this);g&&g.setProperties?g.setProperties(a[y].value):i.extend(g,a[y].value)}else this.setProperties(p,e);else for(var b=0,C=a;b<C.length;b++){var O=C[b],x=i.getValue(O.key+"."+O.index,this);x&&x.setProperties?x.setProperties(O.value):i.extend(x,O.value)}else this.setProperties(p,e)}}},s.prototype.componentWillUnmount=function(){clearTimeout(this.cachedTimeOut);var e=["dropdowntree","checkbox"];this.initRenderCalled&&this.isAppendCalled&&this.element&&(e.indexOf(this.getModuleName())||document.body.contains(this.element))&&!this.isDestroyed&&this.isCreated&&this.destroy()},s.prototype.appendReactElement=function(e,t){var i=r.createPortal(e,t);this.portals?this.portals.push(i):this.portals=[i]},s.prototype.intForceUpdate=function(e){var s=this,o=i.getValue("flushSync",r),n=t.version.split(".")[0];parseInt(n)>=18&&this.initRenderCalled&&o&&!this.mountingState?o(function(){s.forceUpdate(e)}):this.forceUpdate(e)},s.prototype.renderReactTemplates=function(e){this.isReactForeceUpdate=!0,this.intForceUpdate(e),this.isReactForeceUpdate=!1},s.prototype.clearTemplate=function(e,t,r){var i=this,s=[];e&&e.length?Array.prototype.forEach.call(e,function(e){var r=0,o=0;if(i.portals.forEach(function(t){t.propName===e&&(s.push(o),o++)}),t&&i.portals[s[t[r]]].propName==e)i.portals.splice(t,1),r++;else for(var n=0;n<i.portals.length;n++)i.portals[n].propName==e&&(i.portals.splice(n,1),n--)}):this.portals=[],this.renderReactTemplates(r)},s.prototype.validateChildren=function(e,r,i){for(var s=!1,o=0,n=t.Children.toArray(i.children);o<n.length;o++){var a=n[o],p=this.getChildType(a),l=r[p];if(p&&r){var h=this.getChildProps(t.Children.toArray(a.props.children),l);h.length&&(s=!0,e[a.type.propertyName||p]=h)}}return s?e:null},s.prototype.getChildType=function(e){return e.type&&e.type.isDirective?e.type.moduleName||"":""},s.prototype.getChildProps=function(e,t){for(var r=[],s=0,o=e;s<o.length;s++){var n=o[s],a=!1,p=void 0;"string"==typeof t?(a=!0,p=t):p=Object.keys(t)[0];var l=n.props;if(this.getChildType(n)===p)if(a||!l.children){var h=i.extend({},l,{},!0);this.processComplexTemplate(h,n.type),r.push(h)}else{var c=this.validateChildren(i.extend({},l),t[p],l)||l;c.children&&delete c.children,this.processComplexTemplate(c,n.type),r.push(c)}}return r},s.prototype.getInjectedServices=function(){for(var e=0,r=t.Children.toArray(this.props.children);e<r.length;e++){var i=r[e];if(i.type.isService)return i.props.services}return[]},s.reactUid=1,s}(t.Component),c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.render=function(){return null},t.isDirective=!0,t}(t.PureComponent),d=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.render=function(){return null},t.isService=!0,t}(t.PureComponent),m=i.getTemplateEngine();return i.setTemplateEngine({compile:o}),e.ComponentBase=h,e.applyMixins=s,e.ComplexBase=u,e.Inject=f,e.compile=o,e}({},React,ReactDOM,ej.base),this.ejs=ej; | ||
this.ej=this.ej||{},this.ej.reactbase=function(e,t,r,i){"use strict";function s(e,t){t.forEach(function(t){Object.getOwnPropertyNames(t.prototype).forEach(function(r){"isMounted"!==r&&"replaceState"!==r&&(e.prototype[r]=t.prototype[r])})})}function o(e,s){return"string"==typeof e?m(e,s):function(s,o,n,a){var p=e,l=s;"object"==typeof p&&(p=e.template,l=i.extend({},s,e.data||{}));var h;h=a||document.createElement("div");var c=t.createElement(p,l),u=r.createPortal(c,h);if(u.propName=n,o.portals?o.portals.push(u):o.portals=[u],!a)return[h]}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),a=["alt","className","disabled","form","id","readOnly","style","tabIndex","title","type","name","onClick","onFocus","onBlur"],p=["accordion","tab","splitter"],l=new RegExp("]"),h=function(e){function s(){var t=null!==e&&e.apply(this,arguments)||this;return t.mountingState=!1,t.attrKeys=[],t.cachedTimeOut=0,t.isAppendCalled=!1,t.initRenderCalled=!1,t.isReactForeceUpdate=!1,t.isReact=!0,t.isshouldComponentUpdateCalled=!1,t.isCreated=!1,t}return n(s,e),s.prototype.componentDidMount=function(){this.refreshChild(!0),this.canDelayUpdate=-1!==p.indexOf(this.getModuleName()),this.renderReactComponent(),this.portals&&this.portals.length&&(this.mountingState=!0,this.renderReactTemplates(),this.mountingState=!1)},s.prototype.componentDidUpdate=function(e){this.isshouldComponentUpdateCalled||!this.initRenderCalled||this.isReactForeceUpdate||(this.isshouldComponentUpdateCalled=!0,e!==this.props&&this.refreshProperties(this.props,!0))},s.prototype.renderReactComponent=function(){var e=this.reactElement;e&&!this.isAppendCalled&&(this.isAppendCalled=!0,this.appendTo(e))},s.prototype.shouldComponentUpdate=function(e){return this.isshouldComponentUpdateCalled=!0,this.initRenderCalled?(this.isAppendCalled||(clearTimeout(this.cachedTimeOut),this.isAppendCalled=!0,this.appendTo(this.reactElement)),this.updateProperties(e),!0):(this.updateProperties(e,!0),!0)},s.prototype.updateProperties=function(e,t){for(var r=this,s=i.extend({},e),o=0,n=Object.keys(e);o<n.length;o++){var a=n[o],p="className"===a;if("children"!==a)if(p||i.isNullOrUndefined(this.htmlattributes[a])||this.htmlattributes[a]===s[a]||(this.htmlattributes[a]=s[a]),this.compareValues(this.props[a],e[a]))delete s[a];else if(-1!==this.attrKeys.indexOf(a))if(p){this.clsName=!0;for(var l=this.props[a].split(" "),h=0;h<l.length;h++)this.element.classList.remove(l[h]);for(var c=s[a].split(" "),u=0;u<c.length;u++)this.element.classList.add(c[u])}else"disabled"!==a&&delete s[a];else"value"===a&&e[a]===this[a]?delete s[a]:"valueTemplate"!==a&&"itemTemplate"!==a&&"headerTemplate"!==a||e[a].toString()!==this[a].toString()?"content"===a&&"function"==typeof s[a]&&delete s[a]:delete s[a]}s.children&&delete s.children,this.initRenderCalled&&(this.canDelayUpdate||this.props.delayUpdate)?setTimeout(function(){r.refreshProperties(s,e,t)}):this.refreshProperties(s,e,t)},s.prototype.refreshProperties=function(e,t,r){Object.keys(e).length&&(r||this.processComplexTemplate(e,this),this.setProperties(e,r)),this.refreshChild(r,t)},s.prototype.processComplexTemplate=function(e,t){var r=t.complexTemplate;if(r)for(var s in r){var o=r[s];e[s]&&i.setValue(o,i.getValue(s,e),e)}},s.prototype.getDefaultAttributes=function(){var e=this;this.isReact=!0;var t=Object.keys(this.props);this.htmlattributes||(this.htmlattributes={}),this.attrKeys=a.concat(this.controlAttributes||[]);for(var r=0,i=t;r<i.length;r++){var o=i[r];-1===o.indexOf("data-")&&-1===o.indexOf("aria-")&&-1===this.attrKeys.indexOf(o)||this.htmlattributes[o]!==this.props[o]&&(this.htmlattributes[o]=this.props[o])}if(this.htmlattributes.ref||(this.htmlattributes.ref=function(t){e.reactElement=t},-1!==["autocomplete","combobox","dropdownlist","dropdowntree","multiselect","listbox","colorpicker","numerictextbox","textbox","uploader","maskedtextbox","slider","datepicker","datetimepicker","daterangepicker","timepicker","checkbox","switch","radio"].indexOf(this.getModuleName())&&(this.htmlattributes.key=""+s.reactUid,s.reactUid++)),this.clsName){for(var n=this.element.classList,p=this.htmlattributes.className,l=0;l<n.length;l++)-1==p.indexOf(n[l])&&(this.htmlattributes.className=this.htmlattributes.className+" "+n[l]);this.clsName=!1}return this.htmlattributes},s.prototype.trigger=function(e,t,r){var s=this;if(!0!==this.isDestroyed&&this.modelObserver){if(l.test(e)){var o=i.getValue(e,this);o?(o.call(this,t),r&&r.call(this,t)):r&&r.call(this,t)}"change"!==e&&"input"!==e||this.props.onChange&&t.event&&this.props.onChange.call(void 0,{syntheticEvent:t.event,nativeEvent:{text:t.value},value:t.value,target:this});var n=this.isProtectedOnChange;this.isProtectedOnChange=!1,"created"===e?setTimeout(function(){s.isCreated=!0,s.isDestroyed||s.modelObserver.notify(e,t,r)}):this.modelObserver.notify(e,t,r),this.isProtectedOnChange=n}},s.prototype.compareValues=function(e,t){if(typeof e===typeof t){if(e===t)return!0;if((!i.isNullOrUndefined(e)&&e.constructor)!==(!i.isNullOrUndefined(t)&&t.constructor))return!1;if(e instanceof Date||e instanceof RegExp||e instanceof String||e instanceof Number)return e.toString()===t.toString();if(i.isObject(e)||Array.isArray(e)){var r=e,s=t;return i.isObject(r)&&(r=[e],s=[t]),this.compareObjects(r,s).status}}return!1},s.prototype.compareObjects=function(e,t,r){var i=!0,s=[];if(e.length===t.length)for(var o=0,n=t.length;o<n;o++){var a={},p=e[o],l=t[o],h=Object.keys(l);if(0!==h.length)for(var c=0,u=h;c<u.length;c++){var d=u[c],f=p[d],m=l[d];if("items"===d)for(var y=0;y<m.length;y++)if("richtexteditor"===this.getModuleName()&&"object"==typeof m[y])return{status:!0};if("grid"===this.getModuleName()&&"field"===d&&(a[d]=m),!p.hasOwnProperty(d)||!this.compareValues(f,m)){if(!r)return{status:!1};i=!1,a[d]=m}}else if(l[o]===p[o])i=!0;else{if(!r)return{status:!1};i=!1}Object.keys(a).length&&s.push({index:o,value:a,key:r})}else i=!1;return{status:i,changedProperties:s}},s.prototype.refreshChild=function(e,t){if(this.checkInjectedModules){for(var r=this.getInjectedModules()||[],s=0,o=this.getInjectedServices()||[];s<o.length;s++){var n=o[s];-1===r.indexOf(n)&&r.push(n)}this.injectedModules=r}if(this.directivekeys){var a=[],p=this.validateChildren({},this.directivekeys,t||this.props);if(p&&Object.keys(p).length){if(!e&&this.skipRefresh)for(var l=0,h=this.skipRefresh;l<h.length;l++)delete p[h[l]];if(this.prevProperties)for(var c=Object.keys(this.prevProperties),u=0;u<c.length;u++){var d=c[u];if(p.hasOwnProperty(d)){var f=this.compareObjects(this.prevProperties[d],p[d],d);if(f.status)delete p[d];else{f.changedProperties.length&&(a=a.concat(f.changedProperties));var m={};m[d]=p[d],this.prevProperties=i.extend(this.prevProperties,m)}}}else this.prevProperties=i.extend({},p,{},!0);if(a.length)if("grid"===this.getModuleName()&&"columns"===d)for(var y=0,v=this.columns;y<v.length;y++)if(i.getValue("field",v[y])===i.getValue(y+".value.field",a)){var g=i.getValue(a[y].key+"."+a[y].index,this);g&&g.setProperties?g.setProperties(a[y].value):i.extend(g,a[y].value)}else this.setProperties(p,e);else for(var b=0,C=a;b<C.length;b++){var O=C[b],x=i.getValue(O.key+"."+O.index,this);x&&x.setProperties?x.setProperties(O.value):i.extend(x,O.value)}else this.setProperties(p,e)}}},s.prototype.componentWillUnmount=function(){clearTimeout(this.cachedTimeOut);var e=["dropdowntree","checkbox"];this.initRenderCalled&&this.isAppendCalled&&this.element&&(e.indexOf(this.getModuleName())||document.body.contains(this.element))&&!this.isDestroyed&&this.isCreated&&this.destroy()},s.prototype.appendReactElement=function(e,t){var i=r.createPortal(e,t);this.portals?this.portals.push(i):this.portals=[i]},s.prototype.renderReactTemplates=function(e){this.isReactForeceUpdate=!0,e?this.forceUpdate(e):this.forceUpdate(),this.isReactForeceUpdate=!1},s.prototype.clearTemplate=function(e,t,r){var i=this,s=[];e&&e.length?Array.prototype.forEach.call(e,function(e){var r=0,o=0;if(i.portals.forEach(function(t){t.propName===e&&(s.push(o),o++)}),t&&i.portals[s[t[r]]].propName==e)i.portals.splice(t,1),r++;else for(var n=0;n<i.portals.length;n++)i.portals[n].propName==e&&(i.portals.splice(n,1),n--)}):this.portals=[],this.renderReactTemplates(r)},s.prototype.validateChildren=function(e,r,i){for(var s=!1,o=0,n=t.Children.toArray(i.children);o<n.length;o++){var a=n[o],p=this.getChildType(a),l=r[p];if(p&&r){var h=this.getChildProps(t.Children.toArray(a.props.children),l);h.length&&(s=!0,e[a.type.propertyName||p]=h)}}return s?e:null},s.prototype.getChildType=function(e){return e.type&&e.type.isDirective?e.type.moduleName||"":""},s.prototype.getChildProps=function(e,t){for(var r=[],s=0,o=e;s<o.length;s++){var n=o[s],a=!1,p=void 0;"string"==typeof t?(a=!0,p=t):p=Object.keys(t)[0];var l=n.props;if(this.getChildType(n)===p)if(a||!l.children){var h=i.extend({},l,{},!0);this.processComplexTemplate(h,n.type),r.push(h)}else{var c=this.validateChildren(i.extend({},l),t[p],l)||l;c.children&&delete c.children,this.processComplexTemplate(c,n.type),r.push(c)}}return r},s.prototype.getInjectedServices=function(){for(var e=0,r=t.Children.toArray(this.props.children);e<r.length;e++){var i=r[e];if(i.type.isService)return i.props.services}return[]},s.reactUid=1,s}(t.Component),c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.render=function(){return null},t.isDirective=!0,t}(t.PureComponent),d=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.render=function(){return null},t.isService=!0,t}(t.PureComponent),m=i.getTemplateEngine();return i.setTemplateEngine({compile:o}),e.ComponentBase=h,e.applyMixins=s,e.ComplexBase=u,e.Inject=f,e.compile=o,e}({},React,ReactDOM,ej.base),this.ejs=ej; | ||
//# sourceMappingURL=ej2-react-base.min.js.map |
/*! | ||
* filename: index.d.ts | ||
* version : 20.1.58 | ||
* version : 20.1.59 | ||
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
{ | ||
"_from": "@syncfusion/ej2-react-base@*", | ||
"_id": "@syncfusion/ej2-react-base@20.1.57", | ||
"_id": "@syncfusion/ej2-react-base@20.1.58", | ||
"_inBundle": false, | ||
"_integrity": "sha512-YQsNRExCd2ISpE6bT/5U3TCrmo+fOg/63ti6VsshQI4p2ECGivUXvK8xfcTFMTKW8PBolDaIZfUjv9szeoHC2A==", | ||
"_integrity": "sha512-IUfxAwu0jgF4llNU7Gtg5Ovow1reRwcLM0JxcN8YwBJ1cttPG0CA5Ppeh9hLWtmXcexIdNSiiUZj7lTRACm9IA==", | ||
"_location": "/@syncfusion/ej2-react-base", | ||
@@ -21,3 +21,4 @@ "_phantomChildren": {}, | ||
"/", | ||
"/@syncfusion/ej2-react-calendars", | ||
"/@syncfusion/ej2-react-charts", | ||
"/@syncfusion/ej2-react-diagrams", | ||
"/@syncfusion/ej2-react-documenteditor", | ||
@@ -29,13 +30,13 @@ "/@syncfusion/ej2-react-dropdowns", | ||
"/@syncfusion/ej2-react-inputs", | ||
"/@syncfusion/ej2-react-kanban", | ||
"/@syncfusion/ej2-react-layouts", | ||
"/@syncfusion/ej2-react-navigations", | ||
"/@syncfusion/ej2-react-maps", | ||
"/@syncfusion/ej2-react-pdfviewer", | ||
"/@syncfusion/ej2-react-pivotview", | ||
"/@syncfusion/ej2-react-popups", | ||
"/@syncfusion/ej2-react-querybuilder", | ||
"/@syncfusion/ej2-react-richtexteditor", | ||
"/@syncfusion/ej2-react-spreadsheet" | ||
"/@syncfusion/ej2-react-schedule", | ||
"/@syncfusion/ej2-react-spreadsheet", | ||
"/@syncfusion/ej2-react-treegrid", | ||
"/@syncfusion/ej2-react-treemap" | ||
], | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-react-base/-/ej2-react-base-20.1.57.tgz", | ||
"_shasum": "f551011d530b038fe2e3a26c8af91de31d8acd41", | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-react-base/-/ej2-react-base-20.1.58.tgz", | ||
"_shasum": "494a2a31f5c18ab1a92c88e342cf158d291e94cc", | ||
"_spec": "@syncfusion/ej2-react-base@*", | ||
@@ -77,4 +78,4 @@ "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included", | ||
"typings": "index.d.ts", | ||
"version": "20.1.58", | ||
"version": "20.1.59", | ||
"sideEffects": true | ||
} |
@@ -75,3 +75,2 @@ /** | ||
appendReactElement(element: any, container: HTMLElement): void; | ||
intForceUpdate(callback?: any): void; | ||
renderReactTemplates(callback?: any): void; | ||
@@ -78,0 +77,0 @@ clearTemplate(templateNames: string[], index?: any, callback?: any): void; |
@@ -444,22 +444,13 @@ var __extends = (this && this.__extends) || (function () { | ||
; | ||
// tslint:disable:no-any | ||
ComponentBase.prototype.intForceUpdate = function (callback) { | ||
var _this = this; | ||
var flush = getValue('flushSync', ReactDOM); | ||
var version = React.version.split('.')[0]; | ||
if (parseInt(version) >= 18 && this.initRenderCalled && flush && !this.mountingState) { | ||
flush(function () { | ||
_this.forceUpdate(callback); | ||
}); | ||
// tslint:disable:no-any | ||
ComponentBase.prototype.renderReactTemplates = function (callback) { | ||
this.isReactForeceUpdate = true; | ||
if (callback) { | ||
this.forceUpdate(callback); | ||
} | ||
else { | ||
this.forceUpdate(callback); | ||
this.forceUpdate(); | ||
} | ||
}; | ||
ComponentBase.prototype.renderReactTemplates = function (callback) { | ||
this.isReactForeceUpdate = true; | ||
this.intForceUpdate(callback); | ||
this.isReactForeceUpdate = false; | ||
}; | ||
; | ||
// tslint:disable:no-any | ||
@@ -466,0 +457,0 @@ ComponentBase.prototype.clearTemplate = function (templateNames, index, callback) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
313444
2609