@melodicdev/components 2.0.2 → 3.0.0

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 (330) hide show
  1. package/README.md +7 -6
  2. package/assets/melodic-components.js +5568 -4145
  3. package/assets/melodic-components.js.map +1 -1
  4. package/assets/melodic-components.min.js +6469 -5147
  5. package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts +15 -14
  6. package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts.map +1 -1
  7. package/lib/components/data-display/activity-feed/activity-feed-item.component.js +36 -16
  8. package/lib/components/data-display/activity-feed/activity-feed-item.styles.d.ts.map +1 -1
  9. package/lib/components/data-display/activity-feed/activity-feed-item.styles.js +4 -0
  10. package/lib/components/data-display/activity-feed/activity-feed-item.template.d.ts.map +1 -1
  11. package/lib/components/data-display/activity-feed/activity-feed-item.template.js +15 -14
  12. package/lib/components/data-display/avatar/avatar.component.d.ts +9 -4
  13. package/lib/components/data-display/avatar/avatar.component.d.ts.map +1 -1
  14. package/lib/components/data-display/avatar/avatar.component.js +12 -3
  15. package/lib/components/data-display/avatar/avatar.template.js +1 -1
  16. package/lib/components/data-display/badge/badge.component.d.ts +2 -3
  17. package/lib/components/data-display/badge/badge.component.d.ts.map +1 -1
  18. package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
  19. package/lib/components/data-display/badge/badge.styles.js +56 -35
  20. package/lib/components/data-display/badge/badge.types.d.ts +2 -0
  21. package/lib/components/data-display/badge/badge.types.d.ts.map +1 -1
  22. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts +10 -0
  23. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts.map +1 -1
  24. package/lib/components/data-display/calendar-view/calendar-view.utils.js +59 -27
  25. package/lib/components/data-display/data-grid/data-grid.component.d.ts +6 -5
  26. package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
  27. package/lib/components/data-display/data-grid/data-grid.component.js +49 -110
  28. package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
  29. package/lib/components/data-display/data-grid/data-grid.template.js +2 -6
  30. package/lib/components/data-display/list/list-item.component.d.ts +15 -6
  31. package/lib/components/data-display/list/list-item.component.d.ts.map +1 -1
  32. package/lib/components/data-display/list/list-item.component.js +57 -6
  33. package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
  34. package/lib/components/data-display/list/list-item.styles.js +5 -0
  35. package/lib/components/data-display/list/list-item.template.d.ts.map +1 -1
  36. package/lib/components/data-display/list/list-item.template.js +18 -12
  37. package/lib/components/data-display/profile-card/profile-card.component.d.ts +2 -2
  38. package/lib/components/data-display/profile-card/profile-card.component.d.ts.map +1 -1
  39. package/lib/components/data-display/profile-card/profile-card.component.js +17 -15
  40. package/lib/components/data-display/profile-card/profile-card.template.js +1 -1
  41. package/lib/components/data-display/stat-card/stat-card.component.d.ts +6 -6
  42. package/lib/components/data-display/stat-card/stat-card.component.d.ts.map +1 -1
  43. package/lib/components/data-display/stat-card/stat-card.component.js +14 -6
  44. package/lib/components/data-display/stat-card/stat-card.template.js +4 -4
  45. package/lib/components/data-display/table/table.component.d.ts +7 -5
  46. package/lib/components/data-display/table/table.component.d.ts.map +1 -1
  47. package/lib/components/data-display/table/table.component.js +40 -117
  48. package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
  49. package/lib/components/data-display/table/table.styles.js +5 -2
  50. package/lib/components/data-display/table/table.template.d.ts.map +1 -1
  51. package/lib/components/data-display/table/table.template.js +1 -6
  52. package/lib/components/data-display/table-core/index.d.ts +3 -0
  53. package/lib/components/data-display/table-core/index.d.ts.map +1 -0
  54. package/lib/components/data-display/table-core/index.js +2 -0
  55. package/lib/components/data-display/table-core/table-core.d.ts +137 -0
  56. package/lib/components/data-display/table-core/table-core.d.ts.map +1 -0
  57. package/lib/components/data-display/table-core/table-core.js +225 -0
  58. package/lib/components/data-display/tag/tag.component.d.ts +14 -7
  59. package/lib/components/data-display/tag/tag.component.d.ts.map +1 -1
  60. package/lib/components/data-display/tag/tag.component.js +29 -5
  61. package/lib/components/data-display/tag/tag.template.js +2 -2
  62. package/lib/components/data-display/tag/tag.types.d.ts +8 -1
  63. package/lib/components/data-display/tag/tag.types.d.ts.map +1 -1
  64. package/lib/components/feedback/alert/alert.component.d.ts +6 -3
  65. package/lib/components/feedback/alert/alert.component.d.ts.map +1 -1
  66. package/lib/components/feedback/alert/alert.component.js +13 -4
  67. package/lib/components/feedback/alert/alert.template.js +1 -1
  68. package/lib/components/feedback/progress/progress.component.d.ts +4 -0
  69. package/lib/components/feedback/progress/progress.component.d.ts.map +1 -1
  70. package/lib/components/feedback/progress/progress.component.js +9 -0
  71. package/lib/components/feedback/progress/progress.template.d.ts.map +1 -1
  72. package/lib/components/feedback/progress/progress.template.js +19 -5
  73. package/lib/components/feedback/toast/toast.component.d.ts +6 -3
  74. package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
  75. package/lib/components/feedback/toast/toast.component.js +13 -4
  76. package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
  77. package/lib/components/feedback/toast/toast.service.js +2 -1
  78. package/lib/components/feedback/toast/toast.template.js +1 -1
  79. package/lib/components/forms/autocomplete/autocomplete.component.d.ts +12 -4
  80. package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
  81. package/lib/components/forms/autocomplete/autocomplete.component.js +39 -30
  82. package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
  83. package/lib/components/forms/autocomplete/autocomplete.template.js +14 -0
  84. package/lib/components/forms/button/button.component.d.ts +28 -3
  85. package/lib/components/forms/button/button.component.d.ts.map +1 -1
  86. package/lib/components/forms/button/button.component.js +81 -6
  87. package/lib/components/forms/button/button.template.js +1 -1
  88. package/lib/components/forms/button/button.types.d.ts +8 -1
  89. package/lib/components/forms/button/button.types.d.ts.map +1 -1
  90. package/lib/components/forms/button-group/button-group-item.component.d.ts +2 -2
  91. package/lib/components/forms/button-group/button-group-item.component.d.ts.map +1 -1
  92. package/lib/components/forms/button-group/button-group.component.d.ts +4 -2
  93. package/lib/components/forms/button-group/button-group.component.d.ts.map +1 -1
  94. package/lib/components/forms/button-group/button-group.component.js +3 -1
  95. package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
  96. package/lib/components/forms/button-group/button-group.styles.js +15 -1
  97. package/lib/components/forms/button-group/button-group.template.d.ts.map +1 -1
  98. package/lib/components/forms/button-group/button-group.template.js +4 -2
  99. package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -2
  100. package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
  101. package/lib/components/forms/checkbox/checkbox.component.js +3 -1
  102. package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
  103. package/lib/components/forms/checkbox/checkbox.styles.js +19 -0
  104. package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
  105. package/lib/components/forms/checkbox/checkbox.template.js +4 -2
  106. package/lib/components/forms/date-picker/calendar.component.js +1 -1
  107. package/lib/components/forms/date-picker/date-picker.component.d.ts +11 -4
  108. package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
  109. package/lib/components/forms/date-picker/date-picker.component.js +99 -32
  110. package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  111. package/lib/components/forms/date-picker/date-picker.styles.js +0 -10
  112. package/lib/components/forms/date-picker/date-picker.template.d.ts.map +1 -1
  113. package/lib/components/forms/date-picker/date-picker.template.js +3 -4
  114. package/lib/components/forms/file-upload/file-upload-item.component.d.ts +7 -0
  115. package/lib/components/forms/file-upload/file-upload-item.component.d.ts.map +1 -1
  116. package/lib/components/forms/file-upload/file-upload-item.component.js +15 -0
  117. package/lib/components/forms/file-upload/file-upload.component.d.ts +15 -0
  118. package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
  119. package/lib/components/forms/file-upload/file-upload.component.js +56 -0
  120. package/lib/components/forms/form-field/form-field.component.d.ts +12 -4
  121. package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
  122. package/lib/components/forms/form-field/form-field.component.js +50 -31
  123. package/lib/components/forms/form-field/form-field.template.js +1 -1
  124. package/lib/components/forms/input/input.component.d.ts +2 -2
  125. package/lib/components/forms/input/input.component.d.ts.map +1 -1
  126. package/lib/components/forms/radio/radio-group.component.d.ts +6 -0
  127. package/lib/components/forms/radio/radio-group.component.d.ts.map +1 -1
  128. package/lib/components/forms/radio/radio-group.component.js +69 -2
  129. package/lib/components/forms/radio/radio-group.template.js +1 -1
  130. package/lib/components/forms/radio/radio.component.d.ts +7 -2
  131. package/lib/components/forms/radio/radio.component.d.ts.map +1 -1
  132. package/lib/components/forms/radio/radio.component.js +5 -0
  133. package/lib/components/forms/radio/radio.template.d.ts.map +1 -1
  134. package/lib/components/forms/radio/radio.template.js +1 -0
  135. package/lib/components/forms/select/select.component.d.ts +13 -6
  136. package/lib/components/forms/select/select.component.d.ts.map +1 -1
  137. package/lib/components/forms/select/select.component.js +32 -36
  138. package/lib/components/forms/select/select.template.d.ts.map +1 -1
  139. package/lib/components/forms/select/select.template.js +6 -2
  140. package/lib/components/forms/slider/slider.component.d.ts +2 -2
  141. package/lib/components/forms/slider/slider.component.d.ts.map +1 -1
  142. package/lib/components/forms/slider/slider.component.js +5 -1
  143. package/lib/components/forms/textarea/textarea.component.d.ts +2 -2
  144. package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
  145. package/lib/components/forms/toggle/toggle.component.d.ts +4 -2
  146. package/lib/components/forms/toggle/toggle.component.d.ts.map +1 -1
  147. package/lib/components/forms/toggle/toggle.component.js +3 -1
  148. package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
  149. package/lib/components/forms/toggle/toggle.styles.js +19 -0
  150. package/lib/components/forms/toggle/toggle.template.d.ts.map +1 -1
  151. package/lib/components/forms/toggle/toggle.template.js +11 -3
  152. package/lib/components/foundation/card/card.component.d.ts +7 -6
  153. package/lib/components/foundation/card/card.component.d.ts.map +1 -1
  154. package/lib/components/foundation/card/card.component.js +18 -7
  155. package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
  156. package/lib/components/foundation/card/card.styles.js +5 -0
  157. package/lib/components/foundation/card/card.template.d.ts.map +1 -1
  158. package/lib/components/foundation/card/card.template.js +16 -11
  159. package/lib/components/foundation/divider/divider.component.d.ts +5 -4
  160. package/lib/components/foundation/divider/divider.component.d.ts.map +1 -1
  161. package/lib/components/foundation/divider/divider.component.js +11 -3
  162. package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
  163. package/lib/components/foundation/divider/divider.styles.js +6 -0
  164. package/lib/components/foundation/divider/divider.template.d.ts +5 -0
  165. package/lib/components/foundation/divider/divider.template.d.ts.map +1 -1
  166. package/lib/components/foundation/divider/divider.template.js +9 -6
  167. package/lib/components/general/icon/icon.template.d.ts.map +1 -1
  168. package/lib/components/general/icon/icon.template.js +3 -1
  169. package/lib/components/navigation/pagination/pagination.component.d.ts +5 -0
  170. package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
  171. package/lib/components/navigation/pagination/pagination.component.js +22 -10
  172. package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
  173. package/lib/components/navigation/pagination/pagination.styles.js +6 -4
  174. package/lib/components/navigation/sidebar/sidebar-item.component.d.ts +4 -4
  175. package/lib/components/navigation/sidebar/sidebar-item.component.d.ts.map +1 -1
  176. package/lib/components/navigation/sidebar/sidebar-item.component.js +11 -4
  177. package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
  178. package/lib/components/navigation/sidebar/sidebar.component.d.ts +7 -0
  179. package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
  180. package/lib/components/navigation/sidebar/sidebar.component.js +48 -5
  181. package/lib/components/navigation/steps/step-panel.component.d.ts +7 -0
  182. package/lib/components/navigation/steps/step-panel.component.d.ts.map +1 -1
  183. package/lib/components/navigation/steps/step-panel.component.js +7 -0
  184. package/lib/components/navigation/steps/step-panel.template.d.ts +1 -1
  185. package/lib/components/navigation/steps/step-panel.template.d.ts.map +1 -1
  186. package/lib/components/navigation/steps/step-panel.template.js +2 -2
  187. package/lib/components/navigation/steps/step.component.d.ts +2 -2
  188. package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
  189. package/lib/components/navigation/steps/step.component.js +8 -2
  190. package/lib/components/navigation/steps/step.template.js +1 -1
  191. package/lib/components/navigation/steps/steps.component.d.ts +3 -1
  192. package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
  193. package/lib/components/navigation/steps/steps.component.js +47 -14
  194. package/lib/components/navigation/steps/steps.template.d.ts.map +1 -1
  195. package/lib/components/navigation/steps/steps.template.js +5 -1
  196. package/lib/components/navigation/tabs/tab-panel.component.d.ts +7 -0
  197. package/lib/components/navigation/tabs/tab-panel.component.d.ts.map +1 -1
  198. package/lib/components/navigation/tabs/tab-panel.component.js +7 -0
  199. package/lib/components/navigation/tabs/tab-panel.template.d.ts +1 -1
  200. package/lib/components/navigation/tabs/tab-panel.template.d.ts.map +1 -1
  201. package/lib/components/navigation/tabs/tab-panel.template.js +2 -2
  202. package/lib/components/navigation/tabs/tabs.component.d.ts +5 -3
  203. package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
  204. package/lib/components/navigation/tabs/tabs.component.js +49 -14
  205. package/lib/components/navigation/tabs/tabs.template.d.ts.map +1 -1
  206. package/lib/components/navigation/tabs/tabs.template.js +6 -1
  207. package/lib/components/overlays/dialog/dialog-ref.class.d.ts +17 -2
  208. package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
  209. package/lib/components/overlays/dialog/dialog-ref.class.js +52 -6
  210. package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
  211. package/lib/components/overlays/dialog/dialog.component.js +5 -1
  212. package/lib/components/overlays/dialog/dialog.service.d.ts +2 -2
  213. package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
  214. package/lib/components/overlays/dialog/dialog.service.js +46 -18
  215. package/lib/components/overlays/drawer/drawer.component.d.ts +9 -2
  216. package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
  217. package/lib/components/overlays/drawer/drawer.component.js +34 -4
  218. package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
  219. package/lib/components/overlays/drawer/drawer.styles.js +4 -0
  220. package/lib/components/overlays/dropdown/dropdown-item.component.d.ts +5 -2
  221. package/lib/components/overlays/dropdown/dropdown-item.component.d.ts.map +1 -1
  222. package/lib/components/overlays/dropdown/dropdown-item.component.js +18 -0
  223. package/lib/components/overlays/dropdown/dropdown-item.template.d.ts.map +1 -1
  224. package/lib/components/overlays/dropdown/dropdown-item.template.js +0 -3
  225. package/lib/components/overlays/dropdown/dropdown.component.d.ts +8 -4
  226. package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
  227. package/lib/components/overlays/dropdown/dropdown.component.js +61 -60
  228. package/lib/components/overlays/popover/popover.component.d.ts +6 -4
  229. package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
  230. package/lib/components/overlays/popover/popover.component.js +37 -51
  231. package/lib/components/overlays/tooltip/tooltip.component.d.ts +29 -4
  232. package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
  233. package/lib/components/overlays/tooltip/tooltip.component.js +73 -31
  234. package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
  235. package/lib/components/overlays/tooltip/tooltip.styles.js +22 -10
  236. package/lib/components/overlays/tooltip/tooltip.template.d.ts.map +1 -1
  237. package/lib/components/overlays/tooltip/tooltip.template.js +3 -2
  238. package/lib/components/pages/auth/login-page.component.d.ts +11 -4
  239. package/lib/components/pages/auth/login-page.component.d.ts.map +1 -1
  240. package/lib/components/pages/auth/login-page.component.js +18 -5
  241. package/lib/components/pages/auth/login-page.template.d.ts.map +1 -1
  242. package/lib/components/pages/auth/login-page.template.js +9 -10
  243. package/lib/components/pages/auth/signup-page.component.d.ts +11 -4
  244. package/lib/components/pages/auth/signup-page.component.d.ts.map +1 -1
  245. package/lib/components/pages/auth/signup-page.component.js +18 -5
  246. package/lib/components/pages/auth/signup-page.template.d.ts.map +1 -1
  247. package/lib/components/pages/auth/signup-page.template.js +9 -10
  248. package/lib/components/pages/dashboard/dashboard-page.component.d.ts +18 -11
  249. package/lib/components/pages/dashboard/dashboard-page.component.d.ts.map +1 -1
  250. package/lib/components/pages/dashboard/dashboard-page.component.js +55 -13
  251. package/lib/components/pages/dashboard/dashboard-page.template.js +1 -1
  252. package/lib/components/sections/app-shell/app-shell.component.d.ts +6 -6
  253. package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
  254. package/lib/components/sections/app-shell/app-shell.component.js +14 -6
  255. package/lib/components/sections/app-shell/app-shell.template.js +3 -3
  256. package/lib/components/sections/hero/hero-section.component.d.ts +6 -3
  257. package/lib/components/sections/hero/hero-section.component.d.ts.map +1 -1
  258. package/lib/components/sections/hero/hero-section.component.js +13 -4
  259. package/lib/components/sections/hero/hero-section.template.js +2 -2
  260. package/lib/components/sections/page-header/page-header.component.d.ts +16 -17
  261. package/lib/components/sections/page-header/page-header.component.d.ts.map +1 -1
  262. package/lib/components/sections/page-header/page-header.component.js +36 -25
  263. package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
  264. package/lib/components/sections/page-header/page-header.styles.js +9 -0
  265. package/lib/components/sections/page-header/page-header.template.d.ts +5 -0
  266. package/lib/components/sections/page-header/page-header.template.d.ts.map +1 -1
  267. package/lib/components/sections/page-header/page-header.template.js +42 -31
  268. package/lib/components/sections/page-section/page-section.component.d.ts +16 -12
  269. package/lib/components/sections/page-section/page-section.component.d.ts.map +1 -1
  270. package/lib/components/sections/page-section/page-section.component.js +34 -12
  271. package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
  272. package/lib/components/sections/page-section/page-section.styles.js +6 -0
  273. package/lib/components/sections/page-section/page-section.template.d.ts +6 -0
  274. package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
  275. package/lib/components/sections/page-section/page-section.template.js +26 -15
  276. package/lib/components/sections/page-section/sanitize-href.function.d.ts +12 -0
  277. package/lib/components/sections/page-section/sanitize-href.function.d.ts.map +1 -0
  278. package/lib/components/sections/page-section/sanitize-href.function.js +15 -0
  279. package/lib/directives/tooltip.directive.d.ts +8 -2
  280. package/lib/directives/tooltip.directive.d.ts.map +1 -1
  281. package/lib/directives/tooltip.directive.js +103 -9
  282. package/lib/functions/deprecation.functions.d.ts +21 -0
  283. package/lib/functions/deprecation.functions.d.ts.map +1 -0
  284. package/lib/functions/deprecation.functions.js +44 -0
  285. package/lib/functions/index.d.ts +2 -0
  286. package/lib/functions/index.d.ts.map +1 -1
  287. package/lib/functions/index.js +2 -0
  288. package/lib/functions/watch-slot-presence.function.d.ts +17 -0
  289. package/lib/functions/watch-slot-presence.function.d.ts.map +1 -0
  290. package/lib/functions/watch-slot-presence.function.js +27 -0
  291. package/lib/theme/functions/create-theme.function.d.ts +15 -1
  292. package/lib/theme/functions/create-theme.function.d.ts.map +1 -1
  293. package/lib/theme/functions/create-theme.function.js +57 -11
  294. package/lib/theme/index.d.ts +1 -0
  295. package/lib/theme/index.d.ts.map +1 -1
  296. package/lib/types/index.d.ts +8 -2
  297. package/lib/types/index.d.ts.map +1 -1
  298. package/lib/utils/accessibility/focus-trap.d.ts +19 -1
  299. package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
  300. package/lib/utils/accessibility/focus-trap.js +77 -8
  301. package/lib/utils/accessibility/index.d.ts +2 -1
  302. package/lib/utils/accessibility/index.d.ts.map +1 -1
  303. package/lib/utils/accessibility/index.js +1 -1
  304. package/lib/utils/accessibility/live-region.d.ts +10 -3
  305. package/lib/utils/accessibility/live-region.d.ts.map +1 -1
  306. package/lib/utils/accessibility/live-region.js +64 -35
  307. package/lib/utils/directives/click-outside.directive.d.ts.map +1 -1
  308. package/lib/utils/directives/click-outside.directive.js +5 -3
  309. package/lib/utils/overlay/index.d.ts +4 -0
  310. package/lib/utils/overlay/index.d.ts.map +1 -0
  311. package/lib/utils/overlay/index.js +2 -0
  312. package/lib/utils/overlay/overlay-positioner.d.ts +54 -0
  313. package/lib/utils/overlay/overlay-positioner.d.ts.map +1 -0
  314. package/lib/utils/overlay/overlay-positioner.js +85 -0
  315. package/lib/utils/overlay/toggle-dismiss-guard.d.ts +24 -0
  316. package/lib/utils/overlay/toggle-dismiss-guard.d.ts.map +1 -0
  317. package/lib/utils/overlay/toggle-dismiss-guard.js +36 -0
  318. package/lib/utils/positioning/auto-update.d.ts.map +1 -1
  319. package/lib/utils/positioning/auto-update.js +3 -0
  320. package/lib/utils/positioning/compute-position.d.ts.map +1 -1
  321. package/lib/utils/positioning/compute-position.js +8 -4
  322. package/lib/utils/positioning/middlewares/flip.middleware.d.ts.map +1 -1
  323. package/lib/utils/positioning/middlewares/flip.middleware.js +10 -3
  324. package/lib/utils/positioning/middlewares/offset.middleware.d.ts +15 -0
  325. package/lib/utils/positioning/middlewares/offset.middleware.d.ts.map +1 -1
  326. package/lib/utils/positioning/middlewares/offset.middleware.js +31 -1
  327. package/lib/utils/positioning/middlewares/shift.middleware.d.ts +13 -3
  328. package/lib/utils/positioning/middlewares/shift.middleware.d.ts.map +1 -1
  329. package/lib/utils/positioning/middlewares/shift.middleware.js +15 -7
  330. package/package.json +6 -2
