@syncfusion/ej2-base 19.2.55 → 19.3.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 (111) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +1 -89
  3. package/README.md +1 -1
  4. package/dist/ej2-base.umd.min.js +2 -2
  5. package/dist/ej2-base.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-base.es2015.js +2650 -2401
  7. package/dist/es6/ej2-base.es2015.js.map +1 -1
  8. package/dist/es6/ej2-base.es5.js +3186 -2948
  9. package/dist/es6/ej2-base.es5.js.map +1 -1
  10. package/dist/global/ej2-base.min.js +2 -2
  11. package/dist/global/ej2-base.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/e2e/crypto.js +1 -1
  14. package/e2e/index.d.ts +0 -3
  15. package/e2e/m.protractor.config.js +1 -1
  16. package/e2e/protractor.config.js +1 -1
  17. package/helpers/e2e/base.js +3 -3
  18. package/package.json +7 -64
  19. package/src/ajax.d.ts +24 -10
  20. package/src/ajax.js +14 -6
  21. package/src/animation-model.d.ts +12 -4
  22. package/src/animation.d.ts +37 -12
  23. package/src/animation.js +48 -22
  24. package/src/base.d.ts +31 -11
  25. package/src/base.js +34 -16
  26. package/src/browser.d.ts +63 -25
  27. package/src/browser.js +60 -15
  28. package/src/child-property.d.ts +21 -10
  29. package/src/child-property.js +23 -13
  30. package/src/component-model.d.ts +4 -1
  31. package/src/component.d.ts +42 -5
  32. package/src/component.js +52 -35
  33. package/src/dom.d.ts +76 -25
  34. package/src/dom.js +128 -124
  35. package/src/draggable-model.d.ts +5 -0
  36. package/src/draggable.d.ts +4 -1
  37. package/src/draggable.js +8 -2
  38. package/src/droppable-model.d.ts +7 -4
  39. package/src/droppable.d.ts +7 -3
  40. package/src/droppable.js +1 -0
  41. package/src/event-handler.d.ts +10 -6
  42. package/src/event-handler.js +11 -7
  43. package/src/hijri-parser.d.ts +12 -0
  44. package/src/hijri-parser.js +111 -90
  45. package/src/internationalization.d.ts +54 -21
  46. package/src/internationalization.js +55 -18
  47. package/src/intl/date-formatter.d.ts +19 -8
  48. package/src/intl/date-formatter.js +36 -13
  49. package/src/intl/date-parser.d.ts +30 -23
  50. package/src/intl/date-parser.js +61 -42
  51. package/src/intl/intl-base.d.ts +123 -46
  52. package/src/intl/intl-base.js +451 -377
  53. package/src/intl/number-formatter.d.ts +45 -34
  54. package/src/intl/number-formatter.js +47 -35
  55. package/src/intl/number-parser.d.ts +11 -8
  56. package/src/intl/number-parser.js +14 -11
  57. package/src/intl/parser-base.d.ts +38 -13
  58. package/src/intl/parser-base.js +45 -16
  59. package/src/keyboard-model.d.ts +5 -2
  60. package/src/keyboard.d.ts +26 -8
  61. package/src/keyboard.js +24 -9
  62. package/src/l10n.d.ts +16 -7
  63. package/src/l10n.js +16 -7
  64. package/src/module-loader.d.ts +13 -8
  65. package/src/module-loader.js +13 -9
  66. package/src/notify-property-change.d.ts +19 -7
  67. package/src/notify-property-change.js +140 -24
  68. package/src/observer.d.ts +17 -5
  69. package/src/observer.js +19 -7
  70. package/src/sanitize-helper.d.ts +1 -0
  71. package/src/sanitize-helper.js +1 -1
  72. package/src/template-engine.d.ts +30 -4
  73. package/src/template-engine.js +37 -12
  74. package/src/template.d.ts +8 -3
  75. package/src/template.js +67 -19
  76. package/src/touch-model.d.ts +11 -4
  77. package/src/touch.d.ts +51 -9
  78. package/src/touch.js +45 -13
  79. package/src/util.d.ts +67 -37
  80. package/src/util.js +99 -49
  81. package/styles/_bootstrap-definition.scss +0 -1
  82. package/styles/_bootstrap5-dark-definition.scss +10 -0
  83. package/styles/_bootstrap5-definition.scss +9 -0
  84. package/styles/_fabric-dark-definition.scss +0 -1
  85. package/styles/_highcontrast-light-definition.scss +1 -0
  86. package/styles/_material-definition.scss +1 -0
  87. package/styles/bootstrap-dark.css +2613 -32
  88. package/styles/bootstrap.css +2613 -32
  89. package/styles/bootstrap4.css +2149 -32
  90. package/styles/bootstrap5-dark.css +2157 -0
  91. package/styles/bootstrap5-dark.scss +3 -0
  92. package/styles/bootstrap5.css +2157 -0
  93. package/styles/bootstrap5.scss +3 -0
  94. package/styles/common/_core.scss +28 -63
  95. package/styles/definition/_bootstrap-dark.scss +3 -3
  96. package/styles/definition/_bootstrap.scss +1 -1
  97. package/styles/definition/_bootstrap5-dark.scss +357 -0
  98. package/styles/definition/_bootstrap5.scss +356 -0
  99. package/styles/definition/_material-dark.scss +1 -1
  100. package/styles/definition/_tailwind-dark.scss +18 -1
  101. package/styles/definition/_tailwind.scss +17 -0
  102. package/styles/fabric-dark.css +2589 -32
  103. package/styles/fabric.css +2589 -32
  104. package/styles/highcontrast-light.css +2573 -32
  105. package/styles/highcontrast.css +2573 -32
  106. package/styles/material-dark.css +2549 -32
  107. package/styles/material.css +2549 -32
  108. package/styles/tailwind-dark.css +2221 -32
  109. package/styles/tailwind.css +2221 -32
  110. package/src/virtual-dom.d.ts +0 -32
  111. package/src/virtual-dom.js +0 -449
