@syncfusion/ej2-base 21.2.3 → 22.1.34

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 (59) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +24 -0
  3. package/bin/syncfusion-license.js +1 -1
  4. package/dist/ej2-base.min.js +2 -2
  5. package/dist/ej2-base.umd.min.js +2 -2
  6. package/dist/ej2-base.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-base.es2015.js +205 -58
  8. package/dist/es6/ej2-base.es2015.js.map +1 -1
  9. package/dist/es6/ej2-base.es5.js +186 -36
  10. package/dist/es6/ej2-base.es5.js.map +1 -1
  11. package/dist/global/ej2-base.min.js +2 -2
  12. package/dist/global/ej2-base.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +94 -7
  15. package/src/browser.js +1 -1
  16. package/src/draggable.js +3 -0
  17. package/src/fetch.d.ts +114 -0
  18. package/src/fetch.js +116 -0
  19. package/src/index.d.ts +1 -0
  20. package/src/index.js +1 -0
  21. package/src/intl/number-formatter.js +12 -5
  22. package/src/intl/parser-base.js +16 -16
  23. package/src/template-engine.d.ts +12 -3
  24. package/src/template-engine.js +21 -1
  25. package/src/template.d.ts +2 -2
  26. package/src/template.js +14 -9
  27. package/src/validate-lic.js +3 -3
  28. package/styles/_highcontrast-definition.scss +1 -1
  29. package/styles/_highcontrast-light-definition.scss +1 -1
  30. package/styles/_material3-dark-definition.scss +15 -0
  31. package/styles/_material3-definition.scss +16 -0
  32. package/styles/animation/_all.scss +64 -5
  33. package/styles/bootstrap-dark.css +59 -2
  34. package/styles/bootstrap.css +59 -2
  35. package/styles/bootstrap4.css +59 -2
  36. package/styles/bootstrap5-dark.css +59 -2
  37. package/styles/bootstrap5.css +59 -2
  38. package/styles/common/_core.scss +24 -4
  39. package/styles/definition/_material.scss +0 -3
  40. package/styles/definition/_material3-dark.scss +701 -0
  41. package/styles/definition/_material3.scss +782 -0
  42. package/styles/fabric-dark.css +59 -2
  43. package/styles/fabric.css +59 -2
  44. package/styles/fluent-dark.css +59 -2
  45. package/styles/fluent.css +59 -2
  46. package/styles/highcontrast-light.css +60 -3
  47. package/styles/highcontrast.css +60 -3
  48. package/styles/material-dark.css +59 -2
  49. package/styles/material.css +59 -2
  50. package/styles/material3-dark.css +2020 -0
  51. package/styles/material3-dark.scss +3 -0
  52. package/styles/material3.css +2076 -0
  53. package/styles/material3.scss +3 -0
  54. package/styles/offline-theme/material-dark.css +59 -2
  55. package/styles/offline-theme/material.css +59 -2
  56. package/styles/offline-theme/tailwind-dark.css +59 -2
  57. package/styles/offline-theme/tailwind.css +59 -2
  58. package/styles/tailwind-dark.css +59 -2
  59. package/styles/tailwind.css +59 -2
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.2.3
3
+ * version : 22.1.34
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@21.1.39",
3
+ "_id": "@syncfusion/ej2-base@18.86.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-FTK0S0QGfGHBggjRr43m6VvV5YD4gsLKa+bLZFu3lrDeWpqwt9p9Z2vZwkfEBPWPsRsTjWLah2O2nuAIVwZCXg==",
5
+ "_integrity": "sha512-py1u8z6+CRIWrM8Z7XbLfQKjzPnlvYrGRb2bQLi1DGEOh/63W22CT8+iizCQK4azEvvlsbSwwpYY4X65EbFYTQ==",
6
6
  "_location": "/@syncfusion/ej2-base",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -22,9 +22,38 @@
22
22
  "/@syncfusion/ej2-angular-barcode-generator",
23
23
  "/@syncfusion/ej2-angular-base",
24
24
  "/@syncfusion/ej2-angular-buttons",
25
+ "/@syncfusion/ej2-angular-calendars",
26
+ "/@syncfusion/ej2-angular-charts",
25
27
  "/@syncfusion/ej2-angular-circulargauge",
