@syncfusion/ej2-base 19.4.42 → 20.1.47

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 (43) hide show
  1. package/README.md +1 -1
  2. package/dist/ej2-base.umd.min.js +2 -2
  3. package/dist/ej2-base.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-base.es2015.js +206 -7
  5. package/dist/es6/ej2-base.es2015.js.map +1 -1
  6. package/dist/es6/ej2-base.es5.js +210 -7
  7. package/dist/es6/ej2-base.es5.js.map +1 -1
  8. package/dist/global/ej2-base.min.js +2 -2
  9. package/dist/global/ej2-base.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +52 -7
  12. package/src/component-model.d.ts +1 -1
  13. package/src/component.d.ts +1 -0
  14. package/src/component.js +2 -0
  15. package/src/draggable.js +3 -0
  16. package/src/index.d.ts +1 -0
  17. package/src/index.js +1 -0
  18. package/src/intl/intl-base.js +6 -4
  19. package/src/template-engine.js +2 -2
  20. package/src/util.d.ts +4 -0
  21. package/src/util.js +4 -0
  22. package/src/validate-lic.d.ts +7 -0
  23. package/src/validate-lic.js +194 -0
  24. package/styles/bootstrap-dark.css +17 -32
  25. package/styles/bootstrap.css +17 -32
  26. package/styles/bootstrap4.css +17 -32
  27. package/styles/bootstrap5-dark.css +17 -32
  28. package/styles/bootstrap5.css +17 -32
  29. package/styles/common/_core.scss +0 -32
  30. package/styles/definition/_fluent-dark.scss +2 -2
  31. package/styles/definition/_fluent.scss +1 -1
  32. package/styles/fabric-dark.css +17 -32
  33. package/styles/fabric.css +17 -32
  34. package/styles/fluent-dark.css +2177 -0
  35. package/styles/fluent-dark.scss +3 -0
  36. package/styles/fluent.css +2177 -0
  37. package/styles/fluent.scss +3 -0
  38. package/styles/highcontrast-light.css +17 -32
  39. package/styles/highcontrast.css +17 -32
  40. package/styles/material-dark.css +17 -32
  41. package/styles/material.css +17 -32
  42. package/styles/tailwind-dark.css +587 -614
  43. package/styles/tailwind.css +587 -614
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.4.42
3
+ * version : 20.1.47
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@18.44.0",
3
+ "_id": "@syncfusion/ej2-base@18.50.2",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-3pnl+euDLQ1d8wXDgfFymfITBxDdARstErc7iHxLoFCEC5ww7m/tAu5gU5yZ5w6o7KEy+i1MK0GcmYbiFkERYQ==",
5
+ "_integrity": "sha512-dM5GzGNob982ssCZQMmmD0HLByqVSeXEkRCinuf3LrKtoS9uoNXyLatmd4dE15ZNYGmUB4w/vo36J+Qys42U5A==",
6
6
  "_location": "/@syncfusion/ej2-base",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -19,24 +19,39 @@