@@ -1,22 +1,28 @@
1
- import { html, when } from '@melodicdev/core';
1
+ import { html, classMap, when } from '@melodicdev/core';
2
+ // The role (listitem, or button when interactive) lives on the HOST element,
3
+ // managed by the component. The named slots are ALWAYS rendered — hiding them
4
+ // with a class instead of `when` keeps slotchange firing, so content inserted
5
+ // after mount still projects.
2
6
  export function listItemTemplate(c) {
3
7
  return html `
4
- <div class="ml-li" role="listitem">
5
- ${when(c.hasLeadingSlot, () => html `
6
- <div class="ml-li__leading">
7
- <slot name="leading"></slot>
8
- </div>
9
- `)}
8
+ <div class="ml-li">
9
+ <div class=${classMap({
10
+ 'ml-li__leading': true,
11
+ 'ml-li__leading--hidden': !c.hasLeadingSlot
12
+ })}>
13
+ <slot name="leading"></slot>
14
+ </div>
10
15
  <div class="ml-li__content">
11
16
  ${when(!!c.primary, () => html `<span class="ml-li__primary">${c.primary}</span>`)}
12
17
  ${when(!!c.secondary, () => html `<span class="ml-li__secondary">${c.secondary}</span>`)}
13
18
  <slot></slot>
14
19
  </div>
15
- ${when(c.hasTrailingSlot, () => html `
16
- <div class="ml-li__trailing">
17
- <slot name="trailing"></slot>
18
- </div>
19
- `)}
20
+ <div class=${classMap({
21
+ 'ml-li__trailing': true,
22
+ 'ml-li__trailing--hidden': !c.hasTrailingSlot
23
+ })}>
24
+ <slot name="trailing"></slot>
25
+ </div>
20
26
  </div>
21
27
  `;
22
28
  }
