@editora/ui-core 0.1.25 → 0.2.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 (314) hide show
  1. package/README.md +124 -0
  2. package/dist/accordion.cjs.js +13 -12
  3. package/dist/accordion.esm.js +13 -12
  4. package/dist/alert-dialog.cjs.js +76 -45
  5. package/dist/alert-dialog.esm.js +179 -135
  6. package/dist/alert.cjs.js +41 -32
  7. package/dist/alert.esm.js +79 -70
  8. package/dist/animated-beam.cjs.js +42 -50
  9. package/dist/animated-beam.esm.js +47 -55
  10. package/dist/animated-list.cjs.js +11 -27
  11. package/dist/animated-list.esm.js +12 -28
  12. package/dist/animated-text.cjs.js +4 -4
  13. package/dist/animated-text.esm.js +4 -4
  14. package/dist/app-header.cjs.js +5 -5
  15. package/dist/app-header.esm.js +6 -6
  16. package/dist/aspect-ratio.cjs.js +10 -12
  17. package/dist/aspect-ratio.esm.js +11 -13
  18. package/dist/avatar.cjs.js +13 -17
  19. package/dist/avatar.esm.js +13 -17
  20. package/dist/badge.cjs.js +27 -22
  21. package/dist/badge.esm.js +32 -27
  22. package/dist/block-controls.cjs.js +11 -12
  23. package/dist/block-controls.esm.js +8 -9
  24. package/dist/box.cjs.js +2 -3
  25. package/dist/box.esm.js +2 -3
  26. package/dist/breadcrumb.cjs.js +12 -18
  27. package/dist/breadcrumb.esm.js +11 -17
  28. package/dist/button.cjs.js +1 -1
  29. package/dist/button.esm.js +1 -1
  30. package/dist/{calendar-B3PUKHQm.mjs → calendar-DmxiZrR7.mjs} +126 -117
  31. package/dist/{calendar-D-mXMgqc.js → calendar-o273O28D.js} +53 -44
  32. package/dist/calendar.cjs.js +1 -1
  33. package/dist/calendar.esm.js +1 -1
  34. package/dist/card.cjs.js +6 -7
  35. package/dist/card.esm.js +5 -6
  36. package/dist/chart.cjs.js +52 -52
  37. package/dist/chart.esm.js +95 -95
  38. package/dist/checkbox.cjs.js +19 -15
  39. package/dist/checkbox.esm.js +19 -15
  40. package/dist/collapsible.cjs.js +7 -11
  41. package/dist/collapsible.esm.js +7 -11
  42. package/dist/color-picker.cjs.js +36 -17
  43. package/dist/color-picker.esm.js +132 -113
  44. package/dist/combobox.cjs.js +57 -54
  45. package/dist/combobox.esm.js +62 -58
  46. package/dist/command-palette.cjs.js +1 -0
  47. package/dist/command-palette.esm.js +1 -0
  48. package/dist/command.cjs.js +32 -14
  49. package/dist/command.esm.js +46 -28
  50. package/dist/components/date-time-utils.d.ts.map +1 -1
  51. package/dist/components/ui-accordion.d.ts.map +1 -1
  52. package/dist/components/ui-alert-dialog.d.ts +2 -0
  53. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  54. package/dist/components/ui-alert.d.ts.map +1 -1
  55. package/dist/components/ui-animated-beam.d.ts.map +1 -1
  56. package/dist/components/ui-animated-list.d.ts.map +1 -1
  57. package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
  58. package/dist/components/ui-avatar.d.ts.map +1 -1
  59. package/dist/components/ui-badge.d.ts.map +1 -1
  60. package/dist/components/ui-block-controls.d.ts.map +1 -1
  61. package/dist/components/ui-box.d.ts.map +1 -1
  62. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  63. package/dist/components/ui-button.d.ts.map +1 -1
  64. package/dist/components/ui-calendar.d.ts.map +1 -1
  65. package/dist/components/ui-card.d.ts.map +1 -1
  66. package/dist/components/ui-checkbox.d.ts.map +1 -1
  67. package/dist/components/ui-collapsible.d.ts.map +1 -1
  68. package/dist/components/ui-color-picker.d.ts.map +1 -1
  69. package/dist/components/ui-combobox.d.ts.map +1 -1
  70. package/dist/components/ui-command-palette.d.ts.map +1 -1
  71. package/dist/components/ui-command.d.ts.map +1 -1
  72. package/dist/components/ui-container.d.ts.map +1 -1
  73. package/dist/components/ui-context-menu.d.ts.map +1 -1
  74. package/dist/components/ui-data-table.d.ts +7 -0
  75. package/dist/components/ui-data-table.d.ts.map +1 -1
  76. package/dist/components/ui-date-picker.d.ts.map +1 -1
  77. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  78. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  79. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  80. package/dist/components/ui-dialog.d.ts +2 -0
  81. package/dist/components/ui-dialog.d.ts.map +1 -1
  82. package/dist/components/ui-dock.d.ts.map +1 -1
  83. package/dist/components/ui-drawer.d.ts.map +1 -1
  84. package/dist/components/ui-dropdown.d.ts.map +1 -1
  85. package/dist/components/ui-empty-state.d.ts.map +1 -1
  86. package/dist/components/ui-field.d.ts.map +1 -1
  87. package/dist/components/ui-fieldset.d.ts.map +1 -1
  88. package/dist/components/ui-file-upload.d.ts.map +1 -1
  89. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  90. package/dist/components/ui-form.d.ts.map +1 -1
  91. package/dist/components/ui-icon-cloud.d.ts.map +1 -1
  92. package/dist/components/ui-inline-edit.d.ts.map +1 -1
  93. package/dist/components/ui-input.d.ts.map +1 -1
  94. package/dist/components/ui-marquee.d.ts.map +1 -1
  95. package/dist/components/ui-menu.d.ts.map +1 -1
  96. package/dist/components/ui-menubar.d.ts.map +1 -1
  97. package/dist/components/ui-meter.d.ts.map +1 -1
  98. package/dist/components/ui-multi-select.d.ts.map +1 -1
  99. package/dist/components/ui-number-field.d.ts.map +1 -1
  100. package/dist/components/ui-orbiter.d.ts.map +1 -1
  101. package/dist/components/ui-pagination.d.ts.map +1 -1
  102. package/dist/components/ui-password-field.d.ts.map +1 -1
  103. package/dist/components/ui-pin-input.d.ts.map +1 -1
  104. package/dist/components/ui-popover.d.ts.map +1 -1
  105. package/dist/components/ui-progress.d.ts.map +1 -1
  106. package/dist/components/ui-radio-group.d.ts.map +1 -1
  107. package/dist/components/ui-radio.d.ts.map +1 -1
  108. package/dist/components/ui-rating.d.ts +1 -0
  109. package/dist/components/ui-rating.d.ts.map +1 -1
  110. package/dist/components/ui-scroll-area.d.ts.map +1 -1
  111. package/dist/components/ui-section.d.ts.map +1 -1
  112. package/dist/components/ui-select.d.ts.map +1 -1
  113. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  114. package/dist/components/ui-slider.d.ts.map +1 -1
  115. package/dist/components/ui-sortable.d.ts.map +1 -1
  116. package/dist/components/ui-spinning-text.d.ts.map +1 -1
  117. package/dist/components/ui-split-button.d.ts.map +1 -1
  118. package/dist/components/ui-splitter.d.ts.map +1 -1
  119. package/dist/components/ui-stepper.d.ts.map +1 -1
  120. package/dist/components/ui-switch.d.ts.map +1 -1
  121. package/dist/components/ui-tabs.d.ts.map +1 -1
  122. package/dist/components/ui-tags-input.d.ts.map +1 -1
  123. package/dist/components/ui-textarea.d.ts.map +1 -1
  124. package/dist/components/ui-time-picker.d.ts.map +1 -1
  125. package/dist/components/ui-toggle-group.d.ts +2 -0
  126. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  127. package/dist/components/ui-toggle.d.ts.map +1 -1
  128. package/dist/components/ui-toolbar.d.ts +2 -0
  129. package/dist/components/ui-toolbar.d.ts.map +1 -1
  130. package/dist/components/ui-tooltip.d.ts.map +1 -1
  131. package/dist/components/ui-transfer-list.d.ts.map +1 -1
  132. package/dist/components/ui-tree-item.d.ts.map +1 -1
  133. package/dist/components/ui-tree.d.ts.map +1 -1
  134. package/dist/components/ui-wizard.d.ts.map +1 -1
  135. package/dist/container.cjs.js +6 -12
  136. package/dist/container.esm.js +8 -14
  137. package/dist/context-menu.cjs.js +8 -8
  138. package/dist/context-menu.esm.js +42 -41
  139. package/dist/data-table.cjs.js +18 -15
  140. package/dist/data-table.esm.js +207 -187
  141. package/dist/date-field.cjs.js +8 -8
  142. package/dist/date-field.esm.js +7 -7
  143. package/dist/date-picker.cjs.js +27 -18
  144. package/dist/date-picker.esm.js +57 -48
  145. package/dist/date-range-picker.cjs.js +22 -17
  146. package/dist/date-range-picker.esm.js +31 -26
  147. package/dist/date-range-time-picker.cjs.js +26 -19
  148. package/dist/date-range-time-picker.esm.js +23 -16
  149. package/dist/date-time-picker.cjs.js +23 -16
  150. package/dist/date-time-picker.esm.js +88 -81
  151. package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-B4hAkt36.mjs} +75 -68
  152. package/dist/date-time-utils-DdigV4hs.js +1 -0
  153. package/dist/dialog.cjs.js +57 -41
  154. package/dist/dialog.esm.js +84 -51
  155. package/dist/dock.cjs.js +16 -30
  156. package/dist/dock.esm.js +26 -40
  157. package/dist/drawer.cjs.js +8 -12
  158. package/dist/drawer.esm.js +6 -10
  159. package/dist/dropdown.cjs.js +8 -6
  160. package/dist/dropdown.esm.js +33 -30
  161. package/dist/empty-state.cjs.js +17 -15
  162. package/dist/empty-state.esm.js +13 -11
  163. package/dist/field.cjs.js +22 -13
  164. package/dist/field.esm.js +54 -45
  165. package/dist/fieldset.cjs.js +18 -11
  166. package/dist/fieldset.esm.js +20 -13
  167. package/dist/file-upload.cjs.js +77 -35
  168. package/dist/file-upload.esm.js +152 -110
  169. package/dist/floating-toolbar.cjs.js +6 -7
  170. package/dist/floating-toolbar.esm.js +8 -9
  171. package/dist/form.cjs.js +20 -23
  172. package/dist/form.esm.js +20 -23
  173. package/dist/gantt.cjs.js +6 -6
  174. package/dist/gantt.esm.js +6 -6
  175. package/dist/hover-card.cjs.js +7 -7
  176. package/dist/hover-card.esm.js +7 -7
  177. package/dist/icon-cloud.cjs.js +19 -36
  178. package/dist/icon-cloud.esm.js +41 -58
  179. package/dist/index.cjs.js +1 -1
  180. package/dist/index.d.ts +2 -0
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.esm.js +108 -104
  183. package/dist/inline-edit.cjs.js +47 -19
  184. package/dist/inline-edit.esm.js +66 -38
  185. package/dist/input.cjs.js +44 -37
  186. package/dist/input.esm.js +59 -52
  187. package/dist/layout.cjs.js +3 -3
  188. package/dist/layout.esm.js +3 -3
  189. package/dist/marquee.cjs.js +7 -10
  190. package/dist/marquee.esm.js +7 -10
  191. package/dist/menu.cjs.js +8 -24
  192. package/dist/menu.esm.js +52 -72
  193. package/dist/menubar.cjs.js +9 -31
  194. package/dist/menubar.esm.js +127 -153
  195. package/dist/meter.cjs.js +4 -9
  196. package/dist/meter.esm.js +6 -11
  197. package/dist/multi-select.cjs.js +48 -35
  198. package/dist/multi-select.esm.js +67 -53
  199. package/dist/navigation-menu.cjs.js +10 -10
  200. package/dist/navigation-menu.esm.js +33 -33
  201. package/dist/number-field.cjs.js +27 -16
  202. package/dist/number-field.esm.js +36 -25
  203. package/dist/odometer.cjs.js +5 -5
  204. package/dist/odometer.esm.js +3 -3
  205. package/dist/orbiter.cjs.js +11 -28
  206. package/dist/orbiter.esm.js +28 -45
  207. package/dist/overlay-motion-B56x1GoY.js +49 -0
  208. package/dist/overlay-motion-BX3dPLay.mjs +120 -0
  209. package/dist/pagination.cjs.js +28 -25
  210. package/dist/pagination.esm.js +54 -51
  211. package/dist/password-field.cjs.js +38 -33
  212. package/dist/password-field.esm.js +62 -57
  213. package/dist/pin-input.cjs.js +17 -13
  214. package/dist/pin-input.esm.js +23 -19
  215. package/dist/plugin-panel.cjs.js +1 -1
  216. package/dist/plugin-panel.esm.js +1 -1
  217. package/dist/popover.cjs.js +16 -28
  218. package/dist/popover.esm.js +29 -45
  219. package/dist/portal-DeaM1tYY.mjs +121 -0
  220. package/dist/portal-XbYR3m_q.js +1 -0
  221. package/dist/portal.d.ts +3 -1
  222. package/dist/portal.d.ts.map +1 -1
  223. package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
  224. package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
  225. package/dist/positioner.cjs.js +1 -1
  226. package/dist/positioner.esm.js +1 -1
  227. package/dist/primitives/overlay-motion.d.ts +47 -0
  228. package/dist/primitives/overlay-motion.d.ts.map +1 -0
  229. package/dist/primitives/positioner.d.ts.map +1 -1
  230. package/dist/progress.cjs.js +11 -16
  231. package/dist/progress.esm.js +37 -42
  232. package/dist/quick-actions.cjs.js +13 -13
  233. package/dist/quick-actions.esm.js +11 -11
  234. package/dist/radio-group.cjs.js +50 -26
  235. package/dist/radio-group.esm.js +53 -29
  236. package/dist/radio.cjs.js +15 -12
  237. package/dist/radio.esm.js +15 -12
  238. package/dist/rating.cjs.js +11 -15
  239. package/dist/rating.esm.js +48 -50
  240. package/dist/{runtime-CFnK53iC.mjs → runtime-CQM6wZOc.mjs} +498 -514
  241. package/dist/runtime-DxCl0A5q.js +5 -0
  242. package/dist/runtime.cjs.js +1 -1
  243. package/dist/runtime.d.ts +3 -2
  244. package/dist/runtime.d.ts.map +1 -1
  245. package/dist/runtime.esm.js +36 -32
  246. package/dist/scroll-area.cjs.js +3 -4
  247. package/dist/scroll-area.esm.js +3 -4
  248. package/dist/section.cjs.js +2 -4
  249. package/dist/section.esm.js +2 -4
  250. package/dist/select.cjs.js +40 -73
  251. package/dist/select.esm.js +55 -87
  252. package/dist/selection-popup.cjs.js +3 -4
  253. package/dist/selection-popup.esm.js +3 -4
  254. package/dist/semantic-tokens.d.ts +17 -0
  255. package/dist/semantic-tokens.d.ts.map +1 -0
  256. package/dist/sidebar.cjs.js +22 -22
  257. package/dist/sidebar.esm.js +25 -25
  258. package/dist/skeleton.cjs.js +2 -2
  259. package/dist/skeleton.esm.js +2 -2
  260. package/dist/slider.cjs.js +22 -26
  261. package/dist/slider.esm.js +25 -29
  262. package/dist/sortable.cjs.js +4 -5
  263. package/dist/sortable.esm.js +4 -5
  264. package/dist/spinning-text.cjs.js +4 -13
  265. package/dist/spinning-text.esm.js +4 -13
  266. package/dist/split-button.cjs.js +5 -5
  267. package/dist/split-button.esm.js +15 -14
  268. package/dist/splitter.cjs.js +52 -10
  269. package/dist/splitter.esm.js +55 -13
  270. package/dist/stepper.cjs.js +31 -65
  271. package/dist/stepper.esm.js +32 -66
  272. package/dist/switch.cjs.js +20 -22
  273. package/dist/switch.esm.js +20 -22
  274. package/dist/table.cjs.js +5 -5
  275. package/dist/table.esm.js +20 -20
  276. package/dist/tabs.cjs.js +91 -21
  277. package/dist/tabs.esm.js +182 -112
  278. package/dist/tags-input.cjs.js +41 -15
  279. package/dist/tags-input.esm.js +73 -47
  280. package/dist/textarea.cjs.js +32 -33
  281. package/dist/textarea.esm.js +38 -39
  282. package/dist/theme.d.ts +25 -1
  283. package/dist/theme.d.ts.map +1 -1
  284. package/dist/time-field.cjs.js +7 -7
  285. package/dist/time-field.esm.js +6 -6
  286. package/dist/time-picker.cjs.js +16 -13
  287. package/dist/time-picker.esm.js +27 -24
  288. package/dist/timeline.cjs.js +10 -10
  289. package/dist/timeline.esm.js +7 -7
  290. package/dist/toggle-group.cjs.js +13 -13
  291. package/dist/toggle-group.esm.js +66 -61
  292. package/dist/toggle.cjs.js +52 -34
  293. package/dist/toggle.esm.js +80 -62
  294. package/dist/toolbar.cjs.js +14 -14
  295. package/dist/toolbar.esm.js +41 -33
  296. package/dist/tooltip.cjs.js +3 -3
  297. package/dist/tooltip.esm.js +39 -33
  298. package/dist/transfer-list.cjs.js +28 -29
  299. package/dist/transfer-list.esm.js +28 -29
  300. package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
  301. package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
  302. package/dist/tree-item.cjs.js +9 -8
  303. package/dist/tree-item.esm.js +13 -12
  304. package/dist/tree.cjs.js +1 -1
  305. package/dist/tree.esm.js +1 -1
  306. package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
  307. package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
  308. package/dist/wizard.cjs.js +39 -36
  309. package/dist/wizard.esm.js +39 -36
  310. package/package.json +1 -1
  311. package/dist/date-time-utils-y3AvNvGe.js +0 -1
  312. package/dist/portal-DgpQ3Jo1.js +0 -1
  313. package/dist/portal-bR42gHvG.mjs +0 -118
  314. package/dist/runtime-DwE-tizc.js +0 -1