19
19
  "_requiredBy": [
20
20
  "/",
21
21
  "/@syncfusion/ej2",
22
+ "/@syncfusion/ej2-angular-barcode-generator",
22
23
  "/@syncfusion/ej2-angular-base",
23
24
  "/@syncfusion/ej2-angular-buttons",
24
25
  "/@syncfusion/ej2-angular-calendars",
25
26
  "/@syncfusion/ej2-angular-charts",
27
+ "/@syncfusion/ej2-angular-circulargauge",
26
28
  "/@syncfusion/ej2-angular-diagrams",
27
29
  "/@syncfusion/ej2-angular-documenteditor",
28
30
  "/@syncfusion/ej2-angular-dropdowns",
29
31
  "/@syncfusion/ej2-angular-filemanager",
30
32
  "/@syncfusion/ej2-angular-gantt",
31
33
  "/@syncfusion/ej2-angular-grids",
34
+ "/@syncfusion/ej2-angular-heatmap",
35
+ "/@syncfusion/ej2-angular-inplace-editor",
32
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",
33
41
  "/@syncfusion/ej2-angular-maps",
42
+ "/@syncfusion/ej2-angular-navigations",
43
+ "/@syncfusion/ej2-angular-notifications",
34
44
  "/@syncfusion/ej2-angular-pdfviewer",
35
45
  "/@syncfusion/ej2-angular-pivotview",
46
+ "/@syncfusion/ej2-angular-popups",
47
+ "/@syncfusion/ej2-angular-progressbar",
36
48
  "/@syncfusion/ej2-angular-querybuilder",
49
+ "/@syncfusion/ej2-angular-richtexteditor",
37
50
  "/@syncfusion/ej2-angular-schedule",
51
+ "/@syncfusion/ej2-angular-splitbuttons",
38
52
  "/@syncfusion/ej2-angular-spreadsheet",
39
53
  "/@syncfusion/ej2-angular-treegrid",
54
+ "/@syncfusion/ej2-angular-treemap",
40
55
  "/@syncfusion/ej2-barcode-generator",
41
56
  "/@syncfusion/ej2-buttons",
42
57
  "/@syncfusion/ej2-calendars",
@@ -66,24 +81,39 @@
66
81
  "/@syncfusion/ej2-popups",
67
82
  "/@syncfusion/ej2-progressbar",
68
83
  "/@syncfusion/ej2-querybuilder",
84
+ "/@syncfusion/ej2-react-barcode-generator",
69
85
  "/@syncfusion/ej2-react-base",
70
86
  "/@syncfusion/ej2-react-buttons",
71
87
  "/@syncfusion/ej2-react-calendars",
72
88
  "/@syncfusion/ej2-react-charts",
89
+ "/@syncfusion/ej2-react-circulargauge",
73
90
  "/@syncfusion/ej2-react-diagrams",
74
91
  "/@syncfusion/ej2-react-documenteditor",
75
92
  "/@syncfusion/ej2-react-dropdowns",
76
93
  "/@syncfusion/ej2-react-filemanager",
77
94
  "/@syncfusion/ej2-react-gantt",
78
95
  "/@syncfusion/ej2-react-grids",
96
+ "/@syncfusion/ej2-react-heatmap",
97
+ "/@syncfusion/ej2-react-inplace-editor",
79
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",
80
103
  "/@syncfusion/ej2-react-maps",
104
+ "/@syncfusion/ej2-react-navigations",
105
+ "/@syncfusion/ej2-react-notifications",
81
106
  "/@syncfusion/ej2-react-pdfviewer",
82
107
  "/@syncfusion/ej2-react-pivotview",
108
+ "/@syncfusion/ej2-react-popups",
109
+ "/@syncfusion/ej2-react-progressbar",
83
110
  "/@syncfusion/ej2-react-querybuilder",
111
+ "/@syncfusion/ej2-react-richtexteditor",
84
112
  "/@syncfusion/ej2-react-schedule",
113
+ "/@syncfusion/ej2-react-splitbuttons",
85
114
  "/@syncfusion/ej2-react-spreadsheet",
86
115
  "/@syncfusion/ej2-react-treegrid",
116
+ "/@syncfusion/ej2-react-treemap",
87
117
  "/@syncfusion/ej2-richtexteditor",
88
118
  "/@syncfusion/ej2-schedule",
89
119
  "/@syncfusion/ej2-splitbuttons",
@@ -91,27 +121,42 @@
91
121
  "/@syncfusion/ej2-svg-base",
92
122
  "/@syncfusion/ej2-treegrid",
93
123
  "/@syncfusion/ej2-treemap",
124
+ "/@syncfusion/ej2-vue-barcode-generator",
94
125
  "/@syncfusion/ej2-vue-base",
95
126
  "/@syncfusion/ej2-vue-buttons",
96
127
  "/@syncfusion/ej2-vue-calendars",
97
128
  "/@syncfusion/ej2-vue-charts",
129
+ "/@syncfusion/ej2-vue-circulargauge",
98
130
  "/@syncfusion/ej2-vue-diagrams",
99
131
  "/@syncfusion/ej2-vue-documenteditor",
100
132
  "/@syncfusion/ej2-vue-dropdowns",
101
133
  "/@syncfusion/ej2-vue-filemanager",
102
134
  "/@syncfusion/ej2-vue-gantt",
103
135
  "/@syncfusion/ej2-vue-grids",
136
+ "/@syncfusion/ej2-vue-heatmap",
137
+ "/@syncfusion/ej2-vue-inplace-editor",
104
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",
105
143
  "/@syncfusion/ej2-vue-maps",
144
+ "/@syncfusion/ej2-vue-navigations",
145
+ "/@syncfusion/ej2-vue-notifications",
106
146
  "/@syncfusion/ej2-vue-pdfviewer",
107
147
  "/@syncfusion/ej2-vue-pivotview",
148
+ "/@syncfusion/ej2-vue-popups",
149
+ "/@syncfusion/ej2-vue-progressbar",
108
150
  "/@syncfusion/ej2-vue-querybuilder",
151
+ "/@syncfusion/ej2-vue-richtexteditor",
109
152
  "/@syncfusion/ej2-vue-schedule",
153
+ "/@syncfusion/ej2-vue-splitbuttons",
110
154
  "/@syncfusion/ej2-vue-spreadsheet",
111
- "/@syncfusion/ej2-vue-treegrid"
155
+ "/@syncfusion/ej2-vue-treegrid",
156
+ "/@syncfusion/ej2-vue-treemap"
112
157
  ],
