@syncfusion/ej2-base 19.4.52 → 20.1.50

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +5 -10
  2. package/README.md +2 -2
  3. package/dist/ej2-base.umd.min.js +2 -2
  4. package/dist/ej2-base.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-base.es2015.js +210 -14
  6. package/dist/es6/ej2-base.es2015.js.map +1 -1
  7. package/dist/es6/ej2-base.es5.js +208 -10
  8. package/dist/es6/ej2-base.es5.js.map +1 -1
  9. package/dist/global/ej2-base.min.js +2 -2
  10. package/dist/global/ej2-base.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +7 -76
  13. package/src/component-model.d.ts +1 -1
  14. package/src/component.d.ts +1 -1
  15. package/src/component.js +4 -5
  16. package/src/draggable.js +3 -0
  17. package/src/index.d.ts +1 -0
  18. package/src/index.js +1 -0
  19. package/src/intl/intl-base.js +1 -1
  20. package/src/template-engine.js +2 -2
  21. package/src/template.js +1 -1
  22. package/src/util.d.ts +4 -0
  23. package/src/util.js +4 -0
  24. package/src/validate-lic.d.ts +7 -0
  25. package/src/validate-lic.js +194 -0
  26. package/styles/bootstrap-dark.css +17 -32
  27. package/styles/bootstrap.css +17 -32
  28. package/styles/bootstrap4.css +17 -32
  29. package/styles/bootstrap5-dark.css +17 -32
  30. package/styles/bootstrap5.css +17 -32
  31. package/styles/common/_core.scss +0 -32
  32. package/styles/definition/_fluent-dark.scss +2 -2
  33. package/styles/definition/_fluent.scss +1 -1
  34. package/styles/fabric-dark.css +17 -32
  35. package/styles/fabric.css +17 -32
  36. package/styles/fluent-dark.css +2177 -0
  37. package/styles/fluent-dark.scss +3 -0
  38. package/styles/fluent.css +2177 -0
  39. package/styles/fluent.scss +3 -0
  40. package/styles/highcontrast-light.css +17 -32
  41. package/styles/highcontrast.css +17 -32
  42. package/styles/material-dark.css +17 -32
  43. package/styles/material.css +17 -32
  44. package/styles/tailwind-dark.css +587 -614
  45. package/styles/tailwind.css +587 -614
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.4.52
3
+ * version : 20.1.50
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-base@*",
3
- "_id": "@syncfusion/ej2-base@19.4.48",
3
+ "_id": "@syncfusion/ej2-base@20.1.48",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-JeLsLtdfohTepI2YIJfTT9nMo6YkneoYWaqvZliO6C+kx790XeAZeFQnXTZuYaVTp24RKT8OUXntp5IhzzCwzA==",
5
+ "_integrity": "sha512-Az96rW1hYBnEdqkvnSOoNIgsQB0O9UTQvorD/zFKnfN8rEJahfC6bTOuLIXXW2NJ6WsBOu5mplat65p4iFTWWg==",
6
6
  "_location": "/@syncfusion/ej2-base",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -19,39 +19,16 @@