@@ -47,8 +47,8 @@ export declare class ProfileCardComponent implements IElementRef, OnCreate {
47
47
  subtitle: string;
48
48
  /** Avatar image URL — falls back to initials derived from name */
49
49
  avatar: string;
50
- /** Avatar size */
51
- 'avatar-size': Size;
50
+ /** Avatar size (attribute: avatar-size) */
51
+ avatarSize: Size;
52
52
  /** Slot visibility flags (toggled via slotchange) */
53
53
  hasDetails: boolean;
54
54
  hasTags: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"profile-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/profile-card/profile-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAMa,oBAAqB,YAAW,WAAW,EAAE,QAAQ;IAC1D,UAAU,EAAG,WAAW,CAAC;IAEhC,kBAAkB;IACX,IAAI,SAAM;IAEjB,kDAAkD;IAC3C,QAAQ,SAAM;IAErB,kEAAkE;IAC3D,MAAM,SAAM;IAEnB,kBAAkB;IACX,aAAa,EAAE,IAAI,CAAQ;IAElC,qDAAqD;IAC9C,UAAU,UAAS;IACnB,OAAO,UAAS;IAChB,UAAU,UAAS;IACnB,OAAO,UAAS;IAEvB,gCAAgC;IAChC,IAAW,QAAQ,IAAI,MAAM,CAO5B;IAEM,QAAQ,IAAI,IAAI;CAcvB"}