@@ -5,22 +5,22 @@ const A = `
5
5
  /* A wide table scrolls inside its own frame. Without this a grid or flex parent grows to the table's width. */
6
6
  min-inline-size: 0;
7
7
  max-inline-size: 100%;
8
- --ui-data-table-radius: 16px;
9
- --ui-data-table-border-color: var(--ui-color-border, rgba(15, 23, 42, 0.14));
8
+ --ui-data-table-radius: calc(var(--ui-radius, 6px) + 2px);
9
+ --ui-data-table-border-color: var(--ui-color-line-subtle, var(--ui-color-border, rgba(15, 23, 42, 0.14)));
10
10
  --ui-data-table-border: 1px solid var(--ui-data-table-border-color);
11
- --ui-data-table-bg: var(--ui-color-surface, rgba(255, 255, 255, 0.96));
11
+ --ui-data-table-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
12
12
  --ui-data-table-shadow: none;
13
13
  --ui-data-table-empty-color: var(--ui-color-muted, #526175);
14
14
  --ui-data-table-summary-color: var(--ui-color-muted, #475569);
15
15
  --ui-data-table-text: var(--ui-color-text, #0f172a);
16
16
  --ui-data-table-header-text: var(--ui-color-text, #1e293b);
17
- --ui-data-table-header-bg: var(--ui-color-surface-alt, #f8fafc);
17
+ --ui-data-table-header-bg: var(--ui-color-surface-subtle, var(--ui-color-surface-alt, #f8fafc));
18
18
  --ui-data-table-footer-text: var(--ui-color-text, #0f172a);
19
- --ui-data-table-footer-bg: color-mix(in srgb, var(--ui-color-surface-alt, #f8fafc) 88%, var(--ui-color-surface, #ffffff));
19
+ --ui-data-table-footer-bg: var(--ui-color-surface-subtle, color-mix(in srgb, var(--ui-color-surface-alt, #f8fafc) 88%, var(--ui-color-surface, #ffffff)));
20
20
  --ui-data-table-cell-border: color-mix(in srgb, var(--ui-data-table-border-color) 58%, transparent);
21
- --ui-data-table-striped-bg: color-mix(in srgb, var(--ui-color-surface-alt, #f8fafc) 82%, transparent);
22
- --ui-data-table-hover-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 12%, transparent);
23
- --ui-data-table-selected-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 20%, transparent);
21
+ --ui-data-table-striped-bg: var(--ui-color-surface-subtle, color-mix(in srgb, var(--ui-color-surface-alt, #f8fafc) 82%, transparent));
22
+ --ui-data-table-hover-bg: var(--ui-color-fill, color-mix(in srgb, var(--ui-color-primary, #2563eb) 12%, transparent));
23
+ --ui-data-table-selected-bg: var(--ui-color-accent-fill, color-mix(in srgb, var(--ui-color-primary, #2563eb) 20%, transparent));
24
24
  --ui-data-table-sort-indicator: color-mix(in srgb, var(--ui-color-muted, #94a3b8) 80%, transparent);
25
25
  --ui-data-table-sort-active: var(--ui-color-primary, #2563eb);
26
26
  --ui-data-table-resize-handle: color-mix(in srgb, var(--ui-color-muted, #94a3b8) 70%, transparent);
@@ -40,13 +40,16 @@ const A = `
40
40
  overflow: auto;
