@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,874 @@
1
+ import { Component, formatUnit, EventHandler, Event, isNullOrUndefined, closest, Browser } from '@syncfusion/ej2-base';
2
+ import { Property, EmitType, NotifyPropertyChanges, INotifyPropertyChanged, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
3
+ import { setStyleAttribute as setStyle, addClass, removeClass, Touch, SwipeEventArgs } from '@syncfusion/ej2-base';
4
+ import { SidebarModel } from './sidebar-model';
5
+
6
+ const CONTROL: string = 'e-control';
7
+ const ROOT: string = 'e-sidebar';
8
+ const DOCKER: string = 'e-dock';
9
+ const CLOSE: string = 'e-close';
10
+ const OPEN: string = 'e-open';
11
+ const TRASITION: string = 'e-transition';
12
+ const DEFAULTBACKDROP: string = 'e-sidebar-overlay';
13
+ const CONTEXTBACKDROP: string = 'e-backdrop';
14
+ const RTL: string = 'e-rtl';
15
+ const RIGHT: string = 'e-right';
16
+ const LEFT: string = 'e-left';
17
+ const OVER: string = 'e-over';
18
+ const PUSH: string = 'e-push';
19
+ const SLIDE: string = 'e-slide';
20
+ const VISIBILITY: string = 'e-visibility';
21
+ const DISPLAY: string = 'e-sidebar-display';
22
+ const MAINCONTENTANIMATION: string = 'e-content-animation';
23
+ const DISABLEANIMATION: string = 'e-disable-animation';
24
+ const CONTEXT: string = 'e-sidebar-context';
25
+ const SIDEBARABSOLUTE: string = 'e-sidebar-absolute';
26
+
27
+
28
+ /**
29
+ * Specifies the Sidebar types.
30
+ */
31
+ export type SidebarType = 'Slide' | 'Over' | 'Push' | 'Auto';
32
+ /**
33
+ * Specifies the Sidebar positions.
34
+ */
35
+ export type SidebarPosition = 'Left' | 'Right';
36
+
37
+ /**
38
+ * Sidebar is an expandable or collapsible
39
+ * component that typically act as a side container to place the primary or secondary content alongside of the main content.
40
+ * ```html
41
+ * <aside id="sidebar">
42
+ * </aside>
43
+ * ```
44
+ * ```typescript
45
+ * <script>
46
+ * let sidebarObject: Sidebar = new Sidebar();
47
+ * sidebarObject.appendTo("#sidebar");
48
+ * </script>
49
+ * ```
50
+ */
51
+ @NotifyPropertyChanges
52
+ export class Sidebar extends Component<HTMLElement> implements INotifyPropertyChanged {
53
+ private modal: HTMLElement;
54
+ private mainContentEle: Touch;
55
+ private sidebarEle: Touch;
56
+ private sidebarEleCopy: HTMLElement;
57
+ protected tabIndex: string;
58
+ private windowWidth: number;
59
+ private targetEle: HTMLElement;
60
+ // Specifies the first render of Sidebar component.
61
+ private firstRender: boolean;
62
+
63
+ /**
64
+ * Specifies the size of the Sidebar in dock state.
65
+ * > For more details about dockSize refer to
66
+ * [`Dock`](https://ej2.syncfusion.com/documentation/sidebar/docking-sidebar/) documentation.
67
+ *
68
+ * @default 'auto'
69
+ */
70
+ @Property('auto')
71
+ public dockSize: string | number;
72
+ /**
73
+ * Specifies the media query string for resolution, which when met opens the Sidebar.
74
+ * ```typescript
75
+ * let defaultSidebar: Sidebar = new Sidebar({
76
+ * mediaQuery:'(min-width: 600px)'
77
+ * });
78
+ * ```
79
+ * > For more details about mediaQuery refer to
80
+ * [`Auto Close`](https://ej2.syncfusion.com/documentation/sidebar/auto-close/) documentation.
81
+ *
82
+ * @default null
83
+ * @aspType string
84
+ */
85
+ @Property(null)
86
+ public mediaQuery: string | MediaQueryList;
87
+ /**
88
+ * Specifies the docking state of the component.
89
+ * > For more details about enableDock refer to
90
+ * [`Dock`](https://ej2.syncfusion.com/documentation/sidebar/docking-sidebar/) documentation.
91
+ *
92
+ * @default false
93
+ */
94
+ @Property(false)
95
+ public enableDock: boolean;
96
+ /**
97
+ * Enables the expand or collapse while swiping in touch devices.
98
+ * This is not a sidebar property.
99
+ *
100
+ * @default 'en-US'
101
+ * @private
102
+ */
103
+ @Property('en-US')
104
+ public locale: string;
105
+ /**
106
+ * Enable or disable persisting component's state between page reloads. If enabled, following list of states will be persisted.
107
+ * 1. Position
108
+ * 2. Type
109
+ *
110
+ * @default false
111
+ */
112
+ @Property(false)
113
+ public enablePersistence: boolean;
114
+ /**
115
+ * Enables the expand or collapse while swiping in touch devices.
116
+ *
117
+ * @default true
118
+ */
119
+ @Property(true)
120
+ public enableGestures: boolean;
121
+ /**
122
+ * Gets or sets the Sidebar component is open or close.
123
+ * > When the Sidebar type is set to `Auto`,
124
+ * the component will be expanded in the desktop and collapsed in the mobile mode regardless of the isOpen property.
125
+ *
126
+ * @default false
127
+ */
128
+ @Property(false)
129
+ public isOpen: boolean;
130
+ /**
131
+ * Specifies the Sidebar in RTL mode that displays the content in the right-to-left direction.
132
+ *
133
+ * @default false
134
+ */
135
+ @Property(false)
136
+ public enableRtl: boolean;
137
+ /**
138
+ * Enable or disable the animation transitions on expanding or collapsing the Sidebar.
139
+ *
140
+ * @default true
141
+ */
142
+ @Property(true)
143
+ public animate: boolean;
144
+ /**
145
+ * Specifies the height of the Sidebar.
146
+ *
147
+ * @default 'auto'
148
+ * @private
149
+ */
150
+ @Property('auto')
151
+ public height: string | number;
152
+ /**
153
+ * Specifies whether the Sidebar need to be closed or not when document area is clicked.
154
+ *
155
+ * @default false
156
+ */
157
+ @Property(false)
158
+ public closeOnDocumentClick: boolean;
159
+ /**
160
+ * Specifies the position of the Sidebar (Left/Right) corresponding to the main content.
161
+ * > For more details about SidebarPosition refer to
162
+ * [`position`](https://ej2.syncfusion.com/documentation/sidebar/getting-started/#position) documentation.
163
+ *
164
+ * @default 'Left'
165
+ */
166
+ @Property('Left')
167
+ public position: SidebarPosition;
168
+ /**
169
+ * Allows to place the sidebar inside the target element.
170
+ * > For more details about target refer to
171
+ * [`Custom Context`](https://ej2.syncfusion.com/documentation/sidebar/custom-context/) documentation.
172
+ *
173
+ * @default null
174
+ */
175
+ @Property(null)
176
+ public target: HTMLElement | string;
177
+ /**
178
+ * Specifies the whether to apply overlay options to main content when the Sidebar is in an open state.
179
+ * > For more details about showBackdrop refer to
180
+ * [`Backdrop`](https://ej2.syncfusion.com/documentation/sidebar/getting-started/#enable-backdrop) documentation.
181
+ *
182
+ * @default false
183
+ */
184
+ @Property(false)
185
+ public showBackdrop: boolean;
186
+ /**
187
+ * Specifies the expanding types of the Sidebar.
188
+ * * `Over` - The sidebar floats over the main content area.
189
+ * * `Push` - The sidebar pushes the main content area to appear side-by-side, and shrinks the main content within the screen width.
190
+ * * `Slide` - The sidebar translates the x and y positions of main content area based on the sidebar width.
191
+ * The main content area will not be adjusted within the screen width.
192
+ * * `Auto` - Sidebar with `Over` type in mobile resolution and `Push` type in other higher resolutions.
193
+ * > For more details about SidebarType refer to
194
+ * [`SidebarType`](../../sidebar/variations/) documentation.
195
+ *
196
+ * @default 'Auto'
197
+ */
198
+ @Property('Auto')
199
+ public type: SidebarType;
200
+ /**
201
+ * Specifies the width of the Sidebar. By default, the width of the Sidebar sets based on the size of its content.
202
+ * Width can also be set in pixel values.
203
+ *
204
+ * @default 'auto'
205
+ */
206
+ @Property('auto')
207
+ public width: string | number;
208
+ /**
209
+ * Specifies the z-index of the Sidebar. It is applicable only when sidebar act as overlay type.
210
+ *
211
+ * @default 1000
212
+ * @aspType double
213
+ */
214
+ @Property(1000)
215
+ public zIndex: string | number;
216
+ /**
217
+ * Triggers when component is created.
218
+ *
219
+ * @event
220
+ *
221
+ *
222
+ */
223
+ /* eslint-disable */
224
+ @Event()
225
+ public created: EmitType<Object>;
226
+ /* eslint-enable */
227
+ /**
228
+ * Triggers when component is closed.
229
+ *
230
+ * @event
231
+ */
232
+ @Event()
233
+ public close: EmitType<EventArgs>;
234
+ /**
235
+ * Triggers when component is opened.
236
+ *
237
+ * @event
238
+ */
239
+ @Event()
240
+ public open: EmitType<EventArgs>;
241
+ /**
242
+ * Triggers when the state(expand/collapse) of the component is changed.
243
+ *
244
+ * @event
245
+ */
246
+ @Event()
247
+ public change: EmitType<ChangeEventArgs>;
248
+ /**
249
+ * Triggers when component gets destroyed.
250
+ *
251
+ * @event
252
+ */
253
+ /* eslint-disable */
254
+ @Event()
255
+ public destroyed: EmitType<Object>;
256
+ /* eslint-enable */
257
+
258
+ constructor(options?: SidebarModel, element?: string | HTMLElement) {
259
+ super(options, element);
260
+ }
261
+ protected preRender(): void {
262
+ this.setWidth();
263
+ }
264
+ protected render(): void {
265
+ this.initialize();
266
+ this.wireEvents();
267
+ this.renderComplete();
268
+ }
269
+
270
+ protected initialize(): void {
271
+ this.setTarget();
272
+ this.addClass();
273
+ this.setZindex();
274
+ if (this.enableDock) {
275
+ this.setDock();
276
+ }
277
+ if (this.isOpen) {
278
+ this.show();
279
+ this.firstRender = true;
280
+ } else {
281
+ this.setMediaQuery();
282
+ }
283
+ this.checkType(true);
284
+ this.setType(this.type);
285
+ this.setCloseOnDocumentClick();
286
+ this.setEnableRTL();
287
+ if (Browser.isDevice) {
288
+ this.windowWidth = window.innerWidth;
289
+ }
290
+ }
291
+
292
+ private setEnableRTL(): void {
293
+ (this.enableRtl ? addClass : removeClass)([this.element], RTL);
294
+ }
295
+
296
+ private setTarget(): void {
297
+ this.targetEle = <HTMLElement>this.element.nextElementSibling;
298
+ this.sidebarEleCopy = <HTMLElement>this.element.cloneNode(true);
299
+ if (typeof (this.target) === 'string') {
300
+ this.setProperties({ target: <HTMLElement>document.querySelector(this.target) }, true);
301
+ }
302
+ if (this.target) {
303
+ (<HTMLElement>this.target).insertBefore(this.element, (<HTMLElement>this.target).children[0]);
304
+ addClass([this.element], SIDEBARABSOLUTE);
305
+ addClass([(<HTMLElement>this.target)], CONTEXT);
306
+ this.targetEle = this.getTargetElement();
307
+ }
308
+ }
309
+
310
+ private getTargetElement(): HTMLElement {
311
+ let siblingElement: HTMLElement = <HTMLElement>this.element.nextElementSibling;
312
+ while (!isNOU(siblingElement)) {
313
+ if (!siblingElement.classList.contains(ROOT)) {
314
+ break;
315
+ }
316
+ siblingElement = <HTMLElement>siblingElement.nextElementSibling;
317
+ }
318
+ return siblingElement;
319
+ }
320
+
321
+ private setCloseOnDocumentClick(): void {
322
+ if (this.closeOnDocumentClick) {
323
+ EventHandler.add(document, 'mousedown touchstart', this.documentclickHandler, this);
324
+ } else {
325
+ EventHandler.remove(document, 'mousedown touchstart', this.documentclickHandler);
326
+ }
327
+ }
328
+
329
+ private setWidth(): void {
330
+ if (this.enableDock && this.position === 'Left') {
331
+ setStyle(this.element, { 'width': this.setDimension(this.dockSize) });
332
+ } else if (this.enableDock && this.position === 'Right') {
333
+ setStyle(this.element, { 'width': this.setDimension(this.dockSize) });
334
+ } else if (!this.enableDock) {
335
+ setStyle(this.element, { 'width': this.setDimension(this.width) });
336
+ }
337
+ }
338
+
339
+ private setDimension(width: number | string): string {
340
+ if (typeof width === 'number') {
341
+ width = formatUnit(width);
342
+ } else if (typeof width === 'string') {
343
+ width = (width.match(/px|%|em/)) ? width : formatUnit(width);
344
+ } else {
345
+ width = '100%';
346
+ }
347
+ return width;
348
+ }
349
+
350
+ private setZindex(): void {
351
+ setStyle(this.element, { 'z-index': '' + this.zIndex });
352
+ }
353
+
354
+ private addClass(): void {
355
+ if (this.element.tagName === "EJS-SIDEBAR") {
356
+ addClass([this.element], DISPLAY);
357
+ }
358
+ const classELement: HTMLElement = <HTMLElement>document.querySelector('.e-main-content');
359
+ if (!isNullOrUndefined(classELement || this.targetEle)) {
360
+ addClass([classELement || this.targetEle], [MAINCONTENTANIMATION]);
361
+ }
362
+ this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
363
+ if (!this.enableDock && this.type !== 'Auto') {
364
+ addClass([this.element], [VISIBILITY]);
365
+ }
366
+ removeClass([this.element], [OPEN, CLOSE, RIGHT, LEFT, SLIDE, PUSH, OVER]);
367
+ this.element.classList.add(ROOT);
368
+ addClass([this.element], (this.position === 'Right') ? RIGHT : LEFT);
369
+ if (this.enableDock) {
370
+ addClass([this.element], DOCKER);
371
+ }
372
+ this.element.setAttribute('tabindex', this.tabIndex);
373
+ if (this.type === 'Auto' && !Browser.isDevice) {
374
+ this.show();
375
+ } else if (!this.isOpen) {
376
+ addClass([this.element], CLOSE);
377
+ }
378
+ }
379
+ private checkType(val: boolean): void {
380
+ if (!(this.type === 'Push' || this.type === 'Over' || this.type === 'Slide')) {
381
+ this.type = 'Auto';
382
+ } else {
383
+ if (!this.element.classList.contains(CLOSE) && !val) {
384
+ this.hide();
385
+ }
386
+ }
387
+ }
388
+ private transitionEnd(e: Event): void {
389
+ this.setDock();
390
+ if (!isNullOrUndefined(e) && !this.firstRender) {
391
+ this.triggerChange();
392
+ }
393
+ this.firstRender = false;
394
+ EventHandler.remove(this.element, 'transitionend', this.transitionEnd);
395
+ }
396
+ private destroyBackDrop(): void {
397
+ const sibling: HTMLElement = (<HTMLElement>document.querySelector('.e-main-content')) || this.targetEle;
398
+ if (this.target && this.showBackdrop && sibling) {
399
+ removeClass([sibling], CONTEXTBACKDROP);
400
+ } else if (this.showBackdrop && this.modal) {
401
+ this.modal.style.display = 'none';
402
+ this.modal.outerHTML = '';
403
+ this.modal = null;
404
+ }
405
+ }
406
+ /* eslint-disable */
407
+ /**
408
+ * Hide the Sidebar component, if it is in an open state.
409
+ *
410
+ * @returns {void}
411
+ *
412
+ */
413
+ public hide(e?: Event): void {
414
+ const closeArguments: EventArgs = {
415
+ model: this,
416
+ element: this.element,
417
+ cancel: false,
418
+ isInteracted: !isNullOrUndefined(e),
419
+ event: (e || null)
420
+ };
421
+ this.trigger('close', closeArguments, (observedcloseArgs: EventArgs) => {
422
+ if (!observedcloseArgs.cancel) {
423
+ if (this.element.classList.contains(CLOSE)) {
424
+ return;
425
+ }
426
+ if (this.element.classList.contains(OPEN) && !this.animate) {
427
+ this.triggerChange();
428
+ }
429
+ addClass([this.element], CLOSE);
430
+ removeClass([this.element], OPEN);
431
+ setStyle(this.element, { 'width': formatUnit(this.enableDock ? this.dockSize : this.width) });
432
+ this.setType(this.type);
433
+ const sibling: HTMLElement = <HTMLElement>document.querySelector('.e-main-content') || this.targetEle;
434
+ if (!this.enableDock && sibling) {
435
+ sibling.style.transform = 'translateX(' + 0 + 'px)';
436
+ sibling.style[this.position === 'Left' ? 'marginLeft' : 'marginRight'] = '0px';
437
+ }
438
+ this.destroyBackDrop();
439
+ this.setAnimation();
440
+ if (this.type === 'Slide') {
441
+ document.body.classList.remove('e-sidebar-overflow');
442
+ }
443
+ this.setProperties({ isOpen: false }, true);
444
+ if (this.enableDock) {
445
+ setTimeout((): void => this.setTimeOut(), 50);
446
+ }
447
+ EventHandler.add(this.element, 'transitionend', this.transitionEnd, this);
448
+ }
449
+ });
450
+ }
451
+
452
+ private setTimeOut(): void {
453
+ const sibling: HTMLElement = <HTMLElement>document.querySelector('.e-main-content') || this.targetEle;
454
+ const elementWidth: number = this.element.getBoundingClientRect().width;
455
+ if (this.element.classList.contains(OPEN) && sibling && !(this.type === 'Over' && this.enableDock)) {
456
+ if (this.position === 'Left') {
457
+ sibling.style.marginLeft = this.setDimension(this.width === 'auto' ? elementWidth : this.width);
458
+ } else {
459
+ sibling.style.marginRight = this.setDimension(this.width === 'auto' ? elementWidth : this.width);
460
+ }
461
+ } else if (this.element.classList.contains(CLOSE) && sibling) {
462
+ if (this.position === 'Left') {
463
+ sibling.style.marginLeft = this.setDimension(this.dockSize === 'auto' ? elementWidth : this.dockSize);
464
+ } else {
465
+ sibling.style.marginRight = this.setDimension(this.dockSize === 'auto' ? elementWidth : this.dockSize);
466
+ }
467
+ }
468
+ }
469
+ /* eslint-disable */
470
+ /**
471
+ * Shows the Sidebar component, if it is in closed state.
472
+ *
473
+ * @returns {void}
474
+ */
475
+ public show(e?: Event): void {
476
+ const openArguments: EventArgs = {
477
+ model: this,
478
+ element: this.element,
479
+ cancel: false,
480
+ isInteracted: !isNullOrUndefined(e),
481
+ event: (e || null)
482
+ };
483
+ this.trigger('open', openArguments, (observedopenArgs: EventArgs) => {
484
+ if (!observedopenArgs.cancel) {
485
+ removeClass([this.element], VISIBILITY);
486
+ if (this.element.classList.contains(OPEN)) {
487
+ return;
488
+ }
489
+ if (this.element.classList.contains(CLOSE) && !this.animate) {
490
+ this.triggerChange();
491
+ }
492
+ addClass([this.element], [OPEN, TRASITION]);
493
+ setStyle(this.element, { 'transform': '' });
494
+ removeClass([this.element], CLOSE);
495
+ setStyle(this.element, { 'width': formatUnit(this.width) });
496
+ this.setType(this.type);
497
+ this.createBackDrop();
498
+ this.setAnimation();
499
+ if (this.type === 'Slide') {
500
+ document.body.classList.add('e-sidebar-overflow');
501
+ }
502
+ this.setProperties({ isOpen: true }, true);
503
+ EventHandler.add(this.element, 'transitionend', this.transitionEnd, this);
504
+ }
505
+ });
506
+ }
507
+
508
+ private setAnimation(): void {
509
+ if (this.animate) {
510
+ removeClass([this.element], DISABLEANIMATION);
511
+ } else {
512
+ addClass([this.element], DISABLEANIMATION);
513
+ }
514
+ }
515
+
516
+ private triggerChange(): void {
517
+ const changeArguments: ChangeEventArgs = { name: 'change', element: this.element };
518
+ this.trigger('change', changeArguments);
519
+ }
520
+
521
+ private setDock(): void {
522
+ if (this.enableDock && this.position === 'Left' && !this.getState()) {
523
+ setStyle(this.element, { 'transform': 'translateX(' + -100 + '%) translateX(' + this.setDimension(this.dockSize) + ')' });
524
+ } else if (this.enableDock && this.position === 'Right' && !this.getState()) {
525
+ setStyle(this.element, { 'transform': 'translateX(' + 100 + '%) translateX(' + '-' + this.setDimension(this.dockSize) + ')' });
526
+ }
527
+ if (this.element.classList.contains(CLOSE) && this.enableDock) {
528
+ setStyle(this.element, { 'width': this.setDimension(this.dockSize) });
529
+ }
530
+ }
531
+ private createBackDrop(): void {
532
+ if (this.target && this.showBackdrop && this.getState()) {
533
+ const sibling: HTMLElement = <HTMLElement>document.querySelector('.e-main-content') || this.targetEle;
534
+ addClass([sibling], CONTEXTBACKDROP);
535
+ } else if (this.showBackdrop && !this.modal && this.getState()) {
536
+ this.modal = this.createElement('div');
537
+ this.modal.className = DEFAULTBACKDROP;
538
+ this.modal.style.display = 'block';
539
+ document.body.appendChild(this.modal);
540
+ }
541
+ }
542
+
543
+ protected getPersistData(): string {
544
+ return this.addOnPersist(['type', 'position', 'isOpen']);
545
+ }
546
+
547
+ /**
548
+ * Returns the current module name.
549
+ *
550
+ * @returns {string} - returns module name.
551
+ * @private
552
+ *
553
+ */
554
+ protected getModuleName(): string {
555
+ return 'sidebar';
556
+ }
557
+
558
+ /**
559
+ * Shows or hides the Sidebar based on the current state.
560
+ *
561
+ * @returns {void}
562
+ */
563
+ public toggle(): void {
564
+ if (this.element.classList.contains(OPEN)) {
565
+ this.hide();
566
+ } else {
567
+ this.show();
568
+ }
569
+ }
570
+
571
+ protected getState(): boolean {
572
+ return this.element.classList.contains(OPEN) ? true : false;
573
+ }
574
+ private setMediaQuery(): void {
575
+ if (this.mediaQuery) {
576
+ let media: boolean = false;
577
+ if (typeof (this.mediaQuery) === 'string') {
578
+ media = window.matchMedia(this.mediaQuery).matches;
579
+ } else {
580
+ media = (this.mediaQuery).matches;
581
+ }
582
+ if (media && this.windowWidth !== window.innerWidth) {
583
+ this.show();
584
+ } else if (this.getState() && this.windowWidth !== window.innerWidth) {
585
+ this.hide();
586
+ }
587
+ }
588
+ }
589
+ protected resize(): void {
590
+ if (this.type === 'Auto') {
591
+ if (Browser.isDevice) {
592
+ addClass([this.element], OVER);
593
+ } else {
594
+ addClass([this.element], PUSH);
595
+ }
596
+ }
597
+ this.setMediaQuery();
598
+ if (Browser.isDevice) {
599
+ this.windowWidth = window.innerWidth;
600
+ }
601
+ }
602
+
603
+ private documentclickHandler(e: MouseEvent): void {
604
+ if (closest((<HTMLElement>e.target), '.' + CONTROL + '' + '.' + ROOT)) {
605
+ return;
606
+ }
607
+ this.hide(e);
608
+ }
609
+
610
+ private enableGestureHandler(args: SwipeEventArgs): void {
611
+ if (!this.isOpen && this.position === 'Left' && args.swipeDirection === 'Right' &&
612
+ (args.startX <= 20 && args.distanceX >= 50 && args.velocity >= 0.5)) {
613
+ this.show();
614
+ } else if (this.isOpen && this.position === 'Left' && args.swipeDirection === 'Left') {
615
+ this.hide();
616
+ } else if (this.isOpen && this.position === 'Right' && args.swipeDirection === 'Right') {
617
+ this.hide();
618
+ } else if (!this.isOpen && this.position === 'Right' && args.swipeDirection === 'Left'
619
+ && (window.innerWidth - args.startX <= 20 && args.distanceX >= 50 && args.velocity >= 0.5)) {
620
+ this.show();
621
+ }
622
+ }
623
+ private setEnableGestures(): void {
624
+ if (this.enableGestures) {
625
+ this.mainContentEle = new Touch(document.body, { swipe: this.enableGestureHandler.bind(this) });
626
+ this.sidebarEle = new Touch(<HTMLElement>this.element, { swipe: this.enableGestureHandler.bind(this) });
627
+ } else {
628
+ if (this.mainContentEle && this.sidebarEle) {
629
+ this.mainContentEle.destroy();
630
+ this.sidebarEle.destroy();
631
+ }
632
+ }
633
+ }
634
+ private wireEvents(): void {
635
+ this.setEnableGestures();
636
+ EventHandler.add(window as any, 'resize', this.resize, this);
637
+ }
638
+ private unWireEvents(): void {
639
+ EventHandler.remove(window as any, 'resize', this.resize);
640
+ EventHandler.remove(document, 'mousedown touchstart', this.documentclickHandler);
641
+ if (this.mainContentEle) { this.mainContentEle.destroy(); }
642
+ if (this.sidebarEle) { this.sidebarEle.destroy(); }
643
+ }
644
+ /**
645
+ * Called internally if any of the property value changed.
646
+ *
647
+ * @param {SidebarModel} newProp - specifies newProp value.
648
+ * @param {SidebarModel} oldProp - specifies oldProp value.
649
+ * @returns {void}
650
+ * @private
651
+ *
652
+ */
653
+ public onPropertyChanged(newProp: SidebarModel, oldProp: SidebarModel): void {
654
+ const sibling: HTMLElement = <HTMLElement>document.querySelector('.e-main-content') || this.targetEle;
655
+ const isRendered: boolean = this.isServerRendered;
656
+ for (const prop of Object.keys(newProp)) {
657
+ switch (prop) {
658
+ case 'isOpen':
659
+ if (this.isOpen) {
660
+ this.show();
661
+ } else {
662
+ this.hide();
663
+ }
664
+ break;
665
+ case 'width':
666
+ this.setWidth();
667
+ if (!this.getState()) {
668
+ this.setDock();
669
+ }
670
+ break;
671
+ case 'animate':
672
+ this.setAnimation();
673
+ break;
674
+ case 'type':
675
+ this.checkType(false);
676
+ removeClass([this.element], [VISIBILITY]);
677
+ this.addClass();
678
+ addClass([this.element], this.type === 'Auto' ? (Browser.isDevice ? ['e-over'] :
679
+ ['e-push']) : ['e-' + this.type.toLowerCase()]);
680
+ break;
681
+ case 'position':
682
+ this.element.style.transform = '';
683
+ this.setDock();
684
+ if (sibling) {
685
+ sibling.style[this.position === 'Left' ? 'marginRight' : 'marginLeft'] = '0px';
686
+ }
687
+ if (this.position === 'Right') {
688
+ removeClass([this.element], LEFT);
689
+ addClass([this.element], RIGHT);
690
+ } else {
691
+ removeClass([this.element], RIGHT);
692
+ addClass([this.element], LEFT);
693
+ }
694
+ this.setType(this.type);
695
+ break;
696
+ case 'showBackdrop':
697
+ if (this.showBackdrop) { this.createBackDrop(); } else {
698
+ if (this.modal) {
699
+ this.modal.style.display = 'none';
700
+ this.modal.outerHTML = '';
701
+ this.modal = null;
702
+ }
703
+ }
704
+ break;
705
+ case 'target':
706
+ if (typeof (this.target) === 'string') {
707
+ this.setProperties({ target: <HTMLElement>document.querySelector(this.target) }, true);
708
+ }
709
+ if (isNullOrUndefined(this.target)) {
710
+ removeClass([this.element], SIDEBARABSOLUTE);
711
+ removeClass([<HTMLElement>oldProp.target], CONTEXT);
712
+ setStyle(sibling, { 'margin-left': 0, 'margin-right': 0 });
713
+ document.body.insertAdjacentElement('afterbegin', this.element);
714
+ }
715
+ this.isServerRendered = false;
716
+ super.refresh();
717
+ this.isServerRendered = isRendered;
718
+ break;
719
+ case 'closeOnDocumentClick':
720
+ this.setCloseOnDocumentClick();
721
+ break;
722
+ case 'enableDock':
723
+ if (!this.getState()) {
724
+ this.setDock();
725
+ }
726
+ break;
727
+ case 'zIndex':
728
+ this.setZindex();
729
+ break;
730
+ case 'mediaQuery':
731
+ this.setMediaQuery();
732
+ break;
733
+ case 'enableGestures':
734
+ this.setEnableGestures();
735
+ break;
736
+ case 'enableRtl':
737
+ this.setEnableRTL();
738
+ break;
739
+ }
740
+ }
741
+ }
742
+
743
+ protected setType(type?: string): void {
744
+ const elementWidth: number = this.element.getBoundingClientRect().width;
745
+ this.setZindex();
746
+ const sibling: HTMLElement = <HTMLElement>document.querySelector('.e-main-content') || this.targetEle;
747
+ if (sibling) {
748
+ sibling.style.transform = 'translateX(' + 0 + 'px)';
749
+ if (!Browser.isDevice && this.type !== 'Auto' && !(this.type === 'Over' && this.enableDock)) {
750
+ sibling.style[this.position === 'Left' ? 'marginLeft' : 'marginRight'] = '0px';
751
+ }
752
+ }
753
+ const margin: string = this.position === 'Left' ? elementWidth + 'px' : elementWidth + 'px';
754
+ const eleWidth: number = this.position === 'Left' ? elementWidth : - (elementWidth);
755
+ removeClass([this.element], [PUSH, OVER, SLIDE]);
756
+ switch (type) {
757
+ case 'Push':
758
+ addClass([this.element], [PUSH]);
759
+ if (sibling && (this.enableDock || this.element.classList.contains(OPEN))) {
760
+ sibling.style[this.position === 'Left' ? 'marginLeft' : 'marginRight'] = margin;
761
+ } break;
762
+ case 'Slide':
763
+ addClass([this.element], [SLIDE]);
764
+ if (sibling && (this.enableDock || this.element.classList.contains(OPEN))) {
765
+ sibling.style.transform = 'translateX(' + eleWidth + 'px)';
766
+ } break;
767
+ case 'Over':
768
+ addClass([this.element], [OVER]);
769
+ if (this.enableDock && (this.element.classList.contains(CLOSE) || this.isOpen)) {
770
+ if (sibling) {
771
+ sibling.style[this.position === 'Left' ? 'marginLeft' : 'marginRight'] = this.setDimension(this.dockSize);
772
+ }
773
+ }
774
+ break;
775
+ case 'Auto':
776
+ addClass([this.element], [TRASITION]);
777
+ if (Browser.isDevice) {
778
+ if (sibling && (this.enableDock) && !this.getState()) {
779
+ sibling.style[this.position === 'Left' ? 'marginLeft' : 'marginRight'] = margin;
780
+ addClass([this.element], PUSH);
781
+ } else {
782
+ addClass([this.element], OVER);
783
+ }
784
+ } else {
785
+ addClass([this.element], PUSH);
786
+ if (sibling && (this.enableDock || this.element.classList.contains(OPEN))) {
787
+ sibling.style[this.position === 'Left' ? 'marginLeft' : 'marginRight'] = margin;
788
+ }
789
+ }
790
+ this.createBackDrop();
791
+ }
792
+ }
793
+
794
+ /**
795
+ * Removes the control from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
796
+ *
797
+ * @returns {void}
798
+ *
799
+ */
800
+ public destroy(): void {
801
+ super.destroy();
802
+ if (this.target) {
803
+ removeClass([<HTMLElement>this.target], CONTEXT);
804
+ }
805
+ this.destroyBackDrop();
806
+ if (this.element) {
807
+ removeClass([this.element], [OPEN, CLOSE, PUSH, SLIDE, OVER, LEFT, RIGHT, TRASITION]);
808
+ removeClass([this.element], SIDEBARABSOLUTE);
809
+ this.element.style.width = '';
810
+ this.element.style.zIndex = '';
811
+ this.element.style.transform = '';
812
+ if (!isNullOrUndefined(this.sidebarEleCopy.getAttribute('tabindex'))){
813
+ this.element.setAttribute('tabindex', this.tabIndex);
814
+ } else{
815
+ this.element.removeAttribute('tabindex');
816
+ }
817
+ }
818
+ this.windowWidth = null;
819
+ const sibling: HTMLElement = <HTMLElement>document.querySelector('.e-main-content') || this.targetEle;
820
+ if (!isNullOrUndefined(sibling)) {
821
+ sibling.style.margin = '';
822
+ sibling.style.transform = '';
823
+ }
824
+ this.unWireEvents();
825
+ }
826
+ }
827
+ /**
828
+ *
829
+ * Defines the event arguments for the event.
830
+ *
831
+ * @returns void
832
+ */
833
+
834
+ export interface ChangeEventArgs {
835
+ /**
836
+ * Returns event name
837
+ */
838
+ name: string;
839
+ /**
840
+ * Defines the element.
841
+ */
842
+ element: HTMLElement;
843
+ }
844
+
845
+ export interface TransitionEvent extends Event {
846
+ /**
847
+ * Returns event name
848
+ */
849
+ propertyName: string;
850
+ }
851
+
852
+ export interface EventArgs {
853
+ /**
854
+ * Illustrates whether the current action needs to be prevented or not.
855
+ */
856
+ cancel?: boolean;
857
+ /**
858
+ * Defines the Sidebar model.
859
+ */
860
+ model?: SidebarModel;
861
+ /**
862
+ * Defines the element.
863
+ */
864
+ element: HTMLElement;
865
+ /**
866
+ * Defines the boolean that returns true when the Sidebar is closed by user interaction, otherwise returns false.
867
+ */
868
+ isInteracted?: boolean;
869
+
870
+ /**
871
+ * Defines the original event arguments.
872
+ */
873
+ event?: MouseEvent | Event;
874
+ }