hys-ui 0.2.0 → 0.4.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 (261) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +68 -59
  3. package/dist/components/HysAlert/HysAlert.vue.js +5 -54
  4. package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
  5. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
  6. package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
  7. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
  8. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
  9. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
  10. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
  11. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
  12. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
  13. package/dist/components/HysButton/HysButton.vue.js +2 -2
  14. package/dist/components/HysButton/HysButton2.vue.js +227 -60
  15. package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
  16. package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
  17. package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
  18. package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
  19. package/dist/components/HysCascader/HysCascader.vue.js +2 -2
  20. package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
  21. package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
  22. package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
  23. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  24. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
  25. package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
  26. package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
  27. package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
  28. package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
  29. package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
  30. package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
  31. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  32. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
  33. package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
  34. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
  35. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
  36. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
  37. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  38. package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
  39. package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
  40. package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
  41. package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
  42. package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
  43. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  44. package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
  45. package/dist/components/HysMention/HysMention.vue.js +1 -1
  46. package/dist/components/HysMention/HysMention2.vue.js +1092 -142
  47. package/dist/components/HysModal/HysModal.vue.js +2 -2
  48. package/dist/components/HysModal/HysModal2.vue.js +491 -85
  49. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  50. package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
  51. package/dist/components/HysPopover/HysPopover.vue.js +5 -91
  52. package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
  53. package/dist/components/HysProgress/HysProgress.vue.js +2 -2
  54. package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
  55. package/dist/components/HysSearch/HysSearch.vue.js +5 -82
  56. package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
  57. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  58. package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
  59. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  60. package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
  61. package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
  62. package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
  63. package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
  64. package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
  65. package/dist/components/HysTable/HysTable.vue.js +2 -2
  66. package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
  67. package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
  68. package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
  69. package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
  70. package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
  71. package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
  72. package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
  73. package/dist/components/HysTour/HysTour.vue.js +291 -63
  74. package/dist/components/HysTour/HysTour3.vue.js +5 -0
  75. package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
  76. package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
  77. package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
  78. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
  79. package/dist/components/HysTree/HysTree.vue.js +2 -2
  80. package/dist/components/HysTree/HysTree2.vue.js +195 -184
  81. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
  82. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
  83. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  84. package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
  85. package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
  86. package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
  87. package/dist/composables/buttonGroup.js +12 -0
  88. package/dist/composables/color.js +97 -0
  89. package/dist/composables/dataGrid.js +68 -0
  90. package/dist/composables/drawer.js +17 -0
  91. package/dist/composables/feedback.js +14 -0
  92. package/dist/composables/floatingPosition.js +18 -0
  93. package/dist/composables/mentionDocument.js +79 -0
  94. package/dist/composables/mentionEditor.js +58 -0
  95. package/dist/composables/menu.js +96 -0
  96. package/dist/composables/modal.js +14 -0
  97. package/dist/composables/overlayManager.js +48 -18
  98. package/dist/composables/progress.js +94 -0
  99. package/dist/composables/selectOptions.js +44 -38
  100. package/dist/composables/splitPaneSizes.js +58 -0
  101. package/dist/composables/table.js +128 -105
  102. package/dist/composables/tagInput.js +16 -0
  103. package/dist/composables/timeline.js +19 -0
  104. package/dist/composables/transfer.js +19 -17
  105. package/dist/composables/upload.js +55 -0
  106. package/dist/composables/uploadRequest.js +58 -0
  107. package/dist/composables/useAlert.js +124 -0
  108. package/dist/composables/useColorPicker.js +402 -0
  109. package/dist/composables/useContextMenu.js +514 -0
  110. package/dist/composables/useDataGridRemote.js +67 -0
  111. package/dist/composables/useDialog.js +86 -43
  112. package/dist/composables/useDrawerPush.js +33 -0
  113. package/dist/composables/useDrawerResize.js +221 -0
  114. package/dist/composables/useFloating.js +118 -80
  115. package/dist/composables/useHysModal.js +185 -0
  116. package/dist/composables/useMentionCaret.js +81 -0
  117. package/dist/composables/useMentionList.js +81 -0
  118. package/dist/composables/useMentionModel.js +90 -0
  119. package/dist/composables/useMentionOptions.js +421 -0
  120. package/dist/composables/useModal.js +295 -0
  121. package/dist/composables/useModalInteraction.js +394 -0
  122. package/dist/composables/usePopupSurface.js +458 -0
  123. package/dist/composables/useSplitPaneDrag.js +52 -0
  124. package/dist/composables/useSplitPaneStorage.js +38 -0
  125. package/dist/composables/useTable.js +344 -312
  126. package/dist/composables/useTableSticky.js +79 -0
  127. package/dist/composables/useTagInput.js +313 -0
  128. package/dist/composables/useTourLayout.js +129 -0
  129. package/dist/composables/useTransferMotion.js +185 -0
  130. package/dist/composables/useUpload.js +472 -0
  131. package/dist/composables/useUploadModel.js +65 -0
  132. package/dist/composables/useUploadRequests.js +266 -0
  133. package/dist/composables/useVirtualTableLayout.js +277 -0
  134. package/dist/composables/virtualTable.js +43 -0
  135. package/dist/config.js +11 -11
  136. package/dist/index.js +175 -153
  137. package/dist/internal/MultiSplitPane.vue.js +305 -0
  138. package/dist/internal/MultiSplitPane2.vue.js +4 -0
  139. package/dist/internal/PopupReference.js +39 -0
  140. package/dist/internal/PopupSurfacePanel.vue.js +7 -0
  141. package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
  142. package/dist/motion/PopupMotion.js +105 -0
  143. package/dist/motion/popup.js +10 -0
  144. package/dist/style.css +1 -1
  145. package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
  146. package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
  147. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
  148. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
  149. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
  150. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
  151. package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
  152. package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
  153. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
  154. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
  155. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
  156. package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
  157. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
  158. package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
  159. package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
  160. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
  161. package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
  162. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
  163. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +3 -3
  164. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
  165. package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
  166. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
  167. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
  168. package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -39
  169. package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
  170. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
  171. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
  172. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
  173. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
  174. package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
  175. package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
  176. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
  177. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
  178. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
  179. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
  180. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
  181. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
  182. package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
  183. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
  184. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
  185. package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
  186. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
  187. package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -8
  188. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
  189. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
  190. package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
  191. package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
  192. package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
  193. package/dist/types/composables/autocomplete.d.ts +3 -0
  194. package/dist/types/composables/avatar.d.ts +3 -0
  195. package/dist/types/composables/buttonGroup.d.ts +9 -0
  196. package/dist/types/composables/cascader.d.ts +3 -0
  197. package/dist/types/composables/color.d.ts +97 -0
  198. package/dist/types/composables/dataGrid.d.ts +100 -0
  199. package/dist/types/composables/datePicker.d.ts +3 -0
  200. package/dist/types/composables/drawer.d.ts +102 -0
  201. package/dist/types/composables/feedback.d.ts +98 -0
  202. package/dist/types/composables/floatingPosition.d.ts +14 -0
  203. package/dist/types/composables/formContext.d.ts +2 -0
  204. package/dist/types/composables/mention.d.ts +284 -0
  205. package/dist/types/composables/mentionDocument.d.ts +15 -0
  206. package/dist/types/composables/mentionEditor.d.ts +7 -0
  207. package/dist/types/composables/menu.d.ts +183 -0
  208. package/dist/types/composables/modal.d.ts +185 -0
  209. package/dist/types/composables/overlayManager.d.ts +7 -3
  210. package/dist/types/composables/popupSurface.d.ts +83 -0
  211. package/dist/types/composables/progress.d.ts +92 -0
  212. package/dist/types/composables/selectOptions.d.ts +7 -0
  213. package/dist/types/composables/splitPaneSizes.d.ts +11 -0
  214. package/dist/types/composables/table.d.ts +119 -6
  215. package/dist/types/composables/tagInput.d.ts +96 -0
  216. package/dist/types/composables/timeline.d.ts +82 -0
  217. package/dist/types/composables/tour.d.ts +68 -0
  218. package/dist/types/composables/transfer.d.ts +7 -0
  219. package/dist/types/composables/tree.d.ts +3 -0
  220. package/dist/types/composables/treeSelect.d.ts +3 -0
  221. package/dist/types/composables/upload.d.ts +202 -0
  222. package/dist/types/composables/uploadRequest.d.ts +3 -0
  223. package/dist/types/composables/useAlert.d.ts +21 -0
  224. package/dist/types/composables/useCascader.d.ts +1 -1
  225. package/dist/types/composables/useColorPicker.d.ts +101 -0
  226. package/dist/types/composables/useContextMenu.d.ts +81 -0
  227. package/dist/types/composables/useDataGridRemote.d.ts +15 -0
  228. package/dist/types/composables/useDialog.d.ts +16 -3
  229. package/dist/types/composables/useDrawerPush.d.ts +6 -0
  230. package/dist/types/composables/useDrawerResize.d.ts +27 -0
  231. package/dist/types/composables/useFloating.d.ts +22 -3
  232. package/dist/types/composables/useHysModal.d.ts +44 -0
  233. package/dist/types/composables/useMentionCaret.d.ts +6 -0
  234. package/dist/types/composables/useMentionList.d.ts +23 -0
  235. package/dist/types/composables/useMentionModel.d.ts +14 -0
  236. package/dist/types/composables/useMentionOptions.d.ts +26 -0
  237. package/dist/types/composables/useModal.d.ts +62 -0
  238. package/dist/types/composables/useModalInteraction.d.ts +27 -0
  239. package/dist/types/composables/usePopupSurface.d.ts +3341 -0
  240. package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
  241. package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
  242. package/dist/types/composables/useTable.d.ts +7 -3
  243. package/dist/types/composables/useTableSticky.d.ts +22 -0
  244. package/dist/types/composables/useTagInput.d.ts +66 -0
  245. package/dist/types/composables/useTourLayout.d.ts +33 -0
  246. package/dist/types/composables/useTransferMotion.d.ts +36 -0
  247. package/dist/types/composables/useUpload.d.ts +94 -0
  248. package/dist/types/composables/useUploadModel.d.ts +14 -0
  249. package/dist/types/composables/useUploadRequests.d.ts +38 -0
  250. package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
  251. package/dist/types/composables/virtualTable.d.ts +126 -0
  252. package/dist/types/config.d.ts +1 -0
  253. package/dist/types/index.d.ts +53 -3
  254. package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
  255. package/dist/types/internal/PopupReference.d.ts +18 -0
  256. package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
  257. package/dist/types/motion/PopupMotion.d.ts +59 -0
  258. package/dist/types/motion/popup.d.ts +12 -0
  259. package/package.json +3 -2
  260. package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
  261. package/dist/components/HysTour/HysTour2.vue.js +0 -4