19
19
  "_requiredBy": [
20
20
  "/",
21
21
  "/@syncfusion/ej2",
22
- "/@syncfusion/ej2-angular-barcode-generator",
23
22
  "/@syncfusion/ej2-angular-base",
24
23
  "/@syncfusion/ej2-angular-buttons",
25
- "/@syncfusion/ej2-angular-calendars",
26
24
  "/@syncfusion/ej2-angular-charts",
27
- "/@syncfusion/ej2-angular-circulargauge",
28
- "/@syncfusion/ej2-angular-diagrams",
29
25
  "/@syncfusion/ej2-angular-documenteditor",
30
26
  "/@syncfusion/ej2-angular-dropdowns",
31
- "/@syncfusion/ej2-angular-filemanager",
32
27
  "/@syncfusion/ej2-angular-gantt",
33
- "/@syncfusion/ej2-angular-grids",
34
- "/@syncfusion/ej2-angular-heatmap",
35
- "/@syncfusion/ej2-angular-inplace-editor",
36
- "/@syncfusion/ej2-angular-inputs",
37
- "/@syncfusion/ej2-angular-kanban",
38
- "/@syncfusion/ej2-angular-layouts",
39
- "/@syncfusion/ej2-angular-lineargauge",
40
- "/@syncfusion/ej2-angular-lists",
41
- "/@syncfusion/ej2-angular-maps",
42
- "/@syncfusion/ej2-angular-navigations",
43
- "/@syncfusion/ej2-angular-notifications",
44
28
  "/@syncfusion/ej2-angular-pdfviewer",
45
- "/@syncfusion/ej2-angular-pivotview",
46
- "/@syncfusion/ej2-angular-popups",
47
- "/@syncfusion/ej2-angular-progressbar",
48
- "/@syncfusion/ej2-angular-querybuilder",
49
29
  "/@syncfusion/ej2-angular-richtexteditor",
50
30
  "/@syncfusion/ej2-angular-schedule",
51
- "/@syncfusion/ej2-angular-splitbuttons",
52
31
  "/@syncfusion/ej2-angular-spreadsheet",
53
- "/@syncfusion/ej2-angular-treegrid",
54
- "/@syncfusion/ej2-angular-treemap",
55
32
  "/@syncfusion/ej2-barcode-generator",
56
33
  "/@syncfusion/ej2-buttons",
57
34
  "/@syncfusion/ej2-calendars",
@@ -81,39 +58,16 @@
81
58
  "/@syncfusion/ej2-popups",
82
59
  "/@syncfusion/ej2-progressbar",
83
60
  "/@syncfusion/ej2-querybuilder",
84
- "/@syncfusion/ej2-react-barcode-generator",
85
61
  "/@syncfusion/ej2-react-base",
86
62
  "/@syncfusion/ej2-react-buttons",
87
- "/@syncfusion/ej2-react-calendars",
88
63
  "/@syncfusion/ej2-react-charts",
89
- "/@syncfusion/ej2-react-circulargauge",
90
- "/@syncfusion/ej2-react-diagrams",
91
64
  "/@syncfusion/ej2-react-documenteditor",
92
65
  "/@syncfusion/ej2-react-dropdowns",
93
- "/@syncfusion/ej2-react-filemanager",
94
66
  "/@syncfusion/ej2-react-gantt",
95
- "/@syncfusion/ej2-react-grids",
96
- "/@syncfusion/ej2-react-heatmap",
97
- "/@syncfusion/ej2-react-inplace-editor",
98
- "/@syncfusion/ej2-react-inputs",
99
- "/@syncfusion/ej2-react-kanban",
100
- "/@syncfusion/ej2-react-layouts",
101
- "/@syncfusion/ej2-react-lineargauge",
102
- "/@syncfusion/ej2-react-lists",
103
- "/@syncfusion/ej2-react-maps",
104
- "/@syncfusion/ej2-react-navigations",
105
- "/@syncfusion/ej2-react-notifications",
106
67
  "/@syncfusion/ej2-react-pdfviewer",
107
- "/@syncfusion/ej2-react-pivotview",
108
- "/@syncfusion/ej2-react-popups",
109
- "/@syncfusion/ej2-react-progressbar",
110
- "/@syncfusion/ej2-react-querybuilder",
111
68
  "/@syncfusion/ej2-react-richtexteditor",
112
69
  "/@syncfusion/ej2-react-schedule",
113
- "/@syncfusion/ej2-react-splitbuttons",
114
70
  "/@syncfusion/ej2-react-spreadsheet",
115
- "/@syncfusion/ej2-react-treegrid",
116
- "/@syncfusion/ej2-react-treemap",
117
71
  "/@syncfusion/ej2-richtexteditor",
118
72
  "/@syncfusion/ej2-schedule",
119
73
  "/@syncfusion/ej2-splitbuttons",
@@ -121,42 +75,19 @@
121
75
  "/@syncfusion/ej2-svg-base",
122
76
  "/@syncfusion/ej2-treegrid",
123
77
  "/@syncfusion/ej2-treemap",
124
- "/@syncfusion/ej2-vue-barcode-generator",
125
78
  "/@syncfusion/ej2-vue-base",
126
79
  "/@syncfusion/ej2-vue-buttons",
127
- "/@syncfusion/ej2-vue-calendars",
128
80
  "/@syncfusion/ej2-vue-charts",
129
- "/@syncfusion/ej2-vue-circulargauge",
130
- "/@syncfusion/ej2-vue-diagrams",
131
81
  "/@syncfusion/ej2-vue-documenteditor",
132
82
  "/@syncfusion/ej2-vue-dropdowns",
133
- "/@syncfusion/ej2-vue-filemanager",
134
83
  "/@syncfusion/ej2-vue-gantt",
135
- "/@syncfusion/ej2-vue-grids",
136
- "/@syncfusion/ej2-vue-heatmap",
137
- "/@syncfusion/ej2-vue-inplace-editor",
138
- "/@syncfusion/ej2-vue-inputs",
139
- "/@syncfusion/ej2-vue-kanban",
140
- "/@syncfusion/ej2-vue-layouts",
141
- "/@syncfusion/ej2-vue-lineargauge",
142
- "/@syncfusion/ej2-vue-lists",
143
- "/@syncfusion/ej2-vue-maps",
144
- "/@syncfusion/ej2-vue-navigations",
145
- "/@syncfusion/ej2-vue-notifications",
146
84
  "/@syncfusion/ej2-vue-pdfviewer",
147
- "/@syncfusion/ej2-vue-pivotview",
148
- "/@syncfusion/ej2-vue-popups",
149
- "/@syncfusion/ej2-vue-progressbar",
150
- "/@syncfusion/ej2-vue-querybuilder",
151
85
  "/@syncfusion/ej2-vue-richtexteditor",
152
86
  "/@syncfusion/ej2-vue-schedule",
153
- "/@syncfusion/ej2-vue-splitbuttons",
154
- "/@syncfusion/ej2-vue-spreadsheet",
155
- "/@syncfusion/ej2-vue-treegrid",
156
- "/@syncfusion/ej2-vue-treemap"
87
+ "/@syncfusion/ej2-vue-spreadsheet"
157
88
  ],