113
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-base/-/ej2-base-18.44.0.tgz",
114
- "_shasum": "183dd0a95ceb7959d35c3774ad97d4aa917e8c59",
158
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-base/-/ej2-base-18.50.2.tgz",
159
+ "_shasum": "8d3e103cae88a81f8f325ff98d93dccfe180f453",
115
160
  "_spec": "@syncfusion/ej2-base@*",
116
161
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
117
162
  "author": {
@@ -122,7 +167,7 @@
122
167
  },
123
168
  "bundleDependencies": false,
124
169
  "dependencies": {
125
- "@syncfusion/ej2-icons": "~19.4.38"
170
+ "@syncfusion/ej2-icons": "~20.1.47"
126
171
  },
127
172
  "deprecated": false,
128
173
  "description": "A common package of Essential JS 2 base libraries, methods and class definitions",
@@ -163,6 +208,6 @@
163
208
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
164
209
  },
165
210
  "typings": "index.d.ts",
166
- "version": "19.4.42",
211
+ "version": "20.1.47",
167
212
  "sideEffects": true
168
213
  }
@@ -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
  /**
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,7 @@ 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
+ validateLicense();
73
75
  if (!isUndefined(selector)) {
74
76
  _this.appendTo();
75
77
  }
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';
@@ -33,7 +33,7 @@ export var IntlBase;
33
33
  (function (IntlBase) {
34
34
  // tslint:disable-next-line:max-line-length
35
35
  IntlBase.negativeDataRegex = /^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/;
36
- IntlBase.customRegex = /^(('[^']+'|''|[^*#@0,.])*)(\*.)?((([0#,]*[0,]*[0#]*)(\.[0#]*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/;
36
+ IntlBase.customRegex = /^(('[^']+'|''|[^*#@0,.])*)(\*.)?((([0#,]*[0,]*[0#]*[0#\ ]*)(\.[0#]*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/;
37
37
  IntlBase.latnParseRegex = /0|1|2|3|4|5|6|7|8|9/g;
38
38
  var fractionRegex = /[0-9]/g;
39
39
  IntlBase.defaultCurrency = '$';
@@ -887,7 +887,9 @@ export var IntlBase;
887
887
  cOptions.nlead = pattern[1];
888
888
  cOptions.nend = pattern[10];
889
889
  var integerPart = pattern[6];
890
- cOptions.useGrouping = integerPart.indexOf(',') !== -1;
890
+ var spaceCapture = integerPart.match(/\ $/g) ? true : false;
891
+ var spaceGrouping = integerPart.replace(/\ $/g, '').indexOf(' ') !== -1;
892
+ cOptions.useGrouping = integerPart.indexOf(',') !== -1 || spaceGrouping;
891
893
  integerPart = integerPart.replace(/,/g, '');
892
894
  var fractionPart = pattern[7];
893
895
  if (integerPart.indexOf('0') !== -1) {
@@ -916,11 +918,11 @@ export var IntlBase;
916
918
  var symbolPattern = getSymbolPattern(cOptions.type, dOptions.numberMapper.numberSystem, numObject, false);
917
919
  if (cOptions.useGrouping) {
918
920
  // eslint-disable-next-line
919
- cOptions.groupSeparator = dOptions.numberMapper.numberSymbols[mapper[2]];
921
+ cOptions.groupSeparator = spaceGrouping ? ' ' : dOptions.numberMapper.numberSymbols[mapper[2]];
920
922
  cOptions.groupData = NumberFormat.getGroupingDetails(symbolPattern.split(';')[0]);
921
923
  }
922
924
  cOptions.nlead = cOptions.nlead.replace(/'/g, '');
923
- cOptions.nend = cOptions.nend.replace(/'/g, '');
925
+ cOptions.nend = spaceCapture ? ' ' + cOptions.nend.replace(/'/g, '') : cOptions.nend.replace(/'/g, '');
924
926
  }
925
927
  return cOptions;
926
928
  }
@@ -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/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: Window;
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 = 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 && !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
+ };