@melodicdev/components 3.1.0 → 4.0.1

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 (285) hide show
  1. package/assets/melodic-components.js +8081 -5910
  2. package/assets/melodic-components.js.map +1 -1
  3. package/assets/melodic-components.min.js +9250 -7326
  4. package/lib/components/data-display/activity-feed/activity-feed-item.styles.d.ts.map +1 -1
  5. package/lib/components/data-display/activity-feed/activity-feed-item.styles.js +83 -78
  6. package/lib/components/data-display/activity-feed/activity-feed.styles.d.ts.map +1 -1
  7. package/lib/components/data-display/activity-feed/activity-feed.styles.js +10 -5
  8. package/lib/components/data-display/avatar/avatar.styles.d.ts.map +1 -1
  9. package/lib/components/data-display/avatar/avatar.styles.js +23 -18
  10. package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
  11. package/lib/components/data-display/badge/badge.styles.js +54 -48
  12. package/lib/components/data-display/badge-group/badge-group.styles.d.ts.map +1 -1
  13. package/lib/components/data-display/badge-group/badge-group.styles.js +34 -29
  14. package/lib/components/data-display/calendar-view/calendar-view-month.template.d.ts.map +1 -1
  15. package/lib/components/data-display/calendar-view/calendar-view-month.template.js +17 -0
  16. package/lib/components/data-display/calendar-view/calendar-view.component.d.ts +23 -3
  17. package/lib/components/data-display/calendar-view/calendar-view.component.d.ts.map +1 -1
  18. package/lib/components/data-display/calendar-view/calendar-view.component.js +76 -21
  19. package/lib/components/data-display/calendar-view/calendar-view.styles.d.ts.map +1 -1
  20. package/lib/components/data-display/calendar-view/calendar-view.styles.js +160 -155
  21. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts +9 -0
  22. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts.map +1 -1
  23. package/lib/components/data-display/calendar-view/calendar-view.utils.js +68 -19
  24. package/lib/components/data-display/data-grid/data-grid.component.d.ts +24 -0
  25. package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
  26. package/lib/components/data-display/data-grid/data-grid.component.js +104 -31
  27. package/lib/components/data-display/data-grid/data-grid.styles.d.ts.map +1 -1
  28. package/lib/components/data-display/data-grid/data-grid.styles.js +122 -117
  29. package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
  30. package/lib/components/data-display/data-grid/data-grid.template.js +3 -0
  31. package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
  32. package/lib/components/data-display/list/list-item.styles.js +39 -34
  33. package/lib/components/data-display/list/list.styles.d.ts.map +1 -1
  34. package/lib/components/data-display/list/list.styles.js +10 -5
  35. package/lib/components/data-display/profile-card/profile-card.styles.d.ts.map +1 -1
  36. package/lib/components/data-display/profile-card/profile-card.styles.js +71 -66
  37. package/lib/components/data-display/stat-card/stat-card.styles.d.ts.map +1 -1
  38. package/lib/components/data-display/stat-card/stat-card.styles.js +67 -63
  39. package/lib/components/data-display/table/table.component.d.ts +7 -0
  40. package/lib/components/data-display/table/table.component.d.ts.map +1 -1
  41. package/lib/components/data-display/table/table.component.js +20 -5
  42. package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
  43. package/lib/components/data-display/table/table.styles.js +94 -89
  44. package/lib/components/data-display/table/table.template.d.ts.map +1 -1
  45. package/lib/components/data-display/table/table.template.js +3 -0
  46. package/lib/components/data-display/table-core/index.d.ts +1 -0
  47. package/lib/components/data-display/table-core/index.d.ts.map +1 -1
  48. package/lib/components/data-display/table-core/index.js +1 -0
  49. package/lib/components/data-display/table-core/memo.d.ts +10 -0
  50. package/lib/components/data-display/table-core/memo.d.ts.map +1 -0
  51. package/lib/components/data-display/table-core/memo.js +20 -0
  52. package/lib/components/data-display/tag/tag.styles.d.ts.map +1 -1
  53. package/lib/components/data-display/tag/tag.styles.js +67 -62
  54. package/lib/components/feedback/alert/alert.styles.d.ts.map +1 -1
  55. package/lib/components/feedback/alert/alert.styles.js +83 -56
  56. package/lib/components/feedback/progress/progress.styles.d.ts.map +1 -1
  57. package/lib/components/feedback/progress/progress.styles.js +110 -101
  58. package/lib/components/feedback/spinner/spinner.styles.d.ts.map +1 -1
  59. package/lib/components/feedback/spinner/spinner.styles.js +20 -24
  60. package/lib/components/feedback/toast/toast-container.template.d.ts.map +1 -1
  61. package/lib/components/feedback/toast/toast-container.template.js +4 -0
  62. package/lib/components/feedback/toast/toast.component.d.ts +3 -2
  63. package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
  64. package/lib/components/feedback/toast/toast.component.js +10 -0
  65. package/lib/components/feedback/toast/toast.service.d.ts +26 -6
  66. package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
  67. package/lib/components/feedback/toast/toast.service.js +53 -18
  68. package/lib/components/feedback/toast/toast.styles.d.ts.map +1 -1
  69. package/lib/components/feedback/toast/toast.styles.js +74 -69
  70. package/lib/components/feedback/toast/toast.template.js +1 -1
  71. package/lib/components/forms/autocomplete/autocomplete.component.d.ts +7 -0
  72. package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
  73. package/lib/components/forms/autocomplete/autocomplete.component.js +39 -0
  74. package/lib/components/forms/autocomplete/autocomplete.styles.d.ts.map +1 -1
  75. package/lib/components/forms/autocomplete/autocomplete.styles.js +169 -164
  76. package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
  77. package/lib/components/forms/autocomplete/autocomplete.template.js +5 -1
  78. package/lib/components/forms/button/button.styles.d.ts.map +1 -1
  79. package/lib/components/forms/button/button.styles.js +62 -57
  80. package/lib/components/forms/button-group/button-group.component.d.ts +3 -2
  81. package/lib/components/forms/button-group/button-group.component.d.ts.map +1 -1
  82. package/lib/components/forms/button-group/button-group.component.js +11 -1
  83. package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
  84. package/lib/components/forms/button-group/button-group.styles.js +23 -18
  85. package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -0
  86. package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
  87. package/lib/components/forms/checkbox/checkbox.component.js +5 -1
  88. package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
  89. package/lib/components/forms/checkbox/checkbox.styles.js +83 -78
  90. package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
  91. package/lib/components/forms/checkbox/checkbox.template.js +2 -0
  92. package/lib/components/forms/date-picker/calendar.component.d.ts +21 -0
  93. package/lib/components/forms/date-picker/calendar.component.d.ts.map +1 -1
  94. package/lib/components/forms/date-picker/calendar.component.js +69 -2
  95. package/lib/components/forms/date-picker/calendar.styles.d.ts.map +1 -1
  96. package/lib/components/forms/date-picker/calendar.styles.js +152 -147
  97. package/lib/components/forms/date-picker/calendar.template.d.ts.map +1 -1
  98. package/lib/components/forms/date-picker/calendar.template.js +6 -3
  99. package/lib/components/forms/date-picker/date-picker.component.d.ts +6 -0
  100. package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
  101. package/lib/components/forms/date-picker/date-picker.component.js +41 -12
  102. package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  103. package/lib/components/forms/date-picker/date-picker.styles.js +97 -91
  104. package/lib/components/forms/date-time-picker/date-time-picker.styles.d.ts.map +1 -1
  105. package/lib/components/forms/date-time-picker/date-time-picker.styles.js +87 -82
  106. package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
  107. package/lib/components/forms/file-upload/file-upload.component.js +15 -5
  108. package/lib/components/forms/file-upload/file-upload.styles.d.ts.map +1 -1
  109. package/lib/components/forms/file-upload/file-upload.styles.js +97 -92
  110. package/lib/components/forms/form-field/form-field.component.d.ts +8 -0
  111. package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
  112. package/lib/components/forms/form-field/form-field.component.js +41 -6
  113. package/lib/components/forms/form-field/form-field.styles.d.ts.map +1 -1
  114. package/lib/components/forms/form-field/form-field.styles.js +77 -72
  115. package/lib/components/forms/form-field/form-field.template.js +1 -1
  116. package/lib/components/forms/input/input.component.d.ts +26 -3
  117. package/lib/components/forms/input/input.component.d.ts.map +1 -1
  118. package/lib/components/forms/input/input.component.js +46 -6
  119. package/lib/components/forms/input/input.styles.d.ts.map +1 -1
  120. package/lib/components/forms/input/input.styles.js +86 -81
  121. package/lib/components/forms/input/input.template.d.ts.map +1 -1
  122. package/lib/components/forms/input/input.template.js +9 -0
  123. package/lib/components/forms/radio/radio.styles.d.ts.map +1 -1
  124. package/lib/components/forms/radio/radio.styles.js +78 -73
  125. package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts +6 -0
  126. package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts.map +1 -1
  127. package/lib/components/forms/radio-card-group/radio-card-group.component.js +34 -0
  128. package/lib/components/forms/radio-card-group/radio-card-group.styles.d.ts.map +1 -1
  129. package/lib/components/forms/radio-card-group/radio-card-group.styles.js +39 -34
  130. package/lib/components/forms/radio-card-group/radio-card.component.d.ts +6 -0
  131. package/lib/components/forms/radio-card-group/radio-card.component.d.ts.map +1 -1
  132. package/lib/components/forms/radio-card-group/radio-card.component.js +7 -1
  133. package/lib/components/forms/radio-card-group/radio-card.styles.d.ts.map +1 -1
  134. package/lib/components/forms/radio-card-group/radio-card.styles.js +113 -108
  135. package/lib/components/forms/radio-card-group/radio-card.template.js +1 -1
  136. package/lib/components/forms/select/select.component.d.ts.map +1 -1
  137. package/lib/components/forms/select/select.component.js +13 -1
  138. package/lib/components/forms/select/select.styles.d.ts.map +1 -1
  139. package/lib/components/forms/select/select.styles.js +158 -153
  140. package/lib/components/forms/select/select.template.d.ts.map +1 -1
  141. package/lib/components/forms/select/select.template.js +5 -1
  142. package/lib/components/forms/slider/slider.styles.d.ts.map +1 -1
  143. package/lib/components/forms/slider/slider.styles.js +82 -77
  144. package/lib/components/forms/textarea/textarea.component.d.ts +10 -3
  145. package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
  146. package/lib/components/forms/textarea/textarea.component.js +10 -5
  147. package/lib/components/forms/textarea/textarea.styles.d.ts.map +1 -1
  148. package/lib/components/forms/textarea/textarea.styles.js +84 -79
  149. package/lib/components/forms/textarea/textarea.template.d.ts.map +1 -1
  150. package/lib/components/forms/textarea/textarea.template.js +2 -0
  151. package/lib/components/forms/time-picker/time-picker.component.d.ts +16 -0
  152. package/lib/components/forms/time-picker/time-picker.component.d.ts.map +1 -1
  153. package/lib/components/forms/time-picker/time-picker.component.js +43 -3
  154. package/lib/components/forms/time-picker/time-picker.styles.d.ts.map +1 -1
  155. package/lib/components/forms/time-picker/time-picker.styles.js +197 -191
  156. package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
  157. package/lib/components/forms/toggle/toggle.styles.js +84 -79
  158. package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
  159. package/lib/components/foundation/card/card.styles.js +51 -46
  160. package/lib/components/foundation/container/container.component.js +5 -5
  161. package/lib/components/foundation/container/container.styles.d.ts.map +1 -1
  162. package/lib/components/foundation/container/container.styles.js +15 -0
  163. package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
  164. package/lib/components/foundation/divider/divider.styles.js +29 -24
  165. package/lib/components/foundation/stack/stack.component.d.ts +6 -0
  166. package/lib/components/foundation/stack/stack.component.d.ts.map +1 -1
  167. package/lib/components/foundation/stack/stack.component.js +11 -5
  168. package/lib/components/foundation/stack/stack.styles.d.ts.map +1 -1
  169. package/lib/components/foundation/stack/stack.styles.js +20 -0
  170. package/lib/components/general/icon/icon.styles.d.ts.map +1 -1
  171. package/lib/components/general/icon/icon.styles.js +12 -8
  172. package/lib/components/general/icon/icon.template.d.ts.map +1 -1
  173. package/lib/components/general/icon/icon.template.js +7 -1
  174. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.d.ts.map +1 -1
  175. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.js +2 -1
  176. package/lib/components/navigation/breadcrumb/breadcrumb.styles.d.ts.map +1 -1
  177. package/lib/components/navigation/breadcrumb/breadcrumb.styles.js +9 -4
  178. package/lib/components/navigation/functions/match-by-route.function.d.ts +16 -0
  179. package/lib/components/navigation/functions/match-by-route.function.d.ts.map +1 -0
  180. package/lib/components/navigation/functions/match-by-route.function.js +34 -0
  181. package/lib/components/navigation/functions/route-link.function.d.ts +20 -0
  182. package/lib/components/navigation/functions/route-link.function.d.ts.map +1 -0
  183. package/lib/components/navigation/functions/route-link.function.js +34 -0
  184. package/lib/components/navigation/pagination/pagination.component.d.ts +8 -0
  185. package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
  186. package/lib/components/navigation/pagination/pagination.component.js +12 -2
  187. package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
  188. package/lib/components/navigation/pagination/pagination.styles.js +77 -62
  189. package/lib/components/navigation/pagination/pagination.template.js +2 -2
  190. package/lib/components/navigation/sidebar/sidebar-group.styles.d.ts.map +1 -1
  191. package/lib/components/navigation/sidebar/sidebar-group.styles.js +23 -18
  192. package/lib/components/navigation/sidebar/sidebar-item.styles.d.ts.map +1 -1
  193. package/lib/components/navigation/sidebar/sidebar-item.styles.js +104 -99
  194. package/lib/components/navigation/sidebar/sidebar-item.template.d.ts.map +1 -1
  195. package/lib/components/navigation/sidebar/sidebar-item.template.js +5 -1
  196. package/lib/components/navigation/sidebar/sidebar.component.d.ts +12 -6
  197. package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
  198. package/lib/components/navigation/sidebar/sidebar.component.js +20 -12
  199. package/lib/components/navigation/sidebar/sidebar.styles.d.ts.map +1 -1
  200. package/lib/components/navigation/sidebar/sidebar.styles.js +179 -174
  201. package/lib/components/navigation/sidebar/sidebar.template.d.ts.map +1 -1
  202. package/lib/components/navigation/sidebar/sidebar.template.js +5 -1
  203. package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
  204. package/lib/components/navigation/steps/step.component.js +19 -1
  205. package/lib/components/navigation/steps/step.styles.d.ts.map +1 -1
  206. package/lib/components/navigation/steps/step.styles.js +154 -149
  207. package/lib/components/navigation/steps/step.template.d.ts.map +1 -1
  208. package/lib/components/navigation/steps/step.template.js +6 -0
  209. package/lib/components/navigation/steps/steps.component.d.ts +10 -0
  210. package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
  211. package/lib/components/navigation/steps/steps.component.js +42 -9
  212. package/lib/components/navigation/steps/steps.styles.d.ts.map +1 -1
  213. package/lib/components/navigation/steps/steps.styles.js +174 -169
  214. package/lib/components/navigation/steps/steps.template.js +9 -0
  215. package/lib/components/navigation/tabs/tab-panel.styles.d.ts.map +1 -1
  216. package/lib/components/navigation/tabs/tab-panel.styles.js +12 -2
  217. package/lib/components/navigation/tabs/tab.styles.d.ts.map +1 -1
  218. package/lib/components/navigation/tabs/tab.styles.js +41 -36
  219. package/lib/components/navigation/tabs/tabs.component.d.ts +10 -0
  220. package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
  221. package/lib/components/navigation/tabs/tabs.component.js +36 -7
  222. package/lib/components/navigation/tabs/tabs.styles.d.ts.map +1 -1
  223. package/lib/components/navigation/tabs/tabs.styles.js +131 -126
  224. package/lib/components/overlays/dialog/dialog-ref.class.d.ts +19 -9
  225. package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
  226. package/lib/components/overlays/dialog/dialog-ref.class.js +37 -5
  227. package/lib/components/overlays/dialog/dialog.styles.d.ts.map +1 -1
  228. package/lib/components/overlays/dialog/dialog.styles.js +78 -73
  229. package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
  230. package/lib/components/overlays/drawer/drawer.styles.js +82 -77
  231. package/lib/components/overlays/dropdown/dropdown-item.styles.d.ts.map +1 -1
  232. package/lib/components/overlays/dropdown/dropdown-item.styles.js +48 -43
  233. package/lib/components/overlays/dropdown/dropdown.component.d.ts +7 -0
  234. package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
  235. package/lib/components/overlays/dropdown/dropdown.component.js +26 -11
  236. package/lib/components/overlays/dropdown/dropdown.styles.d.ts.map +1 -1
  237. package/lib/components/overlays/dropdown/dropdown.styles.js +35 -30
  238. package/lib/components/overlays/popover/popover.component.d.ts +8 -0
  239. package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
  240. package/lib/components/overlays/popover/popover.component.js +17 -0
  241. package/lib/components/overlays/popover/popover.styles.d.ts.map +1 -1
  242. package/lib/components/overlays/popover/popover.styles.js +36 -31
  243. package/lib/components/overlays/tooltip/tooltip.component.d.ts +6 -5
  244. package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
  245. package/lib/components/overlays/tooltip/tooltip.component.js +14 -10
  246. package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
  247. package/lib/components/overlays/tooltip/tooltip.styles.js +34 -28
  248. package/lib/components/pages/auth/auth-layout.styles.d.ts +1 -1
  249. package/lib/components/pages/auth/auth-layout.styles.d.ts.map +1 -1
  250. package/lib/components/pages/auth/auth-layout.styles.js +86 -81
  251. package/lib/components/pages/dashboard/dashboard-page.styles.d.ts.map +1 -1
  252. package/lib/components/pages/dashboard/dashboard-page.styles.js +39 -34
  253. package/lib/components/sections/app-shell/app-shell.component.d.ts +13 -0
  254. package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
  255. package/lib/components/sections/app-shell/app-shell.component.js +45 -1
  256. package/lib/components/sections/app-shell/app-shell.styles.d.ts.map +1 -1
  257. package/lib/components/sections/app-shell/app-shell.styles.js +74 -53
  258. package/lib/components/sections/app-shell/app-shell.template.d.ts.map +1 -1
  259. package/lib/components/sections/app-shell/app-shell.template.js +5 -0
  260. package/lib/components/sections/hero/hero-section.styles.js +97 -97
  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 +69 -64
  263. package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
  264. package/lib/components/sections/page-section/page-section.styles.js +56 -51
  265. package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
  266. package/lib/components/sections/page-section/page-section.template.js +6 -1
  267. package/lib/directives/tooltip.directive.d.ts.map +1 -1
  268. package/lib/directives/tooltip.directive.js +39 -6
  269. package/lib/theme/functions/apply-theme.function.d.ts +4 -1
  270. package/lib/theme/functions/apply-theme.function.d.ts.map +1 -1
  271. package/lib/theme/functions/apply-theme.function.js +20 -4
  272. package/lib/theme/functions/create-theme.function.js +0 -1
  273. package/lib/utils/accessibility/cross-root-aria.d.ts +40 -0
  274. package/lib/utils/accessibility/cross-root-aria.d.ts.map +1 -0
  275. package/lib/utils/accessibility/cross-root-aria.js +97 -0
  276. package/lib/utils/accessibility/index.d.ts +1 -0
  277. package/lib/utils/accessibility/index.d.ts.map +1 -1
  278. package/lib/utils/accessibility/index.js +1 -0
  279. package/lib/utils/directives/index.d.ts +1 -0
  280. package/lib/utils/directives/index.d.ts.map +1 -1
  281. package/lib/utils/directives/index.js +1 -0
  282. package/lib/utils/directives/watch-light-slots.d.ts +20 -0
  283. package/lib/utils/directives/watch-light-slots.d.ts.map +1 -0
  284. package/lib/utils/directives/watch-light-slots.js +36 -0
  285. package/package.json +2 -2