158
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-base/-/ej2-base-19.4.48.tgz",
159
- "_shasum": "fb9ac7685c8ad563c3251e56ec0c0e7394707e51",
89
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-base/-/ej2-base-20.1.48.tgz",
90
+ "_shasum": "2e4948f597e343b08be14209c2513bd24553b22c",
160
91
  "_spec": "@syncfusion/ej2-base@*",
161
92
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
162
93
  "author": {
@@ -167,7 +98,7 @@
167
98
  },
168
99
  "bundleDependencies": false,
169
100
  "dependencies": {
170
- "@syncfusion/ej2-icons": "~19.4.52"
101
+ "@syncfusion/ej2-icons": "~20.1.47"
171
102
  },
172
103
  "deprecated": false,
173
104
  "description": "A common package of Essential JS 2 base libraries, methods and class definitions",
@@ -208,6 +139,6 @@
208
139
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
209
140
  },
210
141
  "typings": "index.d.ts",
211
- "version": "19.4.52",
142
+ "version": "20.1.50",
212
143
  "sideEffects": true
213
144
  }
@@ -1,4 +1,4 @@
1
- import { isUndefined, getValue, isNullOrUndefined, setValue, uniqueID, isBlazor } 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 { createElement, addClass, removeClass, ElementProperties, select } from './dom';
1
+ import { isUndefined, getValue, isNullOrUndefined, setValue, uniqueID, isBlazor } 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 { createElement, addClass, removeClass, ElementProperties, select } from './dom';import {validateLicense} from './validate-lic';
2
2
 
3
3
  /**
4
4
  * Interface for a class Component
@@ -15,6 +15,7 @@ export declare function enableVersionBasedPersistence(status: boolean): void;
15
15
  */