@@ -1,215 +1,278 @@
1
- import { defineComponent as O, computed as s, ref as I, watch as P, openBlock as v, createElementBlock as c, mergeProps as Q, unref as C, toDisplayString as g, createCommentVNode as w, createElementVNode as B, createVNode as o, withCtx as S, Fragment as F, renderList as U, createBlock as q, normalizeClass as G, createTextVNode as V, withModifiers as K } from "vue";
2
- import { useHysRootAttrs as W } from "../../config.js";
3
- import { ChevronsLeft as X, ChevronLeft as Y, ChevronRight as Z, ChevronsRight as _ } from "lucide-vue-next";
4
- import ee from "../HysSelect/HysSelect.vue.js";
5
- import ae from "../HysNumberInput/HysNumberInput.vue.js";
6
- import M from "../HysButton/HysButton.vue.js";
7
- const te = ["aria-busy"], le = {
1
+ import { defineComponent as ne, useSlots as se, ref as N, computed as u, watch as V, openBlock as s, createElementBlock as o, mergeProps as ue, unref as oe, Fragment as h, renderList as P, normalizeClass as j, renderSlot as w, createTextVNode as B, toDisplayString as b, createBlock as $, withCtx as F, createCommentVNode as A, createElementVNode as W, resolveDynamicComponent as re, createVNode as R, withModifiers as pe } from "vue";
2
+ import { ChevronsRight as ve, ChevronRight as de, ChevronLeft as ge, ChevronsLeft as ce } from "lucide-vue-next";
3
+ import { useHysRootAttrs as fe } from "../../config.js";
4
+ import H from "../HysButton/HysButton.vue.js";
5
+ import me from "../HysNumberInput/HysNumberInput.vue.js";
6
+ import he from "../HysSelect/HysSelect.vue.js";
7
+ const be = ["data-size", "aria-label", "aria-busy"], ye = {
8
8
  key: 0,
9
9
  class: "hys-ui-pf-pagination-total",
10
10
  "aria-live": "polite"
11
- }, ie = { class: "hys-ui-pf-pagination-actions" }, ne = { class: "hys-ui-pf-pagination-controls" }, ue = {
11
+ }, Se = {
12
+ key: 1,
13
+ class: "hys-ui-pf-pagination-controls"
14
+ }, ze = {
12
15
  key: 1,
13
16
  class: "hys-ui-pf-pagination-gap",
14
17
  "aria-hidden": "true"
15
- }, se = {
16
- key: 1,
17
- class: "hys-ui-pf-pagination-indicator"
18
- }, oe = {
18
+ }, ke = {
19
19
  key: 2,
20
- class: "hys-ui-pf-pagination-mobile-indicator"
21
- }, re = {
22
- key: 0,
23
20
  class: "hys-ui-pf-pagination-size"
24
- }, ge = /* @__PURE__ */ O({
21
+ }, Be = /* @__PURE__ */ ne({
25
22
  __name: "HysPagination",
26
23
  props: {
27
24
  page: {},
28
25
  total: {},
29
- pageSize: { default: 10 },
26
+ pageCount: {},
27
+ pageSize: {},
28
+ defaultPage: { default: 1 },
29
+ defaultPageSize: { default: 10 },
30
30
  pageSizeOptions: {},
31
31
  siblingCount: { default: 1 },
32
32
  showSizeChanger: { type: Boolean, default: !1 },
33
33
  showQuickJumper: { type: Boolean, default: !1 },
34
34
  showTotal: { type: Boolean, default: !0 },
35
+ hideOnSinglePage: { type: Boolean, default: !1 },
35
36
  disabled: { type: Boolean, default: !1 },
36
37
  loading: { type: Boolean, default: !1 },
37
38
  compact: { type: Boolean, default: !1 },
39
+ responsive: { type: Boolean, default: !0 },
40
+ size: { default: "md" },
41
+ layout: {},
38
42
  labels: {}
39
43
  },
40
44
  emits: ["change", "update:page", "pageSizeChange", "update:pageSize"],
41
- setup(d, { emit: H }) {
42
- const $ = W(), u = d, b = H, h = s(() => Number.isFinite(u.pageSize) && u.pageSize > 0 ? Math.floor(u.pageSize) : 10), k = s(() => Number.isFinite(u.total) ? Math.max(0, Math.floor(u.total)) : 0), p = s(() => Math.max(1, Math.ceil(k.value / h.value))), a = s(() => Math.min(p.value, Math.max(1, Number.isFinite(u.page) ? Math.floor(u.page) : 1))), r = s(() => u.disabled || u.loading), E = s(() => k.value === 0 ? 0 : (a.value - 1) * h.value + 1), J = s(() => Math.min(k.value, a.value * h.value)), n = s(() => ({ total: "共 {total} 条({start}–{end})", perPage: "每页条数", jump: "跳转到", page: "页", first: "首页", previous: "上一页", next: "下一页", last: "末页", ...u.labels })), L = s(() => n.value.total.replace("{total}", String(k.value)).replace("{start}", String(E.value)).replace("{end}", String(J.value))), R = s(() => [...new Set([...u.pageSizeOptions ?? [10, 20, 50, 100], h.value].filter((l) => Number.isInteger(l) && l > 0))].sort((l, e) => l - e)), T = s(() => {
43
- const l = p.value, e = Math.max(0, Math.min(5, Math.floor(u.siblingCount))), t = /* @__PURE__ */ new Set([1, l]);
44
- for (let i = Math.max(1, a.value - e); i <= Math.min(l, a.value + e); i++) t.add(i);
45
- if (a.value <= e + 3) for (let i = 1; i <= Math.min(l, 2 * e + 3); i++) t.add(i);
46
- if (a.value >= l - e - 2) for (let i = Math.max(1, l - (2 * e + 2)); i <= l; i++) t.add(i);
47
- const f = [...t].sort((i, z) => i - z), N = [];
48
- return f.forEach((i, z) => {
49
- z && i - f[z - 1] > 1 && (i - f[z - 1] === 2 ? N.push(i - 1) : N.push(z === 1 ? "left-gap" : "right-gap")), N.push(i);
50
- }), N;
51
- }), x = I(a.value), m = I(a.value), j = s(() => m.value !== null && Number.isInteger(m.value) && m.value > 0 && m.value !== a.value);
52
- P(a, () => {
53
- x.value = a.value, m.value = a.value;
54
- }), P(x, (l) => m.value = l);
55
- function y(l) {
56
- if (r.value || !Number.isFinite(l)) return;
57
- const e = Math.min(p.value, Math.max(1, Math.floor(l)));
58
- e !== a.value && (b("update:page", e), b("change", e));
45
+ setup(c, { emit: Y }) {
46
+ const Z = fe(), l = c, C = Y, _ = se();
47
+ function y(e, t) {
48
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, Math.floor(e))) : t;
49
+ }
50
+ const J = N(y(l.defaultPageSize, 10)), S = u(() => y(l.pageSize, J.value)), z = u(() => l.total === void 0 ? void 0 : Number.isFinite(l.total) ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.floor(l.total))) : 0), r = u(() => l.pageCount === void 0 ? Math.max(1, Math.ceil((z.value ?? 0) / S.value)) : y(l.pageCount, 1)), L = N(Math.min(y(l.defaultPage, 1), r.value)), T = u(() => y(l.page, L.value)), i = u(() => Math.min(T.value, r.value)), m = u(() => l.disabled || l.loading), D = u(() => (i.value - 1) * S.value), x = u(() => D.value < (z.value ?? 0) ? D.value + 1 : 0), O = u(() => x.value ? Math.min(z.value ?? 0, i.value * S.value) : 0), v = u(() => {
51
+ var e;
52
+ return {
53
+ total: "共 {total} 条({start}–{end})",
54
+ perPage: "每页条数",
55
+ jump: "跳转到",
56
+ page: "页",
57
+ pageItem: "第 {page} " + (((e = l.labels) == null ? void 0 : e.page) ?? "页"),
58
+ navigation: "分页导航",
59
+ confirm: "确定",
60
+ first: "首页",
61
+ previous: "上一页",
62
+ next: "下一页",
63
+ last: "末页",
64
+ ...l.labels
65
+ };
66
+ }), ee = u(() => v.value.total.replace("{total}", String(z.value ?? 0)).replace("{start}", String(x.value)).replace("{end}", String(O.value))), ae = u(() => [...new Set([
67
+ ...l.pageSizeOptions ?? [10, 20, 50, 100],
68
+ S.value
69
+ ].filter((e) => Number.isSafeInteger(e) && e > 0))].sort((e, t) => e - t).map((e) => ({ label: String(e), value: String(e) }))), k = u(() => ({
70
+ first: { page: 1, label: v.value.first, icon: ce },
71
+ prev: { page: i.value - 1, label: v.value.previous, icon: ge },
72
+ next: { page: i.value + 1, label: v.value.next, icon: de },
73
+ last: { page: r.value, label: v.value.last, icon: ve }
74
+ }));
75
+ function q(e) {
76
+ return m.value || (e === "first" || e === "prev" ? i.value === 1 : i.value === r.value);
77
+ }
78
+ function G(e) {
79
+ return e === "first" || e === "prev" || e === "pager" || e === "next" || e === "last";
59
80
  }
60
- function A(l) {
61
- if (r.value) return;
62
- const e = Number(l);
63
- if (!Number.isInteger(e) || e < 1 || e === h.value) return;
64
- const t = a.value, f = Math.max(1, Math.ceil(k.value / e));
65
- b("update:pageSize", e), t > f && (b("update:page", f), b("change", f)), b("pageSizeChange", e);
81
+ const Q = u(() => {
82
+ const e = [
83
+ l.showTotal ? "total" : "",
84
+ "->",
85
+ "first",
86
+ "prev",
87
+ "pager",
88
+ "next",
89
+ "last",
90
+ l.showSizeChanger ? "sizes" : "",
91
+ l.showQuickJumper ? "jumper" : ""
92
+ ].join(","), t = [
93
+ { side: "leading", groups: [] },
94
+ { side: "trailing", groups: [] }
95
+ ], d = /* @__PURE__ */ new Set();
96
+ let p = t[0].groups;
97
+ for (const g of (l.layout ?? e).split(",")) {
98
+ const a = g.trim();
99
+ if (a === "->") {
100
+ p = t[1].groups;
101
+ continue;
102
+ }
103
+ if (!(!G(a) && a !== "total" && a !== "sizes" && a !== "jumper") && !(d.has(a) || a === "jumper" && l.compact) && !(a === "total" && z.value === void 0 && !_.total))
104
+ if (d.add(a), G(a)) {
105
+ const n = p.at(-1);
106
+ (n == null ? void 0 : n.kind) === "controls" ? n.controls.push(a) : p.push({ kind: "controls", controls: [a] });
107
+ } else
108
+ p.push({ kind: a });
109
+ }
110
+ return t.filter((g) => g.groups.length);
111
+ }), te = u(() => {
112
+ const e = r.value, t = Number.isFinite(l.siblingCount) ? Math.max(0, Math.min(5, Math.floor(l.siblingCount))) : 1, d = /* @__PURE__ */ new Set([1, e]);
113
+ for (let a = Math.max(1, i.value - t); a <= Math.min(e, i.value + t); a++) d.add(a);
114
+ if (i.value <= t + 3)
115
+ for (let a = 1; a <= Math.min(e, 2 * t + 3); a++) d.add(a);
116
+ if (i.value >= e - t - 2)
117
+ for (let a = Math.max(1, e - (2 * t + 2)); a <= e; a++) d.add(a);
118
+ const p = [...d].sort((a, n) => a - n), g = [];
119
+ for (const [a, n] of p.entries()) {
120
+ const E = a ? n - p[a - 1] : 0;
121
+ E === 2 && g.push(n - 1), E > 2 && g.push(a === 1 ? "left-gap" : "right-gap"), g.push(n);
122
+ }
123
+ return g;
124
+ }), M = N(i.value), f = N(i.value), U = u(() => f.value !== null && Number.isInteger(f.value) && f.value > 0 && Math.min(r.value, f.value) !== i.value);
125
+ function X() {
126
+ M.value = i.value, f.value = i.value;
66
127
  }
67
- function D() {
68
- const l = Number(m.value);
69
- j.value && Number.isInteger(l) && y(l), x.value = a.value, m.value = a.value;
128
+ V(i, X), V(M, (e) => f.value = e);
129
+ function K(e) {
130
+ l.page === void 0 && (L.value = e), C("update:page", e), C("change", e);
70
131
  }
71
- return (l, e) => (v(), c("nav", Q(C($), {
72
- class: ["hys-ui-pf-pagination", { "hys-ui-pf-pagination-compact": d.compact }],
73
- "aria-label": "分页导航",
74
- "aria-busy": d.loading
132
+ function I(e) {
133
+ if (m.value || !Number.isFinite(e)) return;
134
+ const t = Math.min(r.value, y(e, 1));
135
+ t !== i.value && K(t);
136
+ }
137
+ function le(e) {
138
+ if (m.value) return;
139
+ const t = Number(e);
140
+ !Number.isSafeInteger(t) || t < 1 || t === S.value || (l.pageSize === void 0 && (J.value = t), C("update:pageSize", t), C("pageSizeChange", t));
141
+ }
142
+ V(r, (e, t) => {
143
+ e < t && T.value > e && K(e);
144
+ });
145
+ function ie() {
146
+ U.value && f.value !== null && I(f.value), X();
147
+ }
148
+ return (e, t) => Q.value.length && (!c.hideOnSinglePage || r.value > 1) ? (s(), o("nav", ue({ key: 0 }, oe(Z), {
149
+ class: ["hys-ui-pf-pagination", {
150
+ "hys-ui-pf-pagination-compact": c.compact,
151
+ "hys-ui-pf-pagination-responsive": c.responsive
152
+ }],
153
+ "data-size": c.size,
154
+ "aria-label": v.value.navigation,
155
+ "aria-busy": c.loading
75
156
  }), [
76
- d.showTotal ? (v(), c("span", le, g(L.value), 1)) : w("", !0),
77
- B("div", ie, [
78
- B("div", ne, [
79
- o(M, {
80
- variant: "secondary",
81
- size: "sm",
82
- type: "button",
83
- disabled: r.value || a.value === 1,
84
- "aria-label": n.value.first,
85
- title: n.value.first,
86
- onClick: e[0] || (e[0] = (t) => y(1))
87
- }, {
88
- default: S(() => [
89
- o(C(X), {
90
- size: 16,
91
- "aria-hidden": "true"
92
- })
93
- ]),
94
- _: 1
95
- }, 8, ["disabled", "aria-label", "title"]),
96
- o(M, {
97
- variant: "secondary",
98
- size: "sm",
99
- type: "button",
100
- disabled: r.value || a.value === 1,
101
- "aria-label": n.value.previous,
102
- title: n.value.previous,
103
- onClick: e[1] || (e[1] = (t) => y(a.value - 1))
104
- }, {
105
- default: S(() => [
106
- o(C(Y), {
107
- size: 16,
108
- "aria-hidden": "true"
109
- })
110
- ]),
111
- _: 1
112
- }, 8, ["disabled", "aria-label", "title"]),
113
- d.compact ? (v(), c("span", se, g(a.value) + " / " + g(p.value), 1)) : (v(!0), c(F, { key: 0 }, U(T.value, (t) => (v(), c(F, { key: t }, [
114
- typeof t == "number" ? (v(), q(M, {
115
- key: 0,
157
+ (s(!0), o(h, null, P(Q.value, (d) => (s(), o("div", {
158
+ key: d.side,
159
+ class: j(d.side === "trailing" ? "hys-ui-pf-pagination-actions" : "hys-ui-pf-pagination-leading")
160
+ }, [
161
+ (s(!0), o(h, null, P(d.groups, (p, g) => (s(), o(h, { key: g }, [
162
+ p.kind === "total" ? (s(), o("span", ye, [
163
+ w(e.$slots, "total", {
164
+ total: z.value,
165
+ start: x.value,
166
+ end: O.value,
167
+ pageCount: r.value
168
+ }, () => [
169
+ B(b(ee.value), 1)
170
+ ], !0)
171
+ ])) : p.kind === "controls" ? (s(), o("div", Se, [
172
+ (s(!0), o(h, null, P(p.controls, (a) => (s(), o(h, { key: a }, [
173
+ a === "pager" ? (s(), o(h, { key: 0 }, [
174
+ c.compact ? A("", !0) : (s(!0), o(h, { key: 0 }, P(te.value, (n) => (s(), o(h, { key: n }, [
175
+ typeof n == "number" ? (s(), $(H, {
176
+ key: 0,
177
+ variant: "secondary",
178
+ size: "sm",
179
+ class: j(["hys-ui-pf-pagination-page", { "hys-ui-is-current": n === i.value, "hys-ui-pf-pagination-custom-item": e.$slots.item }]),
180
+ disabled: m.value,
181
+ "aria-label": v.value.pageItem.replace("{page}", String(n)),
182
+ "aria-current": n === i.value ? "page" : void 0,
183
+ onClick: (E) => I(n)
184
+ }, {
185
+ default: F(() => [
186
+ w(e.$slots, "item", {
187
+ type: "page",
188
+ page: n,
189
+ active: n === i.value,
190
+ disabled: m.value
191
+ }, () => [
192
+ B(b(n), 1)
193
+ ], !0)
194
+ ]),
195
+ _: 2
196
+ }, 1032, ["class", "disabled", "aria-label", "aria-current", "onClick"])) : (s(), o("span", ze, "…"))
197
+ ], 64))), 128)),
198
+ W("span", {
199
+ class: j(c.compact ? "hys-ui-pf-pagination-indicator" : "hys-ui-pf-pagination-mobile-indicator"),
200
+ "aria-live": "polite"
201
+ }, b(i.value) + " / " + b(r.value), 3)
202
+ ], 64)) : (s(), $(H, {
203
+ key: 1,
204
+ variant: "secondary",
205
+ size: "sm",
206
+ class: j({ "hys-ui-pf-pagination-custom-item": e.$slots.item }),
207
+ disabled: q(a),
208
+ "aria-label": k.value[a].label,
209
+ title: k.value[a].label,
210
+ onClick: (n) => I(k.value[a].page)
211
+ }, {
212
+ default: F(() => [
213
+ w(e.$slots, "item", {
214
+ type: a,
215
+ page: Math.max(1, Math.min(r.value, k.value[a].page)),
216
+ active: !1,
217
+ disabled: q(a)
218
+ }, () => [
219
+ (s(), $(re(k.value[a].icon), {
220
+ size: 16,
221
+ "aria-hidden": "true"
222
+ }))
223
+ ], !0)
224
+ ]),
225
+ _: 2
226
+ }, 1032, ["class", "disabled", "aria-label", "title", "onClick"]))
227
+ ], 64))), 128))
228
+ ])) : p.kind === "sizes" ? (s(), o("label", ke, [
229
+ B(b(v.value.perPage) + " ", 1),
230
+ R(he, {
231
+ size: c.size === "lg" ? "md" : "sm",
232
+ "model-value": String(S.value),
233
+ options: ae.value,
234
+ disabled: m.value,
235
+ "aria-label": v.value.perPage,
236
+ "onUpdate:modelValue": le
237
+ }, null, 8, ["size", "model-value", "options", "disabled", "aria-label"])
238
+ ])) : p.kind === "jumper" ? (s(), o("form", {
239
+ key: 3,
240
+ class: "hys-ui-pf-pagination-jump",
241
+ onSubmit: pe(ie, ["prevent", "stop"])
242
+ }, [
243
+ W("span", null, b(v.value.jump), 1),
244
+ R(me, {
245
+ modelValue: M.value,
246
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => M.value = a),
247
+ size: "sm",
248
+ class: "hys-ui-pf-pagination-jump-input",
249
+ min: 1,
250
+ max: r.value,
251
+ "show-controls": !1,
252
+ "select-on-focus": "",
253
+ disabled: m.value,
254
+ "aria-label": v.value.jump,
255
+ onInput: t[1] || (t[1] = (a) => f.value = a)
256
+ }, null, 8, ["modelValue", "max", "disabled", "aria-label"]),
257
+ R(H, {
116
258
  variant: "secondary",
117
259
  size: "sm",
118
- class: G(["hys-ui-pf-pagination-page", { "hys-ui-is-current": t === a.value }]),
119
- type: "button",
120
- disabled: r.value,
121
- "aria-label": "第 " + t + " 页",
122
- "aria-current": t === a.value ? "page" : void 0,
123
- onClick: (f) => y(t)
260
+ type: "submit",
261
+ disabled: m.value || !U.value
124
262
  }, {
125
- default: S(() => [
126
- V(g(t), 1)
263
+ default: F(() => [
264
+ w(e.$slots, "jump-button", {}, () => [
265
+ B(b(v.value.confirm), 1)
266
+ ], !0)
127
267
  ]),
128
- _: 2
129
- }, 1032, ["disabled", "aria-label", "aria-current", "class", "onClick"])) : (v(), c("span", ue, "…"))
130
- ], 64))), 128)),
131
- d.compact ? w("", !0) : (v(), c("span", oe, g(a.value) + " / " + g(p.value), 1)),
132
- o(M, {
133
- variant: "secondary",
134
- size: "sm",
135
- type: "button",
136
- disabled: r.value || a.value === p.value,
137
- "aria-label": n.value.next,
138
- title: n.value.next,
139
- onClick: e[2] || (e[2] = (t) => y(a.value + 1))
140
- }, {
141
- default: S(() => [
142
- o(C(Z), {
143
- size: 16,
144
- "aria-hidden": "true"
145
- })
146
- ]),
147
- _: 1
148
- }, 8, ["disabled", "aria-label", "title"]),
149
- o(M, {
150
- variant: "secondary",
151
- size: "sm",
152
- type: "button",
153
- disabled: r.value || a.value === p.value,
154
- "aria-label": n.value.last,
155
- title: n.value.last,
156
- onClick: e[3] || (e[3] = (t) => y(p.value))
157
- }, {
158
- default: S(() => [
159
- o(C(_), {
160
- size: 16,
161
- "aria-hidden": "true"
162
- })
163
- ]),
164
- _: 1
165
- }, 8, ["disabled", "aria-label", "title"])
166
- ]),
167
- d.showSizeChanger ? (v(), c("label", re, [
168
- V(g(n.value.perPage) + " ", 1),
169
- o(ee, {
170
- size: "sm",
171
- "model-value": String(h.value),
172
- options: R.value.map((t) => ({ label: String(t), value: String(t) })),
173
- disabled: r.value,
174
- "aria-label": n.value.perPage,
175
- "onUpdate:modelValue": A
176
- }, null, 8, ["model-value", "options", "disabled", "aria-label"])
177
- ])) : w("", !0),
178
- d.showQuickJumper && !d.compact ? (v(), c("form", {
179
- key: 1,
180
- class: "hys-ui-pf-pagination-jump",
181
- onSubmit: K(D, ["prevent"])
182
- }, [
183
- B("span", null, g(n.value.jump), 1),
184
- o(ae, {
185
- size: "sm",
186
- modelValue: x.value,
187
- "onUpdate:modelValue": e[4] || (e[4] = (t) => x.value = t),
188
- onInput: e[5] || (e[5] = (t) => m.value = t),
189
- class: "hys-ui-pf-pagination-jump-input",
190
- min: 1,
191
- max: p.value,
192
- "show-controls": !1,
193
- "select-on-focus": "",
194
- disabled: r.value,
195
- "aria-label": n.value.jump
196
- }, null, 8, ["modelValue", "max", "disabled", "aria-label"]),
197
- o(M, {
198
- variant: "secondary",
199
- size: "sm",
200
- type: "submit",
201
- disabled: r.value || !j.value
202
- }, {
203
- default: S(() => [...e[6] || (e[6] = [
204
- V("确定", -1)
205
- ])]),
206
- _: 1
207
- }, 8, ["disabled"])
208
- ], 32)) : w("", !0)
209
- ])
210
- ], 16, te));
268
+ _: 3
269
+ }, 8, ["disabled"])
270
+ ], 32)) : A("", !0)
271
+ ], 64))), 128))
272
+ ], 2))), 128))
273
+ ], 16, be)) : A("", !0);
211
274
  }
212
275
  });
213
276
  export {
214
- ge as default
277
+ Be as default
215
278
  };
@@ -1,93 +1,7 @@
1
- import { defineComponent as E, ref as w, onBeforeUnmount as H, onDeactivated as K, watch as v, openBlock as f, createElementBlock as y, mergeProps as T, unref as a, createElementVNode as N, withKeys as $, withModifiers as B, renderSlot as x, createBlock as R, Teleport as S, toDisplayString as V, createCommentVNode as C } from "vue";
2
- import { useHysRootAttrs as q } from "../../config.js";
3
- import { useFloating as M } from "../../composables/useFloating.js";
4
- const U = ["tabindex", "aria-disabled", "aria-expanded"], j = ["aria-label"], z = { key: 0 }, L = /* @__PURE__ */ E({
5
- __name: "HysPopover",
6
- props: {
7
- placement: { default: "bottom-end" },
8
- trigger: { default: "click" },
9
- disabled: { type: Boolean },
10
- open: { type: Boolean, default: void 0 },
11
- width: {},
12
- title: {}
13
- },
14
- emits: ["update:open", "visibleChange"],
15
- setup(o, { expose: F, emit: P }) {
16
- const b = q(), n = o, g = P, m = w(), d = w(), { open: s, style: A, show: c, close: p, restoringFocus: D } = M(m, d, { get placement() {
17
- return n.placement;
18
- }, gap: 8 });
19
- let u;
20
- function h(t) {
21
- clearTimeout(u), t ? r(!0) : u = setTimeout(() => r(!1), 100);
22
- }
23
- H(() => clearTimeout(u)), K(() => clearTimeout(u));
24
- function r(t) {
25
- if (!(t && (n.disabled || D.value))) {
26
- if (n.open !== void 0) {
27
- g("update:open", t);
28
- return;
29
- }
30
- t ? c() : p();
31
- }
32
- }
33
- return v(() => n.open, (t) => {
34
- t !== void 0 && (t && !n.disabled ? c() : p());
35
- }, { immediate: !0, flush: "post" }), v(s, (t) => {
36
- g("visibleChange", t), n.open !== void 0 && n.open !== t && g("update:open", t);
37
- }), v(() => n.disabled, (t) => {
38
- t && p();
39
- }), F({ show: () => r(!0), hide: () => r(!1) }), (t, e) => (f(), y("span", T(a(b), {
40
- class: "hys-ui-popover-wrap",
41
- onPointerenter: e[7] || (e[7] = (i) => o.trigger === "hover" && h(!0)),
42
- onPointerleave: e[8] || (e[8] = (i) => o.trigger === "hover" && h(!1))
43
- }), [
44
- N("span", {
45
- ref_key: "anchor",
46
- ref: m,
47
- class: "hys-ui-popover-trigger",
48
- tabindex: o.disabled ? -1 : 0,
49
- role: "button",
50
- "aria-disabled": o.disabled,
51
- "aria-expanded": a(s),
52
- "aria-haspopup": "dialog",
53
- onClick: e[0] || (e[0] = (i) => o.trigger === "click" && r(!a(s))),
54
- onKeydown: [
55
- e[1] || (e[1] = $(B((i) => r(!a(s)), ["prevent"]), ["enter"])),
56
- e[2] || (e[2] = $(B((i) => r(!a(s)), ["prevent"]), ["space"]))
57
- ],
58
- onFocusin: e[3] || (e[3] = (i) => o.trigger === "focus" && r(!0)),
59
- onFocusout: e[4] || (e[4] = (i) => {
60
- var l;
61
- return o.trigger === "focus" && !((l = d.value) != null && l.contains(i.relatedTarget)) && r(!1);
62
- })
63
- }, [
64
- x(t.$slots, "trigger")
65
- ], 40, U),
66
- (f(), R(S, { to: "body" }, [
67
- a(s) ? (f(), y("div", T({
68
- key: 0,
69
- ref_key: "panel",
70
- ref: d
71
- }, a(b), {
72
- class: "hys-ui-popover-panel hys-ui-floating-surface",
73
- style: { ...a(A), width: o.width },
74
- role: "dialog",
75
- onFocusout: e[5] || (e[5] = (i) => {
76
- var l, k;
77
- return o.trigger === "focus" && !((l = d.value) != null && l.contains(i.relatedTarget)) && !((k = m.value) != null && k.contains(i.relatedTarget)) && r(!1);
78
- }),
79
- "aria-label": o.title || "浮层",
80
- onPointerenter: e[6] || (e[6] = (i) => o.trigger === "hover" && r(!0))
81
- }), [
82
- o.title ? (f(), y("strong", z, V(o.title), 1)) : C("", !0),
83
- x(t.$slots, "default", {
84
- close: () => r(!1)
85
- })
86
- ], 16, j)) : C("", !0)
87
- ]))
88
- ], 16));
89
- }
90
- });
1
+ import o from "./HysPopover2.vue.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f925bad2"]]);
91
5
  export {
92
- L as default
6
+ f as default
93
7
  };