@leavepulse/ui 0.44.0 → 0.45.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 (265) hide show
  1. package/README.md +49 -3
  2. package/dist/assets/{LpCommandPalette-DCP5g2ik.css → LpCommandPalette-nGNnzXqQ.css} +21 -21
  3. package/dist/assets/{LpRollingText-CR1mb0Vt.css → LpRollingText-BGnE6q9j.css} +3 -0
  4. package/dist/assets/{LpShortcutsDialog-ChUyU7oV.css → LpShortcutsDialog-CqYX3yy6.css} +28 -7
  5. package/dist/assets/{LpTable-DDQNdf86.css → LpTable-CPwWxTJS.css} +49 -9
  6. package/dist/chunks/{ContextMenuItems-CrfeNPWT.js → ContextMenuItems-BtKU7074.js} +2 -1
  7. package/dist/chunks/{LayoutCanvas-D-jPOAvg.js → LayoutCanvas-BkaGXTjx.js} +1 -1
  8. package/dist/chunks/{LayoutNode-D8Xy9N-o.js → LayoutNode-B3_9E1Xa.js} +9 -5
  9. package/dist/chunks/{LpActionBar-BbwCF6l5.js → LpActionBar-CnfFVIwC.js} +3 -3
  10. package/dist/chunks/{LpAddressInput-BrOqkZqg.js → LpAddressInput-BwX8uo4_.js} +7 -7
  11. package/dist/chunks/{LpAlert-DkOIjsbq.js → LpAlert-B6ilrM7T.js} +1 -1
  12. package/dist/chunks/{LpAppShell-BUKPcHco.js → LpAppShell-C53_RaGF.js} +4 -4
  13. package/dist/chunks/{LpAutocomplete-DxV3Y9h4.js → LpAutocomplete-C8IgSMsi.js} +2 -1
  14. package/dist/chunks/{LpAvatar-ClBbEYZN.js → LpAvatar-C1XStdOo.js} +3 -3
  15. package/dist/chunks/{LpBreadcrumbs-B8IJgFIc.js → LpBreadcrumbs-CQJd73Gm.js} +1 -1
  16. package/dist/chunks/{LpButton-kqJBHIIb.js → LpButton-CKSwC6Mu.js} +1 -1
  17. package/dist/chunks/{LpCalendar-B7Ko5RdR.js → LpCalendar-DrA2McTU.js} +1 -1
  18. package/dist/chunks/{LpCard-CpRByR0q.js → LpCard-C2IvucmX.js} +1 -1
  19. package/dist/chunks/{LpCheckbox-DpqchzH4.js → LpCheckbox-Bkj13CbW.js} +1 -1
  20. package/dist/chunks/{LpCodeBlock-DeHJPq7p.js → LpCodeBlock-ca7ANFyW.js} +1 -1
  21. package/dist/chunks/{LpColorPicker-Bhf1qxhB.js → LpColorPicker-zz4VGkG4.js} +46 -20
  22. package/dist/chunks/{LpConfirmDialog-CIUOSnWo.js → LpConfirmDialog-DCw5jR1t.js} +3 -3
  23. package/dist/chunks/{LpConfirmHost-CDm0Wtpv.js → LpConfirmHost-CbywMpMP.js} +1 -1
  24. package/dist/chunks/{LpContextMenu-DQw5dGfG.js → LpContextMenu-BqkAYa9X.js} +2 -1
  25. package/dist/chunks/{LpDatePicker-Drirx1AK.js → LpDatePicker-DuusgT69.js} +13 -9
  26. package/dist/chunks/LpDateRangePicker-DHeuznfC.js +208 -0
  27. package/dist/chunks/{LpDisclosure-ChQYmjlR.js → LpDisclosure-Cc23-JOT.js} +1 -1
  28. package/dist/chunks/{LpDrawer-bScx-KMO.js → LpDrawer-Dt4aB4Fr.js} +2 -2
  29. package/dist/chunks/{LpDropdownMenu-DJpoqRCb.js → LpDropdownMenu-DdJGQzPn.js} +2 -1
  30. package/dist/chunks/{LpEmptyState-Dsdqz1Wj.js → LpEmptyState-BJbZXC8D.js} +1 -1
  31. package/dist/chunks/LpFieldNotice-wtieLUTj.js +64 -0
  32. package/dist/chunks/{LpFileTree-CSI_5SK2.js → LpFileTree-CNurOvkV.js} +3 -3
  33. package/dist/chunks/{LpFileTreeNode-B4MiSQX2.js → LpFileTreeNode-D_qRRdsH.js} +3 -3
  34. package/dist/chunks/{LpFormField-CIk5qosh.js → LpFormField-CtVYj6tO.js} +29 -15
  35. package/dist/chunks/{LpIcon-CCnX5_2j.js → LpIcon-DYtaid0K.js} +20 -6
  36. package/dist/chunks/{LpInput-C0e8y8_d.js → LpInput-D-YGQbEv.js} +39 -16
  37. package/dist/chunks/{LpLightbox-Mr0W_6HK.js → LpLightbox-DSDahF23.js} +1 -1
  38. package/dist/chunks/{LpLogViewer-YBOaFnc_.js → LpLogViewer-KypbgOyo.js} +252 -58
  39. package/dist/chunks/{LpMapPicker-NUzS9e37.js → LpMapPicker-Cc84LaM3.js} +1 -1
  40. package/dist/chunks/{LpMediaGallery-DfJmMW0I.js → LpMediaGallery-YKr-cQPN.js} +2 -2
  41. package/dist/chunks/{LpModal-DPwGKBPv.js → LpModal-DMMDQHAu.js} +3 -3
  42. package/dist/chunks/{LpModalNav-DPg5H9f3.js → LpModalNav-BVPDyIup.js} +4 -4
  43. package/dist/chunks/{LpNotificationBell-t5yn-siX.js → LpNotificationBell-CCwyJP5C.js} +26 -14
  44. package/dist/chunks/{LpNumberField-DWnQKktS.js → LpNumberField-B77O-z28.js} +1 -1
  45. package/dist/chunks/{LpPagination-DFngX7Xo.js → LpPagination-BcDlo3r_.js} +1 -1
  46. package/dist/chunks/{LpPasswordInput-CWVDuBJ5.js → LpPasswordInput-eKzQhbQP.js} +2 -2
  47. package/dist/chunks/{LpPhoneInput-CD-ZTeSd.js → LpPhoneInput-BCbrrhgE.js} +126 -23
  48. package/dist/chunks/{LpPie-BLco31Nx.js → LpPie-BEJ2SfI6.js} +9 -10
  49. package/dist/chunks/{LpPopover-p_e_shN3.js → LpPopover-DCKeqiVn.js} +1 -0
  50. package/dist/chunks/LpRangeCalendar-DZuaRV0W.js +331 -0
  51. package/dist/chunks/{LpRollingText-CM5gkSeF.js → LpRollingText-DB7upf-5.js} +1 -1
  52. package/dist/chunks/{LpScrollArea-D8xyKXcF.js → LpScrollArea-Bry1fdOM.js} +14 -2
  53. package/dist/chunks/{LpSection-aM6J_u51.js → LpSection-tKEH0jYf.js} +1 -1
  54. package/dist/chunks/{LpSegmented-Dejd7cIx.js → LpSegmented-C09EEam2.js} +1 -1
  55. package/dist/chunks/{LpSelect-DrRD9I7L.js → LpSelect-DNIL6MB9.js} +20 -23
  56. package/dist/chunks/{LpSidebar-BgwUNWpJ.js → LpSidebar-CQNB0-yU.js} +3 -3
  57. package/dist/chunks/{LpSidebarNav-Bqxz8aWT.js → LpSidebarNav-kx-LdqNU.js} +3 -3
  58. package/dist/chunks/{LpStat-dXtyrdX9.js → LpStat-B-7udBRP.js} +1 -1
  59. package/dist/chunks/{LpStepper-Bk-XaQYU.js → LpStepper-C7XiVKZj.js} +34 -19
  60. package/dist/chunks/{LpSwitch-B1aLKulj.js → LpSwitch-OrcOJX9m.js} +1 -1
  61. package/dist/chunks/LpTableFilter-BV8PpLM9.js +158 -0
  62. package/dist/chunks/{LpTabs-_qMVaZJ6.js → LpTabs-29iW1XOx.js} +1 -1
  63. package/dist/chunks/LpTagsInput-D1SuqbhB.js +300 -0
  64. package/dist/chunks/{LpTextarea-yP8hGedR.js → LpTextarea-uuScWo6-.js} +1 -1
  65. package/dist/chunks/{LpThemeProvider-Wjm7Tuit.js → LpThemeProvider-Be4r2TQX.js} +1 -1
  66. package/dist/chunks/{LpThemeSwitcher-CKLc10KZ.js → LpThemeSwitcher-B4aVPbNC.js} +19 -22
  67. package/dist/chunks/{LpTimeField-C5HRgS5H.js → LpTimeField-Cqe7fXnh.js} +1 -1
  68. package/dist/chunks/{LpToaster--oT6lfhL.js → LpToaster-DpJvoCOh.js} +37 -3
  69. package/dist/chunks/{LpTooltip-CBdzeKNf.js → LpTooltip-CXVKcOXT.js} +3 -2
  70. package/dist/chunks/{LpTopologyCanvas-DocsLal3.js → LpTopologyCanvas-6ozNrQKh.js} +2 -1
  71. package/dist/chunks/{LpUptimeBar-DLtxOMRy.js → LpUptimeBar-ugcv25xj.js} +2 -2
  72. package/dist/chunks/icons-CkA0njzm.js +43 -0
  73. package/dist/chunks/{useTheme-C8JHUlPM.js → useTheme-DJm1JSsY.js} +47 -50
  74. package/dist/component-names.d.ts +1 -1
  75. package/dist/components/ContextMenuItems.vue.js +1 -1
  76. package/dist/components/LayoutCanvas.vue.js +1 -1
  77. package/dist/components/LayoutNode.vue.js +1 -1
  78. package/dist/components/LpActionBar.vue.js +1 -1
  79. package/dist/components/LpAddressInput.vue.js +1 -1
  80. package/dist/components/LpAlert.vue.js +1 -1
  81. package/dist/components/LpAppShell.vue.js +1 -1
  82. package/dist/components/LpAutocomplete.vue.js +1 -1
  83. package/dist/components/LpAvatar.vue.js +1 -1
  84. package/dist/components/LpBreadcrumbs.vue.js +1 -1
  85. package/dist/components/LpButton.vue.d.ts +2 -2
  86. package/dist/components/LpButton.vue.js +1 -1
  87. package/dist/components/LpCalendar.vue.js +1 -1
  88. package/dist/components/LpCard.vue.js +1 -1
  89. package/dist/components/LpChart.vue.d.ts +16 -1
  90. package/dist/components/LpChart.vue.js +63 -5
  91. package/dist/components/LpCheckbox.vue.js +1 -1
  92. package/dist/components/LpCodeBlock.vue.js +1 -1
  93. package/dist/components/LpColorPicker.vue.d.ts +2 -2
  94. package/dist/components/LpColorPicker.vue.js +1 -1
  95. package/dist/components/LpCommandPalette.vue.d.ts +6 -0
  96. package/dist/components/LpCommandPalette.vue.js +61 -10
  97. package/dist/components/LpConfirmDialog.vue.js +1 -1
  98. package/dist/components/LpConfirmHost.vue.js +1 -1
  99. package/dist/components/LpContextMenu.vue.js +1 -1
  100. package/dist/components/LpDatePicker.vue.js +1 -1
  101. package/dist/components/LpDateRangePicker.vue.d.ts +60 -0
  102. package/dist/components/LpDateRangePicker.vue.js +4 -0
  103. package/dist/components/LpDisclosure.vue.js +1 -1
  104. package/dist/components/LpDrawer.vue.js +1 -1
  105. package/dist/components/LpDropdownMenu.vue.js +1 -1
  106. package/dist/components/LpDropzone.vue.js +1 -1
  107. package/dist/components/LpEmptyState.vue.js +1 -1
  108. package/dist/components/LpFieldNotice.vue.d.ts +8 -0
  109. package/dist/components/LpFieldNotice.vue.js +4 -0
  110. package/dist/components/LpFileTree.vue.js +1 -1
  111. package/dist/components/LpFileTreeNode.vue.js +1 -1
  112. package/dist/components/LpFormField.vue.d.ts +4 -1
  113. package/dist/components/LpFormField.vue.js +1 -1
  114. package/dist/components/LpIcon.vue.d.ts +0 -1
  115. package/dist/components/LpIcon.vue.js +1 -1
  116. package/dist/components/LpImageEditor.vue.js +2 -2
  117. package/dist/components/LpInput.vue.d.ts +19 -0
  118. package/dist/components/LpInput.vue.js +1 -1
  119. package/dist/components/LpLightbox.vue.js +1 -1
  120. package/dist/components/LpLogViewer.vue.d.ts +52 -1
  121. package/dist/components/LpLogViewer.vue.js +1 -1
  122. package/dist/components/LpMapPicker.vue.js +1 -1
  123. package/dist/components/LpMediaGallery.vue.js +1 -1
  124. package/dist/components/LpModal.vue.js +1 -1
  125. package/dist/components/LpModalNav.vue.js +1 -1
  126. package/dist/components/LpNotificationBell.vue.js +1 -1
  127. package/dist/components/LpNumberField.vue.js +1 -1
  128. package/dist/components/LpPagination.vue.js +1 -1
  129. package/dist/components/LpPasswordInput.vue.js +1 -1
  130. package/dist/components/LpPhoneInput.vue.d.ts +13 -0
  131. package/dist/components/LpPhoneInput.vue.js +1 -1
  132. package/dist/components/LpPie.vue.js +1 -1
  133. package/dist/components/LpPopover.vue.js +1 -1
  134. package/dist/components/LpProgress.vue.d.ts +1 -1
  135. package/dist/components/LpRangeCalendar.vue.d.ts +51 -0
  136. package/dist/components/LpRangeCalendar.vue.js +4 -0
  137. package/dist/components/LpRollingText.vue.d.ts +1 -1
  138. package/dist/components/LpRollingText.vue.js +1 -1
  139. package/dist/components/LpScrollArea.vue.d.ts +2 -2
  140. package/dist/components/LpScrollArea.vue.js +1 -1
  141. package/dist/components/LpSection.vue.js +1 -1
  142. package/dist/components/LpSegmented.vue.js +1 -1
  143. package/dist/components/LpSelect.vue.js +1 -1
  144. package/dist/components/LpShortcutsDialog.vue.d.ts +6 -0
  145. package/dist/components/LpShortcutsDialog.vue.js +56 -14
  146. package/dist/components/LpSidebar.vue.js +1 -1
  147. package/dist/components/LpSidebarNav.vue.js +1 -1
  148. package/dist/components/LpStat.vue.js +1 -1
  149. package/dist/components/LpStepper.vue.js +1 -1
  150. package/dist/components/LpSwitch.vue.js +1 -1
  151. package/dist/components/LpTable.vue.d.ts +84 -2
  152. package/dist/components/LpTable.vue.js +481 -107
  153. package/dist/components/LpTableFilter.vue.d.ts +31 -0
  154. package/dist/components/LpTableFilter.vue.js +4 -0
  155. package/dist/components/LpTabs.vue.js +1 -1
  156. package/dist/components/LpTagsInput.vue.d.ts +77 -0
  157. package/dist/components/LpTagsInput.vue.js +4 -0
  158. package/dist/components/LpTextarea.vue.js +1 -1
  159. package/dist/components/LpThemeProvider.vue.js +1 -1
  160. package/dist/components/LpThemeSwitcher.vue.d.ts +2 -2
  161. package/dist/components/LpThemeSwitcher.vue.js +1 -1
  162. package/dist/components/LpTimeField.vue.js +1 -1
  163. package/dist/components/LpToaster.vue.js +1 -1
  164. package/dist/components/LpTooltip.vue.js +1 -1
  165. package/dist/components/LpTopologyCanvas.vue.js +1 -1
  166. package/dist/components/LpUptimeBar.vue.js +1 -1
  167. package/dist/components/chart.js +3 -2
  168. package/dist/components/commandSearch.js +3 -0
  169. package/dist/components/dateRange.d.ts +43 -0
  170. package/dist/components/dateRange.js +76 -0
  171. package/dist/components/exportData.d.ts +58 -0
  172. package/dist/components/exportData.js +165 -0
  173. package/dist/components/logSearch.d.ts +18 -0
  174. package/dist/components/logSearch.js +36 -0
  175. package/dist/components/phone.d.ts +41 -0
  176. package/dist/components/phone.js +80 -0
  177. package/dist/components/tableFilter.d.ts +36 -0
  178. package/dist/components/tableFilter.js +84 -0
  179. package/dist/components/tags.d.ts +20 -0
  180. package/dist/components/tags.js +37 -0
  181. package/dist/composables/useField.d.ts +4 -0
  182. package/dist/composables/useFieldNotice.d.ts +17 -0
  183. package/dist/composables/useFieldNotice.js +28 -0
  184. package/dist/composables/useForm.d.ts +53 -0
  185. package/dist/composables/useForm.js +207 -0
  186. package/dist/composables/useHotkeys.d.ts +65 -5
  187. package/dist/composables/useHotkeys.js +170 -9
  188. package/dist/composables/useInputMask.d.ts +59 -0
  189. package/dist/composables/useInputMask.js +170 -0
  190. package/dist/composables/usePaintSelect.d.ts +22 -0
  191. package/dist/composables/usePaintSelect.js +169 -0
  192. package/dist/composables/useShift.js +7 -2
  193. package/dist/icons-all.d.ts +1 -0
  194. package/dist/icons-all.js +3 -0
  195. package/dist/icons.d.ts +14 -1
  196. package/dist/index.d.ts +29 -3
  197. package/dist/index.js +195 -138
  198. package/dist/kit-icons.d.ts +2 -0
  199. package/dist/theme/backdrop.d.ts +12 -0
  200. package/dist/theme/presets.d.ts +0 -2
  201. package/package.json +13 -4
  202. package/src/component-names.ts +4 -0
  203. package/src/components/ContextMenuItems.vue +1 -1
  204. package/src/components/LayoutNode.vue +11 -2
  205. package/src/components/LpActionBar.vue +1 -1
  206. package/src/components/LpAutocomplete.vue +1 -0
  207. package/src/components/LpAvatar.vue +2 -2
  208. package/src/components/LpButton.vue +1 -1
  209. package/src/components/LpChart.vue +80 -1
  210. package/src/components/LpColorPicker.vue +34 -1
  211. package/src/components/LpCommandPalette.vue +81 -7
  212. package/src/components/LpContextMenu.vue +1 -1
  213. package/src/components/LpDatePicker.vue +8 -3
  214. package/src/components/LpDateRangePicker.vue +224 -0
  215. package/src/components/LpDropdownMenu.vue +1 -0
  216. package/src/components/LpFieldNotice.vue +65 -0
  217. package/src/components/LpFormField.vue +33 -4
  218. package/src/components/LpIcon.vue +22 -4
  219. package/src/components/LpInput.vue +46 -6
  220. package/src/components/LpLogViewer.vue +225 -22
  221. package/src/components/LpModal.vue +1 -1
  222. package/src/components/LpNotificationBell.vue +15 -7
  223. package/src/components/LpPhoneInput.vue +179 -20
  224. package/src/components/LpPie.vue +8 -5
  225. package/src/components/LpPopover.vue +1 -0
  226. package/src/components/LpRangeCalendar.vue +365 -0
  227. package/src/components/LpRollingText.vue +3 -0
  228. package/src/components/LpScrollArea.vue +22 -2
  229. package/src/components/LpSelect.vue +0 -0
  230. package/src/components/LpShortcutsDialog.vue +77 -8
  231. package/src/components/LpStepper.vue +23 -10
  232. package/src/components/LpSwitch.vue +1 -1
  233. package/src/components/LpTable.vue +584 -65
  234. package/src/components/LpTableFilter.vue +175 -0
  235. package/src/components/LpTagsInput.vue +364 -0
  236. package/src/components/LpThemeSwitcher.vue +19 -23
  237. package/src/components/LpToaster.vue +49 -1
  238. package/src/components/LpTooltip.vue +9 -2
  239. package/src/components/LpTopologyCanvas.vue +7 -1
  240. package/src/components/chart.ts +5 -3
  241. package/src/components/commandSearch.ts +6 -0
  242. package/src/components/dateRange.ts +134 -0
  243. package/src/components/exportData.ts +228 -0
  244. package/src/components/logSearch.ts +46 -0
  245. package/src/components/phone.ts +140 -0
  246. package/src/components/tableFilter.ts +122 -0
  247. package/src/components/tags.ts +62 -0
  248. package/src/composables/useField.ts +4 -0
  249. package/src/composables/useFieldNotice.ts +59 -0
  250. package/src/composables/useForm.ts +314 -0
  251. package/src/composables/useHotkeys.ts +269 -13
  252. package/src/composables/useInputMask.ts +254 -0
  253. package/src/composables/usePaintSelect.ts +243 -0
  254. package/src/composables/useShift.ts +13 -2
  255. package/src/iconSubset.d.mts +10 -0
  256. package/src/iconSubset.mjs +51 -0
  257. package/src/icons-all.ts +10 -0
  258. package/src/icons.ts +59 -8
  259. package/src/index.ts +37 -3
  260. package/src/kit-icons.ts +5 -0
  261. package/src/nuxt.ts +30 -2
  262. package/src/runtime/theme.plugin.ts +2 -2
  263. package/src/theme/backdrop.ts +69 -0
  264. package/src/theme/presets.ts +6 -64
  265. package/src/tokens/tokens.css +46 -0