1
+ {"version":3,"file":"profile-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/profile-card/profile-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAKpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAMa,oBAAqB,YAAW,WAAW,EAAE,QAAQ;IAC1D,UAAU,EAAG,WAAW,CAAC;IAEhC,kBAAkB;IACX,IAAI,SAAM;IAEjB,kDAAkD;IAC3C,QAAQ,SAAM;IAErB,kEAAkE;IAC3D,MAAM,SAAM;IAEnB,2CAA2C;IACpC,UAAU,EAAE,IAAI,CAAQ;IAE/B,qDAAqD;IAC9C,UAAU,UAAS;IACnB,OAAO,UAAS;IAChB,UAAU,UAAS;IACnB,OAAO,UAAS;IAEvB,gCAAgC;IAChC,IAAW,QAAQ,IAAI,MAAM,CAO5B;IAEM,QAAQ,IAAI,IAAI;CAUvB"}
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { MelodicComponent } from '@melodicdev/core';
8
+ import { watchSlotPresence, defineLegacyAliases } from '../../../functions/index.js';
8
9
  import { profileCardTemplate } from './profile-card.template.js';
9
10
  import { profileCardStyles } from './profile-card.styles.js';
10
11
  /**
@@ -54,8 +55,8 @@ let ProfileCardComponent = class ProfileCardComponent {
54
55
  this.subtitle = '';
55
56
  /** Avatar image URL — falls back to initials derived from name */
