hys-ui 0.6.0 → 0.8.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 (268) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +19 -0
  3. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  4. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1055 -753
  5. package/dist/components/HysDataGrid/gridColumnLayout.js +46 -0
  6. package/dist/components/HysDataGrid/gridPresentation.js +17 -0
  7. package/dist/components/HysDataGrid/useGridContextMenu.js +33 -0
  8. package/dist/components/HysDatePicker/HysDatePicker.vue.js +102 -48
  9. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
  10. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +874 -532
  11. package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +2 -2
  12. package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +209 -168
  13. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +102 -48
  14. package/dist/components/HysDescriptions/HysDescriptions.vue.js +7 -0
  15. package/dist/components/HysDescriptions/HysDescriptions2.vue.js +146 -0
  16. package/dist/components/HysForm/HysForm2.vue.js +9 -8
  17. package/dist/components/HysIcon/HysIcon.vue.js +373 -0
  18. package/dist/components/HysIcon/HysIcon2.vue.js +5 -0
  19. package/dist/components/HysIcon/IconGraphic/IconGraphic.vue.js +147 -0
  20. package/dist/components/HysIcon/IconGraphic/IconGraphic2.vue.js +4 -0
  21. package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.js +7 -0
  22. package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel2.vue.js +440 -0
  23. package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.js +29 -0
  24. package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic2.vue.js +4 -0
  25. package/dist/components/HysIcon/IconTooltip/IconTooltip.vue.js +19 -0
  26. package/dist/components/HysIcon/IconTooltip/IconTooltip2.vue.js +4 -0
  27. package/dist/components/HysIcon/builtins/access.js +180 -0
  28. package/dist/components/HysIcon/builtins/actions.js +327 -0
  29. package/dist/components/HysIcon/builtins/business.js +364 -0
  30. package/dist/components/HysIcon/builtins/catalog/access-1.json.js +51 -0
  31. package/dist/components/HysIcon/builtins/catalog/access-2.json.js +35 -0
  32. package/dist/components/HysIcon/builtins/catalog/accessibility.json.js +26 -0
  33. package/dist/components/HysIcon/builtins/catalog/arrows-1.json.js +45 -0
  34. package/dist/components/HysIcon/builtins/catalog/arrows-2.json.js +46 -0
  35. package/dist/components/HysIcon/builtins/catalog/arrows-3.json.js +42 -0
  36. package/dist/components/HysIcon/builtins/catalog/charts-1.json.js +50 -0
  37. package/dist/components/HysIcon/builtins/catalog/charts-2.json.js +13 -0
  38. package/dist/components/HysIcon/builtins/catalog/commerce.json.js +43 -0
  39. package/dist/components/HysIcon/builtins/catalog/communication-1.json.js +49 -0
  40. package/dist/components/HysIcon/builtins/catalog/communication-2.json.js +37 -0
  41. package/dist/components/HysIcon/builtins/catalog/design-1.json.js +61 -0
  42. package/dist/components/HysIcon/builtins/catalog/design-2.json.js +27 -0
  43. package/dist/components/HysIcon/builtins/catalog/development-1.json.js +58 -0
  44. package/dist/components/HysIcon/builtins/catalog/development-2.json.js +60 -0
  45. package/dist/components/HysIcon/builtins/catalog/development-3.json.js +25 -0
  46. package/dist/components/HysIcon/builtins/catalog/devices-1.json.js +52 -0
  47. package/dist/components/HysIcon/builtins/catalog/devices-2.json.js +55 -0
  48. package/dist/components/HysIcon/builtins/catalog/devices-3.json.js +23 -0
  49. package/dist/components/HysIcon/builtins/catalog/education.json.js +34 -0
  50. package/dist/components/HysIcon/builtins/catalog/emoji.json.js +24 -0
  51. package/dist/components/HysIcon/builtins/catalog/files-1.json.js +45 -0
  52. package/dist/components/HysIcon/builtins/catalog/files-2.json.js +47 -0
  53. package/dist/components/HysIcon/builtins/catalog/files-3.json.js +8 -0
  54. package/dist/components/HysIcon/builtins/catalog/food-1.json.js +67 -0
  55. package/dist/components/HysIcon/builtins/catalog/food-2.json.js +40 -0
  56. package/dist/components/HysIcon/builtins/catalog/home.json.js +36 -0
  57. package/dist/components/HysIcon/builtins/catalog/layout-1.json.js +46 -0
  58. package/dist/components/HysIcon/builtins/catalog/layout-2.json.js +45 -0
  59. package/dist/components/HysIcon/builtins/catalog/manifest.json.js +4 -0
  60. package/dist/components/HysIcon/builtins/catalog/maps-1.json.js +61 -0
  61. package/dist/components/HysIcon/builtins/catalog/maps-2.json.js +24 -0
  62. package/dist/components/HysIcon/builtins/catalog/media-1.json.js +57 -0
  63. package/dist/components/HysIcon/builtins/catalog/media-2.json.js +13 -0
  64. package/dist/components/HysIcon/builtins/catalog/medical.json.js +30 -0
  65. package/dist/components/HysIcon/builtins/catalog/nature.json.js +54 -0
  66. package/dist/components/HysIcon/builtins/catalog/recreation.json.js +51 -0
  67. package/dist/components/HysIcon/builtins/catalog/shapes.json.js +54 -0
  68. package/dist/components/HysIcon/builtins/catalog/text-1.json.js +52 -0
  69. package/dist/components/HysIcon/builtins/catalog/text-2.json.js +54 -0
  70. package/dist/components/HysIcon/builtins/catalog/text-3.json.js +58 -0
  71. package/dist/components/HysIcon/builtins/catalog/text-4.json.js +41 -0
  72. package/dist/components/HysIcon/builtins/catalog/time.json.js +39 -0
  73. package/dist/components/HysIcon/builtins/catalog/transport-1.json.js +57 -0
  74. package/dist/components/HysIcon/builtins/catalog/transport-2.json.js +7 -0
  75. package/dist/components/HysIcon/builtins/catalog/weather.json.js +46 -0
  76. package/dist/components/HysIcon/builtins/communication.js +314 -0
  77. package/dist/components/HysIcon/builtins/documents.js +315 -0
  78. package/dist/components/HysIcon/builtins/extendedCatalog.js +75 -0
  79. package/dist/components/HysIcon/builtins/iconInCategory.js +11 -0
  80. package/dist/components/HysIcon/builtins/media.js +255 -0
  81. package/dist/components/HysIcon/builtins/navigation.js +276 -0
  82. package/dist/components/HysIcon/builtins/technology.js +189 -0
  83. package/dist/components/HysIcon/iconBuiltins.js +228 -0
  84. package/dist/components/HysIcon/iconConfig.js +30 -0
  85. package/dist/components/HysIcon/iconRegistry.js +183 -0
  86. package/dist/components/HysIcon/iconSafety.js +191 -0
  87. package/dist/components/HysIcon/iconStyle.js +70 -0
  88. package/dist/components/HysIcon/useIconResource.js +75 -0
  89. package/dist/components/HysPopconfirm/HysPopconfirm.vue.js +7 -0
  90. package/dist/components/HysPopconfirm/HysPopconfirm2.vue.js +346 -0
  91. package/dist/components/HysPopconfirm/usePopconfirmAction.js +32 -0
  92. package/dist/components/HysResult/HysResult.vue.js +7 -0
  93. package/dist/components/HysResult/HysResult2.vue.js +124 -0
  94. package/dist/components/HysSpace/HysSpace.vue.js +7 -0
  95. package/dist/components/HysSpace/HysSpace2.vue.js +79 -0
  96. package/dist/components/HysSpace/spaceItems.js +17 -0
  97. package/dist/components/HysSpin/HysSpin.vue.js +7 -0
  98. package/dist/components/HysSpin/HysSpin2.vue.js +427 -0
  99. package/dist/components/HysSpin/SpinGlyph/SpinGlyph.vue.js +334 -0
  100. package/dist/components/HysSpin/SpinGlyph/SpinGlyph2.vue.js +5 -0
  101. package/dist/components/HysSpin/SpinPortal/SpinPortal.vue.js +7 -0
  102. package/dist/components/HysSpin/SpinPortal/SpinPortal2.vue.js +66 -0
  103. package/dist/components/HysSpin/SpinPortal/spinTarget.js +57 -0
  104. package/dist/components/HysSpin/spinCatalog.js +35 -0
  105. package/dist/components/HysSpin/spinConfig.js +32 -0
  106. package/dist/components/HysSpin/spinService.js +160 -0
  107. package/dist/components/HysSpin/spinStyle.js +39 -0
  108. package/dist/components/HysSpin/useHysSpinTask.js +92 -0
  109. package/dist/components/HysSpin/useSpinFullscreen.js +60 -0
  110. package/dist/components/HysSpin/useSpinVisibility.js +59 -0
  111. package/dist/components/HysSplitPane/HysSplitPane.vue.js +285 -204
  112. package/dist/components/HysSplitPane/splitPaneResize.js +75 -0
  113. package/dist/components/HysTabPane/HysTabPane.vue.js +49 -0
  114. package/dist/components/HysTabPane/HysTabPane2.vue.js +4 -0
  115. package/dist/components/HysTable/HysTable.vue.js +3 -3
  116. package/dist/components/HysTable/HysTable2.vue.js +412 -383
  117. package/dist/components/HysTable/tableSearch.js +24 -0
  118. package/dist/components/HysTabs/HysTabs.vue.js +172 -5
  119. package/dist/components/HysTabs/HysTabs2.vue.js +2 -275
  120. package/dist/components/HysTabs/TabsMore/TabsMore.vue.js +7 -0
  121. package/dist/components/HysTabs/TabsMore/TabsMore2.vue.js +133 -0
  122. package/dist/components/HysTabs/TabsPanels/TabsPanels.vue.js +161 -0
  123. package/dist/components/HysTabs/TabsPanels/TabsPanels2.vue.js +4 -0
  124. package/dist/components/HysTabs/TabsPrompts/TabsPrompts.vue.js +4 -0
  125. package/dist/components/HysTabs/TabsPrompts/TabsPrompts2.vue.js +88 -0
  126. package/dist/components/HysTabs/TabsSlot/TabsSlot.js +13 -0
  127. package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.js +7 -0
  128. package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench2.vue.js +687 -0
  129. package/dist/components/HysTabs/tabsConfig.js +35 -0
  130. package/dist/components/HysTabs/tabsItems.js +79 -0
  131. package/dist/components/HysTabs/tabsPersistence.js +118 -0
  132. package/dist/components/HysTabs/useHysRouteTabs.js +77 -0
  133. package/dist/components/HysTabs/useTabsDragGhost.js +47 -0
  134. package/dist/components/HysTabs/useTabsNav.js +127 -0
  135. package/dist/components/HysTabs/useTabsOverlays.js +52 -0
  136. package/dist/components/HysTabs/useTabsPanels.js +101 -0
  137. package/dist/components/HysTabs/useTabsPointer.js +131 -0
  138. package/dist/components/HysTabs/useTabsState.js +263 -0
  139. package/dist/composables/datePicker.js +153 -94
  140. package/dist/composables/datePickerModel.js +156 -0
  141. package/dist/composables/datePickerPanels.js +78 -0
  142. package/dist/composables/datePickerRules.js +166 -0
  143. package/dist/composables/floatingPosition.js +32 -13
  144. package/dist/composables/formLayout.js +20 -42
  145. package/dist/composables/popupSurfaceStyle.js +30 -0
  146. package/dist/composables/useContainerWidth.js +24 -0
  147. package/dist/composables/useDatePicker.js +274 -381
  148. package/dist/composables/useFloating.js +42 -41
  149. package/dist/composables/usePageVisibility.js +19 -0
  150. package/dist/composables/usePopupSurface.js +153 -162
  151. package/dist/composables/usePopupSurfaceInteractions.js +91 -90
  152. package/dist/composables/useSplitPaneDrag.js +29 -26
  153. package/dist/composables/useSvgInstanceId.js +15 -0
  154. package/dist/composables/useTable.js +321 -306
  155. package/dist/composables/useTabularRowNavigation.js +46 -0
  156. package/dist/index.js +229 -185
  157. package/dist/internal/MultiSplitPane.vue.js +246 -205
  158. package/dist/internal/PopupSurfacePanel.vue.js +2 -2
  159. package/dist/internal/PopupSurfacePanel2.vue.js +35 -30
  160. package/dist/style.css +1 -1
  161. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +40 -2
  162. package/dist/types/components/HysDataGrid/gridColumnLayout.d.ts +22 -0
  163. package/dist/types/components/HysDataGrid/gridPresentation.d.ts +47 -0
  164. package/dist/types/components/HysDataGrid/useGridContextMenu.d.ts +14 -0
  165. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +6 -9
  166. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +12 -0
  167. package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +6 -0
  168. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +6 -9
  169. package/dist/types/components/HysDescriptions/HysDescriptions.vue.d.ts +20 -0
  170. package/dist/types/components/HysDescriptions/descriptionsTypes.d.ts +54 -0
  171. package/dist/types/components/HysForm/HysForm.vue.d.ts +1 -1
  172. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
  173. package/dist/types/components/HysIcon/HysIcon.vue.d.ts +76 -0
  174. package/dist/types/components/HysIcon/IconGraphic/IconGraphic.vue.d.ts +43 -0
  175. package/dist/types/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.d.ts +17 -0
  176. package/dist/types/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.d.ts +10 -0
  177. package/dist/types/components/HysIcon/IconTooltip/IconTooltip.vue.d.ts +11 -0
  178. package/dist/types/components/HysIcon/builtins/access.d.ts +15 -0
  179. package/dist/types/components/HysIcon/builtins/actions.d.ts +30 -0
  180. package/dist/types/components/HysIcon/builtins/business.d.ts +31 -0
  181. package/dist/types/components/HysIcon/builtins/communication.d.ts +27 -0
  182. package/dist/types/components/HysIcon/builtins/documents.d.ts +29 -0
  183. package/dist/types/components/HysIcon/builtins/extendedCatalog.d.ts +2 -0
  184. package/dist/types/components/HysIcon/builtins/iconInCategory.d.ts +2 -0
  185. package/dist/types/components/HysIcon/builtins/media.d.ts +24 -0
  186. package/dist/types/components/HysIcon/builtins/navigation.d.ts +30 -0
  187. package/dist/types/components/HysIcon/builtins/technology.d.ts +18 -0
  188. package/dist/types/components/HysIcon/iconBuiltins.d.ts +2 -0
  189. package/dist/types/components/HysIcon/iconConfig.d.ts +10 -0
  190. package/dist/types/components/HysIcon/iconRegistry.d.ts +5 -0
  191. package/dist/types/components/HysIcon/iconSafety.d.ts +8 -0
  192. package/dist/types/components/HysIcon/iconStyle.d.ts +6 -0
  193. package/dist/types/components/HysIcon/iconTypes.d.ts +192 -0
  194. package/dist/types/components/HysIcon/useIconResource.d.ts +14 -0
  195. package/dist/types/components/HysPopconfirm/HysPopconfirm.vue.d.ts +85 -0
  196. package/dist/types/components/HysPopconfirm/popconfirmTypes.d.ts +72 -0
  197. package/dist/types/components/HysPopconfirm/usePopconfirmAction.d.ts +6 -0
  198. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
  199. package/dist/types/components/HysResult/HysResult.vue.d.ts +22 -0
  200. package/dist/types/components/HysResult/resultTypes.d.ts +32 -0
  201. package/dist/types/components/HysSpace/HysSpace.vue.d.ts +15 -0
  202. package/dist/types/components/HysSpace/spaceItems.d.ts +9 -0
  203. package/dist/types/components/HysSpace/spaceTypes.d.ts +20 -0
  204. package/dist/types/components/HysSpin/HysSpin.vue.d.ts +84 -0
  205. package/dist/types/components/HysSpin/SpinGlyph/SpinGlyph.vue.d.ts +16 -0
  206. package/dist/types/components/HysSpin/SpinPortal/SpinPortal.vue.d.ts +21 -0
  207. package/dist/types/components/HysSpin/SpinPortal/spinTarget.d.ts +3 -0
  208. package/dist/types/components/HysSpin/spinCatalog.d.ts +122 -0
  209. package/dist/types/components/HysSpin/spinConfig.d.ts +10 -0
  210. package/dist/types/components/HysSpin/spinService.d.ts +7 -0
  211. package/dist/types/components/HysSpin/spinStyle.d.ts +5 -0
  212. package/dist/types/components/HysSpin/spinTypes.d.ts +133 -0
  213. package/dist/types/components/HysSpin/useHysSpinTask.d.ts +4 -0
  214. package/dist/types/components/HysSpin/useSpinFullscreen.d.ts +17 -0
  215. package/dist/types/components/HysSpin/useSpinVisibility.d.ts +10 -0
  216. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +25 -2
  217. package/dist/types/components/HysSplitPane/splitPaneResize.d.ts +17 -0
  218. package/dist/types/components/HysTabPane/HysTabPane.vue.d.ts +11 -0
  219. package/dist/types/components/HysTable/HysTable.vue.d.ts +16 -10
  220. package/dist/types/components/HysTable/tableSearch.d.ts +2 -0
  221. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +83 -74
  222. package/dist/types/components/HysTabs/TabsMore/TabsMore.vue.d.ts +14 -0
  223. package/dist/types/components/HysTabs/TabsPanels/TabsPanels.vue.d.ts +17 -0
  224. package/dist/types/components/HysTabs/TabsPrompts/TabsPrompts.vue.d.ts +7 -0
  225. package/dist/types/components/HysTabs/TabsSlot/TabsSlot.d.ts +9 -0
  226. package/dist/types/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.d.ts +32 -0
  227. package/dist/types/components/HysTabs/tabsConfig.d.ts +4 -0
  228. package/dist/types/components/HysTabs/tabsItems.d.ts +14 -0
  229. package/dist/types/components/HysTabs/tabsPersistence.d.ts +6 -0
  230. package/dist/types/components/HysTabs/tabsTypes.d.ts +236 -0
  231. package/dist/types/components/HysTabs/useHysRouteTabs.d.ts +22 -0
  232. package/dist/types/components/HysTabs/useTabsDragGhost.d.ts +22 -0
  233. package/dist/types/components/HysTabs/useTabsNav.d.ts +20 -0
  234. package/dist/types/components/HysTabs/useTabsOverlays.d.ts +54 -0
  235. package/dist/types/components/HysTabs/useTabsPanels.d.ts +14 -0
  236. package/dist/types/components/HysTabs/useTabsPointer.d.ts +30 -0
  237. package/dist/types/components/HysTabs/useTabsState.d.ts +32 -0
  238. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +2 -2
  239. package/dist/types/components/HysToast/toastPresentation.d.ts +1 -1
  240. package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +2 -2
  241. package/dist/types/composables/dataGrid.d.ts +34 -0
  242. package/dist/types/composables/datePicker.d.ts +14 -214
  243. package/dist/types/composables/datePickerModel.d.ts +63 -0
  244. package/dist/types/composables/datePickerPanels.d.ts +23 -0
  245. package/dist/types/composables/datePickerRules.d.ts +31 -0
  246. package/dist/types/composables/datePickerTypes.d.ts +277 -0
  247. package/dist/types/composables/floatingPosition.d.ts +1 -1
  248. package/dist/types/composables/formLayout.d.ts +1 -2
  249. package/dist/types/composables/popupSurfaceStyle.d.ts +7 -0
  250. package/dist/types/composables/table.d.ts +10 -1
  251. package/dist/types/composables/toastQueue.d.ts +4 -4
  252. package/dist/types/composables/toastQueueModel.d.ts +2 -2
  253. package/dist/types/composables/useColorPicker.d.ts +2 -4
  254. package/dist/types/composables/useContainerWidth.d.ts +2 -0
  255. package/dist/types/composables/useContextMenu.d.ts +2 -4
  256. package/dist/types/composables/useDatePicker.d.ts +20 -11
  257. package/dist/types/composables/useFloating.d.ts +4 -5
  258. package/dist/types/composables/usePageVisibility.d.ts +1 -0
  259. package/dist/types/composables/usePopupSurface.d.ts +9 -3
  260. package/dist/types/composables/usePopupSurfaceInteractions.d.ts +4 -2
  261. package/dist/types/composables/useSplitPaneDrag.d.ts +2 -2
  262. package/dist/types/composables/useSvgInstanceId.d.ts +1 -0
  263. package/dist/types/composables/useTable.d.ts +2 -0
  264. package/dist/types/composables/useTabularRowNavigation.d.ts +18 -0
  265. package/dist/types/index.d.ts +31 -3
  266. package/dist/types/internal/MultiSplitPane.vue.d.ts +10 -1
  267. package/dist/types/internal/PopupSurfacePanel.vue.d.ts +3 -0
  268. package/package.json +1 -1