41
41
  border: var(--ui-data-table-border);
42
42
  border-radius: var(--ui-data-table-radius);
43
- background:
44
- linear-gradient(180deg, color-mix(in srgb, var(--ui-data-table-bg) 96%, #ffffff 4%), var(--ui-data-table-bg)),
45
- var(--ui-data-table-bg);
43
+ background: var(--ui-data-table-bg);
46
44
  box-shadow: var(--ui-data-table-shadow);
47
45
  transition: border-color var(--ui-data-table-duration) var(--ui-data-table-ease), box-shadow var(--ui-data-table-duration) var(--ui-data-table-ease);
48
46
  }
49
47
 
48
+ .frame[data-scroll-region]:focus-visible {
49
+ outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-data-table-focus-ring, #2563eb));
50
+ outline-offset: -2px;
51
+ }
52
+
50
53
  .frame::before {
51
54
  content: '';
52
55
  position: absolute;
@@ -549,12 +552,12 @@ const A = `
549
552
  }
550
553
 
551
554
  ui-data-table[loading]:not([headless]) > table tbody {
552
- opacity: 0.55;
555
+ opacity: 0.7;
553
556
  pointer-events: none;
554
557
  }
555
558
 
556
559
  ui-data-table[state="loading"]:not([headless]) > table tbody {
557
- opacity: 0.55;
560
+ opacity: 0.7;
558
561
  pointer-events: none;
559
562
  }
560
563
 
@@ -677,7 +680,7 @@ function S(m) {
677
680
  const a = Date.parse(m);
678
681
  return !Number.isNaN(a) && /[-/]/.test(m) ? a : m.toLowerCase();
679
682
  }
680
- const k = /* @__PURE__ */ new Set([
683
+ const E = /* @__PURE__ */ new Set([
681
684
  "sticky-header",
682
685
  "sticky-footer",
683
686
  "striped",
@@ -690,7 +693,7 @@ const k = /* @__PURE__ */ new Set([
690
693
  "shape",
691
694
  "variant",
692
695
  "elevation"
693
- ]), E = /* @__PURE__ */ new Set([
696
+ ]), k = /* @__PURE__ */ new Set([
694
697
  "pagination-id",
695
698
  "bulk-actions-label",
696
699
  "bulk-clear-label",
@@ -698,7 +701,7 @@ const k = /* @__PURE__ */ new Set([
698
701
  ]);
699
702
  class R extends C {
700
703
  constructor() {
701
- super(), this._table = null, this._observer = null, this._sortColumnIndex = -1, this._sortDirection = "asc", this._selectedRows = /* @__PURE__ */ new Set(), this._isSyncing = !1, this._isSettingPage = !1, this._isSettingColumnOrder = !1, this._page = 1, this._pageCount = 1, this._pageSize = 10, this._totalRows = 0, this._filteredRows = 0, this._paginationEl = null, this._resizeState = null, this._columnWidths = /* @__PURE__ */ new Map(), this._frameEl = null, this._virtualRaf = 0, this._virtualTopSpacer = null, this._virtualBottomSpacer = null, this._dragColumnIndex = -1, this._dragOverColumnIndex = -1, this._ignoreHeaderClickUntil = 0, this._syncRaf = 0, this._virtualStart = -1, this._virtualEnd = -1, this._virtualVisibleTotal = -1, this._resizeRaf = 0, this._pendingResizeColumn = -1, this._pendingResizeWidth = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onPaginationChange = this._onPaginationChange.bind(this), this._onPointerDown = this._onPointerDown.bind(this), this._onPointerMove = this._onPointerMove.bind(this), this._onPointerUp = this._onPointerUp.bind(this), this._onFrameScroll = this._onFrameScroll.bind(this), this._onDragStart = this._onDragStart.bind(this), this._onDragOver = this._onDragOver.bind(this), this._onDrop = this._onDrop.bind(this), this._onDragEnd = this._onDragEnd.bind(this);
704
+ super(), this._table = null, this._observer = null, this._sortColumnIndex = -1, this._sortDirection = "asc", this._selectedRows = /* @__PURE__ */ new Set(), this._isSyncing = !1, this._isSettingPage = !1, this._isSettingColumnOrder = !1, this._page = 1, this._pageCount = 1, this._pageSize = 10, this._totalRows = 0, this._filteredRows = 0, this._paginationEl = null, this._resizeState = null, this._columnWidths = /* @__PURE__ */ new Map(), this._frameEl = null, this._scrollObserver = null, this._virtualRaf = 0, this._virtualTopSpacer = null, this._virtualBottomSpacer = null, this._dragColumnIndex = -1, this._dragOverColumnIndex = -1, this._ignoreHeaderClickUntil = 0, this._syncRaf = 0, this._virtualStart = -1, this._virtualEnd = -1, this._virtualVisibleTotal = -1, this._resizeRaf = 0, this._pendingResizeColumn = -1, this._pendingResizeWidth = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onPaginationChange = this._onPaginationChange.bind(this), this._onPointerDown = this._onPointerDown.bind(this), this._onPointerMove = this._onPointerMove.bind(this), this._onPointerUp = this._onPointerUp.bind(this), this._onFrameScroll = this._onFrameScroll.bind(this), this._onDragStart = this._onDragStart.bind(this), this._onDragOver = this._onDragOver.bind(this), this._onDrop = this._onDrop.bind(this), this._onDragEnd = this._onDragEnd.bind(this);
702
705
  }
703
706
  static get observedAttributes() {
704
707
  return [
@@ -747,7 +750,7 @@ class R extends C {
747
750
  }), this._syncPaginationBinding();
748
751
  }
749
752
  disconnectedCallback() {
750
- this.removeEventListener("click", this._onClick), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("pointerdown", this._onPointerDown), this.removeEventListener("dragstart", this._onDragStart), this.removeEventListener("dragover", this._onDragOver), this.removeEventListener("drop", this._onDrop), this.removeEventListener("dragend", this._onDragEnd), window.removeEventListener("pointermove", this._onPointerMove), window.removeEventListener("pointerup", this._onPointerUp), this._resizeState = null, this._frameEl && (this._frameEl.removeEventListener("scroll", this._onFrameScroll), this._frameEl = null), this._virtualRaf && (cancelAnimationFrame(this._virtualRaf), this._virtualRaf = 0), this._resizeRaf && (cancelAnimationFrame(this._resizeRaf), this._resizeRaf = 0), this._pendingResizeColumn = -1, this._pendingResizeWidth = null, this._syncRaf && (cancelAnimationFrame(this._syncRaf), this._syncRaf = 0), this._clearVirtualSpacers(), this._observer && (this._observer.disconnect(), this._observer = null), this._detachPaginationListener(), super.disconnectedCallback();
753
+ this.removeEventListener("click", this._onClick), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("pointerdown", this._onPointerDown), this.removeEventListener("dragstart", this._onDragStart), this.removeEventListener("dragover", this._onDragOver), this.removeEventListener("drop", this._onDrop), this.removeEventListener("dragend", this._onDragEnd), window.removeEventListener("pointermove", this._onPointerMove), window.removeEventListener("pointerup", this._onPointerUp), this._resizeState = null, this._frameEl && (this._frameEl.removeEventListener("scroll", this._onFrameScroll), this._frameEl = null), this._virtualRaf && (cancelAnimationFrame(this._virtualRaf), this._virtualRaf = 0), this._resizeRaf && (cancelAnimationFrame(this._resizeRaf), this._resizeRaf = 0), this._pendingResizeColumn = -1, this._pendingResizeWidth = null, this._syncRaf && (cancelAnimationFrame(this._syncRaf), this._syncRaf = 0), this._clearVirtualSpacers(), this._observer && (this._observer.disconnect(), this._observer = null), this._detachPaginationListener(), this._scrollObserver?.disconnect(), this._scrollObserver = null, super.disconnectedCallback();
751
754
  }
752
755
  attributeChangedCallback(t, a, e) {
753
756
  if (a !== e && !(t === "column-order" && this._isSettingColumnOrder) && !(t === "page" && this._isSettingPage)) {
@@ -760,11 +763,11 @@ class R extends C {
760
763
  return;
761
764
  }
762
765
  if (this.isConnected) {
763
- if (E.has(t)) {
766
+ if (k.has(t)) {
764
767
  t === "pagination-id" ? this._syncPaginationBinding() : t === "bulk-actions-label" || t === "bulk-clear-label" ? this._updateBulkActions() : t === "state-text" && this._syncStateBar();
765
768
  return;
766
769
  }
767
- if (k.has(t)) {
770
+ if (E.has(t)) {
768
771
  t === "hide-summary" ? this._updateSummary() : (t === "state" || t === "loading") && this._syncStateBar();
769
772
  return;
770
773
  }
@@ -842,14 +845,14 @@ class R extends C {
842
845
  return a || (t === "loading" ? "Refreshing table data" : t === "error" ? "Table data could not be loaded" : t === "success" ? "Table data is up to date" : "");
843
846
  }
844
847
  _syncStateBar() {
845
- const t = this.root.querySelector(".statebar"), a = this.root.querySelector(".state-text"), e = this.root.querySelector(".loading-text"), i = this.root.querySelector(".frame"), r = this._table;
848
+ const t = this.root.querySelector(".statebar"), a = this.root.querySelector(".state-text"), e = this.root.querySelector(".loading-text"), r = this.root.querySelector(".frame"), i = this._table;
846
849
  if (!t) return;
847
850
  const s = this._state();
848
851
  s !== "idle" ? t.removeAttribute("hidden") : t.setAttribute("hidden", ""), t.setAttribute("data-state", s), t.setAttribute("aria-live", s === "error" ? "assertive" : "polite");
849
852
  const n = this._stateText(s);
850
853
  a && (a.textContent = n), e && (e.textContent = this._stateText("loading"));
851
854
  const u = s === "loading" ? "true" : "false";
852
- i && i.setAttribute("aria-busy", u), r && r.setAttribute("aria-busy", u);
855
+ r && r.setAttribute("aria-busy", u), i && i.setAttribute("aria-busy", u);
853
856
  }
854
857
  _isInteractionBlocked() {
855
858
  return this._state() === "loading";
@@ -865,8 +868,8 @@ class R extends C {
865
868
  if (!t) return `column-${a + 1}`;
866
869
  const e = (t.getAttribute("data-key") || "").trim();
867
870
  if (e) return e;
868
- const i = p(t);
869
- return i ? i.toLowerCase().replace(/\s+/g, "_") : `column-${a + 1}`;
871
+ const r = p(t);
872
+ return r ? r.toLowerCase().replace(/\s+/g, "_") : `column-${a + 1}`;
870
873
  }
871
874
  _currentColumnOrderString() {
872
875
  return this._headerCells().map((a, e) => this._headerKey(a, e)).join(",");
@@ -894,10 +897,10 @@ class R extends C {
894
897
  const e = Number(a);
895
898
  if (Number.isInteger(e) && e >= 0 && e < t.length)
896
899
  return e;
897
- const i = a.toLowerCase();
898
- for (let r = 0; r < t.length; r += 1) {
899
- const s = t[r], o = (s.getAttribute("data-key") || "").toLowerCase(), n = p(s).toLowerCase();
900
- if (o === i || n === i) return r;
900
+ const r = a.toLowerCase();
901
+ for (let i = 0; i < t.length; i += 1) {
902
+ const s = t[i], o = (s.getAttribute("data-key") || "").toLowerCase(), n = p(s).toLowerCase();
903
+ if (o === r || n === r) return i;
901
904
  }
902
905
  return -1;
903
906
  }
@@ -905,12 +908,12 @@ class R extends C {
905
908
  if (typeof a == "number" && Number.isInteger(a) && a >= 0 && a < t.length) return a;
906
909
  const e = String(a || "").trim();
907
910
  if (!e) return -1;
908
- const i = Number(e);
909
- if (Number.isInteger(i) && i >= 0 && i < t.length) return i;
910
- const r = e.toLowerCase();
911
+ const r = Number(e);
912
+ if (Number.isInteger(r) && r >= 0 && r < t.length) return r;
913
+ const i = e.toLowerCase();
911
914
  for (let s = 0; s < t.length; s += 1) {
912
915
  const o = t[s], n = (o.getAttribute("data-key") || "").toLowerCase(), u = p(o).toLowerCase();
913
- if (n === r || u === r || this._headerKey(o, s) === r) return s;
916
+ if (n === i || u === i || this._headerKey(o, s) === i) return s;
914
917
  }
915
918
  return -1;
916
919
  }
@@ -920,14 +923,14 @@ class R extends C {
920
923
  try {
921
924
  const e = JSON.parse(a);
922
925
  if (!Array.isArray(e)) return [];
923
- const i = [];
924
- return e.forEach((r) => {
925
- if (!r || typeof r != "object") return;
926
- const s = r.column ?? r.field ?? r.key, o = this._resolveColumnIndex(t, s);
926
+ const r = [];
927
+ return e.forEach((i) => {
928
+ if (!i || typeof i != "object") return;
929
+ const s = i.column ?? i.field ?? i.key, o = this._resolveColumnIndex(t, s);
927
930
  if (o < 0) return;
928
- const n = String(r.op || r.operator || "contains").trim().toLowerCase();
929
- i.push({ columnIndex: o, op: n, value: r.value });
930
- }), i;
931
+ const n = String(i.op || i.operator || "contains").trim().toLowerCase();
932
+ r.push({ columnIndex: o, op: n, value: i.value });
933
+ }), r;
931
934
  } catch {
932
935
  return [];
933
936
  }
@@ -938,8 +941,8 @@ class R extends C {
938
941
  _parsePinColumns(t) {
939
942
  const a = this.getAttribute("pin-columns");
940
943
  if (!a) return { left: [], right: [] };
941
- const e = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = (u, h) => {
942
- h.forEach((l) => {
944
+ const e = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = (u, c) => {
945
+ c.forEach((l) => {
943
946
  const d = this._resolveColumnIndex(t, l);
944
947
  d >= 0 && u.add(d);
945
948
  });
@@ -947,17 +950,17 @@ class R extends C {
947
950
  try {
948
951
  const u = JSON.parse(a);
949
952
  if (u && typeof u == "object") {
950
- r(e, this._normalizePinTokens(u.left)), r(i, this._normalizePinTokens(u.right));
951
- const h = Array.from(e).sort((d, c) => d - c), l = Array.from(i).filter((d) => !e.has(d)).sort((d, c) => c - d);
952
- return { left: h, right: l };
953
+ i(e, this._normalizePinTokens(u.left)), i(r, this._normalizePinTokens(u.right));
954
+ const c = Array.from(e).sort((d, h) => d - h), l = Array.from(r).filter((d) => !e.has(d)).sort((d, h) => h - d);
955
+ return { left: c, right: l };
953
956
  }
954
957
  } catch {
955
958
  }
956
959
  a.split(";").map((u) => u.trim()).filter(Boolean).forEach((u) => {
957
- const [h, l] = u.split(":"), d = (h || "").trim().toLowerCase(), c = this._normalizePinTokens(l || "");
958
- d === "left" && r(e, c), d === "right" && r(i, c);
960
+ const [c, l] = u.split(":"), d = (c || "").trim().toLowerCase(), h = this._normalizePinTokens(l || "");
961
+ d === "left" && i(e, h), d === "right" && i(r, h);
959
962
  });
960
- const o = Array.from(e).sort((u, h) => u - h), n = Array.from(i).filter((u) => !e.has(u)).sort((u, h) => h - u);
963
+ const o = Array.from(e).sort((u, c) => u - c), n = Array.from(r).filter((u) => !e.has(u)).sort((u, c) => c - u);
961
964
  return { left: o, right: n };
962
965
  }
963
966
  _setPageAttribute(t) {
@@ -983,11 +986,11 @@ class R extends C {
983
986
  _resolveColumnWidth(t, a) {
984
987
  const e = this._columnWidths.get(t);
985
988
  if (typeof e == "number" && Number.isFinite(e)) return Math.max(1, e);
986
- const i = a?.getBoundingClientRect().width || a?.offsetWidth || 0;
987
- return Number.isFinite(i) && i > 0 ? i : 120;
989
+ const r = a?.getBoundingClientRect().width || a?.offsetWidth || 0;
990
+ return Number.isFinite(r) && r > 0 ? r : 120;
988
991
  }
989
- _pinCell(t, a, e, i, r) {
990
- t && (t.setAttribute("data-pinned", a), i ? t.setAttribute("data-pin-edge", "true") : t.removeAttribute("data-pin-edge"), a === "left" ? (t.style.left = `${Math.max(0, Math.round(e))}px`, t.style.right = "") : (t.style.right = `${Math.max(0, Math.round(e))}px`, t.style.left = ""), t.style.zIndex = r ? "4" : "3");
992
+ _pinCell(t, a, e, r, i) {
993
+ t && (t.setAttribute("data-pinned", a), r ? t.setAttribute("data-pin-edge", "true") : t.removeAttribute("data-pin-edge"), a === "left" ? (t.style.left = `${Math.max(0, Math.round(e))}px`, t.style.right = "") : (t.style.right = `${Math.max(0, Math.round(e))}px`, t.style.left = ""), t.style.zIndex = i ? "4" : "3");
991
994
  }
992
995
  _applyPinnedColumns() {
993
996
  if (!this._table) return;
@@ -996,21 +999,21 @@ class R extends C {
996
999
  if (!t.length) return;
997
1000
  const { left: a, right: e } = this._parsePinColumns(t);
998
1001
  if (!a.length && !e.length) return;
999
- const i = Array.from(this._table.rows).filter((o) => !this._isVirtualSpacerRow(o));
1000
- let r = 0;
1002
+ const r = Array.from(this._table.rows).filter((o) => !this._isVirtualSpacerRow(o));
1003
+ let i = 0;
1001
1004
  a.forEach((o, n) => {
1002
- const u = this._resolveColumnWidth(o, t[o]), h = n === a.length - 1;
1003
- i.forEach((l, d) => {
1004
- const c = l.cells[o];
1005
- this._pinCell(c, "left", r, h, d === 0);
1006
- }), r += u;
1005
+ const u = this._resolveColumnWidth(o, t[o]), c = n === a.length - 1;
1006
+ r.forEach((l, d) => {
1007
+ const h = l.cells[o];
1008
+ this._pinCell(h, "left", i, c, d === 0);
1009
+ }), i += u;
1007
1010
  });
1008
1011
  let s = 0;
1009
1012
  e.forEach((o, n) => {
1010
- const u = this._resolveColumnWidth(o, t[o]), h = n === e.length - 1;
1011
- i.forEach((l, d) => {
1012
- const c = l.cells[o];
1013
- this._pinCell(c, "right", s, h, d === 0);
1013
+ const u = this._resolveColumnWidth(o, t[o]), c = n === e.length - 1;
1014
+ r.forEach((l, d) => {
1015
+ const h = l.cells[o];
1016
+ this._pinCell(h, "right", s, c, d === 0);
1014
1017
  }), s += u;
1015
1018
  });
1016
1019
  }
@@ -1020,48 +1023,48 @@ class R extends C {
1020
1023
  if (!t) return;
1021
1024
  const a = this._table.tHead?.rows[0], e = this._table.tBodies[0];
1022
1025
  if (!a || !e) return;
1023
- const i = Array.from(a.cells);
1024
- if (!i.length) return;
1025
- const r = t.split(",").map((l) => l.trim()).filter(Boolean);
1026
+ const r = Array.from(a.cells);
1026
1027
  if (!r.length) return;
1028
+ const i = t.split(",").map((l) => l.trim()).filter(Boolean);
1029
+ if (!i.length) return;
1027
1030
  const s = [], o = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
1028
- i.forEach((l, d) => {
1029
- const c = (l.getAttribute("data-key") || p(l)).toLowerCase().trim();
1030
- c && n.set(c, d);
1031
+ r.forEach((l, d) => {
1032
+ const h = (l.getAttribute("data-key") || p(l)).toLowerCase().trim();
1033
+ h && n.set(h, d);
1031
1034
  });
1032
- for (const l of r) {
1035
+ for (const l of i) {
1033
1036
  const d = Number(l);
1034
- if (Number.isInteger(d) && d >= 0 && d < i.length) {
1037
+ if (Number.isInteger(d) && d >= 0 && d < r.length) {
1035
1038
  o.has(d) || (o.add(d), s.push(d));
1036
1039
  continue;
1037
1040
  }
1038
- const c = n.get(l.toLowerCase());
1039
- typeof c == "number" && !o.has(c) && (o.add(c), s.push(c));
1041
+ const h = n.get(l.toLowerCase());
1042
+ typeof h == "number" && !o.has(h) && (o.add(h), s.push(h));
1040
1043
  }
1041
- for (let l = 0; l < i.length; l += 1)
1044
+ for (let l = 0; l < r.length; l += 1)
1042
1045
  o.has(l) || s.push(l);
1043
1046
  if (s.every((l, d) => l === d)) return;
1044
- s.map((l) => i[l]).forEach((l) => a.appendChild(l)), Array.from(e.rows).filter((l) => !this._isVirtualSpacerRow(l)).forEach((l) => {
1047
+ s.map((l) => r[l]).forEach((l) => a.appendChild(l)), Array.from(e.rows).filter((l) => !this._isVirtualSpacerRow(l)).forEach((l) => {
1045
1048
  const d = Array.from(l.cells);
1046
1049
  s.map((f) => d[f]).filter(Boolean).forEach((f) => l.appendChild(f));
1047
1050
  }), this._columnWidths.clear();
1048
1051
  }
1049
1052
  _moveColumn(t, a) {
1050
1053
  if (!this._table) return !1;
1051
- const e = this._table.tHead?.rows[0], i = this._table.tBodies[0];
1052
- if (!e || !i) return !1;
1053
- const r = Array.from(e.cells), s = r.length;
1054
+ const e = this._table.tHead?.rows[0], r = this._table.tBodies[0];
1055
+ if (!e || !r) return !1;
1056
+ const i = Array.from(e.cells), s = i.length;
1054
1057
  if (!s || t < 0 || t >= s || a < 0 || a >= s || t === a) return !1;
1055
1058
  const o = Array.from({ length: s }, (l, d) => d), [n] = o.splice(t, 1);
1056
- o.splice(a, 0, n), o.map((l) => r[l]).forEach((l) => e.appendChild(l)), Array.from(i.rows).filter((l) => !this._isVirtualSpacerRow(l)).forEach((l) => {
1059
+ o.splice(a, 0, n), o.map((l) => i[l]).forEach((l) => e.appendChild(l)), Array.from(r.rows).filter((l) => !this._isVirtualSpacerRow(l)).forEach((l) => {
1057
1060
  const d = Array.from(l.cells);
1058
1061
  o.map((f) => d[f]).filter(Boolean).forEach((f) => l.appendChild(f));
1059
1062
  });
1060
- const h = /* @__PURE__ */ new Map();
1063
+ const c = /* @__PURE__ */ new Map();
1061
1064
  return o.forEach((l, d) => {
1062
- const c = this._columnWidths.get(l);
1063
- typeof c == "number" && h.set(d, c);
1064
- }), this._columnWidths = h, this._sortColumnIndex >= 0 && (this._sortColumnIndex = o.indexOf(this._sortColumnIndex)), this._syncHeaderState(), this._applyPinnedColumns(), this._syncRowSelectionState(), !0;
1065
+ const h = this._columnWidths.get(l);
1066
+ typeof h == "number" && c.set(d, h);
1067
+ }), this._columnWidths = c, this._sortColumnIndex >= 0 && (this._sortColumnIndex = o.indexOf(this._sortColumnIndex)), this._syncHeaderState(), this._applyPinnedColumns(), this._syncRowSelectionState(), !0;
1065
1068
  }
1066
1069
  _clearDragMarkers() {
1067
1070
  this._headerCells().forEach((a) => {
@@ -1076,7 +1079,7 @@ class R extends C {
1076
1079
  sourceIndex: t,
1077
1080
  targetIndex: a,
1078
1081
  order: e,
1079
- keys: this._headerCells().map((i, r) => this._headerKey(i, r))
1082
+ keys: this._headerCells().map((r, i) => this._headerKey(r, i))
1080
1083
  },
1081
1084
  bubbles: !0
1082
1085
  })
@@ -1087,14 +1090,31 @@ class R extends C {
1087
1090
  e && e.focus();
1088
1091
  }
1089
1092
  _focusSelectableRow(t, a) {
1090
- const e = this._bodyRows().filter((o) => !o.hidden), i = e.indexOf(t);
1091
- if (i < 0) return;
1092
- const r = Math.min(e.length - 1, Math.max(0, i + a)), s = e[r];
1093
+ const e = this._bodyRows().filter((o) => !o.hidden), r = e.indexOf(t);
1094
+ if (r < 0) return;
1095
+ const i = Math.min(e.length - 1, Math.max(0, r + a)), s = e[i];
1093
1096
  s && s.focus();
1094
1097
  }
1095
1098
  _headerKeyboardShortcuts(t, a) {
1096
- const e = this._isRtl(), i = e ? "ArrowRight" : "ArrowLeft", r = e ? "ArrowLeft" : "ArrowRight", s = [i, r, "Home", "End"];
1097
- return t && s.push("Enter", "Space"), a && s.push(`Alt+${i}`, `Alt+${r}`), s.join(" ");
1099
+ const e = this._isRtl(), r = e ? "ArrowRight" : "ArrowLeft", i = e ? "ArrowLeft" : "ArrowRight", s = [r, i, "Home", "End"];
1100
+ return t && s.push("Enter", "Space"), a && s.push(`Alt+${r}`, `Alt+${i}`), s.join(" ");
1101
+ }
1102
+ /**
1103
+ * A frame that scrolls but holds nothing focusable (a loading or read-only table in a narrow
1104
+ * container) cannot be scrolled from the keyboard. Make it a focusable, named region while that is true.
1105
+ */
1106
+ _syncScrollRegion() {
1107
+ const t = this._frameEl;
1108
+ if (!t) return;
1109
+ const a = t.scrollWidth > t.clientWidth + 1 || t.scrollHeight > t.clientHeight + 1, e = !!this._table?.querySelector('[tabindex="0"], a[href], button, input, select, textarea');
1110
+ if (a && !e) {
1111
+ t.setAttribute("tabindex", "0"), t.setAttribute("role", "region"), t.setAttribute("data-scroll-region", "");
1112
+ const r = (this.getAttribute("aria-label") || "").trim();
1113
+ t.setAttribute("aria-label", r ? `${r}, scrollable` : "Scrollable table");
1114
+ } else t.hasAttribute("data-scroll-region") && (t.removeAttribute("tabindex"), t.removeAttribute("role"), t.removeAttribute("aria-label"), t.removeAttribute("data-scroll-region"));
1115
+ }
1116
+ _watchScrollRegion() {
1117
+ this._scrollObserver?.disconnect(), this._scrollObserver = null, !(!this._frameEl || typeof ResizeObserver > "u") && (this._scrollObserver = new ResizeObserver(() => this._syncScrollRegion()), this._scrollObserver.observe(this._frameEl), this._table && this._scrollObserver.observe(this._table));
1098
1118
  }
1099
1119
  _syncStructure() {
1100
1120
  if (!this._isSyncing) {
@@ -1102,7 +1122,7 @@ class R extends C {
1102
1122
  try {
1103
1123
  this._table = this._findTable();
1104
1124
  const t = this.root.querySelector(".frame");
1105
- this._frameEl !== t && (this._frameEl && this._frameEl.removeEventListener("scroll", this._onFrameScroll), this._frameEl = t, this._frameEl && this._frameEl.addEventListener("scroll", this._onFrameScroll, { passive: !0 }));
1125
+ this._frameEl !== t && (this._frameEl && this._frameEl.removeEventListener("scroll", this._onFrameScroll), this._frameEl = t, this._frameEl && this._frameEl.addEventListener("scroll", this._onFrameScroll, { passive: !0 }), this._watchScrollRegion());
1106
1126
  const a = this.root.querySelector(".empty"), e = this.root.querySelector(".summary");
1107
1127
  if (this._syncEmptyText(), !this._table) {
1108
1128
  a && a.removeAttribute("hidden"), e && (e.textContent = ""), this._selectedRows.clear(), this._page = 1, this._pageCount = 1, this._totalRows = 0, this._filteredRows = 0, this._clearVirtualization(!1), this._syncPaginationElement(), this._syncStateBar();
@@ -1115,9 +1135,9 @@ class R extends C {
1115
1135
  }
1116
1136
  }
1117
1137
  _syncHeaderState() {
1118
- const t = this.hasAttribute("sortable"), a = this.hasAttribute("draggable-columns"), e = this.hasAttribute("resizable-columns"), i = this._headerKeyboardShortcuts(t, a);
1138
+ const t = this.hasAttribute("sortable"), a = this.hasAttribute("draggable-columns"), e = this.hasAttribute("resizable-columns"), r = this._headerKeyboardShortcuts(t, a);
1119
1139
  this._headerCells().forEach((s, o) => {
1120
- if (s.setAttribute("data-col-index", String(o)), s.setAttribute("scope", "col"), s.setAttribute("aria-colindex", String(o + 1)), t || a ? s.setAttribute("aria-keyshortcuts", i) : s.removeAttribute("aria-keyshortcuts"), t ? s.setAttribute("data-sortable", "true") : s.removeAttribute("data-sortable"), t || a ? s.hasAttribute("tabindex") || s.setAttribute("tabindex", "0") : s.getAttribute("tabindex") === "0" && s.removeAttribute("tabindex"), o === this._sortColumnIndex && t ? s.setAttribute("aria-sort", this._sortDirection === "asc" ? "ascending" : "descending") : t ? s.setAttribute("aria-sort", "none") : s.removeAttribute("aria-sort"), a ? (s.setAttribute("data-draggable", "true"), s.setAttribute("draggable", "true"), s.setAttribute("aria-description", "Draggable column header")) : (s.removeAttribute("data-draggable"), s.removeAttribute("draggable"), s.removeAttribute("data-dragging"), s.removeAttribute("data-drag-over"), s.removeAttribute("aria-description")), e) {
1140
+ if (s.setAttribute("data-col-index", String(o)), s.setAttribute("scope", "col"), s.setAttribute("aria-colindex", String(o + 1)), t || a ? s.setAttribute("aria-keyshortcuts", r) : s.removeAttribute("aria-keyshortcuts"), t ? s.setAttribute("data-sortable", "true") : s.removeAttribute("data-sortable"), t || a ? s.hasAttribute("tabindex") || s.setAttribute("tabindex", "0") : s.getAttribute("tabindex") === "0" && s.removeAttribute("tabindex"), o === this._sortColumnIndex && t ? s.setAttribute("aria-sort", this._sortDirection === "asc" ? "ascending" : "descending") : t ? s.setAttribute("aria-sort", "none") : s.removeAttribute("aria-sort"), a ? (s.setAttribute("data-draggable", "true"), s.setAttribute("draggable", "true"), s.setAttribute("aria-description", "Draggable column header")) : (s.removeAttribute("data-draggable"), s.removeAttribute("draggable"), s.removeAttribute("data-dragging"), s.removeAttribute("data-drag-over"), s.removeAttribute("aria-description")), e) {
1121
1141
  s.setAttribute("data-resizable", "true");
1122
1142
  let n = s.querySelector(".resize-handle");
1123
1143
  n || (n = document.createElement("button"), n.type = "button", n.className = "resize-handle", n.setAttribute("aria-hidden", "true"), n.tabIndex = -1, s.appendChild(n)), n.setAttribute("data-col-index", String(o));
@@ -1133,18 +1153,18 @@ class R extends C {
1133
1153
  _applyPagination(t) {
1134
1154
  const a = this._bodyRows();
1135
1155
  this._pageSize = this._parsePageSize(), this._totalRows = a.length;
1136
- const e = this._parseFilterQuery(), i = this._headerCells(), r = this._resolveFilterColumnIndex(i), s = this._parseFilters(i), o = a.filter((d) => this._rowMatchesFilter(d, e, r, s));
1156
+ const e = this._parseFilterQuery(), r = this._headerCells(), i = this._resolveFilterColumnIndex(r), s = this._parseFilters(r), o = a.filter((d) => this._rowMatchesFilter(d, e, i, s));
1137
1157
  this._filteredRows = o.length, this._table?.setAttribute("aria-rowcount", String(this._filteredRows));
1138
1158
  const n = this._parsePage();
1139
1159
  this._pageCount = Math.max(1, Math.ceil(o.length / this._pageSize)), this._page = Math.min(this._pageCount, Math.max(1, n)), this._page !== n && this._setPageAttribute(this._page);
1140
- const u = (this._page - 1) * this._pageSize, h = u + this._pageSize, l = new Set(o);
1160
+ const u = (this._page - 1) * this._pageSize, c = u + this._pageSize, l = new Set(o);
1141
1161
  if (a.forEach((d) => {
1142
1162
  l.has(d) ? d.removeAttribute("data-hidden-by-filter") : (d.hidden = !0, d.setAttribute("data-hidden-by-filter", ""), d.removeAttribute("data-hidden-by-page"), d.removeAttribute("aria-rowindex"));
1143
- }), o.forEach((d, c) => {
1144
- const f = c >= u && c < h;
1145
- d.hidden = !f, f ? d.removeAttribute("data-hidden-by-page") : d.setAttribute("data-hidden-by-page", ""), d.setAttribute("aria-rowindex", String(c + 1));
1163
+ }), o.forEach((d, h) => {
1164
+ const f = h >= u && h < c;
1165
+ d.hidden = !f, f ? d.removeAttribute("data-hidden-by-page") : d.setAttribute("data-hidden-by-page", ""), d.setAttribute("aria-rowindex", String(h + 1));
1146
1166
  }), t) {
1147
- const d = o.length, c = d === 0 ? 0 : u + 1, f = Math.min(h, d);
1167
+ const d = o.length, h = d === 0 ? 0 : u + 1, f = Math.min(c, d);
1148
1168
  this.dispatchEvent(
1149
1169
  new CustomEvent("page-change", {
1150
1170
  detail: {
@@ -1152,7 +1172,7 @@ class R extends C {
1152
1172
  count: this._pageCount,
1153
1173
  pageSize: this._pageSize,
1154
1174
  total: d,
1155
- start: c,
1175
+ start: h,
1156
1176
  end: f
1157
1177
  },
1158
1178
  bubbles: !0
@@ -1171,15 +1191,15 @@ class R extends C {
1171
1191
  if (!a) return null;
1172
1192
  const e = t === "top" ? this._virtualTopSpacer : this._virtualBottomSpacer;
1173
1193
  if (e && e.isConnected) return e;
1174
- const i = document.createElement("tr");
1175
- i.setAttribute("data-virtual-spacer", t), i.setAttribute("aria-hidden", "true"), i.setAttribute("role", "presentation"), i.style.pointerEvents = "none";
1176
- const r = document.createElement("td");
1177
- return r.style.padding = "0", r.style.border = "0", r.style.height = "0px", r.style.lineHeight = "0", r.style.fontSize = "0", r.innerHTML = "&nbsp;", i.appendChild(r), t === "top" ? (a.insertBefore(i, a.firstChild), this._virtualTopSpacer = i) : (a.appendChild(i), this._virtualBottomSpacer = i), i;
1194
+ const r = document.createElement("tr");
1195
+ r.setAttribute("data-virtual-spacer", t), r.setAttribute("aria-hidden", "true"), r.setAttribute("role", "presentation"), r.style.pointerEvents = "none";
1196
+ const i = document.createElement("td");
1197
+ return i.style.padding = "0", i.style.border = "0", i.style.height = "0px", i.style.lineHeight = "0", i.style.fontSize = "0", i.innerHTML = "&nbsp;", r.appendChild(i), t === "top" ? (a.insertBefore(r, a.firstChild), this._virtualTopSpacer = r) : (a.appendChild(r), this._virtualBottomSpacer = r), r;
1178
1198
  }
1179
1199
  _setVirtualSpacerHeight(t, a, e) {
1180
1200
  if (!t) return;
1181
- const i = t.cells[0] || t.appendChild(document.createElement("td"));
1182
- i.colSpan !== Math.max(1, e) && (i.colSpan = Math.max(1, e)), i.style.padding = "0", i.style.border = "0", i.style.height = `${Math.max(0, Math.round(a))}px`, i.style.lineHeight = "0", i.style.fontSize = "0";
1201
+ const r = t.cells[0] || t.appendChild(document.createElement("td"));
1202
+ r.colSpan !== Math.max(1, e) && (r.colSpan = Math.max(1, e)), r.style.padding = "0", r.style.border = "0", r.style.height = `${Math.max(0, Math.round(a))}px`, r.style.lineHeight = "0", r.style.fontSize = "0";
1183
1203
  }
1184
1204
  _applyVirtualization(t) {
1185
1205
  if (!this.hasAttribute("virtualize") || !this._frameEl || !this._table) {
@@ -1191,8 +1211,8 @@ class R extends C {
1191
1211
  this._clearVirtualization(!0);
1192
1212
  return;
1193
1213
  }
1194
- const i = this._parseRowHeight(), r = this._parseOverscan(), s = this._frameEl.clientHeight || i * 8, o = this._frameEl.scrollTop, n = Math.max(0, Math.floor(o / i) - r), u = Math.min(e.length, Math.ceil((o + s) / i) + r), h = n * i, l = Math.max(0, (e.length - u) * i), d = Math.max(1, this._headerCells().length || e[0]?.cells.length || 1), c = this._ensureVirtualSpacer("top"), f = this._ensureVirtualSpacer("bottom");
1195
- this._setVirtualSpacerHeight(c, h, d), this._setVirtualSpacerHeight(f, l, d);
1214
+ const r = this._parseRowHeight(), i = this._parseOverscan(), s = this._frameEl.clientHeight || r * 8, o = this._frameEl.scrollTop, n = Math.max(0, Math.floor(o / r) - i), u = Math.min(e.length, Math.ceil((o + s) / r) + i), c = n * r, l = Math.max(0, (e.length - u) * r), d = Math.max(1, this._headerCells().length || e[0]?.cells.length || 1), h = this._ensureVirtualSpacer("top"), f = this._ensureVirtualSpacer("bottom");
1215
+ this._setVirtualSpacerHeight(h, c, d), this._setVirtualSpacerHeight(f, l, d);
1196
1216
  const y = (g, v) => {
1197
1217
  v ? (g.style.display === "none" && (g.style.display = ""), g.removeAttribute("data-hidden-by-virtual")) : (g.style.display !== "none" && (g.style.display = "none"), g.setAttribute("data-hidden-by-virtual", ""));
1198
1218
  };
@@ -1239,12 +1259,12 @@ class R extends C {
1239
1259
  t.textContent = "No records";
1240
1260
  return;
1241
1261
  }
1242
- const i = (this._page - 1) * this._pageSize + 1, r = Math.min(this._page * this._pageSize, e);
1262
+ const r = (this._page - 1) * this._pageSize + 1, i = Math.min(this._page * this._pageSize, e);
1243
1263
  if (e === a) {
1244
- t.textContent = `Showing ${i}-${r} of ${a}`;
1264
+ t.textContent = `Showing ${r}-${i} of ${a}`;
1245
1265
  return;
1246
1266
  }
1247
- t.textContent = `Showing ${i}-${r} of ${e} filtered records (${a} total)`;
1267
+ t.textContent = `Showing ${r}-${i} of ${e} filtered records (${a} total)`;
1248
1268
  }
1249
1269
  _syncEmptyText() {
1250
1270
  const t = this.root.querySelector(".empty");
@@ -1276,45 +1296,45 @@ class R extends C {
1276
1296
  return /^-?\d+(\.\d+)?$/.test(a) ? Number(a) : t.toLowerCase();
1277
1297
  }
1278
1298
  _rulePasses(t, a) {
1279
- const e = a.op, i = a.value, r = t.trim(), s = r.toLowerCase();
1280
- if (e === "empty") return r.length === 0;
1281
- if (e === "notempty" || e === "not-empty") return r.length > 0;
1282
- if (e === "equals" || e === "eq") return s === String(i ?? "").toLowerCase();
1283
- if (e === "neq" || e === "not-equals") return s !== String(i ?? "").toLowerCase();
1284
- if (e === "startswith" || e === "starts-with") return s.startsWith(String(i ?? "").toLowerCase());
1285
- if (e === "endswith" || e === "ends-with") return s.endsWith(String(i ?? "").toLowerCase());
1299
+ const e = a.op, r = a.value, i = t.trim(), s = i.toLowerCase();
1300
+ if (e === "empty") return i.length === 0;
1301
+ if (e === "notempty" || e === "not-empty") return i.length > 0;
1302
+ if (e === "equals" || e === "eq") return s === String(r ?? "").toLowerCase();
1303
+ if (e === "neq" || e === "not-equals") return s !== String(r ?? "").toLowerCase();
1304
+ if (e === "startswith" || e === "starts-with") return s.startsWith(String(r ?? "").toLowerCase());
1305
+ if (e === "endswith" || e === "ends-with") return s.endsWith(String(r ?? "").toLowerCase());
1286
1306
  if (e === "in")
1287
- return (Array.isArray(i) ? i.map((n) => String(n).toLowerCase()) : String(i ?? "").split(",").map((n) => n.trim().toLowerCase()).filter(Boolean)).includes(s);
1307
+ return (Array.isArray(r) ? r.map((n) => String(n).toLowerCase()) : String(r ?? "").split(",").map((n) => n.trim().toLowerCase()).filter(Boolean)).includes(s);
1288
1308
  if (e === "gt" || e === "gte" || e === "lt" || e === "lte" || e === "between") {
1289
- const o = this._parseComparable(r);
1309
+ const o = this._parseComparable(i);
1290
1310
  if (typeof o != "number") return !1;
1291
1311
  if (e === "between") {
1292
- const u = Array.isArray(i) ? i : String(i ?? "").split(","), h = Number(u[0]), l = Number(u[1]);
1293
- return !Number.isFinite(h) || !Number.isFinite(l) ? !1 : o >= Math.min(h, l) && o <= Math.max(h, l);
1312
+ const u = Array.isArray(r) ? r : String(r ?? "").split(","), c = Number(u[0]), l = Number(u[1]);
1313
+ return !Number.isFinite(c) || !Number.isFinite(l) ? !1 : o >= Math.min(c, l) && o <= Math.max(c, l);
1294
1314
  }
1295
- const n = Number(i);
1315
+ const n = Number(r);
1296
1316
  return Number.isFinite(n) ? e === "gt" ? o > n : e === "gte" ? o >= n : e === "lt" ? o < n : o <= n : !1;
1297
1317
  }
1298
- return s.includes(String(i ?? "").toLowerCase());
1318
+ return s.includes(String(r ?? "").toLowerCase());
1299
1319
  }
1300
- _rowMatchesFilter(t, a, e, i) {
1320
+ _rowMatchesFilter(t, a, e, r) {
1301
1321
  if (a) {
1302
- const r = e >= 0 ? p(t.cells[e]) : Array.from(t.cells).map((n) => p(n)).join(" ");
1303
- if (!r) return !1;
1304
- const s = r.toLowerCase(), o = a.split(/\s+/).filter(Boolean);
1322
+ const i = e >= 0 ? p(t.cells[e]) : Array.from(t.cells).map((n) => p(n)).join(" ");
1323
+ if (!i) return !1;
1324
+ const s = i.toLowerCase(), o = a.split(/\s+/).filter(Boolean);
1305
1325
  if (o.length && !o.every((n) => s.includes(n))) return !1;
1306
1326
  }
1307
- return i.length ? i.every((r) => {
1308
- const s = t.cells[r.columnIndex];
1309
- return this._rulePasses(p(s), r);
1327
+ return r.length ? r.every((i) => {
1328
+ const s = t.cells[i.columnIndex];
1329
+ return this._rulePasses(p(s), i);
1310
1330
  }) : !0;
1311
1331
  }
1312
1332
  _setColumnWidth(t, a, e = !0) {
1313
1333
  if (!this._table) return;
1314
- const i = Math.max(72, Math.round(a));
1315
- if (this._columnWidths.set(t, i), Array.from(this._table.rows).forEach((o) => {
1334
+ const r = Math.max(72, Math.round(a));
1335
+ if (this._columnWidths.set(t, r), Array.from(this._table.rows).forEach((o) => {
1316
1336
  const n = o.cells[t];
1317
- n && (n.style.width = `${i}px`, n.style.minWidth = `${i}px`, n.style.maxWidth = `${i}px`, n.style.boxSizing = "border-box");
1337
+ n && (n.style.width = `${r}px`, n.style.minWidth = `${r}px`, n.style.maxWidth = `${r}px`, n.style.boxSizing = "border-box");
1318
1338
  }), !e) return;
1319
1339
  this._applyPinnedColumns();
1320
1340
  const s = this._headerCells()[t];
@@ -1323,7 +1343,7 @@ class R extends C {
1323
1343
  detail: {
1324
1344
  columnIndex: t,
1325
1345
  key: s?.getAttribute("data-key") || p(s) || `column-${t + 1}`,
1326
- width: i
1346
+ width: r
1327
1347
  },
1328
1348
  bubbles: !0
1329
1349
  })
@@ -1333,14 +1353,14 @@ class R extends C {
1333
1353
  if (!this.hasAttribute("resizable-columns") || !this._table) return;
1334
1354
  const e = t.target.closest(".resize-handle");
1335
1355
  if (!e || !this._table.contains(e)) return;
1336
- const i = Number(e.getAttribute("data-col-index"));
1337
- if (!Number.isInteger(i) || i < 0) return;
1338
- const r = this._headerCells()[i];
1339
- if (!r) return;
1356
+ const r = Number(e.getAttribute("data-col-index"));
1357
+ if (!Number.isInteger(r) || r < 0) return;
1358
+ const i = this._headerCells()[r];
1359
+ if (!i) return;
1340
1360
  t.preventDefault();
1341
- const s = r.getBoundingClientRect().width;
1361
+ const s = i.getBoundingClientRect().width;
1342
1362
  this._resizeState = {
1343
- columnIndex: i,
1363
+ columnIndex: r,
1344
1364
  startX: t.clientX,
1345
1365
  startWidth: s
1346
1366
  }, window.addEventListener("pointermove", this._onPointerMove), window.addEventListener("pointerup", this._onPointerUp);
@@ -1373,58 +1393,58 @@ class R extends C {
1373
1393
  }
1374
1394
  const e = a.closest("th");
1375
1395
  if (!e || !this._table.contains(e)) return;
1376
- const r = this._headerCells().indexOf(e);
1377
- r < 0 || (this._dragColumnIndex = r, this._dragOverColumnIndex = r, this._clearDragMarkers(), e.setAttribute("data-dragging", "true"), t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", String(r))));
1396
+ const i = this._headerCells().indexOf(e);
1397
+ i < 0 || (this._dragColumnIndex = i, this._dragOverColumnIndex = i, this._clearDragMarkers(), e.setAttribute("data-dragging", "true"), t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", String(i))));
1378
1398
  }
1379
1399
  _onDragOver(t) {
1380
1400
  if (!this.hasAttribute("draggable-columns") || !this._table || this._dragColumnIndex < 0) return;
1381
1401
  const e = t.target.closest("th");
1382
1402
  if (!e || !this._table.contains(e)) return;
1383
- const i = this._headerCells(), r = i.indexOf(e);
1384
- if (r < 0 || (t.preventDefault(), this._dragOverColumnIndex === r)) return;
1385
- this._clearDragMarkers(), this._dragOverColumnIndex = r, e.setAttribute("data-drag-over", "true");
1386
- const s = i[this._dragColumnIndex];
1403
+ const r = this._headerCells(), i = r.indexOf(e);
1404
+ if (i < 0 || (t.preventDefault(), this._dragOverColumnIndex === i)) return;
1405
+ this._clearDragMarkers(), this._dragOverColumnIndex = i, e.setAttribute("data-drag-over", "true");
1406
+ const s = r[this._dragColumnIndex];
1387
1407
  s && s.setAttribute("data-dragging", "true");
1388
1408
  }
1389
1409
  _onDrop(t) {
1390
1410
  if (!this.hasAttribute("draggable-columns") || !this._table || this._dragColumnIndex < 0) return;
1391
1411
  const e = t.target.closest("th");
1392
1412
  if (!e || !this._table.contains(e)) return;
1393
- const r = this._headerCells().indexOf(e);
1394
- if (r < 0) return;
1413
+ const i = this._headerCells().indexOf(e);
1414
+ if (i < 0) return;
1395
1415
  t.preventDefault();
1396
- const s = this._dragColumnIndex, o = this._moveColumn(s, r);
1397
- this._clearDragMarkers(), this._dragColumnIndex = -1, this._ignoreHeaderClickUntil = Date.now() + 220, o && (this._applyVirtualization(!1), this._emitColumnOrderChange(s, r));
1416
+ const s = this._dragColumnIndex, o = this._moveColumn(s, i);
1417
+ this._clearDragMarkers(), this._dragColumnIndex = -1, this._ignoreHeaderClickUntil = Date.now() + 220, o && (this._applyVirtualization(!1), this._emitColumnOrderChange(s, i));
1398
1418
  }
1399
1419
  _onDragEnd() {
1400
1420
  this._clearDragMarkers(), this._dragColumnIndex = -1;
1401
1421
  }
1402
1422
  _rowValues(t) {
1403
- const a = this._headerCells(), e = Array.from(t.cells), i = {};
1404
- return e.forEach((r, s) => {
1423
+ const a = this._headerCells(), e = Array.from(t.cells), r = {};
1424
+ return e.forEach((i, s) => {
1405
1425
  const o = a[s], n = (o?.getAttribute("data-key") || p(o || void 0) || `col_${s + 1}`).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
1406
- i[n || `col_${s + 1}`] = p(r);
1407
- }), i;
1426
+ r[n || `col_${s + 1}`] = p(i);
1427
+ }), r;
1408
1428
  }
1409
1429
  _syncRowSelectionState() {
1410
1430
  const t = this.hasAttribute("selectable"), a = this._bodyRows();
1411
1431
  for (const e of Array.from(this._selectedRows))
1412
1432
  a.includes(e) || this._selectedRows.delete(e);
1413
1433
  a.forEach((e) => {
1414
- const i = !e.hidden;
1415
- t && i ? (e.setAttribute("aria-selected", this._selectedRows.has(e) ? "true" : "false"), e.setAttribute("aria-keyshortcuts", "ArrowUp ArrowDown Home End Enter Space"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0"), this._selectedRows.has(e) ? e.setAttribute("data-selected", "true") : e.removeAttribute("data-selected")) : (e.removeAttribute("aria-selected"), e.removeAttribute("aria-keyshortcuts"), e.removeAttribute("data-selected"), e.getAttribute("tabindex") === "0" && e.removeAttribute("tabindex"));
1434
+ const r = !e.hidden;
1435
+ t && r ? (e.setAttribute("aria-selected", this._selectedRows.has(e) ? "true" : "false"), e.setAttribute("aria-keyshortcuts", "ArrowUp ArrowDown Home End Enter Space"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0"), this._selectedRows.has(e) ? e.setAttribute("data-selected", "true") : e.removeAttribute("data-selected")) : (e.removeAttribute("aria-selected"), e.removeAttribute("aria-keyshortcuts"), e.removeAttribute("data-selected"), e.getAttribute("tabindex") === "0" && e.removeAttribute("tabindex"));
1416
1436
  });
1417
1437
  }
1418
1438
  _toggleRowSelection(t) {
1419
1439
  const a = this.hasAttribute("multi-select"), e = this._selectedRows.has(t);
1420
1440
  a || this._selectedRows.clear(), e && a ? this._selectedRows.delete(t) : this._selectedRows.add(t), this._syncRowSelectionState(), this._updateBulkActions();
1421
- const i = this._bodyRows(), r = i.flatMap((o, n) => this._selectedRows.has(o) ? [n] : []), s = i.filter((o) => this._selectedRows.has(o)).map((o) => this._rowValues(o));
1441
+ const r = this._bodyRows(), i = r.flatMap((o, n) => this._selectedRows.has(o) ? [n] : []), s = r.filter((o) => this._selectedRows.has(o)).map((o) => this._rowValues(o));
1422
1442
  this.dispatchEvent(
1423
1443
  new CustomEvent("row-select", {
1424
1444
  detail: {
1425
- index: i.indexOf(t),
1445
+ index: r.indexOf(t),
1426
1446
  selected: this._selectedRows.has(t),
1427
- indices: r,
1447
+ indices: i,
1428
1448
  rows: s,
1429
1449
  page: this._page
1430
1450
  },
@@ -1441,9 +1461,9 @@ class R extends C {
1441
1461
  rowIndex: n,
1442
1462
  value: S(p(o.cells[t]))
1443
1463
  })).sort((o, n) => {
1444
- const u = o.value, h = n.value;
1464
+ const u = o.value, c = n.value;
1445
1465
  let l = 0;
1446
- return typeof u == "number" && typeof h == "number" ? l = u - h : l = String(u).localeCompare(String(h), void 0, { numeric: !0, sensitivity: "base" }), l === 0 && (l = o.rowIndex - n.rowIndex), this._sortDirection === "asc" ? l : -l;
1466
+ return typeof u == "number" && typeof c == "number" ? l = u - c : l = String(u).localeCompare(String(c), void 0, { numeric: !0, sensitivity: "base" }), l === 0 && (l = o.rowIndex - n.rowIndex), this._sortDirection === "asc" ? l : -l;
1447
1467
  }).map((o) => o.row).forEach((o) => e.appendChild(o)), this._syncHeaderState(), this._applyPagination(!1), this._syncRowSelectionState(), this._updateSummary(), this._syncPaginationElement();
1448
1468
  const s = a.getAttribute("data-key") || p(a) || `column-${t + 1}`;
1449
1469
  this.dispatchEvent(
@@ -1477,29 +1497,29 @@ class R extends C {
1477
1497
  }
1478
1498
  _onClick(t) {
1479
1499
  if (!this._table) return;
1480
- const e = t.composedPath().find((r) => r instanceof HTMLElement) || t.target;
1500
+ const e = t.composedPath().find((i) => i instanceof HTMLElement) || t.target;
1481
1501
  if (e.closest(".bulk-clear")) {
1482
- const r = this._selectedRows.size;
1483
- r > 0 && (this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: r, page: this._page }, bubbles: !0 })));
1502
+ const i = this._selectedRows.size;
1503
+ i > 0 && (this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: i, page: this._page }, bubbles: !0 })));
1484
1504
  return;
1485
1505
  }
1486
1506
  if (!e.closest(".resize-handle") && !(e.closest("th") && Date.now() < this._ignoreHeaderClickUntil) && !this._isInteractionBlocked()) {
1487
1507
  if (this.hasAttribute("sortable")) {
1488
- const r = e.closest("th");
1489
- if (r && this._table.contains(r)) {
1490
- if (e !== r && this._isInteractiveTarget(e)) return;
1491
- const o = this._headerCells().indexOf(r);
1508
+ const i = e.closest("th");
1509
+ if (i && this._table.contains(i)) {
1510
+ if (e !== i && this._isInteractiveTarget(e)) return;
1511
+ const o = this._headerCells().indexOf(i);
1492
1512
  if (o >= 0) {
1493
- this._sortByColumn(o, r);
1513
+ this._sortByColumn(o, i);
1494
1514
  return;
1495
1515
  }
1496
1516
  }
1497
1517
  }
1498
1518
  if (this.hasAttribute("selectable")) {
1499
- const r = e.closest("tbody tr");
1500
- if (r && this._table.contains(r) && !r.hidden && !this._isVirtualSpacerRow(r)) {
1501
- if (e !== r && this._isInteractiveTarget(e)) return;
1502
- this._toggleRowSelection(r);
1519
+ const i = e.closest("tbody tr");
1520
+ if (i && this._table.contains(i) && !i.hidden && !this._isVirtualSpacerRow(i)) {
1521
+ if (e !== i && this._isInteractiveTarget(e)) return;
1522
+ this._toggleRowSelection(i);
1503
1523
  }
1504
1524
  }
1505
1525
  }
@@ -1508,19 +1528,19 @@ class R extends C {
1508
1528
  if (!this._table) return;
1509
1529
  const a = t.key, e = t.target;
1510
1530
  if (a === "Escape" && this._selectedRows.size) {
1511
- const r = this._selectedRows.size;
1512
- this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: r, page: this._page }, bubbles: !0 }));
1531
+ const i = this._selectedRows.size;
1532
+ this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: i, page: this._page }, bubbles: !0 }));
1513
1533
  return;
1514
1534
  }
1515
1535
  if (this._isInteractionBlocked()) return;
1516
- const i = e.closest("th");
1517
- if (i && this._table.contains(i)) {
1518
- const r = this._headerCells(), s = r.indexOf(i);
1536
+ const r = e.closest("th");
1537
+ if (r && this._table.contains(r)) {
1538
+ const i = this._headerCells(), s = i.indexOf(r);
1519
1539
  if (s >= 0) {
1520
1540
  const n = this._isRtl() ? -1 : 1, u = -n;
1521
1541
  if (a === "ArrowRight" || a === "ArrowLeft") {
1522
1542
  t.preventDefault();
1523
- const h = a === "ArrowRight" ? n : u, l = Math.max(0, Math.min(r.length - 1, s + h));
1543
+ const c = a === "ArrowRight" ? n : u, l = Math.max(0, Math.min(i.length - 1, s + c));
1524
1544
  if (t.altKey && this.hasAttribute("draggable-columns") && l !== s) {
1525
1545
  this._moveColumn(s, l) && (this._ignoreHeaderClickUntil = Date.now() + 220, this._emitColumnOrderChange(s, l), this._applyVirtualization(!1), this._focusHeaderAt(l));
1526
1546
  return;
@@ -1529,22 +1549,22 @@ class R extends C {
1529
1549
  return;
1530
1550
  }
1531
1551
  if (a === "Home" || a === "End") {
1532
- t.preventDefault(), this._focusHeaderAt(a === "Home" ? 0 : r.length - 1);
1552
+ t.preventDefault(), this._focusHeaderAt(a === "Home" ? 0 : i.length - 1);
1533
1553
  return;
1534
1554
  }
1535
1555
  if ((a === "Enter" || a === " ") && this.hasAttribute("sortable")) {
1536
- if (e !== i && this._isInteractiveTarget(e)) return;
1537
- t.preventDefault(), this._sortByColumn(s, i);
1556
+ if (e !== r && this._isInteractiveTarget(e)) return;
1557
+ t.preventDefault(), this._sortByColumn(s, r);
1538
1558
  return;
1539
1559
  }
1540
1560
  }
1541
1561
  }
1542
1562
  if (this.hasAttribute("selectable")) {
1543
- const r = e.closest("tbody tr");
1544
- if (r && this._table.contains(r) && !r.hidden && !this._isVirtualSpacerRow(r)) {
1545
- if (e !== r && this._isInteractiveTarget(e)) return;
1563
+ const i = e.closest("tbody tr");
1564
+ if (i && this._table.contains(i) && !i.hidden && !this._isVirtualSpacerRow(i)) {
1565
+ if (e !== i && this._isInteractiveTarget(e)) return;
1546
1566
  if (a === "ArrowDown" || a === "ArrowUp") {
1547
- t.preventDefault(), this._focusSelectableRow(r, a === "ArrowDown" ? 1 : -1);
1567
+ t.preventDefault(), this._focusSelectableRow(i, a === "ArrowDown" ? 1 : -1);
1548
1568
  return;
1549
1569
  }
1550
1570
  if (a === "Home" || a === "End") {
@@ -1553,7 +1573,7 @@ class R extends C {
1553
1573
  o && o.focus();
1554
1574
  return;
1555
1575
  }
1556
- (a === "Enter" || a === " ") && (t.preventDefault(), this._toggleRowSelection(r));
1576
+ (a === "Enter" || a === " ") && (t.preventDefault(), this._toggleRowSelection(i));
1557
1577
  }
1558
1578
  }
1559
1579
  }
@@ -1566,8 +1586,8 @@ class R extends C {
1566
1586
  return;
1567
1587
  }
1568
1588
  t.removeAttribute("hidden");
1569
- const r = this.getAttribute("bulk-actions-label") || "{count} selected", s = this.getAttribute("bulk-clear-label") || "Clear selection", o = t.querySelector(".bulk-count");
1570
- o && (o.textContent = r.replace("{count}", String(e)));
1589
+ const i = this.getAttribute("bulk-actions-label") || "{count} selected", s = this.getAttribute("bulk-clear-label") || "Clear selection", o = t.querySelector(".bulk-count");
1590
+ o && (o.textContent = i.replace("{count}", String(e)));
1571
1591
  const n = t.querySelector(".bulk-clear");
1572
1592
  n && (n.textContent = s);
1573
1593
  }