@melodicdev/components 2.0.3 → 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 (328) hide show
  1. package/README.md +7 -6
  2. package/assets/melodic-components.js +5570 -4150
  3. package/assets/melodic-components.js.map +1 -1
  4. package/assets/melodic-components.min.js +6466 -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.template.d.ts.map +1 -1
  49. package/lib/components/data-display/table/table.template.js +1 -6
  50. package/lib/components/data-display/table-core/index.d.ts +3 -0
  51. package/lib/components/data-display/table-core/index.d.ts.map +1 -0
  52. package/lib/components/data-display/table-core/index.js +2 -0
  53. package/lib/components/data-display/table-core/table-core.d.ts +137 -0
  54. package/lib/components/data-display/table-core/table-core.d.ts.map +1 -0
  55. package/lib/components/data-display/table-core/table-core.js +225 -0
  56. package/lib/components/data-display/tag/tag.component.d.ts +14 -7
  57. package/lib/components/data-display/tag/tag.component.d.ts.map +1 -1
  58. package/lib/components/data-display/tag/tag.component.js +29 -5
  59. package/lib/components/data-display/tag/tag.template.js +2 -2
  60. package/lib/components/data-display/tag/tag.types.d.ts +8 -1
  61. package/lib/components/data-display/tag/tag.types.d.ts.map +1 -1
  62. package/lib/components/feedback/alert/alert.component.d.ts +6 -3
  63. package/lib/components/feedback/alert/alert.component.d.ts.map +1 -1
  64. package/lib/components/feedback/alert/alert.component.js +13 -4
  65. package/lib/components/feedback/alert/alert.template.js +1 -1
  66. package/lib/components/feedback/progress/progress.component.d.ts +4 -0
  67. package/lib/components/feedback/progress/progress.component.d.ts.map +1 -1
  68. package/lib/components/feedback/progress/progress.component.js +9 -0
  69. package/lib/components/feedback/progress/progress.template.d.ts.map +1 -1
  70. package/lib/components/feedback/progress/progress.template.js +19 -5
  71. package/lib/components/feedback/toast/toast.component.d.ts +6 -3
  72. package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
  73. package/lib/components/feedback/toast/toast.component.js +13 -4
  74. package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
  75. package/lib/components/feedback/toast/toast.service.js +2 -1
  76. package/lib/components/feedback/toast/toast.template.js +1 -1
  77. package/lib/components/forms/autocomplete/autocomplete.component.d.ts +12 -4
  78. package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
  79. package/lib/components/forms/autocomplete/autocomplete.component.js +39 -30
  80. package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
  81. package/lib/components/forms/autocomplete/autocomplete.template.js +14 -0
  82. package/lib/components/forms/button/button.component.d.ts +28 -3
  83. package/lib/components/forms/button/button.component.d.ts.map +1 -1
  84. package/lib/components/forms/button/button.component.js +81 -6
  85. package/lib/components/forms/button/button.template.js +1 -1
  86. package/lib/components/forms/button/button.types.d.ts +8 -1
  87. package/lib/components/forms/button/button.types.d.ts.map +1 -1
  88. package/lib/components/forms/button-group/button-group-item.component.d.ts +2 -2
  89. package/lib/components/forms/button-group/button-group-item.component.d.ts.map +1 -1
  90. package/lib/components/forms/button-group/button-group.component.d.ts +4 -2
  91. package/lib/components/forms/button-group/button-group.component.d.ts.map +1 -1
  92. package/lib/components/forms/button-group/button-group.component.js +3 -1
  93. package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
  94. package/lib/components/forms/button-group/button-group.styles.js +15 -1
  95. package/lib/components/forms/button-group/button-group.template.d.ts.map +1 -1
  96. package/lib/components/forms/button-group/button-group.template.js +4 -2
  97. package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -2
  98. package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
  99. package/lib/components/forms/checkbox/checkbox.component.js +3 -1
  100. package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
  101. package/lib/components/forms/checkbox/checkbox.styles.js +19 -0
  102. package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
  103. package/lib/components/forms/checkbox/checkbox.template.js +4 -2
  104. package/lib/components/forms/date-picker/calendar.component.js +1 -1
  105. package/lib/components/forms/date-picker/date-picker.component.d.ts +11 -4
  106. package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
  107. package/lib/components/forms/date-picker/date-picker.component.js +99 -32
  108. package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  109. package/lib/components/forms/date-picker/date-picker.styles.js +0 -10
  110. package/lib/components/forms/date-picker/date-picker.template.d.ts.map +1 -1
  111. package/lib/components/forms/date-picker/date-picker.template.js +3 -4
  112. package/lib/components/forms/file-upload/file-upload-item.component.d.ts +7 -0
  113. package/lib/components/forms/file-upload/file-upload-item.component.d.ts.map +1 -1
  114. package/lib/components/forms/file-upload/file-upload-item.component.js +15 -0
  115. package/lib/components/forms/file-upload/file-upload.component.d.ts +15 -0
  116. package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
  117. package/lib/components/forms/file-upload/file-upload.component.js +56 -0
  118. package/lib/components/forms/form-field/form-field.component.d.ts +12 -4
  119. package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
  120. package/lib/components/forms/form-field/form-field.component.js +50 -31
  121. package/lib/components/forms/form-field/form-field.template.js +1 -1
  122. package/lib/components/forms/input/input.component.d.ts +2 -2
  123. package/lib/components/forms/input/input.component.d.ts.map +1 -1
  124. package/lib/components/forms/radio/radio-group.component.d.ts +6 -0
  125. package/lib/components/forms/radio/radio-group.component.d.ts.map +1 -1
  126. package/lib/components/forms/radio/radio-group.component.js +69 -2
  127. package/lib/components/forms/radio/radio-group.template.js +1 -1
  128. package/lib/components/forms/radio/radio.component.d.ts +7 -2
  129. package/lib/components/forms/radio/radio.component.d.ts.map +1 -1
  130. package/lib/components/forms/radio/radio.component.js +5 -0
  131. package/lib/components/forms/radio/radio.template.d.ts.map +1 -1
  132. package/lib/components/forms/radio/radio.template.js +1 -0
  133. package/lib/components/forms/select/select.component.d.ts +13 -6
  134. package/lib/components/forms/select/select.component.d.ts.map +1 -1
  135. package/lib/components/forms/select/select.component.js +32 -36
  136. package/lib/components/forms/select/select.template.d.ts.map +1 -1
  137. package/lib/components/forms/select/select.template.js +6 -2
  138. package/lib/components/forms/slider/slider.component.d.ts +2 -2
  139. package/lib/components/forms/slider/slider.component.d.ts.map +1 -1
  140. package/lib/components/forms/slider/slider.component.js +5 -1
  141. package/lib/components/forms/textarea/textarea.component.d.ts +2 -2
  142. package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
  143. package/lib/components/forms/toggle/toggle.component.d.ts +4 -2
  144. package/lib/components/forms/toggle/toggle.component.d.ts.map +1 -1
  145. package/lib/components/forms/toggle/toggle.component.js +3 -1
  146. package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
  147. package/lib/components/forms/toggle/toggle.styles.js +19 -0
  148. package/lib/components/forms/toggle/toggle.template.d.ts.map +1 -1
  149. package/lib/components/forms/toggle/toggle.template.js +11 -3
  150. package/lib/components/foundation/card/card.component.d.ts +7 -6
  151. package/lib/components/foundation/card/card.component.d.ts.map +1 -1
  152. package/lib/components/foundation/card/card.component.js +18 -7
  153. package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
  154. package/lib/components/foundation/card/card.styles.js +5 -0
  155. package/lib/components/foundation/card/card.template.d.ts.map +1 -1
  156. package/lib/components/foundation/card/card.template.js +16 -11
  157. package/lib/components/foundation/divider/divider.component.d.ts +5 -4
  158. package/lib/components/foundation/divider/divider.component.d.ts.map +1 -1
  159. package/lib/components/foundation/divider/divider.component.js +11 -3
  160. package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
  161. package/lib/components/foundation/divider/divider.styles.js +6 -0
  162. package/lib/components/foundation/divider/divider.template.d.ts +5 -0
  163. package/lib/components/foundation/divider/divider.template.d.ts.map +1 -1
  164. package/lib/components/foundation/divider/divider.template.js +9 -6
  165. package/lib/components/general/icon/icon.template.d.ts.map +1 -1
  166. package/lib/components/general/icon/icon.template.js +3 -1
  167. package/lib/components/navigation/pagination/pagination.component.d.ts +5 -0
  168. package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
  169. package/lib/components/navigation/pagination/pagination.component.js +22 -10
  170. package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
  171. package/lib/components/navigation/pagination/pagination.styles.js +6 -4
  172. package/lib/components/navigation/sidebar/sidebar-item.component.d.ts +4 -4
  173. package/lib/components/navigation/sidebar/sidebar-item.component.d.ts.map +1 -1
  174. package/lib/components/navigation/sidebar/sidebar-item.component.js +11 -4
  175. package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
  176. package/lib/components/navigation/sidebar/sidebar.component.d.ts +7 -0
  177. package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
  178. package/lib/components/navigation/sidebar/sidebar.component.js +48 -5
  179. package/lib/components/navigation/steps/step-panel.component.d.ts +7 -0
  180. package/lib/components/navigation/steps/step-panel.component.d.ts.map +1 -1
  181. package/lib/components/navigation/steps/step-panel.component.js +7 -0
  182. package/lib/components/navigation/steps/step-panel.template.d.ts +1 -1
  183. package/lib/components/navigation/steps/step-panel.template.d.ts.map +1 -1
  184. package/lib/components/navigation/steps/step-panel.template.js +2 -2
  185. package/lib/components/navigation/steps/step.component.d.ts +2 -2
  186. package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
  187. package/lib/components/navigation/steps/step.component.js +8 -2
  188. package/lib/components/navigation/steps/step.template.js +1 -1
  189. package/lib/components/navigation/steps/steps.component.d.ts +3 -1
  190. package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
  191. package/lib/components/navigation/steps/steps.component.js +47 -14
  192. package/lib/components/navigation/steps/steps.template.d.ts.map +1 -1
  193. package/lib/components/navigation/steps/steps.template.js +5 -1
  194. package/lib/components/navigation/tabs/tab-panel.component.d.ts +7 -0
  195. package/lib/components/navigation/tabs/tab-panel.component.d.ts.map +1 -1
  196. package/lib/components/navigation/tabs/tab-panel.component.js +7 -0
  197. package/lib/components/navigation/tabs/tab-panel.template.d.ts +1 -1
  198. package/lib/components/navigation/tabs/tab-panel.template.d.ts.map +1 -1
  199. package/lib/components/navigation/tabs/tab-panel.template.js +2 -2
  200. package/lib/components/navigation/tabs/tabs.component.d.ts +5 -3
  201. package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
  202. package/lib/components/navigation/tabs/tabs.component.js +49 -14
  203. package/lib/components/navigation/tabs/tabs.template.d.ts.map +1 -1
  204. package/lib/components/navigation/tabs/tabs.template.js +6 -1
  205. package/lib/components/overlays/dialog/dialog-ref.class.d.ts +17 -2
  206. package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
  207. package/lib/components/overlays/dialog/dialog-ref.class.js +52 -6
  208. package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
  209. package/lib/components/overlays/dialog/dialog.component.js +5 -1
  210. package/lib/components/overlays/dialog/dialog.service.d.ts +2 -2
  211. package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
  212. package/lib/components/overlays/dialog/dialog.service.js +46 -18
  213. package/lib/components/overlays/drawer/drawer.component.d.ts +9 -2
  214. package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
  215. package/lib/components/overlays/drawer/drawer.component.js +34 -4
  216. package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
  217. package/lib/components/overlays/drawer/drawer.styles.js +4 -0
  218. package/lib/components/overlays/dropdown/dropdown-item.component.d.ts +5 -2
  219. package/lib/components/overlays/dropdown/dropdown-item.component.d.ts.map +1 -1
  220. package/lib/components/overlays/dropdown/dropdown-item.component.js +18 -0
  221. package/lib/components/overlays/dropdown/dropdown-item.template.d.ts.map +1 -1
  222. package/lib/components/overlays/dropdown/dropdown-item.template.js +0 -3
  223. package/lib/components/overlays/dropdown/dropdown.component.d.ts +8 -4
  224. package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
  225. package/lib/components/overlays/dropdown/dropdown.component.js +61 -60
  226. package/lib/components/overlays/popover/popover.component.d.ts +6 -4
  227. package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
  228. package/lib/components/overlays/popover/popover.component.js +37 -51
  229. package/lib/components/overlays/tooltip/tooltip.component.d.ts +29 -4
  230. package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
  231. package/lib/components/overlays/tooltip/tooltip.component.js +73 -31
  232. package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
  233. package/lib/components/overlays/tooltip/tooltip.styles.js +22 -10
  234. package/lib/components/overlays/tooltip/tooltip.template.d.ts.map +1 -1
  235. package/lib/components/overlays/tooltip/tooltip.template.js +3 -2
  236. package/lib/components/pages/auth/login-page.component.d.ts +11 -4
  237. package/lib/components/pages/auth/login-page.component.d.ts.map +1 -1
  238. package/lib/components/pages/auth/login-page.component.js +18 -5
  239. package/lib/components/pages/auth/login-page.template.d.ts.map +1 -1
  240. package/lib/components/pages/auth/login-page.template.js +9 -10
  241. package/lib/components/pages/auth/signup-page.component.d.ts +11 -4
  242. package/lib/components/pages/auth/signup-page.component.d.ts.map +1 -1
  243. package/lib/components/pages/auth/signup-page.component.js +18 -5
  244. package/lib/components/pages/auth/signup-page.template.d.ts.map +1 -1
  245. package/lib/components/pages/auth/signup-page.template.js +9 -10
  246. package/lib/components/pages/dashboard/dashboard-page.component.d.ts +18 -11
  247. package/lib/components/pages/dashboard/dashboard-page.component.d.ts.map +1 -1
  248. package/lib/components/pages/dashboard/dashboard-page.component.js +55 -13
  249. package/lib/components/pages/dashboard/dashboard-page.template.js +1 -1
  250. package/lib/components/sections/app-shell/app-shell.component.d.ts +6 -6
  251. package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
  252. package/lib/components/sections/app-shell/app-shell.component.js +14 -6
  253. package/lib/components/sections/app-shell/app-shell.template.js +3 -3
  254. package/lib/components/sections/hero/hero-section.component.d.ts +6 -3
  255. package/lib/components/sections/hero/hero-section.component.d.ts.map +1 -1
  256. package/lib/components/sections/hero/hero-section.component.js +13 -4
  257. package/lib/components/sections/hero/hero-section.template.js +2 -2
  258. package/lib/components/sections/page-header/page-header.component.d.ts +16 -17
  259. package/lib/components/sections/page-header/page-header.component.d.ts.map +1 -1
  260. package/lib/components/sections/page-header/page-header.component.js +36 -25
  261. package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
  262. package/lib/components/sections/page-header/page-header.styles.js +9 -0
  263. package/lib/components/sections/page-header/page-header.template.d.ts +5 -0
  264. package/lib/components/sections/page-header/page-header.template.d.ts.map +1 -1
  265. package/lib/components/sections/page-header/page-header.template.js +42 -31
  266. package/lib/components/sections/page-section/page-section.component.d.ts +16 -12
  267. package/lib/components/sections/page-section/page-section.component.d.ts.map +1 -1
  268. package/lib/components/sections/page-section/page-section.component.js +34 -12
  269. package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
  270. package/lib/components/sections/page-section/page-section.styles.js +6 -0
  271. package/lib/components/sections/page-section/page-section.template.d.ts +6 -0
  272. package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
  273. package/lib/components/sections/page-section/page-section.template.js +26 -15
  274. package/lib/components/sections/page-section/sanitize-href.function.d.ts +12 -0
  275. package/lib/components/sections/page-section/sanitize-href.function.d.ts.map +1 -0
  276. package/lib/components/sections/page-section/sanitize-href.function.js +15 -0
  277. package/lib/directives/tooltip.directive.d.ts +8 -2
  278. package/lib/directives/tooltip.directive.d.ts.map +1 -1
  279. package/lib/directives/tooltip.directive.js +103 -9
  280. package/lib/functions/deprecation.functions.d.ts +21 -0
  281. package/lib/functions/deprecation.functions.d.ts.map +1 -0
  282. package/lib/functions/deprecation.functions.js +44 -0
  283. package/lib/functions/index.d.ts +2 -0
  284. package/lib/functions/index.d.ts.map +1 -1
  285. package/lib/functions/index.js +2 -0
  286. package/lib/functions/watch-slot-presence.function.d.ts +17 -0
  287. package/lib/functions/watch-slot-presence.function.d.ts.map +1 -0
  288. package/lib/functions/watch-slot-presence.function.js +27 -0
  289. package/lib/theme/functions/create-theme.function.d.ts +15 -1
  290. package/lib/theme/functions/create-theme.function.d.ts.map +1 -1
  291. package/lib/theme/functions/create-theme.function.js +57 -11
  292. package/lib/theme/index.d.ts +1 -0
  293. package/lib/theme/index.d.ts.map +1 -1
  294. package/lib/types/index.d.ts +8 -2
  295. package/lib/types/index.d.ts.map +1 -1
  296. package/lib/utils/accessibility/focus-trap.d.ts +19 -1
  297. package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
  298. package/lib/utils/accessibility/focus-trap.js +77 -8
  299. package/lib/utils/accessibility/index.d.ts +2 -1
  300. package/lib/utils/accessibility/index.d.ts.map +1 -1
  301. package/lib/utils/accessibility/index.js +1 -1
  302. package/lib/utils/accessibility/live-region.d.ts +10 -3
  303. package/lib/utils/accessibility/live-region.d.ts.map +1 -1
  304. package/lib/utils/accessibility/live-region.js +64 -35
  305. package/lib/utils/directives/click-outside.directive.d.ts.map +1 -1
  306. package/lib/utils/directives/click-outside.directive.js +5 -3
  307. package/lib/utils/overlay/index.d.ts +4 -0
  308. package/lib/utils/overlay/index.d.ts.map +1 -0
  309. package/lib/utils/overlay/index.js +2 -0
  310. package/lib/utils/overlay/overlay-positioner.d.ts +54 -0
  311. package/lib/utils/overlay/overlay-positioner.d.ts.map +1 -0
  312. package/lib/utils/overlay/overlay-positioner.js +85 -0
  313. package/lib/utils/overlay/toggle-dismiss-guard.d.ts +24 -0
  314. package/lib/utils/overlay/toggle-dismiss-guard.d.ts.map +1 -0
  315. package/lib/utils/overlay/toggle-dismiss-guard.js +36 -0
  316. package/lib/utils/positioning/auto-update.d.ts.map +1 -1
  317. package/lib/utils/positioning/auto-update.js +3 -0
  318. package/lib/utils/positioning/compute-position.d.ts.map +1 -1
  319. package/lib/utils/positioning/compute-position.js +8 -4
  320. package/lib/utils/positioning/middlewares/flip.middleware.d.ts.map +1 -1
  321. package/lib/utils/positioning/middlewares/flip.middleware.js +10 -3
  322. package/lib/utils/positioning/middlewares/offset.middleware.d.ts +15 -0
  323. package/lib/utils/positioning/middlewares/offset.middleware.d.ts.map +1 -1
  324. package/lib/utils/positioning/middlewares/offset.middleware.js +31 -1
  325. package/lib/utils/positioning/middlewares/shift.middleware.d.ts +13 -3
  326. package/lib/utils/positioning/middlewares/shift.middleware.d.ts.map +1 -1
  327. package/lib/utils/positioning/middlewares/shift.middleware.js +15 -7
  328. package/package.json +6 -2
