@syncfusion/ej2-base 24.2.7 → 25.1.35-579988

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 (163) hide show
  1. package/.eslintrc.json +2 -1
  2. package/CHANGELOG.md +641 -677
  3. package/{README.md → ReadMe.md} +100 -100
  4. package/dist/ej2-base.umd.min.js +1 -10
  5. package/dist/ej2-base.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-base.es2015.js +178 -1025
  7. package/dist/es6/ej2-base.es2015.js.map +1 -1
  8. package/dist/es6/ej2-base.es5.js +226 -934
  9. package/dist/es6/ej2-base.es5.js.map +1 -1
  10. package/dist/global/ej2-base.min.js +1 -10
  11. package/dist/global/ej2-base.min.js.map +1 -1
  12. package/dist/global/index.d.ts +0 -9
  13. package/dist/ts/ajax.ts +236 -0
  14. package/dist/ts/animation.ts +544 -0
  15. package/dist/ts/base.ts +357 -0
  16. package/dist/ts/browser.ts +387 -0
  17. package/dist/ts/child-property.ts +192 -0
  18. package/dist/ts/component.ts +519 -0
  19. package/dist/ts/dom.ts +488 -0
  20. package/dist/ts/draggable.ts +1155 -0
  21. package/dist/ts/droppable.ts +172 -0
  22. package/dist/ts/event-handler.ts +169 -0
  23. package/dist/ts/internationalization.ts +369 -0
  24. package/dist/ts/intl/date-formatter.ts +317 -0
  25. package/dist/ts/intl/date-parser.ts +426 -0
  26. package/dist/ts/intl/intl-base.ts +1104 -0
  27. package/dist/ts/intl/number-formatter.ts +411 -0
  28. package/dist/ts/intl/number-parser.ts +158 -0
  29. package/dist/ts/intl/parser-base.ts +394 -0
  30. package/dist/ts/keyboard.ts +238 -0
  31. package/dist/ts/l10n.ts +94 -0
  32. package/dist/ts/module-loader.ts +149 -0
  33. package/dist/ts/notify-property-change.ts +726 -0
  34. package/dist/ts/observer.ts +236 -0
  35. package/dist/ts/sanitize-helper.ts +224 -0
  36. package/dist/ts/template-engine.ts +191 -0
  37. package/dist/ts/template.ts +329 -0
  38. package/dist/ts/touch.ts +544 -0
  39. package/dist/ts/util.ts +523 -0
  40. package/dist/ts/validate-lic.ts +0 -0
  41. package/e2e/crypto.js +16 -16
  42. package/e2e/m.protractor.config.js +286 -286
  43. package/e2e/modified-protractor/protractor.config.js +316 -316
  44. package/e2e/protractor.config.js +389 -332
  45. package/helpers/e2e/index.js +3 -3
  46. package/license +10 -10
  47. package/package.json +225 -174
  48. package/src/ajax.d.ts +1 -1
  49. package/src/ajax.js +3 -8
  50. package/src/animation-model.d.ts +41 -41
  51. package/src/animation.d.ts +6 -6
  52. package/src/animation.js +25 -25
  53. package/src/base.d.ts +2 -1
  54. package/src/base.js +9 -7
  55. package/src/component-model.d.ts +16 -16
  56. package/src/component.d.ts +9 -3
  57. package/src/component.js +50 -38
  58. package/src/draggable-model.d.ts +113 -113
  59. package/src/draggable.d.ts +2 -0
  60. package/src/draggable.js +45 -29
  61. package/src/droppable-model.d.ts +23 -23
  62. package/src/droppable.js +19 -19
  63. package/src/event-handler.js +2 -1
  64. package/src/index.d.ts +0 -3
  65. package/src/index.js +0 -3
  66. package/src/intl/date-formatter.js +2 -6
  67. package/src/intl/date-parser.js +1 -20
  68. package/src/intl/intl-base.js +1 -164
  69. package/src/intl/number-formatter.d.ts +3 -0
  70. package/src/intl/number-formatter.js +7 -7
  71. package/src/intl/number-parser.js +1 -0
  72. package/src/keyboard-model.d.ts +16 -16
  73. package/src/keyboard.js +19 -19
  74. package/src/module-loader.d.ts +12 -0
  75. package/src/module-loader.js +11 -0
  76. package/src/notify-property-change.js +3 -2
  77. package/src/observer.js +2 -0
  78. package/src/sanitize-helper.js +5 -0
  79. package/src/template-engine.js +1 -0
  80. package/src/template.js +3 -2
  81. package/src/touch-model.d.ts +39 -39
  82. package/src/touch.js +19 -19
  83. package/src/validate-lic.d.ts +0 -11
  84. package/src/validate-lic.js +1 -259
  85. package/styles/_all.scss +2 -2
  86. package/styles/_bds-dark-definition.scss +15 -0
  87. package/styles/_bds-definition.scss +15 -0
  88. package/styles/_bootstrap-dark-definition.scss +42 -42
  89. package/styles/_bootstrap-definition.scss +42 -42
  90. package/styles/_bootstrap4-definition.scss +11 -11
  91. package/styles/_bootstrap5-dark-definition.scss +9 -9
  92. package/styles/_bootstrap5-definition.scss +8 -8
  93. package/styles/_fabric-dark-definition.scss +42 -42
  94. package/styles/_fabric-definition.scss +42 -42
  95. package/styles/_fluent-dark-definition.scss +9 -9
  96. package/styles/_fluent-definition.scss +9 -9
  97. package/styles/_fluent2-definition.scss +9 -0
  98. package/styles/_fusionnew-dark-definition.scss +8 -8
  99. package/styles/_fusionnew-definition.scss +8 -8
  100. package/styles/_highcontrast-definition.scss +42 -42
  101. package/styles/_highcontrast-light-definition.scss +42 -42
  102. package/styles/_material-dark-definition.scss +48 -48
  103. package/styles/_material-definition.scss +49 -49
  104. package/styles/_material3-dark-definition.scss +14 -14
  105. package/styles/_material3-definition.scss +15 -15
  106. package/styles/_tailwind-dark-definition.scss +15 -15
  107. package/styles/_tailwind-definition.scss +15 -15
  108. package/styles/animation/_all.scss +560 -560
  109. package/styles/bootstrap-dark.css +10 -1
  110. package/styles/bootstrap.css +10 -1
  111. package/styles/bootstrap4.css +10 -1
  112. package/styles/bootstrap5-dark.css +10 -1
  113. package/styles/bootstrap5.css +10 -1
  114. package/styles/common/_all.scss +2 -2
  115. package/styles/common/_core.scss +117 -117
  116. package/styles/common/_mixin.scss +9 -9
  117. package/styles/definition/_bds-dark.scss +1179 -0
  118. package/styles/definition/_bds.scss +1474 -0
  119. package/styles/definition/_bootstrap-dark.scss +219 -219
  120. package/styles/definition/_bootstrap.scss +215 -215
  121. package/styles/definition/_bootstrap4.scss +167 -167
  122. package/styles/definition/_bootstrap5-dark.scss +493 -493
  123. package/styles/definition/_bootstrap5.scss +494 -494
  124. package/styles/definition/_fabric-dark.scss +200 -200
  125. package/styles/definition/_fabric.scss +198 -198
  126. package/styles/definition/_fluent-dark.scss +557 -557
  127. package/styles/definition/_fluent.scss +558 -558
  128. package/styles/definition/_fluent2.scss +2198 -0
  129. package/styles/definition/_fusionnew-dark.scss +362 -362
  130. package/styles/definition/_fusionnew.scss +363 -363
  131. package/styles/definition/_highcontrast-light.scss +193 -193
  132. package/styles/definition/_highcontrast.scss +195 -195
  133. package/styles/definition/_material-dark.scss +198 -198
  134. package/styles/definition/_material.scss +192 -192
  135. package/styles/definition/_material3-dark.scss +710 -710
  136. package/styles/definition/_material3.scss +792 -792
  137. package/styles/definition/_tailwind-dark.scss +488 -488
  138. package/styles/definition/_tailwind.scss +485 -485
  139. package/styles/fabric-dark.css +10 -1
  140. package/styles/fabric.css +10 -1
  141. package/styles/fluent-dark.css +10 -1
  142. package/styles/fluent.css +10 -1
  143. package/styles/highcontrast-light.css +10 -1
  144. package/styles/highcontrast.css +10 -1
  145. package/styles/material-dark.css +10 -1
  146. package/styles/material.css +10 -1
  147. package/styles/material3-dark.css +10 -1
  148. package/styles/material3.css +10 -1
  149. package/styles/offline-theme/material-dark.css +10 -1
  150. package/styles/offline-theme/material.css +10 -1
  151. package/styles/offline-theme/tailwind-dark.css +10 -1
  152. package/styles/offline-theme/tailwind.css +10 -1
  153. package/styles/tailwind-dark.css +10 -1
  154. package/styles/tailwind.css +10 -1
  155. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -60
  156. package/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -42
  157. package/bin/syncfusion-license.js +0 -2
  158. package/dist/ej2-base.min.js +0 -10
  159. package/e2e/index.d.ts +0 -27
  160. package/src/fetch.d.ts +0 -114
  161. package/src/fetch.js +0 -116
  162. package/src/hijri-parser.d.ts +0 -19
  163. package/src/hijri-parser.js +0 -204