@@ -1,27 +1,61 @@
1
- import { defineComponent, computed, useAttrs, ref, shallowRef, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, withCtx, createElementVNode, createCommentVNode, Fragment, renderList, normalizeStyle, createBlock, createTextVNode, toDisplayString, TransitionGroup, unref, withModifiers, renderSlot, nextTick } from "vue";
2
- import { _ as _sfc_main$3 } from "../chunks/LpCheckbox-DpqchzH4.js";
3
- import { _ as _sfc_main$2 } from "../chunks/LpContextMenu-DQw5dGfG.js";
4
- import { _ as _sfc_main$4 } from "../chunks/LpIcon-CCnX5_2j.js";
5
- import { _ as _sfc_main$5 } from "../chunks/LpPagination-DFngX7Xo.js";
6
- import { _ as _sfc_main$1 } from "../chunks/LpScrollArea-D8xyKXcF.js";
1
+ import { defineComponent, computed, useAttrs, ref, shallowRef, watch, onMounted, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createElementVNode, Transition, renderSlot, mergeProps, normalizeStyle, createBlock, TransitionGroup, unref, withModifiers, nextTick } from "vue";
2
+ import { _ as _sfc_main$7 } from "../chunks/LpCheckbox-Bkj13CbW.js";
3
+ import { _ as _sfc_main$6 } from "../chunks/LpContextMenu-BqkAYa9X.js";
4
+ import { _ as _sfc_main$2 } from "../chunks/LpIcon-DYtaid0K.js";
5
+ import { _ as _sfc_main$a } from "../chunks/LpPagination-BcDlo3r_.js";
6
+ import { _ as _sfc_main$8 } from "../chunks/LpPopover-DCKeqiVn.js";
7
+ import { _ as _sfc_main$5 } from "../chunks/LpScrollArea-Bry1fdOM.js";
8
+ import { _ as _sfc_main$4 } from "../chunks/LpRollingText-DB7upf-5.js";
9
+ import { _ as _sfc_main$3 } from "../chunks/LpShift-DXNsauQZ.js";
10
+ import { _ as _sfc_main$9 } from "../chunks/LpTableFilter-BV8PpLM9.js";
7
11
  import { useAsyncTask } from "../composables/useAsyncTask.js";
