@syncfusion/ej2-base
Advanced tools
Comparing version 16.1.29 to 16.1.30
@@ -5,4 +5,14 @@ # Changelog | ||
### Bug fixes | ||
### Common | ||
#### Bug fixes | ||
- Fixed content security policy issue. | ||
## 16.1.29 (2018-03-13) | ||
### Common | ||
#### Bug fixes | ||
- Fixed `rtl` issue in styles. | ||
@@ -12,4 +22,6 @@ | ||
### Bug fixes | ||
### Common | ||
#### Bug fixes | ||
- Fixed `statePersistence` issue in destroyed control destroy. | ||
@@ -19,4 +31,6 @@ | ||
### New Feature | ||
### Common | ||
#### New Feature | ||
- Essential JS 2 is now officially released and production ready. | ||
@@ -27,3 +41,3 @@ - Angular Universal support added | ||
### Breaking Changes | ||
#### Breaking Changes | ||
@@ -30,0 +44,0 @@ - Tag prefix for Angular components is changed from `ej` to `ejs`. For example, `ej-grid` is changed to `ejs-grid`. |
/*! | ||
* filename: index.d.ts | ||
* version : 16.1.28 | ||
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. | ||
* version : 16.1.29 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
@@ -6,0 +6,0 @@ * A copy of the current license can be obtained at any time by e-mailing |
{ | ||
"name": "@syncfusion/ej2-base", | ||
"version": "16.1.29", | ||
"version": "16.1.30", | ||
"description": "Essential JS 2 Base Library", | ||
@@ -5,0 +5,0 @@ "author": "Syncfusion Inc.", |
@@ -1,2 +0,2 @@ | ||
import { isUndefined, getValue, isNullOrUndefined, setValue, getUniqueID } from './util';import { ModuleLoader, ModuleDeclaration } from './module-loader';import { Base } from './base';import { Observer, BoundOptions } from './observer';import { ChildProperty } from './child-property';import { Property, NotifyPropertyChanges } from './notify-property-change';import { onIntlChange, rightToLeft, defaultCulture } from './internationalization'; | ||
import { isUndefined, getValue, isNullOrUndefined, setValue, getUniqueID, uniqueID } from './util';import { ModuleLoader, ModuleDeclaration } from './module-loader';import { Base } from './base';import { Observer, BoundOptions } from './observer';import { ChildProperty } from './child-property';import { Property, NotifyPropertyChanges } from './notify-property-change';import { onIntlChange, rightToLeft, defaultCulture } from './internationalization'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -10,2 +10,3 @@ import { ModuleLoader, ModuleDeclaration } from './module-loader'; | ||
private detectFunction; | ||
private randomId; | ||
/** | ||
@@ -12,0 +13,0 @@ * Enable or disable persisting component's state between page reloads. |
@@ -30,2 +30,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var _this = _super.call(this, options, selector) || this; | ||
_this.randomId = util_1.uniqueID(); | ||
_this.needsID = false; | ||
@@ -42,3 +43,3 @@ if (util_1.isNullOrUndefined(_this.enableRtl)) { | ||
_this.detectFunction = new Function('args', 'var prop = Object.keys(args); if(prop.length){this[prop[0]] = args[prop[0]];}'); | ||
internationalization_1.onIntlChange.on('notifyExternalChange', _this.detectFunction, _this); | ||
internationalization_1.onIntlChange.on('notifyExternalChange', _this.detectFunction, _this, _this.randomId); | ||
if (!util_1.isUndefined(selector)) { | ||
@@ -70,3 +71,3 @@ _this.appendTo(); | ||
this.moduleLoader.clean(); | ||
internationalization_1.onIntlChange.off('notifyExternalChange', this.detectFunction); | ||
internationalization_1.onIntlChange.off('notifyExternalChange', this.detectFunction, this.randomId); | ||
}; | ||
@@ -73,0 +74,0 @@ /** |
@@ -20,5 +20,7 @@ /** | ||
event?: string; | ||
id?: string; | ||
} | ||
export declare class Observer { | ||
private context; | ||
private ranArray; | ||
private boundedEvents; | ||
@@ -33,3 +35,3 @@ constructor(context?: Object); | ||
*/ | ||
on(property: string, handler: Function, context?: Object): void; | ||
on(property: string, handler: Function, context?: Object, id?: string): void; | ||
/** | ||
@@ -41,3 +43,3 @@ * To remove handlers from a event attached using on() function. | ||
*/ | ||
off(property: string, handler?: Function): void; | ||
off(property: string, handler?: Function, id?: string): void; | ||
/** | ||
@@ -44,0 +46,0 @@ * To notify the handlers in the specified event. |
@@ -6,2 +6,3 @@ define(["require", "exports", "./util"], function (require, exports, util_1) { | ||
function Observer(context) { | ||
this.ranArray = []; | ||
this.boundedEvents = {}; | ||
@@ -21,3 +22,3 @@ if (util_1.isNullOrUndefined(context)) { | ||
*/ | ||
Observer.prototype.on = function (property, handler, context) { | ||
Observer.prototype.on = function (property, handler, context, id) { | ||
if (util_1.isNullOrUndefined(handler)) { | ||
@@ -31,3 +32,9 @@ return; | ||
} | ||
if (!this.isHandlerPresent(this.boundedEvents[property], handler)) { | ||
if (!util_1.isNullOrUndefined(id)) { | ||
if (this.ranArray.indexOf(id) === -1) { | ||
this.ranArray.push(id); | ||
this.boundedEvents[property].push({ handler: handler, context: cntxt, id: id }); | ||
} | ||
} | ||
else if (!this.isHandlerPresent(this.boundedEvents[property], handler)) { | ||
this.boundedEvents[property].push({ handler: handler, context: cntxt }); | ||
@@ -42,3 +49,3 @@ } | ||
*/ | ||
Observer.prototype.off = function (property, handler) { | ||
Observer.prototype.off = function (property, handler, id) { | ||
if (this.notExist(property)) { | ||
@@ -50,6 +57,14 @@ return; | ||
for (var i = 0; i < curObject.length; i++) { | ||
if (handler === curObject[i].handler) { | ||
if (id) { | ||
curObject.splice(i, 1); | ||
var indexLocation = this.ranArray.indexOf(id); | ||
if (indexLocation !== -1) { | ||
this.ranArray.splice(indexLocation, 1); | ||
} | ||
break; | ||
} | ||
else if (handler === curObject[i].handler) { | ||
curObject.splice(i, 1); | ||
break; | ||
} | ||
} | ||
@@ -56,0 +71,0 @@ } |
@@ -165,1 +165,7 @@ /** | ||
export declare function addInstance(element: string | HTMLElement, instance: Object): void; | ||
/** | ||
* Function to generate the unique id. | ||
* @return {string} | ||
* @private | ||
*/ | ||
export declare function uniqueID(): string; |
@@ -385,2 +385,14 @@ define(["require", "exports"], function (require, exports) { | ||
exports.addInstance = addInstance; | ||
/** | ||
* Function to generate the unique id. | ||
* @return {string} | ||
* @private | ||
*/ | ||
function uniqueID() { | ||
// tslint:disable-next-line:no-any | ||
var num = new Uint16Array(5); | ||
var intCrypto = window.msCrypto || window.crypto; | ||
return intCrypto.getRandomValues(num); | ||
} | ||
exports.uniqueID = uniqueID; | ||
function combineArray(num) { | ||
@@ -387,0 +399,0 @@ var ret = ''; |
Sorry, the diff of this file is too big to display
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
Sorry, the diff of this file is too big to display
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
4119598
31225