@aquera/nile-elements 1.5.4 → 1.5.6

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 (297) hide show
  1. package/README.md +10 -0
  2. package/demo/index.css +9 -0
  3. package/dist/index.cjs.js +1 -1
  4. package/dist/index.esm.js +1 -1
  5. package/dist/index.js +871 -255
  6. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  8. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +13 -2
  9. package/dist/nile-button/nile-button.cjs.js +1 -1
  10. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  11. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  12. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  13. package/dist/nile-button/nile-button.css.esm.js +89 -33
  14. package/dist/nile-button/nile-button.esm.js +2 -2
  15. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  16. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  17. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  18. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  19. package/dist/nile-calendar/nile-calendar.css.esm.js +59 -2
  20. package/dist/nile-calendar/nile-calendar.esm.js +16 -10
  21. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  22. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  23. package/dist/nile-checkbox/nile-checkbox.css.esm.js +4 -5
  24. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  25. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  26. package/dist/nile-chip/nile-chip.css.esm.js +37 -23
  27. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  28. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  29. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
  30. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
  31. package/dist/nile-code-editor/nile-code-editor.css.esm.js +7 -6
  32. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  33. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  34. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  35. package/dist/nile-date-picker/nile-date-picker.esm.js +4 -4
  36. package/dist/nile-detail/index.cjs.js +2 -0
  37. package/dist/nile-detail/index.cjs.js.map +1 -0
  38. package/dist/nile-detail/index.esm.js +1 -0
  39. package/dist/nile-detail/nile-detail.cjs.js +2 -0
  40. package/dist/nile-detail/nile-detail.cjs.js.map +1 -0
  41. package/dist/nile-detail/nile-detail.css.cjs.js +2 -0
  42. package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -0
  43. package/dist/nile-detail/nile-detail.css.esm.js +149 -0
  44. package/dist/nile-detail/nile-detail.esm.js +45 -0
  45. package/dist/nile-detail/nile-detail.utils.cjs.js +2 -0
  46. package/dist/nile-detail/nile-detail.utils.cjs.js.map +1 -0
  47. package/dist/nile-detail/nile-detail.utils.esm.js +1 -0
  48. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  49. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  50. package/dist/nile-dropdown/nile-dropdown.esm.js +1 -1
  51. package/dist/nile-file-upload/utils/file-validation.util.cjs.js +2 -2
  52. package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
  53. package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
  54. package/dist/nile-filter-chip/nile-filter-chip.cjs.js +1 -1
  55. package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
  56. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
  57. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
  58. package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +24 -2
  59. package/dist/nile-filter-chip/nile-filter-chip.esm.js +2 -2
  60. package/dist/nile-inline-edit/nile-inline-edit.cjs.js +1 -1
  61. package/dist/nile-inline-edit/nile-inline-edit.cjs.js.map +1 -1
  62. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js +1 -1
  63. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js.map +1 -1
  64. package/dist/nile-inline-edit/nile-inline-edit.css.esm.js +15 -6
  65. package/dist/nile-inline-edit/nile-inline-edit.esm.js +2 -2
  66. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js +1 -1
  67. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js.map +1 -1
  68. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js +1 -1
  69. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js.map +1 -1
  70. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.esm.js +19 -0
  71. package/dist/nile-inline-sidebar/nile-inline-sidebar.esm.js +16 -14
  72. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js +1 -1
  73. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js.map +1 -1
  74. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.esm.js +8 -3
  75. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  76. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  77. package/dist/nile-input/nile-input.css.esm.js +4 -4
  78. package/dist/nile-link/nile-link.cjs.js +1 -1
  79. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  80. package/dist/nile-link/nile-link.css.cjs.js +1 -1
  81. package/dist/nile-link/nile-link.css.cjs.js.map +1 -1
  82. package/dist/nile-link/nile-link.css.esm.js +3 -4
  83. package/dist/nile-link/nile-link.esm.js +2 -2
  84. package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
  85. package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
  86. package/dist/nile-pagination/nile-pagination.css.cjs.js +1 -1
  87. package/dist/nile-pagination/nile-pagination.css.cjs.js.map +1 -1
  88. package/dist/nile-pagination/nile-pagination.css.esm.js +109 -5
  89. package/dist/nile-pagination/nile-pagination.esm.js +70 -3
  90. package/dist/nile-qr-code/index.cjs.js +2 -0
  91. package/dist/nile-qr-code/index.cjs.js.map +1 -0
  92. package/dist/nile-qr-code/index.esm.js +1 -0
  93. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js +2 -0
  94. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js.map +1 -0
  95. package/dist/nile-qr-code/nile-qr-code-utils.esm.js +1 -0
  96. package/dist/nile-qr-code/nile-qr-code.cjs.js +2 -0
  97. package/dist/nile-qr-code/nile-qr-code.cjs.js.map +1 -0
  98. package/dist/nile-qr-code/nile-qr-code.css.cjs.js +2 -0
  99. package/dist/nile-qr-code/nile-qr-code.css.cjs.js.map +1 -0
  100. package/dist/nile-qr-code/nile-qr-code.css.esm.js +12 -0
  101. package/dist/nile-qr-code/nile-qr-code.esm.js +9 -0
  102. package/dist/nile-radio/nile-radio.css.cjs.js +1 -1
  103. package/dist/nile-radio/nile-radio.css.cjs.js.map +1 -1
  104. package/dist/nile-radio/nile-radio.css.esm.js +1 -1
  105. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
  106. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
  107. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
  108. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
  109. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +25 -6
  110. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
  111. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js +1 -1
  112. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js.map +1 -1
  113. package/dist/nile-rich-text-editor/nile-rte-select.esm.js +4 -3
  114. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  115. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  116. package/dist/nile-select/nile-select.css.esm.js +7 -4
  117. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  118. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  119. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +5 -1
  120. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  121. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  122. package/dist/nile-textarea/nile-textarea.css.esm.js +10 -5
  123. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +1 -1
  124. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -1
  125. package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +5 -3
  126. package/dist/src/index.d.ts +2 -0
  127. package/dist/src/index.js +2 -0
  128. package/dist/src/index.js.map +1 -1
  129. package/dist/src/nile-auto-complete/nile-auto-complete.css.js +11 -0
  130. package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
  131. package/dist/src/nile-button/nile-button.css.js +89 -33
  132. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  133. package/dist/src/nile-button/nile-button.js +5 -5
  134. package/dist/src/nile-button/nile-button.js.map +1 -1
  135. package/dist/src/nile-calendar/nile-calendar.css.js +57 -0
  136. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  137. package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
  138. package/dist/src/nile-calendar/nile-calendar.js +24 -6
  139. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  140. package/dist/src/nile-checkbox/nile-checkbox.css.js +4 -5
  141. package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  142. package/dist/src/nile-chip/nile-chip.css.js +35 -21
  143. package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  144. package/dist/src/nile-code-editor/nile-code-editor.css.js +7 -6
  145. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  146. package/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -1
  147. package/dist/src/nile-code-editor/nile-code-editor.js +7 -1
  148. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  149. package/dist/src/nile-date-picker/nile-date-picker.d.ts +3 -0
  150. package/dist/src/nile-date-picker/nile-date-picker.js +22 -2
  151. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  152. package/dist/src/nile-detail/index.d.ts +1 -0
  153. package/dist/src/nile-detail/index.js +2 -0
  154. package/dist/src/nile-detail/index.js.map +1 -0
  155. package/dist/src/nile-detail/nile-detail.css.d.ts +3 -0
  156. package/dist/src/nile-detail/nile-detail.css.js +152 -0
  157. package/dist/src/nile-detail/nile-detail.css.js.map +1 -0
  158. package/dist/src/nile-detail/nile-detail.d.ts +29 -0
  159. package/dist/src/nile-detail/nile-detail.js +143 -0
  160. package/dist/src/nile-detail/nile-detail.js.map +1 -0
  161. package/dist/src/nile-detail/nile-detail.test.d.ts +1 -0
  162. package/dist/src/nile-detail/nile-detail.test.js +168 -0
  163. package/dist/src/nile-detail/nile-detail.test.js.map +1 -0
  164. package/dist/src/nile-detail/nile-detail.utils.d.ts +8 -0
  165. package/dist/src/nile-detail/nile-detail.utils.js +117 -0
  166. package/dist/src/nile-detail/nile-detail.utils.js.map +1 -0
  167. package/dist/src/nile-dropdown/nile-dropdown.d.ts +1 -0
  168. package/dist/src/nile-dropdown/nile-dropdown.js +11 -0
  169. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  170. package/dist/src/nile-file-upload/utils/file-validation.util.js +11 -6
  171. package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
  172. package/dist/src/nile-filter-chip/nile-filter-chip.css.js +22 -0
  173. package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
  174. package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +1 -0
  175. package/dist/src/nile-filter-chip/nile-filter-chip.js +6 -0
  176. package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
  177. package/dist/src/nile-inline-edit/nile-inline-edit.css.js +15 -6
  178. package/dist/src/nile-inline-edit/nile-inline-edit.css.js.map +1 -1
  179. package/dist/src/nile-inline-edit/nile-inline-edit.d.ts +2 -0
  180. package/dist/src/nile-inline-edit/nile-inline-edit.js +7 -0
  181. package/dist/src/nile-inline-edit/nile-inline-edit.js.map +1 -1
  182. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js +19 -0
  183. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js.map +1 -1
  184. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.d.ts +6 -0
  185. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js +88 -4
  186. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js.map +1 -1
  187. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.d.ts +3 -0
  188. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.js +110 -0
  189. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.test.js.map +1 -0
  190. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.d.ts +2 -0
  191. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js +109 -0
  192. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js.map +1 -0
  193. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.d.ts +4 -0
  194. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +30 -2
  195. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +1 -1
  196. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.d.ts +2 -0
  197. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js +109 -0
  198. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js.map +1 -0
  199. package/dist/src/nile-input/nile-input.css.js +4 -4
  200. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  201. package/dist/src/nile-link/nile-link.css.js +1 -2
  202. package/dist/src/nile-link/nile-link.css.js.map +1 -1
  203. package/dist/src/nile-link/nile-link.js +1 -0
  204. package/dist/src/nile-link/nile-link.js.map +1 -1
  205. package/dist/src/nile-pagination/nile-pagination.css.js +107 -3
  206. package/dist/src/nile-pagination/nile-pagination.css.js.map +1 -1
  207. package/dist/src/nile-pagination/nile-pagination.d.ts +5 -1
  208. package/dist/src/nile-pagination/nile-pagination.js +84 -1
  209. package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
  210. package/dist/src/nile-pagination/nile-pagination.test.js +1187 -103
  211. package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -1
  212. package/dist/src/nile-qr-code/index.d.ts +1 -0
  213. package/dist/src/nile-qr-code/index.js +2 -0
  214. package/dist/src/nile-qr-code/index.js.map +1 -0
  215. package/dist/src/nile-qr-code/nile-qr-code-utils.d.ts +15 -0
  216. package/dist/src/nile-qr-code/nile-qr-code-utils.js +678 -0
  217. package/dist/src/nile-qr-code/nile-qr-code-utils.js.map +1 -0
  218. package/dist/src/nile-qr-code/nile-qr-code.css.d.ts +12 -0
  219. package/dist/src/nile-qr-code/nile-qr-code.css.js +24 -0
  220. package/dist/src/nile-qr-code/nile-qr-code.css.js.map +1 -0
  221. package/dist/src/nile-qr-code/nile-qr-code.d.ts +127 -0
  222. package/dist/src/nile-qr-code/nile-qr-code.js +381 -0
  223. package/dist/src/nile-qr-code/nile-qr-code.js.map +1 -0
  224. package/dist/src/nile-qr-code/nile-qr-code.test.d.ts +1 -0
  225. package/dist/src/nile-qr-code/nile-qr-code.test.js +719 -0
  226. package/dist/src/nile-qr-code/nile-qr-code.test.js.map +1 -0
  227. package/dist/src/nile-radio/nile-radio.css.js +1 -1
  228. package/dist/src/nile-radio/nile-radio.css.js.map +1 -1
  229. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +25 -6
  230. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
  231. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +1 -0
  232. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +17 -6
  233. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
  234. package/dist/src/nile-rich-text-editor/nile-rte-select.d.ts +1 -0
  235. package/dist/src/nile-rich-text-editor/nile-rte-select.js +7 -2
  236. package/dist/src/nile-rich-text-editor/nile-rte-select.js.map +1 -1
  237. package/dist/src/nile-select/nile-select.css.js +7 -4
  238. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  239. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +5 -1
  240. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  241. package/dist/src/nile-textarea/nile-textarea.css.js +10 -5
  242. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  243. package/dist/src/nile-virtual-select/nile-virtual-select.css.js +5 -3
  244. package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -1
  245. package/dist/src/version.js +1 -1
  246. package/dist/src/version.js.map +1 -1
  247. package/dist/tsconfig.tsbuildinfo +1 -1
  248. package/package.json +3 -2
  249. package/src/index.ts +3 -2
  250. package/src/nile-auto-complete/nile-auto-complete.css.ts +11 -0
  251. package/src/nile-button/nile-button.css.ts +89 -33
  252. package/src/nile-button/nile-button.ts +6 -5
  253. package/src/nile-calendar/nile-calendar.css.ts +57 -0
  254. package/src/nile-calendar/nile-calendar.ts +17 -6
  255. package/src/nile-checkbox/nile-checkbox.css.ts +4 -5
  256. package/src/nile-chip/nile-chip.css.ts +35 -21
  257. package/src/nile-code-editor/nile-code-editor.css.ts +7 -6
  258. package/src/nile-code-editor/nile-code-editor.ts +7 -1
  259. package/src/nile-date-picker/nile-date-picker.ts +22 -2
  260. package/src/nile-detail/index.ts +1 -0
  261. package/src/nile-detail/nile-detail.css.ts +153 -0
  262. package/src/nile-detail/nile-detail.test.ts +215 -0
  263. package/src/nile-detail/nile-detail.ts +140 -0
  264. package/src/nile-detail/nile-detail.utils.ts +133 -0
  265. package/src/nile-dropdown/nile-dropdown.ts +11 -0
  266. package/src/nile-file-upload/utils/file-validation.util.ts +10 -5
  267. package/src/nile-filter-chip/nile-filter-chip.css.ts +22 -0
  268. package/src/nile-filter-chip/nile-filter-chip.ts +2 -0
  269. package/src/nile-inline-edit/nile-inline-edit.css.ts +15 -6
  270. package/src/nile-inline-edit/nile-inline-edit.ts +4 -0
  271. package/src/nile-inline-sidebar/nile-inline-sidebar.css.ts +19 -0
  272. package/src/nile-inline-sidebar/nile-inline-sidebar.test.ts +108 -0
  273. package/src/nile-inline-sidebar/nile-inline-sidebar.ts +108 -5
  274. package/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.ts +107 -0
  275. package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.ts +107 -0
  276. package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts +34 -3
  277. package/src/nile-input/nile-input.css.ts +4 -4
  278. package/src/nile-link/nile-link.css.ts +1 -2
  279. package/src/nile-link/nile-link.ts +1 -0
  280. package/src/nile-pagination/nile-pagination.css.ts +107 -3
  281. package/src/nile-pagination/nile-pagination.test.ts +1388 -101
  282. package/src/nile-pagination/nile-pagination.ts +87 -2
  283. package/src/nile-qr-code/index.ts +1 -0
  284. package/src/nile-qr-code/nile-qr-code-utils.ts +733 -0
  285. package/src/nile-qr-code/nile-qr-code.css.ts +26 -0
  286. package/src/nile-qr-code/nile-qr-code.test.ts +879 -0
  287. package/src/nile-qr-code/nile-qr-code.ts +431 -0
  288. package/src/nile-radio/nile-radio.css.ts +1 -1
  289. package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +25 -6
  290. package/src/nile-rich-text-editor/nile-rich-text-editor.ts +14 -6
  291. package/src/nile-rich-text-editor/nile-rte-select.ts +5 -2
  292. package/src/nile-select/nile-select.css.ts +7 -4
  293. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +5 -1
  294. package/src/nile-textarea/nile-textarea.css.ts +10 -5
  295. package/src/nile-virtual-select/nile-virtual-select.css.ts +5 -3
  296. package/vscode-html-custom-data.json +163 -10
  297. package/web-test-runner.config.mjs +1 -1