@@ -4,25 +4,31 @@
4
4
  import { compile as render } from './template';
5
5
  import { createElement } from './dom';
6
6
  import { isNullOrUndefined, isBlazor } from './util';
7
- var HAS_ROW = /^[\n\r.]+\<tr|^\<tr/;
8
- var HAS_SVG = /^[\n\r.]+\<svg|^\<path|^\<g/;
7
+ var HAS_ROW = /^[\n\r.]+<tr|^<tr/;
8
+ var HAS_SVG = /^[\n\r.]+<svg|^<path|^<g/;
9
9
  export var blazorTemplates = {};
10
+ /**
11
+ *
12
+ * @returns {string} ?
13
+ */
10
14
  export function getRandomId() {
11
15
  return '-' + Math.random().toString(36).substr(2, 5);
12
16
  }
13
17
  /**
14
18
  * Compile the template string into template function.
15
- * @param {string} templateString - The template string which is going to convert.
16
- * @param {Object} helper? - Helper functions as an object.
19
+ *
20
+ * @param {string} templateString - The template string which is going to convert.
21
+ * @param {Object} helper - Helper functions as an object.
22
+ * @param {boolean} ignorePrefix ?
23
+ * @returns {NodeList} ?
17
24
  * @private
18
25
  */
19
- //tslint:disable-next-line
26
+ // eslint-disable-next-line
20
27
  export function compile(templateString, helper, ignorePrefix) {
21
28
  var compiler = engineObj.compile(templateString, helper, ignorePrefix);
22
- //tslint:disable-next-line
29
+ // eslint-disable-next-line
23
30
  return function (data, component, propName, templateId, isStringTemplate, index, element) {
24
31
  var result = compiler(data, component, propName, element);
25
- var blazor = 'Blazor';
26
32
  var blazorTemplateId = 'BlazorTemplateId';
27
33
  if (isBlazor() && !isStringTemplate) {
28
34
  var randomId = getRandomId();
@@ -46,9 +52,9 @@ export function compile(templateString, helper, ignorePrefix) {
46
52
  data[blazorTemplateId] = blazorId;
47
53
  blazorTemplates[templateId].push(data);
48
54
  }
49
- // tslint:disable-next-line:no-any
55
+ // eslint-disable-next-line
50
56
  return propName === 'rowTemplate' ? [createElement('tr', { id: blazorId, className: 'e-blazor-template' })] :
51
- // tslint:disable-next-line:no-any
57
+ // eslint-disable-next-line
52
58
  [createElement('div', { id: blazorId, className: 'e-blazor-template' })];
53
59
  }
54
60
  if (typeof result === 'string') {
@@ -66,8 +72,16 @@ export function compile(templateString, helper, ignorePrefix) {
66
72
  }
67
73
  };
68
74
  }
75
+ /**
76
+ *
77
+ * @param {string} templateId ?
78
+ * @param {string} templateName ?
79
+ * @param {string} comp ?
80
+ * @param {boolean} isEmpty ?
81
+ * @param {Function} callBack ?
82
+ * @returns {void} ?
83
+ */
69
84
  export function updateBlazorTemplate(templateId, templateName, comp, isEmpty, callBack) {
70
- var blazor = 'Blazor';
71
85
  if (isBlazor()) {
72
86
  var ejsIntrop = 'sfBlazor';
73
87
  window[ejsIntrop].updateTemplate(templateName, blazorTemplates[templateId], templateId, comp, callBack);
@@ -76,10 +90,17 @@ export function updateBlazorTemplate(templateId, templateName, comp, isEmpty, ca
76
90
  }
77
91
  }
78
92
  }
93
+ /**
94
+ *
95
+ * @param {string} templateId ?
96
+ * @param {string} templateName ?
97
+ * @param {number} index ?
98
+ * @returns {void} ?
99
+ */
79
100
  export function resetBlazorTemplate(templateId, templateName, index) {
80
101
  var templateDiv = document.getElementById(templateId);
81
102
  if (templateDiv) {
82
- // tslint:disable-next-line:no-any
103
+ // eslint-disable-next-line
83
104
  var innerTemplates = templateDiv.getElementsByClassName('blazor-inner-template');
84
105
  for (var i = 0; i < innerTemplates.length; i++) {
85
106
  var tempId = ' ';
@@ -107,7 +128,9 @@ export function resetBlazorTemplate(templateId, templateName, index) {
107
128
  }
108
129
  /**
109
130
  * Set your custom template engine for template rendering.
131
+ *
110
132
  * @param {ITemplateEngine} classObj - Class object for custom template.
133
+ * @returns {void} ?
111
134
  * @private
112
135
  */
113
136
  export function setTemplateEngine(classObj) {
@@ -115,7 +138,8 @@ export function setTemplateEngine(classObj) {
115
138
  }
116
139
  /**
117
140
  * Get current template engine for template rendering
118
- * @param {ITemplateEngine} classObj - Class object for custom template.
141
+ *
142
+ * @returns {string} ?
119
143
  * @private
120
144
  */
121
145
  export function getTemplateEngine() {
@@ -125,6 +149,7 @@ export function getTemplateEngine() {
125
149
  var Engine = /** @class */ (function () {
126
150
  function Engine() {
127
151
  }
152
+ // eslint-disable-next-line
128
153
  Engine.prototype.compile = function (templateString, helper, ignorePrefix) {
129
154
  if (helper === void 0) { helper = {}; }
130
155
  return render(templateString, helper);
package/src/template.d.ts CHANGED
@@ -3,14 +3,19 @@
3
3
  */
4
4
  /**
5
5
  * The function to set regular expression for template expression string.
6
- * @param {RegExp} value - Value expression.
6
+ *
7
+ * @param {RegExp} value - Value expression.
8
+ * @returns {RegExp} ?
7
9
  * @private
8
10
  */
9
11
  export declare function expression(value?: RegExp): RegExp;
10
12
  /**
11
13
  * Compile the template string into template function.
12
- * @param {string} template - The template string which is going to convert.
13
- * @param {Object} helper? - Helper functions as an object.
14
+ *
15
+ * @param {string} template - The template string which is going to convert.
16
+ * @param {Object} helper - Helper functions as an object.
17
+ * @param {boolean} ignorePrefix ?
18
+ * @returns {string} ?
14
19
  * @private
15
20
  */
16
21
  export declare function compile(template: string, helper?: Object, ignorePrefix?: boolean): () => string;
package/src/template.js CHANGED
@@ -7,12 +7,12 @@ var IF_STMT = new RegExp('if ?\\(');
7
7
  var ELSEIF_STMT = new RegExp('else if ?\\(');
8
8
  var ELSE_STMT = new RegExp('else');
9
9
  var FOR_STMT = new RegExp('for ?\\(');
10
- var IF_OR_FOR = new RegExp('(\/if|\/for)');
10
+ var IF_OR_FOR = new RegExp('(/if|/for)');
11
11
  var CALL_FUNCTION = new RegExp('\\((.*)\\)', '');
12
12
  var NOT_NUMBER = new RegExp('^[0-9]+$', 'g');
13
13
  var WORD = new RegExp('[\\w"\'.\\s+]+', 'g');
14
14
  var DBL_QUOTED_STR = new RegExp('"(.*?)"', 'g');
15
- var WORDIF = new RegExp('[\\w"\'@#$.\\s+]+', 'g');
15
+ var WORDIF = new RegExp('[\\w"\'@#$.\\s-+]+', 'g');
16
16
  var exp = new RegExp('\\${([^}]*)}', 'g');
17
17
  // let cachedTemplate: Object = {};
18
18
  var ARR_OBJ = /^\..*/gm;
@@ -22,7 +22,9 @@ var WORDFUNC = new RegExp('[\\w"\'@#$.\\s+]+', 'g');
22
22
  var WINDOWFUNC = /\window\./gm;
23
23
  /**
24
24
  * The function to set regular expression for template expression string.
25
- * @param {RegExp} value - Value expression.
25
+ *
26
+ * @param {RegExp} value - Value expression.
27
+ * @returns {RegExp} ?
26
28
  * @private
27
29
  */
28
30
  export function expression(value) {
@@ -49,8 +51,11 @@ export function expression(value) {
49
51
  // }
50
52
  /**
51
53
  * Compile the template string into template function.
52
- * @param {string} template - The template string which is going to convert.
53
- * @param {Object} helper? - Helper functions as an object.
54
+ *
55
+ * @param {string} template - The template string which is going to convert.
56
+ * @param {Object} helper - Helper functions as an object.
57
+ * @param {boolean} ignorePrefix ?
58
+ * @returns {string} ?
54
59
  * @private
55
60
  */
56
61
  export function compile(template, helper, ignorePrefix) {
@@ -58,19 +63,24 @@ export function compile(template, helper, ignorePrefix) {
58
63
  var evalExpResult = evalExp(template, argName, helper, ignorePrefix);
59
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(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 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 ";
60
65
  var fnCode = "var str=\"" + evalExpResult + "\";" + condtion + " return str;";
61
- //let fnCode: string = `var str="${evalExpResult}"; return str;`;
62
- // tslint:disable-next-line:no-function-constructor-with-string-args
63
66
  var fn = new Function(argName, fnCode);
64
67
  return fn.bind(helper);
65
68
  }
66
- // function used to evaluate the function expression
69
+ /** function used to evaluate the function expression
70
+ *
71
+ * @param {string} str ?
72
+ * @param {string} nameSpace ?
73
+ * @param {Object} helper ?
74
+ * @param {boolean} ignorePrefix ?
75
+ * @returns {string} ?
76
+ */
67
77
  function evalExp(str, nameSpace, helper, ignorePrefix) {
68
78
  var varCOunt = 0;
69
79
  /**
70
80
  * Variable containing Local Keys
71
81
  */
72
82
  var localKeys = [];
73
- var isClass = str.match(/class="([^\"]+|)\s{2}/g);
83
+ var isClass = str.match(/class="([^"]+|)\s{2}/g);
74
84
  var singleSpace = '';
75
85
  if (isClass) {
76
86
  isClass.forEach(function (value) {
@@ -78,8 +88,10 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
78
88
  str = str.replace(value, singleSpace);
79
89
  });
80
90
  }
81
- return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\'$1\'').replace(exp, function (match, cnt, offset, matchStr) {
82
- var SPECIAL_CHAR = /\@|\#|\$/gm;
91
+ return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\'$1\'').replace(exp,
92
+ // eslint-disable-next-line
93
+ function (match, cnt, offset, matchStr) {
94
+ var SPECIAL_CHAR = /@|#|\$/gm;
83
95
  var matches = cnt.match(CALL_FUNCTION);
84
96
  // matches to detect any function calls
85
97
  if (matches) {
@@ -101,6 +113,7 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
101
113
  //handling for condition
102
114
  var rlStr_1 = matches[1].split(' of ');
103
115
  // replace for each into actual JavaScript
116
+ // eslint-disable-next-line
104
117
  cnt = '"; ' + cnt.replace(matches[1], function (mtc) {
105
118
  localKeys.push(rlStr_1[0]);
106
119
  localKeys.push(rlStr_1[0] + 'Index');
@@ -113,16 +126,17 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
113
126
  else {
114
127
  //helper function handling
115
128
  var fnStr = cnt.split('(');
129
+ // eslint-disable-next-line
116
130
  var fNameSpace = (helper && helper.hasOwnProperty(fnStr[0]) ? 'this.' : 'global');
117
131
  fNameSpace = (/\./.test(fnStr[0]) ? '' : fNameSpace);
118
132
  var ftArray = matches[1].split(',');
119
133
  if (matches[1].length !== 0 && !(/data/).test(ftArray[0]) && !(/window./).test(ftArray[0])) {
120
134
  matches[1] = (fNameSpace === 'global' ? nameSpace + '.' + matches[1] : matches[1]);
121
135
  }
122
- var splRegexp = /\@|\$|\#/gm;
136
+ var splRegexp = /@|\$|#/gm;
123
137
  var arrObj = /\]\./gm;
124
138
  if (WINDOWFUNC.test(cnt) && arrObj.test(cnt) || splRegexp.test(cnt)) {
125
- var splArrRegexp = /\@|\$|\#|\]\./gm;
139
+ var splArrRegexp = /@|\$|#|\]\./gm;
126
140
  if (splArrRegexp.test(cnt)) {
127
141
  // tslint:disable-next-line
128
142
  cnt = '"+ ' + (fNameSpace === 'global' ? '' : fNameSpace) + cnt.replace(matches[1], rlStr.replace(WORDFUNC, function (strs) {
@@ -140,9 +154,10 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
140
154
  else if (ELSE_STMT.test(cnt)) {
141
155
  // handling else condition
142
156
  cnt = '"; ' + cnt.replace(ELSE_STMT, '} else { \n str = str + "');
157
+ // eslint-disable-next-line
143
158
  }
144
159
  else if (!!cnt.match(IF_OR_FOR)) {
145
- // close condition
160
+ // close condition
146
161
  cnt = cnt.replace(IF_OR_FOR, '"; \n } \n str = str + "');
147
162
  }
148
163
  else if (SPECIAL_CHAR.test(cnt)) {
@@ -160,15 +175,32 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
160
175
  }
161
176
  else {
162
177
  // evaluate normal expression
163
- cnt = '"+' + addNameSpace(cnt.replace(/\,/gi, '+' + nameSpace + '.'), (localKeys.indexOf(cnt) === -1), nameSpace, localKeys, ignorePrefix) + '+"';
178
+ cnt = '"+' + addNameSpace(cnt.replace(/,/gi, '+' + nameSpace + '.'), (localKeys.indexOf(cnt) === -1), nameSpace, localKeys, ignorePrefix) + '+"';
164
179
  }
165
180
  }
166
181
  return cnt;
167
182
  });
168
183
  }
184
+ /**
185
+ *
186
+ * @param {string} str ?
187
+ * @param {boolean} addNS ?
188
+ * @param {string} nameSpace ?
189
+ * @param {string[]} ignoreList ?
190
+ * @param {boolean} ignorePrefix ?
191
+ * @returns {string} ?
192
+ */
169
193
  function addNameSpace(str, addNS, nameSpace, ignoreList, ignorePrefix) {
170
194
  return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1 && !ignorePrefix) ? nameSpace + '.' + str : str);
171
195
  }
196
+ /**
197
+ *
198
+ * @param {string} str ?
199
+ * @param {boolean} addNS ?
200
+ * @param {string} nameSpace ?
201
+ * @param {string[]} ignoreList ?
202
+ * @returns {string} ?
203
+ */
172
204
  function NameSpaceArrObj(str, addNS, nameSpace, ignoreList) {
173
205
  var arrObjReg = /^\..*/gm;
174
206
  return ((addNS && !(NOT_NUMBER.test(str)) &&
@@ -178,14 +210,22 @@ function NameSpaceArrObj(str, addNS, nameSpace, ignoreList) {
178
210
  // function hashCode(str: string): string {
179
211
  // return str.split('').reduce((a: number, b: string) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0).toString();
180
212
  // }
213
+ /**
214
+ *
215
+ * @param {string} str ?
216
+ * @param {boolean} addNS ?
217
+ * @param {string} nameSpace ?
218
+ * @param {string[]} ignoreList ?
219
+ * @returns {string} ?
220
+ */
181
221
  function NameSpaceForspecialChar(str, addNS, nameSpace, ignoreList) {
182
222
  return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1) ? nameSpace + '["' + str : str);
183
223
  }
184
- // tslint:disable-next-line
224
+ // eslint-disable-next-line
185
225
  function SlashReplace(tempStr) {
186
- // tslint:disable-next-line
187
- var double = "\\\\";
226
+ var double = '\\\\';
188
227
  if (tempStr.match(DOUBLE_SLASH)) {
228
+ // eslint-disable-next-line
189
229
  tempStr = tempStr;
190
230
  }
191
231
  else {
@@ -193,12 +233,20 @@ function SlashReplace(tempStr) {
193
233
  }
194
234
  return tempStr;
195
235
  }
236
+ /**
237
+ *
238
+ * @param {string} str ?
239
+ * @param {string} nameSpaceNew ?
240
+ * @param {string[]} keys ?
241
+ * @param {boolean} ignorePrefix ?
242
+ * @returns {string} ?
243
+ */
196
244
  function HandleSpecialCharArrObj(str, nameSpaceNew, keys, ignorePrefix) {
197
245
  str = str.trim();
198
246
  var windowFunc = /\window\./gm;
199
247
  if (!windowFunc.test(str)) {
200
248
  var quotes = /'|"/gm;
201
- var splRegexp = /\@|\$|\#/gm;
249
+ var splRegexp = /@|\$|#/gm;
202
250
  if (splRegexp.test(str)) {
203
251
  str = NameSpaceForspecialChar(str, (keys.indexOf(str) === -1), nameSpaceNew, keys) + '"]';
204
252
  }
@@ -20,42 +20,49 @@ export interface TouchModel {
20
20
 
21
21
  /**
22
22
  * Specifies the callback function for tap event.
23
- * @event
23
+ *
24
+ * @event tap
24
25
  */
25
26
  tap?: EmitType<TapEventArgs>;
26
27
 
27
28
  /**
28
29
  * Specifies the callback function for tapHold event.
29
- * @event
30
+ *
31
+ * @event tapHold
30
32
  */
31
33
  tapHold?: EmitType<TapEventArgs>;
32
34
 
33
35
  /**
34
36
  * Specifies the callback function for swipe event.
35
- * @event
37
+ *
38
+ * @event swipe
36
39
  */
37
40
  swipe?: EmitType<SwipeEventArgs>;
38
41
 
39
42
  /**
40
43
  * Specifies the callback function for scroll event.
41
- * @event
44
+ *
45
+ * @event scroll
42
46
  */
43
47
  scroll?: EmitType<ScrollEventArgs>;
44
48
 
45
49
  /**
46
50
  * Specifies the time delay for tap.
51
+ *
47
52
  * @default 350
48
53
  */
49
54
  tapThreshold?: number;
50
55
 
51
56
  /**
52
57
  * Specifies the time delay for tap hold.
58
+ *
53
59
  * @default 750
54
60
  */
55
61
  tapHoldThreshold?: number;
56
62
 
57
63
  /**
58
64
  * Customize the swipe event configuration.
65
+ *
59
66
  * @default { swipeThresholdDistance: 50 }
60
67
  */
61
68
  swipeSettings?: SwipeSettingsModel;
package/src/touch.d.ts CHANGED
@@ -55,72 +55,114 @@ export declare class Touch extends Base<HTMLElement> implements INotifyPropertyC
55
55
  private timeOutTapHold;
56
56
  /**
57
57
  * Specifies the callback function for tap event.
58
- * @event
58
+ *
59
+ * @event tap
59
60
  */
60
61
  tap: EmitType<TapEventArgs>;
61
62
  /**
62
63
  * Specifies the callback function for tapHold event.
63
- * @event
64
+ *
65
+ * @event tapHold
64
66
  */
65
67
  tapHold: EmitType<TapEventArgs>;
66
68
  /**
67
69
  * Specifies the callback function for swipe event.
68
- * @event
70
+ *
71
+ * @event swipe
69
72
  */
70
73
  swipe: EmitType<SwipeEventArgs>;
71
74
  /**
72
75
  * Specifies the callback function for scroll event.
73
- * @event
76
+ *
77
+ * @event scroll
74
78
  */
75
79
  scroll: EmitType<ScrollEventArgs>;
76
80
  /**
77
81
  * Specifies the time delay for tap.
82
+ *
78
83
  * @default 350
79
84
  */
80
85
  tapThreshold: number;
81
86
  /**
82
87
  * Specifies the time delay for tap hold.
88
+ *
83
89
  * @default 750
84
90
  */
85
91
  tapHoldThreshold: number;
86
92
  /**
87
93
  * Customize the swipe event configuration.
94
+ *
88
95
  * @default { swipeThresholdDistance: 50 }
89
96
  */
90
97
  swipeSettings: SwipeSettingsModel;
91
98
  private tapCount;
92
99
  constructor(element: HTMLElement, options?: TouchModel);
93
100
  /**
101
+ *
94
102
  * @private
95
- * @param newProp
96
- * @param oldProp
103
+ * @param {TouchModel} newProp ?
104
+ * @param {TouchModel} oldProp ?
105
+ * @returns {void} ?
97
106
  */
98
107
  onPropertyChanged(newProp: TouchModel, oldProp: TouchModel): void;
99
108
  protected bind(): void;
100
109
  /**
101
110
  * To destroy the touch instance.
102
- * @return {void}
111
+ *
112
+ * @returns {void}
103
113
  */
104
114
  destroy(): void;
105
115
  private wireEvents;
106
116
  private unwireEvents;
107
117
  /**
108
118
  * Returns module name as touch
109
- * @returns {string}
119
+ *
120
+ * @returns {string} ?
110
121
  * @private
111
122
  */
112
123
  getModuleName(): string;
113
124
  /**
114
125
  * Returns if the HTML element is Scrollable.
126
+ *
115
127
  * @param {HTMLElement} element - HTML Element to check if Scrollable.
116
- * @returns {boolean}
128
+ * @returns {boolean} ?
117
129
  */
118
130
  private isScrollable;
131
+ /**
132
+ *
133
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
134
+ * @returns {void} ?
135
+ */
119
136
  private startEvent;
137
+ /**
138
+ *
139
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
140
+ * @returns {void} ?
141
+ */
120
142
  private moveEvent;
143
+ /**
144
+ *
145
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
146
+ * @returns {void} ?
147
+ */
121
148
  private cancelEvent;
149
+ /**
150
+ *
151
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
152
+ * @returns {void} ?
153
+ */
122
154
  private tapHoldEvent;
155
+ /**
156
+ *
157
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
158
+ * @returns {void} ?
159
+ */
123
160
  private endEvent;
161
+ /**
162
+ *
163
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
164
+ * @returns {void} ?
165
+ */
124
166
  private swipeFn;
125
167
  private modeclear;
126
168
  private calcPoints;
package/src/touch.js CHANGED
@@ -66,6 +66,11 @@ var Touch = /** @class */ (function (_super) {
66
66
  var _this = _super.call(this, options, element) || this;
67
67
  _this.touchAction = true;
68
68
  _this.tapCount = 0;
69
+ /**
70
+ *
71
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
72
+ * @returns {void} ?
73
+ */
69
74
  _this.startEvent = function (evt) {
70
75
  if (_this.touchAction === true) {
71
76
  var point = _this.updateChangeTouches(evt);
@@ -84,6 +89,11 @@ var Touch = /** @class */ (function (_super) {
84
89
  EventHandler.add(_this.element, Browser.touchCancelEvent, _this.cancelEvent, _this);
85
90
  }
86
91
  };
92
+ /**
93
+ *
94
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
95
+ * @returns {void} ?
96
+ */
87
97
  _this.moveEvent = function (evt) {
88
98
  var point = _this.updateChangeTouches(evt);
89
99
  _this.movedPoint = point;
@@ -104,6 +114,11 @@ var Touch = /** @class */ (function (_super) {
104
114
  _this.lastMovedPoint = { clientX: point.clientX, clientY: point.clientY };
105
115
  }
106
116
  };
117
+ /**
118
+ *
119
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
120
+ * @returns {void} ?
121
+ */
107
122
  _this.cancelEvent = function (evt) {
108
123
  clearTimeout(_this.timeOutTapHold);
109
124
  clearTimeout(_this.timeOutTap);
@@ -111,6 +126,11 @@ var Touch = /** @class */ (function (_super) {
111
126
  _this.swipeFn(evt);
112
127
  EventHandler.remove(_this.element, Browser.touchCancelEvent, _this.cancelEvent);
113
128
  };
129
+ /**
130
+ *
131
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
132
+ * @returns {void} ?
133
+ */
114
134
  _this.endEvent = function (evt) {
115
135
  _this.swipeFn(evt);
116
136
  if (!_this.isTouchMoved) {
@@ -123,6 +143,11 @@ var Touch = /** @class */ (function (_super) {
123
143
  }
124
144
  _this.modeclear();
125
145
  };
146
+ /**
147
+ *
148
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
149
+ * @returns {void} ?
150
+ */
126
151
  _this.swipeFn = function (evt) {
127
152
  clearTimeout(_this.timeOutTapHold);
128
153
  clearTimeout(_this.timeOutTap);
@@ -132,11 +157,6 @@ var Touch = /** @class */ (function (_super) {
132
157
  diffX = Math.floor(diffX < 0 ? -1 * diffX : diffX);
133
158
  diffY = Math.floor(diffY < 0 ? -1 * diffY : diffX);
134
159
  _this.isTouchMoved = diffX > 1 || diffY > 1;
135
- // tslint:disable-next-line:no-any
136
- var isFirefox = (/Mozilla|Firefox/).test(Browser.userAgent);
137
- if (isFirefox && point.clientX === 0 && point.clientY === 0 && evt.type === 'mouseup') {
138
- _this.isTouchMoved = false;
139
- }
140
160
  _this.endPoint = point;
141
161
  _this.calcPoints(evt);
142
162
  var swipeArgs = {
@@ -150,6 +170,7 @@ var Touch = /** @class */ (function (_super) {
150
170
  if (_this.isTouchMoved) {
151
171
  var eSwipeArgs = void 0;
152
172
  var tDistance = _this.swipeSettings.swipeThresholdDistance;
173
+ // eslint-disable-next-line
153
174
  eSwipeArgs = extend(eSwipeArgs, _this.defaultArgs, swipeArgs);
154
175
  var canTrigger = false;
155
176
  var ele = _this.element;
@@ -181,12 +202,15 @@ var Touch = /** @class */ (function (_super) {
181
202
  _this.bind();
182
203
  return _this;
183
204
  }
184
- // triggers when property changed
205
+ // triggers when property changed
185
206
  /**
207
+ *
186
208
  * @private
187
- * @param newProp
188
- * @param oldProp
209
+ * @param {TouchModel} newProp ?
210
+ * @param {TouchModel} oldProp ?
211
+ * @returns {void} ?
189
212
  */
213
+ // eslint-disable-next-line
190
214
  Touch.prototype.onPropertyChanged = function (newProp, oldProp) {
191
215
  //No Code to handle
192
216
  };
@@ -198,7 +222,8 @@ var Touch = /** @class */ (function (_super) {
198
222
  };
199
223
  /**
200
224
  * To destroy the touch instance.
201
- * @return {void}
225
+ *
226
+ * @returns {void}
202
227
  */
203
228
  Touch.prototype.destroy = function () {
204
229
  this.unwireEvents();
@@ -213,7 +238,8 @@ var Touch = /** @class */ (function (_super) {
213
238
  };
214
239
  /**
215
240
  * Returns module name as touch
216
- * @returns {string}
241
+ *
242
+ * @returns {string} ?
217
243
  * @private
218
244
  */
219
245
  Touch.prototype.getModuleName = function () {
@@ -221,8 +247,9 @@ var Touch = /** @class */ (function (_super) {
221
247
  };
222
248
  /**
223
249
  * Returns if the HTML element is Scrollable.
250
+ *
224
251
  * @param {HTMLElement} element - HTML Element to check if Scrollable.
225
- * @returns {boolean}
252
+ * @returns {boolean} ?
226
253
  */
227
254
  Touch.prototype.isScrollable = function (element) {
228
255
  var eleStyle = getComputedStyle(element);
@@ -232,12 +259,18 @@ var Touch = /** @class */ (function (_super) {
232
259
  }
233
260
  return false;
234
261
  };
262
+ /**
263
+ *
264
+ * @param {MouseEventArgs | TouchEventArgs} evt ?
265
+ * @returns {void} ?
266
+ */
235
267
  Touch.prototype.tapHoldEvent = function (evt) {
236
268
  this.tapCount = 0;
237
269
  this.touchAction = true;
238
270
  var eTapArgs;
239
271
  EventHandler.remove(this.element, Browser.touchMoveEvent, this.moveEvent);
240
272
  EventHandler.remove(this.element, Browser.touchEndEvent, this.endEvent);
273
+ // eslint-disable-next-line
241
274
  eTapArgs = { originalEvent: evt };
242
275
  this.trigger('tapHold', eTapArgs);
243
276
  EventHandler.remove(this.element, Browser.touchCancelEvent, this.cancelEvent);
@@ -277,7 +310,7 @@ var Touch = /** @class */ (function (_super) {
277
310
  var interval = newT - this.tStampStart;
278
311
  return Math.sqrt(xDist * xDist + yDist * yDist) / interval;
279
312
  };
280
- // tslint:disable-next-line:no-any
313
+ // eslint-disable-next-line
281
314
  Touch.prototype.checkSwipe = function (ele, flag) {
282
315
  var keys = ['scroll', 'offset'];
283
316
  var temp = flag ? ['Height', 'Top'] : ['Width', 'Left'];
@@ -288,7 +321,6 @@ var Touch = /** @class */ (function (_super) {
288
321
  (ele[keys[1] + temp[0]] + ele[keys[0] + temp[1]] >= ele[keys[0] + temp[0]]);
289
322
  };
290
323
  Touch.prototype.updateChangeTouches = function (evt) {
291
- // tslint:disable-next-line:max-line-length
292
324
  var point = evt.changedTouches && evt.changedTouches.length !== 0 ? evt.changedTouches[0] : evt;
293
325
  return point;
294
326
  };