12
+ import { useHotkeys } from "../composables/useHotkeys.js";
13
+ import { usePaintSelect } from "../composables/usePaintSelect.js";
8
14
  import { useRovingFocus } from "../composables/useRovingFocus.js";
9
15
  import { useLabels } from "../composables/useLpConfig.js";
10
16
  import { compareValues } from "./tableSort.js";
17
+ import { _ as _sfc_main$1 } from "../chunks/LpButton-CKSwC6Mu.js";
18
+ import { toCsv, downloadFile, fileStem } from "./exportData.js";
19
+ import { summarizeShown, parseTableState, serializeTableState, countValues } from "./tableFilter.js";
11
20
  import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
12
- import '../assets/LpTable-DDQNdf86.css';const _hoisted_1 = { class: "border-b border-line bg-surface-soft" };
21
+ import '../assets/LpTable-CPwWxTJS.css';const _hoisted_1 = {
22
+ key: 0,
23
+ class: "flex justify-end"
24
+ };
13
25
  const _hoisted_2 = {
14
26
  key: 0,
15
- class: "w-px px-4 py-3"
27
+ class: "flex min-h-8 items-center gap-x-3 pb-3 text-xs"
28
+ };
29
+ const _hoisted_3 = {
30
+ key: 0,
31
+ class: "flex min-w-0 flex-1 flex-wrap items-center gap-1.5"
32
+ };
33
+ const _hoisted_4 = { class: "truncate" };
34
+ const _hoisted_5 = { class: "text-muted" };
35
+ const _hoisted_6 = ["aria-label", "onClick"];
36
+ const _hoisted_7 = { class: "flex items-center gap-2 whitespace-nowrap text-muted" };
37
+ const _hoisted_8 = {
38
+ key: 0,
39
+ class: "flex items-center gap-2"
40
+ };
41
+ const _hoisted_9 = {
42
+ key: 0,
43
+ class: "flex items-center gap-2"
16
44
  };