56
57
  this.avatar = '';
57
- /** Avatar size */
58
- this['avatar-size'] = 'lg';
58
+ /** Avatar size (attribute: avatar-size) */
59
+ this.avatarSize = 'lg';
59
60
  /** Slot visibility flags (toggled via slotchange) */
60
61
  this.hasDetails = false;
61
62
  this.hasTags = false;
@@ -75,19 +76,15 @@ let ProfileCardComponent = class ProfileCardComponent {
75
76
  const shadow = this.elementRef.shadowRoot;
76
77
  if (!shadow)
77
78
  return;
78
- shadow.querySelectorAll('slot[name]').forEach(slot => {
79
- slot.addEventListener('slotchange', () => {
80
- const name = slot.getAttribute('name');
81
- const hasContent = slot.assignedNodes().length > 0;
82
- if (name === 'details')
83
- this.hasDetails = hasContent;
84
- else if (name === 'tags')
85
- this.hasTags = hasContent;
86
- else if (name === 'actions')
87
- this.hasActions = hasContent;
88
- else if (name === 'meta')
89
- this.hasMeta = hasContent;
90
- });
79
+ watchSlotPresence(shadow, (name, hasContent) => {
80
+ if (name === 'details')
81
+ this.hasDetails = hasContent;
82
+ else if (name === 'tags')
83
+ this.hasTags = hasContent;
84
+ else if (name === 'actions')
85
+ this.hasActions = hasContent;
86
+ else if (name === 'meta')
87
+ this.hasMeta = hasContent;
91
88
  });
92
89
  }
93
90
  };
@@ -100,3 +97,8 @@ ProfileCardComponent = __decorate([
100
97
  })
101
98
  ], ProfileCardComponent);
102
99
  export { ProfileCardComponent };
100
+ // Deprecated quoted kebab-case property aliases (warn once on first write;
101
+ // removed in the next major release).
102
+ defineLegacyAliases(ProfileCardComponent.prototype, 'ml-profile-card', {
103
+ 'avatar-size': 'avatarSize'
104
+ });
@@ -6,7 +6,7 @@ export function profileCardTemplate(c) {
6
6
  <div class="ml-profile-card__identity">
7
7
  <div class="ml-profile-card__avatar">
8
8
  <ml-avatar
9
- size=${c['avatar-size']}
9
+ size=${c.avatarSize}
10
10
  src=${c.avatar}
11
11
  initials=${c.initials}
12
12
  ></ml-avatar>
@@ -32,14 +32,14 @@ export declare class StatCardComponent implements IElementRef {
32
32
  value: string | number;
33
33
  /** Trend text (e.g. "+6 this month") */
34
34
  trend: string;
35
- /** Trend direction for styling */
36
- 'trend-direction': TrendDirection;
35
+ /** Trend direction for styling (attribute: trend-direction) */
36
+ trendDirection: TrendDirection;
37
37
  /** Icon name (Phosphor icon) */
38
38
  icon: string;
39
- /** Icon color — CSS color value or token */
40
- 'icon-color': string;
41
- /** Value font family */
42
- 'value-font': ValueFont;
39
+ /** Icon color — CSS color value or token (attribute: icon-color) */
40
+ iconColor: string;
41
+ /** Value font family (attribute: value-font) */
42
+ valueFont: ValueFont;
43
43
  }
44
44
  export {};
45
45
  //# sourceMappingURL=stat-card.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stat-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/stat-card/stat-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,KAAK,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAChD,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAMa,iBAAkB,YAAW,WAAW;IAC7C,UAAU,EAAG,WAAW,CAAC;IAEhC,mBAAmB;IACZ,KAAK,SAAM;IAElB,oBAAoB;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAM;IAEnC,wCAAwC;IACjC,KAAK,SAAM;IAElB,kCAAkC;IAC3B,iBAAiB,EAAE,cAAc,CAAa;IAErD,gCAAgC;IACzB,IAAI,SAAM;IAEjB,4CAA4C;IACrC,YAAY,SAAM;IAEzB,wBAAwB;IACjB,YAAY,EAAE,SAAS,CAAW;CACzC"}
1
+ {"version":3,"file":"stat-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/stat-card/stat-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,KAAK,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAChD,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAMa,iBAAkB,YAAW,WAAW;IAC7C,UAAU,EAAG,WAAW,CAAC;IAEhC,mBAAmB;IACZ,KAAK,SAAM;IAElB,oBAAoB;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAM;IAEnC,wCAAwC;IACjC,KAAK,SAAM;IAElB,+DAA+D;IACxD,cAAc,EAAE,cAAc,CAAa;IAElD,gCAAgC;IACzB,IAAI,SAAM;IAEjB,oEAAoE;IAC7D,SAAS,SAAM;IAEtB,gDAAgD;IACzC,SAAS,EAAE,SAAS,CAAW;CACtC"}
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { MelodicComponent } from '@melodicdev/core';
8
8
  import { statCardTemplate } from './stat-card.template.js';
9
9
  import { statCardStyles } from './stat-card.styles.js';
10
+ import { defineLegacyAliases } from '../../../functions/index.js';
10
11
  /**
11
12
  * ml-stat-card - Dashboard metric card with label, value, optional trend, and icon
12
13
  *
@@ -38,14 +39,14 @@ let StatCardComponent = class StatCardComponent {
38
39
  this.value = '';
39
40
  /** Trend text (e.g. "+6 this month") */
40
41
  this.trend = '';
41
- /** Trend direction for styling */
42
- this['trend-direction'] = 'neutral';
42
+ /** Trend direction for styling (attribute: trend-direction) */
43
+ this.trendDirection = 'neutral';
43
44
  /** Icon name (Phosphor icon) */
44
45
  this.icon = '';
45
- /** Icon color — CSS color value or token */
46
- this['icon-color'] = '';
47
- /** Value font family */
48
- this['value-font'] = 'serif';
46
+ /** Icon color — CSS color value or token (attribute: icon-color) */
47
+ this.iconColor = '';
48
+ /** Value font family (attribute: value-font) */
49
+ this.valueFont = 'serif';
49
50
  }
50
51
  };
51
52
  StatCardComponent = __decorate([
@@ -57,3 +58,10 @@ StatCardComponent = __decorate([
57
58
  })
58
59
  ], StatCardComponent);