28
+ "/@syncfusion/ej2-angular-diagrams",
29
+ "/@syncfusion/ej2-angular-documenteditor",
30
+ "/@syncfusion/ej2-angular-dropdowns",
31
+ "/@syncfusion/ej2-angular-filemanager",
32
+ "/@syncfusion/ej2-angular-gantt",
33
+ "/@syncfusion/ej2-angular-grids",
34
+ "/@syncfusion/ej2-angular-heatmap",
35
+ "/@syncfusion/ej2-angular-image-editor",
36
+ "/@syncfusion/ej2-angular-inplace-editor",
37
+ "/@syncfusion/ej2-angular-inputs",
38
+ "/@syncfusion/ej2-angular-kanban",
39
+ "/@syncfusion/ej2-angular-layouts",
40
+ "/@syncfusion/ej2-angular-lineargauge",
26
41
  "/@syncfusion/ej2-angular-lists",
42
+ "/@syncfusion/ej2-angular-maps",
43
+ "/@syncfusion/ej2-angular-navigations",
44
+ "/@syncfusion/ej2-angular-notifications",
45
+ "/@syncfusion/ej2-angular-pdfviewer",
46
+ "/@syncfusion/ej2-angular-pivotview",
27
47
  "/@syncfusion/ej2-angular-popups",
48
+ "/@syncfusion/ej2-angular-progressbar",
49
+ "/@syncfusion/ej2-angular-querybuilder",
50
+ "/@syncfusion/ej2-angular-ribbon",
51
+ "/@syncfusion/ej2-angular-richtexteditor",
52
+ "/@syncfusion/ej2-angular-schedule",
53
+ "/@syncfusion/ej2-angular-splitbuttons",
54
+ "/@syncfusion/ej2-angular-spreadsheet",
55
+ "/@syncfusion/ej2-angular-treegrid",
56
+ "/@syncfusion/ej2-angular-treemap",
28
57
  "/@syncfusion/ej2-barcode-generator",
29
58
  "/@syncfusion/ej2-buttons",
30
59
  "/@syncfusion/ej2-calendars",
@@ -58,9 +87,38 @@
58
87
  "/@syncfusion/ej2-react-barcode-generator",
59
88
  "/@syncfusion/ej2-react-base",
60
89
  "/@syncfusion/ej2-react-buttons",
90
+ "/@syncfusion/ej2-react-calendars",
91
+ "/@syncfusion/ej2-react-charts",
61
92
  "/@syncfusion/ej2-react-circulargauge",
93
+ "/@syncfusion/ej2-react-diagrams",
94
+ "/@syncfusion/ej2-react-documenteditor",
95
+ "/@syncfusion/ej2-react-dropdowns",
96
+ "/@syncfusion/ej2-react-filemanager",
97
+ "/@syncfusion/ej2-react-gantt",
98
+ "/@syncfusion/ej2-react-grids",
99
+ "/@syncfusion/ej2-react-heatmap",
100
+ "/@syncfusion/ej2-react-image-editor",
101
+ "/@syncfusion/ej2-react-inplace-editor",
102
+ "/@syncfusion/ej2-react-inputs",
103
+ "/@syncfusion/ej2-react-kanban",
104
+ "/@syncfusion/ej2-react-layouts",
105
+ "/@syncfusion/ej2-react-lineargauge",
62
106
  "/@syncfusion/ej2-react-lists",
107
+ "/@syncfusion/ej2-react-maps",
108
+ "/@syncfusion/ej2-react-navigations",
109
+ "/@syncfusion/ej2-react-notifications",
110
+ "/@syncfusion/ej2-react-pdfviewer",
111
+ "/@syncfusion/ej2-react-pivotview",
63
112
  "/@syncfusion/ej2-react-popups",
113
+ "/@syncfusion/ej2-react-progressbar",
114
+ "/@syncfusion/ej2-react-querybuilder",
115
+ "/@syncfusion/ej2-react-ribbon",
116
+ "/@syncfusion/ej2-react-richtexteditor",
117
+ "/@syncfusion/ej2-react-schedule",
118
+ "/@syncfusion/ej2-react-splitbuttons",
119
+ "/@syncfusion/ej2-react-spreadsheet",
120
+ "/@syncfusion/ej2-react-treegrid",
121
+ "/@syncfusion/ej2-react-treemap",
64
122
  "/@syncfusion/ej2-ribbon",