17
- const _hoisted_3 = ["aria-sort"];
18
- const _hoisted_4 = ["onClick"];
19
- const _hoisted_5 = {
45
+ const _hoisted_10 = { class: "hidden sm:inline" };
46
+ const _hoisted_11 = { class: "w-full border-collapse text-sm" };
47
+ const _hoisted_12 = { class: "border-b border-line bg-surface-soft" };
48
+ const _hoisted_13 = ["inert"];
49
+ const _hoisted_14 = ["aria-sort"];
50
+ const _hoisted_15 = ["onClick"];
51
+ const _hoisted_16 = ["aria-label", "data-lp-filter"];
52
+ const _hoisted_17 = {
20
53
  key: "lp-table-empty",
21
54
  class: "lp-row-empty"
22
55
  };
23
- const _hoisted_6 = ["colspan"];
24
- const _hoisted_7 = ["onContextmenu", "onClick"];
56
+ const _hoisted_18 = ["colspan"];
57
+ const _hoisted_19 = ["onContextmenu", "data-paint-key", "onClick", "onPointerdown"];
58
+ const _hoisted_20 = ["onPointerdown"];
25
59
  const __default__ = { inheritAttrs: false };
26
60
  const _sfc_main = /* @__PURE__ */ defineComponent({
27
61
  ...__default__,
@@ -37,7 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
71
  rowKey: {},
38
72
  emptyLabel: {},
39
73
  emptyIcon: { default: "lucide:inbox" },
40
- selectable: { type: Boolean, default: false },
74
+ selectable: { type: [Boolean, String], default: false },
41
75
  selected: { default: () => [] },
42
76
  sort: { default: void 0 },
43
77
  stickyHeader: { type: Boolean },
@@ -48,9 +82,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
82
  filterLabel: {},
49
83
  showAllLabel: {},
50
84
  columnsLabel: {},
51
- labels: {}
85
+ exportable: { type: Boolean },
86
+ exportFilename: {},
87
+ labels: {},
88
+ density: { default: "comfortable" },
89
+ summary: { type: Boolean, default: false },
90
+ persist: {},
91
+ allMatching: { type: Boolean, default: false }
52
92
  },
53
- emits: ["update:selected", "update:sort", "rowClick"],
93
+ emits: ["update:selected", "update:sort", "update:allMatching", "rowClick"],
54
94
  setup(__props, { expose: __expose, emit: __emit }) {
55
95
  const props = __props;
56
96
  const labelSet = useLabels(
@@ -64,7 +104,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
104
  sortClear: "Clear sorting",
65
105
  filter: "Show only",
66
106
  showAll: "Show all",
67
- columns: "Columns"
107
+ columns: "Columns",
108
+ exportCsv: "Export CSV",
109
+ selectAll: "Select every row",
110
+ shortcutsGroup: "Table",
111
+ filterColumn: "Filter {column}",
112
+ filterSearch: "Search values",
113
+ filterAll: "All",
114
+ filterNone: "None",
115
+ filterInvert: "Invert",
116
+ filterOnly: "Only",
117
+ filterOnlyShown: "Only these {count}",
118
+ filterAddShown: "Add these {count}",
119
+ filterNoValues: "No values match",
120
+ filterNothingShown: "none",
121
+ clearFilter: "Clear the {column} filter",
122
+ clearFilters: "Clear all",
123
+ noMatches: "No rows match the filters",
124
+ resetFilters: "Reset filters",
125
+ rowCount: "{shown} of {total}",
126
+ rowsTotal: "{total} rows",
127
+ selectedCount: "{count} selected",
128
+ clearSelection: "Clear selection",
129
+ pageSelected: "All {count} on this page are selected.",
130
+ selectAllMatching: "Select all {total}",
131
+ allMatchingSelected: "All {total} are selected."
68
132
  },
69
133
  () => props.labels
70
134
  );
@@ -102,6 +166,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
102
166
  menuRow.value = row;
103
167
  }
104
168
  const contextMenu = computed(() => {
169
+ if (paint.painting.value) return [];
105
170
  const table = tableMenu();
106
171
  const row = menuRow.value ? props.rowMenu?.(menuRow.value) ?? [] : [];
107
172
  if (!row.length) return table;
@@ -119,11 +184,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
184
  const loading = task.pending;
120
185
  const sourceRows = computed(() => props.load ? loaded.value : props.rows);
121
186
  const sourceIndex = computed(() => new Map(sourceRows.value.map((row, i) => [row, i])));
122
- const tableEl = ref(null);
187
+ const frameEl = ref(null);
123
188
  const floor = ref(0);
124
189
  async function holdHeight() {
125
190
  await nextTick();
126
- const height = tableEl.value?.offsetHeight ?? 0;
191
+ const height = frameEl.value?.querySelector("table")?.offsetHeight ?? 0;
127
192
  if (height > floor.value) floor.value = height;
128
193
  }
129
194
  const hiddenValues = ref({});
@@ -150,20 +215,46 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
150
215
  }
151
216
  return seen;
152
217
  }
153
- function isValueHidden(key, value) {
154
- return hiddenValues.value[key]?.has(value) ?? false;
218
+ function showAllValues(key) {
219
+ withMotion(() => hiddenValues.value = { ...hiddenValues.value, [key]: /* @__PURE__ */ new Set() });
220
+ }
221
+ function setHidden(key, next) {
222
+ withMotion(() => hiddenValues.value = { ...hiddenValues.value, [key]: next });
155
223
  }
156
- function toggleValue(key, value) {
157
- withMotion(() => applyToggle(key, value));
224
+ function labelOf(col, value) {
225
+ return col.valueLabel?.(value) ?? String(value ?? "—");
158
226
  }
159
- function applyToggle(key, value) {
160
- const next = new Set(hiddenValues.value[key] ?? []);
161
- if (next.has(value)) next.delete(value);
162
- else next.add(value);
163
- hiddenValues.value = { ...hiddenValues.value, [key]: next };
227
+ function filterOptions(col) {
228
+ let counts;
229
+ if (!props.load) {
230
+ const others = Object.entries(hiddenValues.value).filter(([key, set]) => key !== col.key && set.size);
231
+ const rows = others.length ? props.rows.filter((row) => others.every(([key, hidden]) => !hidden.has(row[key]))) : props.rows;
232
+ counts = countValues(rows, col.key);
233
+ }
234
+ return valuesOf(col).map((value) => ({ value, label: labelOf(col, value), count: counts?.get(value) ?? (counts ? 0 : void 0) }));
164
235
  }
165
- function showAllValues(key) {
166
- withMotion(() => hiddenValues.value = { ...hiddenValues.value, [key]: /* @__PURE__ */ new Set() });
236
+ const activeFilters = computed(
237
+ () => props.columns.filter((col) => col.filterable && hiddenValues.value[col.key]?.size).map((col) => {
238
+ const hidden = hiddenValues.value[col.key];
239
+ const shown = valuesOf(col).filter((v) => !hidden.has(v)).map((v) => labelOf(col, v));
240
+ return { col, text: shown.length ? summarizeShown(shown) : text.value.filterNothingShown };
241
+ })
242
+ );
243
+ function clearAllFilters() {
244
+ withMotion(() => hiddenValues.value = {});
245
+ }
246
+ function filterLabels() {
247
+ const t = text.value;
248
+ return {
249
+ search: t.filterSearch,
250
+ all: t.filterAll,
251
+ none: t.filterNone,
252
+ invert: t.filterInvert,
253
+ only: t.filterOnly,
254
+ onlyShown: t.filterOnlyShown,
255
+ addShown: t.filterAddShown,
256
+ noValues: t.filterNoValues
257
+ };
167
258
  }
168
259
  function toggleColumn(key) {
169
260
  const next = new Set(hiddenColumns.value);
@@ -179,18 +270,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
179
270
  (row) => active.every(([key, hidden]) => !hidden.has(row[key]))
180
271
  );
181
272
  });
182
- const displayRows = computed(() => {
273
+ function sortRows(rows) {
183
274
  const s = activeSort.value;
184
- if (!s || props.load) return filteredRows.value;
275
+ if (!s || props.load) return rows;
185
276
  const col = props.columns.find((c) => c.key === s.key);
186
- if (!col?.sortable) return filteredRows.value;
277
+ if (!col?.sortable) return rows;
187
278
  const factor = s.dir === "asc" ? 1 : -1;
188
279
  const own = col.compare;
189
280
  const value = col.sortValue ?? ((row) => row[s.key]);
190
- return [...filteredRows.value].sort(
191
- (a, b) => (own ? own(a, b) : compareValues(value(a), value(b))) * factor
192
- );
193
- });
281
+ return [...rows].sort((a, b) => (own ? own(a, b) : compareValues(value(a), value(b))) * factor);
282
+ }
283
+ const displayRows = computed(() => sortRows(filteredRows.value));
194
284
  function toggleSort(col) {
195
285
  if (!col.sortable) return;
196
286
  const s = activeSort.value;
@@ -208,6 +298,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
208
298
  if (s?.key !== col.key) return "lucide:chevrons-up-down";
209
299
  return s.dir === "asc" ? "lucide:arrow-up" : "lucide:arrow-down";
210
300
  }
301
+ function openFilter(key) {
302
+ const open = () => frameEl.value?.querySelector(`[data-lp-filter="${CSS.escape(key)}"]`)?.click();
303
+ const started = performance.now();
304
+ const wait = () => {
305
+ if (!document.querySelector("[data-reka-menu-content]") || performance.now() - started > 600) setTimeout(open, 30);
306
+ else requestAnimationFrame(wait);
307
+ };
308
+ requestAnimationFrame(wait);
309
+ }
211
310
  function headerMenu(col) {
212
311
  const s = activeSort.value;
213
312
  const set = (next) => () => withMotion(() => {
@@ -239,32 +338,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
239
338
  }
240
339
  if (col.filterable) {
241
340
  const hidden = hiddenValues.value[col.key];
242
- items.push({
243
- label: text.value.filter,
244
- icon: "lucide:filter",
245
- separatorBefore: items.length > 0,
246
- children: [
247
- ...valuesOf(col).map((value) => ({
248
- label: col.valueLabel?.(value) ?? String(value ?? "—"),
249
- checked: !isValueHidden(col.key, value),
250
- onSelect: () => toggleValue(col.key, value)
251
- })),
252
- {
253
- label: text.value.showAll,
254
- icon: "lucide:list",
255
- separatorBefore: true,
256
- disabled: !hidden?.size,
257
- onSelect: () => showAllValues(col.key)
258
- }
259
- ]
260
- });
341
+ items.push(
342
+ {
343
+ label: text.value.filterColumn.replace("{column}", col.label),
344
+ icon: "lucide:filter",
345
+ separatorBefore: items.length > 0,
346
+ onSelect: () => openFilter(col.key)
347
+ },
348
+ {
349
+ label: text.value.showAll,
350
+ icon: "lucide:list",
351
+ disabled: !hidden?.size,
352
+ onSelect: () => showAllValues(col.key)
353
+ }
354
+ );
261
355
  }
262
356
  return items;
263
357
  }
264
358
  function tableMenu() {
265
359
  const offered = props.columns.filter((c) => !c.alwaysVisible && c.label);
266
- if (!offered.length) return [];
360
+ const exportItem = props.exportable ? [{ label: text.value.exportCsv, icon: "lucide:download", onSelect: () => exportCsv() }] : [];
361
+ if (!offered.length) return exportItem;
267
362
  return [
363
+ ...exportItem,
268
364
  {
269
365
  label: text.value.columns,
270
366
  icon: "lucide:columns-3",
@@ -311,8 +407,62 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
311
407
  else fetchPage(props.debounce);
312
408
  });
313
409
  watch(page, () => fetchPage());
410
+ const storageKey = computed(() => props.persist ? `lp-table:${props.persist}` : "");
411
+ const restored = ref(false);
412
+ onMounted(() => {
413
+ if (storageKey.value) {
414
+ let raw = null;
415
+ try {
416
+ raw = localStorage.getItem(storageKey.value);
417
+ } catch {
418
+ }
419
+ const state = parseTableState(raw, props.columns.map((c) => c.key));
420
+ if (state) {
421
+ if (state.sort !== void 0) {
422
+ ownSort.value = state.sort;
423
+ emit("update:sort", state.sort);
424
+ }
425
+ if (state.hidden) {
426
+ hiddenValues.value = Object.fromEntries(Object.entries(state.hidden).map(([k, v]) => [k, new Set(v)]));
427
+ }
428
+ if (state.columns) hiddenColumns.value = new Set(state.columns);
429
+ }
430
+ }
431
+ restored.value = true;
432
+ });
433
+ watch([activeSort, hiddenValues, hiddenColumns], () => {
434
+ if (!storageKey.value || !restored.value) return;
435
+ const state = serializeTableState({
436
+ sort: activeSort.value,
437
+ hidden: Object.fromEntries(Object.entries(hiddenValues.value).map(([k, v]) => [k, [...v]])),
438
+ columns: [...hiddenColumns.value]
439
+ });
440
+ try {
441
+ localStorage.setItem(storageKey.value, state);
442
+ } catch {
443
+ }
444
+ });
314
445
  watch(() => props.load, () => fetchPage(), { immediate: true });
315
- __expose({ reload: () => fetchPage() });
446
+ function exportCsv(options = {}) {
447
+ const scope = options.scope ?? "filtered";
448
+ let rows;
449
+ if (scope === "all") rows = sortRows(sourceRows.value);
450
+ else if (scope === "selected") {
451
+ const keys = new Set(props.selected);
452
+ rows = sortRows(sourceRows.value).filter((row, i) => keys.has(keyFor(row, i)));
453
+ } else rows = displayRows.value;
454
+ const columns = visibleColumns.value.filter((col) => col.label).map((col) => ({
455
+ key: col.key,
456
+ label: col.label,
457
+ value: col.exportValue ?? ((row) => row[col.key])
458
+ }));
459
+ const csv = toCsv(rows, columns, options);
460
+ if (options.download !== false) {
461
+ downloadFile(`${fileStem(options.filename ?? props.exportFilename, "table")}.csv`, csv, "text/csv;charset=utf-8");
462
+ }
463
+ return csv;
464
+ }
465
+ __expose({ reload: () => fetchPage(), exportCsv });
316
466
  const selectedSet = computed(() => new Set(props.selected));
317
467
  const allKeys = computed(() => filteredRows.value.map((r, i) => keyFor(r, i)));
318
468
  const allChecked = computed(
@@ -335,6 +485,72 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
335
485
  else next.delete(key);
336
486
  emit("update:selected", [...next]);
337
487
  }
488
+ const keyByText = computed(
489
+ () => new Map(displayRows.value.map((row, index) => [String(keyFor(row, index)), keyFor(row, index)]))
490
+ );
491
+ const paint = usePaintSelect({
492
+ root: frameEl,
493
+ enabled: () => !!props.selectable,
494
+ selection: () => props.selected,
495
+ set: (keys) => emit("update:selected", keys),
496
+ resolve: (raw) => keyByText.value.get(raw),
497
+ selectAll: () => [.../* @__PURE__ */ new Set([...props.selected, ...allKeys.value])],
498
+ help: () => ({ group: text.value.shortcutsGroup, label: text.value.selectAll })
499
+ });
500
+ const holdMode = computed(() => props.selectable === "hold");
501
+ const ticksShown = computed(
502
+ () => props.selectable === true || props.selected.length > 0 || paint.painting.value
503
+ );
504
+ function clearSelection() {
505
+ emit("update:selected", []);
506
+ if (props.allMatching) emit("update:allMatching", false);
507
+ }
508
+ const OWN_CLICKS = "a,button,input,select,textarea,label,[role=button],[role=checkbox],[contenteditable=true]";
509
+ function onRowPointerDown(event, key) {
510
+ if (!holdMode.value) return;
511
+ if (event.target?.closest(OWN_CLICKS)) return;
512
+ paint.onPointerDown(event, key, { hold: 420 });
513
+ }
514
+ function onRowClick(row, key) {
515
+ if (holdMode.value && props.selected.length) toggleRow(key, !selectedSet.value.has(key));
516
+ else emit("rowClick", row);
517
+ }
518
+ useHotkeys(
519
+ () => props.selectable && props.selected.length ? [
520
+ {
521
+ key: "escape",
522
+ help: { group: text.value.shortcutsGroup, label: text.value.clearSelection },
523
+ handler: () => clearSelection()
524
+ }
525
+ ] : [],
526
+ { scope: frameEl }
527
+ );
528
+ const pageKeys = computed(() => displayRows.value.map((row, i) => keyFor(row, i)));
529
+ const pageAllSelected = computed(
530
+ () => pageKeys.value.length > 0 && pageKeys.value.every((k) => selectedSet.value.has(k))
531
+ );
532
+ watch(pageAllSelected, (all) => {
533
+ if (!all && props.allMatching) emit("update:allMatching", false);
534
+ });
535
+ const statusText = computed(() => {
536
+ if (!(props.selectable && props.selected.length)) return countText.value;
537
+ return props.allMatching ? text.value.allMatchingSelected.replace("{total}", String(total.value)) : text.value.selectedCount.replace("{count}", String(props.selected.length));
538
+ });
539
+ const countText = computed(() => {
540
+ const t = text.value;
541
+ if (props.load) return t.rowsTotal.replace("{total}", String(total.value));
542
+ if (displayRows.value.length !== props.rows.length) {
543
+ return t.rowCount.replace("{shown}", String(displayRows.value.length)).replace("{total}", String(props.rows.length));
544
+ }
545
+ return t.rowsTotal.replace("{total}", String(props.rows.length));
546
+ });
547
+ const showBar = computed(() => props.summary || !!props.selectable || activeFilters.value.length > 0);
548
+ const filteredOut = computed(() => {
549
+ if (loading.value || failed.value || displayRows.value.length) return false;
550
+ if (props.load) return Object.values(hiddenValues.value).some((set) => set.size);
551
+ return props.rows.length > 0;
552
+ });
553
+ const cellY = computed(() => props.density === "compact" ? "py-1.5" : "py-3");
338
554
  const colSpan = computed(() => visibleColumns.value.length + (props.selectable ? 1 : 0));
339
555
  const rovingItems = computed(
340
556
  () => displayRows.value.map((row, index) => ({
@@ -395,46 +611,161 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
395
611
  );
396
612
  return (_ctx, _cache) => {
397
613
  return openBlock(), createElementBlock("div", {
614
+ ref_key: "frameEl",
615
+ ref: frameEl,
398
616
  class: normalizeClass(["flex flex-col gap-3", rootClass.value])
399
617
  }, [
400
- createVNode(_sfc_main$1, mergeProps(scrollAttrs.value, {
618
+ __props.exportable ? (openBlock(), createElementBlock("div", _hoisted_1, [
619
+ createVNode(_sfc_main$1, {
620
+ variant: "ghost",
621
+ size: "sm",
622
+ onClick: _cache[0] || (_cache[0] = ($event) => exportCsv())
623
+ }, {
624
+ default: withCtx(() => [
625
+ createVNode(_sfc_main$2, {
626
+ name: "lucide:download",
627
+ size: 14
628
+ }),
629
+ createTextVNode(" " + toDisplayString(text.value.exportCsv), 1)
630
+ ]),
631
+ _: 1
632
+ })
633
+ ])) : createCommentVNode("", true),
634
+ createVNode(_sfc_main$3, { class: "-mb-3" }, {
635
+ default: withCtx(() => [
636
+ showBar.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
637
+ activeFilters.value.length ? (openBlock(), createElementBlock("div", _hoisted_3, [
638
+ (openBlock(true), createElementBlock(Fragment, null, renderList(activeFilters.value, (f) => {
639
+ return openBlock(), createElementBlock("span", {
640
+ key: f.col.key,
641
+ class: "inline-flex max-w-72 animate-[chip-in_var(--duration-fast)_var(--ease-emphasized)] items-center gap-1 rounded-pill bg-brand-soft py-0.5 pr-1 pl-2.5 text-ink motion-reduce:animate-none"
642
+ }, [
643
+ createElementVNode("span", _hoisted_4, [
644
+ createElementVNode("span", _hoisted_5, toDisplayString(f.col.label) + ":", 1),
645
+ createTextVNode(" " + toDisplayString(f.text), 1)
646
+ ]),
647
+ createElementVNode("button", {
648
+ type: "button",
649
+ class: "grid size-4 shrink-0 place-items-center rounded-pill text-muted outline-none transition-colors duration-fast hover:bg-ink/10 hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
650
+ "aria-label": text.value.clearFilter.replace("{column}", f.col.label),
651
+ onClick: ($event) => showAllValues(f.col.key)
652
+ }, [
653
+ createVNode(_sfc_main$2, {
654
+ name: "lucide:x",
655
+ size: 12
656
+ })
657
+ ], 8, _hoisted_6)
658
+ ]);
659
+ }), 128)),
660
+ activeFilters.value.length > 1 ? (openBlock(), createElementBlock("button", {
661
+ key: 0,
662
+ type: "button",
663
+ class: "rounded-control px-1.5 py-0.5 font-medium text-muted outline-none transition-colors duration-fast hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
664
+ onClick: clearAllFilters
665
+ }, toDisplayString(text.value.clearFilters), 1)) : createCommentVNode("", true)
666
+ ])) : createCommentVNode("", true),
667
+ createVNode(_sfc_main$3, {
668
+ axis: "width",
669
+ class: "ml-auto shrink-0"
670
+ }, {
671
+ default: withCtx(() => [
672
+ createElementVNode("div", _hoisted_7, [
673
+ createVNode(_sfc_main$4, {
674
+ value: statusText.value,
675
+ align: "end",
676
+ class: normalizeClass(["tabular-nums", __props.selectable && __props.selected.length ? "font-medium text-ink" : ""]),
677
+ "aria-live": "polite"
678
+ }, null, 8, ["value", "class"]),
679
+ createVNode(Transition, {
680
+ "enter-active-class": "transition-opacity duration-fast motion-reduce:transition-none",
681
+ "leave-active-class": "transition-opacity duration-fast motion-reduce:transition-none",
682
+ "enter-from-class": "opacity-0",
683
+ "leave-to-class": "opacity-0"
684
+ }, {
685
+ default: withCtx(() => [
686
+ __props.selectable && __props.selected.length ? (openBlock(), createElementBlock("span", _hoisted_8, [
687
+ createVNode(Transition, {
688
+ "enter-active-class": "transition-opacity duration-fast motion-reduce:transition-none",
689
+ "leave-active-class": "transition-opacity duration-fast motion-reduce:transition-none",
690
+ "enter-from-class": "opacity-0",
691
+ "leave-to-class": "opacity-0"
692
+ }, {
693
+ default: withCtx(() => [
694
+ __props.load && pageAllSelected.value && !__props.allMatching && total.value > pageKeys.value.length ? (openBlock(), createElementBlock("span", _hoisted_9, [
695
+ createElementVNode("span", _hoisted_10, toDisplayString(text.value.pageSelected.replace("{count}", String(pageKeys.value.length))), 1),
696
+ createElementVNode("button", {
697
+ type: "button",
698
+ class: "rounded-control px-1.5 py-0.5 font-medium text-brand outline-none transition-colors duration-fast hover:bg-brand-soft focus-visible:ring-2 focus-visible:ring-ring",
699
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("update:allMatching", true))
700
+ }, toDisplayString(text.value.selectAllMatching.replace("{total}", String(total.value))), 1)
701
+ ])) : createCommentVNode("", true)
702
+ ]),
703
+ _: 1
704
+ }),
705
+ createElementVNode("button", {
706
+ type: "button",
707
+ class: "rounded-control px-1.5 py-0.5 font-medium outline-none transition-colors duration-fast hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
708
+ onClick: clearSelection
709
+ }, toDisplayString(text.value.clearSelection), 1),
710
+ renderSlot(_ctx.$slots, "bulk", {
711
+ selected: __props.selected,
712
+ allMatching: __props.allMatching,
713
+ clear: clearSelection
714
+ }, void 0, true)
715
+ ])) : createCommentVNode("", true)
716
+ ]),
717
+ _: 3
718
+ })
719
+ ])
720
+ ]),
721
+ _: 3
722
+ })
723
+ ])) : createCommentVNode("", true)
724
+ ]),
725
+ _: 3
726
+ }),
727
+ createVNode(_sfc_main$5, mergeProps(scrollAttrs.value, {
401
728
  fade: false,
402
729
  class: "min-h-0 flex-1 rounded-card border border-line",
403
730
  style: __props.load && floor.value ? { minHeight: `${floor.value + 2}px` } : void 0,
404
731
  "bar-inset-top": barInsetTop.value
405
732
  }), {
406
733
  default: withCtx(() => [
407
- createVNode(_sfc_main$2, {
734
+ createVNode(_sfc_main$6, {
408
735
  items: contextMenu.value,
409
736
  always: ""
410
737
  }, {
411
738
  default: withCtx(() => [
412
- createElementVNode("table", {
413
- ref_key: "tableEl",
414
- ref: tableEl,
415
- class: "w-full border-collapse text-sm"
416
- }, [
739
+ createElementVNode("table", _hoisted_11, [
417
740
  createElementVNode("thead", {
418
741
  ref_key: "headEl",
419
742
  ref: headEl,
420
743
  class: normalizeClass(__props.stickyHeader ? "sticky top-0 z-10 bg-surface-soft" : "")
421
744
  }, [
422
- createElementVNode("tr", _hoisted_1, [
423
- __props.selectable ? (openBlock(), createElementBlock("th", _hoisted_2, [
424
- createVNode(_sfc_main$3, {
425
- "model-value": allChecked.value,
426
- indeterminate: someChecked.value,
427
- "onUpdate:modelValue": toggleAll
428
- }, null, 8, ["model-value", "indeterminate"])
429
- ])) : createCommentVNode("", true),
745
+ createElementVNode("tr", _hoisted_12, [
746
+ __props.selectable ? (openBlock(), createElementBlock("th", {
747
+ key: 0,
748
+ class: normalizeClass(["w-px p-0", cellY.value])
749
+ }, [
750
+ createElementVNode("div", {
751
+ class: normalizeClass(["lp-tick lp-tick-open", ticksShown.value ? "" : "lp-tick-hidden"]),
752
+ inert: !ticksShown.value
753
+ }, [
754
+ createVNode(_sfc_main$7, {
755
+ "model-value": allChecked.value,
756
+ indeterminate: someChecked.value,
757
+ "onUpdate:modelValue": toggleAll
758
+ }, null, 8, ["model-value", "indeterminate"])
759
+ ], 10, _hoisted_13)
760
+ ], 2)) : createCommentVNode("", true),
430
761
  (openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (col) => {
431
762
  return openBlock(), createElementBlock("th", {
432
763
  key: col.key,
433
764
  style: normalizeStyle(col.width ? { width: col.width } : void 0),
434
- class: normalizeClass(["px-4 py-3 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted", alignClass(col.align)]),
765
+ class: normalizeClass(["px-4 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted", [alignClass(col.align), cellY.value]]),
435
766
  "aria-sort": activeSort.value?.key === col.key ? activeSort.value.dir === "asc" ? "ascending" : "descending" : void 0
436
767
  }, [
437
- col.sortable || col.filterable ? (openBlock(), createBlock(_sfc_main$2, {
768
+ col.sortable || col.filterable ? (openBlock(), createBlock(_sfc_main$6, {
438
769
  key: 0,
439
770
  items: headerMenu(col)
440
771
  }, {
@@ -448,27 +779,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
448
779
  onClick: ($event) => toggleSort(col)
449
780
  }, [
450
781
  createTextVNode(toDisplayString(col.label) + " ", 1),
451
- !col.sortable ? (openBlock(), createBlock(_sfc_main$4, {
782
+ col.sortable ? (openBlock(), createBlock(_sfc_main$2, {
452
783
  key: 0,
453
- name: "lucide:filter",
454
- size: 12,
455
- class: normalizeClass(["shrink-0", hiddenValues.value[col.key]?.size ? "text-brand opacity-100" : "opacity-40 group-hover/sort:opacity-70"])
456
- }, null, 8, ["class"])) : (openBlock(), createBlock(_sfc_main$4, {
457
- key: 1,
458
784
  name: sortIcon(col),
459
785
  size: 13,
460
786
  class: normalizeClass([
461
787
  "shrink-0 transition-[transform,opacity] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)]",
462
788
  activeSort.value?.key === col.key ? "opacity-100" : "opacity-40 group-hover/sort:opacity-70"
463
789
  ])
464
- }, null, 8, ["name", "class"]))
465
- ], 10, _hoisted_4)
790
+ }, null, 8, ["name", "class"])) : createCommentVNode("", true)
791
+ ], 10, _hoisted_15)
466
792
  ]),
467
793
  _: 2
468
794
  }, 1032, ["items"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
469
795
  createTextVNode(toDisplayString(col.label), 1)
470
- ], 64))
471
- ], 14, _hoisted_3);
796
+ ], 64)),
797
+ col.filterable ? (openBlock(), createBlock(_sfc_main$8, {
798
+ key: 2,
799
+ align: "start",
800
+ "panel-class": "w-72",
801
+ "aria-label": text.value.filterColumn.replace("{column}", col.label)
802
+ }, {
803
+ trigger: withCtx(() => [
804
+ createElementVNode("button", {
805
+ type: "button",
806
+ class: normalizeClass(["ml-0.5 inline-grid size-5 place-items-center rounded align-middle outline-none transition-colors duration-fast hover:bg-surface-raised hover:text-ink focus-visible:ring-2 focus-visible:ring-ring", hiddenValues.value[col.key]?.size ? "text-brand" : "opacity-60"]),
807
+ "aria-label": text.value.filterColumn.replace("{column}", col.label),
808
+ "data-lp-filter": col.key
809
+ }, [
810
+ createVNode(_sfc_main$2, {
811
+ name: hiddenValues.value[col.key]?.size ? "lucide:filter-x" : "lucide:filter",
812
+ size: 12
813
+ }, null, 8, ["name"])
814
+ ], 10, _hoisted_16)
815
+ ]),
816
+ default: withCtx(() => [
817
+ createVNode(_sfc_main$9, {
818
+ options: filterOptions(col),
819
+ hidden: hiddenValues.value[col.key] ?? /* @__PURE__ */ new Set(),
820
+ labels: filterLabels(),
821
+ "onUpdate:hidden": (next) => setHidden(col.key, next)
822
+ }, null, 8, ["options", "hidden", "labels", "onUpdate:hidden"])
823
+ ]),
824
+ _: 2
825
+ }, 1032, ["aria-label"])) : createCommentVNode("", true)
826
+ ], 14, _hoisted_14);
472
827
  }), 128))
473
828
  ])
474
829
  ], 2),
@@ -480,18 +835,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
480
835
  ref: (el) => unref(roving).setContainer(el?.$el ?? null)
481
836
  }, {
482
837
  default: withCtx(() => [
483
- displayRows.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_5, [
838
+ displayRows.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_17, [
484
839
  createElementVNode("td", {
485
840
  colspan: colSpan.value,
486
841
  class: "px-4 py-10 text-center text-muted"
487
842
  }, [
488
- createVNode(_sfc_main$4, {
489
- name: unref(loading) ? "lucide:loader-circle" : failed.value ? "lucide:circle-alert" : __props.emptyIcon,
843
+ createVNode(_sfc_main$2, {
844
+ name: unref(loading) ? "lucide:loader-circle" : failed.value ? "lucide:circle-alert" : filteredOut.value ? "lucide:filter-x" : __props.emptyIcon,
490
845
  size: 22,
491
846
  class: normalizeClass(["mx-auto mb-2 opacity-60", unref(loading) ? "animate-spin" : ""])
492
847
  }, null, 8, ["name", "class"]),
493
- createElementVNode("div", null, toDisplayString(unref(loading) ? text.value.loading : failed.value ? text.value.error : text.value.empty), 1)
494
- ], 8, _hoisted_6)
848
+ createElementVNode("div", null, toDisplayString(unref(loading) ? text.value.loading : failed.value ? text.value.error : filteredOut.value ? text.value.noMatches : text.value.empty), 1),
849
+ filteredOut.value ? (openBlock(), createBlock(_sfc_main$1, {
850
+ key: 0,
851
+ variant: "outline",
852
+ size: "sm",
853
+ class: "mt-3",
854
+ onClick: clearAllFilters
855
+ }, {
856
+ default: withCtx(() => [
857
+ createTextVNode(toDisplayString(text.value.resetFilters), 1)
858
+ ]),
859
+ _: 1
860
+ })) : createCommentVNode("", true)
861
+ ], 8, _hoisted_18)
495
862
  ])) : createCommentVNode("", true),
496
863
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayRows.value, (row, index) => {
497
864
  return openBlock(), createElementBlock("tr", mergeProps({
@@ -499,24 +866,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
499
866
  onContextmenu: ($event) => onRowContextMenu(row),
500
867
  class: ["group border-b border-line/60 outline-none transition-colors last:border-0 hover:bg-surface-soft/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-[active]:bg-surface-soft/40", selectedSet.value.has(keyFor(row, index)) ? "bg-brand-soft/40" : ""]
501
868
  }, { ref_for: true }, unref(roving).itemProps(String(keyFor(row, index))), {
502
- onClick: ($event) => emit("rowClick", row),
869
+ "data-paint-key": __props.selectable ? String(keyFor(row, index)) : void 0,
870
+ onClick: ($event) => onRowClick(row, keyFor(row, index)),
871
+ onPointerdown: ($event) => onRowPointerDown($event, keyFor(row, index)),
503
872
  onKeydown: onRowKeydown
504
873
  }), [
505
874
  __props.selectable ? (openBlock(), createElementBlock("td", {
506
875
  key: 0,
507
- class: "w-px px-4 py-3",
508
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
509
- }, ["stop"]))
876
+ class: normalizeClass(["w-px cursor-pointer p-0 select-none", cellY.value]),
877
+ onClick: _cache[2] || (_cache[2] = withModifiers(() => {
878
+ }, ["stop"])),
879
+ onPointerdown: withModifiers(($event) => unref(paint).onPointerDown($event, keyFor(row, index)), ["stop"])
510
880
  }, [
511
- createVNode(_sfc_main$3, {
512
- "model-value": selectedSet.value.has(keyFor(row, index)),
513
- "onUpdate:modelValue": (v) => toggleRow(keyFor(row, index), v)
514
- }, null, 8, ["model-value", "onUpdate:modelValue"])
515
- ])) : createCommentVNode("", true),
516
- (openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (col) => {
881
+ createElementVNode("div", {
882
+ class: normalizeClass(["lp-tick lp-tick-open", ticksShown.value ? "" : "lp-tick-cue"])
883
+ }, [
884
+ createVNode(_sfc_main$7, {
885
+ "model-value": selectedSet.value.has(keyFor(row, index)),
886
+ "onUpdate:modelValue": (v) => toggleRow(keyFor(row, index), v)
887
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
888
+ ], 2)
889
+ ], 42, _hoisted_20)) : createCommentVNode("", true),
890
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (col, ci) => {
517
891
  return openBlock(), createElementBlock("td", {
518
892
  key: col.key,
519
- class: normalizeClass(["px-4 py-3 text-ink", alignClass(col.align)])
893
+ class: normalizeClass(["px-4 text-ink", [alignClass(col.align), cellY.value, col.nowrap ? "whitespace-nowrap" : ""]])
520
894
  }, [
521
895
  renderSlot(_ctx.$slots, `cell-${col.key}`, {
522
896
  row,
@@ -526,22 +900,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
526
900
  ], true)
527
901
  ], 2);
528
902
  }), 128))
529
- ], 16, _hoisted_7);
903
+ ], 16, _hoisted_19);
530
904
  }), 128))
531
905
  ]),
532
906
  _: 3
533
907
  }, 8, ["css", "class"])
534
- ], 512)
908
+ ])
535
909
  ]),
536
910
  _: 3
537
911
  }, 8, ["items"])
538
912
  ]),
539
913
  _: 3
540
914
  }, 16, ["style", "bar-inset-top"]),
541
- __props.load && total.value > __props.pageSize ? (openBlock(), createBlock(_sfc_main$5, {
542
- key: 0,
915
+ __props.load && total.value > __props.pageSize ? (openBlock(), createBlock(_sfc_main$a, {
916
+ key: 1,
543
917
  page: page.value,
544
- "onUpdate:page": _cache[1] || (_cache[1] = ($event) => page.value = $event),
918
+ "onUpdate:page": _cache[3] || (_cache[3] = ($event) => page.value = $event),
545
919
  total: total.value,
546
920
  "page-size": __props.pageSize,
547
921
  disabled: unref(loading)
@@ -550,7 +924,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
550
924
  };
551
925
  }
552
926
  });
553
- const LpTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ebce6d15"]]);
927
+ const LpTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fff7ed10"]]);
554
928
  export {
555
929
  LpTable as default
556
930
  };