@@ -18,6 +18,20 @@ export function parseDate(iso) {
18
18
  const [y, m, d] = iso.split('T')[0].split('-').map(Number);
19
19
  return new Date(y, m - 1, d);
20
20
  }
21
+ /**
22
+ * Parse an event timestamp on the single timezone basis the calendar uses
23
+ * everywhere: LOCAL time. Full timestamps go through `new Date(iso)` so any
24
+ * offset/Z suffix is honored and converted to local time; date-only strings
25
+ * are treated as local midnight (never `new Date('YYYY-MM-DD')`, which is UTC
26
+ * midnight and shifts a day in negative-offset timezones).
27
+ */
28
+ export function parseEventDate(iso) {
29
+ return iso.includes('T') ? new Date(iso) : parseDate(iso);
30
+ }
31
+ /** Local-time calendar date (YYYY-MM-DD) of an event timestamp. */
32
+ export function toLocalIsoDate(date) {
33
+ return toIsoDate(date.getFullYear(), date.getMonth(), date.getDate());
34
+ }
21
35
  export function isSameDay(a, b) {
22
36
  return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
23
37
  }
@@ -54,7 +68,7 @@ export function getISOWeekNumber(date) {
54
68
  return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7);
55
69
  }
56
70
  export function formatTime(iso) {
57
- const date = new Date(iso);
71
+ const date = parseEventDate(iso);
58
72
  const h = date.getHours();
59
73
  const m = date.getMinutes();
60
74
  const ampm = h >= 12 ? 'PM' : 'AM';
@@ -133,10 +147,10 @@ export function getWeekdayHeaders(weekStartsOn = 0) {
133
147
  });
