@syncfusion/ej2-react-base
Advanced tools
Comparing version 16.2.45 to 16.2.46
@@ -5,2 +5,4 @@ # Changelog | ||
## 16.2.45 (2018-07-17) | ||
### Common | ||
@@ -7,0 +9,0 @@ |
@@ -1,2 +0,11 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-dom"),require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@syncfusion/ej2-base"],e):e(t.ej={},t.React,t.ReactDOM,t.ej2Base)}(this,function(t,e,r,n){"use strict";function o(t,e){return"string"==typeof t?h(t,e):function(e){var o=document.createElement("div");return document.body.appendChild(o),r.render(t(e),o),n.detach(o),o.children}}var i=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),s=["alt","className","disabled","form","id","readOnly","style","tabIndex","title","type","onClick","onFocus","onBlur"],p=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.attrKeys=[],e}return i(o,t),o.prototype.componentWillMount=function(){var t=Object.keys(this.props);this.htmlattributes={},this.attrKeys=s.concat(this.controlAttributes||[]);for(var e=0,r=t;e<r.length;e++){var n=r[e];-1===n.indexOf("data-")&&-1===n.indexOf("aria-")&&-1===this.attrKeys.indexOf(n)||(this.htmlattributes[n]=this.props[n])}},o.prototype.componentDidMount=function(){this.refreshChild(!0);var t=r.findDOMNode(this);this.appendTo(t)},o.prototype.componentWillReceiveProps=function(t){for(var e=n.extend({},t),r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];this.props[i]===t[i]?delete e[i]:-1!==this.attrKeys.indexOf(i)&&("className"===i&&(this.element.classList.remove(this.props[i]),this.element.classList.add(e[i])),delete e[i])}e.children&&delete e.children,Object.keys(e).length&&this.setProperties(e),this.refreshChild(!1,t)},o.prototype.getDefaultAttributes=function(){return this.htmlattributes},o.prototype.refreshChild=function(t,e){if(this.checkInjectedModules){for(var r=this.getInjectedModules()||[],n=0,o=this.getInjectedServices()||[];n<o.length;n++){var i=o[n];-1===r.indexOf(i)&&r.push(i)}this.injectedModules=r}if(this.directivekeys){var s=this.validateChildren({},this.directivekeys,e||this.props);if(s){if(!t&&this.skipRefresh)for(var p=0,c=this.skipRefresh;p<c.length;p++){delete s[c[p]]}this.setProperties(s,t)}}},o.prototype.componentWillUnmount=function(){this.destroy()},o.prototype.validateChildren=function(t,r,n){for(var o=!1,i=0,s=e.Children.toArray(n.children);i<s.length;i++){var p=s[i],c=this.getChildType(p),u=r[c];if(c&&r){var a=this.getChildProps(e.Children.toArray(p.props.children),u);a.length&&(o=!0,t[p.type.propertyName||c]=a)}}return o?t:null},o.prototype.getChildType=function(t){return t.type&&t.type.isDirective?t.type.moduleName||"":""},o.prototype.getChildProps=function(t,e){for(var r=[],o=0,i=t;o<i.length;o++){var s=i[o],p=!1,c=void 0;"string"==typeof e?(p=!0,c=e):c=Object.keys(e)[0];var u=s.props;this.getChildType(s)===c&&(p||!u.children?r.push(n.extend({},u,{},!0)):r.push(this.validateChildren(n.extend({},u),e[c],u)||u))}return r},o.prototype.getInjectedServices=function(){for(var t=0,r=e.Children.toArray(this.props.children);t<r.length;t++){var n=r[t];if(n.type.isService)return n.props.services}return[]},o}(e.PureComponent),c=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.render=function(){return null},e.isDirective=!0,e}(e.PureComponent),a=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.render=function(){return null},e.isService=!0,e}(e.PureComponent),h=n.getTemplateEngine();n.setTemplateEngine({compile:o}),t.ComponentBase=p,t.applyMixins=function(t,e){e.forEach(function(e){Object.getOwnPropertyNames(e.prototype).forEach(function(r){t.prototype[r]=e.prototype[r]})})},t.ComplexBase=u,t.Inject=l,t.compile=o,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
/*! | ||
* filename: ej2-react-base.umd.min.js | ||
* version : 16.2.46 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
* A copy of the current license can be obtained at any time by e-mailing | ||
* licensing@syncfusion.com. Any infringement will be prosecuted under | ||
* applicable laws. | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-dom"),require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@syncfusion/ej2-base"],e):e(t.ej={},t.React,t.ReactDOM,t.ej2Base)}(this,function(t,e,r,n){"use strict";function o(t,e){return"string"==typeof t?h(t,e):function(e){var o=document.createElement("div");return document.body.appendChild(o),r.render(t(e),o),n.detach(o),o.children}}var i=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),s=["alt","className","disabled","form","id","readOnly","style","tabIndex","title","type","onClick","onFocus","onBlur"],p=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.attrKeys=[],e}return i(o,t),o.prototype.componentWillMount=function(){var t=Object.keys(this.props);this.htmlattributes={},this.attrKeys=s.concat(this.controlAttributes||[]);for(var e=0,r=t;e<r.length;e++){var n=r[e];-1===n.indexOf("data-")&&-1===n.indexOf("aria-")&&-1===this.attrKeys.indexOf(n)||(this.htmlattributes[n]=this.props[n])}},o.prototype.componentDidMount=function(){var t=this;this.refreshChild(!0),setTimeout(function(){var e=r.findDOMNode(t);t.appendTo(e)})},o.prototype.componentWillReceiveProps=function(t){for(var e=n.extend({},t),r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];this.props[i]===t[i]?delete e[i]:-1!==this.attrKeys.indexOf(i)&&("className"===i&&(this.element.classList.remove(this.props[i]),this.element.classList.add(e[i])),delete e[i])}e.children&&delete e.children,Object.keys(e).length&&this.setProperties(e),this.refreshChild(!1,t)},o.prototype.getDefaultAttributes=function(){return this.htmlattributes},o.prototype.refreshChild=function(t,e){if(this.checkInjectedModules){for(var r=this.getInjectedModules()||[],n=0,o=this.getInjectedServices()||[];n<o.length;n++){var i=o[n];-1===r.indexOf(i)&&r.push(i)}this.injectedModules=r}if(this.directivekeys){var s=this.validateChildren({},this.directivekeys,e||this.props);if(s){if(!t&&this.skipRefresh)for(var p=0,c=this.skipRefresh;p<c.length;p++){delete s[c[p]]}this.setProperties(s,t)}}},o.prototype.componentWillUnmount=function(){this.destroy()},o.prototype.validateChildren=function(t,r,n){for(var o=!1,i=0,s=e.Children.toArray(n.children);i<s.length;i++){var p=s[i],c=this.getChildType(p),u=r[c];if(c&&r){var a=this.getChildProps(e.Children.toArray(p.props.children),u);a.length&&(o=!0,t[p.type.propertyName||c]=a)}}return o?t:null},o.prototype.getChildType=function(t){return t.type&&t.type.isDirective?t.type.moduleName||"":""},o.prototype.getChildProps=function(t,e){for(var r=[],o=0,i=t;o<i.length;o++){var s=i[o],p=!1,c=void 0;"string"==typeof e?(p=!0,c=e):c=Object.keys(e)[0];var u=s.props;this.getChildType(s)===c&&(p||!u.children?r.push(n.extend({},u,{},!0)):r.push(this.validateChildren(n.extend({},u),e[c],u)||u))}return r},o.prototype.getInjectedServices=function(){for(var t=0,r=e.Children.toArray(this.props.children);t<r.length;t++){var n=r[t];if(n.type.isService)return n.props.services}return[]},o}(e.PureComponent),c=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.render=function(){return null},e.isDirective=!0,e}(e.PureComponent),a=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.render=function(){return null},e.isService=!0,e}(e.PureComponent),h=n.getTemplateEngine();n.setTemplateEngine({compile:o}),t.ComponentBase=p,t.applyMixins=function(t,e){e.forEach(function(e){Object.getOwnPropertyNames(e.prototype).forEach(function(r){t.prototype[r]=e.prototype[r]})})},t.ComplexBase=u,t.Inject=l,t.compile=o,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ej2-react-base.umd.min.js.map |
@@ -29,4 +29,8 @@ import { Children, PureComponent } from 'react'; | ||
this.refreshChild(true); | ||
let ele = findDOMNode(this); | ||
this.appendTo(ele); | ||
// Used timeout to resolve template binding | ||
// Reference link: https://github.com/facebook/react/issues/10309#issuecomment-318433235 | ||
setTimeout(() => { | ||
let ele = findDOMNode(this); | ||
this.appendTo(ele); | ||
}); | ||
} | ||
@@ -33,0 +37,0 @@ // tslint:disable-next-line:no-any |
@@ -41,5 +41,10 @@ import { Children, PureComponent } from 'react'; | ||
ComponentBase.prototype.componentDidMount = function () { | ||
var _this = this; | ||
this.refreshChild(true); | ||
var ele = findDOMNode(this); | ||
this.appendTo(ele); | ||
// Used timeout to resolve template binding | ||
// Reference link: https://github.com/facebook/react/issues/10309#issuecomment-318433235 | ||
setTimeout(function () { | ||
var ele = findDOMNode(_this); | ||
_this.appendTo(ele); | ||
}); | ||
}; | ||
@@ -46,0 +51,0 @@ // tslint:disable-next-line:no-any |
@@ -0,1 +1,10 @@ | ||
/*! | ||
* filename: index.d.ts | ||
* version : 16.2.46 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
* A copy of the current license can be obtained at any time by e-mailing | ||
* licensing@syncfusion.com. Any infringement will be prosecuted under | ||
* applicable laws. | ||
*/ | ||
import * as _reactbase from '@syncfusion/ej2-react-base'; | ||
@@ -2,0 +11,0 @@ import * as _base from '@syncfusion/ej2-base'; |
12
index.js
@@ -1,8 +0,4 @@ | ||
define(["require", "exports", "./src/index"], function (require, exports, index_1) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(index_1); | ||
}); | ||
/** | ||
* index | ||
*/ | ||
export * from './src/index'; |
{ | ||
"name": "@syncfusion/ej2-react-base", | ||
"version": "16.2.45", | ||
"version": "16.2.46", | ||
"description": "Essential JS 2 React Base", | ||
@@ -14,3 +14,4 @@ "author": "Syncfusion Inc.", | ||
"base", | ||
"library" | ||
"library", | ||
"ej2-react-base" | ||
], | ||
@@ -22,3 +23,3 @@ "repository": { | ||
"main": "./dist/ej2-react-base.umd.min.js", | ||
"module": "./dist/es6/ej2-react-base.es5.js", | ||
"module": "./index.js", | ||
"readme": "ReadMe.md", | ||
@@ -28,3 +29,3 @@ "dependencies": { | ||
"react-dom": "15.5.4 - 16.4.1", | ||
"@syncfusion/ej2-base": "~16.2.45" | ||
"@syncfusion/ej2-base": "~16.2.46" | ||
}, | ||
@@ -31,0 +32,0 @@ "devDependencies": { |
@@ -1,1 +0,79 @@ | ||
A common package of Essential JS 2 react base, methods and class definitions. | ||
# ej2-react-base | ||
A common package of Essential JS 2 for React which contains base libraries, methods and class definitions. | ||
> This is a commercial product and requires a paid license for possession or use. Syncfusion’s licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA (https://www.syncfusion.com/eula/es/). To acquire a license, you can purchase one at https://www.syncfusion.com/sales/products or start a free 30-day trial here (https://www.syncfusion.com/account/manage-trials/start-trials). | ||
> A free community license (https://www.syncfusion.com/products/communitylicense) is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue and five or fewer developers. | ||
## Setup | ||
To install `ej2-react-base` and its dependent packages, use the following command | ||
```sh | ||
npm install @syncfusion/ej2-react-base | ||
``` | ||
## Resources | ||
* [Getting Started](https://ej2.syncfusion.com/react/documentation/base/getting-started.html?utm_source=npm&utm_campaign=ej2-react-base) | ||
* [View Online Demos](https://ej2.syncfusion.com/react/demos?utm_source=npm&utm_campaign=ej2-react-base) | ||
* [Product Page](https://www.syncfusion.com/products/react?utm_source=npm&utm_campaign=ej2-react-base) | ||
## Framework highlights | ||
### Lightweight and user friendly | ||
The entire Essential JS 2 framework is built from scratch to be lightweight and modular. Its footprint can be reduced further by including only the specific components and features your application requires. | ||
### Modular architecture | ||
All components have been built as modules to enable selective referencing, so only the components and features you need are included in your application. | ||
### Built for performance | ||
Performance is critical for delivering a good user experience. We ensure that all our components are designed and built to achieve the best performance possible. | ||
### Responsive and touch friendly | ||
All Essential JS 2 controls are touch friendly and render adaptively based on the device they are on to provide optimal usage experience on phones, tablets and desktops. | ||
### Stunning built-in themes | ||
Pixel-perfect built-in themes are available in material, bootstrap and fabric design. In addition, it comes with Accessible high-contrast theme and an online tool "[Theme Studio](https://ej2.syncfusion.com/themestudio/)" to customize the provided built-in themes. | ||
### Globalization simplified | ||
Easily build applications to be used by a global audience in various language and culture settings. | ||
### Stay current | ||
With our commitment to at least four major updates per year, you receive the most up-to-date functionality and new components in addition to monthly service packs and bug fixes. Custom patches are available as needed. | ||
## Supported Frameworks | ||
The Essential JS 2 is also offered in following list of frameworks. | ||
* [JavaScript](https://www.syncfusion.com/products/javascript?utm_source=npm&utm_campaign=ej2-react-base) | ||
* [Angular](https://www.syncfusion.com/products/angular?utm_source=npm&utm_campaign=ej2-react-base) | ||
* [Vue.js](https://www.syncfusion.com/products/vue?utm_source=npm&utm_campaign=ej2-react-base) | ||
* [ASP.NET Core](https://www.syncfusion.com/products/aspnetcore?utm_source=npm&utm_campaign=ej2-react-base) | ||
* [ASP.NET MVC](https://www.syncfusion.com/products/aspnetmvc?utm_source=npm&utm_campaign=ej2-react-base) | ||
## Support | ||
Product support is available for through following mediums. | ||
* Creating incident in Syncfusion [Direct-trac](https://www.syncfusion.com/support/directtrac/incidents?utm_source=npm&utm_campaign=ej2-react-base) support system or [Community forum](https://www.syncfusion.com/forums/react-js2?utm_source=npm&utm_campaign=ej2-react-base). | ||
* New [GitHub issue](https://github.com/syncfusion/ej2-react-base/issues/new). | ||
* Ask your query in [Stack Overflow](https://stackoverflow.com/) with tag `syncfusion` and `ej2`. | ||
## License | ||
Check the license detail [here](https://github.com/syncfusion/ej2-react-base/blob/master/license). | ||
## Changelog | ||
Check the changelog [here](https://ej2.syncfusion.com/react/documentation/release-notes?utm_source=npm&utm_campaign=ej2-react-base) | ||
© Copyright 2018 Syncfusion, Inc. All Rights Reserved. | ||
The Syncfusion Essential Studio license and copyright applies to this distribution. |
@@ -11,17 +11,17 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
define(["require", "exports", "react"], function (require, exports, React) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ComplexBase = (function (_super) { | ||
__extends(ComplexBase, _super); | ||
function ComplexBase() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
ComplexBase.prototype.render = function () { | ||
return null; | ||
}; | ||
ComplexBase.isDirective = true; | ||
return ComplexBase; | ||
}(React.PureComponent)); | ||
exports.ComplexBase = ComplexBase; | ||
}); | ||
import * as React from 'react'; | ||
/** | ||
* Directory base | ||
*/ | ||
var ComplexBase = /** @class */ (function (_super) { | ||
__extends(ComplexBase, _super); | ||
function ComplexBase() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
ComplexBase.prototype.render = function () { | ||
return null; | ||
}; | ||
ComplexBase.isDirective = true; | ||
return ComplexBase; | ||
}(React.PureComponent)); | ||
export { ComplexBase }; |
@@ -11,151 +11,167 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
define(["require", "exports", "react", "react-dom", "@syncfusion/ej2-base"], function (require, exports, React, ReactDOM, ej2_base_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var defaulthtmlkeys = ['alt', 'className', 'disabled', 'form', 'id', | ||
'readOnly', 'style', 'tabIndex', 'title', 'type', | ||
'onClick', 'onFocus', 'onBlur']; | ||
var ComponentBase = (function (_super) { | ||
__extends(ComponentBase, _super); | ||
function ComponentBase() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.attrKeys = []; | ||
return _this; | ||
/** | ||
* React Component Base | ||
*/ | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { extend } from '@syncfusion/ej2-base'; | ||
var defaulthtmlkeys = ['alt', 'className', 'disabled', 'form', 'id', | ||
'readOnly', 'style', 'tabIndex', 'title', 'type', | ||
'onClick', 'onFocus', 'onBlur']; | ||
/* tslint:disable */ | ||
var ComponentBase = /** @class */ (function (_super) { | ||
__extends(ComponentBase, _super); | ||
function ComponentBase() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.attrKeys = []; | ||
return _this; | ||
} | ||
ComponentBase.prototype.componentWillMount = function () { | ||
var propKeys = Object.keys(this.props); | ||
this.htmlattributes = {}; | ||
this.attrKeys = defaulthtmlkeys.concat(this.controlAttributes || []); | ||
for (var _i = 0, propKeys_1 = propKeys; _i < propKeys_1.length; _i++) { | ||
var prop = propKeys_1[_i]; | ||
if (prop.indexOf('data-') !== -1 || prop.indexOf('aria-') !== -1 || this.attrKeys.indexOf(prop) !== -1) { | ||
this.htmlattributes[prop] = this.props[prop]; | ||
} | ||
} | ||
ComponentBase.prototype.componentWillMount = function () { | ||
var propKeys = Object.keys(this.props); | ||
this.htmlattributes = {}; | ||
this.attrKeys = defaulthtmlkeys.concat(this.controlAttributes || []); | ||
for (var _i = 0, propKeys_1 = propKeys; _i < propKeys_1.length; _i++) { | ||
var prop = propKeys_1[_i]; | ||
if (prop.indexOf('data-') !== -1 || prop.indexOf('aria-') !== -1 || this.attrKeys.indexOf(prop) !== -1) { | ||
this.htmlattributes[prop] = this.props[prop]; | ||
} | ||
}; | ||
ComponentBase.prototype.componentDidMount = function () { | ||
var _this = this; | ||
this.refreshChild(true); | ||
// Used timeout to resolve template binding | ||
// Reference link: https://github.com/facebook/react/issues/10309#issuecomment-318433235 | ||
setTimeout(function () { | ||
var ele = ReactDOM.findDOMNode(_this); | ||
_this.appendTo(ele); | ||
}); | ||
}; | ||
// tslint:disable-next-line:no-any | ||
ComponentBase.prototype.componentWillReceiveProps = function (nextProps) { | ||
var dProps = extend({}, nextProps); | ||
var keys = Object.keys(nextProps); | ||
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { | ||
var propkey = keys_1[_i]; | ||
if (this.props[propkey] === nextProps[propkey]) { | ||
delete dProps[propkey]; | ||
} | ||
}; | ||
ComponentBase.prototype.componentDidMount = function () { | ||
this.refreshChild(true); | ||
var ele = ReactDOM.findDOMNode(this); | ||
this.appendTo(ele); | ||
}; | ||
ComponentBase.prototype.componentWillReceiveProps = function (nextProps) { | ||
var dProps = ej2_base_1.extend({}, nextProps); | ||
var keys = Object.keys(nextProps); | ||
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { | ||
var propkey = keys_1[_i]; | ||
if (this.props[propkey] === nextProps[propkey]) { | ||
delete dProps[propkey]; | ||
else if (this.attrKeys.indexOf(propkey) !== -1) { | ||
if (propkey === 'className') { | ||
this.element.classList.remove(this.props[propkey]); | ||
this.element.classList.add(dProps[propkey]); | ||
} | ||
else if (this.attrKeys.indexOf(propkey) !== -1) { | ||
if (propkey === 'className') { | ||
this.element.classList.remove(this.props[propkey]); | ||
this.element.classList.add(dProps[propkey]); | ||
} | ||
delete dProps[propkey]; | ||
} | ||
delete dProps[propkey]; | ||
} | ||
if (dProps['children']) { | ||
delete dProps['children']; | ||
} | ||
if (Object.keys(dProps).length) { | ||
this.setProperties(dProps); | ||
} | ||
this.refreshChild(false, nextProps); | ||
}; | ||
ComponentBase.prototype.getDefaultAttributes = function () { | ||
return this.htmlattributes; | ||
}; | ||
ComponentBase.prototype.refreshChild = function (silent, props) { | ||
if (this.checkInjectedModules) { | ||
var prevModule = this.getInjectedModules() || []; | ||
var curModule = this.getInjectedServices() || []; | ||
for (var _i = 0, curModule_1 = curModule; _i < curModule_1.length; _i++) { | ||
var mod = curModule_1[_i]; | ||
if (prevModule.indexOf(mod) === -1) { | ||
prevModule.push(mod); | ||
} | ||
} | ||
if (dProps['children']) { | ||
delete dProps['children']; | ||
} | ||
if (Object.keys(dProps).length) { | ||
this.setProperties(dProps); | ||
} | ||
this.refreshChild(false, nextProps); | ||
}; | ||
ComponentBase.prototype.getDefaultAttributes = function () { | ||
return this.htmlattributes; | ||
}; | ||
ComponentBase.prototype.refreshChild = function (silent, props) { | ||
if (this.checkInjectedModules) { | ||
var prevModule = this.getInjectedModules() || []; | ||
var curModule = this.getInjectedServices() || []; | ||
for (var _i = 0, curModule_1 = curModule; _i < curModule_1.length; _i++) { | ||
var mod = curModule_1[_i]; | ||
if (prevModule.indexOf(mod) === -1) { | ||
prevModule.push(mod); | ||
} | ||
this.injectedModules = prevModule; | ||
} | ||
if (this.directivekeys) { | ||
var directiveValue = this.validateChildren({}, this.directivekeys, (props || this.props)); | ||
if (directiveValue) { | ||
if (!silent && this.skipRefresh) { | ||
for (var _a = 0, _b = this.skipRefresh; _a < _b.length; _a++) { | ||
var fields = _b[_a]; | ||
delete directiveValue[fields]; | ||
} | ||
this.injectedModules = prevModule; | ||
} | ||
if (this.directivekeys) { | ||
var directiveValue = this.validateChildren({}, this.directivekeys, (props || this.props)); | ||
if (directiveValue) { | ||
if (!silent && this.skipRefresh) { | ||
for (var _a = 0, _b = this.skipRefresh; _a < _b.length; _a++) { | ||
var fields = _b[_a]; | ||
delete directiveValue[fields]; | ||
} | ||
this.setProperties(directiveValue, silent); | ||
} | ||
this.setProperties(directiveValue, silent); | ||
} | ||
}; | ||
ComponentBase.prototype.componentWillUnmount = function () { | ||
this.destroy(); | ||
}; | ||
ComponentBase.prototype.validateChildren = function (childCache, mapper, props) { | ||
var flag = false; | ||
var childs = React.Children.toArray(props.children); | ||
for (var _i = 0, childs_1 = childs; _i < childs_1.length; _i++) { | ||
var child = childs_1[_i]; | ||
var ifield = this.getChildType(child); | ||
var key = mapper[ifield]; | ||
if (ifield && mapper) { | ||
var childProps = this.getChildProps(React.Children.toArray(child.props.children), key); | ||
if (childProps.length) { | ||
flag = true; | ||
childCache[child.type.propertyName || ifield] = childProps; | ||
} | ||
} | ||
}; | ||
ComponentBase.prototype.componentWillUnmount = function () { | ||
this.destroy(); | ||
}; | ||
/* tslint:disable:no-any */ | ||
ComponentBase.prototype.validateChildren = function (childCache, mapper, props) { | ||
var flag = false; | ||
var childs = React.Children.toArray(props.children); | ||
for (var _i = 0, childs_1 = childs; _i < childs_1.length; _i++) { | ||
var child = childs_1[_i]; | ||
var ifield = this.getChildType(child); | ||
var key = mapper[ifield]; | ||
if (ifield && mapper) { | ||
// tslint:disable | ||
var childProps = this.getChildProps(React.Children.toArray(child.props.children), key); | ||
if (childProps.length) { | ||
flag = true; | ||
// tslint:disable | ||
childCache[child.type.propertyName || ifield] = childProps; | ||
} | ||
} | ||
if (flag) { | ||
return childCache; | ||
} | ||
if (flag) { | ||
return childCache; | ||
} | ||
return null; | ||
}; | ||
// tslint:disable:no-any | ||
ComponentBase.prototype.getChildType = function (child) { | ||
if (child.type && child.type.isDirective) { | ||
return child.type.moduleName || ''; | ||
} | ||
return ''; | ||
}; | ||
ComponentBase.prototype.getChildProps = function (subChild, matcher) { | ||
var ret = []; | ||
for (var _i = 0, subChild_1 = subChild; _i < subChild_1.length; _i++) { | ||
var child = subChild_1[_i]; | ||
var accessProp = false; | ||
var key = void 0; | ||
if (typeof matcher === 'string') { | ||
accessProp = true; | ||
key = matcher; | ||
} | ||
return null; | ||
}; | ||
ComponentBase.prototype.getChildType = function (child) { | ||
if (child.type && child.type.isDirective) { | ||
return child.type.moduleName || ''; | ||
else { | ||
key = Object.keys(matcher)[0]; | ||
} | ||
return ''; | ||
}; | ||
ComponentBase.prototype.getChildProps = function (subChild, matcher) { | ||
var ret = []; | ||
for (var _i = 0, subChild_1 = subChild; _i < subChild_1.length; _i++) { | ||
var child = subChild_1[_i]; | ||
var accessProp = false; | ||
var key = void 0; | ||
if (typeof matcher === 'string') { | ||
accessProp = true; | ||
key = matcher; | ||
var prop = child.props; | ||
// tslint:disable-next-line:no-any | ||
var field = this.getChildType(child); | ||
if (field === key) { | ||
if (accessProp || !prop.children) { | ||
ret.push(extend({}, prop, {}, true)); | ||
} | ||
else { | ||
key = Object.keys(matcher)[0]; | ||
ret.push(this.validateChildren(extend({}, prop), matcher[key], prop) || prop); | ||
} | ||
var prop = child.props; | ||
var field = this.getChildType(child); | ||
if (field === key) { | ||
if (accessProp || !prop.children) { | ||
ret.push(ej2_base_1.extend({}, prop, {}, true)); | ||
} | ||
else { | ||
ret.push(this.validateChildren(ej2_base_1.extend({}, prop), matcher[key], prop) || prop); | ||
} | ||
} | ||
} | ||
return ret; | ||
}; | ||
ComponentBase.prototype.getInjectedServices = function () { | ||
var childs = React.Children.toArray(this.props.children); | ||
for (var _i = 0, childs_2 = childs; _i < childs_2.length; _i++) { | ||
var child = childs_2[_i]; | ||
if (child.type.isService) { | ||
return child.props.services; | ||
} | ||
} | ||
return ret; | ||
}; | ||
// tslint:disable:no-any | ||
ComponentBase.prototype.getInjectedServices = function () { | ||
var childs = React.Children.toArray(this.props.children); | ||
for (var _i = 0, childs_2 = childs; _i < childs_2.length; _i++) { | ||
var child = childs_2[_i]; | ||
/* tslint:disable:no-any */ | ||
if (child.type.isService) { | ||
return child.props.services; | ||
} | ||
return []; | ||
}; | ||
return ComponentBase; | ||
}(React.PureComponent)); | ||
exports.ComponentBase = ComponentBase; | ||
}); | ||
} | ||
return []; | ||
}; | ||
return ComponentBase; | ||
}(React.PureComponent)); | ||
export { ComponentBase }; |
@@ -1,12 +0,8 @@ | ||
define(["require", "exports", "./component-base", "./util", "./complex-base", "./services", "./template"], function (require, exports, component_base_1, util_1, complex_base_1, services_1, template_1) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(component_base_1); | ||
__export(util_1); | ||
__export(complex_base_1); | ||
__export(services_1); | ||
__export(template_1); | ||
}); | ||
/** | ||
* index for component base | ||
*/ | ||
export * from './component-base'; | ||
export * from './util'; | ||
export * from './complex-base'; | ||
export * from './services'; | ||
export * from './template'; |
@@ -11,17 +11,18 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
define(["require", "exports", "react"], function (require, exports, React) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Inject = (function (_super) { | ||
__extends(Inject, _super); | ||
function Inject() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
Inject.prototype.render = function () { | ||
return null; | ||
}; | ||
Inject.isService = true; | ||
return Inject; | ||
}(React.PureComponent)); | ||
exports.Inject = Inject; | ||
}); | ||
/** | ||
* Dependency injection | ||
*/ | ||
import * as React from 'react'; | ||
var Inject = /** @class */ (function (_super) { | ||
__extends(Inject, _super); | ||
function Inject() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
// tslint:disable-next-line:no-any | ||
Inject.prototype.render = function () { | ||
return null; | ||
}; | ||
Inject.isService = true; | ||
return Inject; | ||
}(React.PureComponent)); | ||
export { Inject }; |
@@ -1,21 +0,22 @@ | ||
define(["require", "exports", "@syncfusion/ej2-base", "react-dom"], function (require, exports, ej2_base_1, ReactDOM) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var stringCompiler = ej2_base_1.getTemplateEngine(); | ||
function compile(templateElement, helper) { | ||
if (typeof templateElement === 'string') { | ||
return stringCompiler(templateElement, helper); | ||
} | ||
else { | ||
return function (data) { | ||
var ele = document.createElement('div'); | ||
document.body.appendChild(ele); | ||
ReactDOM.render(templateElement(data), ele); | ||
ej2_base_1.detach(ele); | ||
return ele.children; | ||
}; | ||
} | ||
/** | ||
* Template compiler for react | ||
*/ | ||
import { setTemplateEngine, getTemplateEngine, detach } from '@syncfusion/ej2-base'; | ||
import * as ReactDOM from 'react-dom'; | ||
// tslint:disable:no-any | ||
var stringCompiler = getTemplateEngine(); | ||
export function compile(templateElement, helper) { | ||
if (typeof templateElement === 'string') { | ||
return stringCompiler(templateElement, helper); | ||
} | ||
exports.compile = compile; | ||
ej2_base_1.setTemplateEngine({ compile: compile }); | ||
}); | ||
else { | ||
return function (data) { | ||
var ele = document.createElement('div'); | ||
document.body.appendChild(ele); | ||
ReactDOM.render(templateElement(data), ele); | ||
detach(ele); | ||
return ele.children; | ||
}; | ||
} | ||
} | ||
setTemplateEngine({ compile: compile }); |
@@ -1,12 +0,9 @@ | ||
define(["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function applyMixins(derivedClass, baseClass) { | ||
baseClass.forEach(function (baseClass) { | ||
Object.getOwnPropertyNames(baseClass.prototype).forEach(function (name) { | ||
derivedClass.prototype[name] = baseClass.prototype[name]; | ||
}); | ||
// tslint:disable-next-line:no-any | ||
export function applyMixins(derivedClass, baseClass) { | ||
// tslint:disable:typedef | ||
baseClass.forEach(function (baseClass) { | ||
Object.getOwnPropertyNames(baseClass.prototype).forEach(function (name) { | ||
derivedClass.prototype[name] = baseClass.prototype[name]; | ||
}); | ||
} | ||
exports.applyMixins = applyMixins; | ||
}); | ||
}); | ||
} |
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 too big to display
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
28
80
2017944
2303