65
123
  "/@syncfusion/ej2-richtexteditor",
66
124
  "/@syncfusion/ej2-schedule",
@@ -72,12 +130,41 @@
72
130
  "/@syncfusion/ej2-vue-barcode-generator",
73
131
  "/@syncfusion/ej2-vue-base",
74
132
  "/@syncfusion/ej2-vue-buttons",
133
+ "/@syncfusion/ej2-vue-calendars",
134
+ "/@syncfusion/ej2-vue-charts",
75
135
  "/@syncfusion/ej2-vue-circulargauge",
136
+ "/@syncfusion/ej2-vue-diagrams",
137
+ "/@syncfusion/ej2-vue-documenteditor",
138
+ "/@syncfusion/ej2-vue-dropdowns",
139
+ "/@syncfusion/ej2-vue-filemanager",
140
+ "/@syncfusion/ej2-vue-gantt",
141
+ "/@syncfusion/ej2-vue-grids",
142
+ "/@syncfusion/ej2-vue-heatmap",
143
+ "/@syncfusion/ej2-vue-image-editor",
144
+ "/@syncfusion/ej2-vue-inplace-editor",
145
+ "/@syncfusion/ej2-vue-inputs",
146
+ "/@syncfusion/ej2-vue-kanban",
147
+ "/@syncfusion/ej2-vue-layouts",
148
+ "/@syncfusion/ej2-vue-lineargauge",
76
149
  "/@syncfusion/ej2-vue-lists",
77
- "/@syncfusion/ej2-vue-popups"
150
+ "/@syncfusion/ej2-vue-maps",
151
+ "/@syncfusion/ej2-vue-navigations",
152
+ "/@syncfusion/ej2-vue-notifications",
153
+ "/@syncfusion/ej2-vue-pdfviewer",
154
+ "/@syncfusion/ej2-vue-pivotview",
155
+ "/@syncfusion/ej2-vue-popups",
156
+ "/@syncfusion/ej2-vue-progressbar",
157
+ "/@syncfusion/ej2-vue-querybuilder",
158
+ "/@syncfusion/ej2-vue-ribbon",
159
+ "/@syncfusion/ej2-vue-richtexteditor",
160
+ "/@syncfusion/ej2-vue-schedule",
161
+ "/@syncfusion/ej2-vue-splitbuttons",
162
+ "/@syncfusion/ej2-vue-spreadsheet",
163
+ "/@syncfusion/ej2-vue-treegrid",
164
+ "/@syncfusion/ej2-vue-treemap"
78
165
  ],
79
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-base/-/ej2-base-21.1.39.tgz",
80
- "_shasum": "27c564490dd7783542a34e2d0df4a7da922b2f03",
166
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-base/-/ej2-base-18.86.0.tgz",
167
+ "_shasum": "640ad9caeb3bc6de349ee3d714ab2301f6460df7",
81
168
  "_spec": "@syncfusion/ej2-base@*",
82
169
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
83
170
  "author": {
@@ -91,7 +178,7 @@
91
178
  },
92
179
  "bundleDependencies": false,
93
180
  "dependencies": {
94
- "@syncfusion/ej2-icons": "~21.2.3"
181
+ "@syncfusion/ej2-icons": "~22.1.34"
95
182
  },
96
183
  "deprecated": false,
97
184
  "description": "A common package of Essential JS 2 base libraries, methods and class definitions",
@@ -132,6 +219,6 @@
132
219
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
133
220
  },
134
221
  "typings": "index.d.ts",
135
- "version": "21.2.3",
222
+ "version": "22.1.34",
136
223
  "sideEffects": true
137
224
  }