16
16
  export declare abstract class Component<ElementType extends HTMLElement> extends Base<ElementType> {
17
17
  element: ElementType;
18
+ root: any;
18
19
  private randomId;
19
20
  ej2StatePersistenceVersion: string;
20
21
  /**
@@ -172,7 +173,6 @@ export declare abstract class Component<ElementType extends HTMLElement> extends
172
173
  private detectFunction;
173
174
  private mergePersistData;
174
175
  private setPersistData;
175
- protected appendReactElement(element: any, container: HTMLElement): void;
176
176
  protected renderReactTemplates(): void;
177
177
  protected clearTemplate(templateName?: string[], index?: any): void;
178
178
  private getUniqueID;
package/src/component.js CHANGED
@@ -25,6 +25,7 @@ import { ChildProperty } from './child-property';
25
25
  import { Property, NotifyPropertyChanges } from './notify-property-change';
26
26
  import { onIntlChange, rightToLeft, defaultCulture } from './internationalization';
27
27
  import { createElement, addClass, removeClass, select } from './dom';
28
+ import { validateLicense } from './validate-lic';
28
29
  var componentCount = 0;
29
30
  var lastPageID;
30
31
  var lastHistoryLen = 0;
@@ -70,6 +71,9 @@ var Component = /** @class */ (function (_super) {
70
71
  _this.localObserver = new Observer(_this);
71
72
  // tslint:disable-next-line:no-function-constructor-with-string-args
72
73
  onIntlChange.on('notifyExternalChange', _this.detectFunction, _this, _this.randomId);
74
+ if (typeof window !== "undefined" && typeof document !== "undefined") {
75
+ validateLicense();
76
+ }
73
77
  if (!isUndefined(selector)) {
74
78
  _this.appendTo();
75
79
  }
@@ -358,11 +362,6 @@ var Component = /** @class */ (function (_super) {
358
362
  }
359
363
  };
360
364
  //tslint:disable-next-line
361
- Component.prototype.appendReactElement = function (element, container) {
362
- //No Code
363
- };
364
- ;
365
- //tslint:disable-next-line
366
365
  Component.prototype.renderReactTemplates = function () {
367
366
  //No Code
368
367
  };
package/src/draggable.js CHANGED
@@ -369,6 +369,9 @@ var Draggable = /** @class */ (function (_super) {
369
369
  if (!isUndefined(evt.changedTouches) && (evt.changedTouches.length !== 1)) {
370
370
  return;
371
371
  }
372
+ if (this.clone && evt.changedTouches && Browser.isDevice && Browser.isTouch) {
373
+ evt.preventDefault();
374
+ }
372
375
  var left;
373
376
  var top;
374
377
  this.position = this.getMousePosition(evt, this.isDragScroll);
package/src/index.d.ts CHANGED
@@ -27,3 +27,4 @@ export * from './util';
27
27
  export * from './dom';
28
28
  export * from './observer';
29
29
  export * from './sanitize-helper';
30
+ export * from './validate-lic';
package/src/index.js CHANGED
@@ -23,3 +23,4 @@ export * from './util';
23
23
  export * from './dom';
24
24
  export * from './observer';
25
25
  export * from './sanitize-helper';
26
+ export * from './validate-lic';
@@ -890,7 +890,7 @@ export var IntlBase;
890
890
  var spaceCapture = integerPart.match(/\ $/g) ? true : false;
891
891
  var spaceGrouping = integerPart.replace(/\ $/g, '').indexOf(' ') !== -1;
892
892
  cOptions.useGrouping = integerPart.indexOf(',') !== -1 || spaceGrouping;
893
- integerPart = spaceGrouping ? integerPart.replace(/,/g, '') : integerPart.replace(/,/g, '').replace(/\ $/g, '');
893
+ integerPart = integerPart.replace(/,/g, '');
894
894
  var fractionPart = pattern[7];
895
895
  if (integerPart.indexOf('0') !== -1) {
896
896
  cOptions.minimumIntegerDigits = integerPart.length - integerPart.indexOf('0');
@@ -27,8 +27,8 @@ export function getRandomId() {
27
27
  export function compile(templateString, helper, ignorePrefix) {
28
28
  var compiler = engineObj.compile(templateString, helper, ignorePrefix);
29
29
  // eslint-disable-next-line
30
- return function (data, component, propName, templateId, isStringTemplate, index, element) {
31
- var result = compiler(data, component, propName, element);
30
+ return function (data, component, propName, templateId, isStringTemplate, index, element, root) {
31
+ var result = compiler(data, component, propName, element, root);
32
32
  var blazorTemplateId = 'BlazorTemplateId';
33
33
  if (isBlazor() && !isStringTemplate) {
34
34
  var randomId = getRandomId();
package/src/template.js CHANGED
@@ -61,7 +61,7 @@ export function expression(value) {
61
61
  export function compile(template, helper, ignorePrefix) {
62
62
  var argName = 'data';
63
63
  var evalExpResult = evalExp(template, argName, helper, ignorePrefix);
64
- 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)) && (str.match('svg') === null)){\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)) && (str.match('svg') === null)) {\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 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 }\n ";
64
+ 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 ";
65
65
  var fnCode = "var str=\"" + evalExpResult + "\";" + condtion + " return str;";
66
66
  var fn = new Function(argName, fnCode);
67
67
  return fn.bind(helper);
package/src/util.d.ts CHANGED
@@ -56,6 +56,10 @@ export declare function setValue(nameSpace: string, value: any, obj: any): any;
56
56
  * @private
57
57
  */
58
58
  export declare function deleteObject(obj: any, key: string): void;
59
+ /**
60
+ *@private
61
+ */
62
+ export declare const containerObject: any;
59
63
  /**
60
64
  * Check weather the given argument is only object.
61
65
  *
package/src/util.js CHANGED
@@ -113,6 +113,10 @@ export function setValue(nameSpace, value, obj) {
113
113
  export function deleteObject(obj, key) {
114
114
  delete obj[key];
115
115
  }
116
+ /**
117
+ *@private
118
+ */
119
+ export var containerObject = typeof window !== "undefined" ? window : {};
116
120
  /**
117
121
  * Check weather the given argument is only object.
118
122
  *
@@ -0,0 +1,7 @@
1
+ /**
2
+ * To set license key.
3
+ * @param {string} key - license key
4
+ */
5
+ export declare function registerLicense(key: string): void;
6
+ export declare const validateLicense: Function;
7
+ export declare const getVersion: Function;
@@ -0,0 +1,194 @@
1
+ import { createElement } from './dom';
2
+ import { getValue, containerObject, setValue, isNullOrUndefined } from './util';
3
+ var bypassKey = [115, 121, 110, 99, 102, 117, 115, 105,
4
+ 111, 110, 46, 105, 115, 76, 105, 99, 86, 97, 108,
5
+ 105, 100, 97, 116, 101, 100];
6
+ /**
7
+ * License validation module
8
+ * @private
9
+ */
10
+ var LicenseValidator = /** @class */ (function () {
11
+ function LicenseValidator(key) {
12
+ this.isValidated = false;
13
+ this.version = '20.1';
14
+ this.platform = /JavaScript|ASPNET|ASPNETCORE|ASPNETMVC|FileFormats/i;
15
+ this.errors = {
16
+ noLicense: 'This application was built using a trial version of Syncfusion Essential Studio.' +
17
+ ' Please include a valid license to permanently remove this license validation message.' +
18
+ ' You can also obtain a free 30 day evaluation license to temporarily remove this message ' +
19
+ 'during the evaluation period. Please refer to this <a style="color:yellow;text-decoration:none;"' +
20
+ 'href="https://help.syncfusion.com/common/essential-studio/licensing">help topic</a> for more information.',
21
+ trailExpired: 'Your Syncfusion trial license has expired. Please refer to this ' +
22
+ '<a style="color:yellow;text-decoration:none;"' +
23
+ 'href="https://help.syncfusion.com/common/essential-studio/licensing/licensing-errors#trial-expired">help topic</a> for more information.',
24
+ versionMismatched: 'The included Syncfusion license (v##LicenseVersion) is invalid for version ' +
25
+ '##Requireversion. Please refer to this <a style="color:yellow;text-decoration:none;" ' +
26
+ 'href="https://help.syncfusion.com/es/licensing/version-mismatch/">help topic</a> for more information.',
27
+ platformMismatched: 'The included Syncfusion license is invalid (Platform mismatch). Please refer' +
28
+ ' to this <a style="color:yellow;text-decoration:none;" ' +
29
+ 'href="https://help.syncfusion.com/common/essential-studio/licensing/licensing-errors#platform-mismatch">help topic</a> for more information.',
30
+ invalidKey: 'The included Syncfusion license is invalid. Please refer to this ' +
31
+ '<a style="color:yellow;text-decoration:none;" ' +
32
+ 'href="https://help.syncfusion.com/common/essential-studio/licensing/licensing-errors#invalid-key">help topic</a> for more information.'
33
+ };
34
+ /**
35
+ * To manage licensing operation.
36
+ */
37
+ this.manager = (function () {
38
+ var licKey = null;
39
+ function set(key) { licKey = key; }
40
+ function get() { return licKey; }
41
+ return {
42
+ setKey: set,
43
+ getKey: get
44
+ };
45
+ })();
46
+ this.manager.setKey(key);
47
+ }
48
+ /**
49
+ * To validate the provided license key.
50
+ */
51
+ LicenseValidator.prototype.validate = function () {
52
+ if (!this.isValidated && (containerObject && !getValue(convertToChar(bypassKey), containerObject) && !getValue('Blazor', containerObject))) {
53
+ var validateMsg = void 0;
54
+ if (this.manager && this.manager.getKey()) {
55
+ var result = this.getInfoFromKey();
56
+ if (result && result.length) {
57
+ for (var _i = 0, result_1 = result; _i < result_1.length; _i++) {
58
+ var res = result_1[_i];
59
+ if (!this.platform.test(res.platform) || res.invalidPlatform) {
60
+ validateMsg = this.errors.platformMismatched;
61
+ }
62
+ else if (res.version.indexOf(this.version) === -1) {
63
+ validateMsg = this.errors.versionMismatched;
64
+ validateMsg = validateMsg.replace('##LicenseVersion', res.version);
65
+ validateMsg = validateMsg.replace('##Requireversion', this.version + '.x');
66
+ }
67
+ else if (res.expiryDate) {
68
+ var expDate = new Date(res.expiryDate);
69
+ var currDate = new Date();
70
+ if (expDate !== currDate && expDate < currDate) {
71
+ validateMsg = this.errors.trailExpired;
72
+ }
73
+ else {
74
+ break;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ else {
80
+ validateMsg = this.errors.invalidKey;
81
+ }
82
+ }
83
+ else {
84
+ validateMsg = this.errors.noLicense;
85
+ }
86
+ if (validateMsg && typeof document !== "undefined" && !isNullOrUndefined(document)) {
87
+ var errorDiv = createElement('div', {
88
+ innerHTML: validateMsg +
89
+ '<span style="position:absolute;right: 10px;top:27%;cursor:pointer;"' +
90
+ 'onClick=this.parentElement.remove();>' +
91
+ '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">' +
92
+ '<line x1="5" y1="5" x2="15" y2="15" stroke="yellow" stroke-width="2.5" ' +
93
+ 'stroke-miterlimit="10" stroke-linecap="round"></line><line x1="15" y1="5" ' +
94
+ 'x2="5" y2="15" stroke="yellow" stroke-width="2.5" stroke-linecap="round" ' +
95
+ 'stroke-miterlimit="10"></line></svg></span>',
96
+ styles: 'position:fixed;top:0;left:0;right:0;font-family:"Segoe UI";font-size:16px;' +
97
+ 'background:repeating-linear-gradient(45deg,#d70f0f,#d70f0f 10px,#e12121 10px,#e12121 17px);' +
98
+ 'color:#ffffff;z-index:999999999;text-align:center;padding:10px 50px 10px 25px;'
99
+ });
100
+ errorDiv.setAttribute('id', 'js-licensing');
101
+ document.body.appendChild(errorDiv);
102
+ }
103
+ this.isValidated = true;
104
+ setValue(convertToChar(bypassKey), this.isValidated, containerObject);
105
+ }
106
+ };
107
+ LicenseValidator.prototype.getDecryptedData = function (key) {
108
+ try {
109
+ return atob(key);
110
+ }
111
+ catch (error) {
112
+ return '';
113
+ }
114
+ };
115
+ /**
116
+ * Get license information from key.
117
+ */
118
+ LicenseValidator.prototype.getInfoFromKey = function () {
119
+ try {
120
+ var licKey = this.manager.getKey();
121
+ var licKeySplit = licKey.split(';');
122
+ var pkey = [5439488, 7929856, 5111808, 6488064, 4587520, 7667712, 5439488,
123
+ 6881280, 5177344, 7208960, 4194304, 4456448, 6619136, 7733248, 5242880, 7077888,
124
+ 6356992, 7602176, 4587520, 7274496, 7471104, 7143424];
125
+ var decryptedStr = [];
126
+ var resultArray = [];
127
+ var invalidPlatform = false;
128
+ for (var _i = 0, licKeySplit_1 = licKeySplit; _i < licKeySplit_1.length; _i++) {
129
+ var lKey = licKeySplit_1[_i];
130
+ var decodeStr = this.getDecryptedData(lKey);
131
+ if (!decodeStr) {
132
+ continue;
133
+ }
134
+ var k = 0;
135
+ var buffr = '';
136
+ for (var i = 0; i < decodeStr.length; i++, k++) {
137
+ if (k === pkey.length) {
138
+ k = 0;
139
+ }
140
+ var c = decodeStr.charCodeAt(i);
141
+ buffr += String.fromCharCode(c ^ (pkey[k] >> 16));
142
+ }
143
+ if (this.platform.test(buffr)) {
144
+ decryptedStr = buffr.split(';');
145
+ invalidPlatform = false;
146
+ // checked the length to verify the key in proper strucutre
147
+ if (decryptedStr.length > 3) {
148
+ resultArray.push({ platform: decryptedStr[0],
149
+ version: decryptedStr[1],
150
+ expiryDate: decryptedStr[2] });
151
+ }
152
+ }
153
+ else if (buffr && buffr.split(';').length > 3) {
154
+ invalidPlatform = true;
155
+ }
156
+ }
157
+ if (invalidPlatform && !resultArray.length) {
158
+ return [{ invalidPlatform: invalidPlatform }];
159
+ }
160
+ else {
161
+ return resultArray.length ? resultArray : null;
162
+ }
163
+ }
164
+ catch (error) {
165
+ return null;
166
+ }
167
+ };
168
+ return LicenseValidator;
169
+ }());
170
+ var licenseValidator = new LicenseValidator();
171
+ function convertToChar(cArr) {
172
+ var ret = '';
173
+ for (var _i = 0, cArr_1 = cArr; _i < cArr_1.length; _i++) {
174
+ var arr = cArr_1[_i];
175
+ ret += String.fromCharCode(arr);
176
+ }
177
+ return ret;
178
+ }
179
+ /**
180
+ * To set license key.
181
+ * @param {string} key - license key
182
+ */
183
+ export function registerLicense(key) {
184
+ licenseValidator = new LicenseValidator(key);
185
+ }
186
+ export var validateLicense = function (key) {
187
+ if (key) {
188
+ registerLicense(key);
189
+ }
190
+ licenseValidator.validate();
191
+ };
192
+ export var getVersion = function () {
193
+ return licenseValidator.version;
194
+ };