@syncfusion/ej2-navigations 20.1.47 → 20.1.51-10460

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 (417) hide show
  1. package/.eslintrc.json +243 -243
  2. package/CHANGELOG.md +1601 -1570
  3. package/README.md +194 -194
  4. package/dist/ej2-navigations.min.js +1 -0
  5. package/dist/ej2-navigations.umd.min.js +1 -10
  6. package/dist/ej2-navigations.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-navigations.es2015.js +92 -80
  8. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  9. package/dist/es6/ej2-navigations.es5.js +251 -239
  10. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  11. package/dist/global/ej2-navigations.min.js +1 -10
  12. package/dist/global/ej2-navigations.min.js.map +1 -1
  13. package/dist/global/index.d.ts +0 -9
  14. package/dist/ts/accordion/accordion.ts +1545 -0
  15. package/dist/ts/breadcrumb/breadcrumb.ts +873 -0
  16. package/dist/ts/carousel/carousel.ts +1181 -0
  17. package/dist/ts/common/h-scroll.ts +477 -0
  18. package/dist/ts/common/menu-base.ts +2357 -0
  19. package/dist/ts/common/menu-scroll.ts +105 -0
  20. package/dist/ts/common/v-scroll.ts +454 -0
  21. package/{src/context-menu/context-menu.d.ts → dist/ts/context-menu/context-menu.ts} +134 -88
  22. package/dist/ts/menu/menu.ts +302 -0
  23. package/dist/ts/sidebar/sidebar.ts +874 -0
  24. package/dist/ts/tab/tab.ts +2637 -0
  25. package/dist/ts/toolbar/toolbar.ts +2378 -0
  26. package/dist/ts/treeview/treeview.ts +5768 -0
  27. package/helpers/e2e/accordionHelper.js +70 -53
  28. package/helpers/e2e/contextmenuHelper.js +52 -35
  29. package/helpers/e2e/index.js +14 -12
  30. package/helpers/e2e/menuHelper.js +52 -35
  31. package/helpers/e2e/sidebarHelper.js +109 -92
  32. package/helpers/e2e/tabHelper.js +73 -56
  33. package/helpers/e2e/toolbarHelper.js +73 -56
  34. package/helpers/e2e/treeview.js +79 -61
  35. package/license +10 -10
  36. package/package.json +164 -164
  37. package/src/accordion/accordion-model.d.ts +190 -190
  38. package/src/accordion/accordion.js +19 -19
  39. package/src/breadcrumb/breadcrumb-model.d.ts +105 -105
  40. package/src/breadcrumb/breadcrumb.js +19 -19
  41. package/src/carousel/carousel-model.d.ts +148 -148
  42. package/src/carousel/carousel.js +19 -19
  43. package/src/common/h-scroll-model.d.ts +6 -6
  44. package/src/common/h-scroll.js +23 -21
  45. package/src/common/menu-base-model.d.ts +206 -206
  46. package/src/common/menu-base.js +31 -25
  47. package/src/common/v-scroll-model.d.ts +6 -6
  48. package/src/common/v-scroll.js +19 -19
  49. package/src/context-menu/context-menu-model.d.ts +18 -18
  50. package/src/context-menu/context-menu.js +19 -19
  51. package/src/menu/menu-model.d.ts +43 -43
  52. package/src/menu/menu.js +19 -19
  53. package/src/sidebar/sidebar-model.d.ts +191 -191
  54. package/src/sidebar/sidebar.js +19 -19
  55. package/src/tab/tab-model.d.ts +291 -291
  56. package/src/tab/tab.js +21 -21
  57. package/src/toolbar/toolbar-model.d.ts +195 -195
  58. package/src/toolbar/toolbar.js +23 -19
  59. package/src/treeview/treeview-model.d.ts +411 -411
  60. package/src/treeview/treeview.js +20 -20
  61. package/styles/accordion/_bds-definition.scss +167 -0
  62. package/styles/accordion/_bigger.scss +121 -0
  63. package/styles/accordion/_bootstrap5.3-definition.scss +168 -0
  64. package/styles/accordion/_fluent2-definition.scss +167 -0
  65. package/styles/accordion/_fusionnew-definition.scss +168 -0
  66. package/styles/accordion/_material3-dark-definition.scss +1 -0
  67. package/styles/accordion/_material3-definition.scss +168 -0
  68. package/styles/accordion/fluent2.scss +4 -0
  69. package/styles/accordion/icons/_bds.scss +15 -0
  70. package/styles/accordion/icons/_bootstrap5.3.scss +15 -0
  71. package/styles/accordion/icons/_fluent2.scss +15 -0
  72. package/styles/accordion/icons/_fusionnew.scss +15 -0
  73. package/styles/accordion/icons/_material3-dark.scss +1 -0
  74. package/styles/accordion/icons/_material3.scss +15 -0
  75. package/styles/accordion/material3-dark.scss +4 -0
  76. package/styles/accordion/material3.scss +4 -0
  77. package/styles/appbar/_all.scss +2 -0
  78. package/styles/appbar/_bds-definition.scss +25 -0
  79. package/styles/appbar/_bigger.scss +15 -0
  80. package/styles/appbar/_bootstrap-dark-definition.scss +6 -0
  81. package/styles/appbar/_bootstrap-definition.scss +6 -0
  82. package/styles/appbar/_bootstrap4-definition.scss +6 -0
  83. package/styles/appbar/_bootstrap5-definition.scss +6 -0
  84. package/styles/appbar/_bootstrap5.3-definition.scss +6 -0
  85. package/styles/appbar/_fabric-dark-definition.scss +6 -0
  86. package/styles/appbar/_fabric-definition.scss +6 -0
  87. package/styles/appbar/_fluent-definition.scss +6 -0
  88. package/styles/appbar/_fluent2-definition.scss +24 -0
  89. package/styles/appbar/_fusionnew-definition.scss +6 -0
  90. package/styles/appbar/_highcontrast-definition.scss +6 -0
  91. package/styles/appbar/_highcontrast-light-definition.scss +6 -0
  92. package/styles/appbar/_layout.scss +76 -0
  93. package/styles/appbar/_material-dark-definition.scss +6 -0
  94. package/styles/appbar/_material-definition.scss +6 -0
  95. package/styles/appbar/_material3-definition.scss +6 -0
  96. package/styles/appbar/_tailwind-definition.scss +6 -0
  97. package/styles/appbar/_theme.scss +216 -0
  98. package/styles/bootstrap-dark.css +1 -1
  99. package/styles/bootstrap.css +1 -1
  100. package/styles/bootstrap4.css +1 -1
  101. package/styles/bootstrap5-dark.css +1 -1
  102. package/styles/bootstrap5.css +1 -1
  103. package/styles/breadcrumb/_bds-definition.scss +60 -0
  104. package/styles/breadcrumb/_bigger.scss +160 -0
  105. package/styles/breadcrumb/_bootstrap5.3-definition.scss +61 -0
  106. package/styles/breadcrumb/_fluent2-definition.scss +61 -0
  107. package/styles/breadcrumb/_fusionnew-definition.scss +59 -0
  108. package/styles/breadcrumb/_layout.scss +1 -1
  109. package/styles/breadcrumb/_material3-dark-definition.scss +1 -0
  110. package/styles/breadcrumb/_material3-definition.scss +60 -0
  111. package/styles/breadcrumb/_tailwind-dark-definition.scss +1 -60
  112. package/styles/breadcrumb/_tailwind-definition.scss +3 -3
  113. package/styles/breadcrumb/bootstrap-dark.css +1 -1
  114. package/styles/breadcrumb/bootstrap.css +1 -1
  115. package/styles/breadcrumb/bootstrap4.css +1 -1
  116. package/styles/breadcrumb/bootstrap5-dark.css +1 -1
  117. package/styles/breadcrumb/bootstrap5.css +1 -1
  118. package/styles/breadcrumb/fabric-dark.css +1 -1
  119. package/styles/breadcrumb/fabric.css +1 -1
  120. package/styles/breadcrumb/fluent-dark.css +1 -1
  121. package/styles/breadcrumb/fluent.css +1 -1
  122. package/styles/breadcrumb/fluent2.scss +4 -0
  123. package/styles/breadcrumb/highcontrast-light.css +1 -1
  124. package/styles/breadcrumb/highcontrast.css +1 -1
  125. package/styles/breadcrumb/icons/_bds.scss +23 -0
  126. package/styles/breadcrumb/icons/_bootstrap5.3.scss +23 -0
  127. package/styles/breadcrumb/icons/_fluent2.scss +23 -0
  128. package/styles/breadcrumb/icons/_fusionnew.scss +23 -0
  129. package/styles/breadcrumb/icons/_material3-dark.scss +1 -0
  130. package/styles/breadcrumb/icons/_material3.scss +12 -0
  131. package/styles/breadcrumb/material-dark.css +1 -1
  132. package/styles/breadcrumb/material.css +1 -1
  133. package/styles/breadcrumb/material3-dark.scss +4 -0
  134. package/styles/breadcrumb/material3.scss +4 -0
  135. package/styles/breadcrumb/tailwind-dark.css +8 -8
  136. package/styles/breadcrumb/tailwind.css +8 -8
  137. package/styles/carousel/_bds-definition.scss +20 -0
  138. package/styles/carousel/_bootstrap5.3-definition.scss +20 -0
  139. package/styles/carousel/_fluent2-definition.scss +23 -0
  140. package/styles/carousel/_fusionnew-definition.scss +20 -0
  141. package/styles/carousel/_material3-dark-definition.scss +1 -0
  142. package/styles/carousel/_material3-definition.scss +21 -0
  143. package/styles/carousel/fluent2.scss +4 -0
  144. package/styles/carousel/icons/_bds.scss +30 -0
  145. package/styles/carousel/icons/_bootstrap5.3.scss +30 -0
  146. package/styles/carousel/icons/_fluent2.scss +30 -0
  147. package/styles/carousel/icons/_fusionnew.scss +30 -0
  148. package/styles/carousel/icons/_material3-dark.scss +1 -0
  149. package/styles/carousel/icons/_material3.scss +30 -0
  150. package/styles/carousel/material3-dark.scss +4 -0
  151. package/styles/carousel/material3.scss +4 -0
  152. package/styles/context-menu/_bds-definition.scss +68 -0
  153. package/styles/context-menu/_bigger.scss +96 -0
  154. package/styles/context-menu/_bootstrap5.3-definition.scss +52 -0
  155. package/styles/context-menu/_fluent2-definition.scss +52 -0
  156. package/styles/context-menu/_fusionnew-definition.scss +51 -0
  157. package/styles/context-menu/_material3-dark-definition.scss +1 -0
  158. package/styles/context-menu/_material3-definition.scss +51 -0
  159. package/styles/context-menu/fluent2.scss +4 -0
  160. package/styles/context-menu/icons/_bds.scss +31 -0
  161. package/styles/context-menu/icons/_bootstrap5.3.scss +31 -0
  162. package/styles/context-menu/icons/_fluent2.scss +31 -0
  163. package/styles/context-menu/icons/_fusionnew.scss +31 -0
  164. package/styles/context-menu/icons/_material3-dark.scss +1 -0
  165. package/styles/context-menu/icons/_material3.scss +31 -0
  166. package/styles/context-menu/material3-dark.scss +4 -0
  167. package/styles/context-menu/material3.scss +4 -0
  168. package/styles/fabric-dark.css +1 -1
  169. package/styles/fabric.css +1 -1
  170. package/styles/fluent-dark.css +1 -1
  171. package/styles/fluent.css +1 -1
  172. package/styles/fluent2.scss +34 -0
  173. package/styles/h-scroll/_bds-definition.scss +83 -0
  174. package/styles/h-scroll/_bigger.scss +39 -0
  175. package/styles/h-scroll/_bootstrap5.3-definition.scss +83 -0
  176. package/styles/h-scroll/_fluent2-definition.scss +83 -0
  177. package/styles/h-scroll/_fusionnew-definition.scss +83 -0
  178. package/styles/h-scroll/_material3-dark-definition.scss +1 -0
  179. package/styles/h-scroll/_material3-definition.scss +83 -0
  180. package/styles/h-scroll/fluent2.scss +4 -0
  181. package/styles/h-scroll/icons/_bds.scss +49 -0
  182. package/styles/h-scroll/icons/_bootstrap5.3.scss +49 -0
  183. package/styles/h-scroll/icons/_fluent2.scss +49 -0
  184. package/styles/h-scroll/icons/_fusionnew.scss +49 -0
  185. package/styles/h-scroll/icons/_material3-dark.scss +1 -0
  186. package/styles/h-scroll/icons/_material3.scss +49 -0
  187. package/styles/h-scroll/material3-dark.scss +4 -0
  188. package/styles/h-scroll/material3.scss +4 -0
  189. package/styles/highcontrast-light.css +1 -1
  190. package/styles/highcontrast.css +1 -1
  191. package/styles/material-dark.css +1 -1
  192. package/styles/material.css +1 -1
  193. package/styles/material3-dark.scss +34 -0
  194. package/styles/material3.scss +34 -0
  195. package/styles/menu/_bds-definition.scss +65 -0
  196. package/styles/menu/_bigger.scss +355 -0
  197. package/styles/menu/_bootstrap5.3-definition.scss +66 -0
  198. package/styles/menu/_fluent2-definition.scss +67 -0
  199. package/styles/menu/_fusionnew-definition.scss +66 -0
  200. package/styles/menu/_material3-dark-definition.scss +1 -0
  201. package/styles/menu/_material3-definition.scss +66 -0
  202. package/styles/menu/fluent2.scss +7 -0
  203. package/styles/menu/icons/_bds.scss +104 -0
  204. package/styles/menu/icons/_bootstrap5.3.scss +104 -0
  205. package/styles/menu/icons/_fluent2.scss +104 -0
  206. package/styles/menu/icons/_fusionnew.scss +104 -0
  207. package/styles/menu/icons/_material3-dark.scss +1 -0
  208. package/styles/menu/icons/_material3.scss +104 -0
  209. package/styles/menu/material3-dark.scss +7 -0
  210. package/styles/menu/material3.scss +7 -0
  211. package/styles/pager/_all.scss +2 -0
  212. package/styles/pager/_bds-definition.scss +152 -0
  213. package/styles/pager/_bigger.scss +311 -0
  214. package/styles/pager/_bootstrap-dark-definition.scss +151 -0
  215. package/styles/pager/_bootstrap-definition.scss +151 -0
  216. package/styles/pager/_bootstrap4-definition.scss +151 -0
  217. package/styles/pager/_bootstrap5-definition.scss +166 -0
  218. package/styles/pager/_bootstrap5.3-definition.scss +166 -0
  219. package/styles/pager/_fabric-dark-definition.scss +149 -0
  220. package/styles/pager/_fabric-definition.scss +149 -0
  221. package/styles/pager/_fluent-definition.scss +153 -0
  222. package/styles/pager/_fluent2-definition.scss +152 -0
  223. package/styles/pager/_fusionnew-definition.scss +166 -0
  224. package/styles/pager/_highcontrast-definition.scss +149 -0
  225. package/styles/pager/_highcontrast-light-definition.scss +149 -0
  226. package/styles/pager/_layout.scss +742 -0
  227. package/styles/pager/_material-dark-definition.scss +150 -0
  228. package/styles/pager/_material-definition.scss +150 -0
  229. package/styles/pager/_material3-definition.scss +166 -0
  230. package/styles/pager/_tailwind-definition.scss +152 -0
  231. package/styles/pager/_theme.scss +189 -0
  232. package/styles/pager/icons/_bds.scss +50 -0
  233. package/styles/pager/icons/_bootstrap-dark.scss +50 -0
  234. package/styles/pager/icons/_bootstrap.scss +50 -0
  235. package/styles/pager/icons/_bootstrap4.scss +50 -0
  236. package/styles/pager/icons/_bootstrap5.3.scss +50 -0
  237. package/styles/pager/icons/_bootstrap5.scss +50 -0
  238. package/styles/pager/icons/_fabric-dark.scss +50 -0
  239. package/styles/pager/icons/_fabric.scss +50 -0
  240. package/styles/pager/icons/_fluent.scss +50 -0
  241. package/styles/pager/icons/_fluent2.scss +50 -0
  242. package/styles/pager/icons/_fusionnew.scss +50 -0
  243. package/styles/pager/icons/_highcontrast-light.scss +50 -0
  244. package/styles/pager/icons/_highcontrast.scss +46 -0
  245. package/styles/pager/icons/_material-dark.scss +50 -0
  246. package/styles/pager/icons/_material.scss +46 -0
  247. package/styles/pager/icons/_material3.scss +50 -0
  248. package/styles/pager/icons/_tailwind.scss +50 -0
  249. package/styles/sidebar/_bds-definition.scss +53 -0
  250. package/styles/sidebar/_bootstrap5.3-definition.scss +6 -0
  251. package/styles/sidebar/_fluent2-definition.scss +8 -0
  252. package/styles/sidebar/_fusionnew-definition.scss +6 -0
  253. package/styles/sidebar/_material3-dark-definition.scss +1 -0
  254. package/styles/sidebar/_material3-definition.scss +4 -0
  255. package/styles/sidebar/fluent2.scss +3 -0
  256. package/styles/sidebar/material3-dark.scss +3 -0
  257. package/styles/sidebar/material3.scss +3 -0
  258. package/styles/stepper/_all.scss +2 -0
  259. package/styles/stepper/_bds-definition.scss +72 -0
  260. package/styles/stepper/_bigger.scss +53 -0
  261. package/styles/stepper/_bootstrap-dark-definition.scss +72 -0
  262. package/styles/stepper/_bootstrap-definition.scss +72 -0
  263. package/styles/stepper/_bootstrap4-definition.scss +72 -0
  264. package/styles/stepper/_bootstrap5-definition.scss +73 -0
  265. package/styles/stepper/_bootstrap5.3-definition.scss +72 -0
  266. package/styles/stepper/_fabric-dark-definition.scss +72 -0
  267. package/styles/stepper/_fabric-definition.scss +72 -0
  268. package/styles/stepper/_fluent-definition.scss +72 -0
  269. package/styles/stepper/_fluent2-definition.scss +72 -0
  270. package/styles/stepper/_fusionnew-definition.scss +72 -0
  271. package/styles/stepper/_highcontrast-definition.scss +72 -0
  272. package/styles/stepper/_highcontrast-light-definition.scss +72 -0
  273. package/styles/stepper/_layout.scss +431 -0
  274. package/styles/stepper/_material-dark-definition.scss +72 -0
  275. package/styles/stepper/_material-definition.scss +72 -0
  276. package/styles/stepper/_material3-definition.scss +72 -0
  277. package/styles/stepper/_tailwind-definition.scss +72 -0
  278. package/styles/stepper/_theme.scss +195 -0
  279. package/styles/stepper/icons/_bds.scss +5 -0
  280. package/styles/stepper/icons/_bootstrap-dark.scss +5 -0
  281. package/styles/stepper/icons/_bootstrap.scss +5 -0
  282. package/styles/stepper/icons/_bootstrap4.scss +5 -0
  283. package/styles/stepper/icons/_bootstrap5.3.scss +5 -0
  284. package/styles/stepper/icons/_bootstrap5.scss +5 -0
  285. package/styles/stepper/icons/_fabric-dark.scss +5 -0
  286. package/styles/stepper/icons/_fabric.scss +5 -0
  287. package/styles/stepper/icons/_fluent.scss +5 -0
  288. package/styles/stepper/icons/_fluent2.scss +5 -0
  289. package/styles/stepper/icons/_fusionnew.scss +5 -0
  290. package/styles/stepper/icons/_highcontrast-light.scss +5 -0
  291. package/styles/stepper/icons/_highcontrast.scss +5 -0
  292. package/styles/stepper/icons/_material-dark.scss +5 -0
  293. package/styles/stepper/icons/_material.scss +5 -0
  294. package/styles/stepper/icons/_material3.scss +5 -0
  295. package/styles/stepper/icons/_tailwind.scss +5 -0
  296. package/styles/tab/_bds-definition.scss +661 -0
  297. package/styles/tab/_bigger.scss +1270 -0
  298. package/styles/tab/_bootstrap5.3-definition.scss +636 -0
  299. package/styles/tab/_fluent2-definition.scss +667 -0
  300. package/styles/tab/_fusionnew-definition.scss +634 -0
  301. package/styles/tab/_material3-dark-definition.scss +1 -0
  302. package/styles/tab/_material3-definition.scss +636 -0
  303. package/styles/tab/fluent2.scss +5 -0
  304. package/styles/tab/icons/_bds.scss +90 -0
  305. package/styles/tab/icons/_bootstrap5.3.scss +90 -0
  306. package/styles/tab/icons/_fluent2.scss +98 -0
  307. package/styles/tab/icons/_fusionnew.scss +90 -0
  308. package/styles/tab/icons/_material3-dark.scss +1 -0
  309. package/styles/tab/icons/_material3.scss +90 -0
  310. package/styles/tab/material3-dark.scss +5 -0
  311. package/styles/tab/material3.scss +5 -0
  312. package/styles/tailwind-dark.css +8 -8
  313. package/styles/tailwind.css +8 -8
  314. package/styles/toolbar/_bds-definition.scss +197 -0
  315. package/styles/toolbar/_bigger.scss +309 -0
  316. package/styles/toolbar/_bootstrap5.3-definition.scss +198 -0
  317. package/styles/toolbar/_fluent2-definition.scss +198 -0
  318. package/styles/toolbar/_fusionnew-definition.scss +198 -0
  319. package/styles/toolbar/_material3-dark-definition.scss +1 -0
  320. package/styles/toolbar/_material3-definition.scss +199 -0
  321. package/styles/toolbar/fluent2.scss +6 -0
  322. package/styles/toolbar/icons/_bds.scss +14 -0
  323. package/styles/toolbar/icons/_bootstrap5.3.scss +14 -0
  324. package/styles/toolbar/icons/_fluent2.scss +14 -0
  325. package/styles/toolbar/icons/_fusionnew.scss +14 -0
  326. package/styles/toolbar/icons/_material3-dark.scss +1 -0
  327. package/styles/toolbar/icons/_material3.scss +14 -0
  328. package/styles/toolbar/material3-dark.scss +6 -0
  329. package/styles/toolbar/material3.scss +6 -0
  330. package/styles/treeview/_bds-definition.scss +132 -0
  331. package/styles/treeview/_bigger.scss +393 -0
  332. package/styles/treeview/_bootstrap5.3-definition.scss +119 -0
  333. package/styles/treeview/_fluent2-definition.scss +128 -0
  334. package/styles/treeview/_fusionnew-definition.scss +120 -0
  335. package/styles/treeview/_material3-dark-definition.scss +1 -0
  336. package/styles/treeview/_material3-definition.scss +110 -0
  337. package/styles/treeview/fluent2.scss +4 -0
  338. package/styles/treeview/icons/_bds.scss +44 -0
  339. package/styles/treeview/icons/_bootstrap5.3.scss +44 -0
  340. package/styles/treeview/icons/_fluent2.scss +44 -0
  341. package/styles/treeview/icons/_fusionnew.scss +44 -0
  342. package/styles/treeview/icons/_material3-dark.scss +1 -0
  343. package/styles/treeview/icons/_material3.scss +44 -0
  344. package/styles/treeview/material3-dark.scss +4 -0
  345. package/styles/treeview/material3.scss +4 -0
  346. package/styles/v-scroll/_bds-definition.scss +49 -0
  347. package/styles/v-scroll/_bigger.scss +28 -0
  348. package/styles/v-scroll/_bootstrap5.3-definition.scss +49 -0
  349. package/styles/v-scroll/_fluent2-definition.scss +49 -0
  350. package/styles/v-scroll/_fusionnew-definition.scss +49 -0
  351. package/styles/v-scroll/_material3-dark-definition.scss +1 -0
  352. package/styles/v-scroll/_material3-definition.scss +49 -0
  353. package/styles/v-scroll/fluent2.scss +4 -0
  354. package/styles/v-scroll/icons/_bds.scss +27 -0
  355. package/styles/v-scroll/icons/_bootstrap5.3.scss +27 -0
  356. package/styles/v-scroll/icons/_fluent2.scss +27 -0
  357. package/styles/v-scroll/icons/_fusionnew.scss +27 -0
  358. package/styles/v-scroll/icons/_material3-dark.scss +1 -0
  359. package/styles/v-scroll/icons/_material3.scss +27 -0
  360. package/styles/v-scroll/material3-dark.scss +4 -0
  361. package/styles/v-scroll/material3.scss +4 -0
  362. package/tslint.json +111 -111
  363. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -63
  364. package/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -39
  365. package/accordion.d.ts +0 -4
  366. package/accordion.js +0 -4
  367. package/breadcrumb.d.ts +0 -4
  368. package/breadcrumb.js +0 -4
  369. package/carousel.d.ts +0 -4
  370. package/carousel.js +0 -4
  371. package/common.d.ts +0 -4
  372. package/common.js +0 -4
  373. package/context-menu.d.ts +0 -4
  374. package/context-menu.js +0 -4
  375. package/helpers/e2e/accordionHelper.d.ts +0 -56
  376. package/helpers/e2e/contextmenuHelper.d.ts +0 -37
  377. package/helpers/e2e/index.d.ts +0 -7
  378. package/helpers/e2e/menuHelper.d.ts +0 -37
  379. package/helpers/e2e/sidebarHelper.d.ts +0 -94
  380. package/helpers/e2e/tabHelper.d.ts +0 -60
  381. package/helpers/e2e/toolbarHelper.d.ts +0 -60
  382. package/helpers/e2e/treeview.d.ts +0 -50
  383. package/index.d.ts +0 -4
  384. package/index.js +0 -4
  385. package/menu.d.ts +0 -4
  386. package/menu.js +0 -4
  387. package/sidebar.d.ts +0 -4
  388. package/sidebar.js +0 -4
  389. package/src/accordion/accordion.d.ts +0 -440
  390. package/src/accordion/index.d.ts +0 -5
  391. package/src/breadcrumb/breadcrumb.d.ts +0 -255
  392. package/src/breadcrumb/index.d.ts +0 -5
  393. package/src/carousel/carousel.d.ts +0 -338
  394. package/src/carousel/index.d.ts +0 -3
  395. package/src/common/h-scroll.d.ts +0 -105
  396. package/src/common/index.d.ts +0 -9
  397. package/src/common/menu-base.d.ts +0 -526
  398. package/src/common/menu-scroll.d.ts +0 -29
  399. package/src/common/v-scroll.d.ts +0 -106
  400. package/src/context-menu/index.d.ts +0 -5
  401. package/src/index.d.ts +0 -13
  402. package/src/menu/index.d.ts +0 -5
  403. package/src/menu/menu.d.ts +0 -121
  404. package/src/sidebar/index.d.ts +0 -5
  405. package/src/sidebar/sidebar.d.ts +0 -321
  406. package/src/tab/index.d.ts +0 -5
  407. package/src/tab/tab.d.ts +0 -650
  408. package/src/toolbar/index.d.ts +0 -5
  409. package/src/toolbar/toolbar.d.ts +0 -470
  410. package/src/treeview/index.d.ts +0 -5
  411. package/src/treeview/treeview.d.ts +0 -1256
  412. package/tab.d.ts +0 -4
  413. package/tab.js +0 -4
  414. package/toolbar.d.ts +0 -4
  415. package/toolbar.js +0 -4
  416. package/treeview.d.ts +0 -4
  417. package/treeview.js +0 -4