@@ -1,106 +1,1393 @@
1
- import { expect, fixture, html } from '@open-wc/testing';
1
+ import { expect, fixture, html, elementUpdated } from '@open-wc/testing';
2
2
  import './nile-pagination';
3
3
  import type { NilePagination } from './nile-pagination';
4
4
 
5
5
  describe('NilePagination', () => {
6
- it('1. renders', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el).to.exist; });
7
- it('2. shadow root', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot).to.not.be.null; });
8
- it('3. tag name', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.tagName.toLowerCase()).to.equal('nile-pagination'); });
9
- it('4. is defined', async () => { expect(customElements.get('nile-pagination')).to.exist; });
10
- it('5. has styles', async () => { expect((await import('./nile-pagination')).NilePagination.styles).to.exist; });
11
- it('6. shadow mode', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.mode).to.equal('open'); });
12
- it('7. isConnected', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.isConnected).to.be.true; });
13
- it('8. removal', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); el.remove(); expect(el.isConnected).to.be.false; });
14
- it('9. outerHTML', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.outerHTML).to.contain('nile-pagination'); });
15
- it('10. matches', async () => { const el = await fixture<NilePagination>(html`<nile-pagination class="x"></nile-pagination>`); expect(el.matches('.x')).to.be.true; });
16
- it('11. closest', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.closest('nile-pagination')).to.equal(el); });
17
- it('12. cloneNode', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-pagination'); });
18
- it('13. dispatchEvent', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); let f = false; el.addEventListener('c', () => (f = true)); el.dispatchEvent(new Event('c')); expect(f).to.be.true; });
19
- it('14. updateComplete', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
20
- it('15. render method', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.render).to.be.a('function'); });
21
- it('16. shadowRoot host', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.host).to.equal(el); });
22
- it('17. class attr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination class="pg"></nile-pagination>`); expect(el.classList.contains('pg')).to.be.true; });
23
- it('18. id attr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination id="pg1"></nile-pagination>`); expect(el.id).to.equal('pg1'); });
24
- it('19. hidden', async () => { const el = await fixture<NilePagination>(html`<nile-pagination hidden></nile-pagination>`); expect(el.hidden).to.be.true; });
25
- it('20. nodeType', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.nodeType).to.equal(1); });
26
- it('21. localName', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.localName).to.equal('nile-pagination'); });
27
- it('22. namespaceURI', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
28
- it('23. ownerDocument', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.ownerDocument).to.equal(document); });
29
- it('24. multiple instances', async () => { const c = await fixture(html`<div><nile-pagination></nile-pagination><nile-pagination></nile-pagination></div>`); expect(c.querySelectorAll('nile-pagination').length).to.equal(2); });
30
- it('25. parent-child', async () => { const c = await fixture(html`<div><nile-pagination></nile-pagination></div>`); expect(c.querySelector('nile-pagination')!.parentElement).to.equal(c); });
31
- it('26. createElement', async () => { const el = document.createElement('nile-pagination') as NilePagination; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
32
- it('27. dataset', async () => { const el = await fixture<NilePagination>(html`<nile-pagination data-idx="0"></nile-pagination>`); expect(el.dataset.idx).to.equal('0'); });
33
- it('28. classList add', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
34
- it('29. getBoundingClientRect', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.getBoundingClientRect()).to.exist; });
35
- it('30. style attr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination style="color:red"></nile-pagination>`); expect(el.style.color).to.equal('red'); });
36
- it('31. aria-label', async () => { const el = await fixture<NilePagination>(html`<nile-pagination aria-label="P"></nile-pagination>`); expect(el.getAttribute('aria-label')).to.equal('P'); });
37
- it('32. dir', async () => { const el = await fixture<NilePagination>(html`<nile-pagination dir="rtl"></nile-pagination>`); expect(el.dir).to.equal('rtl'); });
38
- it('33. lang attr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination lang="en"></nile-pagination>`); expect(el.lang).to.equal('en'); });
39
- it('34. tabindex', async () => { const el = await fixture<NilePagination>(html`<nile-pagination tabindex="0"></nile-pagination>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
40
- it('35. requestUpdate', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
41
- it('36. shadow childNodes', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
42
- it('37. scrollIntoView', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.scrollIntoView).to.be.a('function'); });
43
- it('38. focus method', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.focus).to.be.a('function'); });
44
- it('39. blur method', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.blur).to.be.a('function'); });
45
- it('40. class toggle', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); el.classList.toggle('a'); expect(el.classList.contains('a')).to.be.true; });
46
- it('41. toggle hidden', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); el.hidden = true; expect(el.hidden).to.be.true; });
47
- it('42. dispatchCustomEvent', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); let d: any; el.addEventListener('t', ((e: CustomEvent) => { d = e.detail; }) as EventListener); el.dispatchEvent(new CustomEvent('t', { detail: 'x' })); expect(d).to.equal('x'); });
48
- it('43. nested in div', async () => { const c = await fixture(html`<div><nile-pagination></nile-pagination></div>`); expect(c.querySelector('nile-pagination')).to.exist; });
49
- it('44. default totalItems', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.totalItems).to.exist; });
50
- // it('45. default page', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.page).to.exist; });
51
- it('46. default pageSize', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.pageSize).to.exist; });
52
- it('47. set totalItems', async () => { const el = await fixture<NilePagination>(html`<nile-pagination total-items="100"></nile-pagination>`); expect(el.getAttribute('total-items')).to.equal('100'); });
53
- // it('48. set page', async () => { const el = await fixture<NilePagination>(html`<nile-pagination page="2"></nile-pagination>`); expect(el.page).to.equal(2); });
54
- it('49. set pageSize', async () => { const el = await fixture<NilePagination>(html`<nile-pagination page-size="25"></nile-pagination>`); expect(el.getAttribute('page-size')).to.equal('25'); });
55
- it('50. no canvas', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('canvas')).to.be.null; });
56
- it('51. no video', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('video')).to.be.null; });
57
- it('52. no audio', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('audio')).to.be.null; });
58
- it('53. has nav', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nav')).to.exist; });
59
- it('54. no aside', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('aside')).to.be.null; });
60
- it('55. no table', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('table')).to.be.null; });
61
- it('56. no img', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('img')).to.be.null; });
62
- it('57. no anchor', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('a')).to.be.null; });
63
- it('58. no svg', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('svg')).to.be.null; });
64
- it('59. no form', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('form')).to.be.null; });
65
- it('60. title attr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination title="PG"></nile-pagination>`); expect(el.title).to.equal('PG'); });
66
- it('61. no h1', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('h1')).to.be.null; });
67
- it('62. no pre', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('pre')).to.be.null; });
68
- it('63. no code', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('code')).to.be.null; });
69
- it('64. no hr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('hr')).to.be.null; });
70
- it('65. no nile-badge', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-badge')).to.be.null; });
71
- it('66. no nile-input', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-input')).to.be.null; });
72
- it('67. no nile-checkbox', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-checkbox')).to.be.null; });
73
- it('68. no nile-radio', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-radio')).to.be.null; });
74
- it('69. no nile-dialog', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-dialog')).to.be.null; });
75
- it('70. no nile-drawer', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-drawer')).to.be.null; });
76
- it('71. no nile-slider', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-slider')).to.be.null; });
77
- it('72. no nile-accordion', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-accordion')).to.be.null; });
78
- it('73. setAttribute data', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); el.setAttribute('data-test', '1'); expect(el.dataset.test).to.equal('1'); });
79
- it('74. removeAttribute hidden', async () => { const el = await fixture<NilePagination>(html`<nile-pagination hidden></nile-pagination>`); el.removeAttribute('hidden'); expect(el.hidden).to.be.false; });
80
- it('75. setAttribute class', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); el.setAttribute('class', 'test'); expect(el.classList.contains('test')).to.be.true; });
81
- it('76. aria-describedby', async () => { const el = await fixture<NilePagination>(html`<nile-pagination aria-describedby="d"></nile-pagination>`); expect(el.getAttribute('aria-describedby')).to.equal('d'); });
82
- it('77. multiple re-renders', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); for (let i = 0; i < 3; i++) { el.requestUpdate(); await el.updateComplete; } expect(el.shadowRoot).to.not.be.null; });
83
- it('78. contains', async () => { const el = await fixture<NilePagination>(html`<nile-pagination><span id="s1">C</span></nile-pagination>`); expect(el.contains(el.querySelector('#s1'))).to.be.true; });
84
- it('79. no textarea', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('textarea')).to.be.null; });
85
- it('80. no select', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('select')).to.be.null; });
86
- it('81. has ul', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('ul')).to.exist; });
87
- it('82. no p', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('p')).to.be.null; });
88
- it('83. no nile-card', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-card')).to.be.null; });
89
- it('84. no nile-tab', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-tab')).to.be.null; });
90
- it('85. no nile-stepper', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-stepper')).to.be.null; });
91
- it('86. has nile-button', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-button')).to.exist; });
92
- it('87. data attr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination data-x="1"></nile-pagination>`); expect(el.getAttribute('data-x')).to.equal('1'); });
93
- it('88. role attr', async () => { const el = await fixture<NilePagination>(html`<nile-pagination role="navigation"></nile-pagination>`); expect(el.getAttribute('role')).to.equal('navigation'); });
94
- it('89. no section', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('section')).to.be.null; });
95
- it('90. no header', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('header')).to.be.null; });
96
- it('91. no footer', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('footer')).to.be.null; });
97
- it('92. no main', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('main')).to.be.null; });
98
- it('93. no article', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('article')).to.be.null; });
99
- it('94. no nile-toolbar', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-toolbar')).to.be.null; });
100
- it('95. no nile-link', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-link')).to.be.null; });
101
- it('96. has nile-menu', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-menu')).to.exist; });
102
- it('97. no nile-select', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-select')).to.be.null; });
103
- it('98. no nile-textarea', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-textarea')).to.be.null; });
104
- it('99. nile-icon in shadow', async () => { const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`); expect(el.shadowRoot!.querySelector('nile-icon')).to.exist; });
105
- // it('100. full integration', async () => { const el = await fixture<NilePagination>(html`<nile-pagination total-items="100" page="1" page-size="10" class="pg" id="pg1" role="navigation"></nile-pagination>`); expect(el.totalItems).to.equal(100); expect(el.page).to.equal(1); expect(el.pageSize).to.equal(10); expect(el.id).to.equal('pg1'); expect(el.shadowRoot).to.not.be.null; });
6
+ // ═══════════════════════════════════════════════════
7
+ // RENDERING & REGISTRATION
8
+ // ═══════════════════════════════════════════════════
9
+
10
+ it('1. should render without errors', async () => {
11
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
12
+ expect(el).to.exist;
13
+ });
14
+
15
+ it('2. should have a shadow root', async () => {
16
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
17
+ expect(el.shadowRoot).to.not.be.null;
18
+ });
19
+
20
+ it('3. should be registered as a custom element', async () => {
21
+ expect(customElements.get('nile-pagination')).to.exist;
22
+ });
23
+
24
+ it('4. should have correct tag name', async () => {
25
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
26
+ expect(el.tagName.toLowerCase()).to.equal('nile-pagination');
27
+ });
28
+
29
+ it('5. should have styles defined', async () => {
30
+ const { NilePagination } = await import('./nile-pagination');
31
+ expect(NilePagination.styles).to.exist;
32
+ });
33
+
34
+ it('6. should have open shadow root mode', async () => {
35
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
36
+ expect(el.shadowRoot!.mode).to.equal('open');
37
+ });
38
+
39
+ it('7. should be connected when in DOM', async () => {
40
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
41
+ expect(el.isConnected).to.be.true;
42
+ });
43
+
44
+ it('8. should disconnect when removed', async () => {
45
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
46
+ el.remove();
47
+ expect(el.isConnected).to.be.false;
48
+ });
49
+
50
+ it('9. should render multiple instances', async () => {
51
+ const wrapper = await fixture(html`
52
+ <div>
53
+ <nile-pagination></nile-pagination>
54
+ <nile-pagination></nile-pagination>
55
+ </div>
56
+ `);
57
+ expect(wrapper.querySelectorAll('nile-pagination').length).to.equal(2);
58
+ });
59
+
60
+ it('10. should be creatable via document.createElement', async () => {
61
+ const el = document.createElement('nile-pagination') as NilePagination;
62
+ document.body.appendChild(el);
63
+ await el.updateComplete;
64
+ expect(el.shadowRoot).to.not.be.null;
65
+ document.body.removeChild(el);
66
+ });
67
+
68
+ // ═══════════════════════════════════════════════════
69
+ // DEFAULT PROPERTY VALUES
70
+ // ═══════════════════════════════════════════════════
71
+
72
+ it('11. should default totalItems to 0', async () => {
73
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
74
+ expect(el.totalItems).to.equal(0);
75
+ });
76
+
77
+ it('12. should default currentPage to 1', async () => {
78
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
79
+ expect(el.currentPage).to.equal(1);
80
+ });
81
+
82
+ it('13. should default pageSize to 50', async () => {
83
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
84
+ expect(el.pageSize).to.equal(50);
85
+ });
86
+
87
+ it('14. should default variant to fluid', async () => {
88
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
89
+ expect(el.variant).to.equal('fluid');
90
+ });
91
+
92
+ it('15. should default disabled to false', async () => {
93
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
94
+ expect(el.disabled).to.be.false;
95
+ });
96
+
97
+ it('16. should default showTitle to true', async () => {
98
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
99
+ expect(el.showTitle).to.be.true;
100
+ });
101
+
102
+ it('17. should default pageSizeOptions to [10, 25, 50, 100]', async () => {
103
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
104
+ expect(el.pageSizeOptions).to.deep.equal([10, 25, 50, 100]);
105
+ });
106
+
107
+ // ═══════════════════════════════════════════════════
108
+ // ATTRIBUTE → PROPERTY CONVERTERS (totalItems)
109
+ // ═══════════════════════════════════════════════════
110
+
111
+ it('18. should parse totalitems attribute as number', async () => {
112
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200"></nile-pagination>`);
113
+ expect(el.totalItems).to.equal(200);
114
+ });
115
+
116
+ it('19. should floor non-integer totalitems', async () => {
117
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="99.7"></nile-pagination>`);
118
+ expect(el.totalItems).to.equal(99);
119
+ });
120
+
121
+ it('20. should default totalitems to 0 for negative values', async () => {
122
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="-5"></nile-pagination>`);
123
+ expect(el.totalItems).to.equal(0);
124
+ });
125
+
126
+ it('21. should default totalitems to 0 for non-numeric strings', async () => {
127
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="abc"></nile-pagination>`);
128
+ expect(el.totalItems).to.equal(0);
129
+ });
130
+
131
+ it('22. should default totalitems to 0 for Infinity', async () => {
132
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="Infinity"></nile-pagination>`);
133
+ expect(el.totalItems).to.equal(0);
134
+ });
135
+
136
+ it('23. should reflect totalitems attribute', async () => {
137
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="150"></nile-pagination>`);
138
+ expect(el.getAttribute('totalitems')).to.equal('150');
139
+ });
140
+
141
+ // ═══════════════════════════════════════════════════
142
+ // ATTRIBUTE → PROPERTY CONVERTERS (currentPage)
143
+ // ═══════════════════════════════════════════════════
144
+
145
+ it('24. should parse currentpage attribute as number', async () => {
146
+ const el = await fixture<NilePagination>(html`<nile-pagination currentpage="3"></nile-pagination>`);
147
+ expect(el.currentPage).to.equal(3);
148
+ });
149
+
150
+ it('25. should floor non-integer currentpage', async () => {
151
+ const el = await fixture<NilePagination>(html`<nile-pagination currentpage="2.9"></nile-pagination>`);
152
+ expect(el.currentPage).to.equal(2);
153
+ });
154
+
155
+ it('26. should default currentpage to 1 for values < 1', async () => {
156
+ const el = await fixture<NilePagination>(html`<nile-pagination currentpage="0"></nile-pagination>`);
157
+ expect(el.currentPage).to.equal(1);
158
+ });
159
+
160
+ it('27. should default currentpage to 1 for negative values', async () => {
161
+ const el = await fixture<NilePagination>(html`<nile-pagination currentpage="-3"></nile-pagination>`);
162
+ expect(el.currentPage).to.equal(1);
163
+ });
164
+
165
+ it('28. should default currentpage to 1 for non-numeric strings', async () => {
166
+ const el = await fixture<NilePagination>(html`<nile-pagination currentpage="xyz"></nile-pagination>`);
167
+ expect(el.currentPage).to.equal(1);
168
+ });
169
+
170
+ it('29. should reflect currentpage attribute', async () => {
171
+ const el = await fixture<NilePagination>(html`<nile-pagination currentpage="5"></nile-pagination>`);
172
+ expect(el.getAttribute('currentpage')).to.equal('5');
173
+ });
174
+
175
+ // ═══════════════════════════════════════════════════
176
+ // ATTRIBUTE → PROPERTY CONVERTERS (pageSize)
177
+ // ═══════════════════════════════════════════════════
178
+
179
+ it('30. should parse pagesize attribute as number', async () => {
180
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesize="25"></nile-pagination>`);
181
+ expect(el.pageSize).to.equal(25);
182
+ });
183
+
184
+ it('31. should floor non-integer pagesize', async () => {
185
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesize="10.5"></nile-pagination>`);
186
+ expect(el.pageSize).to.equal(10);
187
+ });
188
+
189
+ it('32. should default pagesize to 50 for values < 1', async () => {
190
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesize="0"></nile-pagination>`);
191
+ expect(el.pageSize).to.equal(50);
192
+ });
193
+
194
+ it('33. should default pagesize to 50 for negative values', async () => {
195
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesize="-10"></nile-pagination>`);
196
+ expect(el.pageSize).to.equal(50);
197
+ });
198
+
199
+ it('34. should default pagesize to 50 for non-numeric strings', async () => {
200
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesize="foo"></nile-pagination>`);
201
+ expect(el.pageSize).to.equal(50);
202
+ });
203
+
204
+ it('35. should reflect pagesize attribute', async () => {
205
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesize="10"></nile-pagination>`);
206
+ expect(el.getAttribute('pagesize')).to.equal('10');
207
+ });
208
+
209
+ // ═══════════════════════════════════════════════════
210
+ // ATTRIBUTE → PROPERTY CONVERTERS (pageSizeOptions)
211
+ // ═══════════════════════════════════════════════════
212
+
213
+ it('36. should parse pagesizeoptions from JSON array', async () => {
214
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesizeoptions="[5,10,20]"></nile-pagination>`);
215
+ expect(el.pageSizeOptions).to.deep.equal([5, 10, 20]);
216
+ });
217
+
218
+ it('37. should fallback to defaults for invalid pagesizeoptions JSON', async () => {
219
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesizeoptions="invalid"></nile-pagination>`);
220
+ expect(el.pageSizeOptions).to.deep.equal([10, 25, 50, 100]);
221
+ });
222
+
223
+ it('38. should fallback to defaults for non-number array pagesizeoptions', async () => {
224
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesizeoptions='["a","b"]'></nile-pagination>`);
225
+ expect(el.pageSizeOptions).to.deep.equal([10, 25, 50, 100]);
226
+ });
227
+
228
+ it('39. should fallback to defaults for non-array pagesizeoptions', async () => {
229
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesizeoptions='{"a":1}'></nile-pagination>`);
230
+ expect(el.pageSizeOptions).to.deep.equal([10, 25, 50, 100]);
231
+ });
232
+
233
+ // ═══════════════════════════════════════════════════
234
+ // TOTAL PAGES CALCULATION
235
+ // ═══════════════════════════════════════════════════
236
+
237
+ it('40. should calculate totalPages as 1 when totalItems is 0', async () => {
238
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="0" pagesize="10"></nile-pagination>`);
239
+ await el.updateComplete;
240
+ // With 0 items, totalPages should still be at least 1
241
+ const nav = el.shadowRoot!.querySelector('nav');
242
+ expect(nav).to.exist;
243
+ });
244
+
245
+ it('41. should calculate totalPages correctly (100 items, 10 per page = 10 pages)', async () => {
246
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
247
+ await el.updateComplete;
248
+ // Should render page buttons for 10 pages in fluid variant
249
+ const buttons = el.shadowRoot!.querySelectorAll('ul.pagination nile-button');
250
+ // 7 visible pages (1..7 since <=7) + prev + next = 9 when totalPages=10, with ellipsis
251
+ expect(buttons.length).to.be.greaterThan(2); // At least prev + next
252
+ });
253
+
254
+ it('42. should calculate totalPages correctly with remainder (105 items, 10 per page = 11 pages)', async () => {
255
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="105" pagesize="10"></nile-pagination>`);
256
+ await el.updateComplete;
257
+ const nav = el.shadowRoot!.querySelector('nav');
258
+ expect(nav).to.exist;
259
+ });
260
+
261
+ // ═══════════════════════════════════════════════════
262
+ // FLUID VARIANT RENDERING
263
+ // ═══════════════════════════════════════════════════
264
+
265
+ it('43. should render wrapper with fluid class by default', async () => {
266
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
267
+ const wrapper = el.shadowRoot!.querySelector('.pagination-wrapper');
268
+ expect(wrapper).to.exist;
269
+ expect(wrapper!.classList.contains('fluid')).to.be.true;
270
+ });
271
+
272
+ it('44. should render nav element in fluid variant', async () => {
273
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
274
+ const nav = el.shadowRoot!.querySelector('nav');
275
+ expect(nav).to.exist;
276
+ expect(nav!.getAttribute('aria-label')).to.equal('Pagination');
277
+ });
278
+
279
+ it('45. should render range text in fluid variant with showTitle', async () => {
280
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
281
+ await el.updateComplete;
282
+ const rangeText = el.shadowRoot!.querySelector('.range-text');
283
+ expect(rangeText).to.exist;
284
+ expect(rangeText!.textContent).to.contain('Showing');
285
+ });
286
+
287
+ it('46. should show correct range text for first page', async () => {
288
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
289
+ await el.updateComplete;
290
+ const rangeText = el.shadowRoot!.querySelector('.range-text');
291
+ expect(rangeText!.textContent).to.contain('1');
292
+ expect(rangeText!.textContent).to.contain('10');
293
+ expect(rangeText!.textContent).to.contain('100');
294
+ });
295
+
296
+ it('47. should show correct range text for middle page', async () => {
297
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="5"></nile-pagination>`);
298
+ await el.updateComplete;
299
+ const rangeText = el.shadowRoot!.querySelector('.range-text');
300
+ expect(rangeText!.textContent).to.contain('41');
301
+ expect(rangeText!.textContent).to.contain('50');
302
+ expect(rangeText!.textContent).to.contain('100');
303
+ });
304
+
305
+ it('48. should show correct range text for last page', async () => {
306
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="95" pagesize="10" currentpage="10"></nile-pagination>`);
307
+ await el.updateComplete;
308
+ const rangeText = el.shadowRoot!.querySelector('.range-text');
309
+ expect(rangeText!.textContent).to.contain('91');
310
+ expect(rangeText!.textContent).to.contain('95');
311
+ });
312
+
313
+ it('49. should show "Showing 0 of 0" when totalItems is 0 in fluid variant', async () => {
314
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="0"></nile-pagination>`);
315
+ await el.updateComplete;
316
+ const rangeText = el.shadowRoot!.querySelector('.range-text');
317
+ expect(rangeText).to.exist;
318
+ expect(rangeText!.textContent).to.contain('0 of 0');
319
+ });
320
+
321
+ it('50. should not render range text in fluid variant when showTitle is false', async () => {
322
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" .showTitle=${false}></nile-pagination>`);
323
+ await el.updateComplete;
324
+ const rangeText = el.shadowRoot!.querySelector('.range-text');
325
+ expect(rangeText).to.be.null;
326
+ });
327
+
328
+ it('51. should render page-size-select in fluid variant', async () => {
329
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
330
+ const pageSizeSelect = el.shadowRoot!.querySelector('.page-size-select');
331
+ expect(pageSizeSelect).to.exist;
332
+ });
333
+
334
+ it('52. should render "Items per page" label in fluid variant', async () => {
335
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
336
+ const label = el.shadowRoot!.querySelector('.page-size-label');
337
+ expect(label).to.exist;
338
+ expect(label!.textContent).to.contain('Items per page');
339
+ });
340
+
341
+ it('53. should render page size dropdown showing current pageSize in fluid variant', async () => {
342
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesize="25"></nile-pagination>`);
343
+ await el.updateComplete;
344
+ const trigger = el.shadowRoot!.querySelector('.page-size-dropdown nile-button');
345
+ expect(trigger).to.exist;
346
+ expect(trigger!.textContent).to.contain('25');
347
+ });
348
+
349
+ it('54. should render page size options as menu items in fluid variant', async () => {
350
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
351
+ await el.updateComplete;
352
+ const menuItems = el.shadowRoot!.querySelectorAll('.page-size-dropdown nile-menu-item');
353
+ expect(menuItems.length).to.equal(4); // [10, 25, 50, 100]
354
+ });
355
+
356
+ it('55. should render ul.pagination in fluid variant', async () => {
357
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
358
+ const ul = el.shadowRoot!.querySelector('ul.pagination');
359
+ expect(ul).to.exist;
360
+ });
361
+
362
+ it('56. should render prev button in fluid variant', async () => {
363
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
364
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button');
365
+ expect(prevBtn).to.exist;
366
+ });
367
+
368
+ it('57. should render next button in fluid variant', async () => {
369
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
370
+ const nextBtn = el.shadowRoot!.querySelector('.next-button');
371
+ expect(nextBtn).to.exist;
372
+ });
373
+
374
+ it('58. should render page number buttons in fluid variant for <= 7 pages', async () => {
375
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="50" pagesize="10"></nile-pagination>`);
376
+ await el.updateComplete;
377
+ // 5 pages, all visible + prev + next
378
+ const buttons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button');
379
+ expect(buttons.length).to.equal(7); // 5 pages + prev + next
380
+ });
381
+
382
+ it('59. should render ellipsis dropdown for > 7 pages in fluid variant', async () => {
383
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="10"></nile-pagination>`);
384
+ await el.updateComplete;
385
+ const ellipsis = el.shadowRoot!.querySelector('.ellipsis-dropdown');
386
+ expect(ellipsis).to.exist;
387
+ });
388
+
389
+ it('60. should highlight current page with primary variant button', async () => {
390
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="50" pagesize="10" currentpage="3"></nile-pagination>`);
391
+ await el.updateComplete;
392
+ const pageButtons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button:not(.prev-button):not(.next-button)');
393
+ const currentBtn = Array.from(pageButtons).find(btn => btn.textContent!.trim() === '3');
394
+ expect(currentBtn).to.exist;
395
+ expect(currentBtn!.getAttribute('variant')).to.equal('primary');
396
+ });
397
+
398
+ it('61. should use ghost variant for non-current pages', async () => {
399
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="50" pagesize="10" currentpage="3"></nile-pagination>`);
400
+ await el.updateComplete;
401
+ const pageButtons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button:not(.prev-button):not(.next-button)');
402
+ const otherBtn = Array.from(pageButtons).find(btn => btn.textContent!.trim() === '1');
403
+ expect(otherBtn).to.exist;
404
+ expect(otherBtn!.getAttribute('variant')).to.equal('ghost');
405
+ });
406
+
407
+ // ═══════════════════════════════════════════════════
408
+ // COMPACT VARIANT RENDERING
409
+ // ═══════════════════════════════════════════════════
410
+
411
+ it('62. should render wrapper with compact class', async () => {
412
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="100" pagesize="10"></nile-pagination>`);
413
+ const wrapper = el.shadowRoot!.querySelector('.pagination-wrapper.compact');
414
+ expect(wrapper).to.exist;
415
+ });
416
+
417
+ it('63. should render compact range text without "Showing" prefix', async () => {
418
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
419
+ await el.updateComplete;
420
+ const rangeText = el.shadowRoot!.querySelector('.range-text');
421
+ expect(rangeText).to.exist;
422
+ // compact trims "Showing " from the start
423
+ expect(rangeText!.textContent!.trim().startsWith('Showing')).to.be.false;
424
+ });
425
+
426
+ it('64. should render compact page size dropdown', async () => {
427
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact"></nile-pagination>`);
428
+ await el.updateComplete;
429
+ const dropdown = el.shadowRoot!.querySelector('.compact-dropdown');
430
+ expect(dropdown).to.exist;
431
+ });
432
+
433
+ it('65. should render compact pagination with current page dropdown', async () => {
434
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="100" pagesize="10"></nile-pagination>`);
435
+ await el.updateComplete;
436
+ const compactPagination = el.shadowRoot!.querySelector('.compact-pagination');
437
+ expect(compactPagination).to.exist;
438
+ });
439
+
440
+ it('66. should show current page in compact page dropdown trigger', async () => {
441
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="100" pagesize="10" currentpage="3"></nile-pagination>`);
442
+ await el.updateComplete;
443
+ const trigger = el.shadowRoot!.querySelector('.current-page-btn');
444
+ expect(trigger).to.exist;
445
+ expect(trigger!.textContent).to.contain('3');
446
+ });
447
+
448
+ it('67. should render all page numbers in compact page dropdown', async () => {
449
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="50" pagesize="10"></nile-pagination>`);
450
+ await el.updateComplete;
451
+ const menuItems = el.shadowRoot!.querySelectorAll('.compact-scroll-wrapper1 nile-menu-item');
452
+ expect(menuItems.length).to.equal(5); // 5 total pages
453
+ });
454
+
455
+ it('68. should render prev and next buttons in compact variant', async () => {
456
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="100" pagesize="10"></nile-pagination>`);
457
+ await el.updateComplete;
458
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button');
459
+ const nextBtn = el.shadowRoot!.querySelector('.next-button');
460
+ expect(prevBtn).to.exist;
461
+ expect(nextBtn).to.exist;
462
+ });
463
+
464
+ it('69. should not render page-size-select in compact variant', async () => {
465
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact"></nile-pagination>`);
466
+ await el.updateComplete;
467
+ const pageSizeSelect = el.shadowRoot!.querySelector('.page-size-select');
468
+ expect(pageSizeSelect).to.be.null;
469
+ });
470
+
471
+ it('70. should render compact page size options as menu items', async () => {
472
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact"></nile-pagination>`);
473
+ await el.updateComplete;
474
+ const menuItems = el.shadowRoot!.querySelectorAll('.compact-scroll-wrapper nile-menu-item');
475
+ expect(menuItems.length).to.equal(4); // default [10, 25, 50, 100]
476
+ });
477
+
478
+ // ═══════════════════════════════════════════════════
479
+ // MINI VARIANT RENDERING
480
+ // ═══════════════════════════════════════════════════
481
+
482
+ it('71. should render mini wrapper with mini class', async () => {
483
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
484
+ const wrapper = el.shadowRoot!.querySelector('.pagination-wrapper.mini');
485
+ expect(wrapper).to.exist;
486
+ });
487
+
488
+ it('72. should render "Showing" label in mini variant', async () => {
489
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
490
+ await el.updateComplete;
491
+ const label = el.shadowRoot!.querySelector('.mini-showing-label');
492
+ expect(label).to.exist;
493
+ expect(label!.textContent).to.contain('Showing');
494
+ });
495
+
496
+ it('73. should render "of N" label in mini variant with correct total pages', async () => {
497
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
498
+ await el.updateComplete;
499
+ const ofLabel = el.shadowRoot!.querySelector('.mini-of-label');
500
+ expect(ofLabel).to.exist;
501
+ expect(ofLabel!.textContent).to.contain('of 10');
502
+ });
503
+
504
+ it('74. should render mini page dropdown with current page', async () => {
505
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="3"></nile-pagination>`);
506
+ await el.updateComplete;
507
+ const pageBtn = el.shadowRoot!.querySelector('.mini-page-btn');
508
+ expect(pageBtn).to.exist;
509
+ expect(pageBtn!.textContent).to.contain('3');
510
+ });
511
+
512
+ it('75. should render all page options in mini dropdown', async () => {
513
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="50" pagesize="10"></nile-pagination>`);
514
+ await el.updateComplete;
515
+ const menuItems = el.shadowRoot!.querySelectorAll('.mini-scroll-wrapper nile-menu-item');
516
+ expect(menuItems.length).to.equal(5); // 5 total pages
517
+ });
518
+
519
+ it('76. should render mini prev button', async () => {
520
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
521
+ await el.updateComplete;
522
+ const prevBtn = el.shadowRoot!.querySelector('.mini-prev-button');
523
+ expect(prevBtn).to.exist;
524
+ });
525
+
526
+ it('77. should render mini next button', async () => {
527
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
528
+ await el.updateComplete;
529
+ const nextBtn = el.shadowRoot!.querySelector('.mini-next-button');
530
+ expect(nextBtn).to.exist;
531
+ });
532
+
533
+ it('78. should render mini-nav container', async () => {
534
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
535
+ await el.updateComplete;
536
+ const nav = el.shadowRoot!.querySelector('.mini-nav');
537
+ expect(nav).to.exist;
538
+ });
539
+
540
+ it('79. should render mini-pagination list', async () => {
541
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
542
+ await el.updateComplete;
543
+ const ul = el.shadowRoot!.querySelector('.mini-pagination');
544
+ expect(ul).to.exist;
545
+ });
546
+
547
+ it('80. should not render pager-container in mini variant', async () => {
548
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
549
+ await el.updateComplete;
550
+ const pagerContainer = el.shadowRoot!.querySelector('.pager-container');
551
+ expect(pagerContainer).to.be.null;
552
+ });
553
+
554
+ it('81. should not render page number buttons in mini variant', async () => {
555
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
556
+ await el.updateComplete;
557
+ // mini only has prev/next, no numbered page buttons in the list
558
+ const ellipsis = el.shadowRoot!.querySelector('.ellipsis-dropdown');
559
+ expect(ellipsis).to.be.null;
560
+ });
561
+
562
+ // ═══════════════════════════════════════════════════
563
+ // NAVIGATION — PREV / NEXT BUTTONS
564
+ // ═══════════════════════════════════════════════════
565
+
566
+ it('82. should disable prev button on first page (fluid)', async () => {
567
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
568
+ await el.updateComplete;
569
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button') as HTMLElement;
570
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
571
+ });
572
+
573
+ it('83. should enable prev button when not on first page (fluid)', async () => {
574
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="3"></nile-pagination>`);
575
+ await el.updateComplete;
576
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button') as HTMLElement;
577
+ expect(prevBtn.hasAttribute('disabled')).to.be.false;
578
+ });
579
+
580
+ it('84. should disable next button on last page (fluid)', async () => {
581
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="10"></nile-pagination>`);
582
+ await el.updateComplete;
583
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
584
+ expect(nextBtn.hasAttribute('disabled')).to.be.true;
585
+ });
586
+
587
+ it('85. should enable next button when not on last page (fluid)', async () => {
588
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="5"></nile-pagination>`);
589
+ await el.updateComplete;
590
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
591
+ expect(nextBtn.hasAttribute('disabled')).to.be.false;
592
+ });
593
+
594
+ it('86. should disable mini prev button on first page', async () => {
595
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
596
+ await el.updateComplete;
597
+ const prevBtn = el.shadowRoot!.querySelector('.mini-prev-button') as HTMLElement;
598
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
599
+ });
600
+
601
+ it('87. should enable mini prev button when not on first page', async () => {
602
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="5"></nile-pagination>`);
603
+ await el.updateComplete;
604
+ const prevBtn = el.shadowRoot!.querySelector('.mini-prev-button') as HTMLElement;
605
+ expect(prevBtn.hasAttribute('disabled')).to.be.false;
606
+ });
607
+
608
+ it('88. should disable mini next button on last page', async () => {
609
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="10"></nile-pagination>`);
610
+ await el.updateComplete;
611
+ const nextBtn = el.shadowRoot!.querySelector('.mini-next-button') as HTMLElement;
612
+ expect(nextBtn.hasAttribute('disabled')).to.be.true;
613
+ });
614
+
615
+ it('89. should enable mini next button when not on last page', async () => {
616
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="3"></nile-pagination>`);
617
+ await el.updateComplete;
618
+ const nextBtn = el.shadowRoot!.querySelector('.mini-next-button') as HTMLElement;
619
+ expect(nextBtn.hasAttribute('disabled')).to.be.false;
620
+ });
621
+
622
+ // ═══════════════════════════════════════════════════
623
+ // NAVIGATION — goToPage + nile-change EVENT
624
+ // ═══════════════════════════════════════════════════
625
+
626
+ it('90. should navigate to next page on next button click (fluid)', async () => {
627
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
628
+ await el.updateComplete;
629
+ let detail: any;
630
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
631
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
632
+ nextBtn.click();
633
+ await el.updateComplete;
634
+ expect(detail).to.exist;
635
+ expect(detail.page).to.equal(2);
636
+ expect(detail.previousPage).to.equal(1);
637
+ expect(detail.pageSize).to.equal(10);
638
+ });
639
+
640
+ it('91. should navigate to previous page on prev button click (fluid)', async () => {
641
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="5"></nile-pagination>`);
642
+ await el.updateComplete;
643
+ let detail: any;
644
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
645
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button') as HTMLElement;
646
+ prevBtn.click();
647
+ await el.updateComplete;
648
+ expect(detail).to.exist;
649
+ expect(detail.page).to.equal(4);
650
+ expect(detail.previousPage).to.equal(5);
651
+ });
652
+
653
+ it('92. should navigate to clicked page number (fluid)', async () => {
654
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="50" pagesize="10" currentpage="1"></nile-pagination>`);
655
+ await el.updateComplete;
656
+ let detail: any;
657
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
658
+ // Find page 3 button
659
+ const pageButtons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button:not(.prev-button):not(.next-button)');
660
+ const page3Btn = Array.from(pageButtons).find(btn => btn.textContent!.trim() === '3') as HTMLElement;
661
+ expect(page3Btn).to.exist;
662
+ page3Btn!.click();
663
+ await el.updateComplete;
664
+ expect(detail.page).to.equal(3);
665
+ expect(detail.previousPage).to.equal(1);
666
+ });
667
+
668
+ it('93. should update currentPage property after navigation', async () => {
669
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
670
+ await el.updateComplete;
671
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
672
+ nextBtn.click();
673
+ await el.updateComplete;
674
+ expect(el.currentPage).to.equal(2);
675
+ });
676
+
677
+ it('94. should navigate to next page on mini next button click', async () => {
678
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
679
+ await el.updateComplete;
680
+ let detail: any;
681
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
682
+ const nextBtn = el.shadowRoot!.querySelector('.mini-next-button') as HTMLElement;
683
+ nextBtn.click();
684
+ await el.updateComplete;
685
+ expect(detail.page).to.equal(2);
686
+ expect(detail.previousPage).to.equal(1);
687
+ });
688
+
689
+ it('95. should navigate to prev page on mini prev button click', async () => {
690
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="5"></nile-pagination>`);
691
+ await el.updateComplete;
692
+ let detail: any;
693
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
694
+ const prevBtn = el.shadowRoot!.querySelector('.mini-prev-button') as HTMLElement;
695
+ prevBtn.click();
696
+ await el.updateComplete;
697
+ expect(detail.page).to.equal(4);
698
+ expect(detail.previousPage).to.equal(5);
699
+ });
700
+
701
+ // ═══════════════════════════════════════════════════
702
+ // DISABLED STATE
703
+ // ═══════════════════════════════════════════════════
704
+
705
+ it('96. should not navigate when disabled (fluid)', async () => {
706
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="5" disabled></nile-pagination>`);
707
+ await el.updateComplete;
708
+ let eventFired = false;
709
+ el.addEventListener('nile-change', () => { eventFired = true; });
710
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
711
+ nextBtn.click();
712
+ await el.updateComplete;
713
+ expect(eventFired).to.be.false;
714
+ expect(el.currentPage).to.equal(5);
715
+ });
716
+
717
+ it('97. should disable all nav buttons when disabled is true (fluid)', async () => {
718
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="5" disabled></nile-pagination>`);
719
+ await el.updateComplete;
720
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button') as HTMLElement;
721
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
722
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
723
+ expect(nextBtn.hasAttribute('disabled')).to.be.true;
724
+ });
725
+
726
+ it('98. should disable all page number buttons when disabled (fluid)', async () => {
727
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="50" pagesize="10" disabled></nile-pagination>`);
728
+ await el.updateComplete;
729
+ const pageButtons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button');
730
+ pageButtons.forEach(btn => {
731
+ expect((btn as HTMLElement).hasAttribute('disabled')).to.be.true;
732
+ });
733
+ });
734
+
735
+ it('99. should disable page-size dropdown trigger when disabled (fluid)', async () => {
736
+ const el = await fixture<NilePagination>(html`<nile-pagination disabled></nile-pagination>`);
737
+ await el.updateComplete;
738
+ const dropdown = el.shadowRoot!.querySelector('.page-size-dropdown') as HTMLElement;
739
+ expect(dropdown.hasAttribute('disabled')).to.be.true;
740
+ });
741
+
742
+ it('100. should not navigate when disabled (mini)', async () => {
743
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="5" disabled></nile-pagination>`);
744
+ await el.updateComplete;
745
+ let eventFired = false;
746
+ el.addEventListener('nile-change', () => { eventFired = true; });
747
+ const nextBtn = el.shadowRoot!.querySelector('.mini-next-button') as HTMLElement;
748
+ nextBtn.click();
749
+ await el.updateComplete;
750
+ expect(eventFired).to.be.false;
751
+ expect(el.currentPage).to.equal(5);
752
+ });
753
+
754
+ it('101. should disable mini nav buttons when disabled', async () => {
755
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" currentpage="5" disabled></nile-pagination>`);
756
+ await el.updateComplete;
757
+ const prevBtn = el.shadowRoot!.querySelector('.mini-prev-button') as HTMLElement;
758
+ const nextBtn = el.shadowRoot!.querySelector('.mini-next-button') as HTMLElement;
759
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
760
+ expect(nextBtn.hasAttribute('disabled')).to.be.true;
761
+ });
762
+
763
+ it('102. should disable compact dropdown when disabled', async () => {
764
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" disabled></nile-pagination>`);
765
+ await el.updateComplete;
766
+ const dropdown = el.shadowRoot!.querySelector('.compact-dropdown') as HTMLElement;
767
+ expect(dropdown.hasAttribute('disabled')).to.be.true;
768
+ });
769
+
770
+ it('103. should disable mini page dropdown when disabled', async () => {
771
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10" disabled></nile-pagination>`);
772
+ await el.updateComplete;
773
+ const dropdown = el.shadowRoot!.querySelector('.mini-page-dropdown') as HTMLElement;
774
+ expect(dropdown.hasAttribute('disabled')).to.be.true;
775
+ });
776
+
777
+ // ═══════════════════════════════════════════════════
778
+ // PAGE SIZE CHANGE
779
+ // ═══════════════════════════════════════════════════
780
+
781
+ it('104. should emit nile-change with page=1 on page size change (fluid)', async () => {
782
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="50" currentpage="3"></nile-pagination>`);
783
+ await el.updateComplete;
784
+ let detail: any;
785
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
786
+ const menuItems = el.shadowRoot!.querySelectorAll('.page-size-dropdown nile-menu-item');
787
+ // Click the first option (10)
788
+ (menuItems[0] as HTMLElement).click();
789
+ await el.updateComplete;
790
+ expect(detail).to.exist;
791
+ expect(detail.page).to.equal(1);
792
+ expect(detail.previousPage).to.equal(3);
793
+ expect(detail.pageSize).to.equal(10);
794
+ });
795
+
796
+ it('105. should reset to page 1 after page size change', async () => {
797
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="50" currentpage="3"></nile-pagination>`);
798
+ await el.updateComplete;
799
+ const menuItems = el.shadowRoot!.querySelectorAll('.page-size-dropdown nile-menu-item');
800
+ (menuItems[0] as HTMLElement).click();
801
+ await el.updateComplete;
802
+ expect(el.currentPage).to.equal(1);
803
+ expect(el.pageSize).to.equal(10);
804
+ });
805
+
806
+ it('106. should not emit event when selecting same page size', async () => {
807
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="50"></nile-pagination>`);
808
+ await el.updateComplete;
809
+ let eventFired = false;
810
+ el.addEventListener('nile-change', () => { eventFired = true; });
811
+ // 50 is the 3rd option (index 2) in default [10,25,50,100]
812
+ const menuItems = el.shadowRoot!.querySelectorAll('.page-size-dropdown nile-menu-item');
813
+ (menuItems[2] as HTMLElement).click();
814
+ await el.updateComplete;
815
+ expect(eventFired).to.be.false;
816
+ });
817
+
818
+ it('107. should not change page size when disabled', async () => {
819
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="50" disabled></nile-pagination>`);
820
+ await el.updateComplete;
821
+ let eventFired = false;
822
+ el.addEventListener('nile-change', () => { eventFired = true; });
823
+ const menuItems = el.shadowRoot!.querySelectorAll('.page-size-dropdown nile-menu-item');
824
+ (menuItems[0] as HTMLElement).click();
825
+ await el.updateComplete;
826
+ expect(eventFired).to.be.false;
827
+ expect(el.pageSize).to.equal(50);
828
+ });
829
+
830
+ it('108. should emit nile-change with page=1 on compact page size change', async () => {
831
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="200" pagesize="50" currentpage="2"></nile-pagination>`);
832
+ await el.updateComplete;
833
+ let detail: any;
834
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
835
+ const menuItems = el.shadowRoot!.querySelectorAll('.compact-scroll-wrapper nile-menu-item');
836
+ (menuItems[0] as HTMLElement).click();
837
+ await el.updateComplete;
838
+ expect(detail).to.exist;
839
+ expect(detail.page).to.equal(1);
840
+ expect(detail.pageSize).to.equal(10);
841
+ });
842
+
843
+ // ═══════════════════════════════════════════════════
844
+ // DYNAMIC PROPERTY UPDATES
845
+ // ═══════════════════════════════════════════════════
846
+
847
+ it('109. should re-render when totalItems changes', async () => {
848
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="50" pagesize="10"></nile-pagination>`);
849
+ await el.updateComplete;
850
+ el.totalItems = 200;
851
+ await el.updateComplete;
852
+ // With 200 items / 10 per page = 20 pages, should show ellipsis
853
+ const ellipsis = el.shadowRoot!.querySelector('.ellipsis-dropdown');
854
+ expect(ellipsis).to.exist;
855
+ });
856
+
857
+ it('110. should re-render when currentPage changes programmatically', async () => {
858
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="50" pagesize="10" currentpage="1"></nile-pagination>`);
859
+ await el.updateComplete;
860
+ el.currentPage = 3;
861
+ await el.updateComplete;
862
+ const pageButtons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button:not(.prev-button):not(.next-button)');
863
+ const currentBtn = Array.from(pageButtons).find(btn => btn.getAttribute('variant') === 'primary');
864
+ expect(currentBtn).to.exist;
865
+ expect(currentBtn!.textContent!.trim()).to.equal('3');
866
+ });
867
+
868
+ it('111. should re-render when pageSize changes programmatically', async () => {
869
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
870
+ await el.updateComplete;
871
+ el.pageSize = 25;
872
+ await el.updateComplete;
873
+ // 100/25 = 4 pages, so all pages visible (<=7)
874
+ const pageButtons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button:not(.prev-button):not(.next-button)');
875
+ expect(pageButtons.length).to.equal(4);
876
+ });
877
+
878
+ it('112. should re-render when variant changes', async () => {
879
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
880
+ await el.updateComplete;
881
+ expect(el.shadowRoot!.querySelector('.pagination-wrapper.fluid')).to.exist;
882
+ el.variant = 'compact';
883
+ await el.updateComplete;
884
+ expect(el.shadowRoot!.querySelector('.pagination-wrapper.compact')).to.exist;
885
+ });
886
+
887
+ it('113. should switch to mini rendering when variant changes to mini', async () => {
888
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
889
+ await el.updateComplete;
890
+ el.variant = 'mini';
891
+ await el.updateComplete;
892
+ expect(el.shadowRoot!.querySelector('.pagination-wrapper.mini')).to.exist;
893
+ expect(el.shadowRoot!.querySelector('.mini-showing-label')).to.exist;
894
+ });
895
+
896
+ it('114. should update disabled state dynamically', async () => {
897
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="5"></nile-pagination>`);
898
+ await el.updateComplete;
899
+ el.disabled = true;
900
+ await el.updateComplete;
901
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button') as HTMLElement;
902
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
903
+ });
904
+
905
+ // ═══════════════════════════════════════════════════
906
+ // EVENT DETAILS
907
+ // ═══════════════════════════════════════════════════
908
+
909
+ it('115. should emit nile-change event that bubbles', async () => {
910
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10" currentpage="1"></nile-pagination>`);
911
+ await el.updateComplete;
912
+ let bubbled = false;
913
+ document.addEventListener('nile-change', () => { bubbled = true; }, { once: true });
914
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
915
+ nextBtn.click();
916
+ await el.updateComplete;
917
+ expect(bubbled).to.be.true;
918
+ });
919
+
920
+ it('116. should include page, previousPage, and pageSize in event detail', async () => {
921
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="25" currentpage="2"></nile-pagination>`);
922
+ await el.updateComplete;
923
+ let detail: any;
924
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
925
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
926
+ nextBtn.click();
927
+ await el.updateComplete;
928
+ expect(detail).to.have.property('page', 3);
929
+ expect(detail).to.have.property('previousPage', 2);
930
+ expect(detail).to.have.property('pageSize', 25);
931
+ });
932
+
933
+ // ═══════════════════════════════════════════════════
934
+ // PAGINATION ITEMS (ELLIPSIS LOGIC) — FLUID
935
+ // ═══════════════════════════════════════════════════
936
+
937
+ it('117. should show all pages without ellipsis when totalPages <= 7', async () => {
938
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="70" pagesize="10" currentpage="1"></nile-pagination>`);
939
+ await el.updateComplete;
940
+ const ellipsis = el.shadowRoot!.querySelector('.ellipsis-dropdown');
941
+ expect(ellipsis).to.be.null;
942
+ });
943
+
944
+ it('118. should show ellipsis when totalPages > 7', async () => {
945
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="10" currentpage="1"></nile-pagination>`);
946
+ await el.updateComplete;
947
+ const ellipsis = el.shadowRoot!.querySelector('.ellipsis-dropdown');
948
+ expect(ellipsis).to.exist;
949
+ });
950
+
951
+ it('119. should show right ellipsis when on early pages', async () => {
952
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="10" currentpage="2"></nile-pagination>`);
953
+ await el.updateComplete;
954
+ const ellipsisDropdowns = el.shadowRoot!.querySelectorAll('.ellipsis-dropdown');
955
+ expect(ellipsisDropdowns.length).to.be.greaterThan(0);
956
+ });
957
+
958
+ it('120. should show left ellipsis when on late pages', async () => {
959
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="10" currentpage="19"></nile-pagination>`);
960
+ await el.updateComplete;
961
+ const ellipsisDropdowns = el.shadowRoot!.querySelectorAll('.ellipsis-dropdown');
962
+ expect(ellipsisDropdowns.length).to.be.greaterThan(0);
963
+ });
964
+
965
+ it('121. should show two ellipsis when on middle pages', async () => {
966
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="10" currentpage="10"></nile-pagination>`);
967
+ await el.updateComplete;
968
+ const ellipsisDropdowns = el.shadowRoot!.querySelectorAll('.ellipsis-dropdown');
969
+ expect(ellipsisDropdowns.length).to.equal(2);
970
+ });
971
+
972
+ it('122. should render hidden pages in ellipsis dropdown', async () => {
973
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="200" pagesize="10" currentpage="10"></nile-pagination>`);
974
+ await el.updateComplete;
975
+ const ellipsisMenuItems = el.shadowRoot!.querySelectorAll('.ellipsis-scroll-wrapper nile-menu-item');
976
+ expect(ellipsisMenuItems.length).to.be.greaterThan(0);
977
+ });
978
+
979
+ // ═══════════════════════════════════════════════════
980
+ // EDGE CASES
981
+ // ═══════════════════════════════════════════════════
982
+
983
+ it('123. should handle single page (totalItems <= pageSize)', async () => {
984
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="5" pagesize="10" currentpage="1"></nile-pagination>`);
985
+ await el.updateComplete;
986
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button') as HTMLElement;
987
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
988
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
989
+ expect(nextBtn.hasAttribute('disabled')).to.be.true;
990
+ });
991
+
992
+ it('124. should handle totalItems equal to pageSize (exactly one page)', async () => {
993
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="10" pagesize="10" currentpage="1"></nile-pagination>`);
994
+ await el.updateComplete;
995
+ const pageButtons = el.shadowRoot!.querySelectorAll('ul.pagination > li > nile-button:not(.prev-button):not(.next-button)');
996
+ expect(pageButtons.length).to.equal(1);
997
+ });
998
+
999
+ it('125. should handle large totalItems', async () => {
1000
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="10000" pagesize="10" currentpage="500"></nile-pagination>`);
1001
+ await el.updateComplete;
1002
+ expect(el.shadowRoot!.querySelector('nav')).to.exist;
1003
+ });
1004
+
1005
+ it('126. should handle mini with single page', async () => {
1006
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="5" pagesize="10" currentpage="1"></nile-pagination>`);
1007
+ await el.updateComplete;
1008
+ const ofLabel = el.shadowRoot!.querySelector('.mini-of-label');
1009
+ expect(ofLabel!.textContent).to.contain('of 1');
1010
+ const prevBtn = el.shadowRoot!.querySelector('.mini-prev-button') as HTMLElement;
1011
+ const nextBtn = el.shadowRoot!.querySelector('.mini-next-button') as HTMLElement;
1012
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
1013
+ expect(nextBtn.hasAttribute('disabled')).to.be.true;
1014
+ });
1015
+
1016
+ it('127. should handle compact with single page', async () => {
1017
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="5" pagesize="10" currentpage="1"></nile-pagination>`);
1018
+ await el.updateComplete;
1019
+ const prevBtn = el.shadowRoot!.querySelector('.prev-button') as HTMLElement;
1020
+ const nextBtn = el.shadowRoot!.querySelector('.next-button') as HTMLElement;
1021
+ expect(prevBtn.hasAttribute('disabled')).to.be.true;
1022
+ expect(nextBtn.hasAttribute('disabled')).to.be.true;
1023
+ });
1024
+
1025
+ // ═══════════════════════════════════════════════════
1026
+ // ACCESSIBILITY & PARTS
1027
+ // ═══════════════════════════════════════════════════
1028
+
1029
+ it('128. should have aria-label="Pagination" on nav in fluid variant', async () => {
1030
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
1031
+ const nav = el.shadowRoot!.querySelector('nav');
1032
+ expect(nav!.getAttribute('aria-label')).to.equal('Pagination');
1033
+ });
1034
+
1035
+ it('129. should have aria-label="Pagination" on nav in compact variant', async () => {
1036
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="100" pagesize="10"></nile-pagination>`);
1037
+ const nav = el.shadowRoot!.querySelector('nav');
1038
+ expect(nav!.getAttribute('aria-label')).to.equal('Pagination');
1039
+ });
1040
+
1041
+ it('130. should have aria-label="Pagination" on mini nav', async () => {
1042
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
1043
+ const nav = el.shadowRoot!.querySelector('nav');
1044
+ expect(nav!.getAttribute('aria-label')).to.equal('Pagination');
1045
+ });
1046
+
1047
+ it('131. should expose wrapper part', async () => {
1048
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1049
+ const wrapper = el.shadowRoot!.querySelector('[part="wrapper"]');
1050
+ expect(wrapper).to.exist;
1051
+ });
1052
+
1053
+ it('132. should expose range-text part in fluid variant', async () => {
1054
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
1055
+ await el.updateComplete;
1056
+ const rangeText = el.shadowRoot!.querySelector('[part="range-text"]');
1057
+ expect(rangeText).to.exist;
1058
+ });
1059
+
1060
+ it('133. should expose pagesize-label part in fluid variant', async () => {
1061
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1062
+ const label = el.shadowRoot!.querySelector('[part="pagesize-label"]');
1063
+ expect(label).to.exist;
1064
+ });
1065
+
1066
+ it('134. should expose page-list part in fluid variant', async () => {
1067
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
1068
+ const pageList = el.shadowRoot!.querySelector('[part="page-list"]');
1069
+ expect(pageList).to.exist;
1070
+ });
1071
+
1072
+ it('135. should expose mini parts', async () => {
1073
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
1074
+ await el.updateComplete;
1075
+ expect(el.shadowRoot!.querySelector('[part="mini-showing-label"]')).to.exist;
1076
+ expect(el.shadowRoot!.querySelector('[part="mini-page-dropdown"]')).to.exist;
1077
+ expect(el.shadowRoot!.querySelector('[part="mini-of-label"]')).to.exist;
1078
+ expect(el.shadowRoot!.querySelector('[part="mini-nav"]')).to.exist;
1079
+ expect(el.shadowRoot!.querySelector('[part="mini-page-list"]')).to.exist;
1080
+ });
1081
+
1082
+ // ═══════════════════════════════════════════════════
1083
+ // NILE-ICON RENDERING
1084
+ // ═══════════════════════════════════════════════════
1085
+
1086
+ it('136. should render nile-icon elements in fluid pagination', async () => {
1087
+ const el = await fixture<NilePagination>(html`<nile-pagination totalitems="100" pagesize="10"></nile-pagination>`);
1088
+ const icons = el.shadowRoot!.querySelectorAll('nile-icon');
1089
+ expect(icons.length).to.be.greaterThan(0);
1090
+ });
1091
+
1092
+ it('137. should render chevron icon in page-size dropdown (fluid)', async () => {
1093
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1094
+ const chevron = el.shadowRoot!.querySelector('.page-size-dropdown .chevron');
1095
+ expect(chevron).to.exist;
1096
+ });
1097
+
1098
+ it('138. should render chevron icon in mini page dropdown', async () => {
1099
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="100" pagesize="10"></nile-pagination>`);
1100
+ await el.updateComplete;
1101
+ const chevron = el.shadowRoot!.querySelector('.mini-page-dropdown .chevron');
1102
+ expect(chevron).to.exist;
1103
+ });
1104
+
1105
+ it('139. should render chevron icon in compact page-size dropdown', async () => {
1106
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact"></nile-pagination>`);
1107
+ await el.updateComplete;
1108
+ const chevron = el.shadowRoot!.querySelector('.compact-dropdown .chevron');
1109
+ expect(chevron).to.exist;
1110
+ });
1111
+
1112
+ it('140. should render chevron icon in compact page dropdown', async () => {
1113
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="100" pagesize="10"></nile-pagination>`);
1114
+ await el.updateComplete;
1115
+ const chevron = el.shadowRoot!.querySelector('.compact-dropdown1 .chevron');
1116
+ expect(chevron).to.exist;
1117
+ });
1118
+
1119
+ // ═══════════════════════════════════════════════════
1120
+ // NEGATIVE DOM CHECKS
1121
+ // ═══════════════════════════════════════════════════
1122
+
1123
+ it('141. should not contain canvas', async () => {
1124
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1125
+ expect(el.shadowRoot!.querySelector('canvas')).to.be.null;
1126
+ });
1127
+
1128
+ it('142. should not contain video', async () => {
1129
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1130
+ expect(el.shadowRoot!.querySelector('video')).to.be.null;
1131
+ });
1132
+
1133
+ it('143. should not contain form', async () => {
1134
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1135
+ expect(el.shadowRoot!.querySelector('form')).to.be.null;
1136
+ });
1137
+
1138
+ it('144. should not contain img', async () => {
1139
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1140
+ expect(el.shadowRoot!.querySelector('img')).to.be.null;
1141
+ });
1142
+
1143
+ it('145. should not contain table', async () => {
1144
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1145
+ expect(el.shadowRoot!.querySelector('table')).to.be.null;
1146
+ });
1147
+
1148
+ it('146. should not contain nile-input', async () => {
1149
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1150
+ expect(el.shadowRoot!.querySelector('nile-input')).to.be.null;
1151
+ });
1152
+
1153
+ it('147. should not contain nile-dialog', async () => {
1154
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1155
+ expect(el.shadowRoot!.querySelector('nile-dialog')).to.be.null;
1156
+ });
1157
+
1158
+ it('148. should not contain nile-checkbox', async () => {
1159
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1160
+ expect(el.shadowRoot!.querySelector('nile-checkbox')).to.be.null;
1161
+ });
1162
+
1163
+ it('149. should not contain nile-select', async () => {
1164
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1165
+ expect(el.shadowRoot!.querySelector('nile-select')).to.be.null;
1166
+ });
1167
+
1168
+ it('150. should not contain anchor tag', async () => {
1169
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1170
+ expect(el.shadowRoot!.querySelector('a')).to.be.null;
1171
+ });
1172
+
1173
+ // ═══════════════════════════════════════════════════
1174
+ // GENERIC DOM ATTRIBUTES
1175
+ // ═══════════════════════════════════════════════════
1176
+
1177
+ it('151. should support class attribute', async () => {
1178
+ const el = await fixture<NilePagination>(html`<nile-pagination class="pg"></nile-pagination>`);
1179
+ expect(el.classList.contains('pg')).to.be.true;
1180
+ });
1181
+
1182
+ it('152. should support id attribute', async () => {
1183
+ const el = await fixture<NilePagination>(html`<nile-pagination id="pg1"></nile-pagination>`);
1184
+ expect(el.id).to.equal('pg1');
1185
+ });
1186
+
1187
+ it('153. should support hidden attribute', async () => {
1188
+ const el = await fixture<NilePagination>(html`<nile-pagination hidden></nile-pagination>`);
1189
+ expect(el.hidden).to.be.true;
1190
+ });
1191
+
1192
+ it('154. should support data attributes', async () => {
1193
+ const el = await fixture<NilePagination>(html`<nile-pagination data-test="val"></nile-pagination>`);
1194
+ expect(el.dataset.test).to.equal('val');
1195
+ });
1196
+
1197
+ it('155. should support aria-label attribute', async () => {
1198
+ const el = await fixture<NilePagination>(html`<nile-pagination aria-label="Page nav"></nile-pagination>`);
1199
+ expect(el.getAttribute('aria-label')).to.equal('Page nav');
1200
+ });
1201
+
1202
+ it('156. should support dir attribute', async () => {
1203
+ const el = await fixture<NilePagination>(html`<nile-pagination dir="rtl"></nile-pagination>`);
1204
+ expect(el.dir).to.equal('rtl');
1205
+ });
1206
+
1207
+ it('157. should support style attribute', async () => {
1208
+ const el = await fixture<NilePagination>(html`<nile-pagination style="color:red"></nile-pagination>`);
1209
+ expect(el.style.color).to.equal('red');
1210
+ });
1211
+
1212
+ it('158. should support role attribute', async () => {
1213
+ const el = await fixture<NilePagination>(html`<nile-pagination role="navigation"></nile-pagination>`);
1214
+ expect(el.getAttribute('role')).to.equal('navigation');
1215
+ });
1216
+
1217
+ // ═══════════════════════════════════════════════════
1218
+ // CUSTOM PAGE SIZE OPTIONS
1219
+ // ═══════════════════════════════════════════════════
1220
+
1221
+ it('159. should render custom page size options (fluid)', async () => {
1222
+ const el = await fixture<NilePagination>(html`<nile-pagination pagesizeoptions="[5,15,30]"></nile-pagination>`);
1223
+ await el.updateComplete;
1224
+ const menuItems = el.shadowRoot!.querySelectorAll('.page-size-dropdown nile-menu-item');
1225
+ expect(menuItems.length).to.equal(3);
1226
+ });
1227
+
1228
+ it('160. should render custom page size options (compact)', async () => {
1229
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" pagesizeoptions="[5,15,30]"></nile-pagination>`);
1230
+ await el.updateComplete;
1231
+ const menuItems = el.shadowRoot!.querySelectorAll('.compact-scroll-wrapper nile-menu-item');
1232
+ expect(menuItems.length).to.equal(3);
1233
+ });
1234
+
1235
+ // ═══════════════════════════════════════════════════
1236
+ // RE-RENDER & LIFECYCLE
1237
+ // ═══════════════════════════════════════════════════
1238
+
1239
+ it('161. should handle multiple rapid requestUpdate calls', async () => {
1240
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1241
+ for (let i = 0; i < 5; i++) {
1242
+ el.requestUpdate();
1243
+ await el.updateComplete;
1244
+ }
1245
+ expect(el.shadowRoot).to.not.be.null;
1246
+ });
1247
+
1248
+ it('162. should have render method', async () => {
1249
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1250
+ expect(el.render).to.be.a('function');
1251
+ });
1252
+
1253
+ it('163. should resolve updateComplete', async () => {
1254
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1255
+ const result = await el.updateComplete;
1256
+ expect(result).to.not.be.undefined;
1257
+ });
1258
+
1259
+ // ═══════════════════════════════════════════════════
1260
+ // COMPACT VARIANT — PAGE NAVIGATION VIA DROPDOWN
1261
+ // ═══════════════════════════════════════════════════
1262
+
1263
+ it('164. should navigate to selected page in compact dropdown', async () => {
1264
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="compact" totalitems="50" pagesize="10" currentpage="1"></nile-pagination>`);
1265
+ await el.updateComplete;
1266
+ let detail: any;
1267
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
1268
+ const menuItems = el.shadowRoot!.querySelectorAll('.compact-scroll-wrapper1 nile-menu-item');
1269
+ // Click page 3 (index 2)
1270
+ (menuItems[2] as HTMLElement).click();
1271
+ await el.updateComplete;
1272
+ expect(detail).to.exist;
1273
+ expect(detail.page).to.equal(3);
1274
+ expect(detail.previousPage).to.equal(1);
1275
+ });
1276
+
1277
+ // ═══════════════════════════════════════════════════
1278
+ // MINI VARIANT — PAGE NAVIGATION VIA DROPDOWN
1279
+ // ═══════════════════════════════════════════════════
1280
+
1281
+ it('165. should navigate to selected page in mini dropdown', async () => {
1282
+ const el = await fixture<NilePagination>(html`<nile-pagination variant="mini" totalitems="50" pagesize="10" currentpage="1"></nile-pagination>`);
1283
+ await el.updateComplete;
1284
+ let detail: any;
1285
+ el.addEventListener('nile-change', ((e: CustomEvent) => { detail = e.detail; }) as EventListener);
1286
+ const menuItems = el.shadowRoot!.querySelectorAll('.mini-scroll-wrapper nile-menu-item');
1287
+ // Click page 4 (index 3)
1288
+ (menuItems[3] as HTMLElement).click();
1289
+ await el.updateComplete;
1290
+ expect(detail).to.exist;
1291
+ expect(detail.page).to.equal(4);
1292
+ expect(detail.previousPage).to.equal(1);
1293
+ });
1294
+
1295
+ // ═══════════════════════════════════════════════════
1296
+ // NILE-BUTTON & NILE-MENU PRESENCE
1297
+ // ═══════════════════════════════════════════════════
1298
+
1299
+ it('166. should have nile-button in shadow root', async () => {
1300
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1301
+ expect(el.shadowRoot!.querySelector('nile-button')).to.exist;
1302
+ });
1303
+
1304
+ it('167. should have nile-menu in shadow root', async () => {
1305
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1306
+ expect(el.shadowRoot!.querySelector('nile-menu')).to.exist;
1307
+ });
1308
+
1309
+ it('168. should have nile-dropdown in shadow root', async () => {
1310
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1311
+ expect(el.shadowRoot!.querySelector('nile-dropdown')).to.exist;
1312
+ });
1313
+
1314
+ it('169. should have nile-menu-item in shadow root', async () => {
1315
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1316
+ expect(el.shadowRoot!.querySelector('nile-menu-item')).to.exist;
1317
+ });
1318
+
1319
+ it('170. should have nile-icon in shadow root', async () => {
1320
+ const el = await fixture<NilePagination>(html`<nile-pagination></nile-pagination>`);
1321
+ expect(el.shadowRoot!.querySelector('nile-icon')).to.exist;
1322
+ });
1323
+
1324
+ // ═══════════════════════════════════════════════════
1325
+ // FULL INTEGRATION
1326
+ // ═══════════════════════════════════════════════════
1327
+
1328
+ it('171. full integration — fluid variant with all props', async () => {
1329
+ const el = await fixture<NilePagination>(html`
1330
+ <nile-pagination
1331
+ totalitems="200"
1332
+ pagesize="25"
1333
+ currentpage="3"
1334
+ pagesizeoptions="[10,25,50]"
1335
+ class="pg"
1336
+ id="pg-fluid"
1337
+ ></nile-pagination>
1338
+ `);
1339
+ await el.updateComplete;
1340
+ expect(el.totalItems).to.equal(200);
1341
+ expect(el.pageSize).to.equal(25);
1342
+ expect(el.currentPage).to.equal(3);
1343
+ expect(el.variant).to.equal('fluid');
1344
+ expect(el.id).to.equal('pg-fluid');
1345
+ expect(el.shadowRoot!.querySelector('.pagination-wrapper.fluid')).to.exist;
1346
+ expect(el.shadowRoot!.querySelector('nav')).to.exist;
1347
+ expect(el.shadowRoot!.querySelector('.range-text')).to.exist;
1348
+ expect(el.shadowRoot!.querySelector('.page-size-select')).to.exist;
1349
+ });
1350
+
1351
+ it('172. full integration — compact variant with all props', async () => {
1352
+ const el = await fixture<NilePagination>(html`
1353
+ <nile-pagination
1354
+ variant="compact"
1355
+ totalitems="100"
1356
+ pagesize="10"
1357
+ currentpage="5"
1358
+ id="pg-compact"
1359
+ ></nile-pagination>
1360
+ `);
1361
+ await el.updateComplete;
1362
+ expect(el.totalItems).to.equal(100);
1363
+ expect(el.pageSize).to.equal(10);
1364
+ expect(el.currentPage).to.equal(5);
1365
+ expect(el.variant).to.equal('compact');
1366
+ expect(el.shadowRoot!.querySelector('.pagination-wrapper.compact')).to.exist;
1367
+ expect(el.shadowRoot!.querySelector('.compact-pagination')).to.exist;
1368
+ expect(el.shadowRoot!.querySelector('.current-page-btn')).to.exist;
1369
+ });
1370
+
1371
+ it('173. full integration — mini variant with all props', async () => {
1372
+ const el = await fixture<NilePagination>(html`
1373
+ <nile-pagination
1374
+ variant="mini"
1375
+ totalitems="100"
1376
+ pagesize="10"
1377
+ currentpage="5"
1378
+ id="pg-mini"
1379
+ ></nile-pagination>
1380
+ `);
1381
+ await el.updateComplete;
1382
+ expect(el.totalItems).to.equal(100);
1383
+ expect(el.pageSize).to.equal(10);
1384
+ expect(el.currentPage).to.equal(5);
1385
+ expect(el.variant).to.equal('mini');
1386
+ expect(el.shadowRoot!.querySelector('.pagination-wrapper.mini')).to.exist;
1387
+ expect(el.shadowRoot!.querySelector('.mini-showing-label')).to.exist;
1388
+ expect(el.shadowRoot!.querySelector('.mini-of-label')).to.exist;
1389
+ expect(el.shadowRoot!.querySelector('.mini-page-btn')).to.exist;
1390
+ expect(el.shadowRoot!.querySelector('.mini-prev-button')).to.exist;
1391
+ expect(el.shadowRoot!.querySelector('.mini-next-button')).to.exist;
1392
+ });
106
1393
  });