@syncfusion/ej2-navigations 21.2.9 → 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 (343) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +9 -0
  3. package/dist/ej2-navigations.min.js +2 -2
  4. package/dist/ej2-navigations.umd.min.js +2 -2
  5. package/dist/ej2-navigations.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-navigations.es2015.js +288 -93
  7. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  8. package/dist/es6/ej2-navigations.es5.js +292 -94
  9. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  10. package/dist/global/ej2-navigations.min.js +2 -2
  11. package/dist/global/ej2-navigations.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +11 -11
  14. package/src/accordion/accordion-model.d.ts +4 -2
  15. package/src/accordion/accordion.d.ts +4 -2
  16. package/src/accordion/accordion.js +1 -1
  17. package/src/breadcrumb/breadcrumb-model.d.ts +4 -2
  18. package/src/breadcrumb/breadcrumb.d.ts +4 -2
  19. package/src/carousel/carousel-model.d.ts +37 -8
  20. package/src/carousel/carousel.d.ts +69 -6
  21. package/src/carousel/carousel.js +287 -89
  22. package/src/common/menu-base-model.d.ts +2 -1
  23. package/src/common/menu-base.d.ts +2 -1
  24. package/src/common/menu-base.js +2 -2
  25. package/src/menu/menu-model.d.ts +3 -2
  26. package/src/menu/menu.d.ts +2 -1
  27. package/src/menu/menu.js +1 -1
  28. package/src/sidebar/sidebar.d.ts +12 -26
  29. package/src/tab/tab-model.d.ts +3 -2
  30. package/src/tab/tab.d.ts +3 -2
  31. package/src/toolbar/toolbar-model.d.ts +3 -1
  32. package/src/toolbar/toolbar.d.ts +3 -1
  33. package/src/treeview/treeview-model.d.ts +4 -1
  34. package/src/treeview/treeview.d.ts +17 -31
  35. package/src/treeview/treeview.js +1 -1
  36. package/styles/accordion/_bootstrap-dark-definition.scss +3 -1
  37. package/styles/accordion/_bootstrap-definition.scss +3 -1
  38. package/styles/accordion/_bootstrap4-definition.scss +2 -0
  39. package/styles/accordion/_bootstrap5-definition.scss +3 -1
  40. package/styles/accordion/_fabric-dark-definition.scss +2 -0
  41. package/styles/accordion/_fabric-definition.scss +2 -0
  42. package/styles/accordion/_fluent-definition.scss +2 -0
  43. package/styles/accordion/_fusionnew-definition.scss +2 -0
  44. package/styles/accordion/_highcontrast-definition.scss +2 -0
  45. package/styles/accordion/_highcontrast-light-definition.scss +2 -0
  46. package/styles/accordion/_layout.scss +9 -0
  47. package/styles/accordion/_material-dark-definition.scss +2 -0
  48. package/styles/accordion/_material-definition.scss +2 -0
  49. package/styles/accordion/_material3-dark-definition.scss +1 -0
  50. package/styles/accordion/_material3-definition.scss +182 -0
  51. package/styles/accordion/_tailwind-definition.scss +2 -0
  52. package/styles/accordion/_theme.scss +9 -0
  53. package/styles/accordion/bootstrap-dark.css +11 -1
  54. package/styles/accordion/bootstrap.css +11 -1
  55. package/styles/accordion/bootstrap4.css +10 -0
  56. package/styles/accordion/bootstrap5-dark.css +11 -1
  57. package/styles/accordion/bootstrap5.css +11 -1
  58. package/styles/accordion/fabric-dark.css +10 -0
  59. package/styles/accordion/fabric.css +10 -0
  60. package/styles/accordion/fluent-dark.css +10 -0
  61. package/styles/accordion/fluent.css +10 -0
  62. package/styles/accordion/highcontrast-light.css +10 -0
  63. package/styles/accordion/highcontrast.css +10 -0
  64. package/styles/accordion/icons/_material3-dark.scss +1 -0
  65. package/styles/accordion/material-dark.css +10 -0
  66. package/styles/accordion/material.css +10 -0
  67. package/styles/accordion/material3-dark.css +596 -0
  68. package/styles/accordion/material3-dark.scss +5 -0
  69. package/styles/accordion/material3.css +652 -0
  70. package/styles/accordion/material3.scss +5 -0
  71. package/styles/accordion/tailwind-dark.css +10 -0
  72. package/styles/accordion/tailwind.css +10 -0
  73. package/styles/appbar/_layout.scss +6 -1
  74. package/styles/appbar/_material3-dark-definition.scss +1 -0
  75. package/styles/appbar/_material3-definition.scss +8 -0
  76. package/styles/appbar/_theme.scss +12 -2
  77. package/styles/appbar/bootstrap-dark.css +7 -3
  78. package/styles/appbar/bootstrap.css +7 -3
  79. package/styles/appbar/bootstrap4.css +7 -3
  80. package/styles/appbar/bootstrap5-dark.css +7 -3
  81. package/styles/appbar/bootstrap5.css +7 -3
  82. package/styles/appbar/fabric-dark.css +7 -3
  83. package/styles/appbar/fabric.css +7 -3
  84. package/styles/appbar/fluent-dark.css +7 -3
  85. package/styles/appbar/fluent.css +7 -3
  86. package/styles/appbar/highcontrast-light.css +7 -3
  87. package/styles/appbar/highcontrast.css +7 -3
  88. package/styles/appbar/material-dark.css +7 -3
  89. package/styles/appbar/material.css +7 -3
  90. package/styles/appbar/material3-dark.css +307 -0
  91. package/styles/appbar/material3-dark.scss +4 -0
  92. package/styles/appbar/material3.css +363 -0
  93. package/styles/appbar/material3.scss +4 -0
  94. package/styles/appbar/tailwind-dark.css +7 -3
  95. package/styles/appbar/tailwind.css +7 -3
  96. package/styles/bootstrap-dark.css +185 -126
  97. package/styles/bootstrap.css +185 -126
  98. package/styles/bootstrap4.css +183 -124
  99. package/styles/bootstrap5-dark.css +179 -120
  100. package/styles/bootstrap5.css +179 -120
  101. package/styles/breadcrumb/_material3-dark-definition.scss +1 -0
  102. package/styles/breadcrumb/_material3-definition.scss +60 -0
  103. package/styles/breadcrumb/_theme.scss +13 -11
  104. package/styles/breadcrumb/bootstrap-dark.css +9 -9
  105. package/styles/breadcrumb/bootstrap.css +9 -9
  106. package/styles/breadcrumb/bootstrap4.css +9 -9
  107. package/styles/breadcrumb/bootstrap5-dark.css +8 -8
  108. package/styles/breadcrumb/bootstrap5.css +8 -8
  109. package/styles/breadcrumb/fabric-dark.css +7 -7
  110. package/styles/breadcrumb/fabric.css +7 -7
  111. package/styles/breadcrumb/fluent-dark.css +5 -5
  112. package/styles/breadcrumb/fluent.css +5 -5
  113. package/styles/breadcrumb/highcontrast-light.css +7 -7
  114. package/styles/breadcrumb/highcontrast.css +7 -7
  115. package/styles/breadcrumb/icons/_material3-dark.scss +1 -0
  116. package/styles/breadcrumb/icons/_material3.scss +0 -11
  117. package/styles/breadcrumb/material-dark.css +9 -9
  118. package/styles/breadcrumb/material.css +9 -9
  119. package/styles/breadcrumb/material3-dark.css +424 -0
  120. package/styles/breadcrumb/material3-dark.scss +5 -0
  121. package/styles/breadcrumb/material3.css +480 -0
  122. package/styles/breadcrumb/material3.scss +5 -0
  123. package/styles/breadcrumb/tailwind-dark.css +8 -8
  124. package/styles/breadcrumb/tailwind.css +8 -8
  125. package/styles/carousel/_bootstrap-dark-definition.scss +5 -0
  126. package/styles/carousel/_bootstrap-definition.scss +5 -0
  127. package/styles/carousel/_bootstrap4-definition.scss +5 -0
  128. package/styles/carousel/_bootstrap5-definition.scss +5 -0
  129. package/styles/carousel/_fabric-dark-definition.scss +5 -0
  130. package/styles/carousel/_fabric-definition.scss +5 -0
  131. package/styles/carousel/_fluent-definition.scss +5 -0
  132. package/styles/carousel/_fusionnew-definition.scss +5 -0
  133. package/styles/carousel/_highcontrast-definition.scss +5 -0
  134. package/styles/carousel/_highcontrast-light-definition.scss +5 -0
  135. package/styles/carousel/_layout.scss +96 -67
  136. package/styles/carousel/_material-dark-definition.scss +5 -0
  137. package/styles/carousel/_material-definition.scss +5 -0
  138. package/styles/carousel/_material3-dark-definition.scss +1 -0
  139. package/styles/carousel/_material3-definition.scss +28 -0
  140. package/styles/carousel/_tailwind-definition.scss +5 -0
  141. package/styles/carousel/_theme.scss +49 -20
  142. package/styles/carousel/bootstrap-dark.css +101 -62
  143. package/styles/carousel/bootstrap.css +101 -62
  144. package/styles/carousel/bootstrap4.css +101 -62
  145. package/styles/carousel/bootstrap5-dark.css +101 -62
  146. package/styles/carousel/bootstrap5.css +101 -62
  147. package/styles/carousel/fabric-dark.css +101 -62
  148. package/styles/carousel/fabric.css +101 -62
  149. package/styles/carousel/fluent-dark.css +101 -62
  150. package/styles/carousel/fluent.css +101 -62
  151. package/styles/carousel/highcontrast-light.css +101 -62
  152. package/styles/carousel/highcontrast.css +101 -62
  153. package/styles/carousel/icons/_material3-dark.scss +1 -0
  154. package/styles/carousel/material-dark.css +101 -62
  155. package/styles/carousel/material.css +101 -62
  156. package/styles/carousel/material3-dark.css +359 -0
  157. package/styles/carousel/material3-dark.scss +6 -0
  158. package/styles/carousel/material3.css +415 -0
  159. package/styles/carousel/material3.scss +6 -0
  160. package/styles/carousel/tailwind-dark.css +101 -62
  161. package/styles/carousel/tailwind.css +101 -62
  162. package/styles/context-menu/_layout.scss +2 -2
  163. package/styles/context-menu/_material3-dark-definition.scss +1 -0
  164. package/styles/context-menu/_material3-definition.scss +52 -0
  165. package/styles/context-menu/_theme.scss +6 -1
  166. package/styles/context-menu/icons/_material3-dark.scss +1 -0
  167. package/styles/context-menu/material3-dark.css +435 -0
  168. package/styles/context-menu/material3-dark.scss +8 -0
  169. package/styles/context-menu/material3.css +491 -0
  170. package/styles/context-menu/material3.scss +8 -0
  171. package/styles/fabric-dark.css +186 -127
  172. package/styles/fabric.css +185 -126
  173. package/styles/fluent-dark.css +179 -120
  174. package/styles/fluent.css +179 -120
  175. package/styles/h-scroll/_material3-dark-definition.scss +1 -0
  176. package/styles/h-scroll/_material3-definition.scss +83 -0
  177. package/styles/h-scroll/icons/_material3-dark.scss +1 -0
  178. package/styles/h-scroll/material3-dark.css +336 -0
  179. package/styles/h-scroll/material3-dark.scss +5 -0
  180. package/styles/h-scroll/material3.css +392 -0
  181. package/styles/h-scroll/material3.scss +5 -0
  182. package/styles/highcontrast-light.css +178 -119
  183. package/styles/highcontrast.css +182 -123
  184. package/styles/material-dark.css +189 -130
  185. package/styles/material.css +188 -129
  186. package/styles/material3-dark.css +10343 -0
  187. package/styles/material3-dark.scss +15 -0
  188. package/styles/material3.css +10399 -0
  189. package/styles/material3.scss +15 -0
  190. package/styles/menu/_layout.scss +7 -0
  191. package/styles/menu/_material3-dark-definition.scss +1 -0
  192. package/styles/menu/_material3-definition.scss +67 -0
  193. package/styles/menu/_theme.scss +5 -2
  194. package/styles/menu/bootstrap-dark.css +4 -0
  195. package/styles/menu/bootstrap.css +4 -0
  196. package/styles/menu/bootstrap4.css +4 -0
  197. package/styles/menu/bootstrap5-dark.css +4 -0
  198. package/styles/menu/bootstrap5.css +4 -0
  199. package/styles/menu/fabric-dark.css +4 -0
  200. package/styles/menu/fabric.css +4 -0
  201. package/styles/menu/fluent-dark.css +4 -0
  202. package/styles/menu/fluent.css +4 -0
  203. package/styles/menu/highcontrast-light.css +4 -0
  204. package/styles/menu/highcontrast.css +4 -0
  205. package/styles/menu/icons/_material3-dark.scss +1 -0
  206. package/styles/menu/material-dark.css +4 -0
  207. package/styles/menu/material.css +4 -0
  208. package/styles/menu/material3-dark.css +1162 -0
  209. package/styles/menu/material3-dark.scss +9 -0
  210. package/styles/menu/material3.css +1218 -0
  211. package/styles/menu/material3.scss +9 -0
  212. package/styles/menu/tailwind-dark.css +4 -0
  213. package/styles/menu/tailwind.css +4 -0
  214. package/styles/pager/_bootstrap-dark-definition.scss +9 -5
  215. package/styles/pager/_bootstrap-definition.scss +9 -5
  216. package/styles/pager/_bootstrap4-definition.scss +8 -4
  217. package/styles/pager/_bootstrap5-definition.scss +4 -0
  218. package/styles/pager/_fabric-dark-definition.scss +10 -6
  219. package/styles/pager/_fabric-definition.scss +10 -6
  220. package/styles/pager/_fluent-definition.scss +8 -4
  221. package/styles/pager/_fusionnew-definition.scss +4 -0
  222. package/styles/pager/_highcontrast-definition.scss +8 -4
  223. package/styles/pager/_highcontrast-light-definition.scss +4 -0
  224. package/styles/pager/_layout.scss +63 -48
  225. package/styles/pager/_material-dark-definition.scss +12 -8
  226. package/styles/pager/_material-definition.scss +11 -7
  227. package/styles/pager/_material3-dark-definition.scss +1 -0
  228. package/styles/pager/_material3-definition.scss +150 -0
  229. package/styles/pager/_tailwind-definition.scss +9 -5
  230. package/styles/pager/_theme.scss +12 -5
  231. package/styles/pager/bootstrap-dark.css +15 -43
  232. package/styles/pager/bootstrap.css +15 -43
  233. package/styles/pager/bootstrap4.css +14 -42
  234. package/styles/pager/bootstrap5-dark.css +10 -38
  235. package/styles/pager/bootstrap5.css +10 -38
  236. package/styles/pager/fabric-dark.css +17 -45
  237. package/styles/pager/fabric.css +16 -44
  238. package/styles/pager/fluent-dark.css +14 -42
  239. package/styles/pager/fluent.css +14 -42
  240. package/styles/pager/highcontrast-light.css +10 -38
  241. package/styles/pager/highcontrast.css +14 -42
  242. package/styles/pager/icons/_material3-dark.scss +1 -0
  243. package/styles/pager/icons/_material3.scss +4 -4
  244. package/styles/pager/material-dark.css +18 -46
  245. package/styles/pager/material.css +17 -45
  246. package/styles/pager/material3-dark.css +765 -0
  247. package/styles/pager/material3-dark.scss +5 -0
  248. package/styles/pager/material3.css +821 -0
  249. package/styles/pager/material3.scss +5 -0
  250. package/styles/pager/tailwind-dark.css +15 -43
  251. package/styles/pager/tailwind.css +15 -43
  252. package/styles/sidebar/_material3-dark-definition.scss +1 -0
  253. package/styles/sidebar/_material3-definition.scss +7 -0
  254. package/styles/sidebar/material3-dark.css +204 -0
  255. package/styles/sidebar/material3-dark.scss +4 -0
  256. package/styles/sidebar/material3.css +260 -0
  257. package/styles/sidebar/material3.scss +4 -0
  258. package/styles/tab/_bootstrap-dark-definition.scss +4 -0
  259. package/styles/tab/_bootstrap-definition.scss +4 -0
  260. package/styles/tab/_bootstrap4-definition.scss +4 -0
  261. package/styles/tab/_bootstrap5-definition.scss +4 -0
  262. package/styles/tab/_fabric-dark-definition.scss +4 -0
  263. package/styles/tab/_fabric-definition.scss +4 -0
  264. package/styles/tab/_fluent-definition.scss +4 -0
  265. package/styles/tab/_fusionnew-definition.scss +4 -0
  266. package/styles/tab/_highcontrast-definition.scss +4 -0
  267. package/styles/tab/_highcontrast-light-definition.scss +4 -0
  268. package/styles/tab/_layout.scss +37 -13
  269. package/styles/tab/_material-dark-definition.scss +4 -0
  270. package/styles/tab/_material-definition.scss +4 -0
  271. package/styles/tab/_material3-dark-definition.scss +1 -0
  272. package/styles/tab/_material3-definition.scss +661 -0
  273. package/styles/tab/_tailwind-definition.scss +4 -0
  274. package/styles/tab/_theme.scss +44 -1
  275. package/styles/tab/bootstrap-dark.css +30 -7
  276. package/styles/tab/bootstrap.css +30 -7
  277. package/styles/tab/bootstrap4.css +30 -7
  278. package/styles/tab/bootstrap5-dark.css +30 -7
  279. package/styles/tab/bootstrap5.css +30 -7
  280. package/styles/tab/fabric-dark.css +30 -7
  281. package/styles/tab/fabric.css +30 -7
  282. package/styles/tab/fluent-dark.css +30 -7
  283. package/styles/tab/fluent.css +30 -7
  284. package/styles/tab/highcontrast-light.css +30 -7
  285. package/styles/tab/highcontrast.css +30 -7
  286. package/styles/tab/icons/_material3-dark.scss +1 -0
  287. package/styles/tab/material-dark.css +30 -7
  288. package/styles/tab/material.css +30 -7
  289. package/styles/tab/material3-dark.css +4109 -0
  290. package/styles/tab/material3-dark.scss +6 -0
  291. package/styles/tab/material3.css +4165 -0
  292. package/styles/tab/material3.scss +6 -0
  293. package/styles/tab/tailwind-dark.css +29 -6
  294. package/styles/tab/tailwind.css +29 -6
  295. package/styles/tailwind-dark.css +185 -126
  296. package/styles/tailwind.css +185 -126
  297. package/styles/toolbar/_fabric-dark-definition.scss +3 -3
  298. package/styles/toolbar/_fabric-definition.scss +3 -3
  299. package/styles/toolbar/_highcontrast-definition.scss +1 -1
  300. package/styles/toolbar/_highcontrast-light-definition.scss +1 -1
  301. package/styles/toolbar/_layout.scss +8 -0
  302. package/styles/toolbar/_material-dark-definition.scss +3 -3
  303. package/styles/toolbar/_material-definition.scss +3 -3
  304. package/styles/toolbar/_material3-dark-definition.scss +1 -0
  305. package/styles/toolbar/_material3-definition.scss +220 -0
  306. package/styles/toolbar/_tailwind-definition.scss +3 -3
  307. package/styles/toolbar/_theme.scss +2 -1
  308. package/styles/toolbar/bootstrap-dark.css +8 -1
  309. package/styles/toolbar/bootstrap.css +8 -1
  310. package/styles/toolbar/bootstrap4.css +8 -1
  311. package/styles/toolbar/bootstrap5-dark.css +8 -1
  312. package/styles/toolbar/bootstrap5.css +8 -1
  313. package/styles/toolbar/fabric-dark.css +10 -3
  314. package/styles/toolbar/fabric.css +10 -3
  315. package/styles/toolbar/fluent-dark.css +8 -1
  316. package/styles/toolbar/fluent.css +8 -1
  317. package/styles/toolbar/highcontrast-light.css +9 -2
  318. package/styles/toolbar/highcontrast.css +9 -2
  319. package/styles/toolbar/icons/_material3-dark.scss +1 -0
  320. package/styles/toolbar/material-dark.css +10 -3
  321. package/styles/toolbar/material.css +10 -3
  322. package/styles/toolbar/material3-dark.css +1145 -0
  323. package/styles/toolbar/material3-dark.scss +9 -0
  324. package/styles/toolbar/material3.css +1201 -0
  325. package/styles/toolbar/material3.scss +9 -0
  326. package/styles/toolbar/tailwind-dark.css +11 -4
  327. package/styles/toolbar/tailwind.css +11 -4
  328. package/styles/treeview/_layout.scss +15 -2
  329. package/styles/treeview/_material3-dark-definition.scss +1 -0
  330. package/styles/treeview/_material3-definition.scss +121 -0
  331. package/styles/treeview/icons/_material3-dark.scss +1 -0
  332. package/styles/treeview/icons/_material3.scss +1 -1
  333. package/styles/treeview/material3-dark.css +903 -0
  334. package/styles/treeview/material3-dark.scss +7 -0
  335. package/styles/treeview/material3.css +959 -0
  336. package/styles/treeview/material3.scss +7 -0
  337. package/styles/v-scroll/_material3-dark-definition.scss +1 -0
  338. package/styles/v-scroll/_material3-definition.scss +49 -0
  339. package/styles/v-scroll/icons/_material3-dark.scss +1 -0
  340. package/styles/v-scroll/material3-dark.css +258 -0
  341. package/styles/v-scroll/material3-dark.scss +5 -0
  342. package/styles/v-scroll/material3.css +314 -0
  343. package/styles/v-scroll/material3.scss +5 -0