package/src/browser.js CHANGED
@@ -132,7 +132,7 @@ var Browser = /** @class */ (function () {
132
132
  */
133
133
  Browser.getValue = function (key, regX) {
134
134
  var browserDetails = typeof window !== 'undefined' ? window.browserDetails : {};
135
- if (typeof navigator !== 'undefined' && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 && Browser.isTouch === true) {
135
+ if (typeof navigator !== 'undefined' && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 && Browser.isTouch === true && !REGX_BROWSER.CHROME.test(navigator.userAgent)) {
136
136
  browserDetails['isIos'] = true;
137
137
  browserDetails['isDevice'] = true;
138
138
  browserDetails['isTouch'] = true;
package/src/draggable.js CHANGED
@@ -422,6 +422,9 @@ var Draggable = /** @class */ (function (_super) {
422
422
  var dTop = this.position.top - this.diffY;
423
423
  var styles = getComputedStyle(helperElement);
424
424
  if (this.dragArea) {
425
+ if (this.enableAutoScroll) {
426
+ this.setDragArea();
427
+ }
425
428
  if (this.pageX !== pagex || this.skipDistanceCheck) {
426
429
  var helperWidth = helperElement.offsetWidth + (parseFloat(styles.marginLeft)
427
430
  + parseFloat(styles.marginRight));
package/src/fetch.d.ts ADDED
@@ -0,0 +1,114 @@
1
+ /**
2
+ * The Fetch class provides a way to make asynchronous network requests, typically to retrieve resources from a server.
3
+ * ```typescript
4
+ * var fetchApi = new Fetch('index.html', 'GET');
5
+ * fetchApi.send()
6
+ * .then((value) => {
7
+ * console.log(value);
8
+ * }).catch((error) => {
9
+ * console.log(error);
10
+ * });
11
+ * ```
12
+ */
13
+ export declare class Fetch {
14
+ /**
15
+ * Specifies the URL to which the request is to be sent.
16
+ *
17
+ * @default null
18
+ */
19
+ url: string;
20
+ /**
21
+ * Specifies which request method is to be used, such as GET, POST, etc.
22
+ *
23
+ * @default GET
24
+ */
25
+ type: string;
26
+ /**
27
+ * Specifies the content type of the request, which is used to indicate the original media type of the resource.
28
+ *
29
+ * @default null
30
+ */
31
+ contentType: string;
32
+ /**
33
+ * Specifies the data that needs to be added to the request.
34
+ *
35
+ * @default null
36
+ */
37
+ data: string | Object;
38
+ /**
39
+ * A boolean value indicating whether to reject the promise or not.
40
+ *
41
+ * @private
42
+ * @default true
43
+ */
44
+ emitError: boolean;
45
+ /**
46
+ * Specifies the request object that represents a resource request.
47
+ *
48
+ * @default null
49
+ */
50
+ fetchRequest: Request;
51
+ /**
52
+ * Represents a response to a request.
53
+ *
54
+ * @private
55
+ * @default null
56
+ */
57
+ private fetchResponse;
58
+ /**
59
+ * Specifies the callback function to be triggered before sending the request to the server.
60
+ * This can be used to modify the fetchRequest object before it is sent.
61
+ *
62
+ * @event beforeSend
63
+ */
64
+ beforeSend: Function;
65
+ /**
66
+ * Specifies the callback function to be triggered after the response is received.
67
+ * This callback will be triggered even if the request is failed.
68
+ *
69
+ * @event onLoad
70
+ */
71
+ onLoad: Function;
72
+ /**
73
+ * Specifies the callback function to be triggered after the request is successful.
74
+ * The callback will contain the server response as a parameter.
75
+ *
76
+ * @event onSuccess
77
+ */
78
+ onSuccess: Function;
79
+ /**
80
+ * Specifies the callback function to be triggered after the request is failed.
81
+ *
82
+ * @event onFailure
83
+ */
84
+ onFailure: Function;
85
+ /**
86
+ * Constructor for Fetch class.
87
+ *
88
+ * @param {string|Object} options - Specifies the URL or Request object with URL to which the request is to be sent.
89
+ * @param {string} type - Specifies which request method is to be used, such as GET, POST, etc.
90
+ * @param {string} contentType - Specifies the content type of the request, which is used to indicate the original media type of the resource.
91
+ */
92
+ constructor(options?: string | Object, type?: string, contentType?: string);
93
+ /**
94
+ * Send the request to server.
95
+ *
96
+ * @param {string|Object} data - Specifies the data that needs to be added to the request.
97
+ * @returns {Promise<Response>} - Returns the response to a request.
98
+ */
99
+ send(data?: string | Object): Promise<Response>;
100
+ private triggerEvent;
101
+ }
102
+ /**
103
+ * Provides information about the beforeSend event.
104
+ */
105
+ export interface BeforeSendFetchEventArgs {
106
+ /**
107
+ * A boolean value indicating whether to cancel the fetch request or not.
108
+ */
109
+ cancel?: boolean;
110
+ /**
111
+ * Returns the request object that represents a resource request.
112
+ */
113
+ fetchRequest: Request;
114
+ }
package/src/fetch.js ADDED
@@ -0,0 +1,116 @@
1
+ import { isNullOrUndefined as isNOU, isObject, merge } from './util';
2
+ /**
3
+ * The Fetch class provides a way to make asynchronous network requests, typically to retrieve resources from a server.
4
+ * ```typescript
5
+ * var fetchApi = new Fetch('index.html', 'GET');
6
+ * fetchApi.send()
7
+ * .then((value) => {
8
+ * console.log(value);
9
+ * }).catch((error) => {
10
+ * console.log(error);
11
+ * });
12
+ * ```
13
+ */
14
+ var Fetch = /** @class */ (function () {
15
+ /**
16
+ * Constructor for Fetch class.
17
+ *
18
+ * @param {string|Object} options - Specifies the URL or Request object with URL to which the request is to be sent.
19
+ * @param {string} type - Specifies which request method is to be used, such as GET, POST, etc.
20
+ * @param {string} contentType - Specifies the content type of the request, which is used to indicate the original media type of the resource.
21
+ */
22
+ function Fetch(options, type, contentType) {
23
+ /**
24
+ * Specifies which request method is to be used, such as GET, POST, etc.
25
+ *
26
+ * @default GET
27
+ */
28
+ this.type = 'GET';
29
+ /**
30
+ * A boolean value indicating whether to reject the promise or not.
31
+ *
32
+ * @private
33
+ * @default true
34
+ */
35
+ this.emitError = true;
36
+ if (typeof options === 'string') {
37
+ this.url = options;
38
+ this.type = !isNOU(type) ? type.toUpperCase() : this.type;
39
+ this.contentType = contentType;
40
+ }
41
+ else if (isObject(options) && Object.keys(options).length > 0) {
42
+ merge(this, options);
43
+ }
44
+ this.contentType = !isNOU(this.contentType) ? this.contentType : 'application/json; charset=utf-8';
45
+ }
46
+ /**
47
+ * Send the request to server.
48
+ *
49
+ * @param {string|Object} data - Specifies the data that needs to be added to the request.
50
+ * @returns {Promise<Response>} - Returns the response to a request.
51
+ */
52
+ Fetch.prototype.send = function (data) {
53
+ var _this = this;
54
+ var contentTypes = {
55
+ 'application/json': 'json',
56
+ 'multipart/form-data': 'formData',
57
+ 'application/octet-stream': 'blob',
58
+ 'application/x-www-form-urlencoded': 'formData'
59
+ };
60
+ try {
61
+ if (isNOU(this.fetchRequest) && this.type === 'GET') {
62
+ this.fetchRequest = new Request(this.url, { method: this.type });
63
+ }
64
+ else if (isNOU(this.fetchRequest)) {
65
+ this.data = !isNOU(data) ? data : this.data;
66
+ this.fetchRequest = new Request(this.url, {
67
+ method: this.type,
68
+ headers: { 'Content-Type': this.contentType },
69
+ body: this.data
70
+ });
71
+ }
72
+ var eventArgs = { cancel: false, fetchRequest: this.fetchRequest };
73
+ this.triggerEvent(this['beforeSend'], eventArgs);
74
+ if (eventArgs.cancel) {
75
+ return null;
76
+ }
77
+ this.fetchResponse = fetch(this.fetchRequest);
78
+ return this.fetchResponse.then(function (response) {
79
+ _this.triggerEvent(_this['onLoad'], response);
80
+ if (!response.ok) {
81
+ throw new Error(response.statusText);
82
+ }
83
+ var responseType = 'text';
84
+ for (var _i = 0, _a = Object.keys(contentTypes); _i < _a.length; _i++) {
85
+ var key = _a[_i];
86
+ if (response.headers.get('Content-Type').indexOf(key) !== -1) {
87
+ responseType = contentTypes[key];
88
+ }
89
+ }
90
+ return response[responseType]();
91
+ // eslint-disable-next-line
92
+ }).then(function (data) {
93
+ _this.triggerEvent(_this['onSuccess'], data, _this);
94
+ return data;
95
+ // eslint-disable-next-line
96
+ }).catch(function (error) {
97
+ var returnVal = {};
98
+ if (_this.emitError) {
99
+ _this.triggerEvent(_this['onFailure'], error);
100
+ returnVal = Promise.reject(error);
101
+ }
102
+ return returnVal;
103
+ });
104
+ }
105
+ catch (error) {
106
+ return error;
107
+ }
108
+ };
109
+ Fetch.prototype.triggerEvent = function (callback, data, instance) {
110
+ if (!isNOU(callback) && typeof callback === 'function') {
111
+ callback(data, instance);
112
+ }
113
+ };
114
+ return Fetch;
115
+ }());
116
+ export { Fetch };
package/src/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export * from './intl/intl-base';
5
5
  export * from './ajax';
6
+ export * from './fetch';
6
7
  export * from './animation';
7
8
  export * from './animation-model';
8
9
  export * from './base';
package/src/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export * from './intl/intl-base';
5
5
  export * from './ajax';
6
+ export * from './fetch';
6
7
  export * from './animation';
7
8
  export * from './base';
8
9
  export * from './browser';
@@ -110,7 +110,7 @@ var NumberFormat = /** @class */ (function () {
110
110
  else if (!isFinite(value)) {
111
111
  return symbols[mapper[0]];
112
112
  }
113
- return _this.intNumberFormatter(value, cOptions, dOptions);
113
+ return _this.intNumberFormatter(value, cOptions, dOptions, option);
114
114
  };
115
115
  };
116
116
  /**
@@ -194,7 +194,7 @@ var NumberFormat = /** @class */ (function () {
194
194
  * @param {CommonOptions} dOptions ?
195
195
  * @returns {string} ?
196
196
  */
197
- NumberFormat.intNumberFormatter = function (value, fOptions, dOptions) {
197
+ NumberFormat.intNumberFormatter = function (value, fOptions, dOptions, option) {
198
198
  var curData;
199
199
  if (isUndefined(fOptions.nData.type)) {
200
200
  return undefined;
@@ -218,7 +218,7 @@ var NumberFormat = /** @class */ (function () {
218
218
  fValue = this.processSignificantDigits(value, curData.minimumSignificantDigits, curData.maximumSignificantDigits);
219
219
  }
220
220
  else {
221
- fValue = this.processFraction(value, curData.minimumFractionDigits, curData.maximumFractionDigits);
221
+ fValue = this.processFraction(value, curData.minimumFractionDigits, curData.maximumFractionDigits, option);
222
222
  if (curData.minimumIntegerDigits) {
223
223
  fValue = this.processMinimumIntegers(fValue, curData.minimumIntegerDigits);
224
224
  }
@@ -253,6 +253,9 @@ var NumberFormat = /** @class */ (function () {
253
253
  return curData.nlead;
254
254
  }
255
255
  else {
256
+ if (fValue === '0' && option && option.format === '0') {
257
+ return fValue + curData.nend;
258
+ }
256
259
  return curData.nlead + fValue + curData.nend;
257
260
  }
258
261
  }
@@ -314,7 +317,7 @@ var NumberFormat = /** @class */ (function () {
314
317
  * @param {number} max ?
315
318
  * @returns {string} ?
316
319
  */
317
- NumberFormat.processFraction = function (value, min, max) {
320
+ NumberFormat.processFraction = function (value, min, max, option) {
318
321
  var temp = (value + '').split('.')[1];
319
322
  var length = temp ? temp.length : 0;
320
323
  if (min && length < min) {
@@ -334,7 +337,11 @@ var NumberFormat = /** @class */ (function () {
334
337
  else if (!isNullOrUndefined(max) && (length > max || max === 0)) {
335
338
  return value.toFixed(max);
336
339
  }
337
- return value + '';
340
+ var str = value + '';
341
+ if (str[0] === '0' && option && option.format === '###.00') {
342
+ str = str.slice(1);
343
+ }
344
+ return str;
338
345
  };
339
346
  /**
340
347
  * Returns integer processed numeric string
@@ -214,28 +214,28 @@ var blazorCurrencyData = {
214
214
  'XAF': 'FCFA',
215
215
  'GHS': 'GH₵',
216
216
  'XDR': 'XDR',
217
- 'AED': 'د.إ.‏',
218
- 'BHD': 'د.ب.‏',
219
- 'DZD': 'د.ج.‏',
220
- 'EGP': 'ج.م.‏',
217
+ 'AED': 'د.إ.',
218
+ 'BHD': 'د.ب.',
219
+ 'DZD': 'د.ج.',
220
+ 'EGP': 'ج.م.',
221
221
  'ILS': '₪',
222
- 'IQD': 'د.ع.‏',
223
- 'JOD': 'د.ا.‏',
222
+ 'IQD': 'د.ع.',
223
+ 'JOD': 'د.ا.',
224
224
  'KMF': 'CF',
225
- 'KWD': 'د.ك.‏',
226
- 'LBP': 'ل.ل.‏',
227
- 'LYD': 'د.ل.‏',
228
- 'MAD': 'د.م.‏',
225
+ 'KWD': 'د.ك.',
226
+ 'LBP': 'ل.ل.',
227
+ 'LYD': 'د.ل.',
228
+ 'MAD': 'د.م.',
229
229
  'MRU': 'أ.م.',
230
- 'OMR': 'ر.ع.‏',
231
- 'QAR': 'ر.ق.‏',
232
- 'SAR': 'ر.س.‏',
230
+ 'OMR': 'ر.ع.',
231
+ 'QAR': 'ر.ق.',
232
+ 'SAR': 'ر.س.',
233
233
  'SDG': 'ج.س.',
234
234
  'SOS': 'S',
235
235
  'SSP': '£',
236
- 'SYP': 'ل.س.‏',
237
- 'TND': 'د.ت.‏',
238
- 'YER': 'ر.ي.‏',
236
+ 'SYP': 'ل.س.',
237
+ 'TND': 'د.ت.',
238
+ 'YER': 'ر.ي.',
239
239
  'CLP': '$',
240
240
  'INR': '₹',
241
241
  'TZS': 'TSh',
@@ -8,18 +8,18 @@ export declare function getRandomId(): string;
8
8
  * Interface for Template Engine.
9
9
  */
10
10
  export interface ITemplateEngine {
11
- compile: (templateString: string, helper?: Object, ignorePrefix?: boolean) => (data: Object | JSON) => string;
11
+ compile: (templateString: string | Function, helper?: Object, ignorePrefix?: boolean) => (data: Object | JSON) => string;
12
12
  }
13
13
  /**
14
14
  * Compile the template string into template function.
15
15
  *
16
- * @param {string} templateString - The template string which is going to convert.
16
+ * @param {string | Function} templateString - The template string which is going to convert.
17
17
  * @param {Object} helper - Helper functions as an object.
18
18
  * @param {boolean} ignorePrefix ?
19
19
  * @returns {NodeList} ?
20
20
  * @private
21
21
  */
22
- export declare function compile(templateString: string, helper?: Object, ignorePrefix?: boolean): (data: Object | JSON, component?: any, propName?: any) => NodeList;
22
+ export declare function compile(templateString: string | Function, helper?: Object, ignorePrefix?: boolean): (data: Object | JSON, component?: any, propName?: any) => NodeList;
23
23
  /**
24
24
  *
25
25
  * @param {string} templateId ?
@@ -53,3 +53,12 @@ export declare function setTemplateEngine(classObj: ITemplateEngine): void;
53
53
  * @private
54
54
  */
55
55
  export declare function getTemplateEngine(): (template: string, helper?: Object) => (data: Object | JSON) => string;
56
+ /**
57
+ * Set the current template function to support Content Security Policy.
58
+ *
59
+ * @param {Function} template - The template function that is going to render.
60
+ * @param {any} helper - The data utilized by the template from the helper.
61
+ * @returns {Function} ?
62
+ * @private
63
+ */
64
+ export declare function initializeCSPTemplate(template: Function, helper?: any): Function;
@@ -17,7 +17,7 @@ export function getRandomId() {
17
17
  /**
18
18
  * Compile the template string into template function.
19
19
  *
20
- * @param {string} templateString - The template string which is going to convert.
20
+ * @param {string | Function} templateString - The template string which is going to convert.
21
21
  * @param {Object} helper - Helper functions as an object.
22
22
  * @param {boolean} ignorePrefix ?
23
23
  * @returns {NodeList} ?
@@ -145,6 +145,26 @@ export function setTemplateEngine(classObj) {
145
145
  export function getTemplateEngine() {
146
146
  return engineObj.compile;
147
147
  }
148
+ /**
149
+ * Set the current template function to support Content Security Policy.
150
+ *
151
+ * @param {Function} template - The template function that is going to render.
152
+ * @param {any} helper - The data utilized by the template from the helper.
153
+ * @returns {Function} ?
154
+ * @private
155
+ */
156
+ export function initializeCSPTemplate(template, helper) {
157
+ var boundFunc;
158
+ template.prototype.CSPTemplate = true;
159
+ if (!isNullOrUndefined(helper)) {
160
+ boundFunc = template.bind(helper);
161
+ boundFunc.prototype = Object.create(template.prototype);
162
+ }
163
+ else {
164
+ boundFunc = template;
165
+ }
166
+ return boundFunc;
167
+ }
148
168
  //Default Engine Class
149
169
  var Engine = /** @class */ (function () {
150
170
  function Engine() {
package/src/template.d.ts CHANGED
@@ -12,10 +12,10 @@ export declare function expression(value?: RegExp): RegExp;
12
12
  /**
13
13
  * Compile the template string into template function.
14
14
  *
15
- * @param {string} template - The template string which is going to convert.
15
+ * @param {string | Function} template - The template string which is going to convert.
16
16
  * @param {Object} helper - Helper functions as an object.
17
17
  * @param {boolean} ignorePrefix ?
18
18
  * @returns {string} ?
19
19
  * @private
20
20
  */
21
- export declare function compile(template: string, helper?: Object, ignorePrefix?: boolean): () => string;
21
+ export declare function compile(template: string | Function, helper?: Object, ignorePrefix?: boolean): () => string;
package/src/template.js CHANGED
@@ -52,20 +52,25 @@ export function expression(value) {
52
52
  /**
53
53
  * Compile the template string into template function.
54
54
  *
55
- * @param {string} template - The template string which is going to convert.
55
+ * @param {string | Function} template - The template string which is going to convert.
56
56
  * @param {Object} helper - Helper functions as an object.
57
57
  * @param {boolean} ignorePrefix ?
58
58
  * @returns {string} ?
59
59
  * @private
60
60
  */
61
61
  export function compile(template, helper, ignorePrefix) {
62
- var argName = 'data';
63
- var evalExpResult = evalExp(template, argName, helper, ignorePrefix);
64
- // eslint-disable-next-line
65
- 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 ";
66
- var fnCode = 'var str=\"' + evalExpResult + '\";' + condtion + ' return str;';
67
- var fn = new Function(argName, fnCode);
68
- return fn.bind(helper);
62
+ if (typeof template === 'function') {
63
+ return template;
64
+ }
65
+ else {
66
+ var argName = 'data';
67
+ var evalExpResult = evalExp(template, argName, helper, ignorePrefix);
68
+ // eslint-disable-next-line
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=\"' + evalExpResult + '\";' + condtion + ' return str;';
71
+ var fn = new Function(argName, fnCode);
72
+ return fn.bind(helper);
73
+ }
69
74
  }
70
75
  /** function used to evaluate the function expression
71
76
  *
@@ -192,7 +197,7 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
192
197
  * @returns {string} ?
193
198
  */
194
199
  function addNameSpace(str, addNS, nameSpace, ignoreList, ignorePrefix) {
195
- return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1 && !ignorePrefix) ? nameSpace + '.' + str : str);
200
+ return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1 && !ignorePrefix && str !== "true" && str !== "false") ? nameSpace + '.' + str : str);
196
201
  }
197
202
  /**
198
203
  *