@editora/ui-core 0.1.19 → 0.1.21

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 (313) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +30 -29
  48. package/dist/color-picker.cjs.js +10 -10
  49. package/dist/color-picker.esm.js +190 -253
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-collection.d.ts.map +1 -1
  57. package/dist/components/ui-multi-select.d.ts.map +1 -1
  58. package/dist/components/ui-orbiter.d.ts.map +1 -1
  59. package/dist/components/ui-portal.d.ts.map +1 -1
  60. package/dist/components/ui-positioner.d.ts.map +1 -1
  61. package/dist/components/ui-skeleton.d.ts.map +1 -1
  62. package/dist/components/ui-sortable.d.ts +8 -0
  63. package/dist/components/ui-sortable.d.ts.map +1 -1
  64. package/dist/components/ui-split-button.d.ts +1 -0
  65. package/dist/components/ui-split-button.d.ts.map +1 -1
  66. package/dist/components/ui-tabs.d.ts.map +1 -1
  67. package/dist/components/ui-textarea.d.ts.map +1 -1
  68. package/dist/components/ui-time-picker.d.ts.map +1 -1
  69. package/dist/container.cjs.js +2 -2
  70. package/dist/container.esm.js +2 -3
  71. package/dist/context-menu.cjs.js +8 -8
  72. package/dist/context-menu.esm.js +157 -219
  73. package/dist/control-group.cjs.js +1 -1
  74. package/dist/control-group.esm.js +2 -3
  75. package/dist/data-table.cjs.js +4 -4
  76. package/dist/data-table.esm.js +299 -381
  77. package/dist/date-field.cjs.js +3 -3
  78. package/dist/date-field.esm.js +68 -80
  79. package/dist/date-picker.cjs.js +9 -9
  80. package/dist/date-picker.esm.js +69 -97
  81. package/dist/date-range-picker.cjs.js +3 -3
  82. package/dist/date-range-picker.esm.js +32 -56
  83. package/dist/date-range-time-picker.cjs.js +9 -9
  84. package/dist/date-range-time-picker.esm.js +111 -140
  85. package/dist/date-time-picker.cjs.js +7 -7
  86. package/dist/date-time-picker.esm.js +115 -147
  87. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  88. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  89. package/dist/description.cjs.js +1 -1
  90. package/dist/description.esm.js +3 -5
  91. package/dist/dialog.cjs.js +12 -12
  92. package/dist/dialog.esm.js +44 -63
  93. package/dist/direction-provider.cjs.js +1 -1
  94. package/dist/direction-provider.esm.js +2 -3
  95. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  96. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  97. package/dist/dismissable-layer.cjs.js +2 -2
  98. package/dist/dismissable-layer.esm.js +4 -6
  99. package/dist/dock.cjs.js +5 -5
  100. package/dist/dock.esm.js +134 -155
  101. package/dist/drawer.cjs.js +2 -2
  102. package/dist/drawer.esm.js +18 -35
  103. package/dist/dropdown.cjs.js +2 -2
  104. package/dist/dropdown.esm.js +119 -149
  105. package/dist/dropzone.cjs.js +1 -1
  106. package/dist/dropzone.esm.js +0 -1
  107. package/dist/empty-state.cjs.js +1 -1
  108. package/dist/empty-state.esm.js +1 -1
  109. package/dist/field-error.cjs.js +1 -1
  110. package/dist/field-error.esm.js +3 -5
  111. package/dist/field.cjs.js +5 -5
  112. package/dist/field.esm.js +27 -34
  113. package/dist/fieldset.cjs.js +4 -4
  114. package/dist/fieldset.esm.js +19 -24
  115. package/dist/file-upload.cjs.js +4 -4
  116. package/dist/file-upload.esm.js +69 -93
  117. package/dist/flex.cjs.js +1 -1
  118. package/dist/flex.esm.js +5 -9
  119. package/dist/floating-toolbar.cjs.js +4 -4
  120. package/dist/floating-toolbar.esm.js +60 -85
  121. package/dist/focus-scope-Bwug2gDv.js +1 -0
  122. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  123. package/dist/focus-scope.cjs.js +2 -2
  124. package/dist/focus-scope.esm.js +15 -20
  125. package/dist/form.cjs.js +2 -2
  126. package/dist/form.esm.js +26 -53
  127. package/dist/gantt.cjs.js +43 -43
  128. package/dist/gantt.esm.js +295 -322
  129. package/dist/grid.cjs.js +1 -1
  130. package/dist/grid.esm.js +5 -9
  131. package/dist/hover-card.cjs.js +4 -4
  132. package/dist/hover-card.esm.js +22 -28
  133. package/dist/icon-cloud.cjs.js +7 -7
  134. package/dist/icon-cloud.esm.js +48 -62
  135. package/dist/icon.cjs.js +1 -1
  136. package/dist/icon.esm.js +2 -4
  137. package/dist/index.cjs.js +1 -1
  138. package/dist/index.esm.js +378 -390
  139. package/dist/inline-edit.cjs.js +11 -11
  140. package/dist/inline-edit.esm.js +32 -36
  141. package/dist/input.cjs.js +17 -17
  142. package/dist/input.esm.js +50 -63
  143. package/dist/label.cjs.js +2 -2
  144. package/dist/label.esm.js +8 -17
  145. package/dist/layout.cjs.js +2 -2
  146. package/dist/layout.esm.js +20 -26
  147. package/dist/listbox-B6QgECax.js +46 -0
  148. package/dist/listbox-DJamVeFj.mjs +200 -0
  149. package/dist/listbox.cjs.js +1 -1
  150. package/dist/listbox.esm.js +2 -4
  151. package/dist/marquee.cjs.js +5 -5
  152. package/dist/marquee.esm.js +33 -50
  153. package/dist/masonry-grid.cjs.js +1 -1
  154. package/dist/masonry-grid.esm.js +5 -9
  155. package/dist/menu.cjs.js +3 -3
  156. package/dist/menu.esm.js +106 -126
  157. package/dist/menubar.cjs.js +5 -5
  158. package/dist/menubar.esm.js +118 -164
  159. package/dist/meter.cjs.js +2 -2
  160. package/dist/meter.esm.js +4 -4
  161. package/dist/multi-select.cjs.js +5 -5
  162. package/dist/multi-select.esm.js +125 -137
  163. package/dist/navigation-menu.cjs.js +4 -4
  164. package/dist/navigation-menu.esm.js +44 -55
  165. package/dist/number-field.cjs.js +2 -2
  166. package/dist/number-field.esm.js +73 -98
  167. package/dist/number-ticker.cjs.js +3 -3
  168. package/dist/number-ticker.esm.js +22 -43
  169. package/dist/odometer.cjs.js +1 -1
  170. package/dist/odometer.esm.js +5 -9
  171. package/dist/orbiter.cjs.js +13 -13
  172. package/dist/orbiter.esm.js +79 -90
  173. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  174. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  175. package/dist/pagination.cjs.js +2 -2
  176. package/dist/pagination.esm.js +14 -18
  177. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  178. package/dist/panel-group-CaD0_KQf.js +36 -0
  179. package/dist/panel-group.cjs.js +1 -1
  180. package/dist/panel-group.esm.js +2 -5
  181. package/dist/panel.cjs.js +4 -4
  182. package/dist/panel.esm.js +8 -10
  183. package/dist/password-field.cjs.js +9 -9
  184. package/dist/password-field.esm.js +62 -82
  185. package/dist/pin-input.cjs.js +3 -3
  186. package/dist/pin-input.esm.js +33 -39
  187. package/dist/placement-grid.cjs.js +4 -4
  188. package/dist/placement-grid.esm.js +108 -131
  189. package/dist/plugin-panel.cjs.js +7 -7
  190. package/dist/plugin-panel.esm.js +13 -15
  191. package/dist/popover.cjs.js +2 -2
  192. package/dist/popover.esm.js +21 -31
  193. package/dist/portal-DgpQ3Jo1.js +1 -0
  194. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  195. package/dist/portal.cjs.js +3 -3
  196. package/dist/portal.esm.js +20 -28
  197. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  198. package/dist/positioner-D_fqyx_j.js +1 -0
  199. package/dist/positioner.cjs.js +2 -2
  200. package/dist/positioner.esm.js +22 -28
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/primitives/auto-scroll.d.ts +9 -0
  204. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  205. package/dist/primitives/selector.d.ts +4 -0
  206. package/dist/primitives/selector.d.ts.map +1 -0
  207. package/dist/progress.cjs.js +1 -1
  208. package/dist/progress.esm.js +5 -9
  209. package/dist/quick-actions.cjs.js +6 -6
  210. package/dist/quick-actions.esm.js +52 -62
  211. package/dist/radio-group.cjs.js +13 -13
  212. package/dist/radio-group.esm.js +39 -51
  213. package/dist/radio.cjs.js +1 -1
  214. package/dist/radio.esm.js +5 -9
  215. package/dist/rating.cjs.js +1 -1
  216. package/dist/rating.esm.js +12 -23
  217. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  218. package/dist/roving-focus-group.cjs.js +1 -1
  219. package/dist/roving-focus-group.esm.js +3 -5
  220. package/dist/runtime-CTaOSmBj.js +1 -0
  221. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  222. package/dist/runtime.cjs.js +1 -1
  223. package/dist/runtime.esm.js +6 -6
  224. package/dist/scroll-area.cjs.js +3 -3
  225. package/dist/scroll-area.esm.js +38 -46
  226. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  227. package/dist/section.cjs.js +1 -1
  228. package/dist/section.esm.js +1 -1
  229. package/dist/select.cjs.js +7 -7
  230. package/dist/select.esm.js +67 -97
  231. package/dist/selection-popup.cjs.js +1 -1
  232. package/dist/selection-popup.esm.js +8 -15
  233. package/dist/selector-BvAh35ve.js +1 -0
  234. package/dist/selector-WI8pD7YO.mjs +18 -0
  235. package/dist/separator.cjs.js +1 -1
  236. package/dist/separator.esm.js +1 -1
  237. package/dist/sidebar.cjs.js +18 -18
  238. package/dist/sidebar.esm.js +117 -139
  239. package/dist/skeleton.cjs.js +11 -11
  240. package/dist/skeleton.esm.js +27 -24
  241. package/dist/slider.cjs.js +1 -1
  242. package/dist/slider.esm.js +6 -11
  243. package/dist/slot.cjs.js +4 -4
  244. package/dist/slot.esm.js +16 -19
  245. package/dist/sortable.cjs.js +79 -65
  246. package/dist/sortable.esm.js +714 -734
  247. package/dist/spinning-text.cjs.js +12 -12
  248. package/dist/spinning-text.esm.js +80 -92
  249. package/dist/split-button.cjs.js +4 -4
  250. package/dist/split-button.esm.js +77 -62
  251. package/dist/splitter.cjs.js +1 -1
  252. package/dist/splitter.esm.js +1 -1
  253. package/dist/stepper.cjs.js +8 -8
  254. package/dist/stepper.esm.js +32 -52
  255. package/dist/switch.cjs.js +7 -7
  256. package/dist/switch.esm.js +23 -31
  257. package/dist/table.cjs.js +2 -2
  258. package/dist/table.esm.js +46 -56
  259. package/dist/tabs.cjs.js +8 -8
  260. package/dist/tabs.esm.js +89 -109
  261. package/dist/tags-input.cjs.js +4 -4
  262. package/dist/tags-input.esm.js +45 -62
  263. package/dist/textarea.cjs.js +10 -10
  264. package/dist/textarea.esm.js +49 -52
  265. package/dist/time-field.cjs.js +4 -4
  266. package/dist/time-field.esm.js +70 -84
  267. package/dist/time-picker.cjs.js +22 -22
  268. package/dist/time-picker.esm.js +88 -110
  269. package/dist/timeline.cjs.js +1 -1
  270. package/dist/timeline.esm.js +3 -5
  271. package/dist/toast.cjs.js +2 -2
  272. package/dist/toast.esm.js +33 -47
  273. package/dist/toggle-group.cjs.js +6 -6
  274. package/dist/toggle-group.esm.js +85 -105
  275. package/dist/toggle.cjs.js +1 -1
  276. package/dist/toggle.esm.js +3 -5
  277. package/dist/toolbar.cjs.js +1 -1
  278. package/dist/toolbar.esm.js +13 -24
  279. package/dist/tooltip.cjs.js +2 -2
  280. package/dist/tooltip.esm.js +31 -42
  281. package/dist/transfer-list.cjs.js +31 -31
  282. package/dist/transfer-list.esm.js +114 -127
  283. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  284. package/dist/tree-Dx_kv_ih.js +39 -0
  285. package/dist/tree-item.cjs.js +2 -2
  286. package/dist/tree-item.esm.js +2 -3
  287. package/dist/tree.cjs.js +1 -1
  288. package/dist/tree.esm.js +2 -5
  289. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  290. package/dist/ui-button-rXQOS9QJ.js +521 -0
  291. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  292. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  293. package/dist/visually-hidden.cjs.js +1 -1
  294. package/dist/visually-hidden.esm.js +1 -1
  295. package/dist/wizard.cjs.js +14 -14
  296. package/dist/wizard.esm.js +85 -105
  297. package/package.json +2 -2
  298. package/dist/date-time-utils-66480de4.js +0 -1
  299. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  300. package/dist/dismissable-layer-193e3bed.js +0 -1
  301. package/dist/focus-scope-2b12b4e7.js +0 -1
  302. package/dist/listbox-308789a0.mjs +0 -210
  303. package/dist/listbox-ef2f708e.js +0 -46
  304. package/dist/panel-group-40254cdd.js +0 -36
  305. package/dist/portal-c69756c0.js +0 -1
  306. package/dist/positioner-33529bb8.js +0 -1
  307. package/dist/runtime-3f13807b.js +0 -1
  308. package/dist/tree-0a7a8d05.js +0 -39
  309. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  310. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  311. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  312. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  313. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,5 +1,5 @@