59
60
  export { StatCardComponent };
61
+ // Deprecated quoted kebab-case property aliases (warn once on first write;
62
+ // removed in the next major release).
63
+ defineLegacyAliases(StatCardComponent.prototype, 'ml-stat-card', {
64
+ 'trend-direction': 'trendDirection',
65
+ 'icon-color': 'iconColor',
66
+ 'value-font': 'valueFont'
67
+ });
@@ -1,6 +1,6 @@
1
1
  import { html, classMap, when } from '@melodicdev/core';
2
2
  export function statCardTemplate(c) {
3
- const iconStyle = c['icon-color'] ? `--ml-stat-card-icon-color: ${c['icon-color']}` : '';
3
+ const iconStyle = c.iconColor ? `--ml-stat-card-icon-color: ${c.iconColor}` : '';
4
4
  return html `
5
5
  <div class="ml-stat-card">
6
6
  <div class="ml-stat-card__header">
@@ -13,13 +13,13 @@ export function statCardTemplate(c) {
13
13
  </div>
14
14
  <div class=${classMap({
15
15
  'ml-stat-card__value': true,
16
- 'ml-stat-card__value--serif': c['value-font'] === 'serif',
17
- 'ml-stat-card__value--sans': c['value-font'] === 'sans'
16
+ 'ml-stat-card__value--serif': c.valueFont === 'serif',
17
+ 'ml-stat-card__value--sans': c.valueFont === 'sans'
18
18
  })}>${c.value}</div>
19
19
  ${when(!!c.trend, () => html `
20
20
  <div class=${classMap({
21
21
  'ml-stat-card__trend': true,
22
- [`ml-stat-card__trend--${c['trend-direction']}`]: true
22
+ [`ml-stat-card__trend--${c.trendDirection}`]: true
23
23
  })}>${c.trend}</div>
24
24
  `)}
25
25
  </div>
@@ -19,7 +19,11 @@ import type { TableColumn, SortDirection } from './table.types.js';
19
19
  * ```
20
20
  *
21
21
  * @fires ml:sort - Emitted when a sortable column header is clicked. Detail: { key, direction }
22
- * @fires ml:select - Emitted when row selection changes. Detail: { selectedRows, allSelected }
22
+ * @fires ml:select - Emitted when row selection changes (including when sorting clears a
23
+ * non-empty selection). Detail: { selectedRows, selectedIndices, allSelected } where
24
+ * `selectedRows` contains the selected row OBJECTS and `selectedIndices` their indices
25
+ * in the original `rows` array (consumer order, independent of the current sort).
26
+ * BREAKING (2.x): `selectedRows` previously contained sorted-order indices.
23
27
  * @fires ml:row-click - Emitted when a row is clicked. Detail: { row, index }
24
28
  *
25
29
  * @slot footer - Content for the table footer area (e.g. pagination)
@@ -72,14 +76,13 @@ export declare class TableComponent implements IElementRef, OnCreate, OnDestroy,
72
76
  selectedIndices: number[];
73
77
  startIndex: number;
74
78
  endIndex: number;
75
- private _scroller;
76
- private _viewport;
79
+ /** Shared table pipeline: sorting, selection, ml:* events, virtual window. */
80
+ private _core;
77
81
  get rowHeight(): number;
78
82
  onPropertyChange(name: string, _oldVal: unknown, _newVal: unknown): void;
79
83
  onCreate(): void;
80
84
  onRender(): void;
81
85
  onDestroy(): void;
82
- private _attachScroller;
83
86
  /** Rows sorted by current sort key/direction */
84
87
  get sortedRows(): Record<string, unknown>[];
85
88
  get visibleRows(): Record<string, unknown>[];
@@ -93,6 +96,5 @@ export declare class TableComponent implements IElementRef, OnCreate, OnDestroy,
93
96
  handleSelectAll: () => void;
94
97
  handleSelectRow: (index: number, event: Event) => void;
95
98
  handleRowClick: (row: Record<string, unknown>, index: number) => void;
96
- private emitSelect;
97
99
  }
98
100
  //# sourceMappingURL=table.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKnE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAMa,cAAe,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IAC3F,UAAU,EAAG,WAAW,CAAC;IAEhC;;;;OAIG;IACI,aAAa,UAAS;IAE7B,0CAA0C;IACnC,SAAS,UAAS;IAEzB,kDAAkD;IAC3C,gBAAgB,UAAS;IAEhC,0CAA0C;IACnC,UAAU,UAAS;IAE1B,kCAAkC;IAC3B,OAAO,UAAS;IAEvB,8BAA8B;IACvB,SAAS,UAAQ;IAExB,0BAA0B;IACnB,YAAY,UAAS;IAE5B,iBAAiB;IACV,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,yBAAyB;IAClB,UAAU,SAAM;IAEvB,+BAA+B;IACxB,WAAW,SAAM;IAExB,2DAA2D;IACpD,OAAO,UAAS;IAEvB;;;;;OAKG;IACI,UAAU,UAAS;IAE1B,yBAAyB;IAClB,OAAO,EAAE,WAAW,EAAE,CAAM;IAEnC,eAAe;IACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAM;IAE5C,kCAAkC;IAC3B,OAAO,SAAM;IAEpB,6BAA6B;IACtB,aAAa,EAAE,aAAa,CAAS;IAE5C,+BAA+B;IACxB,eAAe,EAAE,MAAM,EAAE,CAAM;IAI/B,UAAU,SAAK;IACf,QAAQ,SAAM;IAIrB,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,SAAS,CAA4B;IAI7C,IAAW,SAAS,IAAI,MAAM,CAE7B;IAIM,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAMxE,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAiBhB,SAAS,IAAI,IAAI;IAOxB,OAAO,CAAC,eAAe;IAgBvB,gDAAgD;IAChD,IAAW,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAcjD;IAED,IAAW,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAGlD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAGtC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,aAAa,GAAI,OAAO,MAAM,KAAG,OAAO,CAE7C;IAIK,UAAU,GAAI,QAAQ,WAAW,KAAG,IAAI,CAiB7C;IAEK,eAAe,QAAO,IAAI,CAO/B;IAEK,eAAe,GAAI,OAAO,MAAM,EAAE,OAAO,KAAK,KAAG,IAAI,CAQ1D;IAEK,cAAc,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,IAAI,CAQzE;IAEF,OAAO,CAAC,UAAU;CASlB"}