@@ -1458,6 +1458,7 @@ let MenuBase = class MenuBase extends Component {
1458
1458
  }
1459
1459
  getUlByNavIdx(navIdxLen = this.navIdx.length) {
1460
1460
  if (this.isMenu) {
1461
+ let popup = [this.getWrapper()].concat([].slice.call(selectAll('.' + POPUP)))[navIdxLen];
1461
1462
  const popups = [];
1462
1463
  const allPopup = selectAll('.' + POPUP);
1463
1464
  allPopup.forEach((elem) => {
@@ -1465,7 +1466,7 @@ let MenuBase = class MenuBase extends Component {
1465
1466
  popups.push(elem);
1466
1467
  }
1467
1468
  });
1468
- const popup = [this.getWrapper()].concat([].slice.call(popups))[navIdxLen];
1469
+ popup = [this.getWrapper()].concat([].slice.call(popups))[navIdxLen];
1469
1470
  return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
1470
1471
  }
1471
1472
  else {
@@ -1833,7 +1834,6 @@ let MenuBase = class MenuBase extends Component {
1833
1834
  }
1834
1835
  }
1835
1836
  }
1836
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1837
1837
  copyObject(source, destination) {
1838
1838
  for (const prop in source) {
1839
1839
  destination[`${prop}`] = source[`${prop}`];
@@ -5778,7 +5778,7 @@ let Accordion = class Accordion extends Component {
5778
5778
  templateParser(template) {
5779
5779
  if (template) {
5780
5780
  try {
5781
- if (document.querySelectorAll(template).length) {
5781
+ if (typeof template !== 'function' && document.querySelectorAll(template).length) {
5782
5782
  return compile(document.querySelector(template).innerHTML.trim());
5783
5783
  }
5784
5784
  else {
@@ -7067,7 +7067,7 @@ let Menu = class Menu extends MenuBase {
7067
7067
  this.element.id = this.element.id || getUniqueID('ej2-menu');
7068
7068
  if (this.template) {
7069
7069
  try {
7070
- if (document.querySelectorAll(this.template).length) {
7070
+ if (typeof this.template !== 'function' && document.querySelectorAll(this.template).length) {
7071
7071
  this.template = document.querySelector(this.template).innerHTML.trim();
7072
7072
  this.clearChanges();
7073
7073
  }
@@ -9990,7 +9990,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
9990
9990
  // eslint-disable-next-line
9991
9991
  this.element.classList.add(INTERACTION);
9992
9992
  try {
9993
- if (document.querySelectorAll(template).length) {
9993
+ if (typeof template !== 'function' && document.querySelectorAll(template).length) {
9994
9994
  return compile(document.querySelector(template).innerHTML.trim());
9995
9995
  }
9996
9996
  else {
@@ -16250,6 +16250,7 @@ const CLS_CAROUSEL = 'e-carousel';
16250
16250
  const CLS_ACTIVE$2 = 'e-active';
16251
16251
  const CLS_RTL$5 = 'e-rtl';
16252
16252
  const CLS_PARTIAL = 'e-partial';
16253
+ const CLS_SWIPE = 'e-swipe';
16253
16254
  const CLS_SLIDE_CONTAINER = 'e-carousel-slide-container';
16254
16255
  const CLS_ITEMS$2 = 'e-carousel-items';
16255
16256
  const CLS_CLONED = 'e-cloned';
@@ -16283,6 +16284,19 @@ const CLS_PREV_SLIDE = 'e-prev';
16283
16284
  const CLS_NEXT_SLIDE = 'e-next';
16284
16285
  const CLS_TRANSITION_START = 'e-transition-start';
16285
16286
  const CLS_TRANSITION_END = 'e-transition-end';
16287
+ /**
16288
+ * Specifies the action (touch & mouse) which enables the slide swiping action in carousel.
16289
+ * * Touch - Enables or disables the swiping action in touch interaction.
16290
+ * * Mouse - Enables or disables the swiping action in mouse interaction.
16291
+ * @aspNumberEnum
16292
+ */
16293
+ var CarouselSwipeMode;
16294
+ (function (CarouselSwipeMode) {
16295
+ /** Enables or disables the swiping action in touch interaction. */
16296
+ CarouselSwipeMode[CarouselSwipeMode["Touch"] = 1] = "Touch";
16297
+ /** Enables or disables the swiping action in mouse interaction. */
16298
+ CarouselSwipeMode[CarouselSwipeMode["Mouse"] = 2] = "Mouse";
16299
+ })(CarouselSwipeMode || (CarouselSwipeMode = {}));
16286
16300
  /** Specifies the carousel individual item. */
16287
16301
  class CarouselItem extends ChildProperty {
16288
16302
  }
@@ -16307,6 +16321,7 @@ let Carousel = class Carousel extends Component {
16307
16321
  */
16308
16322
  constructor(options, element) {
16309
16323
  super(options, element);
16324
+ this.isSwipe = false;
16310
16325
  }
16311
16326
  getModuleName() {
16312
16327
  return CLS_CAROUSEL.replace('e-', '');
@@ -16377,7 +16392,7 @@ let Carousel = class Carousel extends Component {
16377
16392
  this.applySlideInterval();
16378
16393
  }
16379
16394
  this.handleNavigatorsActions(this.selectedIndex);
16380
- if (this.partialVisible) {
16395
+ if (this.partialVisible || !(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
16381
16396
  this.reRenderSlides();
16382
16397
  }
16383
16398
  break;
@@ -16391,11 +16406,10 @@ let Carousel = class Carousel extends Component {
16391
16406
  else {
16392
16407
  removeClass(rtlElement, CLS_RTL$5);
16393
16408
  }
16394
- if (this.partialVisible) {
16395
- const itemsContainer = this.element.querySelector(`.${CLS_ITEMS$2}`);
16396
- const cloneCount = this.loop ? 2 : 0;
16397
- const slideWidth = itemsContainer.firstElementChild.clientWidth;
16398
- itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
16409
+ if (this.partialVisible || !(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
16410
+ const cloneCount = this.loop ? this.getNumOfItems() : 0;
16411
+ const slideWidth = this.itemsContainer.firstElementChild.clientWidth;
16412
+ this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
16399
16413
  }
16400
16414
  break;
16401
16415
  case 'buttonsVisibility':
@@ -16435,8 +16449,9 @@ let Carousel = class Carousel extends Component {
16435
16449
  this.autoSlide();
16436
16450
  break;
16437
16451
  case 'showIndicators':
16452
+ case 'indicatorsType':
16438
16453
  target = this.element.querySelector(`.${CLS_INDICATORS}`);
16439
- if (!this.showIndicators && target) {
16454
+ if (target) {
16440
16455
  this.resetTemplates(['indicatorsTemplate']);
16441
16456
  remove(target);
16442
16457
  }
@@ -16463,6 +16478,13 @@ let Carousel = class Carousel extends Component {
16463
16478
  }
16464
16479
  this.reRenderSlides();
16465
16480
  break;
16481
+ case 'swipeMode':
16482
+ EventHandler.remove(this.element, 'mousedown touchstart', this.swipeStart);
16483
+ EventHandler.remove(this.element, 'mousemove touchmove', this.swiping);
16484
+ EventHandler.remove(this.element, 'mouseup touchend', this.swipStop);
16485
+ this.swipeModehandlers();
16486
+ this.reRenderSlides();
16487
+ break;
16466
16488
  }
16467
16489
  }
16468
16490
  }
@@ -16485,6 +16507,9 @@ let Carousel = class Carousel extends Component {
16485
16507
  if (this.partialVisible) {
16486
16508
  carouselClasses.push(CLS_PARTIAL);
16487
16509
  }
16510
+ if (!(this.swipeMode === (~CarouselSwipeMode.Touch & ~CarouselSwipeMode.Mouse))) {
16511
+ carouselClasses.push(CLS_SWIPE);
16512
+ }
16488
16513
  addClass([this.element], carouselClasses);
16489
16514
  setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
16490
16515
  attributes(this.element, { 'tabindex': '0', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
@@ -16498,52 +16523,52 @@ let Carousel = class Carousel extends Component {
16498
16523
  slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER });
16499
16524
  this.element.appendChild(slideContainer);
16500
16525
  }
16501
- const itemsContainer = this.createElement('div', { className: CLS_ITEMS$2, attrs: { 'aria-live': this.autoPlay ? 'off' : 'polite' } });
16502
- slideContainer.appendChild(itemsContainer);
16503
- if (this.partialVisible && this.loop) {
16526
+ this.itemsContainer = this.createElement('div', { className: CLS_ITEMS$2, attrs: { 'aria-live': this.autoPlay ? 'off' : 'polite' } });
16527
+ slideContainer.appendChild(this.itemsContainer);
16528
+ const numOfItems = this.getNumOfItems();
16529
+ if (numOfItems > 0 && this.loop) {
16504
16530
  if (this.items.length > 0) {
16505
- this.items.slice(-2).forEach((item, index) => {
16506
- this.renderSlide(item, item.template, index, itemsContainer, true);
16531
+ this.items.slice(-numOfItems).forEach((item, index) => {
16532
+ this.renderSlide(item, item.template, index, this.itemsContainer, true);
16507
16533
  });
16508
16534
  }
16509
16535
  else if (this.dataSource.length > 0) {
16510
- this.dataSource.slice(-2).forEach((item, index) => {
16511
- this.renderSlide(item, this.itemTemplate, index, itemsContainer, true);
16536
+ this.dataSource.slice(-numOfItems).forEach((item, index) => {
16537
+ this.renderSlide(item, this.itemTemplate, index, this.itemsContainer, true);
16512
16538
  });
16513
16539
  }
16514
16540
  }
16515
16541
  if (this.items.length > 0) {
16516
16542
  this.slideItems = this.items;
16517
16543
  this.items.forEach((item, index) => {
16518
- this.renderSlide(item, item.template, index, itemsContainer);
16544
+ this.renderSlide(item, item.template, index, this.itemsContainer);
16519
16545
  });
16520
16546
  }
16521
16547
  else if (this.dataSource.length > 0) {
16522
16548
  this.slideItems = this.dataSource;
16523
16549
  this.dataSource.forEach((item, index) => {
16524
- this.renderSlide(item, this.itemTemplate, index, itemsContainer);
16550
+ this.renderSlide(item, this.itemTemplate, index, this.itemsContainer);
16525
16551
  });
16526
16552
  }
16527
- if (this.partialVisible && this.loop) {
16553
+ if (numOfItems > 0 && this.loop) {
16528
16554
  if (this.items.length > 0) {
16529
- this.items.slice(0, 2).forEach((item, index) => {
16530
- this.renderSlide(item, item.template, index, itemsContainer, true);
16555
+ this.items.slice(0, numOfItems).forEach((item, index) => {
16556
+ this.renderSlide(item, item.template, index, this.itemsContainer, true);
16531
16557
  });
16532
16558
  }
16533
16559
  else if (this.dataSource.length > 0) {
16534
- this.dataSource.slice(0, 2).forEach((item, index) => {
16535
- this.renderSlide(item, this.itemTemplate, index, itemsContainer, true);
16560
+ this.dataSource.slice(0, numOfItems).forEach((item, index) => {
16561
+ this.renderSlide(item, this.itemTemplate, index, this.itemsContainer, true);
16536
16562
  });
16537
16563
  }
16538
16564
  }
16539
16565
  this.renderTemplates();
16540
- if (this.partialVisible) {
16541
- itemsContainer.style.setProperty('--carousel-items-count', `${itemsContainer.children.length}`);
16542
- const slideWidth = itemsContainer.firstElementChild.clientWidth;
16543
- const cloneCount = this.loop ? 2 : 0;
16544
- itemsContainer.style.transitionProperty = 'none';
16545
- itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
16546
- }
16566
+ this.itemsContainer.style.setProperty('--carousel-items-count', `${this.itemsContainer.children.length}`);
16567
+ const slideWidth = isNullOrUndefined(this.itemsContainer.firstElementChild) ? 0 :
16568
+ this.itemsContainer.firstElementChild.clientWidth;
16569
+ this.itemsContainer.style.transitionProperty = 'none';
16570
+ const cloneCount = this.loop ? numOfItems : 0;
16571
+ this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + cloneCount);
16547
16572
  this.autoSlide();
16548
16573
  this.renderTouchActions();
16549
16574
  this.renderKeyboardActions();
@@ -16644,8 +16669,7 @@ let Carousel = class Carousel extends Component {
16644
16669
  if (isLastSlide) {
16645
16670
  this.setProperties({ autoPlay: false }, true);
16646
16671
  playButton.setAttribute('aria-label', this.localeObj.getConstant('playSlideTransition'));
16647
- const itemsContainer = this.element.querySelector(`.${CLS_ITEMS$2}`);
16648
- itemsContainer.setAttribute('aria-live', 'polite');
16672
+ this.itemsContainer.setAttribute('aria-live', 'polite');
16649
16673
  }
16650
16674
  buttonObj.appendTo(playButton);
16651
16675
  playPauseWrap.appendChild(playButton);
@@ -16659,34 +16683,69 @@ let Carousel = class Carousel extends Component {
16659
16683
  if (!this.showIndicators) {
16660
16684
  return;
16661
16685
  }
16662
- const indicatorWrap = this.createElement('div', { className: CLS_INDICATORS });
16686
+ let indicatorClass = 'e-default';
16687
+ if (!this.indicatorsTemplate) {
16688
+ indicatorClass = `e-${this.indicatorsType.toLowerCase()}`;
16689
+ }
16690
+ const indicatorWrap = this.createElement('div', { className: `${CLS_INDICATORS} ${indicatorClass}` });
16663
16691
  const indicatorBars = this.createElement('div', { className: CLS_INDICATOR_BARS });
16664
16692
  indicatorWrap.appendChild(indicatorBars);
16693
+ let progress;
16665
16694
  if (this.slideItems) {
16666
- this.slideItems.forEach((item, index) => {
16667
- const indicatorBar = this.createElement('div', {
16668
- className: CLS_INDICATOR_BAR + ' ' + (this.selectedIndex === index ? CLS_ACTIVE$2 : ''),
16669
- attrs: { 'data-index': index.toString(), 'aria-current': this.selectedIndex === index ? 'true' : 'false' }
16670
- });
16671
- if (this.indicatorsTemplate) {
16672
- addClass([indicatorBar], CLS_TEMPLATE$2);
16673
- const templateId = this.element.id + '_indicatorsTemplate';
16674
- const template = this.templateParser(this.indicatorsTemplate)({ index: index, selectedIndex: this.selectedIndex }, this, 'indicatorsTemplate', templateId, false);
16675
- append(template, indicatorBar);
16676
- }
16677
- else {
16678
- const indicator = this.createElement('button', { className: CLS_INDICATOR$1, attrs: { 'type': 'button', 'aria-label': this.localeObj.getConstant('slide') + ' ' + (index + 1) + ' ' + this.localeObj.getConstant('of') + ' ' + this.slideItems.length } });
16679
- indicatorBar.appendChild(indicator);
16680
- indicator.appendChild(this.createElement('div', {}));
16681
- const buttonObj = new Button({ cssClass: 'e-flat e-small' });
16682
- buttonObj.appendTo(indicator);
16683
- }
16684
- indicatorBars.appendChild(indicatorBar);
16685
- EventHandler.add(indicatorBar, 'click', this.indicatorClickHandler, this);
16686
- });
16695
+ switch (this.indicatorsType) {
16696
+ case 'Fraction':
16697
+ if (this.indicatorsTemplate) {
16698
+ this.renderIndicatorTemplate(indicatorBars, this.selectedIndex + 1);
16699
+ }
16700
+ else {
16701
+ indicatorBars.innerText = `${this.selectedIndex + 1} / ${this.slideItems.length}`;
16702
+ }
16703
+ break;
16704
+ case 'Progress':
16705
+ if (this.indicatorsTemplate) {
16706
+ this.renderIndicatorTemplate(indicatorBars, this.selectedIndex + 1);
16707
+ }
16708
+ else {
16709
+ progress = this.createElement('div', { className: CLS_INDICATOR_BAR });
16710
+ progress.style.setProperty('--carousel-items-current', `${this.selectedIndex + 1}`);
16711
+ progress.style.setProperty('--carousel-items-count', `${this.slideItems.length}`);
16712
+ indicatorBars.appendChild(progress);
16713
+ }
16714
+ break;
16715
+ case 'Default':
16716
+ case 'Dynamic':
16717
+ this.slideItems.forEach((item, index) => {
16718
+ const indicatorBar = this.createElement('div', {
16719
+ className: CLS_INDICATOR_BAR + ' ' + (this.selectedIndex === index ? CLS_ACTIVE$2 : this.selectedIndex - 1 === index ? CLS_PREV_SLIDE : this.selectedIndex + 1 === index ? CLS_NEXT_SLIDE : ''),
16720
+ attrs: { 'data-index': index.toString(), 'aria-current': this.selectedIndex === index ? 'true' : 'false' }
16721
+ });
16722
+ indicatorBar.style.setProperty('--carousel-items-current', `${this.selectedIndex}`);
16723
+ if (this.indicatorsTemplate) {
16724
+ this.renderIndicatorTemplate(indicatorBar, index);
16725
+ }
16726
+ else if (this.indicatorsType === 'Default') {
16727
+ const indicator = this.createElement('button', { className: CLS_INDICATOR$1, attrs: { 'type': 'button', 'aria-label': this.localeObj.getConstant('slide') + ' ' + (index + 1) + ' ' + this.localeObj.getConstant('of') + ' ' + this.slideItems.length } });
16728
+ indicatorBar.appendChild(indicator);
16729
+ indicator.appendChild(this.createElement('div', {}));
16730
+ const buttonObj = new Button({ cssClass: 'e-flat e-small' });
16731
+ buttonObj.appendTo(indicator);
16732
+ }
16733
+ indicatorBars.appendChild(indicatorBar);
16734
+ if (this.indicatorsType === 'Default') {
16735
+ EventHandler.add(indicatorBar, 'click', this.indicatorClickHandler, this);
16736
+ }
16737
+ });
16738
+ break;
16739
+ }
16687
16740
  }
16688
16741
  this.element.appendChild(indicatorWrap);
16689
16742
  }
16743
+ renderIndicatorTemplate(indicatorBar, index = 0) {
16744
+ addClass([indicatorBar], CLS_TEMPLATE$2);
16745
+ const templateId = this.element.id + '_indicatorsTemplate';
16746
+ const template = this.templateParser(this.indicatorsTemplate)({ index: index, selectedIndex: this.selectedIndex }, this, 'indicatorsTemplate', templateId, false);
16747
+ append(template, indicatorBar);
16748
+ }
16690
16749
  renderKeyboardActions() {
16691
16750
  this.keyModule = new KeyboardEvents(this.element, { keyAction: this.keyHandler.bind(this), keyConfigs: this.keyConfigs });
16692
16751
  }
@@ -16801,13 +16860,7 @@ let Carousel = class Carousel extends Component {
16801
16860
  this.setProperties({ selectedIndex: currentIndex }, true);
16802
16861
  attributes(args.currentSlide, { 'aria-hidden': 'true' });
16803
16862
  attributes(args.nextSlide, { 'aria-hidden': 'false' });
16804
- const slideIndicators = [].slice.call(this.element.querySelectorAll(`.${CLS_INDICATOR_BAR}`));
16805
- if (slideIndicators.length > 0) {
16806
- attributes(slideIndicators[parseInt(activeIndex.toString(), 10)], { 'aria-current': 'false' });
16807
- attributes(slideIndicators[parseInt(currentIndex.toString(), 10)], { 'aria-current': 'true' });
16808
- removeClass(slideIndicators, CLS_ACTIVE$2);
16809
- addClass([slideIndicators[parseInt(currentIndex.toString(), 10)]], CLS_ACTIVE$2);
16810
- }
16863
+ this.refreshIndicators(activeIndex, currentIndex);
16811
16864
  this.slideChangedEventArgs = {
16812
16865
  currentIndex: args.nextIndex,
16813
16866
  previousIndex: args.currentIndex,
@@ -16816,25 +16869,32 @@ let Carousel = class Carousel extends Component {
16816
16869
  slideDirection: direction,
16817
16870
  isSwiped: isSwiped
16818
16871
  };
16819
- if (this.partialVisible) {
16820
- const container = this.element.querySelector('.' + CLS_ITEMS$2);
16821
- const slideWidth = allSlides[parseInt(currentIndex.toString(), 10)].clientWidth;
16822
- container.style.transitionProperty = 'transform';
16823
- if (this.loop) {
16824
- if (this.slideChangedEventArgs.currentIndex === 0 && this.slideChangedEventArgs.slideDirection === 'Next') {
16825
- container.style.transform = this.getTranslateX(slideWidth, allSlides.length + 2);
16826
- }
16827
- else if (this.slideChangedEventArgs.currentIndex === this.slideItems.length - 1 && this.slideChangedEventArgs.slideDirection === 'Previous') {
16828
- container.style.transform = this.getTranslateX(slideWidth);
16829
- }
16830
- else {
16831
- container.style.transform = this.getTranslateX(slideWidth, currentIndex + 2);
16832
- }
16872
+ const slideWidth = allSlides[parseInt(currentIndex.toString(), 10)].clientWidth;
16873
+ const numOfItems = this.getNumOfItems();
16874
+ if (!this.isSwipe) {
16875
+ this.itemsContainer.style.transitionDuration = '0.6s';
16876
+ }
16877
+ this.isSwipe = false;
16878
+ if ((this.animationEffect === 'Fade')) {
16879
+ this.itemsContainer.classList.add('e-fade-in-out');
16880
+ }
16881
+ else {
16882
+ this.itemsContainer.style.transitionProperty = 'transform';
16883
+ }
16884
+ if (this.loop) {
16885
+ if (this.slideChangedEventArgs.currentIndex === 0 && this.slideChangedEventArgs.slideDirection === 'Next') {
16886
+ this.itemsContainer.style.transform = this.getTranslateX(slideWidth, allSlides.length + numOfItems);
16887
+ }
16888
+ else if (this.slideChangedEventArgs.currentIndex === this.slideItems.length - 1 && this.slideChangedEventArgs.slideDirection === 'Previous') {
16889
+ this.itemsContainer.style.transform = this.partialVisible ? this.getTranslateX(slideWidth) : 'translateX(0px)';
16833
16890
  }
16834
16891
  else {
16835
- container.style.transform = this.getTranslateX(slideWidth, currentIndex);
16892
+ this.itemsContainer.style.transform = this.getTranslateX(slideWidth, currentIndex + numOfItems);
16836
16893
  }
16837
16894
  }
16895
+ else {
16896
+ this.itemsContainer.style.transform = this.getTranslateX(slideWidth, currentIndex);
16897
+ }
16838
16898
  if (this.animationEffect === 'Slide') {
16839
16899
  if (direction === 'Previous') {
16840
16900
  addClass([args.nextSlide], CLS_PREV_SLIDE);
@@ -16868,13 +16928,14 @@ let Carousel = class Carousel extends Component {
16868
16928
  });
16869
16929
  }
16870
16930
  onTransitionEnd() {
16931
+ removeClass(this.element.querySelectorAll(`.${CLS_ITEMS$2}`), 'e-fade-in-out');
16932
+ const numOfItems = this.getNumOfItems();
16871
16933
  if (this.slideChangedEventArgs) {
16872
- if (this.partialVisible && this.loop && (this.slideChangedEventArgs.currentIndex === 0 && this.slideChangedEventArgs.slideDirection === 'Next' ||
16934
+ this.itemsContainer.style.transitionProperty = 'none';
16935
+ if (this.loop && (this.slideChangedEventArgs.currentIndex === 0 && this.slideChangedEventArgs.slideDirection === 'Next' ||
16873
16936
  this.slideChangedEventArgs.currentIndex === this.slideItems.length - 1 && this.slideChangedEventArgs.slideDirection === 'Previous')) {
16874
- const container = this.element.querySelector('.' + CLS_ITEMS$2);
16875
16937
  const slideWidth = this.slideChangedEventArgs.currentSlide.clientWidth;
16876
- container.style.transitionProperty = 'none';
16877
- container.style.transform = this.getTranslateX(slideWidth, this.slideChangedEventArgs.currentIndex + 2);
16938
+ this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.slideChangedEventArgs.currentIndex + numOfItems);
16878
16939
  }
16879
16940
  addClass([this.slideChangedEventArgs.currentSlide], CLS_ACTIVE$2);
16880
16941
  removeClass([this.slideChangedEventArgs.previousSlide], CLS_ACTIVE$2);
@@ -16884,6 +16945,51 @@ let Carousel = class Carousel extends Component {
16884
16945
  });
16885
16946
  }
16886
16947
  }
16948
+ refreshIndicators(activeIndex, currentIndex) {
16949
+ const slideIndicator = this.element.querySelector(`.${CLS_INDICATOR_BARS}`);
16950
+ if (isNullOrUndefined(slideIndicator)) {
16951
+ return;
16952
+ }
16953
+ const indicators = [].slice.call(slideIndicator.childNodes);
16954
+ switch (this.indicatorsType) {
16955
+ case 'Default':
16956
+ case 'Dynamic':
16957
+ attributes(indicators[parseInt(activeIndex.toString(), 10)], { 'aria-current': 'false' });
16958
+ attributes(indicators[parseInt(currentIndex.toString(), 10)], { 'aria-current': 'true' });
16959
+ removeClass(indicators, [CLS_ACTIVE$2, CLS_PREV_SLIDE, CLS_NEXT_SLIDE]);
16960
+ addClass([indicators[parseInt(currentIndex.toString(), 10)]], CLS_ACTIVE$2);
16961
+ if (indicators[currentIndex - 1]) {
16962
+ addClass([indicators[currentIndex - 1]], CLS_PREV_SLIDE);
16963
+ }
16964
+ if (indicators[currentIndex + 1]) {
16965
+ addClass([indicators[currentIndex + 1]], CLS_NEXT_SLIDE);
16966
+ }
16967
+ indicators.forEach((item) => item.style.setProperty('--carousel-items-current', `${this.selectedIndex}`));
16968
+ break;
16969
+ case 'Fraction':
16970
+ if (this.indicatorsTemplate) {
16971
+ if (slideIndicator.children.length > 0) {
16972
+ slideIndicator.removeChild(slideIndicator.firstElementChild);
16973
+ }
16974
+ this.renderIndicatorTemplate(slideIndicator, currentIndex + 1);
16975
+ }
16976
+ else {
16977
+ slideIndicator.innerText = `${this.selectedIndex + 1} / ${this.slideItems.length}`;
16978
+ }
16979
+ break;
16980
+ case 'Progress':
16981
+ if (this.indicatorsTemplate) {
16982
+ if (slideIndicator.children.length > 0) {
16983
+ slideIndicator.removeChild(slideIndicator.firstElementChild);
16984
+ }
16985
+ this.renderIndicatorTemplate(slideIndicator, currentIndex + 1);
16986
+ }
16987
+ else {
16988
+ slideIndicator.firstElementChild.style.setProperty('--carousel-items-current', `${this.selectedIndex + 1}`);
16989
+ }
16990
+ break;
16991
+ }
16992
+ }
16887
16993
  setHtmlAttributes(attribute, element) {
16888
16994
  const keys = Object.keys(attribute);
16889
16995
  for (const key of keys) {
@@ -16898,7 +17004,7 @@ let Carousel = class Carousel extends Component {
16898
17004
  templateParser(template) {
16899
17005
  if (template) {
16900
17006
  try {
16901
- if (document.querySelectorAll(template).length) {
17007
+ if (typeof template !== 'function' && document.querySelectorAll(template).length) {
16902
17008
  return compile(document.querySelector(template).innerHTML.trim());
16903
17009
  }
16904
17010
  else {
@@ -16947,8 +17053,7 @@ let Carousel = class Carousel extends Component {
16947
17053
  playButton.setAttribute('aria-label', this.localeObj.getConstant(this.autoPlay ? 'pauseSlideTransition' : 'playSlideTransition'));
16948
17054
  buttonObj.iconCss = CLS_ICON$1 + ' ' + (this.autoPlay ? CLS_PAUSE_ICON : CLS_PLAY_ICON);
16949
17055
  buttonObj.dataBind();
16950
- const itemsContainer = this.element.querySelector(`.${CLS_ITEMS$2}`);
16951
- itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
17056
+ this.itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
16952
17057
  if (this.autoPlay && !this.loop && this.selectedIndex === this.slideItems.length - 1) {
16953
17058
  this.setActiveSlide(0, 'Next');
16954
17059
  }
@@ -17032,8 +17137,7 @@ let Carousel = class Carousel extends Component {
17032
17137
  if (isButtonUpdate) {
17033
17138
  this.setProperties({ autoPlay: !isLastSlide }, true);
17034
17139
  playButton.setAttribute('aria-label', this.localeObj.getConstant(this.autoPlay ? 'pauseSlideTransition' : 'playSlideTransition'));
17035
- const itemsContainer = this.element.querySelector(`.${CLS_ITEMS$2}`);
17036
- itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
17140
+ this.itemsContainer.setAttribute('aria-live', this.autoPlay ? 'off' : 'polite');
17037
17141
  const buttonObj = getInstance(playButton, Button);
17038
17142
  buttonObj.iconCss = CLS_ICON$1 + ' ' + (this.autoPlay ? CLS_PAUSE_ICON : CLS_PLAY_ICON);
17039
17143
  buttonObj.dataBind();
@@ -17092,7 +17196,94 @@ let Carousel = class Carousel extends Component {
17092
17196
  }
17093
17197
  }
17094
17198
  }
17199
+ getNumOfItems() {
17200
+ return this.partialVisible ? 2 : 1;
17201
+ }
17202
+ getTranslateValue(element) {
17203
+ const style = getComputedStyle(element);
17204
+ return window.WebKitCSSMatrix ?
17205
+ new WebKitCSSMatrix(style.webkitTransform).m41 : 0;
17206
+ }
17207
+ swipeStart(e) {
17208
+ if (!this.timeStampStart) {
17209
+ this.timeStampStart = Date.now();
17210
+ }
17211
+ this.isSwipe = false;
17212
+ this.itemsContainer.classList.add('e-swipe-start');
17213
+ this.prevPageX = e.touches ? e.touches[0].pageX : e.pageX;
17214
+ this.initialTranslate = this.getTranslateValue(this.itemsContainer);
17215
+ }
17216
+ swiping(e) {
17217
+ if (!this.itemsContainer.classList.contains('e-swipe-start')) {
17218
+ return;
17219
+ }
17220
+ e.preventDefault();
17221
+ const pageX = e.touches ? e.touches[0].pageX : e.pageX;
17222
+ const positionDiff = this.prevPageX - (pageX);
17223
+ if (!this.loop && ((this.enableRtl && ((this.selectedIndex === 0 && positionDiff > 0) ||
17224
+ (this.selectedIndex === this.itemsContainer.childElementCount - 1 && positionDiff < 0))) ||
17225
+ (!this.enableRtl && ((this.selectedIndex === 0 && positionDiff < 0) ||
17226
+ (this.selectedIndex === this.itemsContainer.childElementCount - 1 && positionDiff > 0))))) {
17227
+ return;
17228
+ }
17229
+ this.itemsContainer.style.transform = `translateX(${this.initialTranslate + (this.enableRtl ? positionDiff : -positionDiff)}px)`;
17230
+ }
17231
+ swipStop() {
17232
+ this.isSwipe = true;
17233
+ const time = Date.now() - this.timeStampStart;
17234
+ let distanceX = this.getTranslateValue(this.itemsContainer) - this.initialTranslate;
17235
+ distanceX = distanceX < 0 ? distanceX * -1 : distanceX;
17236
+ if (this.isSwipe) {
17237
+ const offsetDist = distanceX * (Browser.isDevice ? 6 : 1.66);
17238
+ this.itemsContainer.style.transitionDuration = (((Browser.isDevice ? distanceX : offsetDist) / time) / 10) + 's';
17239
+ }
17240
+ const slideWidth = this.itemsContainer.firstElementChild.clientWidth;
17241
+ const threshold = slideWidth / 2;
17242
+ this.itemsContainer.classList.remove('e-swipe-start');
17243
+ const value = this.getTranslateValue(this.itemsContainer);
17244
+ if (value - this.initialTranslate < -threshold) {
17245
+ this.swipeNavigation(!this.enableRtl);
17246
+ }
17247
+ else if (value - this.initialTranslate > threshold) {
17248
+ this.swipeNavigation(this.enableRtl);
17249
+ }
17250
+ else {
17251
+ this.itemsContainer.style.transform = `translateX(${this.initialTranslate}px)`;
17252
+ if (this.animationEffect === 'Fade') {
17253
+ this.itemsContainer.classList.add('e-fade-in-out');
17254
+ }
17255
+ }
17256
+ }
17257
+ swipeNavigation(isRtl) {
17258
+ if (isRtl) {
17259
+ this.next();
17260
+ }
17261
+ else {
17262
+ this.prev();
17263
+ }
17264
+ }
17265
+ swipeModehandlers() {
17266
+ if ((this.swipeMode & CarouselSwipeMode.Touch) === CarouselSwipeMode.Touch) {
17267
+ EventHandler.add(this.itemsContainer, 'touchstart', this.swipeStart, this);
17268
+ EventHandler.add(this.itemsContainer, 'touchmove', this.swiping, this);
17269
+ EventHandler.add(this.itemsContainer, 'touchend', this.swipStop, this);
17270
+ }
17271
+ if ((this.swipeMode & CarouselSwipeMode.Mouse) === CarouselSwipeMode.Mouse) {
17272
+ EventHandler.add(this.itemsContainer, 'mousedown', this.swipeStart, this);
17273
+ EventHandler.add(this.itemsContainer, 'mousemove', this.swiping, this);
17274
+ EventHandler.add(this.itemsContainer, 'mouseup', this.swipStop, this);
17275
+ }
17276
+ if ((this.swipeMode === 0) && (this.swipeMode & CarouselSwipeMode.Mouse & CarouselSwipeMode.Touch) ===
17277
+ (CarouselSwipeMode.Mouse & CarouselSwipeMode.Touch)) {
17278
+ EventHandler.add(this.itemsContainer, 'mousedown touchstart', this.swipeStart, this);
17279
+ EventHandler.add(this.itemsContainer, 'mousemove touchmove', this.swiping, this);
17280
+ EventHandler.add(this.itemsContainer, 'mouseup touchend', this.swipStop, this);
17281
+ }
17282
+ }
17095
17283
  wireEvents() {
17284
+ if (!(this.animationEffect === 'Custom')) {
17285
+ this.swipeModehandlers();
17286
+ }
17096
17287
  EventHandler.add(this.element, 'focusin focusout', this.onFocusActions, this);
17097
17288
  EventHandler.add(this.element, 'mouseenter mouseleave', this.onHoverActions, this);
17098
17289
  EventHandler.add(this.element.firstElementChild, 'animationend', this.onTransitionEnd, this);
@@ -17154,8 +17345,7 @@ let Carousel = class Carousel extends Component {
17154
17345
  playButton.setAttribute('aria-label', this.localeObj.getConstant('pauseSlideTransition'));
17155
17346
  }
17156
17347
  this.setProperties({ autoPlay: true }, true);
17157
- const itemsContainer = this.element.querySelector(`.${CLS_ITEMS$2}`);
17158
- itemsContainer.setAttribute('aria-live', 'off');
17348
+ this.itemsContainer.setAttribute('aria-live', 'off');
17159
17349
  this.applySlideInterval();
17160
17350
  }
17161
17351
  /**
@@ -17171,8 +17361,7 @@ let Carousel = class Carousel extends Component {
17171
17361
  classList(pauseIcon, [CLS_PLAY_ICON], [CLS_PAUSE_ICON]);
17172
17362
  }
17173
17363
  this.setProperties({ autoPlay: false }, true);
17174
- const itemsContainer = this.element.querySelector(`.${CLS_ITEMS$2}`);
17175
- itemsContainer.setAttribute('aria-live', 'off');
17364
+ this.itemsContainer.setAttribute('aria-live', 'off');
17176
17365
  this.resetSlideInterval();
17177
17366
  }
17178
17367
  /**
@@ -17277,12 +17466,18 @@ __decorate$11([
17277
17466
  __decorate$11([
17278
17467
  Property(true)
17279
17468
  ], Carousel.prototype, "showIndicators", void 0);
17469
+ __decorate$11([
17470
+ Property('Default')
17471
+ ], Carousel.prototype, "indicatorsType", void 0);
17280
17472
  __decorate$11([
17281
17473
  Property('Visible')
17282
17474
  ], Carousel.prototype, "buttonsVisibility", void 0);
17283
17475
  __decorate$11([
17284
17476
  Property(false)
17285
17477
  ], Carousel.prototype, "partialVisible", void 0);
17478
+ __decorate$11([
17479
+ Property(CarouselSwipeMode.Touch)
17480
+ ], Carousel.prototype, "swipeMode", void 0);
17286
17481
  __decorate$11([
17287
17482
  Property()
17288
17483
  ], Carousel.prototype, "htmlAttributes", void 0);
@@ -17504,5 +17699,5 @@ AppBar = __decorate$12([
17504
17699
  * Navigation all modules
17505
17700
  */
17506
17701
 
17507
- export { MenuAnimationSettings, MenuItem, FieldSettings, HScroll, VScroll, addScrolling, destroyScroll, Item, Toolbar, AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion, ContextMenu, Menu, TabActionSettings, TabAnimationSettings, Header, TabItem, Tab, FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView, Sidebar, BreadcrumbOverflowMode, BreadcrumbItem, Breadcrumb, CarouselItem, Carousel, AppBar };
17702
+ export { MenuAnimationSettings, MenuItem, FieldSettings, HScroll, VScroll, addScrolling, destroyScroll, Item, Toolbar, AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion, ContextMenu, Menu, TabActionSettings, TabAnimationSettings, Header, TabItem, Tab, FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView, Sidebar, BreadcrumbOverflowMode, BreadcrumbItem, Breadcrumb, CarouselSwipeMode, CarouselItem, Carousel, AppBar };
17508
17703
  //# sourceMappingURL=ej2-navigations.es2015.js.map