@@ -1,4 +1,13 @@
1
1
  import type { CalendarEvent, CalendarDayCell, CalendarTimeColumn, PositionedEvent } from './calendar-view.types.js';
2
+ export declare function setCalendarLocale(locale: string | undefined): void;
3
+ /** Full month names for the active locale ("January"). */
4
+ export declare function monthNames(): string[];
5
+ /** Abbreviated month names for the active locale ("Jan"). */
6
+ export declare function monthAbbrevs(): string[];
7
+ /** Full weekday names, Sunday first, for the active locale. */
8
+ export declare function dayNames(): string[];
9
+ /** Abbreviated weekday names, Sunday first, for the active locale. */
10
+ export declare function dayAbbrevs(): string[];
2
11
  /** 30-minute time slots = 48 rows for 24 hours */
3
12
  export declare const TIME_INCREMENT = 30;
4
13
  export declare const TOTAL_ROWS = 48;
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-view.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/calendar-view/calendar-view.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAepH,kDAAkD;AAClD,eAAO,MAAM,cAAc,KAAK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C,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAWhF;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,kBAAkB,EAAE,CAa9G;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,kBAAkB,CAUpF;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAUrG"}
@@ -1,13 +1,62 @@
1
- const MONTH_NAMES = [
2
- 'January', 'February', 'March', 'April', 'May', 'June',
3
- 'July', 'August', 'September', 'October', 'November', 'December'
4
- ];
5
- const MONTH_ABBREVS = [
6
- 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
7
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
8
- ];
9
- const DAY_NAMES = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
10
- const DAY_ABBREVS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
1
+ /**
2
+ * Month and weekday names, resolved through `Intl` for the active locale.
3
+ *
4
+ * These were hardcoded English arrays, so the calendar rendered "January" and
5
+ * "Mon" no matter what language the page was in. `setCalendarLocale()` (or
6
+ * `<ml-calendar-view locale="fr-FR">`) changes them; the default follows
7
+ * `document.documentElement.lang`, falling back to the browser locale.
8
+ *
9
+ * The formatters are built once per locale — constructing an `Intl` formatter
10
+ * is expensive and these run inside render.
11
+ */
12
+ let activeLocale;
13
+ export function setCalendarLocale(locale) {
14
+ activeLocale = locale || undefined;
15
+ }
16
+ function resolvedLocale() {
17
+ if (activeLocale) {
18
+ return activeLocale;
19
+ }
20
+ if (typeof document !== 'undefined') {
21
+ const lang = document.documentElement.lang?.trim();
22
+ if (lang) {
23
+ return lang;
24
+ }
25
+ }
26
+ return undefined;
27
+ }
28
+ const nameCache = new Map();
29
+ function names(kind, width) {
30
+ const locale = resolvedLocale() ?? 'default';
31
+ const key = `${locale}:${kind}:${width}`;
32
+ const cached = nameCache.get(key);
33
+ if (cached) {
34
+ return cached;
35
+ }
36
+ const formatter = new Intl.DateTimeFormat(resolvedLocale(), kind === 'month' ? { month: width } : { weekday: width });
37
+ // 2021-01-03 was a Sunday, so index 0 is Sunday, matching Date#getDay().
38
+ const values = kind === 'month'
39
+ ? Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2021, i, 1)))
40
+ : Array.from({ length: 7 }, (_, i) => formatter.format(new Date(2021, 0, 3 + i)));
41
+ nameCache.set(key, values);
42
+ return values;
43
+ }
44
+ /** Full month names for the active locale ("January"). */
45
+ export function monthNames() {
46
+ return names('month', 'long');
47
+ }
48
+ /** Abbreviated month names for the active locale ("Jan"). */
49
+ export function monthAbbrevs() {
50
+ return names('month', 'short');
51
+ }
52
+ /** Full weekday names, Sunday first, for the active locale. */
53
+ export function dayNames() {
54
+ return names('weekday', 'long');
55
+ }
56
+ /** Abbreviated weekday names, Sunday first, for the active locale. */
57
+ export function dayAbbrevs() {
58
+ return names('weekday', 'short');
59
+ }
11
60
  /** 30-minute time slots = 48 rows for 24 hours */