1
+ {"version":3,"file":"table.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAMa,cAAe,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IAC3F,UAAU,EAAG,WAAW,CAAC;IAEhC;;;;OAIG;IACI,aAAa,UAAS;IAE7B,0CAA0C;IACnC,SAAS,UAAS;IAEzB,kDAAkD;IAC3C,gBAAgB,UAAS;IAEhC,0CAA0C;IACnC,UAAU,UAAS;IAE1B,kCAAkC;IAC3B,OAAO,UAAS;IAEvB,8BAA8B;IACvB,SAAS,UAAQ;IAExB,0BAA0B;IACnB,YAAY,UAAS;IAE5B,iBAAiB;IACV,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,yBAAyB;IAClB,UAAU,SAAM;IAEvB,+BAA+B;IACxB,WAAW,SAAM;IAExB,2DAA2D;IACpD,OAAO,UAAS;IAEvB;;;;;OAKG;IACI,UAAU,UAAS;IAE1B,yBAAyB;IAClB,OAAO,EAAE,WAAW,EAAE,CAAM;IAEnC,eAAe;IACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAM;IAE5C,kCAAkC;IAC3B,OAAO,SAAM;IAEpB,6BAA6B;IACtB,aAAa,EAAE,aAAa,CAAS;IAE5C,+BAA+B;IACxB,eAAe,EAAE,MAAM,EAAE,CAAM;IAI/B,UAAU,SAAK;IACf,QAAQ,SAAM;IAIrB,8EAA8E;IAC9E,OAAO,CAAC,KAAK,CAGV;IAIH,IAAW,SAAS,IAAI,MAAM,CAE7B;IAIM,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAaxE,QAAQ,IAAI,IAAI;IAUhB,QAAQ,IAAI,IAAI;IAIhB,SAAS,IAAI,IAAI;IAMxB,gDAAgD;IAChD,IAAW,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAGjD;IAED,IAAW,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAElD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,aAAa,GAAI,OAAO,MAAM,KAAG,OAAO,CAE7C;IAIK,UAAU,GAAI,QAAQ,WAAW,KAAG,IAAI,CAE7C;IAEK,eAAe,QAAO,IAAI,CAE/B;IAEK,eAAe,GAAI,OAAO,MAAM,EAAE,OAAO,KAAK,KAAG,IAAI,CAE1D;IAEK,cAAc,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,IAAI,CAEzE;CACF"}
@@ -5,9 +5,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { MelodicComponent } from '@melodicdev/core';
8
+ import { watchSlotPresence } from '../../../functions/index.js';
8
9
  import { tableTemplate } from './table.template.js';
9
10
  import { tableStyles } from './table.styles.js';
10
- import { VirtualScroller } from '../../../utils/virtual-scroll/index.js';
11
+ import { TableCore } from '../table-core/index.js';
11
12
  /**
12
13
  * ml-table - Data table with sorting, selection, and custom cell rendering
13
14
  *
@@ -27,7 +28,11 @@ import { VirtualScroller } from '../../../utils/virtual-scroll/index.js';
27
28
  * ```
28
29
  *
29
30
  * @fires ml:sort - Emitted when a sortable column header is clicked. Detail: { key, direction }
30
- * @fires ml:select - Emitted when row selection changes. Detail: { selectedRows, allSelected }
31
+ * @fires ml:select - Emitted when row selection changes (including when sorting clears a
32
+ * non-empty selection). Detail: { selectedRows, selectedIndices, allSelected } where
33
+ * `selectedRows` contains the selected row OBJECTS and `selectedIndices` their indices
34
+ * in the original `rows` array (consumer order, independent of the current sort).
35
+ * BREAKING (2.x): `selectedRows` previously contained sorted-order indices.
31
36
  * @fires ml:row-click - Emitted when a row is clicked. Detail: { row, index }
32
37
  *
33
38
  * @slot footer - Content for the table footer area (e.g. pagination)
@@ -82,55 +87,26 @@ let TableComponent = class TableComponent {
82
87
  this.startIndex = 0;
83
88
  this.endIndex = 50;
84
89
  // ── Private ──────────────────────────────────────────────────────────────────
85
- this._scroller = new VirtualScroller();
86
- this._viewport = null;
90
+ /** Shared table pipeline: sorting, selection, ml:* events, virtual window. */
91
+ this._core = new TableCore(this, {
92
+ viewportSelector: '.ml-table__wrapper',
93
+ displayRows: () => this.sortedRows
94
+ });
87
95
  this.isRowSelected = (index) => {
88
- return this.selectedIndices.includes(index);
96
+ return this._core.isRowSelected(index);
89
97
  };
90
98
  // ── Event handlers ────────────────────────────────────────────────────────────
91
99
  this.handleSort = (column) => {
92
- if (!column.sortable)
93
- return;
94
- if (this.sortKey === column.key) {
95
- this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
96
- }
97
- else {
98
- this.sortKey = column.key;
99
- this.sortDirection = 'asc';
100
- }
101
- this.selectedIndices = [];
102
- this._scroller.invalidate();
103
- this.elementRef.dispatchEvent(new CustomEvent('ml:sort', {
104
- bubbles: true,
105
- composed: true,
106
- detail: { key: this.sortKey, direction: this.sortDirection }
107
- }));
100
+ this._core.handleSortClick(column);
108
101
  };
109
102
  this.handleSelectAll = () => {
110
- if (this.allSelected) {
111
- this.selectedIndices = [];
112
- }
113
- else {
114
- this.selectedIndices = this.rows.map((_, i) => i);
115
- }
116
- this.emitSelect();
103
+ this._core.toggleSelectAll();
117
104
  };
118
105
  this.handleSelectRow = (index, event) => {
119
- event.stopPropagation();
120
- if (this.selectedIndices.includes(index)) {
121
- this.selectedIndices = this.selectedIndices.filter(i => i !== index);
122
- }
123
- else {
124
- this.selectedIndices = [...this.selectedIndices, index];
125
- }
126
- this.emitSelect();
106
+ this._core.toggleSelectRow(index, event);
127
107
  };
128
108
  this.handleRowClick = (row, index) => {
129
- this.elementRef.dispatchEvent(new CustomEvent('ml:row-click', {
130
- bubbles: true,
131
- composed: true,
132
- detail: { row, index }
133
- }));
109
+ this._core.emitRowClick(row, index);
134
110
  };
135
111
  }
136
112
  // ── Row height by size ────────────────────────────────────────────────────────
@@ -139,111 +115,58 @@ let TableComponent = class TableComponent {
139
115
  }
140
116
  // ── Lifecycle ─────────────────────────────────────────────────────────────────
