@syncfusion/ej2-base 25.2.7 → 26.1.35-7502
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{README.md → ReadMe.md} +100 -100
- package/bin/syncfusion-license.js +104 -1
- package/dist/ej2-base.min.js +1 -10
- package/dist/ej2-base.umd.min.js +1 -10
- package/dist/ej2-base.umd.min.js.map +1 -1
- package/dist/es6/ej2-base.es2015.js +268 -486
- package/dist/es6/ej2-base.es2015.js.map +1 -1
- package/dist/es6/ej2-base.es5.js +307 -522
- package/dist/es6/ej2-base.es5.js.map +1 -1
- package/dist/global/ej2-base.min.js +1 -10
- package/dist/global/ej2-base.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/undefined +67 -0
- package/e2e/crypto.js +16 -16
- package/e2e/index.d.ts +27 -27
- package/e2e/m.protractor.config.js +286 -286
- package/e2e/modified-protractor/protractor.config.js +316 -316
- package/e2e/protractor.config.js +389 -389
- package/helpers/e2e/index.js +3 -3
- package/license +10 -10
- package/package.json +225 -161
- package/src/ajax.d.ts +1 -1
- package/src/ajax.js +3 -7
- package/src/animation-model.d.ts +41 -41
- package/src/animation.d.ts +1 -1
- package/src/animation.js +20 -22
- package/src/base.d.ts +2 -1
- package/src/base.js +4 -13
- package/src/browser.d.ts +1 -1
- package/src/browser.js +3 -4
- package/src/child-property.d.ts +1 -0
- package/src/child-property.js +2 -2
- package/src/component-model.d.ts +16 -16
- package/src/component.d.ts +4 -0
- package/src/component.js +28 -36
- package/src/dom.js +4 -11
- package/src/draggable-model.d.ts +113 -113
- package/src/draggable.js +20 -41
- package/src/droppable-model.d.ts +23 -23
- package/src/droppable.js +19 -20
- package/src/event-handler.js +2 -6
- package/src/fetch.js +1 -2
- package/src/hijri-parser.js +3 -3
- package/src/internationalization.d.ts +4 -0
- package/src/internationalization.js +0 -5
- package/src/intl/date-formatter.js +19 -33
- package/src/intl/date-parser.js +33 -62
- package/src/intl/intl-base.d.ts +9 -1
- package/src/intl/intl-base.js +19 -18
- package/src/intl/number-formatter.js +14 -7
- package/src/intl/number-parser.js +2 -6
- package/src/intl/parser-base.js +6 -11
- package/src/keyboard-model.d.ts +16 -16
- package/src/keyboard.js +19 -20
- package/src/module-loader.js +1 -0
- package/src/notify-property-change.d.ts +0 -20
- package/src/notify-property-change.js +16 -55
- package/src/observer.js +3 -6
- package/src/sanitize-helper.js +0 -1
- package/src/template-engine.js +1 -7
- package/src/template.js +13 -18
- package/src/touch-model.d.ts +39 -39
- package/src/touch.js +22 -27
- package/src/util.d.ts +4 -4
- package/src/util.js +12 -37
- package/src/validate-lic.js +4 -3
- package/styles/_all.scss +2 -2
- package/styles/_bds-dark-definition.scss +16 -15
- package/styles/_bds-definition.scss +16 -15
- package/styles/_bootstrap-dark-definition.scss +42 -42
- package/styles/_bootstrap-definition.scss +42 -42
- package/styles/_bootstrap4-definition.scss +11 -11
- package/styles/_bootstrap5-dark-definition.scss +9 -9
- package/styles/_bootstrap5-definition.scss +8 -8
- package/styles/_bootstrap5.3-dark-definition.scss +8 -0
- package/styles/_bootstrap5.3-definition.scss +8 -0
- package/styles/_fabric-dark-definition.scss +42 -42
- package/styles/_fabric-definition.scss +42 -42
- package/styles/_fluent-dark-definition.scss +9 -9
- package/styles/_fluent-definition.scss +9 -9
- package/styles/_fluent2-dark-definition.scss +9 -0
- package/styles/_fluent2-definition.scss +9 -0
- package/styles/_fluent2-highcontrast-definition.scss +9 -0
- package/styles/_fusionnew-dark-definition.scss +8 -8
- package/styles/_fusionnew-definition.scss +8 -8
- package/styles/_highcontrast-definition.scss +42 -42
- package/styles/_highcontrast-light-definition.scss +42 -42
- package/styles/_material-dark-definition.scss +49 -48
- package/styles/_material-definition.scss +50 -49
- package/styles/_material3-dark-definition.scss +15 -14
- package/styles/_material3-definition.scss +16 -15
- package/styles/_tailwind-dark-definition.scss +16 -15
- package/styles/_tailwind-definition.scss +16 -15
- package/styles/_tailwind3-dark-definition.scss +15 -0
- package/styles/_tailwind3-definition.scss +15 -0
- package/styles/animation/_all.scss +535 -560
- package/styles/bds-lite.css +3408 -0
- package/styles/bds-lite.scss +3 -0
- package/styles/bds.css +3408 -0
- package/styles/bds.scss +3 -0
- package/styles/bootstrap-dark-lite.css +3749 -0
- package/styles/bootstrap-dark-lite.scss +3 -0
- package/styles/bootstrap-dark.css +1075 -169
- package/styles/bootstrap-lite.css +3749 -0
- package/styles/bootstrap-lite.scss +3 -0
- package/styles/bootstrap.css +1075 -169
- package/styles/bootstrap4-lite.css +3390 -0
- package/styles/bootstrap4-lite.scss +3 -0
- package/styles/bootstrap4.css +1063 -169
- package/styles/bootstrap5-dark-lite.css +2966 -0
- package/styles/bootstrap5-dark-lite.scss +3 -0
- package/styles/bootstrap5-dark.css +1068 -171
- package/styles/bootstrap5-lite.css +2966 -0
- package/styles/bootstrap5-lite.scss +3 -0
- package/styles/bootstrap5.3-lite.css +3559 -0
- package/styles/bootstrap5.3-lite.scss +3 -0
- package/styles/bootstrap5.3.css +3559 -0
- package/styles/bootstrap5.3.scss +3 -0
- package/styles/bootstrap5.css +1066 -169
- package/styles/common/_all.scss +2 -2
- package/styles/common/_core.scss +111 -117
- package/styles/common/_mixin.scss +11 -9
- package/styles/definition/_bds-dark.scss +1193 -1178
- package/styles/definition/_bds.scss +1488 -1458
- package/styles/definition/_bootstrap-dark.scss +213 -219
- package/styles/definition/_bootstrap.scss +208 -215
- package/styles/definition/_bootstrap4.scss +159 -167
- package/styles/definition/_bootstrap5-dark.scss +481 -494
- package/styles/definition/_bootstrap5.3-dark.scss +1232 -0
- package/styles/definition/_bootstrap5.3.scss +1579 -0
- package/styles/definition/_bootstrap5.scss +481 -495
- package/styles/definition/_fabric-dark.scss +194 -200
- package/styles/definition/_fabric.scss +192 -198
- package/styles/definition/_fluent-dark.scss +494 -557
- package/styles/definition/_fluent.scss +494 -558
- package/styles/definition/_fluent2-dark.scss +1523 -0
- package/styles/definition/_fluent2-highcontrast.scss +1523 -0
- package/styles/definition/_fluent2.scss +2295 -0
- package/styles/definition/_fusionnew-dark.scss +330 -362
- package/styles/definition/_fusionnew.scss +331 -363
- package/styles/definition/_highcontrast-light.scss +189 -193
- package/styles/definition/_highcontrast.scss +189 -195
- package/styles/definition/_material-dark.scss +193 -198
- package/styles/definition/_material.scss +186 -192
- package/styles/definition/_material3-dark.scss +660 -710
- package/styles/definition/_material3.scss +729 -792
- package/styles/definition/_tailwind-dark.scss +445 -488
- package/styles/definition/_tailwind.scss +443 -485
- package/styles/definition/_tailwind3-dark.scss +1622 -0
- package/styles/definition/_tailwind3.scss +2093 -0
- package/styles/fabric-dark-lite.css +3734 -0
- package/styles/fabric-dark-lite.scss +3 -0
- package/styles/fabric-dark.css +1075 -169
- package/styles/fabric-lite.css +3734 -0
- package/styles/fabric-lite.scss +3 -0
- package/styles/fabric.css +1075 -169
- package/styles/fluent-dark-lite.css +2966 -0
- package/styles/fluent-dark-lite.scss +3 -0
- package/styles/fluent-dark.css +1066 -169
- package/styles/fluent-lite.css +2966 -0
- package/styles/fluent-lite.scss +3 -0
- package/styles/fluent.css +1066 -169
- package/styles/fluent2-lite.css +4017 -0
- package/styles/fluent2-lite.scss +3 -0
- package/styles/fluent2.css +4017 -0
- package/styles/fluent2.scss +3 -0
- package/styles/highcontrast-light-lite.css +3725 -0
- package/styles/highcontrast-light-lite.scss +3 -0
- package/styles/highcontrast-light.css +1075 -169
- package/styles/highcontrast-lite.css +3725 -0
- package/styles/highcontrast-lite.scss +3 -0
- package/styles/highcontrast.css +1075 -169
- package/styles/material-dark-lite.css +3702 -0
- package/styles/material-dark-lite.scss +3 -0
- package/styles/material-dark.css +1075 -169
- package/styles/material-lite.css +3702 -0
- package/styles/material-lite.scss +3 -0
- package/styles/material.css +1075 -169
- package/styles/material3-dark-lite.css +3021 -0
- package/styles/material3-dark-lite.scss +3 -0
- package/styles/material3-dark.css +1066 -170
- package/styles/material3-lite.css +3077 -0
- package/styles/material3-lite.scss +3 -0
- package/styles/material3.css +1066 -170
- package/styles/offline-theme/material-dark.css +1075 -169
- package/styles/offline-theme/material.css +1075 -169
- package/styles/offline-theme/tailwind-dark.css +1067 -170
- package/styles/offline-theme/tailwind.css +1067 -170
- package/styles/tailwind-dark-lite.css +2967 -0
- package/styles/tailwind-dark-lite.scss +3 -0
- package/styles/tailwind-dark.css +1067 -170
- package/styles/tailwind-lite.css +2967 -0
- package/styles/tailwind-lite.scss +3 -0
- package/styles/tailwind.css +1067 -170
- package/styles/tailwind3-lite.css +3775 -0
- package/styles/tailwind3-lite.scss +3 -0
- package/styles/tailwind3.css +3775 -0
- package/styles/tailwind3.scss +3 -0
- package/.eslintrc.json +0 -260
- package/CHANGELOG.md +0 -649
- package/tslint.json +0 -111
|
@@ -2,8 +2,7 @@ import { extend, isNullOrUndefined, isBlazor, getValue } from '../util';
|
|
|
2
2
|
import { ParserBase as parser } from './parser-base';
|
|
3
3
|
import { IntlBase as base } from './intl-base';
|
|
4
4
|
var regExp = RegExp;
|
|
5
|
-
|
|
6
|
-
var parseRegex = new regExp('^([^0-9]*)' + '(([0-9,]*[0-9]+)(\.[0-9]+)?)' + '([Ee][+-]?[0-9]+)?([^0-9]*)$');
|
|
5
|
+
var parseRegex = new regExp('^([^0-9]*)' + '(([0-9,]*[0-9]+)(.[0-9]+)?)' + '([Ee][+-]?[0-9]+)?([^0-9]*)$');
|
|
7
6
|
var groupRegex = /,/g;
|
|
8
7
|
var keys = ['minusSign', 'infinity'];
|
|
9
8
|
/**
|
|
@@ -26,7 +25,6 @@ var NumberParser = /** @class */ (function () {
|
|
|
26
25
|
var _this = this;
|
|
27
26
|
var dependable = base.getDependables(cldr, culture, '', true);
|
|
28
27
|
var parseOptions = { custom: true };
|
|
29
|
-
var numOptions;
|
|
30
28
|
if ((base.formatRegex.test(option.format)) || !(option.format)) {
|
|
31
29
|
extend(parseOptions, base.getProperNumericSkeleton(option.format || 'N'));
|
|
32
30
|
parseOptions.custom = false;
|
|
@@ -40,10 +38,8 @@ var NumberParser = /** @class */ (function () {
|
|
|
40
38
|
extend(parseOptions, base.customFormat(option.format, null, null));
|
|
41
39
|
}
|
|
42
40
|
var numbers = getValue('numbers', dependable.parserObject);
|
|
43
|
-
|
|
44
|
-
numOptions = parser.getCurrentNumericOptions(dependable.parserObject, parser.getNumberingSystem(cldr), true, isBlazor());
|
|
41
|
+
var numOptions = parser.getCurrentNumericOptions(dependable.parserObject, parser.getNumberingSystem(cldr), true, isBlazor());
|
|
45
42
|
parseOptions.symbolRegex = parser.getSymbolRegex(Object.keys(numOptions.symbolMatch));
|
|
46
|
-
// eslint-disable-next-line
|
|
47
43
|
parseOptions.infinity = numOptions.symbolNumberSystem[keys[1]];
|
|
48
44
|
var symbolpattern;
|
|
49
45
|
if (!isBlazor()) {
|
package/src/intl/parser-base.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
/**
|
|
2
3
|
* Parser
|
|
3
4
|
*/
|
|
@@ -59,10 +60,8 @@ var ParserBase = /** @class */ (function () {
|
|
|
59
60
|
var res = {};
|
|
60
61
|
for (var _i = 0, propKeys_1 = propKeys; _i < propKeys_1.length; _i++) {
|
|
61
62
|
var key = propKeys_1[_i];
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// eslint-disable-next-line
|
|
65
|
-
res[prop[key]] = key;
|
|
63
|
+
if (!Object.prototype.hasOwnProperty.call(res, prop["" + key])) {
|
|
64
|
+
res[prop["" + key]] = key;
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
return res;
|
|
@@ -90,8 +89,7 @@ var ParserBase = /** @class */ (function () {
|
|
|
90
89
|
var ret = {};
|
|
91
90
|
for (var _i = 0, matchKeys_1 = matchKeys; _i < matchKeys_1.length; _i++) {
|
|
92
91
|
var key = matchKeys_1[_i];
|
|
93
|
-
|
|
94
|
-
ret[prop[key]] = defaultNumberSymbols[key];
|
|
92
|
+
ret[prop["" + key]] = defaultNumberSymbols["" + key];
|
|
95
93
|
}
|
|
96
94
|
return ret;
|
|
97
95
|
};
|
|
@@ -124,8 +122,7 @@ var ParserBase = /** @class */ (function () {
|
|
|
124
122
|
*/
|
|
125
123
|
ParserBase.convertValueParts = function (value, regex, obj) {
|
|
126
124
|
return value.replace(regex, function (str) {
|
|
127
|
-
|
|
128
|
-
return obj[str];
|
|
125
|
+
return obj["" + str];
|
|
129
126
|
});
|
|
130
127
|
};
|
|
131
128
|
/**
|
|
@@ -177,7 +174,6 @@ var ParserBase = /** @class */ (function () {
|
|
|
177
174
|
* @param {boolean} isNumber ?
|
|
178
175
|
* @returns {NumberMapper} ?
|
|
179
176
|
*/
|
|
180
|
-
// eslint-disable-next-line
|
|
181
177
|
ParserBase.getNumberMapper = function (curObj, numberSystem, isNumber) {
|
|
182
178
|
var ret = { mapper: {} };
|
|
183
179
|
var cur = this.getDefaultNumberingSystem(curObj);
|
|
@@ -189,8 +185,7 @@ var ParserBase = /** @class */ (function () {
|
|
|
189
185
|
if (!isUndefined(digits)) {
|
|
190
186
|
for (var _i = 0, latnNumberSystem_1 = latnNumberSystem; _i < latnNumberSystem_1.length; _i++) {
|
|
191
187
|
var i = latnNumberSystem_1[_i];
|
|
192
|
-
|
|
193
|
-
ret.mapper[i] = digits[i];
|
|
188
|
+
ret.mapper[parseInt(i.toString(), 10)] = digits[parseInt(i.toString(), 10)];
|
|
194
189
|
}
|
|
195
190
|
}
|
|
196
191
|
}
|
package/src/keyboard-model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from './notify-property-change';
|
|
1
|
+
import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from './notify-property-change';
|
|
2
2
|
import {KeyboardEventArgs} from "./keyboard";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -7,24 +7,24 @@ import {KeyboardEventArgs} from "./keyboard";
|
|
|
7
7
|
export interface KeyboardEventsModel {
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Specifies key combination and it respective action name.
|
|
11
|
-
*
|
|
12
|
-
* @default null
|
|
13
|
-
*/
|
|
14
|
-
keyConfigs?: { [key: string]: string };
|
|
10
|
+
* Specifies key combination and it respective action name.
|
|
11
|
+
*
|
|
12
|
+
* @default null
|
|
13
|
+
*/
|
|
14
|
+
keyConfigs?: { [key: string]: string };
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
|
|
18
|
-
*
|
|
19
|
-
* @default keyup
|
|
20
|
-
*/
|
|
21
|
-
eventName?: string;
|
|
17
|
+
* Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
|
|
18
|
+
*
|
|
19
|
+
* @default keyup
|
|
20
|
+
*/
|
|
21
|
+
eventName?: string;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Specifies the listener when keyboard actions is performed.
|
|
25
|
-
*
|
|
26
|
-
* @event keyAction
|
|
27
|
-
*/
|
|
28
|
-
keyAction?: EmitType<KeyboardEventArgs>;
|
|
24
|
+
* Specifies the listener when keyboard actions is performed.
|
|
25
|
+
*
|
|
26
|
+
* @event keyAction
|
|
27
|
+
*/
|
|
28
|
+
keyAction?: EmitType<KeyboardEventArgs>;
|
|
29
29
|
|
|
30
30
|
}
|
package/src/keyboard.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
};
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
20
|
import { Property, NotifyPropertyChanges, Event } from './notify-property-change';
|
|
21
21
|
import { Base } from './base';
|
|
22
22
|
var keyCode = {
|
|
@@ -139,7 +139,6 @@ var KeyboardEvents = /** @class */ (function (_super) {
|
|
|
139
139
|
* @returns {void} ?
|
|
140
140
|
* @private
|
|
141
141
|
*/
|
|
142
|
-
// eslint-disable-next-line
|
|
143
142
|
KeyboardEvents.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
144
143
|
// No code are needed
|
|
145
144
|
};
|
package/src/module-loader.js
CHANGED
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {Object} defaultValue - Specifies the default value of property.
|
|
5
5
|
* @returns {PropertyDecorator} ?
|
|
6
|
-
* ```
|
|
7
|
-
* @Property('TypeScript')
|
|
8
|
-
* propertyName: Type;
|
|
9
|
-
* ```
|
|
10
6
|
* @private
|
|
11
7
|
*/
|
|
12
8
|
export declare function Property<T>(defaultValue?: T | Object): PropertyDecorator;
|
|
@@ -75,22 +71,6 @@ export declare function Event(): PropertyDecorator;
|
|
|
75
71
|
*
|
|
76
72
|
* @param {Function} classConstructor ?
|
|
77
73
|
* @returns {void} ?
|
|
78
|
-
* ```
|
|
79
|
-
* @NotifyPropertyChanges
|
|
80
|
-
* class DemoClass implements INotifyPropertyChanged {
|
|
81
|
-
*
|
|
82
|
-
* @Property()
|
|
83
|
-
* property1: string;
|
|
84
|
-
*
|
|
85
|
-
* dataBind: () => void;
|
|
86
|
-
*
|
|
87
|
-
* constructor() { }
|
|
88
|
-
*
|
|
89
|
-
* onPropertyChanged(newProp: any, oldProp: any) {
|
|
90
|
-
* // Called when property changed
|
|
91
|
-
* }
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
94
74
|
* @private
|
|
95
75
|
*/
|
|
96
76
|
export declare function NotifyPropertyChanges(classConstructor: Function): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { createInstance, isUndefined, merge, extend, getValue } from './util';
|
|
2
3
|
/**
|
|
3
4
|
* Returns the Class Object
|
|
@@ -8,10 +9,8 @@ import { createInstance, isUndefined, merge, extend, getValue } from './util';
|
|
|
8
9
|
* @param {Object[]} type ?
|
|
9
10
|
* @returns {ClassObject} ?
|
|
10
11
|
*/
|
|
11
|
-
// eslint-disable-next-line
|
|
12
12
|
function getObject(instance, curKey, defaultValue, type) {
|
|
13
|
-
|
|
14
|
-
if (!instance.properties.hasOwnProperty(curKey) || !(instance.properties[curKey] instanceof type)) {
|
|
13
|
+
if (!Object.prototype.hasOwnProperty.call(instance.properties, curKey) || !(instance.properties["" + curKey] instanceof type)) {
|
|
15
14
|
instance.properties["" + curKey] = createInstance(type, [instance, curKey, defaultValue]);
|
|
16
15
|
}
|
|
17
16
|
return instance.properties["" + curKey];
|
|
@@ -27,7 +26,6 @@ function getObject(instance, curKey, defaultValue, type) {
|
|
|
27
26
|
* @param {boolean} isFactory ?
|
|
28
27
|
* @returns {Object[]} ?
|
|
29
28
|
*/
|
|
30
|
-
// eslint-disable-next-line
|
|
31
29
|
function getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactory) {
|
|
32
30
|
var result = [];
|
|
33
31
|
var len = defaultValue ? defaultValue.length : 0;
|
|
@@ -56,8 +54,7 @@ function getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactor
|
|
|
56
54
|
*/
|
|
57
55
|
function propertyGetter(defaultValue, curKey) {
|
|
58
56
|
return function () {
|
|
59
|
-
|
|
60
|
-
if (!this.properties.hasOwnProperty(curKey)) {
|
|
57
|
+
if (!Object.prototype.hasOwnProperty.call(this.properties, curKey)) {
|
|
61
58
|
this.properties["" + curKey] = defaultValue;
|
|
62
59
|
}
|
|
63
60
|
return this.properties["" + curKey];
|
|
@@ -73,8 +70,7 @@ function propertyGetter(defaultValue, curKey) {
|
|
|
73
70
|
function propertySetter(defaultValue, curKey) {
|
|
74
71
|
return function (newValue) {
|
|
75
72
|
if (this.properties["" + curKey] !== newValue) {
|
|
76
|
-
|
|
77
|
-
var oldVal = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;
|
|
73
|
+
var oldVal = Object.prototype.hasOwnProperty.call(this.properties, curKey) ? this.properties["" + curKey] : defaultValue;
|
|
78
74
|
this.saveChanges(curKey, newValue, oldVal);
|
|
79
75
|
this.properties["" + curKey] = newValue;
|
|
80
76
|
}
|
|
@@ -88,7 +84,6 @@ function propertySetter(defaultValue, curKey) {
|
|
|
88
84
|
* @param {Object[]} type ?
|
|
89
85
|
* @returns {void} ?
|
|
90
86
|
*/
|
|
91
|
-
// eslint-disable-next-line
|
|
92
87
|
function complexGetter(defaultValue, curKey, type) {
|
|
93
88
|
return function () {
|
|
94
89
|
return getObject(this, curKey, defaultValue, type);
|
|
@@ -114,12 +109,10 @@ function complexSetter(defaultValue, curKey, type) {
|
|
|
114
109
|
* @param {FunctionConstructor} type ?
|
|
115
110
|
* @returns {void} ?
|
|
116
111
|
*/
|
|
117
|
-
// eslint-disable-next-line
|
|
118
112
|
function complexFactoryGetter(defaultValue, curKey, type) {
|
|
119
113
|
return function () {
|
|
120
114
|
var curType = type({});
|
|
121
|
-
|
|
122
|
-
if (this.properties.hasOwnProperty(curKey)) {
|
|
115
|
+
if (Object.prototype.hasOwnProperty.call(this.properties, curKey)) {
|
|
123
116
|
return this.properties["" + curKey];
|
|
124
117
|
}
|
|
125
118
|
else {
|
|
@@ -150,15 +143,13 @@ function complexFactorySetter(defaultValue, curKey, type) {
|
|
|
150
143
|
function complexArrayGetter(defaultValue, curKey, type) {
|
|
151
144
|
return function () {
|
|
152
145
|
var _this = this;
|
|
153
|
-
|
|
154
|
-
if (!this.properties.hasOwnProperty(curKey)) {
|
|
146
|
+
if (!Object.prototype.hasOwnProperty.call(this.properties, curKey)) {
|
|
155
147
|
var defCollection = getObjectArray(this, curKey, defaultValue, type, false);
|
|
156
148
|
this.properties["" + curKey] = defCollection;
|
|
157
149
|
}
|
|
158
150
|
var ignore = ((this.controlParent !== undefined && this.controlParent.ignoreCollectionWatch)
|
|
159
151
|
|| this.ignoreCollectionWatch);
|
|
160
|
-
|
|
161
|
-
if (!this.properties[curKey].hasOwnProperty('push') && !ignore) {
|
|
152
|
+
if (!Object.prototype.hasOwnProperty.call(this.properties["" + curKey], 'push') && !ignore) {
|
|
162
153
|
['push', 'pop'].forEach(function (extendFunc) {
|
|
163
154
|
var descriptor = {
|
|
164
155
|
value: complexArrayDefinedCallback(extendFunc, curKey, type, _this.properties["" + curKey]).bind(_this),
|
|
@@ -167,8 +158,7 @@ function complexArrayGetter(defaultValue, curKey, type) {
|
|
|
167
158
|
Object.defineProperty(_this.properties["" + curKey], extendFunc, descriptor);
|
|
168
159
|
});
|
|
169
160
|
}
|
|
170
|
-
|
|
171
|
-
if (!this.properties[curKey].hasOwnProperty('isComplexArray')) {
|
|
161
|
+
if (!Object.prototype.hasOwnProperty.call(this.properties["" + curKey], 'isComplexArray')) {
|
|
172
162
|
Object.defineProperty(this.properties["" + curKey], 'isComplexArray', { value: true });
|
|
173
163
|
}
|
|
174
164
|
return this.properties["" + curKey];
|
|
@@ -200,8 +190,7 @@ function complexArraySetter(defaultValue, curKey, type) {
|
|
|
200
190
|
*/
|
|
201
191
|
function complexArrayFactorySetter(defaultValue, curKey, type) {
|
|
202
192
|
return function (newValue) {
|
|
203
|
-
|
|
204
|
-
var oldValueCollection = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;
|
|
193
|
+
var oldValueCollection = Object.prototype.hasOwnProperty.call(this.properties, curKey) ? this.properties["" + curKey] : defaultValue;
|
|
205
194
|
var newValCollection = getObjectArray(this, curKey, newValue, type, true, true);
|
|
206
195
|
this.saveChanges(curKey, newValCollection, oldValueCollection);
|
|
207
196
|
this.properties["" + curKey] = newValCollection;
|
|
@@ -217,8 +206,7 @@ function complexArrayFactorySetter(defaultValue, curKey, type) {
|
|
|
217
206
|
function complexArrayFactoryGetter(defaultValue, curKey, type) {
|
|
218
207
|
return function () {
|
|
219
208
|
var curType = type({});
|
|
220
|
-
|
|
221
|
-
if (!this.properties.hasOwnProperty(curKey)) {
|
|
209
|
+
if (!Object.prototype.hasOwnProperty.call(this.properties, curKey)) {
|
|
222
210
|
var defCollection = getObjectArray(this, curKey, defaultValue, curType, false);
|
|
223
211
|
this.properties["" + curKey] = defCollection;
|
|
224
212
|
}
|
|
@@ -234,7 +222,6 @@ function complexArrayFactoryGetter(defaultValue, curKey, type) {
|
|
|
234
222
|
* @returns {Object} ?
|
|
235
223
|
*/
|
|
236
224
|
function complexArrayDefinedCallback(dFunc, curKey, type, prop) {
|
|
237
|
-
/* tslint:disable no-function-expression */
|
|
238
225
|
return function () {
|
|
239
226
|
var newValue = [];
|
|
240
227
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -246,16 +233,16 @@ function complexArrayDefinedCallback(dFunc, curKey, type, prop) {
|
|
|
246
233
|
for (var i = 0; i < newValue.length; i++) {
|
|
247
234
|
var newValueParse = newValue[parseInt(i.toString(), 10)];
|
|
248
235
|
Array.prototype["" + dFunc].apply(prop, [newValueParse]);
|
|
249
|
-
var
|
|
250
|
-
this.serverDataBind(
|
|
236
|
+
var model = getArrayModel(keyString + (prop.length - 1), newValueParse, !this.controlParent, dFunc);
|
|
237
|
+
this.serverDataBind(model, newValue[parseInt(i.toString(), 10)], false, dFunc);
|
|
251
238
|
}
|
|
252
239
|
break;
|
|
253
|
-
case 'pop':
|
|
240
|
+
case 'pop': {
|
|
254
241
|
Array.prototype["" + dFunc].apply(prop);
|
|
255
|
-
// eslint-disable-next-line
|
|
256
242
|
var model = getArrayModel(keyString + prop.length, null, !this.controlParent, dFunc);
|
|
257
243
|
this.serverDataBind(model, { ejsAction: 'pop' }, false, dFunc);
|
|
258
244
|
break;
|
|
245
|
+
}
|
|
259
246
|
}
|
|
260
247
|
return prop;
|
|
261
248
|
};
|
|
@@ -280,16 +267,11 @@ function getArrayModel(keyString, value, isControlParent, arrayFunction) {
|
|
|
280
267
|
}
|
|
281
268
|
return modelObject;
|
|
282
269
|
}
|
|
283
|
-
// eslint-disable-next-line
|
|
284
270
|
/**
|
|
285
271
|
* Method used to create property. General syntax below.
|
|
286
272
|
*
|
|
287
273
|
* @param {Object} defaultValue - Specifies the default value of property.
|
|
288
274
|
* @returns {PropertyDecorator} ?
|
|
289
|
-
* ```
|
|
290
|
-
* @Property('TypeScript')
|
|
291
|
-
* propertyName: Type;
|
|
292
|
-
* ```
|
|
293
275
|
* @private
|
|
294
276
|
*/
|
|
295
277
|
export function Property(defaultValue) {
|
|
@@ -439,25 +421,8 @@ export function Event() {
|
|
|
439
421
|
*
|
|
440
422
|
* @param {Function} classConstructor ?
|
|
441
423
|
* @returns {void} ?
|
|
442
|
-
* ```
|
|
443
|
-
* @NotifyPropertyChanges
|
|
444
|
-
* class DemoClass implements INotifyPropertyChanged {
|
|
445
|
-
*
|
|
446
|
-
* @Property()
|
|
447
|
-
* property1: string;
|
|
448
|
-
*
|
|
449
|
-
* dataBind: () => void;
|
|
450
|
-
*
|
|
451
|
-
* constructor() { }
|
|
452
|
-
*
|
|
453
|
-
* onPropertyChanged(newProp: any, oldProp: any) {
|
|
454
|
-
* // Called when property changed
|
|
455
|
-
* }
|
|
456
|
-
* }
|
|
457
|
-
* ```
|
|
458
424
|
* @private
|
|
459
425
|
*/
|
|
460
|
-
// eslint-disable-next-line
|
|
461
426
|
export function NotifyPropertyChanges(classConstructor) {
|
|
462
427
|
/** Need to code */
|
|
463
428
|
}
|
|
@@ -485,13 +450,11 @@ function addPropertyCollection(target, key, propertyType, defaultValue, type) {
|
|
|
485
450
|
eventNames: []
|
|
486
451
|
};
|
|
487
452
|
}
|
|
488
|
-
// eslint-disable-next-line
|
|
489
453
|
target.propList[propertyType + 's'].push({
|
|
490
454
|
propertyName: key,
|
|
491
455
|
defaultValue: defaultValue,
|
|
492
456
|
type: type
|
|
493
457
|
});
|
|
494
|
-
// eslint-disable-next-line
|
|
495
458
|
target.propList[propertyType + 'Names'].push(key);
|
|
496
459
|
}
|
|
497
460
|
/**
|
|
@@ -560,8 +523,7 @@ export function CreateBuilder(component) {
|
|
|
560
523
|
return this;
|
|
561
524
|
};
|
|
562
525
|
var instanceFunction = function (element) {
|
|
563
|
-
|
|
564
|
-
if (!builderFunction.prototype.hasOwnProperty('create')) {
|
|
526
|
+
if (!Object.prototype.hasOwnProperty.call(builderFunction, 'create')) {
|
|
565
527
|
builderFunction.prototype = getBuilderProperties(component);
|
|
566
528
|
builderFunction.prototype.create = function () {
|
|
567
529
|
var temp = extend({}, {}, this.properties);
|
|
@@ -582,8 +544,7 @@ export function CreateBuilder(component) {
|
|
|
582
544
|
* @private
|
|
583
545
|
*/
|
|
584
546
|
function getParentContext(context, prefix) {
|
|
585
|
-
|
|
586
|
-
if (context.hasOwnProperty('parentObj') === false) {
|
|
547
|
+
if (Object.prototype.hasOwnProperty.call(context, 'parentObj') === false) {
|
|
587
548
|
return { context: context, prefix: prefix };
|
|
588
549
|
}
|
|
589
550
|
else {
|
package/src/observer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types */
|
|
1
2
|
import { isNullOrUndefined, getValue, extend, isBlazor } from './util';
|
|
2
3
|
var Observer = /** @class */ (function () {
|
|
3
4
|
function Observer(context) {
|
|
@@ -139,7 +140,6 @@ var Observer = /** @class */ (function () {
|
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
|
-
// eslint-disable-next-line
|
|
143
143
|
Observer.prototype.dateReviver = function (key, value) {
|
|
144
144
|
var dPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;
|
|
145
145
|
if (isBlazor && typeof value === 'string' && value.match(dPattern) !== null) {
|
|
@@ -170,12 +170,10 @@ var Observer = /** @class */ (function () {
|
|
|
170
170
|
* @returns {void} ?
|
|
171
171
|
*/
|
|
172
172
|
Observer.prototype.offIntlEvents = function () {
|
|
173
|
-
// eslint-disable-next-line
|
|
174
173
|
var eventsArr = this.boundedEvents['notifyExternalChange'];
|
|
175
174
|
if (eventsArr) {
|
|
176
175
|
for (var i = 0; i < eventsArr.length; i++) {
|
|
177
|
-
|
|
178
|
-
var curContext = eventsArr["" + i].context;
|
|
176
|
+
var curContext = eventsArr[parseInt(i.toString(), 10)].context;
|
|
179
177
|
if (curContext && curContext.detectFunction && curContext.randomId && !curContext.isRendered) {
|
|
180
178
|
this.off('notifyExternalChange', curContext.detectFunction, curContext.randomId);
|
|
181
179
|
i--;
|
|
@@ -193,8 +191,7 @@ var Observer = /** @class */ (function () {
|
|
|
193
191
|
* @returns {boolean} ?
|
|
194
192
|
*/
|
|
195
193
|
Observer.prototype.notExist = function (prop) {
|
|
196
|
-
|
|
197
|
-
return this.boundedEvents.hasOwnProperty(prop) === false || this.boundedEvents[prop].length <= 0;
|
|
194
|
+
return Object.prototype.hasOwnProperty.call(this.boundedEvents, prop) === false || this.boundedEvents["" + prop].length <= 0;
|
|
198
195
|
};
|
|
199
196
|
/**
|
|
200
197
|
* Returns if the handler is present.
|
package/src/sanitize-helper.js
CHANGED
|
@@ -179,7 +179,6 @@ var SanitizeHtmlHelper = /** @class */ (function () {
|
|
|
179
179
|
};
|
|
180
180
|
SanitizeHtmlHelper.removeXssAttrs = function () {
|
|
181
181
|
var _this = this;
|
|
182
|
-
// eslint-disable-next-line
|
|
183
182
|
this.removeAttrs.forEach(function (item, index) {
|
|
184
183
|
var elements = _this.wrapElement.querySelectorAll(item.selector);
|
|
185
184
|
if (elements.length > 0) {
|
package/src/template-engine.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types */
|
|
1
2
|
/**
|
|
2
3
|
* Template Engine Bridge
|
|
3
4
|
*/
|
|
@@ -23,10 +24,8 @@ export function getRandomId() {
|
|
|
23
24
|
* @returns {NodeList} ?
|
|
24
25
|
* @private
|
|
25
26
|
*/
|
|
26
|
-
// eslint-disable-next-line
|
|
27
27
|
export function compile(templateString, helper, ignorePrefix) {
|
|
28
28
|
var compiler = engineObj.compile(templateString, helper, ignorePrefix);
|
|
29
|
-
// eslint-disable-next-line
|
|
30
29
|
return function (data, component, propName, templateId, isStringTemplate, index, element, root) {
|
|
31
30
|
var result = compiler(data, component, propName, element, root);
|
|
32
31
|
var blazorTemplateId = 'BlazorTemplateId';
|
|
@@ -52,9 +51,7 @@ export function compile(templateString, helper, ignorePrefix) {
|
|
|
52
51
|
data["" + blazorTemplateId] = blazorId;
|
|
53
52
|
blazorTemplates["" + templateId].push(data);
|
|
54
53
|
}
|
|
55
|
-
// eslint-disable-next-line
|
|
56
54
|
return propName === 'rowTemplate' ? [createElement('tr', { id: blazorId, className: 'e-blazor-template' })] :
|
|
57
|
-
// eslint-disable-next-line
|
|
58
55
|
[createElement('div', { id: blazorId, className: 'e-blazor-template' })];
|
|
59
56
|
}
|
|
60
57
|
if (typeof result === 'string') {
|
|
@@ -100,7 +97,6 @@ export function updateBlazorTemplate(templateId, templateName, comp, isEmpty, ca
|
|
|
100
97
|
export function resetBlazorTemplate(templateId, templateName, index) {
|
|
101
98
|
var templateDiv = document.getElementById(templateId);
|
|
102
99
|
if (templateDiv) {
|
|
103
|
-
// eslint-disable-next-line
|
|
104
100
|
var innerTemplates = templateDiv.getElementsByClassName('blazor-inner-template');
|
|
105
101
|
for (var i = 0; i < innerTemplates.length; i++) {
|
|
106
102
|
var tempId = ' ';
|
|
@@ -153,7 +149,6 @@ export function getTemplateEngine() {
|
|
|
153
149
|
* @returns {Function} ?
|
|
154
150
|
* @private
|
|
155
151
|
*/
|
|
156
|
-
// eslint-disable-next-line
|
|
157
152
|
export function initializeCSPTemplate(template, helper) {
|
|
158
153
|
var boundFunc;
|
|
159
154
|
template.prototype.CSPTemplate = true;
|
|
@@ -170,7 +165,6 @@ export function initializeCSPTemplate(template, helper) {
|
|
|
170
165
|
var Engine = /** @class */ (function () {
|
|
171
166
|
function Engine() {
|
|
172
167
|
}
|
|
173
|
-
// eslint-disable-next-line
|
|
174
168
|
Engine.prototype.compile = function (templateString, helper, ignorePrefix) {
|
|
175
169
|
if (helper === void 0) { helper = {}; }
|
|
176
170
|
return render(templateString, helper);
|
package/src/template.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
/**
|
|
2
3
|
* Template Engine
|
|
3
4
|
*/
|
|
@@ -65,10 +66,8 @@ export function compile(template, helper, ignorePrefix) {
|
|
|
65
66
|
else {
|
|
66
67
|
var argName = 'data';
|
|
67
68
|
var evalExpResult = evalExp(template, argName, helper, ignorePrefix);
|
|
68
|
-
/* eslint-disable */
|
|
69
69
|
var condtion = "var valueRegEx = (/value=\\'([A-Za-z0-9 _]*)((.)([\\w)(!-;?-\u25A0\\s]+)['])/g);\n var hrefRegex = (/(?:href)([\\s='\"./]+)([\\w-./?=&\\\\#\"]+)((.)([\\w)(!-;/?-\u25A0\\s]+)['])/g);\n if(str.match(valueRegEx)){\n var check = str.match(valueRegEx);\n var str1 = str;\n for (var i=0; i < check.length; i++) {\n var check1 = str.match(valueRegEx)[i].split('value=')[1];\n var change = check1.match(/^'/) !== null ? check1.replace(/^'/, '\"') : check1;\n change =change.match(/.$/)[0] === '\\'' ? change.replace(/.$/,'\"') : change;\n str1 = str1.replace(check1, change);\n }\n str = str.replace(str, str1);\n }\n else if (str.match(/(?:href='')/) === null) {\n if(str.match(hrefRegex)) {\n var check = str.match(hrefRegex);\n var str1 = str;\n for (var i=0; i < check.length; i++) {\n var check1 = str.match(hrefRegex)[i].split('href=')[1];\n if (check1) {\n var change = check1.match(/^'/) !== null ? check1.replace(/^'/, '\"') : check1;\n change =change.match(/.$/)[0] === '\\'' ? change.replace(/.$/,'\"') : change;\n str1 = str1.replace(check1, change);\n }\n }\n str = str.replace(str, str1);\n }\n }\n ";
|
|
70
|
-
var fnCode = 'var str
|
|
71
|
-
/* eslint-enable */
|
|
70
|
+
var fnCode = 'var str="' + evalExpResult + '";' + condtion + ' return str;';
|
|
72
71
|
var fn = new Function(argName, fnCode);
|
|
73
72
|
return fn.bind(helper);
|
|
74
73
|
}
|
|
@@ -112,9 +111,7 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
|
|
|
112
111
|
else {
|
|
113
112
|
str = str.replace(/\\?"/g, '\\"');
|
|
114
113
|
}
|
|
115
|
-
return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\'$1\'').replace(exp,
|
|
116
|
-
// eslint-disable-next-line
|
|
117
|
-
function (match, cnt, offset, matchStr) {
|
|
114
|
+
return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\'$1\'').replace(exp, function (match, cnt, offset, matchStr) {
|
|
118
115
|
var SPECIAL_CHAR = /@|#|\$/gm;
|
|
119
116
|
var matches = cnt.match(CALL_FUNCTION);
|
|
120
117
|
// matches to detect any function calls
|
|
@@ -137,12 +134,10 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
|
|
|
137
134
|
//handling for condition
|
|
138
135
|
var rlStr_1 = matches[1].split(' of ');
|
|
139
136
|
// replace for each into actual JavaScript
|
|
140
|
-
// eslint-disable-next-line
|
|
141
137
|
cnt = '"; ' + cnt.replace(matches[1], function (mtc) {
|
|
142
138
|
localKeys.push(rlStr_1[0]);
|
|
143
139
|
localKeys.push(rlStr_1[0] + 'Index');
|
|
144
140
|
varCOunt = varCOunt + 1;
|
|
145
|
-
// tslint:disable-next-line
|
|
146
141
|
return 'var i' + varCOunt + '=0; i' + varCOunt + ' < ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys, ignorePrefix) + '.length; i' + varCOunt + '++';
|
|
147
142
|
}) + '{ \n ' + rlStr_1[0] + '= ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys, ignorePrefix)
|
|
148
143
|
+ '[i' + varCOunt + ']; \n var ' + rlStr_1[0] + 'Index=i' + varCOunt + '; \n str = str + "';
|
|
@@ -150,8 +145,7 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
|
|
|
150
145
|
else {
|
|
151
146
|
//helper function handling
|
|
152
147
|
var fnStr = cnt.split('(');
|
|
153
|
-
|
|
154
|
-
var fNameSpace = (helper && helper.hasOwnProperty(fnStr[0]) ? 'this.' : 'global');
|
|
148
|
+
var fNameSpace = (helper && Object.prototype.hasOwnProperty.call(helper, fnStr[0]) ? 'this.' : 'global');
|
|
155
149
|
fNameSpace = (/\./.test(fnStr[0]) ? '' : fNameSpace);
|
|
156
150
|
var ftArray = matches[1].split(',');
|
|
157
151
|
if (matches[1].length !== 0 && !(/data/).test(ftArray[0]) && !(/window./).test(ftArray[0])) {
|
|
@@ -162,7 +156,6 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
|
|
|
162
156
|
if (WINDOWFUNC.test(cnt) && arrObj.test(cnt) || splRegexp.test(cnt)) {
|
|
163
157
|
var splArrRegexp = /@|\$|#|\]\./gm;
|
|
164
158
|
if (splArrRegexp.test(cnt)) {
|
|
165
|
-
// tslint:disable-next-line
|
|
166
159
|
cnt = '"+ ' + (fNameSpace === 'global' ? '' : fNameSpace) + cnt.replace(matches[1], rlStr.replace(WORDFUNC, function (strs) {
|
|
167
160
|
return HandleSpecialCharArrObj(strs, nameSpace, localKeys, ignorePrefix);
|
|
168
161
|
})) + '+ "';
|
|
@@ -178,9 +171,8 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
|
|
|
178
171
|
else if (ELSE_STMT.test(cnt)) {
|
|
179
172
|
// handling else condition
|
|
180
173
|
cnt = '"; ' + cnt.replace(ELSE_STMT, '} else { \n str = str + "');
|
|
181
|
-
// eslint-disable-next-line
|
|
182
174
|
}
|
|
183
|
-
else if (
|
|
175
|
+
else if (cnt.match(IF_OR_FOR)) {
|
|
184
176
|
// close condition
|
|
185
177
|
cnt = cnt.replace(IF_OR_FOR, '"; \n } \n str = str + "');
|
|
186
178
|
}
|
|
@@ -245,17 +237,20 @@ function NameSpaceArrObj(str, addNS, nameSpace, ignoreList) {
|
|
|
245
237
|
function NameSpaceForspecialChar(str, addNS, nameSpace, ignoreList) {
|
|
246
238
|
return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1) ? nameSpace + '["' + str : str);
|
|
247
239
|
}
|
|
248
|
-
|
|
240
|
+
/**
|
|
241
|
+
* Replace double slashes to single slash.
|
|
242
|
+
*
|
|
243
|
+
* @param {string} tempStr ?
|
|
244
|
+
* @returns {any} ?
|
|
245
|
+
*/
|
|
249
246
|
function SlashReplace(tempStr) {
|
|
250
247
|
var double = '\\\\';
|
|
251
248
|
if (tempStr.match(DOUBLE_SLASH)) {
|
|
252
|
-
|
|
253
|
-
tempStr = tempStr;
|
|
249
|
+
return tempStr;
|
|
254
250
|
}
|
|
255
251
|
else {
|
|
256
|
-
|
|
252
|
+
return tempStr.replace(SINGLE_SLASH, double);
|
|
257
253
|
}
|
|
258
|
-
return tempStr;
|
|
259
254
|
}
|
|
260
255
|
/**
|
|
261
256
|
*
|