1
- import { E as A } from "./ElementBase-909688f3.mjs";
2
- const S = `
1
+ import { E as C } from "./ElementBase-YlTLMsGk.mjs";
2
+ const A = `
3
3
  :host {
4
4
  display: block;
5
5
  --ui-data-table-radius: 16px;
@@ -654,29 +654,27 @@ const S = `
654
654
  }
655
655
  }
656
656
  `;
657
- function C() {
658
- if (typeof document > "u")
659
- return;
660
- const _ = "ui-data-table-light-dom-style", t = document.getElementById(_);
657
+ function w() {
658
+ if (typeof document > "u") return;
659
+ const m = "ui-data-table-light-dom-style", t = document.getElementById(m);
661
660
  if (t) {
662
661
  t.textContent !== x && (t.textContent = x);
663
662
  return;
664
663
  }
665
664
  const a = document.createElement("style");
666
- a.id = _, a.textContent = x, document.head.appendChild(a);
665
+ a.id = m, a.textContent = x, document.head.appendChild(a);
667
666
  }
668
- typeof document < "u" && C();
669
- function m(_) {
670
- return _ ? (_.textContent || "").replace(/\s+/g, " ").trim() : "";
667
+ typeof document < "u" && w();
668
+ function p(m) {
669
+ return m ? (m.textContent || "").replace(/\s+/g, " ").trim() : "";
671
670
  }
672
- function k(_) {
673
- const t = _.replace(/,/g, "");
674
- if (/^-?\d+(\.\d+)?$/.test(t))
675
- return Number(t);
676
- const a = Date.parse(_);
677
- return !Number.isNaN(a) && /[-/]/.test(_) ? a : _.toLowerCase();
671
+ function S(m) {
672
+ const t = m.replace(/,/g, "");
673
+ if (/^-?\d+(\.\d+)?$/.test(t)) return Number(t);
674
+ const a = Date.parse(m);
675
+ return !Number.isNaN(a) && /[-/]/.test(m) ? a : m.toLowerCase();
678
676
  }
679
- const E = /* @__PURE__ */ new Set([
677
+ const k = /* @__PURE__ */ new Set([
680
678
  "sticky-header",
681
679
  "sticky-footer",
682
680
  "striped",
@@ -689,13 +687,13 @@ const E = /* @__PURE__ */ new Set([
689
687
  "shape",
690
688
  "variant",
691
689
  "elevation"
692
- ]), R = /* @__PURE__ */ new Set([
690
+ ]), E = /* @__PURE__ */ new Set([
693
691
  "pagination-id",
694
692
  "bulk-actions-label",
695
693
  "bulk-clear-label",
696
694
  "state-text"
697
695
  ]);
698
- class z extends A {
696
+ class R extends C {
699
697
  constructor() {
700
698
  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);
701
699
  }
@@ -737,7 +735,7 @@ class z extends A {
737
735
  ];
738
736
  }
739
737
  connectedCallback() {
740
- super.connectedCallback(), C(), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("pointerdown", this._onPointerDown), this.addEventListener("dragstart", this._onDragStart), this.addEventListener("dragover", this._onDragOver), this.addEventListener("drop", this._onDrop), this.addEventListener("dragend", this._onDragEnd), this._observer = new MutationObserver(() => {
738
+ super.connectedCallback(), w(), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("pointerdown", this._onPointerDown), this.addEventListener("dragstart", this._onDragStart), this.addEventListener("dragover", this._onDragOver), this.addEventListener("drop", this._onDrop), this.addEventListener("dragend", this._onDragEnd), this._observer = new MutationObserver(() => {
741
739
  this._isSyncing || this._queueSyncStructure();
742
740
  }), this._observer.observe(this, {
743
741
  childList: !0,
@@ -759,11 +757,11 @@ class z extends A {
759
757
  return;
760
758
  }
761
759
  if (this.isConnected) {
762
- if (R.has(t)) {
760
+ if (E.has(t)) {
763
761
  t === "pagination-id" ? this._syncPaginationBinding() : t === "bulk-actions-label" || t === "bulk-clear-label" ? this._updateBulkActions() : t === "state-text" && this._syncStateBar();
764
762
  return;
765
763
  }
766
- if (E.has(t)) {
764
+ if (k.has(t)) {
767
765
  t === "hide-summary" ? this._updateSummary() : (t === "state" || t === "loading") && this._syncStateBar();
768
766
  return;
769
767
  }
@@ -782,7 +780,7 @@ class z extends A {
782
780
  }
783
781
  const t = this.getAttribute("empty-text") || "No data available.";
784
782
  this.setContent(`
785
- <style>${S}</style>
783
+ <style>${A}</style>
786
784
  <div class="statebar" part="state" hidden role="status" aria-live="polite">
787
785
  <span class="state-dot" aria-hidden="true"></span>
788
786
  <span class="state-text"></span>
@@ -822,8 +820,7 @@ class z extends A {
822
820
  return t.hasAttribute("data-virtual-spacer");
823
821
  }
824
822
  _clearVirtualSpacers() {
825
- var t, a;
826
- (t = this._virtualTopSpacer) != null && t.isConnected && this._virtualTopSpacer.remove(), (a = this._virtualBottomSpacer) != null && a.isConnected && this._virtualBottomSpacer.remove(), this._virtualTopSpacer = null, this._virtualBottomSpacer = null, this._virtualStart = -1, this._virtualEnd = -1, this._virtualVisibleTotal = -1;
823
+ this._virtualTopSpacer?.isConnected && this._virtualTopSpacer.remove(), this._virtualBottomSpacer?.isConnected && this._virtualBottomSpacer.remove(), this._virtualTopSpacer = null, this._virtualBottomSpacer = null, this._virtualStart = -1, this._virtualEnd = -1, this._virtualVisibleTotal = -1;
827
824
  }
828
825
  _parseRowHeight() {
829
826
  const t = Number(this.getAttribute("row-height") || 44);
@@ -842,35 +839,31 @@ class z extends A {
842
839
  return a || (t === "loading" ? "Refreshing table data" : t === "error" ? "Table data could not be loaded" : t === "success" ? "Table data is up to date" : "");
843
840
  }
844
841
  _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;
846
- if (!t)
847
- return;
842
+ 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;
843
+ if (!t) return;
848
844
  const s = this._state();
849
845
  s !== "idle" ? t.removeAttribute("hidden") : t.setAttribute("hidden", ""), t.setAttribute("data-state", s), t.setAttribute("aria-live", s === "error" ? "assertive" : "polite");
850
846
  const n = this._stateText(s);
851
847
  a && (a.textContent = n), e && (e.textContent = this._stateText("loading"));
852
- const d = s === "loading" ? "true" : "false";
853
- i && i.setAttribute("aria-busy", d), r && r.setAttribute("aria-busy", d);
848
+ const u = s === "loading" ? "true" : "false";
849
+ r && r.setAttribute("aria-busy", u), i && i.setAttribute("aria-busy", u);
854
850
  }
855
851
  _isInteractionBlocked() {
856
852
  return this._state() === "loading";
857
853
  }
858
854
  _isInteractiveTarget(t) {
859
- if (!t)
860
- return !1;
855
+ if (!t) return !1;
861
856
  const a = t.closest(
862
857
  'button, a[href], input, select, textarea, label, summary, details, [contenteditable=""], [contenteditable="true"], [role="button"], [role="link"], [role="checkbox"], [role="switch"], [role="menuitem"]'
863
858
  );
864
859
  return !(!a || a.classList.contains("resize-handle"));
865
860
  }
866
861
  _headerKey(t, a) {
867
- if (!t)
868
- return `column-${a + 1}`;
862
+ if (!t) return `column-${a + 1}`;
869
863
  const e = (t.getAttribute("data-key") || "").trim();
870
- if (e)
871
- return e;
872
- const i = m(t);
873
- return i ? i.toLowerCase().replace(/\s+/g, "_") : `column-${a + 1}`;
864
+ if (e) return e;
865
+ const r = p(t);
866
+ return r ? r.toLowerCase().replace(/\s+/g, "_") : `column-${a + 1}`;
874
867
  }
875
868
  _currentColumnOrderString() {
876
869
  return this._headerCells().map((a, e) => this._headerKey(a, e)).join(",");
@@ -894,54 +887,44 @@ class z extends A {
894
887
  }
895
888
  _resolveFilterColumnIndex(t) {
896
889
  const a = (this.getAttribute("filter-column") || "").trim();
897
- if (!a)
898
- return -1;
890
+ if (!a) return -1;
899
891
  const e = Number(a);
900
892
  if (Number.isInteger(e) && e >= 0 && e < t.length)
901
893
  return e;
902
- const i = a.toLowerCase();
903
- for (let r = 0; r < t.length; r += 1) {
904
- const s = t[r], o = (s.getAttribute("data-key") || "").toLowerCase(), n = m(s).toLowerCase();
905
- if (o === i || n === i)
906
- return r;
894
+ const r = a.toLowerCase();
895
+ for (let i = 0; i < t.length; i += 1) {
896
+ const s = t[i], o = (s.getAttribute("data-key") || "").toLowerCase(), n = p(s).toLowerCase();
897
+ if (o === r || n === r) return i;
907
898
  }
908
899
  return -1;
909
900
  }
910
901
  _resolveColumnIndex(t, a) {
911
- if (typeof a == "number" && Number.isInteger(a) && a >= 0 && a < t.length)
912
- return a;
902
+ if (typeof a == "number" && Number.isInteger(a) && a >= 0 && a < t.length) return a;
913
903
  const e = String(a || "").trim();
914
- if (!e)
915
- return -1;
916
- const i = Number(e);
917
- if (Number.isInteger(i) && i >= 0 && i < t.length)
918
- return i;
919
- const r = e.toLowerCase();
904
+ if (!e) return -1;
905
+ const r = Number(e);
906
+ if (Number.isInteger(r) && r >= 0 && r < t.length) return r;
907
+ const i = e.toLowerCase();
920
908
  for (let s = 0; s < t.length; s += 1) {
921
- const o = t[s], n = (o.getAttribute("data-key") || "").toLowerCase(), d = m(o).toLowerCase();
922
- if (n === r || d === r || this._headerKey(o, s) === r)
923
- return s;
909
+ const o = t[s], n = (o.getAttribute("data-key") || "").toLowerCase(), u = p(o).toLowerCase();
910
+ if (n === i || u === i || this._headerKey(o, s) === i) return s;
924
911
  }
925
912
  return -1;
926
913
  }
927
914
  _parseFilters(t) {
928
915
  const a = this.getAttribute("filters");
929
- if (!a)
930
- return [];
916
+ if (!a) return [];
931
917
  try {
932
918
  const e = JSON.parse(a);
933
- if (!Array.isArray(e))
934
- return [];
935
- const i = [];
936
- return e.forEach((r) => {
937
- if (!r || typeof r != "object")
938
- return;
939
- const s = r.column ?? r.field ?? r.key, o = this._resolveColumnIndex(t, s);
940
- if (o < 0)
941
- return;
942
- const n = String(r.op || r.operator || "contains").trim().toLowerCase();
943
- i.push({ columnIndex: o, op: n, value: r.value });
944
- }), i;
919
+ if (!Array.isArray(e)) return [];
920
+ const r = [];
921
+ return e.forEach((i) => {
922
+ if (!i || typeof i != "object") return;
923
+ const s = i.column ?? i.field ?? i.key, o = this._resolveColumnIndex(t, s);
924
+ if (o < 0) return;
925
+ const n = String(i.op || i.operator || "contains").trim().toLowerCase();
926
+ r.push({ columnIndex: o, op: n, value: i.value });
927
+ }), r;
945
928
  } catch {
946
929
  return [];
947
930
  }
@@ -951,28 +934,27 @@ class z extends A {
951
934
  }
952
935
  _parsePinColumns(t) {
953
936
  const a = this.getAttribute("pin-columns");
954
- if (!a)
955
- return { left: [], right: [] };
956
- const e = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = (d, c) => {
957
- c.forEach((h) => {
958
- const l = this._resolveColumnIndex(t, h);
959
- l >= 0 && d.add(l);
937
+ if (!a) return { left: [], right: [] };
938
+ const e = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = (u, h) => {
939
+ h.forEach((l) => {
940
+ const d = this._resolveColumnIndex(t, l);
941
+ d >= 0 && u.add(d);
960
942
  });
961
943
  };
962
944
  try {
963
- const d = JSON.parse(a);
964
- if (d && typeof d == "object") {
965
- r(e, this._normalizePinTokens(d.left)), r(i, this._normalizePinTokens(d.right));
966
- const c = Array.from(e).sort((l, u) => l - u), h = Array.from(i).filter((l) => !e.has(l)).sort((l, u) => u - l);
967
- return { left: c, right: h };
945
+ const u = JSON.parse(a);
946
+ if (u && typeof u == "object") {
947
+ i(e, this._normalizePinTokens(u.left)), i(r, this._normalizePinTokens(u.right));
948
+ const h = Array.from(e).sort((d, c) => d - c), l = Array.from(r).filter((d) => !e.has(d)).sort((d, c) => c - d);
949
+ return { left: h, right: l };
968
950
  }
969
951
  } catch {
970
952
  }
971
- a.split(";").map((d) => d.trim()).filter(Boolean).forEach((d) => {
972
- const [c, h] = d.split(":"), l = (c || "").trim().toLowerCase(), u = this._normalizePinTokens(h || "");
973
- l === "left" && r(e, u), l === "right" && r(i, u);
953
+ a.split(";").map((u) => u.trim()).filter(Boolean).forEach((u) => {
954
+ const [h, l] = u.split(":"), d = (h || "").trim().toLowerCase(), c = this._normalizePinTokens(l || "");
955
+ d === "left" && i(e, c), d === "right" && i(r, c);
974
956
  });
975
- const o = Array.from(e).sort((d, c) => d - c), n = Array.from(i).filter((d) => !e.has(d)).sort((d, c) => c - d);
957
+ const o = Array.from(e).sort((u, h) => u - h), n = Array.from(r).filter((u) => !e.has(u)).sort((u, h) => h - u);
976
958
  return { left: o, right: n };
977
959
  }
978
960
  _setPageAttribute(t) {
@@ -980,17 +962,14 @@ class z extends A {
980
962
  this.getAttribute("page") !== String(a) && (this._isSettingPage = !0, this.setAttribute("page", String(a)), this._isSettingPage = !1);
981
963
  }
982
964
  _bodyRows() {
983
- if (!this._table)
984
- return [];
965
+ if (!this._table) return [];
985
966
  const t = this._table.tBodies[0];
986
967
  return t ? Array.from(t.rows).filter((a) => !this._isVirtualSpacerRow(a)) : [];
987
968
  }
988
969
  _headerCells() {
989
- var a;
990
- if (!this._table)
991
- return [];
992
- const t = (a = this._table.tHead) == null ? void 0 : a.rows[0];
993
- return t ? Array.from(t.cells).filter((e) => e.tagName.toLowerCase() === "th") : Array.from(this._table.querySelectorAll("th"));
970
+ if (!this._table) return [];
971
+ const t = this._table.tHead?.rows[0];
972
+ return t ? Array.from(t.cells).filter((a) => a.tagName.toLowerCase() === "th") : Array.from(this._table.querySelectorAll("th"));
994
973
  }
995
974
  _clearPinnedColumns() {
996
975
  this._table && this._table.querySelectorAll("[data-pinned]").forEach((t) => {
@@ -1000,101 +979,86 @@ class z extends A {
1000
979
  }
1001
980
  _resolveColumnWidth(t, a) {
1002
981
  const e = this._columnWidths.get(t);
1003
- if (typeof e == "number" && Number.isFinite(e))
1004
- return Math.max(1, e);
1005
- const i = (a == null ? void 0 : a.getBoundingClientRect().width) || (a == null ? void 0 : a.offsetWidth) || 0;
1006
- return Number.isFinite(i) && i > 0 ? i : 120;
982
+ if (typeof e == "number" && Number.isFinite(e)) return Math.max(1, e);
983
+ const r = a?.getBoundingClientRect().width || a?.offsetWidth || 0;
984
+ return Number.isFinite(r) && r > 0 ? r : 120;
1007
985
  }
1008
- _pinCell(t, a, e, i, r) {
1009
- 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");
986
+ _pinCell(t, a, e, r, i) {
987
+ 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");
1010
988
  }
1011
989
  _applyPinnedColumns() {
1012
- if (!this._table)
1013
- return;
990
+ if (!this._table) return;
1014
991
  this._clearPinnedColumns();
1015
992
  const t = this._headerCells();
1016
- if (!t.length)
1017
- return;
993
+ if (!t.length) return;
1018
994
  const { left: a, right: e } = this._parsePinColumns(t);
1019
- if (!a.length && !e.length)
1020
- return;
1021
- const i = Array.from(this._table.rows).filter((o) => !this._isVirtualSpacerRow(o));
1022
- let r = 0;
995
+ if (!a.length && !e.length) return;
996
+ const r = Array.from(this._table.rows).filter((o) => !this._isVirtualSpacerRow(o));
997
+ let i = 0;
1023
998
  a.forEach((o, n) => {
1024
- const d = this._resolveColumnWidth(o, t[o]), c = n === a.length - 1;
1025
- i.forEach((h, l) => {
1026
- const u = h.cells[o];
1027
- this._pinCell(u, "left", r, c, l === 0);
1028
- }), r += d;
999
+ const u = this._resolveColumnWidth(o, t[o]), h = n === a.length - 1;
1000
+ r.forEach((l, d) => {
1001
+ const c = l.cells[o];
1002
+ this._pinCell(c, "left", i, h, d === 0);
1003
+ }), i += u;
1029
1004
  });
1030
1005
  let s = 0;
1031
1006
  e.forEach((o, n) => {
1032
- const d = this._resolveColumnWidth(o, t[o]), c = n === e.length - 1;
1033
- i.forEach((h, l) => {
1034
- const u = h.cells[o];
1035
- this._pinCell(u, "right", s, c, l === 0);
1036
- }), s += d;
1007
+ const u = this._resolveColumnWidth(o, t[o]), h = n === e.length - 1;
1008
+ r.forEach((l, d) => {
1009
+ const c = l.cells[o];
1010
+ this._pinCell(c, "right", s, h, d === 0);
1011
+ }), s += u;
1037
1012
  });
1038
1013
  }
1039
1014
  _applyColumnOrder() {
1040
- var h;
1041
- if (!this._table)
1042
- return;
1015
+ if (!this._table) return;
1043
1016
  const t = (this.getAttribute("column-order") || "").trim();
1044
- if (!t)
1045
- return;
1046
- const a = (h = this._table.tHead) == null ? void 0 : h.rows[0], e = this._table.tBodies[0];
1047
- if (!a || !e)
1048
- return;
1049
- const i = Array.from(a.cells);
1050
- if (!i.length)
1051
- return;
1052
- const r = t.split(",").map((l) => l.trim()).filter(Boolean);
1053
- if (!r.length)
1054
- return;
1017
+ if (!t) return;
1018
+ const a = this._table.tHead?.rows[0], e = this._table.tBodies[0];
1019
+ if (!a || !e) return;
1020
+ const r = Array.from(a.cells);
1021
+ if (!r.length) return;
1022
+ const i = t.split(",").map((l) => l.trim()).filter(Boolean);
1023
+ if (!i.length) return;
1055
1024
  const s = [], o = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
1056
- i.forEach((l, u) => {
1057
- const b = (l.getAttribute("data-key") || m(l)).toLowerCase().trim();
1058
- b && n.set(b, u);
1025
+ r.forEach((l, d) => {
1026
+ const c = (l.getAttribute("data-key") || p(l)).toLowerCase().trim();
1027
+ c && n.set(c, d);
1059
1028
  });
1060
- for (const l of r) {
1061
- const u = Number(l);
1062
- if (Number.isInteger(u) && u >= 0 && u < i.length) {
1063
- o.has(u) || (o.add(u), s.push(u));
1029
+ for (const l of i) {
1030
+ const d = Number(l);
1031
+ if (Number.isInteger(d) && d >= 0 && d < r.length) {
1032
+ o.has(d) || (o.add(d), s.push(d));
1064
1033
  continue;
1065
1034
  }
1066
- const b = n.get(l.toLowerCase());
1067
- typeof b == "number" && !o.has(b) && (o.add(b), s.push(b));
1035
+ const c = n.get(l.toLowerCase());
1036
+ typeof c == "number" && !o.has(c) && (o.add(c), s.push(c));
1068
1037
  }
1069
- for (let l = 0; l < i.length; l += 1)
1038
+ for (let l = 0; l < r.length; l += 1)
1070
1039
  o.has(l) || s.push(l);
1071
- if (s.every((l, u) => l === u))
1072
- return;
1073
- s.map((l) => i[l]).forEach((l) => a.appendChild(l)), Array.from(e.rows).filter((l) => !this._isVirtualSpacerRow(l)).forEach((l) => {
1074
- const u = Array.from(l.cells);
1075
- s.map((f) => u[f]).filter(Boolean).forEach((f) => l.appendChild(f));
1040
+ if (s.every((l, d) => l === d)) return;
1041
+ s.map((l) => r[l]).forEach((l) => a.appendChild(l)), Array.from(e.rows).filter((l) => !this._isVirtualSpacerRow(l)).forEach((l) => {
1042
+ const d = Array.from(l.cells);
1043
+ s.map((f) => d[f]).filter(Boolean).forEach((f) => l.appendChild(f));
1076
1044
  }), this._columnWidths.clear();
1077
1045
  }
1078
1046
  _moveColumn(t, a) {
1079
- var h;
1080
- if (!this._table)
1081
- return !1;
1082
- const e = (h = this._table.tHead) == null ? void 0 : h.rows[0], i = this._table.tBodies[0];
1083
- if (!e || !i)
1084
- return !1;
1085
- const r = Array.from(e.cells), s = r.length;
1086
- if (!s || t < 0 || t >= s || a < 0 || a >= s || t === a)
1087
- return !1;
1088
- const o = Array.from({ length: s }, (l, u) => u), [n] = o.splice(t, 1);
1089
- 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) => {
1090
- const u = Array.from(l.cells);
1091
- o.map((f) => u[f]).filter(Boolean).forEach((f) => l.appendChild(f));
1047
+ if (!this._table) return !1;
1048
+ const e = this._table.tHead?.rows[0], r = this._table.tBodies[0];
1049
+ if (!e || !r) return !1;
1050
+ const i = Array.from(e.cells), s = i.length;
1051
+ if (!s || t < 0 || t >= s || a < 0 || a >= s || t === a) return !1;
1052
+ const o = Array.from({ length: s }, (l, d) => d), [n] = o.splice(t, 1);
1053
+ 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) => {
1054
+ const d = Array.from(l.cells);
1055
+ o.map((f) => d[f]).filter(Boolean).forEach((f) => l.appendChild(f));
1092
1056
  });
1093
- const c = /* @__PURE__ */ new Map();
1094
- return o.forEach((l, u) => {
1095
- const b = this._columnWidths.get(l);
1096
- typeof b == "number" && c.set(u, b);
1097
- }), this._columnWidths = c, this._sortColumnIndex >= 0 && (this._sortColumnIndex = o.indexOf(this._sortColumnIndex)), this._syncHeaderState(), this._applyPinnedColumns(), this._syncRowSelectionState(), !0;
1057
+ const h = /* @__PURE__ */ new Map();
1058
+ return o.forEach((l, d) => {
1059
+ const c = this._columnWidths.get(l);
1060
+ typeof c == "number" && h.set(d, c);
1061
+ }), this._columnWidths = h, this._sortColumnIndex >= 0 && (this._sortColumnIndex = o.indexOf(this._sortColumnIndex)), this._syncHeaderState(), this._applyPinnedColumns(), this._syncRowSelectionState(), !0;
1098
1062
  }
1099
1063
  _clearDragMarkers() {
1100
1064
  this._headerCells().forEach((a) => {
@@ -1109,7 +1073,7 @@ class z extends A {
1109
1073
  sourceIndex: t,
1110
1074
  targetIndex: a,
1111
1075
  order: e,
1112
- keys: this._headerCells().map((i, r) => this._headerKey(i, r))
1076
+ keys: this._headerCells().map((r, i) => this._headerKey(r, i))
1113
1077
  },
1114
1078
  bubbles: !0
1115
1079
  })
@@ -1120,15 +1084,14 @@ class z extends A {
1120
1084
  e && e.focus();
1121
1085
  }
1122
1086
  _focusSelectableRow(t, a) {
1123
- const e = this._bodyRows().filter((o) => !o.hidden), i = e.indexOf(t);
1124
- if (i < 0)
1125
- return;
1126
- const r = Math.min(e.length - 1, Math.max(0, i + a)), s = e[r];
1087
+ const e = this._bodyRows().filter((o) => !o.hidden), r = e.indexOf(t);
1088
+ if (r < 0) return;
1089
+ const i = Math.min(e.length - 1, Math.max(0, r + a)), s = e[i];
1127
1090
  s && s.focus();
1128
1091
  }
1129
1092
  _headerKeyboardShortcuts(t, a) {
1130
- const e = this._isRtl(), i = e ? "ArrowRight" : "ArrowLeft", r = e ? "ArrowLeft" : "ArrowRight", s = [i, r, "Home", "End"];
1131
- return t && s.push("Enter", "Space"), a && s.push(`Alt+${i}`, `Alt+${r}`), s.join(" ");
1093
+ const e = this._isRtl(), r = e ? "ArrowRight" : "ArrowLeft", i = e ? "ArrowLeft" : "ArrowRight", s = [r, i, "Home", "End"];
1094
+ return t && s.push("Enter", "Space"), a && s.push(`Alt+${r}`, `Alt+${i}`), s.join(" ");
1132
1095
  }
1133
1096
  _syncStructure() {
1134
1097
  if (!this._isSyncing) {
@@ -1149,14 +1112,14 @@ class z extends A {
1149
1112
  }
1150
1113
  }
1151
1114
  _syncHeaderState() {
1152
- const t = this.hasAttribute("sortable"), a = this.hasAttribute("draggable-columns"), e = this.hasAttribute("resizable-columns"), i = this._headerKeyboardShortcuts(t, a);
1115
+ const t = this.hasAttribute("sortable"), a = this.hasAttribute("draggable-columns"), e = this.hasAttribute("resizable-columns"), r = this._headerKeyboardShortcuts(t, a);
1153
1116
  this._headerCells().forEach((s, o) => {
1154
- 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) {
1117
+ 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) {
1155
1118
  s.setAttribute("data-resizable", "true");
1156
1119
  let n = s.querySelector(".resize-handle");
1157
1120
  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));
1158
- const d = this._columnWidths.get(o);
1159
- typeof d == "number" && this._setColumnWidth(o, d, !1);
1121
+ const u = this._columnWidths.get(o);
1122
+ typeof u == "number" && this._setColumnWidth(o, u, !1);
1160
1123
  } else {
1161
1124
  s.removeAttribute("data-resizable");
1162
1125
  const n = s.querySelector(".resize-handle");
@@ -1165,29 +1128,28 @@ class z extends A {
1165
1128
  });
1166
1129
  }
1167
1130
  _applyPagination(t) {
1168
- var l;
1169
1131
  const a = this._bodyRows();
1170
1132
  this._pageSize = this._parsePageSize(), this._totalRows = a.length;
1171
- const e = this._parseFilterQuery(), i = this._headerCells(), r = this._resolveFilterColumnIndex(i), s = this._parseFilters(i), o = a.filter((u) => this._rowMatchesFilter(u, e, r, s));
1172
- this._filteredRows = o.length, (l = this._table) == null || l.setAttribute("aria-rowcount", String(this._filteredRows));
1133
+ 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));
1134
+ this._filteredRows = o.length, this._table?.setAttribute("aria-rowcount", String(this._filteredRows));
1173
1135
  const n = this._parsePage();
1174
1136
  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);
1175
- const d = (this._page - 1) * this._pageSize, c = d + this._pageSize, h = new Set(o);
1176
- if (a.forEach((u) => {
1177
- h.has(u) ? u.removeAttribute("data-hidden-by-filter") : (u.hidden = !0, u.setAttribute("data-hidden-by-filter", ""), u.removeAttribute("data-hidden-by-page"), u.removeAttribute("aria-rowindex"));
1178
- }), o.forEach((u, b) => {
1179
- const f = b >= d && b < c;
1180
- u.hidden = !f, f ? u.removeAttribute("data-hidden-by-page") : u.setAttribute("data-hidden-by-page", ""), u.setAttribute("aria-rowindex", String(b + 1));
1137
+ const u = (this._page - 1) * this._pageSize, h = u + this._pageSize, l = new Set(o);
1138
+ if (a.forEach((d) => {
1139
+ 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"));
1140
+ }), o.forEach((d, c) => {
1141
+ const f = c >= u && c < h;
1142
+ d.hidden = !f, f ? d.removeAttribute("data-hidden-by-page") : d.setAttribute("data-hidden-by-page", ""), d.setAttribute("aria-rowindex", String(c + 1));
1181
1143
  }), t) {
1182
- const u = o.length, b = u === 0 ? 0 : d + 1, f = Math.min(c, u);
1144
+ const d = o.length, c = d === 0 ? 0 : u + 1, f = Math.min(h, d);
1183
1145
  this.dispatchEvent(
1184
1146
  new CustomEvent("page-change", {
1185
1147
  detail: {
1186
1148
  page: this._page,
1187
1149
  count: this._pageCount,
1188
1150
  pageSize: this._pageSize,
1189
- total: u,
1190
- start: b,
1151
+ total: d,
1152
+ start: c,
1191
1153
  end: f
1192
1154
  },
1193
1155
  bubbles: !0
@@ -1201,70 +1163,65 @@ class z extends A {
1201
1163
  });
1202
1164
  }
1203
1165
  _ensureVirtualSpacer(t) {
1204
- if (!this._table)
1205
- return null;
1166
+ if (!this._table) return null;
1206
1167
  const a = this._table.tBodies[0];
1207
- if (!a)
1208
- return null;
1168
+ if (!a) return null;
1209
1169
  const e = t === "top" ? this._virtualTopSpacer : this._virtualBottomSpacer;
1210
- if (e && e.isConnected)
1211
- return e;
1212
- const i = document.createElement("tr");
1213
- i.setAttribute("data-virtual-spacer", t), i.setAttribute("aria-hidden", "true"), i.setAttribute("role", "presentation"), i.style.pointerEvents = "none";
1214
- const r = document.createElement("td");
1215
- 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;
1170
+ if (e && e.isConnected) return e;
1171
+ const r = document.createElement("tr");
1172
+ r.setAttribute("data-virtual-spacer", t), r.setAttribute("aria-hidden", "true"), r.setAttribute("role", "presentation"), r.style.pointerEvents = "none";
1173
+ const i = document.createElement("td");
1174
+ 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;
1216
1175
  }
1217
1176
  _setVirtualSpacerHeight(t, a, e) {
1218
- if (!t)
1219
- return;
1220
- const i = t.cells[0] || t.appendChild(document.createElement("td"));
1221
- 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";
1177
+ if (!t) return;
1178
+ const r = t.cells[0] || t.appendChild(document.createElement("td"));
1179
+ 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";
1222
1180
  }
1223
1181
  _applyVirtualization(t) {
1224
- var w;
1225
1182
  if (!this.hasAttribute("virtualize") || !this._frameEl || !this._table) {
1226
1183
  this._clearVirtualization(!0);
1227
1184
  return;
1228
1185
  }
1229
- const e = this._bodyRows().filter((p) => !p.hidden);
1186
+ const e = this._bodyRows().filter((g) => !g.hidden);
1230
1187
  if (!e.length) {
1231
1188
  this._clearVirtualization(!0);
1232
1189
  return;
1233
1190
  }
1234
- 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), d = Math.min(e.length, Math.ceil((o + s) / i) + r), c = n * i, h = Math.max(0, (e.length - d) * i), l = Math.max(1, this._headerCells().length || ((w = e[0]) == null ? void 0 : w.cells.length) || 1), u = this._ensureVirtualSpacer("top"), b = this._ensureVirtualSpacer("bottom");
1235
- this._setVirtualSpacerHeight(u, c, l), this._setVirtualSpacerHeight(b, h, l);
1236
- const f = (p, y) => {
1237
- y ? (p.style.display === "none" && (p.style.display = ""), p.removeAttribute("data-hidden-by-virtual")) : (p.style.display !== "none" && (p.style.display = "none"), p.setAttribute("data-hidden-by-virtual", ""));
1191
+ 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), h = n * r, l = Math.max(0, (e.length - u) * r), d = Math.max(1, this._headerCells().length || e[0]?.cells.length || 1), c = this._ensureVirtualSpacer("top"), f = this._ensureVirtualSpacer("bottom");
1192
+ this._setVirtualSpacerHeight(c, h, d), this._setVirtualSpacerHeight(f, l, d);
1193
+ const y = (g, v) => {
1194
+ 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", ""));
1238
1195
  };
1239
1196
  if (!(this._virtualStart >= 0 && this._virtualEnd >= this._virtualStart && this._virtualVisibleTotal === e.length))
1240
- e.forEach((p, y) => {
1241
- f(p, y >= n && y < d);
1197
+ e.forEach((g, v) => {
1198
+ y(g, v >= n && v < u);
1242
1199
  });
1243
1200
  else {
1244
- const p = this._virtualStart, y = this._virtualEnd;
1245
- for (let g = p; g < Math.min(n, y); g += 1) {
1246
- const v = e[g];
1247
- v && f(v, !1);
1201
+ const g = this._virtualStart, v = this._virtualEnd;
1202
+ for (let b = g; b < Math.min(n, v); b += 1) {
1203
+ const _ = e[b];
1204
+ _ && y(_, !1);
1248
1205
  }
1249
- for (let g = n; g < Math.min(p, d); g += 1) {
1250
- const v = e[g];
1251
- v && f(v, !0);
1206
+ for (let b = n; b < Math.min(g, u); b += 1) {
1207
+ const _ = e[b];
1208
+ _ && y(_, !0);
1252
1209
  }
1253
- for (let g = Math.max(d, p); g < y; g += 1) {
1254
- const v = e[g];
1255
- v && f(v, !1);
1210
+ for (let b = Math.max(u, g); b < v; b += 1) {
1211
+ const _ = e[b];
1212
+ _ && y(_, !1);
1256
1213
  }
1257
- for (let g = Math.max(y, n); g < d; g += 1) {
1258
- const v = e[g];
1259
- v && f(v, !0);
1214
+ for (let b = Math.max(v, n); b < u; b += 1) {
1215
+ const _ = e[b];
1216
+ _ && y(_, !0);
1260
1217
  }
1261
1218
  }
1262
- this._virtualStart = n, this._virtualEnd = d, this._virtualVisibleTotal = e.length, t && this.dispatchEvent(
1219
+ this._virtualStart = n, this._virtualEnd = u, this._virtualVisibleTotal = e.length, t && this.dispatchEvent(
1263
1220
  new CustomEvent("virtual-range-change", {
1264
1221
  detail: {
1265
1222
  start: n,
1266
- end: Math.max(n, d - 1),
1267
- visible: Math.max(0, d - n),
1223
+ end: Math.max(n, u - 1),
1224
+ visible: Math.max(0, u - n),
1268
1225
  total: e.length
1269
1226
  },
1270
1227
  bubbles: !0
@@ -1273,24 +1230,22 @@ class z extends A {
1273
1230
  }
1274
1231
  _updateSummary() {
1275
1232
  const t = this.root.querySelector(".summary");
1276
- if (!t)
1277
- return;
1233
+ if (!t) return;
1278
1234
  const a = this._totalRows, e = this._filteredRows;
1279
1235
  if (!a || !e) {
1280
1236
  t.textContent = "No records";
1281
1237
  return;
1282
1238
  }
1283
- const i = (this._page - 1) * this._pageSize + 1, r = Math.min(this._page * this._pageSize, e);
1239
+ const r = (this._page - 1) * this._pageSize + 1, i = Math.min(this._page * this._pageSize, e);
1284
1240
  if (e === a) {
1285
- t.textContent = `Showing ${i}-${r} of ${a}`;
1241
+ t.textContent = `Showing ${r}-${i} of ${a}`;
1286
1242
  return;
1287
1243
  }
1288
- t.textContent = `Showing ${i}-${r} of ${e} filtered records (${a} total)`;
1244
+ t.textContent = `Showing ${r}-${i} of ${e} filtered records (${a} total)`;
1289
1245
  }
1290
1246
  _syncEmptyText() {
1291
1247
  const t = this.root.querySelector(".empty");
1292
- if (!t)
1293
- return;
1248
+ if (!t) return;
1294
1249
  const a = !!this._parseFilterQuery();
1295
1250
  if (this._table && this._filteredRows === 0 && a) {
1296
1251
  t.textContent = "No matching records.";
@@ -1318,104 +1273,86 @@ class z extends A {
1318
1273
  return /^-?\d+(\.\d+)?$/.test(a) ? Number(a) : t.toLowerCase();
1319
1274
  }
1320
1275
  _rulePasses(t, a) {
1321
- const e = a.op, i = a.value, r = t.trim(), s = r.toLowerCase();
1322
- if (e === "empty")
1323
- return r.length === 0;
1324
- if (e === "notempty" || e === "not-empty")
1325
- return r.length > 0;
1326
- if (e === "equals" || e === "eq")
1327
- return s === String(i ?? "").toLowerCase();
1328
- if (e === "neq" || e === "not-equals")
1329
- return s !== String(i ?? "").toLowerCase();
1330
- if (e === "startswith" || e === "starts-with")
1331
- return s.startsWith(String(i ?? "").toLowerCase());
1332
- if (e === "endswith" || e === "ends-with")
1333
- return s.endsWith(String(i ?? "").toLowerCase());
1276
+ const e = a.op, r = a.value, i = t.trim(), s = i.toLowerCase();
1277
+ if (e === "empty") return i.length === 0;
1278
+ if (e === "notempty" || e === "not-empty") return i.length > 0;
1279
+ if (e === "equals" || e === "eq") return s === String(r ?? "").toLowerCase();
1280
+ if (e === "neq" || e === "not-equals") return s !== String(r ?? "").toLowerCase();
1281
+ if (e === "startswith" || e === "starts-with") return s.startsWith(String(r ?? "").toLowerCase());
1282
+ if (e === "endswith" || e === "ends-with") return s.endsWith(String(r ?? "").toLowerCase());
1334
1283
  if (e === "in")
1335
- return (Array.isArray(i) ? i.map((n) => String(n).toLowerCase()) : String(i ?? "").split(",").map((n) => n.trim().toLowerCase()).filter(Boolean)).includes(s);
1284
+ return (Array.isArray(r) ? r.map((n) => String(n).toLowerCase()) : String(r ?? "").split(",").map((n) => n.trim().toLowerCase()).filter(Boolean)).includes(s);
1336
1285
  if (e === "gt" || e === "gte" || e === "lt" || e === "lte" || e === "between") {
1337
- const o = this._parseComparable(r);
1338
- if (typeof o != "number")
1339
- return !1;
1286
+ const o = this._parseComparable(i);
1287
+ if (typeof o != "number") return !1;
1340
1288
  if (e === "between") {
1341
- const d = Array.isArray(i) ? i : String(i ?? "").split(","), c = Number(d[0]), h = Number(d[1]);
1342
- return !Number.isFinite(c) || !Number.isFinite(h) ? !1 : o >= Math.min(c, h) && o <= Math.max(c, h);
1289
+ const u = Array.isArray(r) ? r : String(r ?? "").split(","), h = Number(u[0]), l = Number(u[1]);
1290
+ return !Number.isFinite(h) || !Number.isFinite(l) ? !1 : o >= Math.min(h, l) && o <= Math.max(h, l);
1343
1291
  }
1344
- const n = Number(i);
1292
+ const n = Number(r);
1345
1293
  return Number.isFinite(n) ? e === "gt" ? o > n : e === "gte" ? o >= n : e === "lt" ? o < n : o <= n : !1;
1346
1294
  }
1347
- return s.includes(String(i ?? "").toLowerCase());
1295
+ return s.includes(String(r ?? "").toLowerCase());
1348
1296
  }
1349
- _rowMatchesFilter(t, a, e, i) {
1297
+ _rowMatchesFilter(t, a, e, r) {
1350
1298
  if (a) {
1351
- const r = e >= 0 ? m(t.cells[e]) : Array.from(t.cells).map((n) => m(n)).join(" ");
1352
- if (!r)
1353
- return !1;
1354
- const s = r.toLowerCase(), o = a.split(/\s+/).filter(Boolean);
1355
- if (o.length && !o.every((n) => s.includes(n)))
1356
- return !1;
1299
+ const i = e >= 0 ? p(t.cells[e]) : Array.from(t.cells).map((n) => p(n)).join(" ");
1300
+ if (!i) return !1;
1301
+ const s = i.toLowerCase(), o = a.split(/\s+/).filter(Boolean);
1302
+ if (o.length && !o.every((n) => s.includes(n))) return !1;
1357
1303
  }
1358
- return i.length ? i.every((r) => {
1359
- const s = t.cells[r.columnIndex];
1360
- return this._rulePasses(m(s), r);
1304
+ return r.length ? r.every((i) => {
1305
+ const s = t.cells[i.columnIndex];
1306
+ return this._rulePasses(p(s), i);
1361
1307
  }) : !0;
1362
1308
  }
1363
1309
  _setColumnWidth(t, a, e = !0) {
1364
- if (!this._table)
1365
- return;
1366
- const i = Math.max(72, Math.round(a));
1367
- if (this._columnWidths.set(t, i), Array.from(this._table.rows).forEach((o) => {
1310
+ if (!this._table) return;
1311
+ const r = Math.max(72, Math.round(a));
1312
+ if (this._columnWidths.set(t, r), Array.from(this._table.rows).forEach((o) => {
1368
1313
  const n = o.cells[t];
1369
- n && (n.style.width = `${i}px`, n.style.minWidth = `${i}px`, n.style.maxWidth = `${i}px`, n.style.boxSizing = "border-box");
1370
- }), !e)
1371
- return;
1314
+ n && (n.style.width = `${r}px`, n.style.minWidth = `${r}px`, n.style.maxWidth = `${r}px`, n.style.boxSizing = "border-box");
1315
+ }), !e) return;
1372
1316
  this._applyPinnedColumns();
1373
1317
  const s = this._headerCells()[t];
1374
1318
  this.dispatchEvent(
1375
1319
  new CustomEvent("column-resize", {
1376
1320
  detail: {
1377
1321
  columnIndex: t,
1378
- key: (s == null ? void 0 : s.getAttribute("data-key")) || m(s) || `column-${t + 1}`,
1379
- width: i
1322
+ key: s?.getAttribute("data-key") || p(s) || `column-${t + 1}`,
1323
+ width: r
1380
1324
  },
1381
1325
  bubbles: !0
1382
1326
  })
1383
1327
  );
1384
1328
  }
1385
1329
  _onPointerDown(t) {
1386
- if (!this.hasAttribute("resizable-columns") || !this._table)
1387
- return;
1330
+ if (!this.hasAttribute("resizable-columns") || !this._table) return;
1388
1331
  const e = t.target.closest(".resize-handle");
1389
- if (!e || !this._table.contains(e))
1390
- return;
1391
- const i = Number(e.getAttribute("data-col-index"));
1392
- if (!Number.isInteger(i) || i < 0)
1393
- return;
1394
- const r = this._headerCells()[i];
1395
- if (!r)
1396
- return;
1332
+ if (!e || !this._table.contains(e)) return;
1333
+ const r = Number(e.getAttribute("data-col-index"));
1334
+ if (!Number.isInteger(r) || r < 0) return;
1335
+ const i = this._headerCells()[r];
1336
+ if (!i) return;
1397
1337
  t.preventDefault();
1398
- const s = r.getBoundingClientRect().width;
1338
+ const s = i.getBoundingClientRect().width;
1399
1339
  this._resizeState = {
1400
- columnIndex: i,
1340
+ columnIndex: r,
1401
1341
  startX: t.clientX,
1402
1342
  startWidth: s
1403
1343
  }, window.addEventListener("pointermove", this._onPointerMove), window.addEventListener("pointerup", this._onPointerUp);
1404
1344
  }
1405
1345
  _onPointerMove(t) {
1406
- if (!this._resizeState)
1407
- return;
1346
+ if (!this._resizeState) return;
1408
1347
  const a = t.clientX - this._resizeState.startX, e = this._isRtl() ? -a : a;
1409
1348
  this._pendingResizeColumn = this._resizeState.columnIndex, this._pendingResizeWidth = this._resizeState.startWidth + e, this._setColumnWidth(this._pendingResizeColumn, this._pendingResizeWidth, !1);
1410
1349
  }
1411
1350
  _onPointerUp() {
1412
- if (!this._resizeState)
1413
- return;
1351
+ if (!this._resizeState) return;
1414
1352
  const t = this._resizeState;
1415
1353
  this._resizeState = null, this._resizeRaf && (cancelAnimationFrame(this._resizeRaf), this._resizeRaf = 0), this._pendingResizeColumn === t.columnIndex && this._pendingResizeWidth != null && this._setColumnWidth(t.columnIndex, this._pendingResizeWidth, !1), this._pendingResizeColumn = -1, this._pendingResizeWidth = null, window.removeEventListener("pointermove", this._onPointerMove), window.removeEventListener("pointerup", this._onPointerUp);
1416
1354
  const a = this._headerCells()[t.columnIndex];
1417
- if (!a)
1418
- return;
1355
+ if (!a) return;
1419
1356
  const e = a.getBoundingClientRect().width;
1420
1357
  this._setColumnWidth(t.columnIndex, e, !0);
1421
1358
  }
@@ -1425,74 +1362,66 @@ class z extends A {
1425
1362
  })));
1426
1363
  }
1427
1364
  _onDragStart(t) {
1428
- if (!this.hasAttribute("draggable-columns") || !this._table)
1429
- return;
1365
+ if (!this.hasAttribute("draggable-columns") || !this._table) return;
1430
1366
  const a = t.target;
1431
1367
  if (a.closest(".resize-handle")) {
1432
1368
  t.preventDefault();
1433
1369
  return;
1434
1370
  }
1435
1371
  const e = a.closest("th");
1436
- if (!e || !this._table.contains(e))
1437
- return;
1438
- const r = this._headerCells().indexOf(e);
1439
- 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))));
1372
+ if (!e || !this._table.contains(e)) return;
1373
+ const i = this._headerCells().indexOf(e);
1374
+ 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))));
1440
1375
  }
1441
1376
  _onDragOver(t) {
1442
- if (!this.hasAttribute("draggable-columns") || !this._table || this._dragColumnIndex < 0)
1443
- return;
1377
+ if (!this.hasAttribute("draggable-columns") || !this._table || this._dragColumnIndex < 0) return;
1444
1378
  const e = t.target.closest("th");
1445
- if (!e || !this._table.contains(e))
1446
- return;
1447
- const i = this._headerCells(), r = i.indexOf(e);
1448
- if (r < 0 || (t.preventDefault(), this._dragOverColumnIndex === r))
1449
- return;
1450
- this._clearDragMarkers(), this._dragOverColumnIndex = r, e.setAttribute("data-drag-over", "true");
1451
- const s = i[this._dragColumnIndex];
1379
+ if (!e || !this._table.contains(e)) return;
1380
+ const r = this._headerCells(), i = r.indexOf(e);
1381
+ if (i < 0 || (t.preventDefault(), this._dragOverColumnIndex === i)) return;
1382
+ this._clearDragMarkers(), this._dragOverColumnIndex = i, e.setAttribute("data-drag-over", "true");
1383
+ const s = r[this._dragColumnIndex];
1452
1384
  s && s.setAttribute("data-dragging", "true");
1453
1385
  }
1454
1386
  _onDrop(t) {
1455
- if (!this.hasAttribute("draggable-columns") || !this._table || this._dragColumnIndex < 0)
1456
- return;
1387
+ if (!this.hasAttribute("draggable-columns") || !this._table || this._dragColumnIndex < 0) return;
1457
1388
  const e = t.target.closest("th");
1458
- if (!e || !this._table.contains(e))
1459
- return;
1460
- const r = this._headerCells().indexOf(e);
1461
- if (r < 0)
1462
- return;
1389
+ if (!e || !this._table.contains(e)) return;
1390
+ const i = this._headerCells().indexOf(e);
1391
+ if (i < 0) return;
1463
1392
  t.preventDefault();
1464
- const s = this._dragColumnIndex, o = this._moveColumn(s, r);
1465
- this._clearDragMarkers(), this._dragColumnIndex = -1, this._ignoreHeaderClickUntil = Date.now() + 220, o && (this._applyVirtualization(!1), this._emitColumnOrderChange(s, r));
1393
+ const s = this._dragColumnIndex, o = this._moveColumn(s, i);
1394
+ this._clearDragMarkers(), this._dragColumnIndex = -1, this._ignoreHeaderClickUntil = Date.now() + 220, o && (this._applyVirtualization(!1), this._emitColumnOrderChange(s, i));
1466
1395
  }
1467
1396
  _onDragEnd() {
1468
1397
  this._clearDragMarkers(), this._dragColumnIndex = -1;
1469
1398
  }
1470
1399
  _rowValues(t) {
1471
- const a = this._headerCells(), e = Array.from(t.cells), i = {};
1472
- return e.forEach((r, s) => {
1473
- const o = a[s], n = ((o == null ? void 0 : o.getAttribute("data-key")) || m(o || void 0) || `col_${s + 1}`).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
1474
- i[n || `col_${s + 1}`] = m(r);
1475
- }), i;
1400
+ const a = this._headerCells(), e = Array.from(t.cells), r = {};
1401
+ return e.forEach((i, s) => {
1402
+ const o = a[s], n = (o?.getAttribute("data-key") || p(o || void 0) || `col_${s + 1}`).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
1403
+ r[n || `col_${s + 1}`] = p(i);
1404
+ }), r;
1476
1405
  }
1477
1406
  _syncRowSelectionState() {
1478
1407
  const t = this.hasAttribute("selectable"), a = this._bodyRows();
1479
1408
  for (const e of Array.from(this._selectedRows))
1480
1409
  a.includes(e) || this._selectedRows.delete(e);
1481
1410
  a.forEach((e) => {
1482
- const i = !e.hidden;
1483
- 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"));
1411
+ const r = !e.hidden;
1412
+ 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"));
1484
1413
  });
1485
1414
  }
1486
1415
  _toggleRowSelection(t) {
1487
1416
  const a = this.hasAttribute("multi-select"), e = this._selectedRows.has(t);
1488
1417
  a || this._selectedRows.clear(), e && a ? this._selectedRows.delete(t) : this._selectedRows.add(t), this._syncRowSelectionState(), this._updateBulkActions();
1489
- 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));
1418
+ 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));
1490
1419
  this.dispatchEvent(
1491
1420
  new CustomEvent("row-select", {
1492
1421
  detail: {
1493
- index: i.indexOf(t),
1422
+ index: r.indexOf(t),
1494
1423
  selected: this._selectedRows.has(t),
1495
- indices: r,
1424
+ indices: i,
1496
1425
  rows: s,
1497
1426
  page: this._page
1498
1427
  },
@@ -1501,21 +1430,19 @@ class z extends A {
1501
1430
  );
1502
1431
  }
1503
1432
  _sortByColumn(t, a) {
1504
- if (!this._table)
1505
- return;
1433
+ if (!this._table) return;
1506
1434
  const e = this._table.tBodies[0];
1507
- if (!e)
1508
- return;
1435
+ if (!e) return;
1509
1436
  this._sortColumnIndex === t ? this._sortDirection = this._sortDirection === "asc" ? "desc" : "asc" : (this._sortColumnIndex = t, this._sortDirection = "asc"), Array.from(e.rows).filter((o) => !this._isVirtualSpacerRow(o)).map((o, n) => ({
1510
1437
  row: o,
1511
1438
  rowIndex: n,
1512
- value: k(m(o.cells[t]))
1439
+ value: S(p(o.cells[t]))
1513
1440
  })).sort((o, n) => {
1514
- const d = o.value, c = n.value;
1515
- let h = 0;
1516
- return typeof d == "number" && typeof c == "number" ? h = d - c : h = String(d).localeCompare(String(c), void 0, { numeric: !0, sensitivity: "base" }), h === 0 && (h = o.rowIndex - n.rowIndex), this._sortDirection === "asc" ? h : -h;
1441
+ const u = o.value, h = n.value;
1442
+ let l = 0;
1443
+ 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;
1517
1444
  }).map((o) => o.row).forEach((o) => e.appendChild(o)), this._syncHeaderState(), this._applyPagination(!1), this._syncRowSelectionState(), this._updateSummary(), this._syncPaginationElement();
1518
- const s = a.getAttribute("data-key") || m(a) || `column-${t + 1}`;
1445
+ const s = a.getAttribute("data-key") || p(a) || `column-${t + 1}`;
1519
1446
  this.dispatchEvent(
1520
1447
  new CustomEvent("sort-change", {
1521
1448
  detail: {
@@ -1534,8 +1461,7 @@ class z extends A {
1534
1461
  _syncPaginationBinding() {
1535
1462
  this._detachPaginationListener();
1536
1463
  const t = this.getAttribute("pagination-id");
1537
- if (!t)
1538
- return;
1464
+ if (!t) return;
1539
1465
  const a = document.getElementById(t);
1540
1466
  a && (this._paginationEl = a, this._paginationEl.addEventListener("change", this._onPaginationChange), this._syncPaginationElement());
1541
1467
  }
@@ -1543,86 +1469,79 @@ class z extends A {
1543
1469
  this._paginationEl && (this._paginationEl.setAttribute("count", String(this._pageCount || 1)), this._paginationEl.setAttribute("page", String(this._page || 1)));
1544
1470
  }
1545
1471
  _onPaginationChange(t) {
1546
- const a = t.detail, e = Number(a == null ? void 0 : a.page);
1472
+ const a = t.detail, e = Number(a?.page);
1547
1473
  Number.isFinite(e) && e !== this._page && (this._setPageAttribute(e), this._applyPagination(!0), this._syncRowSelectionState(), this._updateSummary(), this._syncPaginationElement());
1548
1474
  }
1549
1475
  _onClick(t) {
1550
- if (!this._table)
1551
- return;
1552
- const e = t.composedPath().find((r) => r instanceof HTMLElement) || t.target;
1476
+ if (!this._table) return;
1477
+ const e = t.composedPath().find((i) => i instanceof HTMLElement) || t.target;
1553
1478
  if (e.closest(".bulk-clear")) {
1554
- const r = this._selectedRows.size;
1555
- r > 0 && (this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: r, page: this._page }, bubbles: !0 })));
1479
+ const i = this._selectedRows.size;
1480
+ i > 0 && (this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: i, page: this._page }, bubbles: !0 })));
1556
1481
  return;
1557
1482
  }
1558
1483
  if (!e.closest(".resize-handle") && !(e.closest("th") && Date.now() < this._ignoreHeaderClickUntil) && !this._isInteractionBlocked()) {
1559
1484
  if (this.hasAttribute("sortable")) {
1560
- const r = e.closest("th");
1561
- if (r && this._table.contains(r)) {
1562
- if (e !== r && this._isInteractiveTarget(e))
1563
- return;
1564
- const o = this._headerCells().indexOf(r);
1485
+ const i = e.closest("th");
1486
+ if (i && this._table.contains(i)) {
1487
+ if (e !== i && this._isInteractiveTarget(e)) return;
1488
+ const o = this._headerCells().indexOf(i);
1565
1489
  if (o >= 0) {
1566
- this._sortByColumn(o, r);
1490
+ this._sortByColumn(o, i);
1567
1491
  return;
1568
1492
  }
1569
1493
  }
1570
1494
  }
1571
1495
  if (this.hasAttribute("selectable")) {
1572
- const r = e.closest("tbody tr");
1573
- if (r && this._table.contains(r) && !r.hidden && !this._isVirtualSpacerRow(r)) {
1574
- if (e !== r && this._isInteractiveTarget(e))
1575
- return;
1576
- this._toggleRowSelection(r);
1496
+ const i = e.closest("tbody tr");
1497
+ if (i && this._table.contains(i) && !i.hidden && !this._isVirtualSpacerRow(i)) {
1498
+ if (e !== i && this._isInteractiveTarget(e)) return;
1499
+ this._toggleRowSelection(i);
1577
1500
  }
1578
1501
  }
1579
1502
  }
1580
1503
  }
1581
1504
  _onKeyDown(t) {
1582
- if (!this._table)
1583
- return;
1505
+ if (!this._table) return;
1584
1506
  const a = t.key, e = t.target;
1585
1507
  if (a === "Escape" && this._selectedRows.size) {
1586
- const r = this._selectedRows.size;
1587
- this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: r, page: this._page }, bubbles: !0 }));
1508
+ const i = this._selectedRows.size;
1509
+ this._selectedRows.clear(), this._syncRowSelectionState(), this._updateBulkActions(), this.dispatchEvent(new CustomEvent("bulk-clear", { detail: { count: i, page: this._page }, bubbles: !0 }));
1588
1510
  return;
1589
1511
  }
1590
- if (this._isInteractionBlocked())
1591
- return;
1592
- const i = e.closest("th");
1593
- if (i && this._table.contains(i)) {
1594
- const r = this._headerCells(), s = r.indexOf(i);
1512
+ if (this._isInteractionBlocked()) return;
1513
+ const r = e.closest("th");
1514
+ if (r && this._table.contains(r)) {
1515
+ const i = this._headerCells(), s = i.indexOf(r);
1595
1516
  if (s >= 0) {
1596
- const n = this._isRtl() ? -1 : 1, d = -n;
1517
+ const n = this._isRtl() ? -1 : 1, u = -n;
1597
1518
  if (a === "ArrowRight" || a === "ArrowLeft") {
1598
1519
  t.preventDefault();
1599
- const c = a === "ArrowRight" ? n : d, h = Math.max(0, Math.min(r.length - 1, s + c));
1600
- if (t.altKey && this.hasAttribute("draggable-columns") && h !== s) {
1601
- this._moveColumn(s, h) && (this._ignoreHeaderClickUntil = Date.now() + 220, this._emitColumnOrderChange(s, h), this._applyVirtualization(!1), this._focusHeaderAt(h));
1520
+ const h = a === "ArrowRight" ? n : u, l = Math.max(0, Math.min(i.length - 1, s + h));
1521
+ if (t.altKey && this.hasAttribute("draggable-columns") && l !== s) {
1522
+ this._moveColumn(s, l) && (this._ignoreHeaderClickUntil = Date.now() + 220, this._emitColumnOrderChange(s, l), this._applyVirtualization(!1), this._focusHeaderAt(l));
1602
1523
  return;
1603
1524
  }
1604
- this._focusHeaderAt(h);
1525
+ this._focusHeaderAt(l);
1605
1526
  return;
1606
1527
  }
1607
1528
  if (a === "Home" || a === "End") {
1608
- t.preventDefault(), this._focusHeaderAt(a === "Home" ? 0 : r.length - 1);
1529
+ t.preventDefault(), this._focusHeaderAt(a === "Home" ? 0 : i.length - 1);
1609
1530
  return;
1610
1531
  }
1611
1532
  if ((a === "Enter" || a === " ") && this.hasAttribute("sortable")) {
1612
- if (e !== i && this._isInteractiveTarget(e))
1613
- return;
1614
- t.preventDefault(), this._sortByColumn(s, i);
1533
+ if (e !== r && this._isInteractiveTarget(e)) return;
1534
+ t.preventDefault(), this._sortByColumn(s, r);
1615
1535
  return;
1616
1536
  }
1617
1537
  }
1618
1538
  }
1619
1539
  if (this.hasAttribute("selectable")) {
1620
- const r = e.closest("tbody tr");
1621
- if (r && this._table.contains(r) && !r.hidden && !this._isVirtualSpacerRow(r)) {
1622
- if (e !== r && this._isInteractiveTarget(e))
1623
- return;
1540
+ const i = e.closest("tbody tr");
1541
+ if (i && this._table.contains(i) && !i.hidden && !this._isVirtualSpacerRow(i)) {
1542
+ if (e !== i && this._isInteractiveTarget(e)) return;
1624
1543
  if (a === "ArrowDown" || a === "ArrowUp") {
1625
- t.preventDefault(), this._focusSelectableRow(r, a === "ArrowDown" ? 1 : -1);
1544
+ t.preventDefault(), this._focusSelectableRow(i, a === "ArrowDown" ? 1 : -1);
1626
1545
  return;
1627
1546
  }
1628
1547
  if (a === "Home" || a === "End") {
@@ -1631,22 +1550,21 @@ class z extends A {
1631
1550
  o && o.focus();
1632
1551
  return;
1633
1552
  }
1634
- (a === "Enter" || a === " ") && (t.preventDefault(), this._toggleRowSelection(r));
1553
+ (a === "Enter" || a === " ") && (t.preventDefault(), this._toggleRowSelection(i));
1635
1554
  }
1636
1555
  }
1637
1556
  }
1638
1557
  _updateBulkActions() {
1639
1558
  const t = this.root.querySelector(".bulk");
1640
- if (!t)
1641
- return;
1559
+ if (!t) return;
1642
1560
  const a = this.hasAttribute("selectable"), e = this._selectedRows.size;
1643
1561
  if (!(a && e > 0)) {
1644
1562
  t.setAttribute("hidden", "");
1645
1563
  return;
1646
1564
  }
1647
1565
  t.removeAttribute("hidden");
1648
- const r = this.getAttribute("bulk-actions-label") || "{count} selected", s = this.getAttribute("bulk-clear-label") || "Clear selection", o = t.querySelector(".bulk-count");
1649
- o && (o.textContent = r.replace("{count}", String(e)));
1566
+ const i = this.getAttribute("bulk-actions-label") || "{count} selected", s = this.getAttribute("bulk-clear-label") || "Clear selection", o = t.querySelector(".bulk-count");
1567
+ o && (o.textContent = i.replace("{count}", String(e)));
1650
1568
  const n = t.querySelector(".bulk-clear");
1651
1569
  n && (n.textContent = s);
1652
1570
  }
@@ -1654,7 +1572,7 @@ class z extends A {
1654
1572
  return !1;
1655
1573
  }
1656
1574
  }
1657
- typeof customElements < "u" && !customElements.get("ui-data-table") && customElements.define("ui-data-table", z);
1575
+ typeof customElements < "u" && !customElements.get("ui-data-table") && customElements.define("ui-data-table", R);
1658
1576
  export {
1659
- z as UIDataTable
1577
+ R as UIDataTable
1660
1578
  };