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,166 +1,1116 @@
1
- import { defineComponent as te, useModel as ae, ref as g, useId as le, computed as k, watch as D, onBeforeUnmount as oe, onDeactivated as ne, openBlock as C, createElementBlock as F, mergeProps as O, unref as o, withDirectives as ie, createElementVNode as z, vModelText as re, createBlock as de, Teleport as se, Fragment as ue, renderList as ce, withModifiers as ve, normalizeClass as fe, renderSlot as pe, toDisplayString as U, createCommentVNode as he, mergeModels as K, nextTick as j } from "vue";
2
- import { useHysControlState as me } from "../../composables/formContext.js";
3
- import { useHysRootAttrs as ge } from "../../config.js";
4
- import { useFloating as be } from "../../composables/useFloating.js";
5
- const ye = ["placeholder", "disabled", "readonly", "maxlength", "aria-label", "aria-controls", "aria-expanded", "aria-activedescendant"], xe = ["id"], we = ["id", "disabled", "aria-selected", "data-active", "onPointerenter", "onClick"], ke = {
1
+ import { defineComponent as ga, useAttrs as ba, useSlots as xa, useId as ka, computed as y, ref as E, shallowRef as Mt, watch as A, onDeactivated as Ma, onMounted as wt, openBlock as d, createElementBlock as h, mergeProps as Me, unref as r, createElementVNode as X, renderSlot as F, createCommentVNode as T, normalizeClass as we, Fragment as Z, renderList as Ct, toDisplayString as B, createTextVNode as V, toHandlers as Dt, createBlock as Ce, resolveDynamicComponent as wa, withModifiers as De, Teleport as Ca, createVNode as Da, withCtx as Ta, normalizeStyle as re, nextTick as Ie, h as Tt } from "vue";
2
+ import Sa from "../../motion/PopupMotion.js";
3
+ import { useHysControlState as Ba, useHysFormItemContext as za } from "../../composables/formContext.js";
4
+ import { useHysRootAttrs as Ea } from "../../config.js";
5
+ import { useFloating as Aa } from "../../composables/useFloating.js";
6
+ import { useMentionCaret as Fa } from "../../composables/useMentionCaret.js";
7
+ import { useMentionOptions as Ra } from "../../composables/useMentionOptions.js";
8
+ import { useMentionList as Wa } from "../../composables/useMentionList.js";
9
+ import { useMentionModel as La, diffMentionEntities as qa } from "../../composables/useMentionModel.js";
10
+ import { mentionTriggers as Oa, mentionSegments as Ha, rebaseMentionEntities as $e, serializeMentionDocument as St, matchMention as Ia, normalizeMentionEntities as Bt, deserializeMentionDocument as zt } from "../../composables/mentionDocument.js";
11
+ import { readMentionSelection as Et, isNativeMentionInput as At, writeMentionSelection as $a } from "../../composables/mentionEditor.js";
12
+ const Na = ["data-size", "data-status"], Pa = { class: "hys-ui-mention-input-row" }, Ka = {
13
+ key: 0,
14
+ class: "hys-ui-mention-affix"
15
+ }, ja = ["data-invalid"], Va = ["textContent", "contenteditable", "tabindex", "data-placeholder"], Ua = ["name", "value", "disabled"], Qa = {
16
+ key: 1,
17
+ class: "hys-ui-mention-affix"
18
+ }, Ya = ["aria-label"], Ga = {
19
+ key: 0,
20
+ class: "hys-ui-mention-count"
21
+ }, Ja = ["data-placement"], Xa = {
22
+ key: 1,
23
+ class: "hys-ui-mention-message",
24
+ role: "status"
25
+ }, Za = {
26
+ key: 2,
27
+ class: "hys-ui-mention-message",
28
+ role: "status"
29
+ }, _a = ["id", "aria-label", "aria-busy"], en = ["id", "aria-label", "aria-posinset", "aria-setsize", "disabled", "aria-selected", "data-active", "data-create", "onPointerenter", "onClick"], tn = ["src"], an = {
30
+ key: 1,
6
31
  class: "hys-ui-mention-avatar",
7
32
  "aria-hidden": "true"
8
- }, Se = /* @__PURE__ */ te({
33
+ }, nn = { class: "hys-ui-mention-label" }, ln = { key: 2 }, on = {
34
+ key: 3,
35
+ class: "hys-ui-mention-message",
36
+ role: "status"
37
+ }, rn = ["disabled"], Ft = "application/x-hys-mention+json", xn = /* @__PURE__ */ ga({
38
+ inheritAttrs: !1,
9
39
  __name: "HysMention",
10
- props: /* @__PURE__ */ K({
40
+ props: {
41
+ modelValue: {},
11
42
  users: {},
43
+ options: {},
44
+ fieldNames: {},
45
+ loadOptions: {},
46
+ sources: {},
47
+ debounce: { default: 180 },
48
+ throttle: {},
49
+ pageSize: {},
50
+ cache: { type: [Boolean, Object] },
51
+ historyKey: {},
52
+ recentLimit: {},
53
+ recommendations: {},
54
+ recommendOnFocus: { type: Boolean },
55
+ minQueryLength: { default: 0 },
56
+ defaultValue: { default: "" },
57
+ prefix: {},
58
+ triggers: {},
59
+ boundary: {},
60
+ allowSpaces: { type: Boolean },
61
+ matchTrigger: {},
62
+ split: { default: " " },
63
+ filterOption: { type: [Boolean, Function], default: void 0 },
64
+ searchMode: {},
65
+ searchFields: {},
66
+ sortOptions: { type: [Boolean, Function] },
67
+ groupBy: {},
68
+ validateSearch: {},
69
+ whole: { type: Boolean },
70
+ checkIsWhole: {},
71
+ validateEntity: {},
72
+ invalidEntity: { default: "mark" },
73
+ canSelect: {},
74
+ beforeRemove: {},
75
+ parseEntities: {},
76
+ highlightMentions: { type: Boolean },
77
+ entityClass: {},
78
+ allowCreate: { type: Boolean },
79
+ createOption: {},
80
+ formatMention: {},
81
+ replaceRest: { type: Boolean },
82
+ selectOnTab: { type: Boolean },
83
+ highlightMatch: { type: Boolean },
84
+ loading: { type: Boolean },
85
+ notFoundText: {},
86
+ errorText: {},
87
+ maxOptions: { default: 8 },
88
+ placement: { default: "bottom-start" },
89
+ showArrow: { type: Boolean },
90
+ offset: { default: 6 },
91
+ autoAdjustOverflow: { type: Boolean, default: !0 },
92
+ popupWidth: {},
93
+ popupMaxHeight: {},
94
+ zIndex: {},
95
+ virtual: { type: Boolean },
96
+ itemHeight: {},
97
+ overscan: {},
98
+ appendTo: { type: [String, Boolean], default: "body" },
99
+ popupClass: {},
100
+ popupStyle: { type: [Boolean, null, String, Object, Array] },
101
+ type: { default: "textarea" },
102
+ rows: {},
103
+ name: {},
104
+ autofocus: { type: Boolean },
12
105
  placeholder: {},
13
106
  disabled: { type: Boolean },
14
107
  readonly: { type: Boolean },
15
108
  maxlength: {},
16
- ariaLabel: {}
17
- }, {
18
- modelValue: { default: "" },
19
- modelModifiers: {}
20
- }),
21
- emits: /* @__PURE__ */ K(["select", "change"], ["update:modelValue"]),
22
- setup(h, { expose: q, emit: J }) {
23
- const M = h, { disabled: R, label: G } = me(M), r = ae(h, "modelValue"), T = J, H = ge(), n = g(0), c = g(!1), V = g(!1), d = g(), $ = g(), L = g(r.value.length), B = le(), Q = k(() => d.value ? { getBoundingClientRect: Z, contains: (e) => {
109
+ minlength: {},
110
+ required: { type: Boolean },
111
+ clearable: { type: Boolean },
112
+ showCount: { type: Boolean },
113
+ autosize: { type: [Boolean, Object] },
114
+ restoreFocus: { type: Boolean, default: !0 },
115
+ shortcuts: {},
116
+ locale: {},
117
+ defaultEntities: {},
118
+ entities: {},
119
+ ariaLabel: {},
120
+ status: {},
121
+ size: {},
122
+ popupTransition: {},
123
+ popupTransitionDuration: {}
124
+ },
125
+ emits: ["update:modelValue", "update:entities", "select", "search", "create", "loadError", "openChange", "change", "documentChange", "entityAdd", "entityRemove", "wholeRemove", "clear", "focus", "blur"],
126
+ setup(f, { expose: Rt, emit: Wt }) {
127
+ const n = f, g = Wt, U = ba(), Te = xa(), Ne = Ea(), { disabled: _, size: Lt, label: qt } = Ba(n), se = za(), Se = ka(), R = y(() => ({
128
+ input: "提及输入",
129
+ list: "提及候选成员",
130
+ placeholder: "输入 @ 提及成员",
131
+ loading: "正在加载候选…",
132
+ empty: "没有匹配的候选",
133
+ error: n.errorText ?? "候选加载失败",
134
+ retry: "重试",
135
+ more: "加载更多",
136
+ recent: "最近使用",
137
+ recommended: "常用推荐",
138
+ clear: "清空输入",
139
+ create: "创建 {value}",
140
+ ...n.locale
141
+ })), P = La(
142
+ n,
143
+ (e, t, a) => {
144
+ a && g("update:modelValue", e.text), g("update:entities", e.entities), a && g("change", e.text);
145
+ },
146
+ (e, t) => {
147
+ const { added: a, removed: l } = qa(
148
+ t.entities,
149
+ e.entities
150
+ );
151
+ for (const i of l) g("entityRemove", i);
152
+ for (const i of a) g("entityAdd", i);
153
+ g("documentChange", e);
154
+ }
155
+ ), { value: s, entities: q } = P, u = E(), ue = E(), Pe = E(), ce = E(), Ke = Mt({}), W = E(s.value.length), H = E(!1), je = E(!1), Ve = E(!1), M = E(!1), de = E(""), w = E(!1), I = E(0), C = Mt(), b = y(() => !_.value && !n.readonly), x = y(() => n.type === "rich"), z = y(
156
+ () => Number.isFinite(n.maxlength) ? Math.max(0, Math.floor(n.maxlength)) : void 0
157
+ ), Be = y(
158
+ () => Number.isFinite(n.minlength) ? Math.max(0, Math.floor(n.minlength)) : void 0
159
+ ), ze = y(() => n.required || se.required.value), Ue = y(
160
+ () => n.status === "error" || se.invalid.value || z.value !== void 0 && s.value.length > z.value || je.value && (ze.value && !s.value || !!s.value && Be.value !== void 0 && s.value.length < Be.value)
161
+ ), $ = y(() => Oa(n)), ve = (e) => $.value.find((t) => t.prefix === e), Q = (e) => {
24
162
  var t;
25
- return !!((t = d.value) != null && t.contains(e));
26
- }, focus: () => {
27
- var e;
28
- return (e = d.value) == null ? void 0 : e.focus();
29
- }, get isConnected() {
30
- var e;
31
- return !!((e = d.value) != null && e.isConnected);
32
- } } : void 0), { open: v, style: X, show: I, close: b, update: Y } = be(Q, $, { gap: 6 }), E = k(() => r.value.slice(0, L.value)), W = k(() => {
33
- var e;
34
- return ((e = E.value.match(/@([^\s@]*)$/)) == null ? void 0 : e[1]) ?? null;
163
+ return ((t = ve(e)) == null ? void 0 : t.split) ?? n.split;
164
+ }, Ee = (e, t) => Ia(e, t, $.value, n), Ae = y(() => Ee(s.value, W.value)), m = y(() => {
165
+ var i;
166
+ if (!H.value || !b.value || M.value) return;
167
+ const e = n.recommendOnFocus && $.value.length ? {
168
+ prefix: $.value[0].prefix,
169
+ query: "",
170
+ start: W.value,
171
+ end: W.value,
172
+ manual: !0
173
+ } : void 0, t = C.value ?? Ae.value ?? e;
174
+ if (!t) return;
175
+ const a = ve(t.prefix), l = (a == null ? void 0 : a.minQueryLength) ?? n.minQueryLength;
176
+ if (!(!t.manual && Number.isFinite(l) && Array.from(t.query).length < Math.max(0, l) || ((i = n.validateSearch) == null ? void 0 : i.call(n, t.query, t)) === !1))
177
+ return t;
178
+ }), Ot = y(
179
+ () => m.value && ve(m.value.prefix)
180
+ ), {
181
+ entries: Ht,
182
+ choices: ee,
183
+ busy: Y,
184
+ loadingMore: fe,
185
+ hasMore: Fe,
186
+ loadError: G,
187
+ retry: te,
188
+ loadMore: J,
189
+ cancelLoad: Qe,
190
+ remember: It
191
+ } = Ra(
192
+ n,
193
+ m,
194
+ Ot,
195
+ w,
196
+ s,
197
+ (e, t) => g("loadError", e, t)
198
+ ), {
199
+ rows: sn,
200
+ enabled: ae,
201
+ visibleRows: Ye,
202
+ topSpacer: Ge,
203
+ bottomSpacer: Je,
204
+ rowHeight: Xe,
205
+ onScroll: Ze,
206
+ reset: $t,
207
+ ensureVisible: Nt
208
+ } = Wa(n, ee, Pe, J), S = y(() => ae.value[I.value]);
209
+ A(
210
+ [
211
+ () => {
212
+ var e;
213
+ return (e = m.value) == null ? void 0 : e.query;
214
+ },
215
+ () => {
216
+ var e;
217
+ return (e = m.value) == null ? void 0 : e.prefix;
218
+ },
219
+ () => {
220
+ var e;
221
+ return (e = m.value) == null ? void 0 : e.start;
222
+ }
223
+ ],
224
+ () => {
225
+ I.value = 0, w.value = !1, $t();
226
+ const e = m.value;
227
+ e && g("search", e.query, e.prefix, e);
228
+ }
229
+ ), A(ae, (e, t) => {
230
+ var i;
231
+ const a = (i = t[I.value]) == null ? void 0 : i.key, l = a === void 0 ? -1 : e.findIndex((o) => o.key === a);
232
+ I.value = l >= 0 ? l : Math.min(I.value, Math.max(0, e.length - 1));
233
+ });
234
+ const he = y(
235
+ () => !!m.value && !w.value && (ee.value.length > 0 || Y.value || !!G.value || !!C.value || !!m.value.manual || n.notFoundText !== void 0 || !!Te.empty)
236
+ ), { anchor: Pt, removeMirror: Kt } = Fa(
237
+ u,
238
+ s,
239
+ () => {
240
+ var e, t;
241
+ return ((e = m.value) == null ? void 0 : e.start) ?? ((t = Ae.value) == null ? void 0 : t.start) ?? W.value;
242
+ }
243
+ );
244
+ function jt(e) {
245
+ return typeof e == "number" && Number.isFinite(e) ? Math.max(0, e) + "px" : typeof e == "string" ? e : void 0;
246
+ }
247
+ const { placement: _e, open: D, style: Vt, show: Re, close: We, update: et, schedule: ne } = Aa(
248
+ Pt,
249
+ ue,
250
+ {
251
+ placement: () => n.placement,
252
+ get strategy() {
253
+ return n.appendTo === "body" ? "fixed" : "absolute";
254
+ },
255
+ get gap() {
256
+ return n.offset;
257
+ },
258
+ get autoAdjustOverflow() {
259
+ return n.autoAdjustOverflow;
260
+ },
261
+ width: () => n.popupWidth,
262
+ zIndex: () => n.zIndex,
263
+ closeOnEscape: !1,
264
+ closeOnTab: !1,
265
+ onPosition({ anchor: e, placement: t, x: a, y: l, width: i, height: o }) {
266
+ if (!n.showArrow) return;
267
+ const v = (c, L) => Math.max(8, Math.min(L - 8, c)) + "px";
268
+ Ke.value = t.startsWith("top") || t.startsWith("bottom") ? { left: v(e.left + e.width / 2 - a, i) } : { top: v(e.top + e.height / 2 - l, o) };
269
+ }
270
+ }
271
+ ), tt = y(() => {
272
+ const e = jt(n.popupMaxHeight);
273
+ return e ? "min(" + e + ", calc(100dvh - 20px))" : void 0;
274
+ });
275
+ A(
276
+ [he, ee],
277
+ ([e]) => {
278
+ e ? Re() : We();
279
+ },
280
+ { flush: "post" }
281
+ ), A(D, (e) => {
282
+ e || Kt(), g("openChange", e);
283
+ }), A(
284
+ [D, u, ue],
285
+ ([e, t, a], l, i) => {
286
+ if (!e || !t || !a || typeof ResizeObserver > "u")
287
+ return;
288
+ const o = new ResizeObserver(ne);
289
+ o.observe(t), o.observe(a), i(() => o.disconnect());
290
+ },
291
+ { flush: "post" }
292
+ ), A(
293
+ [
294
+ () => n.placement,
295
+ () => n.offset,
296
+ () => n.showArrow,
297
+ () => n.popupWidth,
298
+ tt
299
+ ],
300
+ ne,
301
+ { flush: "post" }
302
+ ), Ma(() => {
303
+ H.value = !1, M.value = !1, C.value = void 0;
35
304
  });
36
- let i;
37
- function A() {
38
- i == null || i.remove(), i = void 0;
39
- }
40
- function Z() {
41
- const e = d.value, t = e.getBoundingClientRect();
42
- if (!t.width && !t.height) return t;
43
- const l = getComputedStyle(e);
44
- i || (i = document.createElement("div"), i.setAttribute("aria-hidden", "true"), document.body.append(i));
45
- for (const N of ["direction", "font", "font-family", "font-size", "font-weight", "font-style", "font-variant", "letter-spacing", "word-spacing", "text-transform", "text-indent", "text-align", "line-height", "padding-top", "padding-right", "padding-bottom", "padding-left", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", "border-style", "box-sizing", "tab-size"]) i.style.setProperty(N, l.getPropertyValue(N));
46
- Object.assign(i.style, { position: "fixed", top: "0px", left: "-10000px", visibility: "hidden", pointerEvents: "none", height: "auto", overflow: "hidden", whiteSpace: e.wrap === "off" ? "pre" : "pre-wrap", overflowWrap: "break-word", wordBreak: l.wordBreak });
47
- const a = parseFloat(l.borderLeftWidth) || 0, f = parseFloat(l.borderTopWidth) || 0;
48
- i.style.width = (e.clientWidth || t.width - a - (parseFloat(l.borderRightWidth) || 0)) + a + (parseFloat(l.borderRightWidth) || 0) + "px";
49
- const u = Math.max(0, E.value.lastIndexOf("@"));
50
- i.textContent = r.value.slice(0, u);
51
- const p = document.createElement("span");
52
- p.textContent = r.value.slice(u) || "@", i.append(p);
53
- const w = parseFloat(l.lineHeight) || (parseFloat(l.fontSize) || 14) * 1.6, m = t.left + p.offsetLeft + a - e.scrollLeft, S = t.top + p.offsetTop + f - e.scrollTop;
54
- return { x: m, y: S, left: m, top: S, right: m + 1, bottom: S + w, width: 1, height: w, toJSON: () => ({ left: m, top: S, width: 1, height: w }) };
55
- }
56
- D(v, (e) => {
57
- e || A();
58
- }), oe(A), ne(A);
59
- const y = k(() => W.value === null || R.value || M.readonly || c.value || !V.value ? [] : M.users.filter((e) => e.name.toLocaleLowerCase().includes(W.value.toLocaleLowerCase())).slice(0, 8)), s = k(() => y.value.filter((e) => !e.disabled));
60
- D(W, () => {
61
- n.value = 0, c.value = !1;
62
- }), D(y, (e) => {
63
- n.value = Math.min(n.value, Math.max(0, s.value.length - 1)), e.length ? I() : b();
64
- }, { flush: "post" });
65
- async function x() {
305
+ function k() {
306
+ return u.value ? Et(u.value, W.value) : { start: W.value, end: W.value };
307
+ }
308
+ function le() {
309
+ W.value = k().start, D.value && ne();
310
+ }
311
+ function K(e) {
312
+ u.value && (!x.value || H.value || u.value.ownerDocument.activeElement === u.value) && $a(u.value, e), W.value = e.start, D.value && ne();
313
+ }
314
+ function O() {
315
+ w.value = !0, Qe(), We();
316
+ }
317
+ function at(e) {
318
+ var l;
319
+ if (!b.value || !u.value || M.value) return !1;
320
+ if (u.value.focus(), H.value = !0, !(e != null && e.prefix) && !(e != null && e.query) && (e == null ? void 0 : e.position) === void 0 && Ae.value)
321
+ return w.value = !1, Ie(() => {
322
+ he.value && Re();
323
+ }), !0;
324
+ const t = Math.max(
325
+ 0,
326
+ Math.min(s.value.length, (e == null ? void 0 : e.position) ?? k().start)
327
+ ), a = (e == null ? void 0 : e.prefix) ?? ((l = $.value[0]) == null ? void 0 : l.prefix) ?? "@";
328
+ return K({ start: t, end: t }), C.value = {
329
+ prefix: a,
330
+ query: (e == null ? void 0 : e.query) ?? "",
331
+ start: t,
332
+ end: t,
333
+ manual: !0
334
+ }, w.value = !1, Ie(() => {
335
+ he.value && Re();
336
+ }), !0;
337
+ }
338
+ function nt(e) {
339
+ return At(e) ? e.value : e.textContent ?? "";
340
+ }
341
+ const ye = y(() => Ha(s.value, q.value));
342
+ function lt(e) {
343
+ return typeof n.entityClass == "function" ? n.entityClass(e) : n.entityClass;
344
+ }
345
+ function it(e) {
346
+ var t;
347
+ return ((t = n.validateEntity) == null ? void 0 : t.call(n, e)) === !1;
348
+ }
349
+ function pe(e) {
350
+ const t = u.value;
351
+ if (!x.value || !t || M.value) return;
352
+ const a = t.ownerDocument, l = a.createDocumentFragment();
353
+ for (const i of ye.value)
354
+ if (!i.entity) l.append(a.createTextNode(i.text));
355
+ else {
356
+ const o = a.createElement("span");
357
+ o.setAttribute("data-mention-entity", String(i.entity.id)), o.setAttribute("data-mention-start", String(i.entity.start)), o.setAttribute("contenteditable", "false"), it(i.entity) && o.setAttribute("aria-invalid", "true"), o.className = ["hys-ui-mention-entity", lt(i.entity)].filter(Boolean).join(" "), o.textContent = i.text, l.append(o);
358
+ }
359
+ t.replaceChildren(l), e && H.value && K(e);
360
+ }
361
+ A(
362
+ [
363
+ ye,
364
+ x,
365
+ () => n.entityClass,
366
+ () => n.validateEntity,
367
+ u
368
+ ],
369
+ () => {
370
+ const e = H.value ? k() : void 0;
371
+ pe(e);
372
+ },
373
+ { flush: "post" }
374
+ ), wt(() => {
66
375
  var e;
67
- await j(), L.value = ((e = d.value) == null ? void 0 : e.selectionStart) ?? r.value.length, v.value && Y();
68
- }
69
- D(r, () => void x(), { flush: "post" });
70
- async function P(e) {
71
- var f, u;
72
- if (!e || e.disabled || R.value || M.readonly) return;
73
- const t = E.value.replace(/@[^\s@]*$/, "@" + e.name + " "), l = r.value.slice(L.value), a = l.startsWith(" ") ? l.slice(1) : l;
74
- r.value = t + a, c.value = !0, n.value = 0, b(), T("select", e), T("change", r.value), await j(), (f = d.value) == null || f.focus(), (u = d.value) == null || u.setSelectionRange(t.length, t.length), L.value = t.length;
75
- }
76
- function _(e) {
77
- var t, l;
78
- if (e.key === "Tab") {
79
- c.value = !0, b();
376
+ Ve.value = !0, pe(), n.autofocus && ((e = u.value) == null || e.focus());
377
+ });
378
+ function Le() {
379
+ u.value && ce.value && (ce.value.scrollTop = u.value.scrollTop, ce.value.scrollLeft = u.value.scrollLeft);
380
+ }
381
+ function Ut() {
382
+ Le(), D.value && et();
383
+ }
384
+ function qe() {
385
+ const e = u.value;
386
+ if (!e || !n.autosize || !(e instanceof HTMLTextAreaElement)) {
387
+ e instanceof HTMLTextAreaElement && (e.style.removeProperty("height"), e.style.removeProperty("overflow-y"));
80
388
  return;
81
389
  }
82
- y.value.length && (e.key === "Escape" ? (e.preventDefault(), c.value = !0, b()) : e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), v.value ? n.value = (n.value + (e.key === "ArrowDown" ? 1 : -1) + Math.max(1, s.value.length)) % Math.max(1, s.value.length) : I(), (l = (t = $.value) == null ? void 0 : t.querySelector('[data-active="true"]')) == null || l.scrollIntoView({ block: "nearest" })) : e.key === "Enter" && !e.isComposing && s.value[n.value] && (e.preventDefault(), P(s.value[n.value])));
390
+ const t = typeof n.autosize == "object" ? n.autosize : {}, a = getComputedStyle(e), l = parseFloat(a.lineHeight) || (parseFloat(a.fontSize) || 14) * 1.6, i = (parseFloat(a.borderTopWidth) || 0) + (parseFloat(a.borderBottomWidth) || 0), o = (parseFloat(a.paddingTop) || 0) + (parseFloat(a.paddingBottom) || 0), v = Math.max(1, t.minRows ?? n.rows ?? 2) * l + o + i, c = t.maxRows === void 0 ? 1 / 0 : Math.max(v, t.maxRows * l + o + i), L = e.scrollTop;
391
+ e.style.height = "auto";
392
+ const j = e.scrollHeight + i;
393
+ e.style.height = Math.max(v, Math.min(c, j)) + "px", e.style.overflowY = j > c ? "auto" : "hidden", e.scrollTop = L, Le(), D.value && ne();
83
394
  }
84
- function ee() {
85
- c.value = !1, x(), T("change", r.value);
395
+ A([s, de, () => n.autosize, u], qe, {
396
+ flush: "post"
397
+ }), A(
398
+ [u, () => n.autosize],
399
+ ([e, t], a, l) => {
400
+ if (!e || !t || typeof ResizeObserver > "u") return;
401
+ let i = e.clientWidth;
402
+ const o = new ResizeObserver(() => {
403
+ i !== e.clientWidth && (i = e.clientWidth, qe());
404
+ });
405
+ o.observe(e), l(() => o.disconnect());
406
+ },
407
+ { flush: "post" }
408
+ ), wt(qe), A(ye, Le, { flush: "post" });
409
+ const Qt = y(() => {
410
+ if (!n.autosize) return {};
411
+ const e = typeof n.autosize == "object" ? n.autosize : {};
412
+ return {
413
+ minHeight: "calc(" + (e.minRows ?? n.rows ?? 2) + "lh + 24px)",
414
+ maxHeight: e.maxRows ? "calc(" + e.maxRows + "lh + 24px)" : void 0
415
+ };
416
+ }), ot = y(
417
+ () => !!n.highlightMentions && !x.value && !M.value && !!q.value.length
418
+ ), Yt = y(
419
+ () => x.value ? "div" : n.type === "text" ? "input" : "textarea"
420
+ );
421
+ let rt = 0;
422
+ async function N(e, t, a = k(), l, i = !1) {
423
+ const o = ++rt, c = b.value && (z.value === void 0 || e.text.length <= z.value || e.text.length < s.value.length) && await P.commit(e, a, l, !0, i);
424
+ return o !== rt || !u.value || M.value || (x.value ? pe() : At(u.value) && u.value.value !== s.value && (u.value.value = s.value), K(c ? t : a)), c;
86
425
  }
87
- return q({ focus: () => {
88
- var e;
89
- return (e = d.value) == null ? void 0 : e.focus();
90
- }, blur: () => {
426
+ function me(e, t, a, l = []) {
427
+ const i = s.value.slice(0, t) + e + s.value.slice(a), o = [
428
+ ...$e(P.document.value, i, { start: t, end: a }),
429
+ ...l
430
+ ];
431
+ return { text: i, entities: Bt(i, o) };
432
+ }
433
+ let ie;
434
+ function Gt(e, t, a) {
435
+ if (!t) return;
436
+ let { start: l, end: i } = t;
437
+ if (l === i && e.length < s.value.length) {
438
+ const o = s.value.length - e.length;
439
+ a != null && a.endsWith("Backward") && (l = Math.max(0, l - o)), a != null && a.endsWith("Forward") && (i = Math.min(s.value.length, i + o));
440
+ }
441
+ if (e.startsWith(s.value.slice(0, l)) && e.endsWith(s.value.slice(i)) && e.length >= l + s.value.length - i)
442
+ return { start: l, end: i };
443
+ }
444
+ function st(e) {
445
+ const t = e.target, a = nt(t);
446
+ if (M.value) {
447
+ de.value = a;
448
+ return;
449
+ }
450
+ const l = Et(t, a.length), i = ie ?? { start: W.value, end: W.value }, o = Gt(a, ie, e.inputType);
451
+ if (ie = void 0, a === s.value) return;
452
+ w.value = !1, C.value && l.start >= C.value.start && a.startsWith(s.value.slice(0, C.value.start)) && !Ee(a, l.start) ? C.value = {
453
+ ...C.value,
454
+ query: a.slice(C.value.start, l.start),
455
+ end: l.start
456
+ } : C.value = void 0;
457
+ const v = $e(P.document.value, a, o);
458
+ N({ text: a, entities: v }, l, i);
459
+ }
460
+ function Jt() {
461
+ ie = k(), de.value = u.value ? nt(u.value) : s.value, M.value = !0;
462
+ }
463
+ function Xt(e) {
464
+ M.value && (M.value = !1, st(e));
465
+ }
466
+ async function ge(e) {
467
+ if (!b.value || M.value) return !1;
468
+ O();
469
+ const t = await P.history(e, k());
470
+ return t ? (x.value && pe(), K(t), !0) : !1;
471
+ }
472
+ function Zt(e) {
473
+ if (!(M.value || e.isComposing || !b.value))
474
+ if (ie = k(), e.inputType === "historyUndo" || e.inputType === "historyRedo") {
475
+ if (!e.cancelable) return;
476
+ e.preventDefault(), ge(e.inputType === "historyUndo" ? "undo" : "redo");
477
+ } else x.value && (e.inputType === "insertParagraph" || e.inputType === "insertLineBreak") && (e.preventDefault(), oe(`
478
+ `));
479
+ }
480
+ function oe(e, t = []) {
481
+ const { start: a, end: l } = k();
482
+ if (z.value !== void 0) {
483
+ const c = Math.max(
484
+ 0,
485
+ z.value - (s.value.length - (l - a))
486
+ );
487
+ e = e.slice(0, c).replace(/[\uD800-\uDBFF]$/, "");
488
+ }
489
+ const i = Bt(e, t).map((c) => ({
490
+ ...c,
491
+ start: a + c.start,
492
+ end: a + c.end
493
+ })), o = me(e, a, l, i);
494
+ w.value = !1, C.value = void 0;
495
+ const v = a + e.length;
496
+ N(o, { start: v, end: v }, { start: a, end: l });
497
+ }
498
+ function ut(e, t = !1) {
499
+ if (!e.clipboardData || t && !b.value) return;
500
+ const { start: a, end: l } = k();
501
+ if (a === l) return;
502
+ const i = s.value.slice(a, l), o = q.value.filter(
503
+ (v) => v.start >= a && v.end <= l
504
+ );
505
+ if (!(!x.value && !o.length)) {
506
+ e.preventDefault(), e.clipboardData.setData("text/plain", i);
507
+ try {
508
+ e.clipboardData.setData(
509
+ Ft,
510
+ St({
511
+ text: i,
512
+ entities: o.map((v) => ({
513
+ ...v,
514
+ start: v.start - a,
515
+ end: v.end - a
516
+ }))
517
+ })
518
+ );
519
+ } catch {
520
+ }
521
+ t && oe("");
522
+ }
523
+ }
524
+ function _t(e) {
525
+ if (!b.value || !e.clipboardData) return;
526
+ const t = e.clipboardData.getData(Ft);
527
+ if (!(!t && !x.value)) {
528
+ e.preventDefault();
529
+ try {
530
+ const a = zt(t);
531
+ oe(a.text, a.entities);
532
+ } catch {
533
+ oe(e.clipboardData.getData("text/plain"));
534
+ }
535
+ }
536
+ }
537
+ function ea(e) {
538
+ !x.value || !b.value || (e.preventDefault(), e.dataTransfer && oe(e.dataTransfer.getData("text/plain")));
539
+ }
540
+ function ta(e) {
541
+ const t = q.value.find(
542
+ (i) => i.start === e.start && i.prefix === e.prefix && e.end <= i.end
543
+ );
544
+ if (t) return t.end;
545
+ if (!n.replaceRest || e.manual) return e.end;
546
+ let a = e.end;
547
+ const l = Q(e.prefix);
548
+ for (; a < s.value.length && !/\s/.test(s.value[a]) && !(l && s.value.startsWith(l, a)) && !$.value.some(({ prefix: i }) => s.value.startsWith(i, a)); )
549
+ a++;
550
+ return a;
551
+ }
552
+ async function ct(e, t, a, l, i) {
553
+ var xt, kt;
554
+ if (!b.value || M.value || e.disabled || ((xt = n.canSelect) == null ? void 0 : xt.call(n, e, t)) === !1)
555
+ return !1;
556
+ const o = ve(t.prefix), v = (o == null ? void 0 : o.formatMention) ?? n.formatMention, c = (v == null ? void 0 : v(e, t)) ?? t.prefix + String(e.value);
557
+ if (!c) return !1;
558
+ const L = Q(t.prefix), j = s.value.slice(a), be = L && j.startsWith(L) ? L.length : 0, p = {
559
+ id: e.id ?? e.value,
560
+ value: e.value,
561
+ label: typeof e.label == "string" ? e.label : String(e.value),
562
+ type: e.type ?? (o == null ? void 0 : o.type) ?? t.prefix,
563
+ prefix: t.prefix,
564
+ text: c,
565
+ start: t.start,
566
+ end: t.start + c.length,
567
+ payload: e.payload
568
+ }, xe = me(c + L, t.start, a + be, [p]);
569
+ if (z.value !== void 0 && xe.text.length > z.value) return !1;
570
+ O();
571
+ const ke = p.end + L.length, bt = await N(
572
+ xe,
573
+ { start: ke, end: ke },
574
+ k(),
575
+ i
576
+ );
577
+ return bt && (It(e, t.prefix), l && n.restoreFocus && ((kt = u.value) != null && kt.isConnected) && u.value.ownerDocument.activeElement !== u.value && (u.value.focus(), K({ start: ke, end: ke }))), O(), bt;
578
+ }
579
+ function Oe(e, t = !0) {
580
+ const a = m.value;
581
+ !e || !a || e.user.disabled || Y.value || w.value || ct(e.option, a, ta(a), t, () => {
582
+ g("select", e.user, a.prefix, e.option), e.created && g("create", e.option, a);
583
+ });
584
+ }
585
+ function aa(e, t) {
586
+ var v;
587
+ const a = k(), l = (t == null ? void 0 : t.prefix) ?? e.prefix ?? ((v = $.value[0]) == null ? void 0 : v.prefix) ?? "@", i = Math.max(
588
+ 0,
589
+ Math.min(s.value.length, Math.trunc((t == null ? void 0 : t.start) ?? a.start))
590
+ ), o = Math.max(
591
+ i,
592
+ Math.min(s.value.length, Math.trunc((t == null ? void 0 : t.end) ?? a.end))
593
+ );
594
+ return ct(
595
+ e,
596
+ { prefix: l, query: "", start: i, end: o, manual: !0 },
597
+ o,
598
+ (t == null ? void 0 : t.focus) !== !1
599
+ );
600
+ }
601
+ function dt(e, t = !0, a = !1) {
602
+ const l = Q(e.prefix), i = t && l && s.value.startsWith(l, e.end) ? e.end + l.length : e.end;
603
+ return O(), N(
604
+ me("", e.start, i),
605
+ { start: e.start, end: e.start },
606
+ k(),
607
+ a ? () => g("wholeRemove", String(e.value), e.prefix) : void 0
608
+ );
609
+ }
610
+ function na(e) {
611
+ const t = q.value.find(
612
+ (a) => typeof e == "object" ? a.id === e.id && a.start === e.start && a.end === e.end : a.id === e
613
+ );
614
+ return t ? dt(t) : Promise.resolve(!1);
615
+ }
616
+ function la(e) {
617
+ var j, be;
618
+ if (!b.value || !n.whole && !n.checkIsWhole && !x.value)
619
+ return;
620
+ const { start: t, end: a } = k();
621
+ if (t !== a) return;
622
+ const l = e.key === "Backspace", i = q.value.find(
623
+ (p) => l ? p.end === t || p.end + Q(p.prefix).length === t && s.value.startsWith(Q(p.prefix), p.end) : p.start === t
624
+ );
625
+ if (i && (((j = n.checkIsWhole) == null ? void 0 : j.call(n, String(i.value), i.prefix)) ?? (n.whole || x.value))) {
626
+ e.preventDefault(), dt(i, !0, !0);
627
+ return;
628
+ }
629
+ if (!l) return;
630
+ const o = s.value.slice(0, t), v = $.value.map(({ prefix: p }) => Q(p)).filter((p) => p && o.endsWith(p)).sort((p, xe) => xe.length - p.length)[0] ?? "", c = Ee(s.value, t - v.length);
631
+ if (!(c != null && c.query)) return;
632
+ const L = Ht.value.some(
633
+ ({ option: p }) => String(p.value) === c.query && (!p.prefix || p.prefix === c.prefix)
634
+ );
635
+ (((be = n.checkIsWhole) == null ? void 0 : be.call(n, c.query, c.prefix)) ?? (n.whole && L)) && (e.preventDefault(), O(), N(
636
+ me("", c.start, t),
637
+ { start: c.start, end: c.start },
638
+ k(),
639
+ () => g("wholeRemove", c.query, c.prefix)
640
+ ));
641
+ }
642
+ const ia = y(
643
+ () => Ve.value && n.invalidEntity === "remove" && b.value && n.validateEntity ? q.value.filter((e) => !n.validateEntity(e)) : []
644
+ );
645
+ A(
646
+ ia,
647
+ async (e) => {
648
+ if (!e.length) return;
649
+ let t = P.document.value;
650
+ for (const i of [...e].reverse()) {
651
+ const o = t.text.slice(0, i.start) + t.text.slice(i.end);
652
+ t = {
653
+ text: o,
654
+ entities: $e(t, o, i)
655
+ };
656
+ }
657
+ const a = k(), l = Math.min(t.text.length, a.start);
658
+ await N(
659
+ t,
660
+ { start: l, end: l },
661
+ a,
662
+ void 0,
663
+ !0
664
+ );
665
+ },
666
+ { immediate: !0, flush: "post" }
667
+ );
668
+ function oa(e) {
669
+ const t = ae.value.length;
670
+ t && (I.value = e === "first" ? 0 : e === "last" ? t - 1 : (I.value + (e === "next" ? 1 : -1) + t) % t, Ie(() => {
671
+ S.value && Nt(S.value.key);
672
+ }));
673
+ }
674
+ function vt(e, t) {
675
+ t === "open" ? (e.preventDefault(), at()) : D.value ? t === "close" ? (e.preventDefault(), e.stopPropagation(), O()) : t === "retry" || t === "select" && G.value && !S.value ? G.value && !Y.value && (e.preventDefault(), te()) : t === "select" ? S.value && (e.preventDefault(), Oe(S.value)) : ae.value.length && (e.preventDefault(), oa(t)) : t === "next" && w.value && m.value && (e.preventDefault(), w.value = !1);
676
+ }
677
+ const ft = {
678
+ ArrowDown: "next",
679
+ ArrowUp: "previous",
680
+ Enter: "select",
681
+ Escape: "close"
682
+ };
683
+ function ra(e) {
684
+ var l;
685
+ if (e.isComposing || M.value || e.keyCode === 229) return;
686
+ const t = [
687
+ e.ctrlKey && "Ctrl",
688
+ e.metaKey && "Meta",
689
+ e.altKey && "Alt",
690
+ e.shiftKey && "Shift",
691
+ e.key
692
+ ].filter(Boolean).join("+"), a = (l = n.shortcuts) == null ? void 0 : l[t];
693
+ a ? vt(e, a) : (e.ctrlKey || e.metaKey) && !e.altKey && ["z", "y"].includes(e.key.toLowerCase()) ? (e.preventDefault(), ge(
694
+ e.shiftKey || e.key.toLowerCase() === "y" ? "redo" : "undo"
695
+ )) : e.key === "Backspace" || e.key === "Delete" ? la(e) : e.key === "Tab" ? n.selectOnTab && D.value && S.value ? Oe(S.value, !1) : O() : e.key === "PageDown" && D.value && Fe.value ? (e.preventDefault(), J()) : !e.ctrlKey && !e.altKey && !e.metaKey && ft[e.key] && vt(e, ft[e.key]);
696
+ }
697
+ function sa(e) {
698
+ H.value = !0, w.value = !1, le(), g("focus", e);
699
+ }
700
+ function ua(e) {
701
+ var t;
702
+ e.relatedTarget instanceof Node && ((t = ue.value) != null && t.contains(e.relatedTarget)) || (H.value = !1, je.value = !0, C.value = void 0, Qe(), We(), g("blur", e));
703
+ }
704
+ function He() {
91
705
  var e;
92
- return (e = d.value) == null ? void 0 : e.blur();
93
- } }), (e, t) => {
706
+ (e = u.value) == null || e.focus();
707
+ }
708
+ function ca(e) {
709
+ if (!x.value || !b.value || !(e.target instanceof Element))
710
+ return;
711
+ const t = e.target.closest("[data-mention-start]");
712
+ if (!t) return;
713
+ const a = q.value.find(
714
+ ({ start: l }) => l === Number(t.dataset.mentionStart)
715
+ );
716
+ a && (e.preventDefault(), He(), K({ start: a.start, end: a.end }), C.value = {
717
+ prefix: a.prefix,
718
+ query: "",
719
+ start: a.start,
720
+ end: a.end,
721
+ manual: !0
722
+ }, w.value = !1);
723
+ }
724
+ async function ht() {
725
+ if (!b.value) return !1;
726
+ O();
727
+ const e = await N(
728
+ { text: "", entities: [] },
729
+ { start: 0, end: 0 },
730
+ k(),
731
+ () => g("clear")
732
+ );
733
+ return e && n.restoreFocus && He(), e;
734
+ }
735
+ async function da(e) {
736
+ let t;
737
+ try {
738
+ t = typeof e == "string" ? zt(e) : e;
739
+ } catch {
740
+ return !1;
741
+ }
742
+ return !t || typeof t.text != "string" || !Array.isArray(t.entities) ? !1 : (O(), N(t, { start: t.text.length, end: t.text.length }));
743
+ }
744
+ function yt() {
745
+ const { class: e, style: t, ...a } = U;
746
+ return a;
747
+ }
748
+ const pt = y(() => ({
749
+ id: String(U.id ?? se.id.value ?? "") || void 0,
750
+ role: "combobox",
751
+ "aria-label": n.ariaLabel ?? U["aria-label"] ?? qt.value ?? R.value.input,
752
+ "aria-invalid": Ue.value || void 0,
753
+ "aria-required": ze.value || void 0,
754
+ "aria-disabled": _.value || void 0,
755
+ "aria-readonly": n.readonly || void 0,
756
+ "aria-describedby": se.describedBy.value ?? U["aria-describedby"],
757
+ "aria-controls": D.value ? Se : void 0,
758
+ "aria-expanded": D.value,
759
+ "aria-activedescendant": va.value,
760
+ "aria-autocomplete": "list"
761
+ })), mt = (e) => Se + "-option-" + encodeURIComponent(e), va = y(
762
+ () => D.value && S.value && Ye.value.some((e) => {
763
+ var t;
764
+ return e.key === ((t = S.value) == null ? void 0 : t.key);
765
+ }) ? mt(S.value.key) : void 0
766
+ );
767
+ function fa(e) {
768
+ return e.option.group ? e.option.group + "," + e.user.name : e.user.name;
769
+ }
770
+ function ha(e) {
771
+ const t = ae.value.findIndex(({ key: a }) => a === e.key);
772
+ t >= 0 && (I.value = t);
773
+ }
774
+ function ya(e) {
775
+ e.pointerType === "touch" && e.cancelable && e.preventDefault();
776
+ }
777
+ const gt = {
778
+ keydown: ra,
779
+ keyup: le,
780
+ click: () => {
781
+ w.value = !1, le();
782
+ },
783
+ focus: sa,
784
+ blur: ua,
785
+ input: st,
786
+ beforeinput: Zt,
787
+ compositionstart: Jt,
788
+ compositionend: Xt,
789
+ scroll: Ut,
790
+ paste: _t,
791
+ copy: ut,
792
+ cut: (e) => ut(e, !0),
793
+ drop: ea,
794
+ dblclick: ca
795
+ };
796
+ A(s, le, { flush: "post" });
797
+ const pa = ({ name: e }) => {
94
798
  var l;
95
- return C(), F("div", O(o(H), { class: "hys-ui-ent-mention" }), [
96
- ie(z("textarea", {
97
- ref_key: "input",
98
- ref: d,
99
- "onUpdate:modelValue": t[0] || (t[0] = (a) => r.value = a),
100
- placeholder: h.placeholder || "输入 @ 提及成员",
101
- disabled: o(R),
102
- readonly: h.readonly,
103
- maxlength: h.maxlength,
104
- "aria-label": h.ariaLabel || o(G) || "提及输入",
105
- "aria-controls": o(v) ? o(B) : void 0,
106
- "aria-expanded": o(v),
107
- "aria-activedescendant": o(v) ? o(B) + "-" + ((l = s.value[n.value]) == null ? void 0 : l.id) : void 0,
108
- role: "combobox",
109
- onKeydown: _,
110
- onKeyup: x,
111
- onClick: t[1] || (t[1] = (a) => {
112
- c.value = !1, x();
113
- }),
114
- onFocus: t[2] || (t[2] = (a) => {
115
- V.value = !0, x();
116
- }),
117
- onBlur: t[3] || (t[3] = (a) => {
118
- V.value = !1, o(b)();
119
- }),
120
- onInput: ee
121
- }, null, 40, ye), [
122
- [re, r.value]
123
- ]),
124
- (C(), de(se, { to: "body" }, [
125
- o(v) && y.value.length ? (C(), F("div", O({
799
+ const t = ((l = m.value) == null ? void 0 : l.query.trim()) ?? "", a = n.highlightMatch && t ? e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase()) : -1;
800
+ return Tt(
801
+ "span",
802
+ a < 0 ? e : [
803
+ e.slice(0, a),
804
+ Tt(
805
+ "mark",
806
+ { class: "hys-ui-mention-match" },
807
+ e.slice(a, a + t.length)
808
+ ),
809
+ e.slice(a + t.length)
810
+ ]
811
+ );
812
+ }, ma = ({ value: e }) => e;
813
+ return Rt({
814
+ input: u,
815
+ dropdownVisible: D,
816
+ focus: He,
817
+ blur: () => {
818
+ var e;
819
+ return (e = u.value) == null ? void 0 : e.blur();
820
+ },
821
+ open: at,
822
+ close: O,
823
+ update: et,
824
+ retry: te,
825
+ loadMore: J,
826
+ insertMention: aa,
827
+ removeMention: na,
828
+ getEntities: () => q.value.map((e) => ({ ...e })),
829
+ getDocument: () => ({
830
+ text: s.value,
831
+ entities: q.value.map((e) => ({ ...e }))
832
+ }),
833
+ setDocument: da,
834
+ serialize: () => St(P.document.value),
835
+ clear: ht,
836
+ undo: () => ge("undo"),
837
+ redo: () => ge("redo")
838
+ }), (e, t) => (d(), h("div", Me(r(Ne), {
839
+ class: ["hys-ui-ent-mention", r(U).class],
840
+ style: r(U).style,
841
+ "data-size": r(Lt),
842
+ "data-status": Ue.value ? "error" : f.status
843
+ }), [
844
+ X("div", Pa, [
845
+ Te.prefix ? (d(), h("div", Ka, [
846
+ F(e.$slots, "prefix", {}, void 0, !0)
847
+ ])) : T("", !0),
848
+ X("div", {
849
+ class: we(["hys-ui-mention-editor", {
850
+ "hys-ui-mention-highlighted": ot.value,
851
+ "hys-ui-mention-autosize": f.autosize
852
+ }])
853
+ }, [
854
+ ot.value ? (d(), h("div", {
126
855
  key: 0,
127
- id: o(B),
128
- ref_key: "panel",
129
- ref: $
130
- }, o(H), {
131
- class: "hys-ui-mention-list hys-ui-floating-surface",
132
- style: { ...o(X), maxHeight: "min(240px,calc(100vh - 20px))" },
133
- role: "listbox",
134
- "aria-label": "提及候选成员"
135
- }), [
136
- (C(!0), F(ue, null, ce(y.value, (a) => {
137
- var f, u, p;
138
- return C(), F("button", {
139
- id: o(B) + "-" + a.id,
140
- key: a.id,
141
- type: "button",
142
- role: "option",
143
- disabled: a.disabled,
144
- "aria-selected": ((f = s.value[n.value]) == null ? void 0 : f.id) === a.id,
145
- "data-active": ((u = s.value[n.value]) == null ? void 0 : u.id) === a.id,
146
- class: fe({ "hys-ui-mention-active": ((p = s.value[n.value]) == null ? void 0 : p.id) === a.id }),
147
- onMousedown: t[4] || (t[4] = ve(() => {
148
- }, ["prevent"])),
149
- onPointerenter: (w) => !a.disabled && (n.value = s.value.findIndex((m) => m.id === a.id)),
150
- onClick: (w) => P(a)
856
+ ref_key: "highlightLayer",
857
+ ref: ce,
858
+ class: we(["hys-ui-mention-highlight-layer", { "hys-ui-mention-single": f.type === "text" }]),
859
+ "aria-hidden": "true"
860
+ }, [
861
+ (d(!0), h(Z, null, Ct(ye.value, (a) => (d(), h(Z, {
862
+ key: a.start
863
+ }, [
864
+ a.entity ? (d(), h("span", {
865
+ key: 0,
866
+ class: we(["hys-ui-mention-entity", lt(a.entity)]),
867
+ "data-invalid": it(a.entity) || void 0
868
+ }, B(a.text), 11, ja)) : (d(), h(Z, { key: 1 }, [
869
+ V(B(a.text), 1)
870
+ ], 64))
871
+ ], 64))), 128))
872
+ ], 2)) : T("", !0),
873
+ x.value ? (d(), h("div", Me({
874
+ key: 1,
875
+ ref_key: "input",
876
+ ref: u
877
+ }, { ...yt(), ...pt.value }, Dt(gt, !0), {
878
+ textContent: B(r(s)),
879
+ class: "hys-ui-mention-rich",
880
+ style: Qt.value,
881
+ contenteditable: b.value ? "true" : "false",
882
+ tabindex: r(_) ? -1 : 0,
883
+ "data-placeholder": f.placeholder ?? R.value.placeholder
884
+ }), null, 16, Va)) : (d(), Ce(wa(Yt.value), Me({
885
+ key: 2,
886
+ ref_key: "input",
887
+ ref: u
888
+ }, { ...yt(), ...pt.value }, Dt(gt), {
889
+ value: M.value ? de.value : r(s),
890
+ type: f.type === "text" ? "text" : void 0,
891
+ rows: f.type === "textarea" ? f.rows : void 0,
892
+ name: f.name,
893
+ autofocus: f.autofocus,
894
+ placeholder: f.placeholder ?? R.value.placeholder,
895
+ disabled: r(_),
896
+ readonly: f.readonly,
897
+ required: ze.value,
898
+ maxlength: z.value,
899
+ minlength: Be.value,
900
+ onSelect: le
901
+ }), null, 16, ["value", "type", "rows", "name", "autofocus", "placeholder", "disabled", "readonly", "required", "maxlength", "minlength"])),
902
+ x.value && f.name ? (d(), h("input", {
903
+ key: 3,
904
+ type: "hidden",
905
+ name: f.name,
906
+ value: r(s),
907
+ disabled: r(_)
908
+ }, null, 8, Ua)) : T("", !0)
909
+ ], 2),
910
+ Te.suffix || f.clearable && b.value && r(s) ? (d(), h("div", Qa, [
911
+ F(e.$slots, "suffix", {}, void 0, !0),
912
+ f.clearable && b.value && r(s) ? (d(), h("button", {
913
+ key: 0,
914
+ class: "hys-ui-mention-clear",
915
+ type: "button",
916
+ "aria-label": R.value.clear,
917
+ onMousedown: t[0] || (t[0] = De(() => {
918
+ }, ["prevent"])),
919
+ onClick: ht
920
+ }, [
921
+ F(e.$slots, "clear-icon", {}, () => [
922
+ t[7] || (t[7] = X("span", { "aria-hidden": "true" }, "×", -1))
923
+ ], !0)
924
+ ], 40, Ya)) : T("", !0)
925
+ ])) : T("", !0)
926
+ ]),
927
+ f.showCount ? (d(), h("div", Ga, [
928
+ F(e.$slots, "count", {
929
+ count: r(s).length,
930
+ max: z.value
931
+ }, () => [
932
+ V(B(r(s).length), 1),
933
+ z.value !== void 0 ? (d(), h(Z, { key: 0 }, [
934
+ V(" / " + B(z.value), 1)
935
+ ], 64)) : T("", !0)
936
+ ], !0)
937
+ ])) : T("", !0),
938
+ (d(), Ce(Ca, {
939
+ to: f.appendTo || "body",
940
+ disabled: f.appendTo === !1
941
+ }, [
942
+ Da(r(Sa), {
943
+ "popup-transition": f.popupTransition,
944
+ "popup-transition-duration": f.popupTransitionDuration,
945
+ placement: r(_e)
946
+ }, {
947
+ default: Ta(() => [
948
+ r(D) && he.value ? (d(), h("div", Me({
949
+ key: 0,
950
+ ref_key: "panel",
951
+ ref: ue
952
+ }, r(Ne), {
953
+ class: ["hys-ui-mention-list hys-ui-floating-surface", [f.popupClass, { "hys-ui-mention-virtual": f.virtual }]],
954
+ style: [
955
+ r(Vt),
956
+ { maxHeight: tt.value, overflowY: "visible" },
957
+ f.popupStyle
958
+ ],
959
+ "data-placement": r(_e)
960
+ }), [
961
+ f.showArrow ? (d(), h("span", {
962
+ key: 0,
963
+ class: "hys-ui-mention-arrow",
964
+ style: re(Ke.value),
965
+ "aria-hidden": "true"
966
+ }, null, 4)) : T("", !0),
967
+ F(e.$slots, "header", { context: m.value }, void 0, !0),
968
+ r(Y) ? (d(), h("div", Xa, [
969
+ F(e.$slots, "loading", {}, () => [
970
+ V(B(R.value.loading), 1)
971
+ ], !0)
972
+ ])) : !r(ee).length && !r(G) ? (d(), h("div", Za, [
973
+ F(e.$slots, "empty", {}, () => [
974
+ V(B(f.notFoundText ?? R.value.empty), 1)
975
+ ], !0)
976
+ ])) : T("", !0),
977
+ X("div", {
978
+ id: r(Se),
979
+ ref_key: "listbox",
980
+ ref: Pe,
981
+ class: "hys-ui-mention-options",
982
+ role: "listbox",
983
+ "aria-label": R.value.list,
984
+ "aria-busy": r(Y) || r(fe) || void 0,
985
+ onScroll: t[2] || (t[2] = //@ts-ignore
986
+ (...a) => r(Ze) && r(Ze)(...a))
151
987
  }, [
152
- pe(e.$slots, "option", { user: a }, () => [
153
- z("span", ke, U(a.name.slice(0, 1)), 1),
154
- z("span", null, U(a.name), 1)
988
+ r(Ge) ? (d(), h("div", {
989
+ key: 0,
990
+ style: re({ height: r(Ge) + "px" }),
991
+ role: "presentation"
992
+ }, null, 4)) : T("", !0),
993
+ (d(!0), h(Z, null, Ct(r(Ye), (a) => {
994
+ var l, i, o;
995
+ return d(), h(Z, {
996
+ key: a.key
997
+ }, [
998
+ "group" in a ? (d(), h("div", {
999
+ key: 0,
1000
+ class: "hys-ui-mention-group",
1001
+ role: "presentation",
1002
+ style: re(f.virtual ? { height: r(Xe) + "px" } : void 0)
1003
+ }, [
1004
+ F(e.$slots, "group", {
1005
+ label: a.group,
1006
+ context: m.value
1007
+ }, () => [
1008
+ V(B(a.group), 1)
1009
+ ], !0)
1010
+ ], 4)) : (d(), h("button", {
1011
+ key: 1,
1012
+ id: mt(a.key),
1013
+ type: "button",
1014
+ role: "option",
1015
+ tabindex: "-1",
1016
+ "aria-label": fa(a.entry),
1017
+ "aria-posinset": a.index + 1,
1018
+ "aria-setsize": r(ee).length,
1019
+ disabled: a.entry.user.disabled,
1020
+ "aria-selected": ((l = S.value) == null ? void 0 : l.key) === a.key,
1021
+ "data-active": ((i = S.value) == null ? void 0 : i.key) === a.key,
1022
+ class: we([
1023
+ a.entry.option.class,
1024
+ { "hys-ui-mention-active": ((o = S.value) == null ? void 0 : o.key) === a.key }
1025
+ ]),
1026
+ style: re([
1027
+ a.entry.option.style,
1028
+ f.virtual ? { height: r(Xe) + "px" } : void 0
1029
+ ]),
1030
+ "data-create": a.entry.created || void 0,
1031
+ onMousedown: t[1] || (t[1] = De(() => {
1032
+ }, ["prevent"])),
1033
+ onPointerdown: ya,
1034
+ onPointerenter: (v) => ha(a.entry),
1035
+ onClick: (v) => Oe(a.entry)
1036
+ }, [
1037
+ F(e.$slots, "option", {
1038
+ user: a.entry.user,
1039
+ option: a.entry.option,
1040
+ context: m.value,
1041
+ created: !!a.entry.created
1042
+ }, () => [
1043
+ F(e.$slots, "avatar", {
1044
+ option: a.entry.option
1045
+ }, () => [
1046
+ a.entry.option.avatar ? (d(), h("img", {
1047
+ key: 0,
1048
+ class: "hys-ui-mention-avatar",
1049
+ src: a.entry.option.avatar,
1050
+ alt: ""
1051
+ }, null, 8, tn)) : (d(), h("span", an, B(Array.from(a.entry.user.name)[0]), 1))
1052
+ ], !0),
1053
+ X("span", nn, [
1054
+ typeof a.entry.option.label == "function" ? (d(), Ce(ma, {
1055
+ key: 0,
1056
+ value: a.entry.option.label(a.entry.option)
1057
+ }, null, 8, ["value"])) : (d(), Ce(pa, {
1058
+ key: 1,
1059
+ name: a.entry.user.name
1060
+ }, null, 8, ["name"])),
1061
+ a.entry.option.description ? (d(), h("small", ln, B(a.entry.option.description), 1)) : T("", !0)
1062
+ ])
1063
+ ], !0)
1064
+ ], 46, en))
1065
+ ], 64);
1066
+ }), 128)),
1067
+ r(Je) ? (d(), h("div", {
1068
+ key: 1,
1069
+ style: re({ height: r(Je) + "px" }),
1070
+ role: "presentation"
1071
+ }, null, 4)) : T("", !0)
1072
+ ], 40, _a),
1073
+ !r(Y) && r(G) ? (d(), h("div", on, [
1074
+ F(e.$slots, "error", {
1075
+ error: r(G).reason,
1076
+ retry: r(te),
1077
+ context: m.value
1078
+ }, () => [
1079
+ V(B(R.value.error) + " ", 1),
1080
+ X("button", {
1081
+ type: "button",
1082
+ class: "hys-ui-mention-retry",
1083
+ tabindex: "-1",
1084
+ onMousedown: t[3] || (t[3] = De(() => {
1085
+ }, ["prevent"])),
1086
+ onClick: t[4] || (t[4] = //@ts-ignore
1087
+ (...a) => r(te) && r(te)(...a))
1088
+ }, B(R.value.retry), 33)
155
1089
  ], !0)
156
- ], 42, we);
157
- }), 128))
158
- ], 16, xe)) : he("", !0)
159
- ]))
160
- ], 16);
161
- };
1090
+ ])) : r(Fe) || r(fe) ? (d(), h("button", {
1091
+ key: 4,
1092
+ class: "hys-ui-mention-more",
1093
+ type: "button",
1094
+ tabindex: "-1",
1095
+ disabled: r(fe),
1096
+ onMousedown: t[5] || (t[5] = De(() => {
1097
+ }, ["prevent"])),
1098
+ onClick: t[6] || (t[6] = //@ts-ignore
1099
+ (...a) => r(J) && r(J)(...a))
1100
+ }, B(r(fe) ? R.value.loading : R.value.more), 41, rn)) : T("", !0),
1101
+ F(e.$slots, "footer", {
1102
+ context: m.value,
1103
+ hasMore: r(Fe),
1104
+ loadMore: r(J)
1105
+ }, void 0, !0)
1106
+ ], 16, Ja)) : T("", !0)
1107
+ ]),
1108
+ _: 3
1109
+ }, 8, ["popup-transition", "popup-transition-duration", "placement"])
1110
+ ], 8, ["to", "disabled"]))
1111
+ ], 16, Na));
162
1112
  }
163
1113
  });
164
1114
  export {
165
- Se as default
1115
+ xn as default
166
1116
  };