12
61
  export const TIME_INCREMENT = 30;
13
62
  export const TOTAL_ROWS = 48;
@@ -76,11 +125,11 @@ export function formatTime(iso) {
76
125
  return m === 0 ? `${hour} ${ampm}` : `${hour}:${String(m).padStart(2, '0')} ${ampm}`;
77
126
  }
78
127
  export function formatMonthYear(date) {
79
- return `${MONTH_NAMES[date.getMonth()]} ${date.getFullYear()}`;
128
+ return `${monthNames()[date.getMonth()]} ${date.getFullYear()}`;
80
129
  }
81
130
  export function formatDateRange(start, end) {
82
- const sMonth = MONTH_ABBREVS[start.getMonth()];
83
- const eMonth = MONTH_ABBREVS[end.getMonth()];
131
+ const sMonth = monthAbbrevs()[start.getMonth()];
132
+ const eMonth = monthAbbrevs()[end.getMonth()];
84
133
  if (start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear()) {
85
134
  return `${sMonth} ${start.getDate()} – ${end.getDate()}, ${start.getFullYear()}`;
86
135
  }
@@ -143,7 +192,7 @@ export function getWeekDays(date, weekStartsOn = 0) {
143
192
  export function getWeekdayHeaders(weekStartsOn = 0) {
144
193
  return Array.from({ length: 7 }, (_, i) => {
145
194
  const idx = (weekStartsOn + i) % 7;
146
- return { short: DAY_ABBREVS[idx], full: DAY_NAMES[idx] };
195
+ return { short: dayAbbrevs()[idx], full: dayNames()[idx] };
147
196
  });
148
197
  }
149
198
  export function getEventsForDate(events, iso) {
@@ -153,13 +202,13 @@ export function getEventsForDate(events, iso) {
153
202
  return events.filter(e => toLocalIsoDate(parseEventDate(e.start)) === iso);
154
203
  }
155
204
  export function getMonthAbbrev(date) {
156
- return MONTH_ABBREVS[date.getMonth()];
205
+ return monthAbbrevs()[date.getMonth()];
157
206
  }
158
207
  export function getDayAbbrev(date) {
159
- return DAY_ABBREVS[date.getDay()];
208
+ return dayAbbrevs()[date.getDay()];
160
209
  }
161
210
  export function getDayName(date) {
162
- return DAY_NAMES[date.getDay()];
211
+ return dayNames()[date.getDay()];
163
212
  }
164
213
  /** Convert minutes from midnight to a 1-based grid row (30-min increments, 48 rows) */
165
214
  function minutesToGridRow(minutes) {
@@ -279,7 +328,7 @@ export function getWeekColumns(date, weekStartsOn, events) {
279
328
  const dayEvents = getEventsForDate(events, iso).filter(e => !e.allDay);
280
329
  return {
281
330
  date: iso,
282
- dayLabel: DAY_ABBREVS[d.getDay()],
331
+ dayLabel: dayAbbrevs()[d.getDay()],
283
332
  dayNumber: d.getDate(),
284
333
  isToday: isToday(d),
285
334
  events: layoutOverlappingEvents(dayEvents)
@@ -291,7 +340,7 @@ export function getDayColumn(date, events) {
291
340
  const dayEvents = getEventsForDate(events, iso).filter(e => !e.allDay);
292
341
  return {
293
342
  date: iso,
294
- dayLabel: DAY_ABBREVS[date.getDay()],
343
+ dayLabel: dayAbbrevs()[date.getDay()],
295
344
  dayNumber: date.getDate(),
296
345
  isToday: isToday(date),
297
346
  events: layoutOverlappingEvents(dayEvents)
@@ -76,8 +76,22 @@ export declare class DataGridComponent implements IElementRef, OnCreate, OnDestr
76
76
  onPropertyChange(name: string, _oldVal: unknown, newVal: unknown): void;
77
77
  onCreate(): void;
78
78
  onRender(): void;
79
+ /**
80
+ * Publish the header height as a CSS variable for the sticky filter row.
81
+ *
82
+ * `getBoundingClientRect()` forces a synchronous layout, and this ran on
83
+ * every render — including the render each `pointermove` of a column
84
+ * resize produced. Only write when the value actually changed, and skip
85
+ * entirely while resizing (the header height cannot change then).
86
+ */
87
+ private _headerHeight;
88
+ private syncHeaderHeight;
79
89
  onDestroy(): void;
80
90
  private _syncColumnState;
91
+ private readonly _filteredRowsMemo;
92
+ private readonly _sortedRowsMemo;
93
+ private readonly _pagedRowsMemo;
94
+ private get _filterKey();
81
95
  get filteredRows(): Record<string, unknown>[];
82
96
  get sortedRows(): Record<string, unknown>[];
83
97
  get pagedRows(): Record<string, unknown>[];
@@ -105,7 +119,17 @@ export declare class DataGridComponent implements IElementRef, OnCreate, OnDestr
105
119
  handleRowClick: (row: Record<string, unknown>, index: number) => void;
106
120
  handleResizeStart: (key: string, e: PointerEvent) => void;
107
121
  handleResizeMove: (key: string, e: PointerEvent) => void;
122
+ private _pendingResizeWidth;
108
123
  handleResizeEnd: () => void;
124
+ /**
125
+ * Keyboard equivalents for the header's mouse-only interactions.
126
+ *
127
+ * Enter/Space sorts; Ctrl/Cmd + Arrow moves the column. Drag-and-drop
128
+ * reordering and click-to-sort were otherwise unreachable without a mouse.
129
+ */
130
+ handleHeaderKeyDown: (col: DataGridColumn, event: KeyboardEvent) => void;
131
+ /** Move a column `delta` positions and announce the new order. */
132
+ moveColumn: (key: string, delta: number) => void;
109
133
  handleDragStart: (key: string, e: DragEvent) => void;
110
134
  handleDragOver: (key: string, e: DragEvent) => void;
111
135
  handleDragEnd: () => void;
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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;IACvB,SAAS,UAAQ;IAExB,wBAAwB;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,2CAA2C;IACpC,SAAS,SAAM;IAEtB,iDAAiD;IAC1C,WAAW,SAAM;IAExB,kFAAkF;IAC3E,UAAU,UAAS;IAE1B,8BAA8B;IACvB,QAAQ,SAAM;IAErB,2DAA2D;IACpD,OAAO,UAAQ;IAEtB,yDAAyD;IAClD,aAAa,UAAS;IAI7B,yBAAyB;IAClB,OAAO,EAAE,cAAc,EAAE,CAAM;IAEtC,eAAe;IACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAM;IAIrC,OAAO,SAAM;IACb,aAAa,EAAE,aAAa,CAAS;IAIrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAIrC,eAAe,EAAE,MAAM,EAAE,CAAM;IAI/B,WAAW,SAAK;IAIhB,UAAU,SAAK;IACf,QAAQ,SAAM;IAId,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA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E,MAAM,GAAG,MAAM;IAYhD,IAAW,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAM5C;IAED,IAAW,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAK9C;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAID,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,aAAa,GAAI,OAAO,MAAM,KAAG,OAAO,CAAoC;IAI5E,UAAU,GAAI,KAAK,cAAc,KAAG,IAAI,CAK7C;IAEK,iBAAiB,GAAI,KAAK,MAAM,EAAE,GAAG,KAAK,KAAG,IAAI,CAetD;IAEK,eAAe,QAAO,IAAI,CAE/B;IAEK,eAAe,GAAI,OAAO,MAAM,EAAE,GAAG,KAAK,KAAG,IAAI,CAEtD;IAEK,cAAc,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,IAAI,CAEzE;IAEK,iBAAiB,GAAI,KAAK,MAAM,EAAE,GAAG,YAAY,KAAG,IAAI,CAO7D;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"}
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,EA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AU,GAAI,WAAW,MAAM,KAAG,IAAI,CAwB3C;IAEK,QAAQ,GAAI,MAAM,MAAM,KAAG,IAAI,CAgBpC;CACF"}
@@ -8,6 +8,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
10
  import { TableCore } from '../table-core/index.js';
11
+ import { memoOn } from '../table-core/index.js';
11
12
  /**
12
13
  * ml-data-grid — Full-featured data grid with virtual scrolling, sorting, filtering,
13
14
  * selection, column resizing, column reordering, pinned columns, and pagination.
@@ -95,6 +96,19 @@ let DataGridComponent = class DataGridComponent {
95
96
  });
96
97
  this._resizeStartX = 0;
97
98
  this._resizeStartWidth = 0;
99
+ /**
100
+ * Publish the header height as a CSS variable for the sticky filter row.
101
+ *
102
+ * `getBoundingClientRect()` forces a synchronous layout, and this ran on
103
+ * every render — including the render each `pointermove` of a column
104
+ * resize produced. Only write when the value actually changed, and skip
105
+ * entirely while resizing (the header height cannot change then).
106
+ */
107
+ this._headerHeight = 0;
108
+ // ── Data pipeline ─────────────────────────────────────────────────────────────
109
+ this._filteredRowsMemo = memoOn();
110
+ this._sortedRowsMemo = memoOn();
111
+ this._pagedRowsMemo = memoOn();
98
112
  this.isRowSelected = (index) => this._core.isRowSelected(index);
99
113
  // ── Event handlers ────────────────────────────────────────────────────────────
100
114
  this.handleSort = (col) => {
@@ -139,16 +153,24 @@ let DataGridComponent = class DataGridComponent {
139
153
  if (this.resizingKey !== key)
140
154
  return;
141
155
  const delta = e.clientX - this._resizeStartX;
142
- const col = this.columns.find(c => c.key === key);
156
+ const col = this.columns.find((c) => c.key === key);
143
157
  const minW = col?.minWidth ?? 80;
144
- this.colWidths = {
145
- ...this.colWidths,
146
- [key]: Math.max(minW, this._resizeStartWidth + delta)
147
- };
158
+ const width = Math.max(minW, this._resizeStartWidth + delta);
159
+ // Writing to `colWidths` re-renders the entire grid — every row, every
160
+ // cell — on each pointermove. Drive the live drag through a CSS custom
161
+ // property instead and commit the value once, on pointerup.
162
+ this._pendingResizeWidth = width;
163
+ this.elementRef.style.setProperty(`--ml-grid-col-${key}`, `${width}px`);
148
164
  };
165
+ this._pendingResizeWidth = null;
149
166
  this.handleResizeEnd = () => {
150
167
  if (!this.resizingKey)
151
168
  return;
169
+ if (this._pendingResizeWidth !== null) {
170
+ this.colWidths = { ...this.colWidths, [this.resizingKey]: this._pendingResizeWidth };
171
+ this.elementRef.style.removeProperty(`--ml-grid-col-${this.resizingKey}`);
172
+ this._pendingResizeWidth = null;
173
+ }
152
174
  this.elementRef.dispatchEvent(new CustomEvent('ml:column-resize', {
153
175
  bubbles: true,
154
176
  composed: true,
@@ -156,6 +178,44 @@ let DataGridComponent = class DataGridComponent {
156
178
  }));
157
179
  this.resizingKey = null;
158
180
  };
181
+ /**
182
+ * Keyboard equivalents for the header's mouse-only interactions.
183
+ *
184
+ * Enter/Space sorts; Ctrl/Cmd + Arrow moves the column. Drag-and-drop
185
+ * reordering and click-to-sort were otherwise unreachable without a mouse.
186
+ */
187
+ this.handleHeaderKeyDown = (col, event) => {
188
+ if ((event.ctrlKey || event.metaKey) && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
189
+ if (col.reorderable === false) {
190
+ return;
191
+ }
192
+ event.preventDefault();
193
+ this.moveColumn(col.key, event.key === 'ArrowLeft' ? -1 : 1);
194
+ return;
195
+ }
196
+ if (col.sortable && (event.key === 'Enter' || event.key === ' ')) {
197
+ event.preventDefault();
198
+ this.handleSort(col);
199
+ }
200
+ };
201
+ /** Move a column `delta` positions and announce the new order. */
202
+ this.moveColumn = (key, delta) => {
203
+ const base = this.colOrder.length ? this.colOrder : this.columns.map((col) => col.key);
204
+ const order = [...base];
205
+ const from = order.indexOf(key);
206
+ const to = from + delta;
207
+ if (from === -1 || to < 0 || to >= order.length) {
208
+ return;
209
+ }
210
+ order.splice(from, 1);
211
+ order.splice(to, 0, key);
212
+ this.colOrder = order;
213
+ this.elementRef.dispatchEvent(new CustomEvent('ml:column-reorder', {
214
+ bubbles: true,
215
+ composed: true,
216
+ detail: { order: this.colOrder }
217
+ }));
218
+ };
159
219
  this.handleDragStart = (key, e) => {
160
220
  this.draggingKey = key;
161
221
  if (e.dataTransfer)
@@ -239,19 +299,23 @@ let DataGridComponent = class DataGridComponent {
239
299
  this._core.attachScroller();
240
300
  }
241
301
  onRender() {
242
- // Update CSS variable for filter row sticky offset
243
- const shadow = this.elementRef.shadowRoot;
244
- if (shadow) {
245
- const headerRow = shadow.querySelector('.ml-data-grid__header-row');
246
- if (headerRow) {
247
- const h = headerRow.getBoundingClientRect().height;
248
- if (h > 0) {
249
- this.elementRef.style.setProperty('--ml-grid-header-h', `${h}px`);
250
- }
251
- }
252
- }
302
+ this.syncHeaderHeight();
253
303
  this._core.syncRenderWindow();
254
304
  }
305
+ syncHeaderHeight() {
306
+ if (this.resizingKey) {
307
+ return;
308
+ }
309
+ const headerRow = this.elementRef.shadowRoot?.querySelector('.ml-data-grid__header-row');
310
+ if (!headerRow) {
311
+ return;
312
+ }
313
+ const height = headerRow.getBoundingClientRect().height;
314
+ if (height > 0 && height !== this._headerHeight) {
315
+ this._headerHeight = height;
316
+ this.elementRef.style.setProperty('--ml-grid-header-h', `${height}px`);
317
+ }
318
+ }
255
319
  onDestroy() {
256
320
  this._core.detach();
257
321
  }
@@ -264,25 +328,34 @@ let DataGridComponent = class DataGridComponent {
264
328
  }
265
329
  this.colWidths = newWidths;
266
330
  }
267
- // ── Data pipeline ─────────────────────────────────────────────────────────────
331
+ // The filter object is mutated in place, so its identity is not a usable
332
+ // memo key; its serialized contents are.
333
+ get _filterKey() {
334
+ return JSON.stringify(this.filters);
335
+ }
268
336
  get filteredRows() {
269
- if (this.serverSide)
270
- return this.rows;
271
- const entries = Object.entries(this.filters).filter(([, v]) => v !== '');
272
- if (!entries.length)
273
- return this.rows;
274
- return this.rows.filter(row => entries.every(([key, val]) => String(row[key] ?? '').toLowerCase().includes(val.toLowerCase())));
337
+ // Memoized — see the note on ml-table.sortedRows.
338
+ return this._filteredRowsMemo([this.rows, this.serverSide, this._filterKey], () => {
339
+ if (this.serverSide)
340
+ return this.rows;
341
+ const entries = Object.entries(this.filters).filter(([, v]) => v !== '');
342
+ if (!entries.length)
343
+ return this.rows;
344
+ return this.rows.filter((row) => entries.every(([key, val]) => String(row[key] ?? '').toLowerCase().includes(val.toLowerCase())));
345
+ });
275
346
  }
276
347
  get sortedRows() {
277
- if (this.serverSide)
278
- return this.filteredRows;
279
- return this._core.sortRows(this.filteredRows);
348
+ const filtered = this.filteredRows;
349
+ return this._sortedRowsMemo([filtered, this.serverSide, this.sortKey, this.sortDirection], () => this.serverSide ? filtered : this._core.sortRows(filtered));
280
350
  }
281
351
  get pagedRows() {
282
352
  if (this.serverSide)
283
353
  return this.rows;
284
- const start = (this.currentPage - 1) * this.pageSize;
285
- return this.sortedRows.slice(start, start + this.pageSize);
354
+ const sorted = this.sortedRows;
355
+ return this._pagedRowsMemo([sorted, this.currentPage, this.pageSize], () => {
356
+ const start = (this.currentPage - 1) * this.pageSize;
357
+ return sorted.slice(start, start + this.pageSize);
358
+ });
286
359
  }
287
360
  get processedRows() {
288
361
  return this.pagedRows;
@@ -317,9 +390,9 @@ let DataGridComponent = class DataGridComponent {
317
390
  return colTotal + (this.selectable ? 44 : 0);
318
391
  }
319
392
  get gridTemplateColumns() {
320
- const cols = this.orderedColumns
321
- .map(col => `${this.columnWidths[col.key] ?? 150}px`)
322
- .join(' ');
393
+ // `var(--ml-grid-col-<key>, <committed>px)` lets a live column drag
394
+ // update the layout by writing one custom property, without a render.
395
+ const cols = this.orderedColumns.map((col) => `var(--ml-grid-col-${col.key}, ${this.columnWidths[col.key] ?? 150}px)`).join(' ');
323
396
  return this.selectable ? `44px ${cols}` : cols;
324
397
  }
325
398
  getPinnedLeftOffset(key) {
@@ -1 +1 @@
1
- {"version":3,"file":"data-grid.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iDAkiB1B,CAAC"}
1
+ {"version":3,"file":"data-grid.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iDAuiB1B,CAAC"}