141
117
  onPropertyChange(name, _oldVal, _newVal) {
142
- if (name === 'rows' || name === 'columns') {
143
- this._scroller.invalidate();
118
+ if (name === 'columns') {
119
+ this._core.invalidateScroller();
120
+ }
121
+ if (name === 'rows') {
122
+ // Selection is positional; a new dataset invalidates it. Reset silently
123
+ // (the consumer initiated the change) and recompute the virtual window
124
+ // after the new value commits — same behavior as ml-data-grid.
125
+ this._core.handleRowsChange();
144
126
  }
145
127
  }
146
128
  onCreate() {
147
129
  const shadow = this.elementRef.shadowRoot;
148
130
  if (!shadow)
149
131
  return;
150
- shadow.querySelectorAll('slot').forEach(slot => {
151
- slot.addEventListener('slotchange', () => {
152
- const name = slot.getAttribute('name');
153
- if (name === 'footer') {
154
- this.hasFooter = slot.assignedNodes().length > 0;
155
- }
156
- else if (name === 'header-actions') {
157
- this.hasHeaderActions = slot.assignedNodes().length > 0;
158
- }
159
- });
132
+ watchSlotPresence(shadow, (name, hasContent) => {
133
+ if (name === 'footer')
134
+ this.hasFooter = hasContent;
135
+ else if (name === 'header-actions')
136
+ this.hasHeaderActions = hasContent;
160
137
  });
161
- this._attachScroller();
138
+ this._core.attachScroller();
162
139
  }
163
140
  onRender() {
164
- this._attachScroller();
165
- // Compute initial end index when viewport height not yet known
166
- if (this.virtual && this._viewport && this._viewport.clientHeight === 0 && this.sortedRows.length > 0) {
167
- const approxEnd = Math.min(this.sortedRows.length, Math.ceil(600 / this.rowHeight) + 6);
168
- if (approxEnd !== this.endIndex) {
169
- this.endIndex = approxEnd;
170
- }
171
- }
172
- if (!this.virtual) {
173
- const total = this.sortedRows.length;
174
- if (this.endIndex !== total)
175
- this.endIndex = total;
176
- }
141
+ this._core.syncRenderWindow();
177
142
  }
178
143
  onDestroy() {
179
- this._scroller.detach();
180
- this._viewport = null;
181
- }
182
- // ── Private helpers ───────────────────────────────────────────────────────────
183
- _attachScroller() {
184
- if (this._viewport)
185
- return; // already attached
186
- const shadow = this.elementRef.shadowRoot;
187
- if (!shadow)
188
- return;
189
- this._viewport = shadow.querySelector('.ml-table__wrapper');
190
- if (!this._viewport)
191
- return;
192
- this._scroller.attach(this._viewport, {
193
- rowHeight: () => this.rowHeight,
194
- itemCount: () => this.sortedRows.length,
195
- onUpdate: (start, end) => { this.startIndex = start; this.endIndex = end; },
196
- enabled: () => this.virtual,
197
- });
144
+ this._core.detach();
198
145
  }
199
146
  // ── Data ──────────────────────────────────────────────────────────────────────
200
147
  /** Rows sorted by current sort key/direction */
201
148
  get sortedRows() {
202
- if (this.manualSort || !this.sortKey)
149
+ if (this.manualSort)
203
150
  return this.rows;
204
- const key = this.sortKey;
205
- const dir = this.sortDirection === 'asc' ? 1 : -1;
206
- return [...this.rows].sort((a, b) => {
207
- const aVal = a[key];
208
- const bVal = b[key];
209
- if (aVal === undefined || aVal === null) {
210
- return (bVal === undefined || bVal === null) ? 0 : 1;
211
- }
212
- if (bVal === undefined || bVal === null)
213
- return -1;
214
- if (typeof aVal === 'number' && typeof bVal === 'number')
215
- return (aVal - bVal) * dir;
216
- return String(aVal).localeCompare(String(bVal)) * dir;
217
- });
151
+ return this._core.sortRows(this.rows);
218
152
  }
219
153
  get visibleRows() {
220
- if (!this.virtual)
221
- return this.sortedRows;
222
- return this.sortedRows.slice(this.startIndex, this.endIndex);
154
+ return this._core.visibleRows;
223
155
  }
224
156
  get topSpacerHeight() {
225
- return this.virtual ? this.startIndex * this.rowHeight : 0;
157
+ return this._core.topSpacerHeight;
226
158
  }
227
159
  get bottomSpacerHeight() {
228
- if (!this.virtual)
229
- return 0;
230
- return Math.max(0, (this.sortedRows.length - this.endIndex) * this.rowHeight);
160
+ return this._core.bottomSpacerHeight;
231
161
  }
232
162
  get colCount() {
233
163
  return this.columns.length + (this.selectable ? 1 : 0);
234
164
  }
235
165
  get allSelected() {
236
- return this.rows.length > 0 && this.selectedIndices.length === this.rows.length;
166
+ return this._core.allSelected;
237
167
  }
238
168
  get someSelected() {
239
- return this.selectedIndices.length > 0 && !this.allSelected;
240
- }
241
- emitSelect() {
242
- this.elementRef.dispatchEvent(new CustomEvent('ml:select', {
243
- bubbles: true,
244
- composed: true,
245
- detail: { selectedRows: this.selectedIndices, allSelected: this.allSelected }
246
- }));
169
+ return this._core.someSelected;
247
170
  }
248
171
  };
249
172
  TableComponent = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"table.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,iDAiTvB,CAAC"}
1
+ {"version":3,"file":"table.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,iDAoTvB,CAAC"}
@@ -177,13 +177,16 @@ export const tableStyles = () => css `
177
177
  }
178
178
 
179
179
  /* ── Body rows ── */
180
+ /* Divider rendered as an inset box-shadow (not border-bottom) so it never
181
+ participates in layout — hover/selected/striped state changes can't
182
+ collapse it and shift rows below by 1px. */
180
183
  .ml-table__row {
181
- border-bottom: var(--ml-table-divider-width) solid var(--ml-table-divider-color);
184
+ box-shadow: inset 0 calc(-1 * var(--ml-table-divider-width)) 0 var(--ml-table-divider-color);
182
185
  transition: background-color var(--ml-duration-150) var(--ml-ease-in-out);
183
186
  }
184
187
 
185
188
  .ml-table__row:last-child {
186
- border-bottom: none;
189
+ box-shadow: none;
187
190
  }
188
191
 
189
192
  .ml-table--hoverable .ml-table__row:hover {
@@ -1 +1 @@
1
- {"version":3,"file":"table.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAU3D,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,6CA+H9C"}
1
+ {"version":3,"file":"table.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,6CA+H9C"}
@@ -1,10 +1,5 @@
1
1
  import { html, classMap, when, repeat } from '@melodicdev/core';
2
- function renderCell(column, row, index) {
3
- if (column.render) {
4
- return column.render(row[column.key], row, index);
5
- }
6
- return row[column.key] ?? '';
7
- }
2
+ import { renderCell } from '../table-core/index.js';
8
3
  export function tableTemplate(c) {
9
4
  return html `
10
5
  <div class=${classMap({
@@ -0,0 +1,3 @@
1
+ export { TableCore, renderCell } from './table-core.js';
2
+ export type { TableCoreHost, TableCoreOptions, TableCoreColumn, SortDirection } from './table-core.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table-core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ // INTERNAL shared core for ml-table / ml-data-grid — not exported from the package root.
2
+ export { TableCore, renderCell } from './table-core.js';