@@ -1,192 +1,198 @@
1
- import { ref as R, computed as s, shallowRef as ce, watch as p, nextTick as ee, onActivated as Be, onDeactivated as He, onBeforeUnmount as Ue } from "vue";
2
- import { tableValue as se, tableToken as b, tableFilterPredicate as Je, tableCompare as Le } from "./table.js";
3
- function Ze(l, m, fe, i) {
4
- const f = R(!0), g = s(() => !!l.loading || !!l.disabled), z = s(
1
+ import { ref as R, computed as s, shallowRef as de, watch as U, nextTick as te, onActivated as Je, onDeactivated as Le, onBeforeUnmount as Qe } from "vue";
2
+ import { tableValue as ve, tableToken as b, tableFilterPredicate as Ye, tableCompare as Ze } from "./table.js";
3
+ import { tableSearchPredicate as $e } from "../components/HysTable/tableSearch.js";
4
+ function at(l, x, fe, i) {
5
+ const d = R(!0), g = s(() => !!l.loading || !!l.disabled), O = s(
5
6
  () => typeof l.pagination == "object" ? l.pagination : {}
6
- ), de = R(
7
- Array.isArray(l.defaultSort) ? [...l.defaultSort] : l.defaultSort ? [l.defaultSort] : l.defaultSort === void 0 ? m().filter((e) => e.defaultSortOrder).map((e) => ({ key: e.key, direction: e.defaultSortOrder })) : []
8
- ), te = R({
7
+ ), he = R(
8
+ Array.isArray(l.defaultSort) ? [...l.defaultSort] : l.defaultSort ? [l.defaultSort] : l.defaultSort === void 0 ? x().filter((e) => e.defaultSortOrder).map((e) => ({ key: e.key, direction: e.defaultSortOrder })) : []
9
+ ), ae = R({
9
10
  ...Object.fromEntries(
10
- m().filter((e) => e.defaultFilterValue).map((e) => [e.key, [...e.defaultFilterValue]])
11
+ x().filter((e) => e.defaultFilterValue).map((e) => [e.key, [...e.defaultFilterValue]])
11
12
  ),
12
13
  ...l.defaultFilters
13
- }), q = R(z.value.defaultPage ?? 1), _ = R(z.value.defaultPageSize ?? 10), ve = R([
14
+ }), K = R(O.value.defaultPage ?? 1), _ = R(O.value.defaultPageSize ?? 10), ge = R([
14
15
  ...l.defaultSelectedRowKeys ?? []
15
- ]), he = R([...l.defaultExpandedRowKeys ?? []]), ae = R(
16
+ ]), we = R([...l.defaultExpandedRowKeys ?? []]), ne = R(
16
17
  l.defaultCurrentRowKey ?? null
17
- ), x = ce(
18
+ ), m = de(
18
19
  /* @__PURE__ */ new Map()
19
- ), h = ce(
20
+ ), h = de(
20
21
  /* @__PURE__ */ new Map()
21
- ), A = ce(/* @__PURE__ */ new Map());
22
+ ), E = de(/* @__PURE__ */ new Map());
22
23
  let W = /* @__PURE__ */ new WeakSet();
23
- const ne = /* @__PURE__ */ new WeakMap();
24
- let Oe = 0;
25
- function le(e) {
26
- const a = typeof l.rowKey == "function" ? l.rowKey(e) : se(e, l.rowKey ?? "id");
27
- return typeof a == "string" || typeof a == "number" && Number.isFinite(a) ? a : (ne.has(e) || ne.set(e, "@hys-table-row:" + ++Oe), ne.get(e));
24
+ const le = /* @__PURE__ */ new WeakMap();
25
+ let Fe = 0;
26
+ function oe(e) {
27
+ const a = typeof l.rowKey == "function" ? l.rowKey(e) : ve(e, l.rowKey ?? "id");
28
+ return typeof a == "string" || typeof a == "number" && Number.isFinite(a) ? a : (le.has(e) || le.set(e, "@hys-table-row:" + ++Fe), le.get(e));
28
29
  }
29
- const d = s(() => {
30
+ const v = s(() => {
30
31
  const e = [], a = [], t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new WeakSet(), o = [...l.rows].reverse().map((r) => ({
31
32
  row: r,
32
33
  parent: void 0,
33
34
  depth: 0
34
35
  }));
35
36
  for (; o.length; ) {
36
- const { row: r, parent: u, depth: c } = o.pop();
37
+ const { row: r, parent: c, depth: u } = o.pop();
37
38
  if (!r || typeof r != "object" || n.has(r)) continue;
38
39
  n.add(r);
39
- const y = le(r), M = b(y);
40
- if (t.has(M)) continue;
41
- const F = l.treeMode ? se(r, l.childrenKey ?? "children") : void 0, w = x.value.get(M), D = (w == null ? void 0 : w.row) === r && w.override ? w.rows : Array.isArray(F) ? F : (w == null ? void 0 : w.row) === r ? w.rows : [], T = {
40
+ const y = oe(r), w = b(y);
41
+ if (t.has(w)) continue;
42
+ const A = l.treeMode ? ve(r, l.childrenKey ?? "children") : void 0, k = m.value.get(w), H = (k == null ? void 0 : k.row) === r && k.override ? k.rows : Array.isArray(A) ? A : (k == null ? void 0 : k.row) === r ? k.rows : [], N = {
42
43
  row: r,
43
44
  key: y,
44
- token: M,
45
+ token: w,
45
46
  index: a.length,
46
- depth: c,
47
- rootToken: (u == null ? void 0 : u.rootToken) ?? M,
48
- parent: u,
47
+ depth: u,
48
+ rootToken: (c == null ? void 0 : c.rootToken) ?? w,
49
+ parent: c,
49
50
  children: [],
50
- lazy: !!l.treeMode && !!l.loadChildren && !Array.isArray(F) && (w == null ? void 0 : w.row) !== r && !!se(r, l.hasChildrenKey ?? "hasChildren")
51
+ lazy: !!l.treeMode && !!l.loadChildren && !Array.isArray(A) && (k == null ? void 0 : k.row) !== r && !!ve(r, l.hasChildrenKey ?? "hasChildren")
51
52
  };
52
- if (t.set(M, T), a.push(T), ((u == null ? void 0 : u.children) ?? e).push(T), l.treeMode)
53
- for (let v = D.length - 1; v >= 0; v--)
54
- o.push({ row: D[v], parent: T, depth: c + 1 });
53
+ if (t.set(w, N), a.push(N), ((c == null ? void 0 : c.children) ?? e).push(N), l.treeMode)
54
+ for (let f = H.length - 1; f >= 0; f--)
55
+ o.push({ row: H[f], parent: N, depth: u + 1 });
55
56
  }
56
57
  return { roots: e, all: a, map: t };
57
- }), S = s(() => [
58
- ...new Set(l.selectedRowKeys ?? ve.value)
59
- ]), k = s(
60
- () => new Set(S.value.map(b))
61
- ), G = s(() => [
58
+ }), re = R(), G = s(() => l.search ?? re.value ?? l.defaultSearch ?? ""), M = s(() => [
59
+ ...new Set(l.selectedRowKeys ?? ge.value)
60
+ ]), S = s(
61
+ () => new Set(M.value.map(b))
62
+ ), V = s(() => [
62
63
  ...new Set(
63
- l.expandedRowKeys ?? (l.defaultExpandAll && !ge.value ? d.value.all.filter((e) => e.children.length || e.lazy || fe()).map((e) => e.key) : he.value)
64
+ l.expandedRowKeys ?? (l.defaultExpandAll && !ke.value ? v.value.all.filter((e) => e.children.length || e.lazy || fe()).map((e) => e.key) : we.value)
64
65
  )
65
- ]), ge = R(!1), V = s(() => new Set(G.value.map(b))), B = /* @__PURE__ */ new Map();
66
- p(
67
- [S, () => d.value.all, () => l.reserveSelection],
66
+ ]), ke = R(!1), X = s(() => new Set(V.value.map(b))), J = /* @__PURE__ */ new Map();
67
+ U(
68
+ [M, () => v.value.all, () => l.reserveSelection],
68
69
  () => {
69
70
  var a, t;
70
- for (const n of B.keys())
71
- k.value.has(n) || B.delete(n);
72
- for (const n of S.value) {
73
- const o = d.value.map.get(b(n));
74
- o && B.set(o.token, o.row);
71
+ for (const n of J.keys())
72
+ S.value.has(n) || J.delete(n);
73
+ for (const n of M.value) {
74
+ const o = v.value.map.get(b(n));
75
+ o && J.set(o.token, o.row);
75
76
  }
76
77
  if (!l.reserveSelection) {
77
- const n = S.value.filter(
78
- (o) => d.value.map.has(b(o))
78
+ const n = M.value.filter(
79
+ (o) => v.value.map.has(b(o))
79
80
  );
80
- n.length !== S.value.length && Z(n);
81
+ n.length !== M.value.length && p(n);
81
82
  }
82
83
  let e;
83
- for (const [n, o] of x.value)
84
- ((a = d.value.map.get(n)) == null ? void 0 : a.row) !== o.row && (e ?? (e = new Map(x.value)), e.delete(n));
85
- e && (x.value = e);
84
+ for (const [n, o] of m.value)
85
+ ((a = v.value.map.get(n)) == null ? void 0 : a.row) !== o.row && (e ?? (e = new Map(m.value)), e.delete(n));
86
+ e && (m.value = e);
86
87
  for (const [n, o] of h.value)
87
- ((t = d.value.map.get(n)) == null ? void 0 : t.row) !== o.row && I(n);
88
+ ((t = v.value.map.get(n)) == null ? void 0 : t.row) !== o.row && q(n);
88
89
  },
89
90
  { immediate: !0 }
90
91
  );
91
- function H(e) {
92
- const a = new Map(m().filter((n) => n.sortable).map((n) => [n.key, n])), t = /* @__PURE__ */ new Set();
92
+ function L(e) {
93
+ const a = new Map(x().filter((n) => n.sortable).map((n) => [n.key, n])), t = /* @__PURE__ */ new Set();
93
94
  return e.filter(
94
95
  (n) => ["asc", "desc"].includes(n.direction) && a.has(n.key) && !t.has(n.key) && (t.add(n.key), !0)
95
96
  ).slice(0, l.multiSort ? void 0 : 1).sort(
96
97
  (n, o) => {
97
- var r, u;
98
- return (((r = a.get(o.key)) == null ? void 0 : r.sortPriority) ?? 0) - (((u = a.get(n.key)) == null ? void 0 : u.sortPriority) ?? 0);
98
+ var r, c;
99
+ return (((r = a.get(o.key)) == null ? void 0 : r.sortPriority) ?? 0) - (((c = a.get(n.key)) == null ? void 0 : c.sortPriority) ?? 0);
99
100
  }
100
101
  );
101
102
  }
102
- const oe = s(() => new Map(
103
- m().filter((e) => e.sortable && e.sortOrder !== void 0).map((e) => [e.key, e.sortOrder])
104
- )), N = s(() => {
105
- if (l.sorts !== void 0) return H(l.sorts);
106
- if (l.sort !== void 0) return H(l.sort ? [l.sort] : []);
107
- const e = de.value.filter((t) => !oe.value.has(t.key)), a = m().flatMap(({ key: t }) => {
108
- const n = oe.value.get(t);
103
+ const ue = s(() => new Map(
104
+ x().filter((e) => e.sortable && e.sortOrder !== void 0).map((e) => [e.key, e.sortOrder])
105
+ )), j = s(() => {
106
+ if (l.sorts !== void 0) return L(l.sorts);
107
+ if (l.sort !== void 0) return L(l.sort ? [l.sort] : []);
108
+ const e = he.value.filter((t) => !ue.value.has(t.key)), a = x().flatMap(({ key: t }) => {
109
+ const n = ue.value.get(t);
109
110
  return n ? [{ key: t, direction: n }] : [];
110
111
  });
111
- return H([...a, ...e]);
112
- }), j = s(() => {
112
+ return L([...a, ...e]);
113
+ }), P = s(() => {
113
114
  if (l.filters !== void 0) return l.filters;
114
- const e = m().flatMap(
115
+ const e = x().flatMap(
115
116
  ({ key: a, filteredValue: t }) => t === void 0 ? [] : [[a, t]]
116
117
  );
117
- return e.length ? { ...te.value, ...Object.fromEntries(e) } : te.value;
118
- }), E = s(() => {
119
- const e = d.value, a = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Map(), n = Je(j.value, m());
118
+ return e.length ? { ...ae.value, ...Object.fromEntries(e) } : ae.value;
119
+ }), z = s(() => {
120
+ const e = v.value, a = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Map(), n = Ye(P.value, x()), o = l.serverMode ? void 0 : $e(
121
+ G.value,
122
+ x(),
123
+ l.searchColumns,
124
+ l.searchMethod
125
+ );
120
126
  if (!l.serverMode)
121
127
  for (let u = e.all.length - 1; u >= 0; u--) {
122
- const c = e.all[u];
123
- (n(c.row) || c.children.some((y) => a.has(y.token))) && a.add(c.token);
128
+ const y = e.all[u];
129
+ (n(y.row) && (!o || o(y.row)) || y.children.some((w) => a.has(w.token))) && a.add(y.token);
124
130
  }
125
- const o = Le(N.value, m());
126
- function r(u) {
127
- const c = l.serverMode ? [...u] : u.filter((y) => a.has(y.token));
128
- return l.serverMode || !N.value.length ? c : c.sort((y, M) => o(y.row, M.row) || y.index - M.index);
131
+ const r = Ze(j.value, x());
132
+ function c(u) {
133
+ const y = l.serverMode ? [...u] : u.filter((w) => a.has(w.token));
134
+ return l.serverMode || !j.value.length ? y : y.sort((w, A) => r(w.row, A.row) || w.index - A.index);
129
135
  }
130
136
  for (const u of e.all)
131
- u.children.length && t.set(u.token, r(u.children));
132
- return { roots: r(e.roots), children: t };
133
- }), X = s(() => {
134
- const e = l.pageSize ?? z.value.pageSize ?? _.value;
137
+ u.children.length && t.set(u.token, c(u.children));
138
+ return { roots: c(e.roots), children: t };
139
+ }), D = s(() => {
140
+ const e = l.pageSize ?? O.value.pageSize ?? _.value;
135
141
  return Number.isFinite(e) && e > 0 ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, Math.floor(e))) : 10;
136
- }), we = s(() => {
137
- const e = z.value.pageCount;
142
+ }), ye = s(() => {
143
+ const e = O.value.pageCount;
138
144
  return l.serverMode && e !== void 0 && Number.isFinite(e) && e > 0 ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, Math.floor(e))) : void 0;
139
- }), ke = s(() => {
140
- if (!l.serverMode) return E.value.roots.length;
141
- const e = l.total ?? z.value.total;
142
- return e === void 0 ? we.value === void 0 ? l.rows.length : void 0 : Number.isFinite(e) ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.floor(e))) : 0;
143
- }), re = s(
144
- () => we.value ?? Math.max(1, Math.ceil((ke.value ?? 0) / X.value))
145
- ), U = s(() => {
146
- const e = l.page ?? z.value.page ?? q.value;
145
+ }), Se = s(() => {
146
+ if (!l.serverMode) return z.value.roots.length;
147
+ const e = l.total ?? O.value.total;
148
+ return e === void 0 ? ye.value === void 0 ? l.rows.length : void 0 : Number.isFinite(e) ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.floor(e))) : 0;
149
+ }), ie = s(
150
+ () => ye.value ?? Math.max(1, Math.ceil((Se.value ?? 0) / D.value))
151
+ ), Q = s(() => {
152
+ const e = l.page ?? O.value.page ?? K.value;
147
153
  return Math.min(
148
- re.value,
154
+ ie.value,
149
155
  Math.max(1, Number.isFinite(e) ? Math.floor(e) : 1)
150
156
  );
151
- }), ye = s(
152
- () => !l.pagination || l.serverMode ? E.value.roots : E.value.roots.slice(
153
- (U.value - 1) * X.value,
154
- U.value * X.value
157
+ }), Me = s(
158
+ () => !l.pagination || l.serverMode ? z.value.roots : z.value.roots.slice(
159
+ (Q.value - 1) * D.value,
160
+ Q.value * D.value
155
161
  )
156
- ), J = s(() => {
157
- const e = [], a = [...ye.value].reverse();
162
+ ), Y = s(() => {
163
+ const e = [], a = [...Me.value].reverse();
158
164
  for (; a.length; ) {
159
165
  const t = a.pop();
160
- if (e.push(t), V.value.has(t.token) || !l.serverMode && Object.values(j.value).some((n) => n.length)) {
161
- const n = E.value.children.get(t.token) ?? [];
166
+ if (e.push(t), X.value.has(t.token) || !l.serverMode && (G.value.trim() || Object.values(P.value).some((n) => n.length))) {
167
+ const n = z.value.children.get(t.token) ?? [];
162
168
  for (let o = n.length - 1; o >= 0; o--) a.push(n[o]);
163
169
  }
164
170
  }
165
171
  return e;
166
- }), Se = s(() => {
167
- const e = [], a = [...E.value.roots].reverse();
172
+ }), be = s(() => {
173
+ const e = [], a = [...z.value.roots].reverse();
168
174
  for (; a.length; ) {
169
175
  const t = a.pop();
170
176
  e.push(t.row);
171
- const n = E.value.children.get(t.token) ?? [];
177
+ const n = z.value.children.get(t.token) ?? [];
172
178
  for (let o = n.length - 1; o >= 0; o--) a.push(n[o]);
173
179
  }
174
180
  return e;
175
- }), L = s(
176
- () => l.currentRowKey !== void 0 ? l.currentRowKey : ae.value
177
- ), Q = s(
181
+ }), Z = s(
182
+ () => l.currentRowKey !== void 0 ? l.currentRowKey : ne.value
183
+ ), $ = s(
178
184
  () => {
179
185
  var e;
180
- return L.value == null || (e = d.value.map.get(b(L.value))) == null ? void 0 : e.row;
186
+ return Z.value == null || (e = v.value.map.get(b(Z.value))) == null ? void 0 : e.row;
181
187
  }
182
- ), ue = s(() => {
188
+ ), ce = s(() => {
183
189
  const e = /* @__PURE__ */ new Set();
184
190
  if (l.checkStrictly !== !1) return e;
185
- for (let a = d.value.all.length - 1; a >= 0; a--) {
186
- const t = d.value.all[a];
191
+ for (let a = v.value.all.length - 1; a >= 0; a--) {
192
+ const t = v.value.all[a];
187
193
  t.children.some(
188
- (n) => e.has(n.token) || k.value.has(n.token)
189
- ) && !t.children.filter(C).every((n) => k.value.has(n.token)) && e.add(t.token);
194
+ (n) => e.has(n.token) || S.value.has(n.token)
195
+ ) && !t.children.filter(C).every((n) => S.value.has(n.token)) && e.add(t.token);
190
196
  }
191
197
  return e;
192
198
  });
@@ -194,313 +200,322 @@ function Ze(l, m, fe, i) {
194
200
  var a;
195
201
  return l.selectable !== !1 && ((a = l.getSelectionProps) == null ? void 0 : a.call(l, e.row, e.index).disabled) !== !0 && (typeof l.selectable != "function" || l.selectable(e.row, e.index));
196
202
  }
197
- const O = s(() => {
198
- const e = [], a = [...ye.value].reverse();
203
+ const F = s(() => {
204
+ const e = [], a = [...Me.value].reverse();
199
205
  for (; a.length; ) {
200
206
  const t = a.pop();
201
207
  C(t) && e.push(t);
202
- const n = E.value.children.get(t.token) ?? [];
208
+ const n = z.value.children.get(t.token) ?? [];
203
209
  for (let o = n.length - 1; o >= 0; o--) a.push(n[o]);
204
210
  }
205
211
  return e;
206
- }), ie = s(
207
- () => !!O.value.length && O.value.every((e) => k.value.has(e.token))
208
- ), Me = s(
209
- () => !ie.value && O.value.some(
210
- (e) => k.value.has(e.token) || ue.value.has(e.token)
212
+ }), se = s(
213
+ () => !!F.value.length && F.value.every((e) => S.value.has(e.token))
214
+ ), xe = s(
215
+ () => !se.value && F.value.some(
216
+ (e) => S.value.has(e.token) || ce.value.has(e.token)
211
217
  )
212
- ), be = s(() => ({
218
+ ), me = s(() => ({
213
219
  action: "page",
214
- page: U.value,
215
- pageSize: X.value,
216
- sorts: N.value.map((e) => ({ ...e })),
220
+ page: Q.value,
221
+ pageSize: D.value,
222
+ sorts: j.value.map((e) => ({ ...e })),
217
223
  filters: Object.fromEntries(
218
- Object.entries(j.value).map(([e, a]) => [e, [...a]])
224
+ Object.entries(P.value).map(([e, a]) => [e, [...a]])
219
225
  ),
220
- currentData: Se.value
226
+ ...l.search !== void 0 || l.defaultSearch !== void 0 || re.value !== void 0 ? { search: G.value } : {},
227
+ currentData: be.value
221
228
  }));
222
- function Y(e, a = {}) {
223
- const t = { ...be.value, ...a, action: e };
229
+ function B(e, a = {}) {
230
+ const t = { ...me.value, ...a, action: e };
224
231
  i("queryChange", t), i("change", t);
225
232
  }
226
- function Ke(e, a = "page") {
227
- if (g.value || !f.value) return;
228
- const t = Math.max(1, Math.min(re.value, Math.floor(e) || 1));
229
- q.value = t, i("update:page", t), i("pageChange", t), Y(a, { page: t });
233
+ function Te(e, a = "page") {
234
+ if (g.value || !d.value) return;
235
+ const t = Math.max(1, Math.min(ie.value, Math.floor(e) || 1));
236
+ K.value = t, i("update:page", t), i("pageChange", t), B(a, { page: t });
230
237
  }
231
- function Fe(e) {
232
- g.value || !f.value || !Number.isFinite(e) || e < 1 || (_.value = Math.floor(e), q.value = 1, i("update:pageSize", _.value), i("pageSizeChange", _.value), i("update:page", 1), i("pageChange", 1), Y("pageSize", { page: 1, pageSize: _.value }));
238
+ function Ne(e) {
239
+ l.disabled || !d.value || e === G.value || (l.search === void 0 && (re.value = e), K.value = 1, i("update:search", e), i("update:page", 1), B("search", { search: e, page: 1 }));
233
240
  }
234
- function xe(e) {
235
- if (g.value || !f.value) return;
236
- const a = H(
241
+ U(() => l.search, (e, a) => {
242
+ e !== a && (K.value = 1);
243
+ });
244
+ function je(e) {
245
+ g.value || !d.value || !Number.isFinite(e) || e < 1 || (_.value = Math.floor(e), K.value = 1, i("update:pageSize", _.value), i("pageSizeChange", _.value), i("update:page", 1), i("pageChange", 1), B("pageSize", { page: 1, pageSize: _.value }));
246
+ }
247
+ function Ce(e) {
248
+ if (g.value || !d.value) return;
249
+ const a = L(
237
250
  Array.isArray(e) ? [...e] : e ? [e] : []
238
251
  );
239
- de.value = l.sorts !== void 0 || l.sort !== void 0 ? a : a.filter((t) => !oe.value.has(t.key)), q.value = 1, i("update:sort", a[0] ?? null), i("update:sorts", a), i("sortChange", a[0] ?? null, a), i("update:page", 1), Y("sort", { sorts: a, page: 1 });
252
+ he.value = l.sorts !== void 0 || l.sort !== void 0 ? a : a.filter((t) => !ue.value.has(t.key)), K.value = 1, i("update:sort", a[0] ?? null), i("update:sorts", a), i("sortChange", a[0] ?? null, a), i("update:page", 1), B("sort", { sorts: a, page: 1 });
240
253
  }
241
- function me(e, a) {
242
- var o, r, u;
243
- const t = (o = N.value.find((c) => c.key === e.key)) == null ? void 0 : o.direction, n = (r = e.sortOrders) != null && r.length ? e.sortOrders : (u = l.sortOrders) != null && u.length ? l.sortOrders : ["asc", "desc", null];
254
+ function Ae(e, a) {
255
+ var o, r, c;
256
+ const t = (o = j.value.find((u) => u.key === e.key)) == null ? void 0 : o.direction, n = (r = e.sortOrders) != null && r.length ? e.sortOrders : (c = l.sortOrders) != null && c.length ? l.sortOrders : ["asc", "desc", null];
244
257
  return a ? t === a ? null : a : n[(n.indexOf(t ?? null) + 1) % n.length];
245
258
  }
246
- function Te(e, a) {
259
+ function Pe(e, a) {
247
260
  if (!e.sortable) return;
248
- const t = me(e, a), n = l.multiSort ? N.value.filter((o) => o.key !== e.key) : [];
249
- t && n.push({ key: e.key, direction: t }), xe(n);
261
+ const t = Ae(e, a), n = l.multiSort ? j.value.filter((o) => o.key !== e.key) : [];
262
+ t && n.push({ key: e.key, direction: t }), Ce(n);
250
263
  }
251
- function Ce(e) {
252
- if (g.value || !f.value) return;
253
- const a = new Set(m().filter((t) => t.filteredValue !== void 0).map((t) => t.key));
254
- te.value = l.filters !== void 0 || !a.size ? e : Object.fromEntries(Object.entries(e).filter(([t]) => !a.has(t))), q.value = 1, i("update:filters", e), i("filterChange", e), i("update:page", 1), Y("filter", { filters: e, page: 1 });
264
+ function Re(e) {
265
+ if (g.value || !d.value) return;
266
+ const a = new Set(x().filter((t) => t.filteredValue !== void 0).map((t) => t.key));
267
+ ae.value = l.filters !== void 0 || !a.size ? e : Object.fromEntries(Object.entries(e).filter(([t]) => !a.has(t))), K.value = 1, i("update:filters", e), i("filterChange", e), i("update:page", 1), B("filter", { filters: e, page: 1 });
255
268
  }
256
- function Ne(e, a) {
257
- m().some((t) => t.key === e) && Ce({ ...j.value, [e]: [...a] });
269
+ function Ie(e, a) {
270
+ x().some((t) => t.key === e) && Re({ ...P.value, [e]: [...a] });
258
271
  }
259
- function je(e) {
260
- Ce(
272
+ function qe(e) {
273
+ Re(
261
274
  e ? Object.fromEntries(
262
- Object.entries(j.value).filter(
275
+ Object.entries(P.value).filter(
263
276
  ([a]) => !e.includes(a)
264
277
  )
265
278
  ) : {}
266
279
  );
267
280
  }
268
- function P(e) {
269
- return d.value.map.get(
270
- b(typeof e == "object" ? le(e) : e)
281
+ function I(e) {
282
+ return v.value.map.get(
283
+ b(typeof e == "object" ? oe(e) : e)
271
284
  );
272
285
  }
273
- function K() {
274
- return S.value.flatMap((e) => {
286
+ function T() {
287
+ return M.value.flatMap((e) => {
275
288
  var n;
276
- const a = b(e), t = ((n = d.value.map.get(a)) == null ? void 0 : n.row) ?? (l.reserveSelection ? B.get(a) : void 0);
289
+ const a = b(e), t = ((n = v.value.map.get(a)) == null ? void 0 : n.row) ?? (l.reserveSelection ? J.get(a) : void 0);
277
290
  return t ? [t] : [];
278
291
  });
279
292
  }
280
- async function Z(e) {
281
- if (g.value || !f.value) return !1;
293
+ async function p(e) {
294
+ if (g.value || !d.value) return !1;
282
295
  const a = [...new Set(e)];
283
- ve.value = a, i("update:selectedRowKeys", a), await ee();
284
- const t = f.value && a.length === S.value.length && a.every((n) => k.value.has(b(n)));
285
- return t && i("selectionChange", K(), S.value), t;
296
+ ge.value = a, i("update:selectedRowKeys", a), await te();
297
+ const t = d.value && a.length === M.value.length && a.every((n) => S.value.has(b(n)));
298
+ return t && i("selectionChange", T(), M.value), t;
286
299
  }
287
- function Pe(e) {
300
+ function _e(e) {
288
301
  if (!(l.checkStrictly !== !1 || l.selectionType === "radio"))
289
- for (let a = d.value.all.length - 1; a >= 0; a--) {
290
- const t = d.value.all[a], n = t.children.filter(C);
302
+ for (let a = v.value.all.length - 1; a >= 0; a--) {
303
+ const t = v.value.all[a], n = t.children.filter(C);
291
304
  !n.length || !C(t) || (n.every((o) => e.has(o.token)) ? e.add(t.token) : e.delete(t.token));
292
305
  }
293
306
  }
294
- function $(e) {
295
- Pe(e);
296
- const a = S.value.filter((t) => e.has(b(t)));
297
- for (const t of d.value.all)
298
- e.has(t.token) && !k.value.has(t.token) && a.push(t.key);
299
- return Z(a);
307
+ function ee(e) {
308
+ _e(e);
309
+ const a = M.value.filter((t) => e.has(b(t)));
310
+ for (const t of v.value.all)
311
+ e.has(t.token) && !S.value.has(t.token) && a.push(t.key);
312
+ return p(a);
300
313
  }
301
- let Ae;
302
- async function Ie(e, a, t = !1) {
303
- const n = P(e), o = typeof t == "boolean" ? t : t.range, r = typeof t == "object" && t.ignoreSelectable;
304
- if (!n || !r && !C(n) || g.value || !f.value)
314
+ let Ee;
315
+ async function We(e, a, t = !1) {
316
+ const n = I(e), o = typeof t == "boolean" ? t : t.range, r = typeof t == "object" && t.ignoreSelectable;
317
+ if (!n || !r && !C(n) || g.value || !d.value)
305
318
  return !1;
306
- const u = a ?? !k.value.has(n.token);
319
+ const c = a ?? !S.value.has(n.token);
307
320
  if (l.selectionType === "radio") {
308
- const v = await Z(u ? [n.key] : []);
309
- return v && i("select", K(), n.row, u), v;
321
+ const f = await p(c ? [n.key] : []);
322
+ return f && i("select", T(), n.row, c), f;
310
323
  }
311
- const c = o && l.rangeSelection ? J.value.findIndex((v) => v.token === Ae) : -1, y = J.value.findIndex((v) => v.token === n.token), M = c >= 0 && y >= 0 ? J.value.slice(Math.min(c, y), Math.max(c, y) + 1) : [n], F = new Set(k.value), w = [...M], D = /* @__PURE__ */ new Set();
312
- for (; w.length; ) {
313
- const v = w.pop();
314
- D.has(v.token) || (D.add(v.token), (r && v === n || C(v)) && (u ? F.add(v.token) : F.delete(v.token)), l.checkStrictly === !1 && w.push(...v.children));
324
+ const u = o && l.rangeSelection ? Y.value.findIndex((f) => f.token === Ee) : -1, y = Y.value.findIndex((f) => f.token === n.token), w = u >= 0 && y >= 0 ? Y.value.slice(Math.min(u, y), Math.max(u, y) + 1) : [n], A = new Set(S.value), k = [...w], H = /* @__PURE__ */ new Set();
325
+ for (; k.length; ) {
326
+ const f = k.pop();
327
+ H.has(f.token) || (H.add(f.token), (r && f === n || C(f)) && (c ? A.add(f.token) : A.delete(f.token)), l.checkStrictly === !1 && k.push(...f.children));
315
328
  }
316
- const T = await $(F);
317
- return T && (Ae = n.token, i("select", K(), n.row, u), M.length > 1 && i(
329
+ const N = await ee(A);
330
+ return N && (Ee = n.token, i("select", T(), n.row, c), w.length > 1 && i(
318
331
  "selectRange",
319
- K(),
320
- M.filter(C).map((v) => v.row),
321
- u
322
- )), T;
332
+ T(),
333
+ w.filter(C).map((f) => f.row),
334
+ c
335
+ )), N;
323
336
  }
324
- async function qe(e) {
337
+ async function Ge(e) {
325
338
  if (l.selectionType === "radio") return !1;
326
- const a = e ?? (Me.value && l.selectOnIndeterminate === !1 ? !1 : !ie.value), t = k.value, n = new Set(t), o = O.value;
327
- for (const u of o)
328
- a ? n.add(u.token) : n.delete(u.token);
329
- const r = await $(n);
339
+ const a = e ?? (xe.value && l.selectOnIndeterminate === !1 ? !1 : !se.value), t = S.value, n = new Set(t), o = F.value;
340
+ for (const c of o)
341
+ a ? n.add(c.token) : n.delete(c.token);
342
+ const r = await ee(n);
330
343
  if (r) {
331
- const u = o.filter(({ token: c }) => t.has(c) !== n.has(c));
332
- i("selectAll", K(), a, u.map(({ row: c }) => c));
344
+ const c = o.filter(({ token: u }) => t.has(u) !== n.has(u));
345
+ i("selectAll", T(), a, c.map(({ row: u }) => u));
333
346
  }
334
347
  return r;
335
348
  }
336
- async function _e() {
337
- if (l.selectionType === "radio" || g.value || !f.value)
349
+ async function Ve() {
350
+ if (l.selectionType === "radio" || g.value || !d.value)
338
351
  return !1;
339
- const e = new Set(k.value);
340
- for (const t of O.value)
352
+ const e = new Set(S.value);
353
+ for (const t of F.value)
341
354
  (l.checkStrictly !== !1 || !t.children.some(C)) && (e.has(t.token) ? e.delete(t.token) : e.add(t.token));
342
- const a = await $(e);
343
- return a && i("selectInvert", K(), S.value), a;
355
+ const a = await ee(e);
356
+ return a && i("selectInvert", T(), M.value), a;
344
357
  }
345
- async function We(e, a = O.value) {
346
- if (l.selectionType === "radio" || g.value || !f.value) return !1;
347
- const t = new Set(e.map(b)), n = new Set(k.value);
358
+ async function Xe(e, a = F.value) {
359
+ if (l.selectionType === "radio" || g.value || !d.value) return !1;
360
+ const t = new Set(e.map(b)), n = new Set(S.value);
348
361
  for (const o of a) {
349
- const r = d.value.map.get(o.token);
362
+ const r = v.value.map.get(o.token);
350
363
  (r == null ? void 0 : r.row) !== o.row || !C(r) || (t.has(o.token) ? n.add(o.token) : n.delete(o.token));
351
364
  }
352
- return $(n);
365
+ return ee(n);
353
366
  }
354
- async function Ge() {
355
- const e = S.value.length > 0, a = await Z([]);
367
+ async function De() {
368
+ const e = M.value.length > 0, a = await p([]);
356
369
  return e && a && i("selectNone"), a;
357
370
  }
358
- async function Ve(e) {
359
- if (g.value || !f.value) return !1;
360
- const a = e == null ? void 0 : P(e);
371
+ async function Be(e) {
372
+ if (g.value || !d.value) return !1;
373
+ const a = e == null ? void 0 : I(e);
361
374
  if (e != null && !a) return !1;
362
- const t = Q.value;
363
- ae.value = (a == null ? void 0 : a.key) ?? null, i("update:currentRowKey", ae.value), await ee();
364
- const n = f.value && L.value === ((a == null ? void 0 : a.key) ?? null);
365
- return n && Q.value !== t && i("currentChange", Q.value, t), n;
375
+ const t = $.value;
376
+ ne.value = (a == null ? void 0 : a.key) ?? null, i("update:currentRowKey", ne.value), await te();
377
+ const n = d.value && Z.value === ((a == null ? void 0 : a.key) ?? null);
378
+ return n && $.value !== t && i("currentChange", $.value, t), n;
366
379
  }
367
- function I(e) {
380
+ function q(e) {
368
381
  const a = h.value.get(e);
369
382
  if (!a) return;
370
383
  a.controller.abort(), W.delete(a.row);
371
384
  const t = new Map(h.value);
372
385
  t.delete(e), h.value = t;
373
386
  }
374
- async function Re(e, a = !1) {
375
- var u;
376
- const t = P(e), n = l.loadChildren;
377
- if (!t || !n || !l.treeMode || g.value || !f.value || h.value.has(t.token))
387
+ async function ze(e, a = !1) {
388
+ var c;
389
+ const t = I(e), n = l.loadChildren;
390
+ if (!t || !n || !l.treeMode || g.value || !d.value || h.value.has(t.token))
378
391
  return !1;
379
- if (!a && !t.lazy && x.value.has(t.token)) return !0;
392
+ if (!a && !t.lazy && m.value.has(t.token)) return !0;
380
393
  W.add(t.row);
381
394
  const o = { row: t.row, controller: new AbortController() };
382
395
  h.value = new Map(h.value).set(t.token, o);
383
- const r = new Map(A.value);
384
- r.delete(t.token), A.value = r;
396
+ const r = new Map(E.value);
397
+ r.delete(t.token), E.value = r;
385
398
  try {
386
- const c = await n(t.row, {
399
+ const u = await n(t.row, {
387
400
  signal: o.controller.signal,
388
401
  key: t.key,
389
402
  depth: t.depth
390
403
  });
391
- if (!f.value || o.controller.signal.aborted || h.value.get(t.token) !== o || ((u = d.value.map.get(t.token)) == null ? void 0 : u.row) !== t.row || l.loadChildren !== n)
404
+ if (!d.value || o.controller.signal.aborted || h.value.get(t.token) !== o || ((c = v.value.map.get(t.token)) == null ? void 0 : c.row) !== t.row || l.loadChildren !== n)
392
405
  return !1;
393
- if (!Array.isArray(c))
406
+ if (!Array.isArray(u))
394
407
  throw new TypeError("loadChildren must return an array");
395
- return x.value = new Map(x.value).set(t.token, {
408
+ return m.value = new Map(m.value).set(t.token, {
396
409
  row: t.row,
397
- rows: c
398
- }), i("load", t.row, c), !0;
399
- } catch (c) {
400
- return f.value && !o.controller.signal.aborted && h.value.get(t.token) === o && (A.value = new Map(A.value).set(t.token, c), i("loadError", t.row, c)), !1;
410
+ rows: u
411
+ }), i("load", t.row, u), !0;
412
+ } catch (u) {
413
+ return d.value && !o.controller.signal.aborted && h.value.get(t.token) === o && (E.value = new Map(E.value).set(t.token, u), i("loadError", t.row, u)), !1;
401
414
  } finally {
402
415
  if (h.value.get(t.token) === o) {
403
- const c = new Map(h.value);
404
- c.delete(t.token), h.value = c;
416
+ const u = new Map(h.value);
417
+ u.delete(t.token), h.value = u;
405
418
  }
406
419
  }
407
420
  }
408
- function Ee(e) {
421
+ function Oe(e) {
409
422
  var a;
410
423
  return ((a = l.rowExpandable) == null ? void 0 : a.call(l, e.row)) !== !1 && (e.children.length > 0 || e.lazy || !!l.expandable || fe());
411
424
  }
412
- async function Xe(e, a) {
425
+ async function He(e, a) {
413
426
  var r;
414
- const t = P(e);
415
- if (!t || !l.treeMode || g.value || !f.value || !Array.isArray(a))
427
+ const t = I(e);
428
+ if (!t || !l.treeMode || g.value || !d.value || !Array.isArray(a))
416
429
  return !1;
417
- I(t.token), W.add(t.row);
430
+ q(t.token), W.add(t.row);
418
431
  const n = { row: t.row, rows: [...a], override: !0 };
419
- x.value = new Map(x.value).set(t.token, n);
420
- const o = new Map(A.value);
421
- return o.delete(t.token), A.value = o, await ee(), !f.value || x.value.get(t.token) !== n || ((r = d.value.map.get(t.token)) == null ? void 0 : r.row) !== t.row ? !1 : (i("childrenChange", t.row, n.rows), !0);
432
+ m.value = new Map(m.value).set(t.token, n);
433
+ const o = new Map(E.value);
434
+ return o.delete(t.token), E.value = o, await te(), !d.value || m.value.get(t.token) !== n || ((r = v.value.map.get(t.token)) == null ? void 0 : r.row) !== t.row ? !1 : (i("childrenChange", t.row, n.rows), !0);
422
435
  }
423
- async function De(e, a) {
424
- const t = P(e);
425
- if (!t || !Ee(t) || g.value || !f.value) return !1;
426
- const n = a ?? !V.value.has(t.token), o = G.value.filter((u) => b(u) !== t.token);
427
- return n && o.push(t.key), ge.value = !0, he.value = o, i("update:expandedRowKeys", o), await ee(), f.value && V.value.has(t.token) === n ? (i("expandChange", t.row, n, G.value), n || I(t.token), !0) : !1;
436
+ async function Ue(e, a) {
437
+ const t = I(e);
438
+ if (!t || !Oe(t) || g.value || !d.value) return !1;
439
+ const n = a ?? !X.value.has(t.token), o = V.value.filter((c) => b(c) !== t.token);
440
+ return n && o.push(t.key), ke.value = !0, we.value = o, i("update:expandedRowKeys", o), await te(), d.value && X.value.has(t.token) === n ? (i("expandChange", t.row, n, V.value), n || q(t.token), !0) : !1;
428
441
  }
429
- function ze() {
430
- f.value = !1;
431
- for (const e of [...h.value.keys()]) I(e);
442
+ function Ke() {
443
+ d.value = !1;
444
+ for (const e of [...h.value.keys()]) q(e);
432
445
  }
433
- return p(
446
+ return U(
434
447
  () => l.loadChildren,
435
448
  () => {
436
- for (const e of [...h.value.keys()]) I(e);
437
- x.value = /* @__PURE__ */ new Map(), A.value = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new WeakSet();
449
+ for (const e of [...h.value.keys()]) q(e);
450
+ m.value = /* @__PURE__ */ new Map(), E.value = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new WeakSet();
438
451
  }
439
- ), p(g, (e) => {
440
- if (e) for (const a of [...h.value.keys()]) I(a);
441
- }), p(
442
- [G, () => d.value.all, () => h.value.size, f, g],
452
+ ), U(g, (e) => {
453
+ if (e) for (const a of [...h.value.keys()]) q(a);
454
+ }), U(
455
+ [V, () => v.value.all, () => h.value.size, d, g],
443
456
  () => {
444
457
  var a;
445
- if (!f.value || g.value) return;
458
+ if (!d.value || g.value) return;
446
459
  let e = Math.max(0, 4 - h.value.size);
447
- for (const t of d.value.all) {
460
+ for (const t of v.value.all) {
448
461
  if (!e) break;
449
- t.lazy && V.value.has(t.token) && !W.has(t.row) && !A.value.has(t.token) && ((a = l.rowExpandable) == null ? void 0 : a.call(l, t.row)) !== !1 && (e--, Re(t.key));
462
+ t.lazy && X.value.has(t.token) && !W.has(t.row) && !E.value.has(t.token) && ((a = l.rowExpandable) == null ? void 0 : a.call(l, t.row)) !== !1 && (e--, ze(t.key));
450
463
  }
451
464
  },
452
465
  { immediate: !0, flush: "post" }
453
- ), Be(() => f.value = !0), He(ze), Ue(ze), {
454
- live: f,
466
+ ), Je(() => d.value = !0), Le(Ke), Qe(Ke), {
467
+ live: d,
455
468
  busy: g,
456
- graph: d,
457
- rowId: le,
458
- selectedKeys: S,
459
- selectedSet: k,
460
- expandedKeys: G,
461
- expandedSet: V,
462
- halfSet: ue,
469
+ graph: v,
470
+ rowId: oe,
471
+ selectedKeys: M,
472
+ selectedSet: S,
473
+ expandedKeys: V,
474
+ expandedSet: X,
475
+ halfSet: ce,
463
476
  eligible: C,
464
- allSelected: ie,
465
- someSelected: Me,
466
- selectionPage: O,
467
- sorts: N,
468
- filters: j,
469
- processed: E,
470
- filteredRows: Se,
471
- display: J,
472
- page: U,
473
- pageSize: X,
474
- pageCount: re,
475
- paginationTotal: ke,
476
- pagination: z,
477
- currentKey: L,
478
- currentRow: Q,
479
- query: be,
477
+ allSelected: se,
478
+ someSelected: xe,
479
+ selectionPage: F,
480
+ sorts: j,
481
+ filters: P,
482
+ search: G,
483
+ processed: z,
484
+ filteredRows: be,
485
+ display: Y,
486
+ page: Q,
487
+ pageSize: D,
488
+ pageCount: ie,
489
+ paginationTotal: Se,
490
+ pagination: O,
491
+ currentKey: Z,
492
+ currentRow: $,
493
+ query: me,
480
494
  pending: h,
481
- loadErrors: A,
482
- canExpand: Ee,
483
- nextSortOrder: me,
484
- toggleSort: Te,
485
- setSort: xe,
486
- setFilter: Ne,
487
- clearFilter: je,
488
- requestPage: Ke,
489
- changeSize: Fe,
490
- toggleRowSelection: Ie,
491
- toggleAllSelection: qe,
492
- invertSelection: _e,
493
- clearSelection: Ge,
494
- selectPage: We,
495
- getSelectionRows: K,
496
- getHalfSelectionRows: () => d.value.all.filter((e) => ue.value.has(e.token)).map((e) => e.row),
497
- setCurrentRow: Ve,
498
- toggleRowExpansion: De,
499
- loadRow: Re,
500
- updateKeyChildren: Xe,
501
- find: P
495
+ loadErrors: E,
496
+ canExpand: Oe,
497
+ nextSortOrder: Ae,
498
+ toggleSort: Pe,
499
+ setSort: Ce,
500
+ setFilter: Ie,
501
+ clearFilter: qe,
502
+ setSearch: Ne,
503
+ requestPage: Te,
504
+ changeSize: je,
505
+ toggleRowSelection: We,
506
+ toggleAllSelection: Ge,
507
+ invertSelection: Ve,
508
+ clearSelection: De,
509
+ selectPage: Xe,
510
+ getSelectionRows: T,
511
+ getHalfSelectionRows: () => v.value.all.filter((e) => ce.value.has(e.token)).map((e) => e.row),
512
+ setCurrentRow: Be,
513
+ toggleRowExpansion: Ue,
514
+ loadRow: ze,
515
+ updateKeyChildren: He,
516
+ find: I
502
517
  };
503
518
  }
504
519
  export {
505
- Ze as useTable
520
+ at as useTable
506
521
  };