134
148
  }
135
149
  export function getEventsForDate(events, iso) {
136
- return events.filter(e => {
137
- const eventDate = e.start.split('T')[0];
138
- return eventDate === iso;
139
- });
150
+ // Bucket by the event's LOCAL calendar date — the same basis used to render
151
+ // its time — so a `…T23:00:00Z` event never lands on its UTC date while
152
+ // displaying a local-shifted time on the wrong day.
153
+ return events.filter(e => toLocalIsoDate(parseEventDate(e.start)) === iso);
140
154
  }
141
155
  export function getMonthAbbrev(date) {
142
156
  return MONTH_ABBREVS[date.getMonth()];
@@ -147,31 +161,48 @@ export function getDayAbbrev(date) {
147
161
  export function getDayName(date) {
148
162
  return DAY_NAMES[date.getDay()];
149
163
  }
150
- function getMinutesFromMidnight(iso) {
151
- const date = new Date(iso);
152
- return date.getHours() * 60 + date.getMinutes();
153
- }
154
164
  /** Convert minutes from midnight to a 1-based grid row (30-min increments, 48 rows) */
155
165
  function minutesToGridRow(minutes) {
156
166
  return Math.floor(minutes / TIME_INCREMENT) + 1;
157
167
  }
168
+ /**
169
+ * An event's in-day occupancy in local minutes from midnight.
170
+ *
171
+ * Events that cross midnight (or otherwise end on a later local day than they
172
+ * start) are clamped to the end of the start day, so grid spans stay valid
173
+ * (gridRowEnd >= gridRowStart) and column packing sees real occupancy instead
174
+ * of an end that is numerically before the start. Degenerate/reversed inputs
175
+ * within one day are clamped to a minimum positive span.
176
+ */
177
+ function getEventSpan(event) {
178
+ const startDate = parseEventDate(event.start);
179
+ const endDate = parseEventDate(event.end);
180
+ const start = startDate.getHours() * 60 + startDate.getMinutes();
181
+ let end = endDate.getHours() * 60 + endDate.getMinutes();
182
+ if (!isSameDay(startDate, endDate)) {
183
+ end = 24 * 60;
184
+ }
185
+ return { start, end: Math.max(end, start + 1) };
186
+ }
158
187
  export function layoutOverlappingEvents(events) {
159
188
  if (events.length === 0)
160
189
  return [];
190
+ const spans = new Map();
191
+ for (const event of events) {
192
+ spans.set(event.id, getEventSpan(event));
193
+ }
194
+ const spanOf = (event) => spans.get(event.id);
161
195
  const sorted = [...events].sort((a, b) => {
162
- const aStart = getMinutesFromMidnight(a.start);
163
- const bStart = getMinutesFromMidnight(b.start);
164
- if (aStart !== bStart)
165
- return aStart - bStart;
166
- const aDuration = getMinutesFromMidnight(a.end) - aStart;
167
- const bDuration = getMinutesFromMidnight(b.end) - bStart;
168
- return bDuration - aDuration;
196
+ const aSpan = spanOf(a);
197
+ const bSpan = spanOf(b);
198
+ if (aSpan.start !== bSpan.start)
199
+ return aSpan.start - bSpan.start;
200
+ return (bSpan.end - bSpan.start) - (aSpan.end - aSpan.start);
169
201
  });
170
202
  const columns = [];
171
203
  const eventColumns = new Map();
172
204
  for (const event of sorted) {
173
- const start = getMinutesFromMidnight(event.start);
174
- const end = getMinutesFromMidnight(event.end);
205
+ const { start, end } = spanOf(event);
175
206
  let placed = false;
176
207
  for (let col = 0; col < columns.length; col++) {
177
208
  const lastInCol = columns[col][columns[col].length - 1];
@@ -195,16 +226,16 @@ export function layoutOverlappingEvents(events) {
195
226
  continue;
196
227
  const group = [event];
197
228
  visited.add(event.id);
198
- let groupEnd = getMinutesFromMidnight(event.end);
229
+ let groupEnd = spanOf(event).end;
199
230
  let maxCol = eventColumns.get(event.id) + 1;
200
231
  for (const other of sorted) {
201
232
  if (visited.has(other.id))
202
233
  continue;
203
- const otherStart = getMinutesFromMidnight(other.start);
204
- if (otherStart < groupEnd) {
234
+ const otherSpan = spanOf(other);
235
+ if (otherSpan.start < groupEnd) {
205
236
  group.push(other);
206
237
  visited.add(other.id);
207
- groupEnd = Math.max(groupEnd, getMinutesFromMidnight(other.end));
238
+ groupEnd = Math.max(groupEnd, otherSpan.end);
208
239
  maxCol = Math.max(maxCol, eventColumns.get(other.id) + 1);
209
240
  }
210
241
  }
@@ -213,14 +244,15 @@ export function layoutOverlappingEvents(events) {
213
244
  const result = [];
214
245
  for (const group of groups) {
215
246
  for (const event of group.events) {
216
- const start = getMinutesFromMidnight(event.start);
217
- const end = getMinutesFromMidnight(event.end);
247
+ const { start, end } = spanOf(event);
218
248
  const col = eventColumns.get(event.id);
219
249
  const total = group.totalColumns;
250
+ const gridRowStart = minutesToGridRow(start);
251
+ const gridRowEnd = Math.max(minutesToGridRow(end), gridRowStart + 1);
220
252
  result.push({
221
253
  event,
222
- gridRowStart: minutesToGridRow(start),
223
- gridRowEnd: minutesToGridRow(end),
254
+ gridRowStart,
255
+ gridRowEnd,
224
256
  left: col / total,
225
257
  width: 1 / total
226
258
  });
@@ -270,7 +302,7 @@ export function getMiniCalendarDots(year, month, events) {
270
302
  const daysInMonth = new Date(year, month + 1, 0).getDate();
271
303
  for (let d = 1; d <= daysInMonth; d++) {
272
304
  const iso = toIsoDate(year, month, d);
273
- if (events.some(e => e.start.split('T')[0] === iso)) {
305
+ if (events.some(e => toLocalIsoDate(parseEventDate(e.start)) === iso)) {
274
306
  dots.add(iso);
275
307
  }
276
308
  }
@@ -19,7 +19,10 @@ import type { DataGridColumn, SortDirection } from './data-grid.types.js';
19
19
  *
20
20
  * @fires ml:sort - { key, direction }
21
21
  * @fires ml:filter - { filters: Record<string, string> }
22
- * @fires ml:select - { selectedRows: number[], allSelected: boolean }
22
+ * @fires ml:select - { selectedRows, selectedIndices, allSelected } where `selectedRows`
23
+ * contains the selected row OBJECTS and `selectedIndices` their indices in the original
24
+ * `rows` array (consumer order). Also emitted when sorting/filtering/paging clears a
25
+ * non-empty selection. BREAKING (2.x): `selectedRows` previously contained page-relative indices.
23
26
  * @fires ml:row-click - { row, index }
24
27
  * @fires ml:column-resize - { key, width }
25
28
  * @fires ml:column-reorder - { order: string[] }
@@ -65,8 +68,8 @@ export declare class DataGridComponent implements IElementRef, OnCreate, OnDestr
65
68
  resizingKey: string | null;
66
69
  draggingKey: string | null;
67
70
  dragOverKey: string | null;
68
- private _scroller;
69
- private _viewport;
71
+ /** Shared table pipeline: sorting, selection, ml:* events, virtual window. */
72
+ private _core;
70
73
  private _resizeStartX;
71
74
  private _resizeStartWidth;
72
75
  get rowHeight(): number;
@@ -74,7 +77,6 @@ export declare class DataGridComponent implements IElementRef, OnCreate, OnDestr
74
77
  onCreate(): void;
75
78
  onRender(): void;
76
79
  onDestroy(): void;
77
- private _attachScroller;
78
80
  private _syncColumnState;
79
81
  get filteredRows(): Record<string, unknown>[];
80
82
  get sortedRows(): Record<string, unknown>[];
@@ -109,6 +111,5 @@ export declare class DataGridComponent implements IElementRef, OnCreate, OnDestr
109
111
  handleDragEnd: () => void;
110
112
  handleDrop: (targetKey: string) => void;
111
113
  goToPage: (page: number) => void;
112
- private _emitSelect;
113
114
  }
114
115
  //# sourceMappingURL=data-grid.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.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,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAiBa,iBAAkB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IAC9F,UAAU,EAAG,WAAW,CAAC;IAIhC,0CAA0C;IACnC,UAAU,UAAS;IAE1B,kCAAkC;IAC3B,OAAO,UAAS;IAEvB,8BAA8B;IACv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O7D;IAEK,gBAAgB,GAAI,KAAK,MAAM,EAAE,GAAG,YAAY,KAAG,IAAI,CAS5D;IAEK,eAAe,QAAO,IAAI,CAU/B;IAEK,eAAe,GAAI,KAAK,MAAM,EAAE,GAAG,SAAS,KAAG,IAAI,CAGxD;IAEK,cAAc,GAAI,KAAK,MAAM,EAAE,GAAG,SAAS,KAAG,IAAI,CAGvD;IAEK,aAAa,QAAO,IAAI,CAG7B;IAEK,UAAU,GAAI,WAAW,MAAM,KAAG,IAAI,CAwB3C;IAEK,QAAQ,GAAI,MAAM,MAAM,KAAG,IAAI,CAgBpC;CACF"}
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { MelodicComponent } from '@melodicdev/core';
8
8
  import { dataGridTemplate } from './data-grid.template.js';
9
9
  import { dataGridStyles } from './data-grid.styles.js';
10
- import { VirtualScroller } from '../../../utils/virtual-scroll/index.js';
10
+ import { TableCore } from '../table-core/index.js';
11
11
  /**
12
12
  * ml-data-grid — Full-featured data grid with virtual scrolling, sorting, filtering,
13
13
  * selection, column resizing, column reordering, pinned columns, and pagination.
@@ -27,7 +27,10 @@ import { VirtualScroller } from '../../../utils/virtual-scroll/index.js';
27
27
  *
28
28
  * @fires ml:sort - { key, direction }
29
29
  * @fires ml:filter - { filters: Record<string, string> }
30
- * @fires ml:select - { selectedRows: number[], allSelected: boolean }
30
+ * @fires ml:select - { selectedRows, selectedIndices, allSelected } where `selectedRows`
31
+ * contains the selected row OBJECTS and `selectedIndices` their indices in the original
32
+ * `rows` array (consumer order). Also emitted when sorting/filtering/paging clears a
33
+ * non-empty selection. BREAKING (2.x): `selectedRows` previously contained page-relative indices.
31
34
  * @fires ml:row-click - { row, index }
32
35
  * @fires ml:column-resize - { key, width }
33
36
  * @fires ml:column-reorder - { order: string[] }
@@ -83,65 +86,46 @@ let DataGridComponent = class DataGridComponent {
83
86
  // ── Reorder drag state (reactive) ────────────────────────────────────────────
84
87
  this.draggingKey = null;
85
88
  this.dragOverKey = null;
86
- // ── Private (non-reactive) DOM refs and drag intermediates ───────────────────
89
+ // ── Private (non-reactive) drag intermediates and shared core ────────────────
87
90
  // Properties starting with _ are intentionally excluded from reactivity.
88
- this._scroller = new VirtualScroller();
89
- this._viewport = null;
91
+ /** Shared table pipeline: sorting, selection, ml:* events, virtual window. */
92
+ this._core = new TableCore(this, {
93
+ viewportSelector: '.ml-data-grid__viewport',
94
+ displayRows: () => this.processedRows
95
+ });
90
96
  this._resizeStartX = 0;
91
97
  this._resizeStartWidth = 0;
92
- this.isRowSelected = (index) => this.selectedIndices.includes(index);
98
+ this.isRowSelected = (index) => this._core.isRowSelected(index);
93
99
  // ── Event handlers ────────────────────────────────────────────────────────────
94
100
  this.handleSort = (col) => {
95
- if (!col.sortable)
96
- return;
97
- if (this.sortKey === col.key) {
98
- this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
99
- }
100
- else {
101
- this.sortKey = col.key;
102
- this.sortDirection = 'asc';
103
- }
104
- this.currentPage = 1;
105
- // Selection is positional; sorting reorders rows, so clear it (otherwise
106
- // the same indices would point at different rows).
107
- this.selectedIndices = [];
108
- this._scroller.invalidate();
109
- this.elementRef.dispatchEvent(new CustomEvent('ml:sort', {
110
- bubbles: true,
111
- composed: true,
112
- detail: { key: this.sortKey, direction: this.sortDirection }
113
- }));
101
+ // Sorting restarts pagination from the first page before events fire.
102
+ this._core.handleSortClick(col, () => {
103
+ this.currentPage = 1;
104
+ });
114
105
  };
115
106
  this.handleFilterInput = (key, e) => {
116
107
  const val = e.target.value;
117
108
  this.filters = { ...this.filters, [key]: val };
118
109
  this.currentPage = 1;
119
110
  // Filtering changes which rows are present; positional selection no longer applies.
120
- this.selectedIndices = [];
121
- this._scroller.invalidate();
111
+ const hadSelection = this._core.clearSelection();
112
+ this._core.invalidateScroller();
122
113
  this.elementRef.dispatchEvent(new CustomEvent('ml:filter', {
123
114
  bubbles: true,
124
115
  composed: true,
125
116
  detail: { filters: this.filters }
126
117
  }));
118
+ if (hadSelection)
119
+ this._core.emitSelect();
127
120
  };
128
121
  this.handleSelectAll = () => {
129
- this.selectedIndices = this.allSelected ? [] : this.processedRows.map((_, i) => i);
130
- this._emitSelect();
122
+ this._core.toggleSelectAll();
131
123
  };
132
124
  this.handleSelectRow = (index, e) => {
133
- e.stopPropagation();
134
- this.selectedIndices = this.selectedIndices.includes(index)
135
- ? this.selectedIndices.filter(i => i !== index)
136
- : [...this.selectedIndices, index];
137
- this._emitSelect();
125
+ this._core.toggleSelectRow(index, e);
138
126
  };
139
127
  this.handleRowClick = (row, index) => {
140
- this.elementRef.dispatchEvent(new CustomEvent('ml:row-click', {
141
- bubbles: true,
142
- composed: true,
143
- detail: { row, index }
144
- }));
128
+ this._core.emitRowClick(row, index);
145
129
  };
146
130
  this.handleResizeStart = (key, e) => {
147
131
  this.resizingKey = key;
@@ -215,15 +199,16 @@ let DataGridComponent = class DataGridComponent {
215
199
  this.currentPage = page;
216
200
  // Selection indices are page-relative; clear on page change so the header
217
201
  // checkbox and ml:select don't report rows from the previous page.
218
- this.selectedIndices = [];
219
- if (this._viewport)
220
- this._viewport.scrollTop = 0;
221
- this._scroller.invalidate();
202
+ const hadSelection = this._core.clearSelection();
203
+ this._core.scrollViewportToTop();
204
+ this._core.invalidateScroller();
222
205
  this.elementRef.dispatchEvent(new CustomEvent('ml:page-change', {
223
206
  bubbles: true,
224
207
  composed: true,
225
208
  detail: { page: this.currentPage, pageSize: this.pageSize }
226
209
  }));
210
+ if (hadSelection)
211
+ this._core.emitSelect();
227
212
  };
228
213
  }
229
214
  // ── Row height by size ────────────────────────────────────────────────────────
@@ -236,19 +221,24 @@ let DataGridComponent = class DataGridComponent {
236
221
  this._syncColumnState(newVal);
237
222
  }
238
223
  if (name === 'rows') {
239
- // Selection is positional; a new dataset invalidates it. Recompute the
240
- // virtual window after the new value commits (onPropertyChange fires
241
- // before the assignment), matching ml-table's behavior.
242
- this.selectedIndices = [];
243
- queueMicrotask(() => this._scroller.invalidate());
224
+ // Selection is positional; a new dataset invalidates it. The virtual
225
+ // window recomputes after the new value commits (onPropertyChange fires
226
+ // before the assignment) — after clamping the page when the new dataset
227
+ // has fewer pages than the current one (internal filter/sort already
228
+ // reset it; an external rows replacement must not leave e.g.
229
+ // "Page 5 of 2" and a blank grid).
230
+ this._core.handleRowsChange(() => {
231
+ if (this.currentPage > this.totalPages) {
232
+ this.currentPage = this.totalPages;
233
+ }
234
+ });
244
235
  }
245
236
  }
246
237
  onCreate() {
247
238
  this._syncColumnState(this.columns);
248
- this._attachScroller();
239
+ this._core.attachScroller();
249
240
  }
250
241
  onRender() {
251
- this._attachScroller();
252
242
  // Update CSS variable for filter row sticky offset
253
243
  const shadow = this.elementRef.shadowRoot;
254
244
  if (shadow) {
@@ -260,40 +250,12 @@ let DataGridComponent = class DataGridComponent {
260
250
  }
261
251
  }
262
252
  }
263
- // Compute initial end index when viewport height not yet known
264
- if (this._viewport && this._viewport.clientHeight === 0 && this.processedRows.length > 0) {
265
- const approxEnd = Math.min(this.processedRows.length, Math.ceil(600 / this.rowHeight) + 6);
266
- if (approxEnd !== this.endIndex) {
267
- this.endIndex = approxEnd;
268
- }
269
- }
270
- if (!this.virtual) {
271
- const total = this.processedRows.length;
272
- if (this.endIndex !== total)
273
- this.endIndex = total;
274
- }
253
+ this._core.syncRenderWindow();
275
254
  }
276
255
  onDestroy() {
277
- this._scroller.detach();
278
- this._viewport = null;
256
+ this._core.detach();
279
257
  }
280
258
  // ── Private helpers ───────────────────────────────────────────────────────────
281
- _attachScroller() {
282
- if (this._viewport)
283
- return; // already attached
284
- const shadow = this.elementRef.shadowRoot;
285
- if (!shadow)
286
- return;
287
- this._viewport = shadow.querySelector('.ml-data-grid__viewport');
288
- if (!this._viewport)
289
- return;
290
- this._scroller.attach(this._viewport, {
291
- rowHeight: () => this.rowHeight,
292
- itemCount: () => this.processedRows.length,
293
- onUpdate: (start, end) => { this.startIndex = start; this.endIndex = end; },
294
- enabled: () => this.virtual,
295
- });
296
- }
297
259
  _syncColumnState(cols) {
298
260
  this.colOrder = cols.map(c => c.key);
299
261
  const newWidths = {};
@@ -312,21 +274,9 @@ let DataGridComponent = class DataGridComponent {
312
274
  return this.rows.filter(row => entries.every(([key, val]) => String(row[key] ?? '').toLowerCase().includes(val.toLowerCase())));
313
275
  }
314
276
  get sortedRows() {
315
- if (this.serverSide || !this.sortKey)
277
+ if (this.serverSide)
316
278
  return this.filteredRows;
317
- const key = this.sortKey;
318
- const dir = this.sortDirection === 'asc' ? 1 : -1;
319
- return [...this.filteredRows].sort((a, b) => {
320
- const aVal = a[key];
321
- const bVal = b[key];
322
- if (aVal == null)
323
- return bVal == null ? 0 : 1;
324
- if (bVal == null)
325
- return -1;
326
- if (typeof aVal === 'number' && typeof bVal === 'number')
327
- return (aVal - bVal) * dir;
328
- return String(aVal).localeCompare(String(bVal)) * dir;
329
- });
279
+ return this._core.sortRows(this.filteredRows);
330
280
  }
331
281
  get pagedRows() {
332
282
  if (this.serverSide)
@@ -338,9 +288,7 @@ let DataGridComponent = class DataGridComponent {
338
288
  return this.pagedRows;
339
289
  }
340
290
  get visibleRows() {
341
- if (!this.virtual)
342
- return this.processedRows;
343
- return this.processedRows.slice(this.startIndex, this.endIndex);
291
+ return this._core.visibleRows;
344
292
  }
345
293
  get totalRows() {
346
294
  return this.serverSide ? this.rows.length : this.filteredRows.length;
@@ -413,26 +361,17 @@ let DataGridComponent = class DataGridComponent {
413
361
  return null;
414
362
  }
415
363
  get topSpacerHeight() {
416
- return this.virtual ? this.startIndex * this.rowHeight : 0;
364
+ return this._core.topSpacerHeight;
417
365
  }
418
366
  get bottomSpacerHeight() {
419
- if (!this.virtual)
420
- return 0;
421
- return Math.max(0, (this.processedRows.length - this.endIndex) * this.rowHeight);
367
+ return this._core.bottomSpacerHeight;
422
368
  }
423
369
  // ── Selection ─────────────────────────────────────────────────────────────────
424
370
  get allSelected() {
425
- return this.processedRows.length > 0 && this.selectedIndices.length === this.processedRows.length;
371
+ return this._core.allSelected;
426
372
  }
427
373
  get someSelected() {
428
- return this.selectedIndices.length > 0 && !this.allSelected;
429
- }
430
- _emitSelect() {
431
- this.elementRef.dispatchEvent(new CustomEvent('ml:select', {
432
- bubbles: true,
433
- composed: true,
434
- detail: { selectedRows: this.selectedIndices, allSelected: this.allSelected }
435
- }));
374
+ return this._core.someSelected;
436
375
  }
437
376
  };
438
377
  DataGridComponent = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"data-grid.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAelE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CA+NpD"}
1
+ {"version":3,"file":"data-grid.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAUlE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CAgOpD"}
@@ -1,10 +1,5 @@
1
1
  import { html, classMap, when, repeat } from '@melodicdev/core';
2
- function renderCell(col, row, index) {
3
- if (col.render)
4
- return col.render(row[col.key], row, index);
5
- const val = row[col.key];
6
- return val == null ? '' : val;
7
- }
2
+ import { renderCell } from '../table-core/index.js';
8
3
  function pinStyle(c, col) {
9
4
  if (col.pinned === 'left')
10
5
  return `left: ${c.getPinnedLeftOffset(col.key)}px`;
@@ -96,6 +91,7 @@ export function dataGridTemplate(c) {
96
91
  @pointerdown=${(e) => c.handleResizeStart(col.key, e)}
97
92
  @pointermove=${(e) => c.handleResizeMove(col.key, e)}
98
93
  @pointerup=${c.handleResizeEnd}
94
+ @click=${(e) => e.stopPropagation()}
99
95
  ></div>
100
96
  `)}
101
97
  </div>
@@ -1,4 +1,4 @@
1
- import type { IElementRef } from '@melodicdev/core';
1
+ import type { IElementRef, OnCreate, OnRender } from '@melodicdev/core';
2
2
  /**
3
3
  * ml-list-item - Individual item within a list
4
4
  *
@@ -14,7 +14,7 @@ import type { IElementRef } from '@melodicdev/core';
14
14
  * @slot default - Main content (overrides primary/secondary text)
15
15
  * @slot trailing - Right side content (badges, indicators, actions)
16
16
  */
17
- export declare class ListItemComponent implements IElementRef {
17
+ export declare class ListItemComponent implements IElementRef, OnCreate, OnRender {
18
18
  elementRef: HTMLElement;
19
19
  /** Primary text */
20
20
  primary: string;
@@ -24,9 +24,18 @@ export declare class ListItemComponent implements IElementRef {
24
24
  disabled: boolean;
25
25
  /** Enable hover/focus states for clickable items */
26
26
  interactive: boolean;
27
- /** Check if leading slot has content */
28
- get hasLeadingSlot(): boolean;
29
- /** Check if trailing slot has content */
30
- get hasTrailingSlot(): boolean;
27
+ /** Whether the leading slot has content (kept in sync via slotchange) */
28
+ hasLeadingSlot: boolean;
29
+ /** Whether the trailing slot has content (kept in sync via slotchange) */
30
+ hasTrailingSlot: boolean;
31
+ onCreate(): void;
32
+ onRender(): void;
33
+ private readonly _handleKeyDown;
34
+ /**
35
+ * Reflect interactive semantics onto the host: without a tabindex/role the
36
+ * `:host([interactive]:focus-visible)` styling is dead and keyboard users
37
+ * can never reach a clickable item.
38
+ */
39
+ private syncHostA11y;
31
40
  }
32
41
  //# sourceMappingURL=list-item.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/list/list-item.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD;;;;;;;;;;;;;;GAcG;AACH,qBAMa,iBAAkB,YAAW,WAAW;IAC7C,UAAU,EAAG,WAAW,CAAC;IAEhC,mBAAmB;IACZ,OAAO,SAAM;IAEpB,qBAAqB;IACd,SAAS,SAAM;IAEtB,uBAAuB;IAChB,QAAQ,UAAS;IAExB,oDAAoD;IAC7C,WAAW,UAAS;IAE3B,wCAAwC;IACxC,IAAW,cAAc,IAAI,OAAO,CAEnC;IAED,yCAAyC;IACzC,IAAW,eAAe,IAAI,OAAO,CAEpC;CAED"}
1
+ {"version":3,"file":"list-item.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/list/list-item.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKxE;;;;;;;;;;;;;;GAcG;AACH,qBAMa,iBAAkB,YAAW,WAAW,EAAE,QAAQ,EAAE,QAAQ;IACjE,UAAU,EAAG,WAAW,CAAC;IAEhC,mBAAmB;IACZ,OAAO,SAAM;IAEpB,qBAAqB;IACd,SAAS,SAAM;IAEtB,uBAAuB;IAChB,QAAQ,UAAS;IAExB,oDAAoD;IAC7C,WAAW,UAAS;IAE3B,yEAAyE;IAClE,cAAc,UAAS;IAE9B,0EAA0E;IACnE,eAAe,UAAS;IAExB,QAAQ,IAAI,IAAI;IAkBhB,QAAQ,IAAI,IAAI;IAIvB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAO7B;IAEF;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAkBpB"}
@@ -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 } from '../../../functions/index.js';
8
9
  import { listItemTemplate } from './list-item.template.js';
9
10
  import { listItemStyles } from './list-item.styles.js';
10
11
  /**
@@ -32,14 +33,64 @@ let ListItemComponent = class ListItemComponent {
32
33
  this.disabled = false;
33
34
  /** Enable hover/focus states for clickable items */
34
35
  this.interactive = false;
36
+ /** Whether the leading slot has content (kept in sync via slotchange) */
37
+ this.hasLeadingSlot = false;
38
+ /** Whether the trailing slot has content (kept in sync via slotchange) */
39
+ this.hasTrailingSlot = false;
40
+ this._handleKeyDown = (event) => {
41
+ if (!this.interactive || this.disabled)
42
+ return;
43
+ if (event.target !== this.elementRef)
44
+ return;
45
+ if (event.key !== 'Enter' && event.key !== ' ')
46
+ return;
47
+ event.preventDefault();
48
+ this.elementRef.click();
49
+ };
35
50
  }
36
- /** Check if leading slot has content */
37
- get hasLeadingSlot() {
38
- return this.elementRef?.querySelector('[slot="leading"]') !== null;
51
+ onCreate() {
52
+ const shadow = this.elementRef.shadowRoot;
53
+ if (shadow) {
54
+ // Slot presence is reactive: content added/removed after mount projects
55
+ // correctly instead of being frozen at first render.
56
+ watchSlotPresence(shadow, (name, hasContent) => {
57
+ if (name === 'leading')
58
+ this.hasLeadingSlot = hasContent;
59
+ else if (name === 'trailing')
60
+ this.hasTrailingSlot = hasContent;
61
+ });
62
+ }
63
+ // Keyboard activation for interactive items: Enter/Space trigger the same
64
+ // click consumers already listen for on the host.
65
+ this.elementRef.addEventListener('keydown', this._handleKeyDown);
66
+ this.syncHostA11y();
39
67
  }
40
- /** Check if trailing slot has content */
41
- get hasTrailingSlot() {
42
- return this.elementRef?.querySelector('[slot="trailing"]') !== null;
68
+ onRender() {
69
+ this.syncHostA11y();
70
+ }
71
+ /**
72
+ * Reflect interactive semantics onto the host: without a tabindex/role the
73
+ * `:host([interactive]:focus-visible)` styling is dead and keyboard users
74
+ * can never reach a clickable item.
75
+ */
76
+ syncHostA11y() {
77
+ const host = this.elementRef;
78
+ if (this.interactive) {
79
+ host.setAttribute('role', 'button');
80
+ if (this.disabled) {
81
+ host.removeAttribute('tabindex');
82
+ host.setAttribute('aria-disabled', 'true');
83
+ }
84
+ else {
85
+ host.setAttribute('tabindex', '0');
86
+ host.removeAttribute('aria-disabled');
87
+ }
88
+ }
89
+ else {
90
+ host.setAttribute('role', 'listitem');
91
+ host.removeAttribute('tabindex');
92
+ host.removeAttribute('aria-disabled');
93
+ }
43
94
  }
44
95
  };
45
96
  ListItemComponent = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/list/list-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iDA4F1B,CAAC"}
1
+ {"version":3,"file":"list-item.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/list/list-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iDAiG1B,CAAC"}
@@ -62,6 +62,11 @@ export const listItemStyles = () => css `
62
62
  flex-shrink: 0;
63
63
  }
64
64
 
65
+ .ml-li__leading--hidden,
66
+ .ml-li__trailing--hidden {
67
+ display: none;
68
+ }
69
+
65
70
  .ml-li__content {
66
71
  flex: 1;
67
72
  min-width: 0;
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/list/list-item.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CA0BpD"}
1
+ {"version":3,"file":"list-item.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/list/list-item.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CAsBpD"}