@@ -0,0 +1,873 @@
1
+ import { Component, NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty, Property, Collection, append, extend, Event, EmitType, BaseEventArgs, EventHandler, closest, addClass, removeClass, detach, remove } from '@syncfusion/ej2-base';
2
+ import { ListBase, ListBaseOptions } from '@syncfusion/ej2-lists';
3
+ import { Popup } from '@syncfusion/ej2-popups';
4
+ import { BreadcrumbModel, BreadcrumbItemModel } from './breadcrumb-model';
5
+
6
+ type obj = { [key: string]: Object };
7
+ const ICONRIGHT: string = 'e-icon-right';
8
+ const ITEMTEXTCLASS: string = 'e-breadcrumb-text';
9
+ const ICONCLASS: string = 'e-breadcrumb-icon';
10
+ const MENUCLASS: string = 'e-breadcrumb-menu';
11
+ const ITEMCLASS: string = 'e-breadcrumb-item';
12
+ const POPUPCLASS: string = 'e-breadcrumb-popup';
13
+ const WRAPMODECLASS: string = 'e-breadcrumb-wrap-mode';
14
+ const SCROLLMODECLASS: string = 'e-breadcrumb-scroll-mode';
15
+ const TABINDEX: string = 'tabindex';
16
+ const DISABLEDCLASS: string = 'e-disabled';
17
+ const ARIADISABLED: string = 'aria-disabled'
18
+ const DOT: string = '.';
19
+ /**
20
+ * Defines the Breadcrumb overflow modes.
21
+ */
22
+ export type BreadcrumbOverflowMode = 'Hidden' | 'Collapsed' | 'Menu' | 'Wrap' | 'Scroll' | 'None';
23
+
24
+ export class BreadcrumbItem extends ChildProperty<BreadcrumbItem> {
25
+ /**
26
+ * Specifies the text content of the Breadcrumb item.
27
+ *
28
+ * @default ''
29
+ */
30
+ @Property('')
31
+ public text: string;
32
+
33
+ /**
34
+ * Specifies the Url of the Breadcrumb item that will be activated when clicked.
35
+ *
36
+ * @default ''
37
+ */
38
+ @Property('')
39
+ public url: string;
40
+
41
+ /**
42
+ * Defines a class/multiple classes separated by a space for the item that is used to include an icon.
43
+ *
44
+ * @default null
45
+ */
46
+ @Property(null)
47
+ public iconCss: string;
48
+
49
+ /**
50
+ * Enable or disable the breadcrumb item, when set to true, the breadcrumb item will be disabled.
51
+ *
52
+ * @default false
53
+ */
54
+ @Property(false)
55
+ public disabled: boolean;
56
+ }
57
+
58
+ /**
59
+ * Interface for item click event.
60
+ */
61
+ export interface BreadcrumbClickEventArgs extends BaseEventArgs {
62
+ /**
63
+ * Specifies the item's element.
64
+ */
65
+ element: HTMLElement;
66
+ /**
67
+ * Specifies the Breadcrumb item.
68
+ */
69
+ item: BreadcrumbItemModel;
70
+ /**
71
+ * Specifies the item click event.
72
+ */
73
+ event: Event;
74
+ }
75
+
76
+ /**
77
+ * Interface for before item render event.
78
+ */
79
+ export interface BreadcrumbBeforeItemRenderEventArgs extends BaseEventArgs {
80
+ /**
81
+ * Specifies the item's element.
82
+ */
83
+ element: HTMLElement;
84
+ /**
85
+ * Specifies the Breadcrumb item.
86
+ */
87
+ item: BreadcrumbItemModel;
88
+ /**
89
+ * Cancels the Breadcrumb item rendering.
90
+ */
91
+ cancel: boolean;
92
+ }
93
+
94
+ /**
95
+ * Breadcrumb is a graphical user interface that helps to identify or highlight the current location within a hierarchical structure of websites.
96
+ * The aim is to make the user aware of their current position in a hierarchy of website links.
97
+ * ```html
98
+ * <nav id='breadcrumb'></nav>
99
+ * ```
100
+ * ```typescript
101
+ * <script>
102
+ * var breadcrumbObj = new Breadcrumb({ items: [{ text: 'Home', url: '/' }, { text: 'Index', url: './index.html }]});
103
+ * breadcrumbObj.appendTo("#breadcrumb");
104
+ * </script>
105
+ * ```
106
+ */
107
+ @NotifyPropertyChanges
108
+ export class Breadcrumb extends Component<HTMLElement> implements INotifyPropertyChanged {
109
+ private isExpanded: boolean;
110
+ private startIndex: number;
111
+ private endIndex: number;
112
+ private _maxItems: number;
113
+ private popupObj: Popup;
114
+ private popupUl: HTMLElement;
115
+ private delegateClickHanlder: Function;
116
+ /**
117
+ * Defines the Url based on which the Breadcrumb items are generated.
118
+ *
119
+ * @default ''
120
+ */
121
+ @Property('')
122
+ public url: string;
123
+
124
+ /**
125
+ * Defines the list of Breadcrumb items.
126
+ *
127
+ * @default []
128
+ */
129
+ @Collection<BreadcrumbItemModel>([], BreadcrumbItem)
130
+ public items: BreadcrumbItemModel[];
131
+
132
+ /**
133
+ * Specifies the Url of the active Breadcrumb item.
134
+ *
135
+ * @default ''
136
+ */
137
+ @Property('')
138
+ public activeItem: string;
139
+
140
+ /**
141
+ * Specifies an integer to enable overflow behavior when the Breadcrumb items count exceeds and it is based on the overflowMode property.
142
+ *
143
+ * @default -1
144
+ * @aspType int
145
+ */
146
+ @Property(-1)
147
+ public maxItems: number;
148
+
149
+ /**
150
+ * Specifies the overflow mode of the Breadcrumb item when it exceeds maxItems count. The possible values are,
151
+ * - Default: Specified maxItems count will be visible and the remaining items will be hidden. While clicking on the previous item, the hidden item will become visible.
152
+ * - Collapsed: Only the first and last items will be visible, and the remaining items will be hidden in the collapsed icon. When the collapsed icon is clicked, all items become visible.
153
+ * - Menu: Shows the number of breadcrumb items that can be accommodated within the container space, and creates a sub menu with the remaining items.
154
+ * - Wrap: Wraps the items on multiple lines when the Breadcrumb’s width exceeds the container space.
155
+ * - Scroll: Shows an HTML scroll bar when the Breadcrumb’s width exceeds the container space.
156
+ * - None: Shows all the items on a single line.
157
+ *
158
+ * @default 'Menu'
159
+ */
160
+ @Property('Menu')
161
+ public overflowMode: BreadcrumbOverflowMode;
162
+
163
+ /**
164
+ * Defines class/multiple classes separated by a space in the Breadcrumb element.
165
+ *
166
+ * @default ''
167
+ */
168
+ @Property('')
169
+ public cssClass: string;
170
+
171
+ /**
172
+ * Specifies the template for Breadcrumb item.
173
+ *
174
+ * @default null
175
+ */
176
+ @Property(null)
177
+ public itemTemplate: string;
178
+
179
+ /**
180
+ * Specifies the separator template for Breadcrumb.
181
+ *
182
+ * @default '/'
183
+ */
184
+ @Property('/')
185
+ public separatorTemplate: string;
186
+
187
+ /**
188
+ * Enable or disable the item's navigation, when set to false, each item navigation will be prevented.
189
+ *
190
+ * @default true
191
+ */
192
+ @Property(true)
193
+ public enableNavigation: boolean;
194
+
195
+ /**
196
+ * Enable or disable the active item navigation, when set to true, active item will be navigable.
197
+ *
198
+ * @default false
199
+ */
200
+ @Property(false)
201
+ public enableActiveItemNavigation: boolean;
202
+
203
+ /**
204
+ * Enable or disable the breadcrumb, when set to true, the breadcrumb will be disabled.
205
+ *
206
+ * @default false
207
+ */
208
+ @Property(false)
209
+ public disabled: boolean;
210
+
211
+ /**
212
+ * Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
213
+ *
214
+ * @default ''
215
+ * @private
216
+ * @aspIgnore
217
+ */
218
+ @Property('')
219
+ public locale: string;
220
+
221
+ /**
222
+ * Triggers while rendering each breadcrumb item.
223
+ *
224
+ * @event beforeItemRender
225
+ */
226
+ @Event()
227
+ public beforeItemRender: EmitType<BreadcrumbBeforeItemRenderEventArgs>;
228
+
229
+ /**
230
+ * Triggers while clicking the breadcrumb item.
231
+ *
232
+ * @event itemClick
233
+ */
234
+ @Event()
235
+ public itemClick: EmitType<BreadcrumbClickEventArgs>;
236
+
237
+ /**
238
+ * Triggers once the component rendering is completed.
239
+ *
240
+ * @event created
241
+ */
242
+ @Event()
243
+ public created: EmitType<Event>;
244
+
245
+ /**
246
+ * Constructor for creating the widget.
247
+ *
248
+ * @private
249
+ * @param {BreadcrumbModel} options - Specifies the Breadcrumb model.
250
+ * @param {string | HTMLElement} element - Specifies the element.
251
+ */
252
+ public constructor(options?: BreadcrumbModel, element?: string | HTMLElement) {
253
+ super(options, <string | HTMLElement>element);
254
+ }
255
+
256
+ /**
257
+ * @private
258
+ * @returns {void}
259
+ */
260
+ protected preRender(): void {
261
+ // pre render code
262
+ }
263
+
264
+ /**
265
+ * Initialize the control rendering.
266
+ *
267
+ * @private
268
+ * @returns {void}
269
+ */
270
+ protected render(): void {
271
+ this.initialize();
272
+ this.renderItems(this.items);
273
+ this.wireEvents();
274
+ }
275
+
276
+ private initialize(): void {
277
+ this._maxItems = this.maxItems;
278
+ this.element.setAttribute('aria-label', 'breadcrumb');
279
+ if (this.cssClass) {
280
+ addClass([this.element], this.cssClass.split(' '));
281
+ }
282
+ if (this.enableRtl) {
283
+ this.element.classList.add('e-rtl');
284
+ }
285
+ if (this.disabled) {
286
+ this.element.classList.add(DISABLEDCLASS);
287
+ this.element.setAttribute(ARIADISABLED, 'true');
288
+ }
289
+ if (this.overflowMode === 'Wrap') {
290
+ this.element.classList.add(WRAPMODECLASS);
291
+ } else if (this.overflowMode === 'Scroll') {
292
+ this.element.classList.add(SCROLLMODECLASS);
293
+ }
294
+ this.initItems();
295
+ this.initPvtProps();
296
+ }
297
+
298
+ private initPvtProps(): void {
299
+ if (this.overflowMode === 'Hidden' && this._maxItems > 0) {
300
+ this.endIndex = this.getEndIndex();
301
+ this.startIndex = this.endIndex + 1 - (this._maxItems - 1);
302
+ }
303
+ if (this.overflowMode === 'Menu') {
304
+ if (this._maxItems >= 0) {
305
+ this.startIndex = this._maxItems > 1 ? 1 : 0;
306
+ this.endIndex = this.getEndIndex();
307
+ this.popupUl = this.createElement('ul', { attrs: { TABINDEX: '0', 'role': 'menu' } });
308
+ } else {
309
+ this.startIndex = this.endIndex = null;
310
+ }
311
+ }
312
+ }
313
+
314
+ private getEndIndex(): number {
315
+ let endIndex: number;
316
+ if (this.activeItem) {
317
+ this.items.forEach((item: BreadcrumbItemModel, idx: number) => {
318
+ if (item.url === this.activeItem || item.text === this.activeItem) {
319
+ endIndex = idx;
320
+ }
321
+ });
322
+ } else {
323
+ endIndex = this.items.length - 1;
324
+ }
325
+ return endIndex;
326
+ }
327
+
328
+ private initItems(): void {
329
+ if (!this.items.length) {
330
+ let baseUri: string;
331
+ let uri: string[];
332
+ const items: BreadcrumbItemModel[] = [];
333
+ if (this.url) {
334
+ const url: URL = new URL(this.url, window.location.origin);
335
+ baseUri = url.origin + '/';
336
+ uri = url.href.split(baseUri)[1].split('/');
337
+ } else {
338
+ baseUri = window.location.origin + '/';
339
+ uri = window.location.href.split(baseUri)[1].split('/');
340
+ }
341
+ items.push({ iconCss: 'e-icons e-home', url: baseUri });
342
+ for (let i: number = 0; i < uri.length; i++) {
343
+ if (uri[i]) {
344
+ items.push({ text: uri[i], url: baseUri + uri[i] });
345
+ baseUri += uri[i] + '/';
346
+ }
347
+ }
348
+ this.setProperties({ items: items }, true);
349
+ }
350
+ }
351
+
352
+ private renderItems(items: BreadcrumbItemModel[]): void {
353
+ let item: BreadcrumbItemModel[] | object[]; let isSingleLevel: boolean;
354
+ const isIconRight: boolean = this.element.classList.contains(ICONRIGHT);
355
+ const itemsLength: number = items.length;
356
+ if (itemsLength) {
357
+ let isActiveItem: boolean;
358
+ let isLastItem: boolean;
359
+ let isLastItemInPopup: boolean;
360
+ let j: number = 0;
361
+ let wrapDiv: HTMLElement;
362
+ const len: number = (itemsLength * 2) - 1;
363
+ let isItemCancelled: boolean = false;
364
+ const ol: HTMLElement = this.createElement('ol', { className: this.overflowMode === 'Wrap' ? 'e-breadcrumb-wrapped-ol' : '' });
365
+ const firstOl: HTMLElement = this.createElement('ol', { className: this.overflowMode === 'Wrap' ? 'e-breadcrumb-first-ol' : '' });
366
+ const showIcon: boolean = this.hasField(items, 'iconCss');
367
+ const isCollasped: boolean = (this.overflowMode === 'Collapsed' && this._maxItems > 0 && itemsLength > this._maxItems && !this.isExpanded);
368
+ const isDefaultOverflowMode: boolean = (this.overflowMode === 'Hidden' && this._maxItems > 0);
369
+ if (this.overflowMode === 'Menu' && this.popupUl) {
370
+ this.popupUl.innerHTML = '';
371
+ }
372
+ const listBaseOptions: ListBaseOptions = {
373
+ moduleName: this.getModuleName(),
374
+ showIcon: showIcon,
375
+ itemNavigable: true,
376
+ itemCreated: (args: { curData: BreadcrumbItemModel, item: HTMLElement, fields: obj }): void => {
377
+ const isLastItem: boolean = (args.curData as { isLastItem: boolean }).isLastItem;
378
+ if (isLastItem && args.item.children.length && !this.itemTemplate) {
379
+ delete (args.curData as { isLastItem: boolean }).isLastItem;
380
+ if (!isLastItemInPopup && !this.enableActiveItemNavigation) {
381
+ args.item.innerHTML = this.createElement('span', { className: ITEMTEXTCLASS, innerHTML: args.item.children[0].innerHTML }).outerHTML;
382
+ }
383
+ }
384
+ if (args.curData.iconCss && !args.curData.text && !this.itemTemplate) {
385
+ args.item.classList.add('e-icon-item');
386
+ }
387
+ if (isDefaultOverflowMode) {
388
+ args.item.setAttribute('item-index', j.toString());
389
+ }
390
+ const eventArgs: BreadcrumbBeforeItemRenderEventArgs = {
391
+ item: extend({}, (args.curData as { properties: object }).properties ?
392
+ (args.curData as { properties: object }).properties : args.curData), element: args.item, cancel: false
393
+ };
394
+ this.trigger('beforeItemRender', eventArgs);
395
+ isItemCancelled = eventArgs.cancel;
396
+ const containsRightIcon: boolean = (isIconRight || eventArgs.element.classList.contains(ICONRIGHT));
397
+ if (containsRightIcon && args.curData.iconCss && !this.itemTemplate) {
398
+ args.item.querySelector('.e-anchor-wrap').appendChild(args.item.querySelector(DOT + ICONCLASS));
399
+ }
400
+ if (eventArgs.item.disabled) {
401
+ args.item.setAttribute(ARIADISABLED, 'true');
402
+ args.item.classList.add(DISABLEDCLASS);
403
+ }
404
+ if ((eventArgs.item.disabled || this.disabled) && args.item.children.length && !this.itemTemplate) {
405
+ args.item.children[0].setAttribute(TABINDEX, '-1');
406
+ }
407
+ if ((args.curData as { isEmptyUrl: boolean }).isEmptyUrl) {
408
+ args.item.children[0].removeAttribute('href');
409
+ if ((!isLastItem || (isLastItem && this.enableActiveItemNavigation)) && !(eventArgs.item.disabled || this.disabled)) {
410
+ args.item.children[0].setAttribute(TABINDEX, '0');
411
+ EventHandler.add(args.item.children[0], 'keydown', this.keyDownHandler, this);
412
+ }
413
+ }
414
+ if (isLastItem) {
415
+ args.item.setAttribute('data-active-item', '');
416
+ }
417
+ if (!this.itemTemplate) {
418
+ this.beforeItemRenderChanges(args.curData, eventArgs.item, args.item, containsRightIcon);
419
+ }
420
+ }
421
+ };
422
+ for (let i: number = 0; i < len; (i % 2 && j++), i++) {
423
+ isActiveItem = (this.activeItem && (this.activeItem === items[j].url || this.activeItem === items[j].text));
424
+ if (isCollasped && i > 1 && i < len - 2) {
425
+ continue;
426
+ } else if (isDefaultOverflowMode && ((j < this.startIndex || j > this.endIndex)
427
+ && (i % 2 ? j !== this.startIndex - 1 : true)) && j !== 0) {
428
+ continue;
429
+ }
430
+ if (i % 2) {
431
+ // separator item
432
+ wrapDiv = this.createElement('div', { className: 'e-breadcrumb-item-wrapper' });
433
+ listBaseOptions.template = this.separatorTemplate ? this.separatorTemplate : '/';
434
+ listBaseOptions.itemClass = 'e-breadcrumb-separator';
435
+ isSingleLevel = false;
436
+ item = [{ previousItem: items[j], nextItem: items[j + 1] }];
437
+ } else {
438
+ // list item
439
+ listBaseOptions.itemClass = '';
440
+ if (this.itemTemplate) {
441
+ listBaseOptions.template = this.itemTemplate;
442
+ isSingleLevel = false;
443
+ } else {
444
+ isSingleLevel = true;
445
+ }
446
+ item = [extend({}, (items[j] as { properties: object }).properties ? (items[j] as { properties: object }).properties
447
+ : items[j])];
448
+ if (!(item as BreadcrumbItemModel[])[0].url && !this.itemTemplate) {
449
+ item = [extend({}, (item as BreadcrumbItemModel[])[0], { isEmptyUrl: true, url: '#' })];
450
+ }
451
+ isLastItem = (isDefaultOverflowMode || this.overflowMode === 'Menu') && (j === this.endIndex);
452
+ if (((i === len - 1 || isLastItem) && !this.itemTemplate) || isActiveItem) {
453
+ (item[0] as { isLastItem: boolean }).isLastItem = true;
454
+ }
455
+ }
456
+ let parent: HTMLElement = ol;
457
+ const lastPopupItemIdx: number = this.startIndex + this.endIndex - this._maxItems;
458
+ if (this.overflowMode === 'Menu' && ((j >= this.startIndex && (j <= lastPopupItemIdx && (i % 2 ? !(j === lastPopupItemIdx) : true)) && this.endIndex >= this._maxItems && this._maxItems > 0) || this._maxItems === 0)) {
459
+ if (i % 2) {
460
+ continue;
461
+ } else {
462
+ parent = this.popupUl;
463
+ if (isLastItem) {
464
+ isLastItemInPopup = true;
465
+ }
466
+ }
467
+ } else if (this.overflowMode === 'Wrap') {
468
+ if (i === 0) {
469
+ parent = firstOl
470
+ } else {
471
+ parent = wrapDiv;
472
+ }
473
+ }
474
+ const li: NodeList = ListBase.createList(this.createElement, item as { [key: string]: Object; }[], listBaseOptions, isSingleLevel, this).childNodes;
475
+ if (!isItemCancelled) {
476
+ append(li, parent);
477
+ } else if (isDefaultOverflowMode || isCollasped || this.overflowMode === 'Menu' || this.overflowMode === 'Wrap') {
478
+ items.splice(j, 1);
479
+ this.initPvtProps();
480
+ return this.reRenderItems();
481
+ }
482
+ else if ((i === len - 1 || isLastItem)) {
483
+ remove(parent.lastElementChild);
484
+ }
485
+ if (this.overflowMode === 'Wrap' && i !== 0 && i % 2 === 0) {
486
+ ol.appendChild(wrapDiv);
487
+ }
488
+ if (isCollasped && i === 1) {
489
+ const li: Element = this.createElement('li', { className: 'e-icons e-breadcrumb-collapsed', attrs: { TABINDEX: '0' } });
490
+ EventHandler.add(li, 'keyup', this.expandHandler, this);
491
+ ol.appendChild(li);
492
+ }
493
+ if (this.overflowMode === 'Menu' && this.startIndex === i && this.endIndex >= this._maxItems && this._maxItems >= 0) {
494
+ const menu: Element = this.getMenuElement();
495
+ EventHandler.add(menu, 'keyup', this.keyDownHandler, this);
496
+ ol.appendChild(menu);
497
+ }
498
+ if (isActiveItem || isLastItem) {
499
+ break;
500
+ }
501
+ if (isItemCancelled) {
502
+ i++;
503
+ }
504
+ }
505
+ if ((this as unknown as { isReact: boolean }).isReact) {
506
+ this.renderReactTemplates();
507
+ }
508
+ if (this.overflowMode === 'Wrap') {
509
+ this.element.appendChild(firstOl);
510
+ }
511
+ this.element.appendChild(ol);
512
+ this.calculateMaxItems();
513
+ }
514
+ }
515
+
516
+ private calculateMaxItems(): void {
517
+ if (this.overflowMode === 'Hidden' || this.overflowMode === 'Collapsed' || this.overflowMode === 'Menu') {
518
+ let maxItems: number;
519
+ const width: number = this.element.offsetWidth;
520
+ const liElems: HTMLElement[] = [].slice.call(this.element.children[0].children).reverse();
521
+ let liWidth: number = this.overflowMode === 'Menu' ? 0 : liElems[liElems.length - 1].offsetWidth + (liElems[liElems.length - 2] ? liElems[liElems.length - 2].offsetWidth : 0);
522
+ if (this.overflowMode === 'Menu') {
523
+ const menuEle: HTMLElement = this.getMenuElement();
524
+ this.element.appendChild(menuEle);
525
+ liWidth += menuEle.offsetWidth;
526
+ remove(menuEle);
527
+ }
528
+ for (let i: number = 0; i < liElems.length - 2; i++) {
529
+ if (liWidth > width) {
530
+ maxItems = Math.ceil((i - 1) / 2) + ((this.overflowMode === 'Menu' && i <= 2) ? 0 : 1);
531
+ if (((this.maxItems > maxItems && !(this.maxItems > -1 && maxItems == -1)) || this.maxItems == -1) && this._maxItems != maxItems) {
532
+ this._maxItems = maxItems;
533
+ this.initPvtProps();
534
+ return this.reRenderItems();
535
+ } else {
536
+ break;
537
+ }
538
+ } else {
539
+ if (this.overflowMode === 'Menu' && i === 2) {
540
+ liWidth += liElems[liElems.length - 1].offsetWidth + liElems[liElems.length - 2].offsetWidth;
541
+ if (liWidth > width) {
542
+ this._maxItems = 1;
543
+ this.initPvtProps();
544
+ return this.reRenderItems();
545
+ }
546
+ }
547
+ if (!(this.overflowMode === 'Menu' && liElems[i].classList.contains(MENUCLASS))) {
548
+ liWidth += liElems[i].offsetWidth;
549
+ if (liWidth > width) {
550
+ maxItems = Math.ceil((i) / 2) + (this.overflowMode === 'Menu' && i <= 2 ? 0 : 1);
551
+ this._maxItems = maxItems;
552
+ this.initPvtProps();
553
+ return this.reRenderItems();
554
+ }
555
+ }
556
+ }
557
+ }
558
+ } else if ((this.overflowMode === 'Wrap' || this.overflowMode === 'Scroll') && this._maxItems > 0) {
559
+ let width: number = 0;
560
+ const liElems: NodeListOf<HTMLElement> = this.element.querySelectorAll(DOT + ITEMCLASS);
561
+ if (liElems.length > this._maxItems + this._maxItems - 1) {
562
+ for (let i: number = this.overflowMode === 'Wrap' ? 1 : 0; i < this._maxItems + this._maxItems - 1; i++) {
563
+ width += liElems[i].offsetWidth;
564
+ }
565
+ width = width + 5 + (parseInt(getComputedStyle(this.element.children[0]).paddingLeft, 10) * 2);
566
+ if (this.overflowMode === 'Wrap') {
567
+ (this.element.querySelector('.e-breadcrumb-wrapped-ol') as HTMLElement).style.width = width + 'px';
568
+ } else {
569
+ this.element.style.width = width + 'px';
570
+ }
571
+ }
572
+ }
573
+ }
574
+
575
+ private hasField(items: BreadcrumbItemModel[], field: string): boolean {
576
+ for (let i: number = 0, len: number = items.length; i < len; i++) {
577
+ if ((<obj>items[i])[field]) {
578
+ return true;
579
+ }
580
+ }
581
+ return false;
582
+ }
583
+
584
+ private getMenuElement(): HTMLElement {
585
+ return this.createElement('li', { className: 'e-icons e-breadcrumb-menu', attrs: { TABINDEX: '0' } })
586
+ }
587
+
588
+ private beforeItemRenderChanges(prevItem: BreadcrumbItemModel, currItem: BreadcrumbItemModel, elem: Element, isRightIcon: boolean)
589
+ : void {
590
+ const wrapElem: Element = elem.querySelector('.e-anchor-wrap');
591
+ if (currItem.text !== prevItem.text) {
592
+ wrapElem.childNodes.forEach((child: Element) => {
593
+ if (child.nodeType === Node.TEXT_NODE) {
594
+ child.textContent = currItem.text;
595
+ }
596
+ });
597
+ }
598
+ if (currItem.iconCss !== prevItem.iconCss && wrapElem) { // wrapElem - for checking it is item not a separator
599
+ const iconElem: Element = elem.querySelector(DOT + ICONCLASS);
600
+ if (iconElem) {
601
+ if (currItem.iconCss) {
602
+ removeClass([iconElem], prevItem.iconCss.split(' '));
603
+ addClass([iconElem], currItem.iconCss.split(' '));
604
+ } else {
605
+ remove(iconElem);
606
+ }
607
+ } else if (currItem.iconCss) {
608
+ const iconElem: Element = this.createElement('span', { className: ICONCLASS + ' ' + currItem.iconCss });
609
+ if (isRightIcon) {
610
+ append([iconElem], wrapElem);
611
+ } else {
612
+ wrapElem.insertBefore(iconElem, wrapElem.childNodes[0]);
613
+ }
614
+ }
615
+ }
616
+ if (currItem.url !== prevItem.url && this.enableNavigation) {
617
+ const anchor: Element = elem.querySelector('a.' + ITEMTEXTCLASS);
618
+ if (anchor) {
619
+ if (currItem.url) {
620
+ anchor.setAttribute('href', currItem.url);
621
+ } else {
622
+ anchor.removeAttribute('href');
623
+ }
624
+ }
625
+ }
626
+ }
627
+
628
+ private reRenderItems(): void {
629
+ this.element.innerHTML = '';
630
+ this.renderItems(this.items);
631
+ }
632
+
633
+ private clickHandler(e: MouseEvent): void {
634
+ const li: Element = closest(e.target as Element, DOT + ITEMCLASS + ':not(.e-breadcrumb-separator)');
635
+ if (!this.enableNavigation) {
636
+ e.preventDefault();
637
+ }
638
+ if (li && (closest(e.target as Element, DOT + ITEMTEXTCLASS) || this.itemTemplate)) {
639
+ let idx: number;
640
+ if (this.overflowMode === 'Wrap') {
641
+ idx = [].slice.call(this.element.querySelectorAll(DOT + ITEMCLASS)).indexOf(li);
642
+ } else {
643
+ idx = [].slice.call(li.parentElement.children).indexOf(li);
644
+ }
645
+ if (this.overflowMode === 'Menu') {
646
+ if (closest(e.target as Element, DOT + POPUPCLASS)) {
647
+ idx += this.startIndex;
648
+ this.endIndex = idx;
649
+ if (e.type === 'keydown') {
650
+ this.documentClickHandler(e);
651
+ }
652
+ } else if (this.element.querySelector(DOT + MENUCLASS)) {
653
+ if (idx > [].slice.call(this.element.children[0].children).indexOf(this.element.querySelector(DOT + MENUCLASS))) {
654
+ idx += (this.popupUl.childElementCount * 2) - 2;
655
+ idx = Math.floor(idx / 2);
656
+ this.endIndex = idx;
657
+ } else {
658
+ this.startIndex = this.endIndex = idx;
659
+ }
660
+ } else {
661
+ idx = Math.floor(idx / 2);
662
+ this.startIndex = this.endIndex = idx;
663
+ }
664
+ } else {
665
+ idx = Math.floor(idx / 2);
666
+ }
667
+ if (this.overflowMode === 'Hidden' && this._maxItems > 0 && this.endIndex !== 0) {
668
+ idx = parseInt(li.getAttribute('item-index'), 10);
669
+ if (this.startIndex > 1) {
670
+ this.startIndex -= (this.endIndex - idx);
671
+ }
672
+ this.endIndex = idx;
673
+ }
674
+ this.trigger('itemClick', { element: li, item: this.items[idx], event: e });
675
+ this.activeItem = this.items[idx].url || this.items[idx].text;
676
+ this.dataBind();
677
+ }
678
+ if ((e.target as Element).classList.contains('e-breadcrumb-collapsed')) {
679
+ this.isExpanded = true;
680
+ this.reRenderItems();
681
+ }
682
+ if ((e.target as Element).classList.contains(MENUCLASS)) {
683
+ this.renderPopup();
684
+ }
685
+ }
686
+
687
+ private renderPopup(): void {
688
+ const wrapper: HTMLElement = this.createElement('div', { className: POPUPCLASS + ' ' + this.cssClass + (this.enableRtl ? ' e-rtl' : '') });
689
+ document.body.appendChild(wrapper);
690
+ this.popupObj = new Popup(wrapper, {
691
+ content: this.popupUl,
692
+ relateTo: this.element.querySelector(DOT + MENUCLASS) as HTMLElement,
693
+ enableRtl: this.enableRtl,
694
+ position: { X: 'left', Y: 'bottom' },
695
+ collision: { X: 'fit', Y: 'flip' },
696
+ open: (): void => {
697
+ this.popupUl.focus();
698
+ }
699
+ });
700
+ this.popupWireEvents();
701
+ this.popupObj.show();
702
+ }
703
+
704
+ private documentClickHandler(e: Event): void {
705
+ if (this.overflowMode === 'Menu' && this.popupObj && this.popupObj.element.classList.contains('e-popup-open') && !closest(e.target as Element, DOT + MENUCLASS)) {
706
+ this.popupObj.hide();
707
+ this.popupObj.destroy();
708
+ detach(this.popupObj.element);
709
+ }
710
+ }
711
+
712
+ private resize(): void {
713
+ this._maxItems = this.maxItems;
714
+ this.initPvtProps();
715
+ this.reRenderItems();
716
+ }
717
+
718
+ private expandHandler(e: KeyboardEvent): void {
719
+ if (e.key === 'Enter') {
720
+ this.isExpanded = true;
721
+ this.reRenderItems();
722
+ }
723
+ }
724
+
725
+ private keyDownHandler(e: KeyboardEvent): void {
726
+ if (e.key === 'Enter') {
727
+ this.clickHandler(e as unknown as MouseEvent);
728
+ }
729
+ }
730
+
731
+ private popupKeyDownHandler(e: KeyboardEvent): void {
732
+ if (e.key === 'Escape') {
733
+ this.documentClickHandler(e);
734
+ }
735
+ }
736
+
737
+ /**
738
+ * Called internally if any of the property value changed.
739
+ *
740
+ * @private
741
+ * @param {BreadcrumbModel} newProp - Specifies the new properties.
742
+ * @param {BreadcrumbModel} oldProp - Specifies the old properties.
743
+ * @returns {void}
744
+ */
745
+ public onPropertyChanged(newProp: BreadcrumbModel, oldProp: BreadcrumbModel): void {
746
+ for (const prop of Object.keys(newProp)) {
747
+ switch (prop) {
748
+ case 'items':
749
+ case 'enableActiveItemNavigation':
750
+ this.reRenderItems();
751
+ break;
752
+ case 'activeItem':
753
+ this._maxItems = this.maxItems;
754
+ this.initPvtProps();
755
+ this.reRenderItems();
756
+ break;
757
+ case 'overflowMode':
758
+ case 'maxItems':
759
+ this._maxItems = this.maxItems;
760
+ this.initPvtProps();
761
+ this.reRenderItems();
762
+ if (oldProp.overflowMode === 'Wrap') {
763
+ this.element.classList.remove(WRAPMODECLASS);
764
+ } else if (newProp.overflowMode === 'Wrap') {
765
+ this.element.classList.add(WRAPMODECLASS);
766
+ }
767
+ if (oldProp.overflowMode === 'Scroll') {
768
+ this.element.classList.remove(SCROLLMODECLASS);
769
+ } else if (newProp.overflowMode === 'Scroll') {
770
+ this.element.classList.add(SCROLLMODECLASS);
771
+ }
772
+ break;
773
+ case 'url':
774
+ this.initItems();
775
+ this.reRenderItems();
776
+ break;
777
+ case 'cssClass':
778
+ if (oldProp.cssClass) {
779
+ removeClass([this.element], oldProp.cssClass.split(' '));
780
+ }
781
+ if (newProp.cssClass) {
782
+ addClass([this.element], newProp.cssClass.split(' '));
783
+ }
784
+ if ((oldProp.cssClass && oldProp.cssClass.indexOf(ICONRIGHT) > -1) && !(newProp.cssClass &&
785
+ newProp.cssClass.indexOf(ICONRIGHT) > -1) || !(oldProp.cssClass && oldProp.cssClass.indexOf(ICONRIGHT) > -1) &&
786
+ (newProp.cssClass && newProp.cssClass.indexOf(ICONRIGHT) > -1)) {
787
+ this.reRenderItems();
788
+ }
789
+ break;
790
+ case 'enableRtl':
791
+ this.element.classList.toggle('e-rtl');
792
+ break;
793
+ case 'disabled':
794
+ this.element.classList.toggle(DISABLEDCLASS);
795
+ this.element.setAttribute(ARIADISABLED, newProp.disabled + '');
796
+ break;
797
+ }
798
+ }
799
+ }
800
+
801
+ private wireEvents(): void {
802
+ this.delegateClickHanlder = this.documentClickHandler.bind(this);
803
+ EventHandler.add(document, 'click', this.delegateClickHanlder, this);
804
+ EventHandler.add(this.element, 'click', this.clickHandler, this);
805
+ window.addEventListener('resize', this.resize.bind(this));
806
+ }
807
+
808
+ private popupWireEvents(): void {
809
+ EventHandler.add(this.popupObj.element, 'click', this.clickHandler, this);
810
+ EventHandler.add(this.popupObj.element, 'keydown', this.popupKeyDownHandler, this);
811
+ }
812
+
813
+ private unWireEvents(): void {
814
+ EventHandler.remove(document, 'click', this.delegateClickHanlder);
815
+ EventHandler.remove(this.element, 'click', this.clickHandler);
816
+ window.removeEventListener('resize', this.resize.bind(this));
817
+ if (this.popupObj) {
818
+ EventHandler.remove(this.popupObj.element, 'click', this.clickHandler);
819
+ EventHandler.remove(this.popupObj.element, 'keydown', this.popupKeyDownHandler);
820
+ }
821
+ }
822
+
823
+ /**
824
+ * Get the properties to be maintained in the persisted state.
825
+ *
826
+ * @returns {string} - Persist data
827
+ */
828
+ protected getPersistData(): string {
829
+ return this.addOnPersist(['activeItem']);
830
+ }
831
+
832
+ /**
833
+ * Get module name.
834
+ *
835
+ * @private
836
+ * @returns {string} - Module Name
837
+ */
838
+ protected getModuleName(): string {
839
+ return 'breadcrumb';
840
+ }
841
+
842
+ /**
843
+ * Destroys the widget.
844
+ *
845
+ * @returns {void}
846
+ */
847
+ public destroy(): void {
848
+ let classes: string[] = [];
849
+ let attributes: string[] = ['aria-label'];
850
+ if (this.cssClass) {
851
+ classes.concat(this.cssClass.split(' '));
852
+ }
853
+ if (this.enableRtl) {
854
+ classes.push('e-rtl');
855
+ }
856
+ if (this.disabled) {
857
+ classes.push(DISABLEDCLASS);
858
+ attributes.push(ARIADISABLED);
859
+ }
860
+ if (this.overflowMode === 'Wrap') {
861
+ classes.push(WRAPMODECLASS);
862
+ } else if (this.overflowMode === 'Scroll') {
863
+ classes.push(SCROLLMODECLASS);
864
+ }
865
+ this.unWireEvents();
866
+ this.element.innerHTML = '';
867
+ removeClass([this.element], classes);
868
+ attributes.forEach((attribute: string) => {
869
+ this.element.removeAttribute(attribute);
870
+ });
871
+ super.destroy();
872
+ }
873
+ }