@@ -1,12 +1,3 @@
1
- /*!
2
- * filename: index.d.ts
3
- * version : 24.2.7
4
- * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  import * as _base from '@syncfusion/ej2-base';
11
2
 
12
3
  export declare namespace ej {
@@ -0,0 +1,236 @@
1
+ import { isNullOrUndefined, merge } from './util';
2
+ const headerRegex: RegExp = /^(.*?):[ \t]*([^\r\n]*)$/gm;
3
+ const defaultType: string = 'GET';
4
+
5
+ /**
6
+ * Ajax class provides ability to make asynchronous HTTP request to the server
7
+ * ```typescript
8
+ * var ajax = new Ajax("index.html", "GET", true);
9
+ * ajax.send().then(
10
+ * function (value) {
11
+ * console.log(value);
12
+ * },
13
+ * function (reason) {
14
+ * console.log(reason);
15
+ * });
16
+ * ```
17
+ */
18
+ export class Ajax {
19
+ /**
20
+ * Specifies the URL to which request to be sent.
21
+ *
22
+ * @default null
23
+ */
24
+ public url: string;
25
+ /**
26
+ * Specifies which HTTP request method to be used. For ex., GET, POST
27
+ *
28
+ * @default GET
29
+ */
30
+ public type: string;
31
+ /**
32
+ * Specifies the data to be sent.
33
+ *
34
+ * @default null
35
+ */
36
+ public data: string | Object;
37
+ /**
38
+ * A boolean value indicating whether the request should be sent asynchronous or not.
39
+ *
40
+ * @default true
41
+ */
42
+ public mode: boolean = true;
43
+ /**
44
+ * Specifies the callback for creating the XMLHttpRequest object.
45
+ *
46
+ * @default null
47
+ */
48
+ public httpRequest: XMLHttpRequest;
49
+ /**
50
+ * A boolean value indicating whether to ignore the promise reject.
51
+ *
52
+ * @private
53
+ * @default true
54
+ */
55
+ public emitError: boolean = true;
56
+
57
+ private options: Object = {};
58
+
59
+ public onLoad: (this: XMLHttpRequest, ev: Event) => Object;
60
+ public onProgress: (this: XMLHttpRequest, ev: Event) => Object;
61
+ public onError: (this: XMLHttpRequest, ev: Event) => Object;
62
+ public onAbort: (this: XMLHttpRequest, ev: Event) => Object;
63
+
64
+ public onUploadProgress: (this: XMLHttpRequest, ev: Event) => Object;
65
+
66
+ private contentType: string;
67
+ private dataType: string;
68
+ /**
69
+ * Constructor for Ajax class
70
+ *
71
+ * @param {string|Object} options ?
72
+ * @param {string} type ?
73
+ * @param {boolean} async ?
74
+ * @returns defaultType any
75
+ */
76
+
77
+ constructor(options?: string | Object, type?: string, async?: boolean, contentType?: string) {
78
+ if (typeof options === 'string') {
79
+ this.url = options;
80
+ this.type = type ? type.toUpperCase() : defaultType;
81
+ this.mode = !isNullOrUndefined(async) ? async : true;
82
+ } else if (typeof options === 'object') {
83
+ this.options = options;
84
+ merge(this, this.options);
85
+ }
86
+ this.type = this.type ? this.type.toUpperCase() : defaultType;
87
+ this.contentType = (this.contentType !== undefined) ? this.contentType : contentType;
88
+ }
89
+ /**
90
+ *
91
+ * Send the request to server.
92
+ *
93
+ * @param {any} data - To send the user data
94
+ * @returns {Promise} ?
95
+ */
96
+
97
+ public send(data?: string | Object): Promise<Ajax> {
98
+ this.data = isNullOrUndefined(data) ? this.data : data;
99
+ const eventArgs: BeforeSendEventArgs = {
100
+ cancel: false,
101
+ httpRequest: null
102
+ };
103
+ const promise: Promise<Ajax> = new Promise((resolve: Function, reject: Function) => {
104
+ this.httpRequest = new XMLHttpRequest();
105
+ this.httpRequest.onreadystatechange = () => { this.stateChange(resolve, reject); };
106
+ if (!isNullOrUndefined(this.onLoad)) {
107
+ this.httpRequest.onload = this.onLoad;
108
+ }
109
+ if (!isNullOrUndefined(this.onProgress)) {
110
+ this.httpRequest.onprogress = this.onProgress;
111
+ }
112
+ /* istanbul ignore next */
113
+ if (!isNullOrUndefined(this.onAbort)) {
114
+ this.httpRequest.onabort = this.onAbort;
115
+ }
116
+ /* istanbul ignore next */
117
+ if (!isNullOrUndefined(this.onError)) {
118
+ this.httpRequest.onerror = this.onError;
119
+ }
120
+ //** Upload Events **/
121
+ /* istanbul ignore next */
122
+ if (!isNullOrUndefined(this.onUploadProgress)) {
123
+ this.httpRequest.upload.onprogress = this.onUploadProgress;
124
+ }
125
+ this.httpRequest.open(this.type, this.url, this.mode);
126
+ // Set default headers
127
+ if (!isNullOrUndefined(this.data) && this.contentType !== null) {
128
+ this.httpRequest.setRequestHeader('Content-Type', this.contentType || 'application/json; charset=utf-8');
129
+ }
130
+ if (this.beforeSend) {
131
+ eventArgs.httpRequest = this.httpRequest;
132
+ this.beforeSend(eventArgs);
133
+ }
134
+ if (!eventArgs.cancel) {
135
+ this.httpRequest.send(!isNullOrUndefined(this.data) ? this.data as Document : null);
136
+ }
137
+ });
138
+ return promise;
139
+ }
140
+ /**
141
+ * Specifies the callback function to be triggered before sending request to sever.
142
+ * This can be used to modify the XMLHttpRequest object before it is sent.
143
+ *
144
+ * @event beforeSend
145
+ */
146
+ public beforeSend: Function;
147
+ /**
148
+ * Specifies callback function to be triggered after XmlHttpRequest is succeeded.
149
+ * The callback will contain server response as the parameter.
150
+ *
151
+ * @event onSuccess
152
+ */
153
+ public onSuccess: Function;
154
+ /**
155
+ * Triggers when XmlHttpRequest is failed.
156
+ *
157
+ * @event onFailure
158
+ */
159
+ public onFailure: Function;
160
+ private successHandler(data: string): string {
161
+ if (this.onSuccess) {
162
+ this.onSuccess(data, this);
163
+ }
164
+ return data;
165
+ }
166
+ private failureHandler(reason: string): string {
167
+ if (this.onFailure) {
168
+ this.onFailure(this.httpRequest);
169
+ }
170
+ return reason;
171
+ }
172
+ private stateChange(resolve: Function, reject: Function): void {
173
+ let data: string = this.httpRequest.responseText;
174
+ if (this.dataType && this.dataType.toLowerCase() === 'json') {
175
+ if (data === '') {
176
+ data = undefined;
177
+ } else {
178
+ try {
179
+ data = JSON.parse(data);
180
+ } catch (error) {
181
+ // no exception handle
182
+ }
183
+ }
184
+ }
185
+ if (this.httpRequest.readyState === 4) {
186
+ //success range should be 200 to 299
187
+ if ((this.httpRequest.status >= 200 && this.httpRequest.status <= 299) || this.httpRequest.status === 304) {
188
+ resolve(this.successHandler(data));
189
+ } else {
190
+ if (this.emitError) {
191
+ reject(new Error(this.failureHandler(this.httpRequest.statusText)));
192
+ } else {
193
+ resolve();
194
+ }
195
+ }
196
+ }
197
+ }
198
+ /**
199
+ * To get the response header from XMLHttpRequest
200
+ *
201
+ * @param {string} key Key to search in the response header
202
+ * @returns {string} ?
203
+ */
204
+
205
+ public getResponseHeader(key: string): string {
206
+ const responseHeaders: { [key: string]: string } = {};
207
+ let headers: string[] = headerRegex.exec(this.httpRequest.getAllResponseHeaders());
208
+ while (headers) {
209
+ responseHeaders[headers[1].toLowerCase()] = headers[2];
210
+ headers = headerRegex.exec(this.httpRequest.getAllResponseHeaders());
211
+ }
212
+ const header: string = responseHeaders[key.toLowerCase()];
213
+ return isNullOrUndefined(header) ? null : header;
214
+ }
215
+ }
216
+
217
+ export interface HeaderOptions {
218
+ readyState?: number;
219
+ getResponseHeader?: Function;
220
+ setRequestHeader?: Function;
221
+ overrideMimeType?: Function;
222
+ }
223
+
224
+ /**
225
+ * Specifies the ajax beforeSend event arguments
226
+ *
227
+ * @event BeforeSendEventArgs
228
+ */
229
+ export interface BeforeSendEventArgs {
230
+
231
+ /** To cancel the ajax request in beforeSend */
232
+ cancel?: boolean;
233
+
234
+ /** Returns the request sent from the client end */
235
+ httpRequest?: XMLHttpRequest;
236
+ }