hys-ui 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +19 -0
  3. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  4. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1055 -753
  5. package/dist/components/HysDataGrid/gridColumnLayout.js +46 -0
  6. package/dist/components/HysDataGrid/gridPresentation.js +17 -0
  7. package/dist/components/HysDataGrid/useGridContextMenu.js +33 -0
  8. package/dist/components/HysDatePicker/HysDatePicker.vue.js +102 -48
  9. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
  10. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +874 -532
  11. package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +2 -2
  12. package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +209 -168
  13. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +102 -48
  14. package/dist/components/HysDescriptions/HysDescriptions.vue.js +7 -0
  15. package/dist/components/HysDescriptions/HysDescriptions2.vue.js +146 -0
  16. package/dist/components/HysForm/HysForm2.vue.js +9 -8
  17. package/dist/components/HysIcon/HysIcon.vue.js +373 -0
  18. package/dist/components/HysIcon/HysIcon2.vue.js +5 -0
  19. package/dist/components/HysIcon/IconGraphic/IconGraphic.vue.js +147 -0
  20. package/dist/components/HysIcon/IconGraphic/IconGraphic2.vue.js +4 -0
  21. package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.js +7 -0
  22. package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel2.vue.js +440 -0
  23. package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.js +29 -0
  24. package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic2.vue.js +4 -0
  25. package/dist/components/HysIcon/IconTooltip/IconTooltip.vue.js +19 -0
  26. package/dist/components/HysIcon/IconTooltip/IconTooltip2.vue.js +4 -0
  27. package/dist/components/HysIcon/builtins/access.js +180 -0
  28. package/dist/components/HysIcon/builtins/actions.js +327 -0
  29. package/dist/components/HysIcon/builtins/business.js +364 -0
  30. package/dist/components/HysIcon/builtins/catalog/access-1.json.js +51 -0
  31. package/dist/components/HysIcon/builtins/catalog/access-2.json.js +35 -0
  32. package/dist/components/HysIcon/builtins/catalog/accessibility.json.js +26 -0
  33. package/dist/components/HysIcon/builtins/catalog/arrows-1.json.js +45 -0
  34. package/dist/components/HysIcon/builtins/catalog/arrows-2.json.js +46 -0
  35. package/dist/components/HysIcon/builtins/catalog/arrows-3.json.js +42 -0
  36. package/dist/components/HysIcon/builtins/catalog/charts-1.json.js +50 -0
  37. package/dist/components/HysIcon/builtins/catalog/charts-2.json.js +13 -0
  38. package/dist/components/HysIcon/builtins/catalog/commerce.json.js +43 -0
  39. package/dist/components/HysIcon/builtins/catalog/communication-1.json.js +49 -0
  40. package/dist/components/HysIcon/builtins/catalog/communication-2.json.js +37 -0
  41. package/dist/components/HysIcon/builtins/catalog/design-1.json.js +61 -0
  42. package/dist/components/HysIcon/builtins/catalog/design-2.json.js +27 -0
  43. package/dist/components/HysIcon/builtins/catalog/development-1.json.js +58 -0
  44. package/dist/components/HysIcon/builtins/catalog/development-2.json.js +60 -0
  45. package/dist/components/HysIcon/builtins/catalog/development-3.json.js +25 -0
  46. package/dist/components/HysIcon/builtins/catalog/devices-1.json.js +52 -0
  47. package/dist/components/HysIcon/builtins/catalog/devices-2.json.js +55 -0
  48. package/dist/components/HysIcon/builtins/catalog/devices-3.json.js +23 -0
  49. package/dist/components/HysIcon/builtins/catalog/education.json.js +34 -0
  50. package/dist/components/HysIcon/builtins/catalog/emoji.json.js +24 -0
  51. package/dist/components/HysIcon/builtins/catalog/files-1.json.js +45 -0
  52. package/dist/components/HysIcon/builtins/catalog/files-2.json.js +47 -0
  53. package/dist/components/HysIcon/builtins/catalog/files-3.json.js +8 -0
  54. package/dist/components/HysIcon/builtins/catalog/food-1.json.js +67 -0
  55. package/dist/components/HysIcon/builtins/catalog/food-2.json.js +40 -0
  56. package/dist/components/HysIcon/builtins/catalog/home.json.js +36 -0
  57. package/dist/components/HysIcon/builtins/catalog/layout-1.json.js +46 -0
  58. package/dist/components/HysIcon/builtins/catalog/layout-2.json.js +45 -0
  59. package/dist/components/HysIcon/builtins/catalog/manifest.json.js +4 -0
  60. package/dist/components/HysIcon/builtins/catalog/maps-1.json.js +61 -0
  61. package/dist/components/HysIcon/builtins/catalog/maps-2.json.js +24 -0
  62. package/dist/components/HysIcon/builtins/catalog/media-1.json.js +57 -0
  63. package/dist/components/HysIcon/builtins/catalog/media-2.json.js +13 -0
  64. package/dist/components/HysIcon/builtins/catalog/medical.json.js +30 -0
  65. package/dist/components/HysIcon/builtins/catalog/nature.json.js +54 -0
  66. package/dist/components/HysIcon/builtins/catalog/recreation.json.js +51 -0
  67. package/dist/components/HysIcon/builtins/catalog/shapes.json.js +54 -0
  68. package/dist/components/HysIcon/builtins/catalog/text-1.json.js +52 -0
  69. package/dist/components/HysIcon/builtins/catalog/text-2.json.js +54 -0
  70. package/dist/components/HysIcon/builtins/catalog/text-3.json.js +58 -0
  71. package/dist/components/HysIcon/builtins/catalog/text-4.json.js +41 -0
  72. package/dist/components/HysIcon/builtins/catalog/time.json.js +39 -0
  73. package/dist/components/HysIcon/builtins/catalog/transport-1.json.js +57 -0
  74. package/dist/components/HysIcon/builtins/catalog/transport-2.json.js +7 -0
  75. package/dist/components/HysIcon/builtins/catalog/weather.json.js +46 -0
  76. package/dist/components/HysIcon/builtins/communication.js +314 -0
  77. package/dist/components/HysIcon/builtins/documents.js +315 -0
  78. package/dist/components/HysIcon/builtins/extendedCatalog.js +75 -0
  79. package/dist/components/HysIcon/builtins/iconInCategory.js +11 -0
  80. package/dist/components/HysIcon/builtins/media.js +255 -0
  81. package/dist/components/HysIcon/builtins/navigation.js +276 -0
  82. package/dist/components/HysIcon/builtins/technology.js +189 -0
  83. package/dist/components/HysIcon/iconBuiltins.js +228 -0
  84. package/dist/components/HysIcon/iconConfig.js +30 -0
  85. package/dist/components/HysIcon/iconRegistry.js +183 -0
  86. package/dist/components/HysIcon/iconSafety.js +191 -0
  87. package/dist/components/HysIcon/iconStyle.js +70 -0
  88. package/dist/components/HysIcon/useIconResource.js +75 -0
  89. package/dist/components/HysPopconfirm/HysPopconfirm.vue.js +7 -0
  90. package/dist/components/HysPopconfirm/HysPopconfirm2.vue.js +346 -0
  91. package/dist/components/HysPopconfirm/usePopconfirmAction.js +32 -0
  92. package/dist/components/HysResult/HysResult.vue.js +7 -0
  93. package/dist/components/HysResult/HysResult2.vue.js +124 -0
  94. package/dist/components/HysSpace/HysSpace.vue.js +7 -0
  95. package/dist/components/HysSpace/HysSpace2.vue.js +79 -0
  96. package/dist/components/HysSpace/spaceItems.js +17 -0
  97. package/dist/components/HysSpin/HysSpin.vue.js +7 -0
  98. package/dist/components/HysSpin/HysSpin2.vue.js +427 -0
  99. package/dist/components/HysSpin/SpinGlyph/SpinGlyph.vue.js +334 -0
  100. package/dist/components/HysSpin/SpinGlyph/SpinGlyph2.vue.js +5 -0
  101. package/dist/components/HysSpin/SpinPortal/SpinPortal.vue.js +7 -0
  102. package/dist/components/HysSpin/SpinPortal/SpinPortal2.vue.js +66 -0
  103. package/dist/components/HysSpin/SpinPortal/spinTarget.js +57 -0
  104. package/dist/components/HysSpin/spinCatalog.js +35 -0
  105. package/dist/components/HysSpin/spinConfig.js +32 -0
  106. package/dist/components/HysSpin/spinService.js +160 -0
  107. package/dist/components/HysSpin/spinStyle.js +39 -0
  108. package/dist/components/HysSpin/useHysSpinTask.js +92 -0
  109. package/dist/components/HysSpin/useSpinFullscreen.js +60 -0
  110. package/dist/components/HysSpin/useSpinVisibility.js +59 -0
  111. package/dist/components/HysSplitPane/HysSplitPane.vue.js +285 -204
  112. package/dist/components/HysSplitPane/splitPaneResize.js +75 -0
  113. package/dist/components/HysTabPane/HysTabPane.vue.js +49 -0
  114. package/dist/components/HysTabPane/HysTabPane2.vue.js +4 -0
  115. package/dist/components/HysTable/HysTable.vue.js +3 -3
  116. package/dist/components/HysTable/HysTable2.vue.js +412 -383
  117. package/dist/components/HysTable/tableSearch.js +24 -0
  118. package/dist/components/HysTabs/HysTabs.vue.js +172 -5
  119. package/dist/components/HysTabs/HysTabs2.vue.js +2 -275
  120. package/dist/components/HysTabs/TabsMore/TabsMore.vue.js +7 -0
  121. package/dist/components/HysTabs/TabsMore/TabsMore2.vue.js +133 -0
  122. package/dist/components/HysTabs/TabsPanels/TabsPanels.vue.js +161 -0
  123. package/dist/components/HysTabs/TabsPanels/TabsPanels2.vue.js +4 -0
  124. package/dist/components/HysTabs/TabsPrompts/TabsPrompts.vue.js +4 -0
  125. package/dist/components/HysTabs/TabsPrompts/TabsPrompts2.vue.js +88 -0
  126. package/dist/components/HysTabs/TabsSlot/TabsSlot.js +13 -0
  127. package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.js +7 -0
  128. package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench2.vue.js +687 -0
  129. package/dist/components/HysTabs/tabsConfig.js +35 -0
  130. package/dist/components/HysTabs/tabsItems.js +79 -0
  131. package/dist/components/HysTabs/tabsPersistence.js +118 -0
  132. package/dist/components/HysTabs/useHysRouteTabs.js +77 -0
  133. package/dist/components/HysTabs/useTabsDragGhost.js +47 -0
  134. package/dist/components/HysTabs/useTabsNav.js +127 -0
  135. package/dist/components/HysTabs/useTabsOverlays.js +52 -0
  136. package/dist/components/HysTabs/useTabsPanels.js +101 -0
  137. package/dist/components/HysTabs/useTabsPointer.js +131 -0
  138. package/dist/components/HysTabs/useTabsState.js +263 -0
  139. package/dist/composables/datePicker.js +153 -94
  140. package/dist/composables/datePickerModel.js +156 -0
  141. package/dist/composables/datePickerPanels.js +78 -0
  142. package/dist/composables/datePickerRules.js +166 -0
  143. package/dist/composables/floatingPosition.js +32 -13
  144. package/dist/composables/formLayout.js +20 -42
  145. package/dist/composables/popupSurfaceStyle.js +30 -0
  146. package/dist/composables/useContainerWidth.js +24 -0
  147. package/dist/composables/useDatePicker.js +274 -381
  148. package/dist/composables/useFloating.js +42 -41
  149. package/dist/composables/usePageVisibility.js +19 -0
  150. package/dist/composables/usePopupSurface.js +153 -162
  151. package/dist/composables/usePopupSurfaceInteractions.js +91 -90
  152. package/dist/composables/useSplitPaneDrag.js +29 -26
  153. package/dist/composables/useSvgInstanceId.js +15 -0
  154. package/dist/composables/useTable.js +321 -306
  155. package/dist/composables/useTabularRowNavigation.js +46 -0
  156. package/dist/index.js +229 -185
  157. package/dist/internal/MultiSplitPane.vue.js +246 -205
  158. package/dist/internal/PopupSurfacePanel.vue.js +2 -2
  159. package/dist/internal/PopupSurfacePanel2.vue.js +35 -30
  160. package/dist/style.css +1 -1
  161. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +40 -2
  162. package/dist/types/components/HysDataGrid/gridColumnLayout.d.ts +22 -0
  163. package/dist/types/components/HysDataGrid/gridPresentation.d.ts +47 -0
  164. package/dist/types/components/HysDataGrid/useGridContextMenu.d.ts +14 -0
  165. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +6 -9
  166. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +12 -0
  167. package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +6 -0
  168. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +6 -9
  169. package/dist/types/components/HysDescriptions/HysDescriptions.vue.d.ts +20 -0
  170. package/dist/types/components/HysDescriptions/descriptionsTypes.d.ts +54 -0
  171. package/dist/types/components/HysForm/HysForm.vue.d.ts +1 -1
  172. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
  173. package/dist/types/components/HysIcon/HysIcon.vue.d.ts +76 -0
  174. package/dist/types/components/HysIcon/IconGraphic/IconGraphic.vue.d.ts +43 -0
  175. package/dist/types/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.d.ts +17 -0
  176. package/dist/types/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.d.ts +10 -0
  177. package/dist/types/components/HysIcon/IconTooltip/IconTooltip.vue.d.ts +11 -0
  178. package/dist/types/components/HysIcon/builtins/access.d.ts +15 -0
  179. package/dist/types/components/HysIcon/builtins/actions.d.ts +30 -0
  180. package/dist/types/components/HysIcon/builtins/business.d.ts +31 -0
  181. package/dist/types/components/HysIcon/builtins/communication.d.ts +27 -0
  182. package/dist/types/components/HysIcon/builtins/documents.d.ts +29 -0
  183. package/dist/types/components/HysIcon/builtins/extendedCatalog.d.ts +2 -0
  184. package/dist/types/components/HysIcon/builtins/iconInCategory.d.ts +2 -0
  185. package/dist/types/components/HysIcon/builtins/media.d.ts +24 -0
  186. package/dist/types/components/HysIcon/builtins/navigation.d.ts +30 -0
  187. package/dist/types/components/HysIcon/builtins/technology.d.ts +18 -0
  188. package/dist/types/components/HysIcon/iconBuiltins.d.ts +2 -0
  189. package/dist/types/components/HysIcon/iconConfig.d.ts +10 -0
  190. package/dist/types/components/HysIcon/iconRegistry.d.ts +5 -0
  191. package/dist/types/components/HysIcon/iconSafety.d.ts +8 -0
  192. package/dist/types/components/HysIcon/iconStyle.d.ts +6 -0
  193. package/dist/types/components/HysIcon/iconTypes.d.ts +192 -0
  194. package/dist/types/components/HysIcon/useIconResource.d.ts +14 -0
  195. package/dist/types/components/HysPopconfirm/HysPopconfirm.vue.d.ts +85 -0
  196. package/dist/types/components/HysPopconfirm/popconfirmTypes.d.ts +72 -0
  197. package/dist/types/components/HysPopconfirm/usePopconfirmAction.d.ts +6 -0
  198. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
  199. package/dist/types/components/HysResult/HysResult.vue.d.ts +22 -0
  200. package/dist/types/components/HysResult/resultTypes.d.ts +32 -0
  201. package/dist/types/components/HysSpace/HysSpace.vue.d.ts +15 -0
  202. package/dist/types/components/HysSpace/spaceItems.d.ts +9 -0
  203. package/dist/types/components/HysSpace/spaceTypes.d.ts +20 -0
  204. package/dist/types/components/HysSpin/HysSpin.vue.d.ts +84 -0
  205. package/dist/types/components/HysSpin/SpinGlyph/SpinGlyph.vue.d.ts +16 -0
  206. package/dist/types/components/HysSpin/SpinPortal/SpinPortal.vue.d.ts +21 -0
  207. package/dist/types/components/HysSpin/SpinPortal/spinTarget.d.ts +3 -0
  208. package/dist/types/components/HysSpin/spinCatalog.d.ts +122 -0
  209. package/dist/types/components/HysSpin/spinConfig.d.ts +10 -0
  210. package/dist/types/components/HysSpin/spinService.d.ts +7 -0
  211. package/dist/types/components/HysSpin/spinStyle.d.ts +5 -0
  212. package/dist/types/components/HysSpin/spinTypes.d.ts +133 -0
  213. package/dist/types/components/HysSpin/useHysSpinTask.d.ts +4 -0
  214. package/dist/types/components/HysSpin/useSpinFullscreen.d.ts +17 -0
  215. package/dist/types/components/HysSpin/useSpinVisibility.d.ts +10 -0
  216. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +25 -2
  217. package/dist/types/components/HysSplitPane/splitPaneResize.d.ts +17 -0
  218. package/dist/types/components/HysTabPane/HysTabPane.vue.d.ts +11 -0
  219. package/dist/types/components/HysTable/HysTable.vue.d.ts +16 -10
  220. package/dist/types/components/HysTable/tableSearch.d.ts +2 -0
  221. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +83 -74
  222. package/dist/types/components/HysTabs/TabsMore/TabsMore.vue.d.ts +14 -0
  223. package/dist/types/components/HysTabs/TabsPanels/TabsPanels.vue.d.ts +17 -0
  224. package/dist/types/components/HysTabs/TabsPrompts/TabsPrompts.vue.d.ts +7 -0
  225. package/dist/types/components/HysTabs/TabsSlot/TabsSlot.d.ts +9 -0
  226. package/dist/types/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.d.ts +32 -0
  227. package/dist/types/components/HysTabs/tabsConfig.d.ts +4 -0
  228. package/dist/types/components/HysTabs/tabsItems.d.ts +14 -0
  229. package/dist/types/components/HysTabs/tabsPersistence.d.ts +6 -0
  230. package/dist/types/components/HysTabs/tabsTypes.d.ts +236 -0
  231. package/dist/types/components/HysTabs/useHysRouteTabs.d.ts +22 -0
  232. package/dist/types/components/HysTabs/useTabsDragGhost.d.ts +22 -0
  233. package/dist/types/components/HysTabs/useTabsNav.d.ts +20 -0
  234. package/dist/types/components/HysTabs/useTabsOverlays.d.ts +54 -0
  235. package/dist/types/components/HysTabs/useTabsPanels.d.ts +14 -0
  236. package/dist/types/components/HysTabs/useTabsPointer.d.ts +30 -0
  237. package/dist/types/components/HysTabs/useTabsState.d.ts +32 -0
  238. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +2 -2
  239. package/dist/types/components/HysToast/toastPresentation.d.ts +1 -1
  240. package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +2 -2
  241. package/dist/types/composables/dataGrid.d.ts +34 -0
  242. package/dist/types/composables/datePicker.d.ts +14 -214
  243. package/dist/types/composables/datePickerModel.d.ts +63 -0
  244. package/dist/types/composables/datePickerPanels.d.ts +23 -0
  245. package/dist/types/composables/datePickerRules.d.ts +31 -0
  246. package/dist/types/composables/datePickerTypes.d.ts +277 -0
  247. package/dist/types/composables/floatingPosition.d.ts +1 -1
  248. package/dist/types/composables/formLayout.d.ts +1 -2
  249. package/dist/types/composables/popupSurfaceStyle.d.ts +7 -0
  250. package/dist/types/composables/table.d.ts +10 -1
  251. package/dist/types/composables/toastQueue.d.ts +4 -4
  252. package/dist/types/composables/toastQueueModel.d.ts +2 -2
  253. package/dist/types/composables/useColorPicker.d.ts +2 -4
  254. package/dist/types/composables/useContainerWidth.d.ts +2 -0
  255. package/dist/types/composables/useContextMenu.d.ts +2 -4
  256. package/dist/types/composables/useDatePicker.d.ts +20 -11
  257. package/dist/types/composables/useFloating.d.ts +4 -5
  258. package/dist/types/composables/usePageVisibility.d.ts +1 -0
  259. package/dist/types/composables/usePopupSurface.d.ts +9 -3
  260. package/dist/types/composables/usePopupSurfaceInteractions.d.ts +4 -2
  261. package/dist/types/composables/useSplitPaneDrag.d.ts +2 -2
  262. package/dist/types/composables/useSvgInstanceId.d.ts +1 -0
  263. package/dist/types/composables/useTable.d.ts +2 -0
  264. package/dist/types/composables/useTabularRowNavigation.d.ts +18 -0
  265. package/dist/types/index.d.ts +31 -3
  266. package/dist/types/internal/MultiSplitPane.vue.d.ts +10 -1
  267. package/dist/types/internal/PopupSurfacePanel.vue.d.ts +3 -0
  268. package/package.json +1 -1
@@ -4,7 +4,7 @@ import { popupSize as Q } from "../motion/popup.js";
4
4
  import { positionFloating as Z } from "./floatingPosition.js";
5
5
  import { overlayOwnerKey as _, registerOverlay as ee } from "./overlayManager.js";
6
6
  function re(v, n, e = {}) {
7
- const { disabled: k } = J({}), m = T(_, void 0), c = E(!1), W = Y(), p = E(!1), L = E({
7
+ const { disabled: M } = J({}), m = T(_, void 0), s = E(!1), W = Y(), p = E(!1), L = E({
8
8
  position: "fixed",
9
9
  top: "0px",
10
10
  left: "0px",
@@ -17,58 +17,59 @@ function re(v, n, e = {}) {
17
17
  let $ = 0, w, r, y = 0;
18
18
  function F() {
19
19
  var R, S, H;
20
- if (!c.value || !v.value || !n.value) return;
20
+ if (!s.value || !v.value || !n.value) return;
21
21
  const t = v.value.getBoundingClientRect();
22
22
  if (!t.width && !t.height) {
23
- u();
23
+ u(!1, !1, "anchor");
24
24
  return;
25
25
  }
26
- const a = Number.isFinite(e.gap) ? e.gap : 8, i = Number.isFinite(e.padding) ? Math.max(0, e.padding) : 10, l = document.documentElement.clientWidth, o = document.documentElement.clientHeight, d = Math.min(t.width, Math.max(0, l - 2 * i)), g = typeof e.matchWidth == "function" ? e.matchWidth() : e.matchWidth, h = (R = e.maxWidth) == null ? void 0 : R.call(e), P = h !== void 0 && (typeof h != "number" || Number.isFinite(h)) ? `min(${typeof h == "number" ? Math.max(0, h) + "px" : h},calc(100vw - ${i * 2}px))` : `calc(100vw - ${i * 2}px)`, b = (S = e.width) == null ? void 0 : S.call(e), x = typeof b == "number" ? Number.isFinite(b) ? Math.max(0, b) + "px" : void 0 : b;
27
- x !== void 0 ? (n.value.style.width = x, n.value.style.minWidth = "0", n.value.style.maxWidth = P) : g === !0 && (n.value.style.width = `${d}px`, n.value.style.minWidth = "0", n.value.style.maxWidth = `${d}px`), x === void 0 && g === "min" && (n.value.style.width = "max-content", n.value.style.minWidth = `${d}px`, n.value.style.maxWidth = `calc(100vw - ${i * 2}px)`);
26
+ const a = Number.isFinite(e.gap) ? e.gap : 8, i = Number.isFinite(e.padding) ? Math.max(0, e.padding) : 10, l = document.documentElement.clientWidth, d = document.documentElement.clientHeight, c = Math.min(t.width, Math.max(0, l - 2 * i)), g = typeof e.matchWidth == "function" ? e.matchWidth() : e.matchWidth, h = (R = e.maxWidth) == null ? void 0 : R.call(e), N = h !== void 0 && (typeof h != "number" || Number.isFinite(h)) ? `min(${typeof h == "number" ? Math.max(0, h) + "px" : h},calc(100vw - ${i * 2}px))` : `calc(100vw - ${i * 2}px)`, b = (S = e.width) == null ? void 0 : S.call(e), x = typeof b == "number" ? Number.isFinite(b) ? Math.max(0, b) + "px" : void 0 : b;
27
+ x !== void 0 ? (n.value.style.width = x, n.value.style.minWidth = "0", n.value.style.maxWidth = N) : g === !0 && (n.value.style.width = `${c}px`, n.value.style.minWidth = "0", n.value.style.maxWidth = `${c}px`), x === void 0 && g === "min" && (n.value.style.width = "max-content", n.value.style.minWidth = `${c}px`, n.value.style.maxWidth = `calc(100vw - ${i * 2}px)`);
28
28
  const z = Z(
29
29
  t,
30
30
  Q(n.value),
31
- { width: l, height: o },
31
+ { width: l, height: d },
32
32
  A(),
33
33
  a,
34
34
  i,
35
- e.autoAdjustOverflow !== !1
35
+ e.autoAdjustOverflow !== !1,
36
+ e.fallbackPlacements
36
37
  );
37
- let { x: O, y: M } = z;
38
+ let { x: O, y: k } = z;
38
39
  if (C.value = z.placement, (H = e.onPosition) == null || H.call(e, { anchor: t, ...z }), e.strategy === "absolute") {
39
40
  n.value.style.position = "absolute";
40
41
  const f = n.value.offsetParent;
41
42
  if (f && f !== document.body && f !== document.documentElement) {
42
43
  const j = f.getBoundingClientRect();
43
- O += f.scrollLeft - j.left - f.clientLeft, M += f.scrollTop - j.top - f.clientTop;
44
+ O += f.scrollLeft - j.left - f.clientLeft, k += f.scrollTop - j.top - f.clientTop;
44
45
  } else
45
- O += window.scrollX, M += window.scrollY;
46
+ O += window.scrollX, k += window.scrollY;
46
47
  }
47
48
  L.value = {
48
- ...x !== void 0 ? { width: x, minWidth: "0" } : g === !0 ? { width: `${d}px`, minWidth: "0" } : g === "min" ? { width: "max-content", minWidth: `${d}px` } : {},
49
+ ...x !== void 0 ? { width: x, minWidth: "0" } : g === !0 ? { width: `${c}px`, minWidth: "0" } : g === "min" ? { width: "max-content", minWidth: `${c}px` } : {},
49
50
  position: e.strategy ?? "fixed",
50
51
  left: `${Math.round(O)}px`,
51
- top: `${Math.round(M)}px`,
52
+ top: `${Math.round(k)}px`,
52
53
  visibility: "visible",
53
54
  zIndex: "1200",
54
- maxWidth: P,
55
+ maxWidth: N,
55
56
  maxHeight: `calc(100vh - ${i * 2}px)`,
56
57
  overflowY: "auto",
57
58
  overscrollBehavior: "contain"
58
59
  };
59
60
  }
60
- function s() {
61
+ function o() {
61
62
  cancelAnimationFrame($), $ = requestAnimationFrame(F);
62
63
  }
63
64
  function I(t) {
64
65
  var a, i;
65
- !(r != null && r()) || e.closeOnOutside === !1 || !((a = v.value) != null && a.contains(t.target)) && !((i = n.value) != null && i.contains(t.target)) && u();
66
+ !(r != null && r()) || e.closeOnOutside === !1 || !((a = v.value) != null && a.contains(t.target)) && !((i = n.value) != null && i.contains(t.target)) && u(!1, !1, "outside");
66
67
  }
67
- function q(t) {
68
+ function P(t) {
68
69
  var a, i;
69
- if (!(!c.value || !(r != null && r()))) {
70
+ if (!(!s.value || !(r != null && r()))) {
70
71
  if (t.key === "Escape" && e.closeOnEscape !== !1)
71
- t.preventDefault(), t.stopImmediatePropagation(), u(!0);
72
+ t.preventDefault(), t.stopImmediatePropagation(), u(!0, !1, "escape");
72
73
  else if (t.key === "Tab" && e.closeOnTab !== !1) {
73
74
  const l = document.activeElement;
74
75
  if ((a = v.value) != null && a.contains(l)) {
@@ -76,25 +77,25 @@ function re(v, n, e = {}) {
76
77
  return;
77
78
  }
78
79
  if ((i = n.value) != null && i.contains(l)) {
79
- const o = Array.from(
80
+ const d = Array.from(
80
81
  n.value.querySelectorAll(
81
82
  'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])'
82
83
  )
83
84
  ).filter(
84
- (d) => d.getClientRects().length && !d.closest("[inert]")
85
+ (c) => c.getClientRects().length && !c.closest("[inert]")
85
86
  );
86
- (!o.length || l === (t.shiftKey ? o[0] : o.at(-1))) && u(!0);
87
+ (!d.length || l === (t.shiftKey ? d[0] : d.at(-1))) && u(!0);
87
88
  }
88
89
  }
89
90
  }
90
91
  }
91
- function B() {
92
+ function q() {
92
93
  var t, a;
93
- document.removeEventListener("pointerdown", I, !0), document.removeEventListener("keydown", q, !0), window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0), (t = window.visualViewport) == null || t.removeEventListener("resize", s), (a = window.visualViewport) == null || a.removeEventListener("scroll", s), cancelAnimationFrame($), w == null || w(), w = void 0, W.value = void 0, r = void 0;
94
+ document.removeEventListener("pointerdown", I, !0), document.removeEventListener("keydown", P, !0), window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0), (t = window.visualViewport) == null || t.removeEventListener("resize", o), (a = window.visualViewport) == null || a.removeEventListener("scroll", o), cancelAnimationFrame($), w == null || w(), w = void 0, W.value = void 0, r = void 0;
94
95
  }
95
- function u(t = !1, a = !1) {
96
- var i, l;
97
- if (!(!a && c.value && ((i = e.requestOpen) == null ? void 0 : i.call(e, !1, t)) === !1) && (y++, !!c.value && (c.value = !1, B(), t && ((l = v.value) != null && l.isConnected)))) {
96
+ function u(t = !1, a = !1, i) {
97
+ var l, d;
98
+ if (!(!a && s.value && ((l = e.requestOpen) == null ? void 0 : l.call(e, !1, t, i)) === !1) && (y++, !!s.value && (s.value = !1, q(), t && ((d = v.value) != null && d.isConnected)))) {
98
99
  p.value = !0;
99
100
  try {
100
101
  v.value.focus();
@@ -103,33 +104,33 @@ function re(v, n, e = {}) {
103
104
  }
104
105
  }
105
106
  }
106
- async function N(t = !1) {
107
- var l, o, d;
108
- if (k.value || (m == null ? void 0 : m.value) === !1) return;
109
- if (c.value) {
110
- s();
107
+ async function B(t = !1) {
108
+ var l, d, c;
109
+ if (M.value || (m == null ? void 0 : m.value) === !1) return;
110
+ if (s.value) {
111
+ o();
111
112
  return;
112
113
  }
113
114
  if (!t && ((l = e.requestOpen) == null ? void 0 : l.call(e, !0)) === !1) return;
114
115
  const a = ++y;
115
- if (c.value = !0, L.value = {
116
+ if (s.value = !0, L.value = {
116
117
  position: "fixed",
117
118
  top: "0px",
118
119
  left: "0px",
119
120
  visibility: "hidden"
120
- }, await G(), a !== y || !c.value) return;
121
+ }, await G(), a !== y || !s.value) return;
121
122
  const i = ee(
122
123
  "floating",
123
- () => u(!0),
124
+ () => u(!0, !1, "escape"),
124
125
  e.zIndex
125
126
  );
126
- W.value = i, w = i.unregister, r = i.isTop, F(), document.addEventListener("pointerdown", I, !0), document.addEventListener("keydown", q, !0), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), (o = window.visualViewport) == null || o.addEventListener("resize", s), (d = window.visualViewport) == null || d.addEventListener("scroll", s);
127
+ W.value = i, w = i.unregister, r = i.isTop, F(), document.addEventListener("pointerdown", I, !0), document.addEventListener("keydown", P, !0), window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), (d = window.visualViewport) == null || d.addEventListener("resize", o), (c = window.visualViewport) == null || c.addEventListener("scroll", o);
127
128
  }
128
129
  function K() {
129
- return c.value ? u() : N();
130
+ return s.value ? u() : B();
130
131
  }
131
132
  return D(
132
- k,
133
+ M,
133
134
  (t) => {
134
135
  t && u(!1, !0);
135
136
  },
@@ -141,9 +142,9 @@ function re(v, n, e = {}) {
141
142
  },
142
143
  { flush: "sync" }
143
144
  ), V(() => {
144
- y++, B();
145
+ y++, q();
145
146
  }), {
146
- open: c,
147
+ open: s,
147
148
  style: X(() => {
148
149
  var t;
149
150
  return {
@@ -153,11 +154,11 @@ function re(v, n, e = {}) {
153
154
  }),
154
155
  placement: C,
155
156
  update: F,
156
- show: N,
157
+ show: B,
157
158
  close: u,
158
159
  toggle: K,
159
160
  restoringFocus: p,
160
- schedule: s,
161
+ schedule: o,
161
162
  isTop: () => (r == null ? void 0 : r()) ?? !1
162
163
  };
163
164
  }
@@ -0,0 +1,19 @@
1
+ import { onMounted as s, onActivated as u, onDeactivated as c, onBeforeUnmount as d, readonly as f, ref as a } from "vue";
2
+ const r = a(!1);
3
+ let o = 0;
4
+ function i() {
5
+ r.value = document.hidden;
6
+ }
7
+ function b() {
8
+ let e = !1;
9
+ function n() {
10
+ e || (e = !0, ++o === 1 && (i(), document.addEventListener("visibilitychange", i)));
11
+ }
12
+ function t() {
13
+ e && (e = !1, --o === 0 && document.removeEventListener("visibilitychange", i));
14
+ }
15
+ return s(n), u(n), c(t), d(t), f(r);
16
+ }
17
+ export {
18
+ b as usePageVisibility
19
+ };
@@ -1,59 +1,61 @@
1
- import { ref as C, shallowRef as le, useId as ce, inject as re, computed as u, watch as f, onMounted as ie, onActivated as se, onDeactivated as ve, onBeforeUnmount as fe, nextTick as G } from "vue";
2
- import { useHysControlState as de } from "./formContext.js";
3
- import { useChoiceModel as he } from "./choiceModel.js";
4
- import { overlayOwnerKey as me } from "./overlayManager.js";
5
- import { useFloating as ye } from "./useFloating.js";
6
- import { popupFocusControls as L, usePopupSurfaceInteractions as ge } from "./usePopupSurfaceInteractions.js";
7
- import { createPopupReferenceBinding as xe } from "./popupReferenceBinding.js";
8
- const q = (t) => typeof t == "number" ? Number.isFinite(t) ? Math.max(0, t) + "px" : void 0 : t;
9
- function Se(t, i, y) {
10
- const g = C(), p = le(), b = C(), E = ce() + "-popup", J = E + "-title", { disabled: k } = de(t), s = re(me, void 0), l = C(!0), w = C(!1), z = C(!1), M = he(
1
+ import { ref as E, shallowRef as fe, useId as de, inject as ve, computed as i, watch as d, onMounted as me, onActivated as pe, onDeactivated as ye, onBeforeUnmount as ge, nextTick as k } from "vue";
2
+ import { useHysControlState as he } from "./formContext.js";
3
+ import { useChoiceModel as we } from "./choiceModel.js";
4
+ import { overlayOwnerKey as be } from "./overlayManager.js";
5
+ import { useFloating as xe } from "./useFloating.js";
6
+ import { popupFocusControls as j, usePopupSurfaceInteractions as Oe } from "./usePopupSurfaceInteractions.js";
7
+ import { createPopupReferenceBinding as Ce } from "./popupReferenceBinding.js";
8
+ import { usePopupSurfaceStyle as Ee, popupMaximumWidth as Re } from "./popupSurfaceStyle.js";
9
+ function Ie(t, v, y, u) {
10
+ const g = E(), b = fe(), x = E(), R = de() + "-popup", ee = R + "-title", { disabled: q } = he(t), s = ve(be, void 0), c = E(!0), O = E(!1), B = E(!1), M = we(
11
11
  {
12
12
  get modelValue() {
13
13
  return t.open ?? t.modelValue;
14
14
  }
15
15
  },
16
16
  () => t.defaultOpen ?? !1
17
- ), R = u(
18
- () => l.value && !k.value && (s == null ? void 0 : s.value) !== !1
19
- ), d = u(
17
+ ), A = i(
18
+ () => c.value && !q.value && (s == null ? void 0 : s.value) !== !1
19
+ ), m = i(
20
20
  () => typeof t.reference == "function" ? t.reference() : t.reference
21
- ), c = u(() => {
22
- const e = d.value;
23
- return e instanceof HTMLElement ? e : (e == null ? void 0 : e.contextElement) ?? p.value ?? g.value;
24
- }), S = u(
25
- () => !!p.value && (p.value.matches(L) || !!p.value.querySelector(L))
21
+ ), r = i(() => {
22
+ const e = m.value;
23
+ return e instanceof HTMLElement ? e : (e == null ? void 0 : e.contextElement) ?? b.value ?? g.value;
24
+ }), S = i(
25
+ () => !!b.value && (b.value.matches(j) || !!b.value.querySelector(j))
26
26
  );
27
- function B() {
27
+ function V() {
28
28
  var a;
29
- const e = c.value;
30
- (a = e != null && e.matches(L) ? e : (e == null ? void 0 : e.querySelector(L)) ?? g.value) == null || a.focus({ preventScroll: !0 });
29
+ const e = r.value;
30
+ (a = e != null && e.matches(j) ? e : (e == null ? void 0 : e.querySelector(j)) ?? g.value) == null || a.focus({ preventScroll: !0 });
31
31
  }
32
- function V() {
32
+ function K() {
33
33
  n.restoringFocus.value = !0;
34
34
  try {
35
- B();
35
+ V();
36
36
  } finally {
37
37
  n.restoringFocus.value = !1;
38
38
  }
39
39
  }
40
- const O = u(() => {
41
- const e = d.value ?? p.value ?? g.value;
40
+ const C = i(() => {
41
+ const e = m.value ?? b.value ?? g.value;
42
42
  if (e)
43
43
  return {
44
44
  getBoundingClientRect: () => e.getBoundingClientRect(),
45
45
  contains: (a) => {
46
- var r, m;
47
- return !!((r = c.value) != null && r.contains(a)) || !!((m = g.value) != null && m.contains(a));
46
+ var o, w;
47
+ return !!((o = r.value) != null && o.contains(a)) || !!((w = g.value) != null && w.contains(a));
48
48
  },
49
- focus: B,
49
+ focus: V,
50
50
  get isConnected() {
51
51
  var a;
52
- return ((a = c.value) == null ? void 0 : a.isConnected) ?? !!d.value;
52
+ return ((a = r.value) == null ? void 0 : a.isConnected) ?? !!m.value;
53
53
  }
54
54
  };
55
- }), D = u(() => {
55
+ }), N = i(() => {
56
56
  const e = t.appendTo;
57
+ if (typeof document > "u")
58
+ return typeof e == "string" ? e : "body";
57
59
  if (e instanceof HTMLElement) return e;
58
60
  if (typeof e == "string")
59
61
  try {
@@ -62,19 +64,19 @@ function Se(t, i, y) {
62
64
  return document.body;
63
65
  }
64
66
  return document.body;
65
- }), N = C({});
66
- function Q(e) {
67
- const a = e.placement.startsWith("left") || e.placement.startsWith("right"), r = a ? e.height : e.width, m = Number.isFinite(t.arrowOffset) ? Math.max(6, t.arrowOffset) : 10, W = a ? e.anchor.top + e.anchor.height / 2 - e.y : e.anchor.left + e.anchor.width / 2 - e.x;
68
- N.value = {
69
- [a ? "top" : "left"]: Math.max(Math.min(m, r / 2), Math.min(W, r - m)) + "px"
67
+ }), U = E({});
68
+ function te(e) {
69
+ const a = e.placement.startsWith("left") || e.placement.startsWith("right"), o = a ? e.height : e.width, w = Number.isFinite(t.arrowOffset) ? Math.max(6, t.arrowOffset) : 10, z = a ? e.anchor.top + e.anchor.height / 2 - e.y : e.anchor.left + e.anchor.width / 2 - e.x;
70
+ U.value = {
71
+ [a ? "top" : "left"]: Math.max(Math.min(w, o / 2), Math.min(z, o - w)) + "px"
70
72
  };
71
73
  }
72
- const n = ye(O, b, {
74
+ const n = xe(C, x, {
73
75
  get placement() {
74
76
  return t.placement;
75
77
  },
76
78
  get gap() {
77
- return t.offset ?? (i === "tooltip" ? 7 : 8);
79
+ return t.offset ?? (v === "tooltip" ? 7 : 8);
78
80
  },
79
81
  get autoAdjustOverflow() {
80
82
  return t.autoAdjustOverflow;
@@ -85,101 +87,103 @@ function Se(t, i, y) {
85
87
  get closeOnOutside() {
86
88
  return t.closeOnOutside;
87
89
  },
88
- closeOnTab: i === "tooltip",
90
+ closeOnTab: v === "tooltip",
89
91
  get strategy() {
90
- return t.appendTo === !1 || D.value !== document.body ? "absolute" : "fixed";
92
+ return t.appendTo === !1 || N.value !== document.body ? "absolute" : "fixed";
91
93
  },
92
94
  width: () => t.width,
93
- maxWidth: () => q(t.maxWidth) ?? (i === "tooltip" ? "320px" : "360px"),
95
+ maxWidth: () => Re(t, v),
94
96
  zIndex: () => t.zIndex,
95
- onPosition: Q,
96
- requestOpen(e, a) {
97
- return v(e, a), !1;
97
+ onPosition: te,
98
+ requestOpen(e, a, o) {
99
+ return f(e, a, o), !1;
98
100
  }
99
- }), o = ge(t, i, {
100
- available: R,
101
- anchor: O,
102
- actualReference: c,
103
- panel: b,
101
+ }), l = Oe(t, v, {
102
+ available: A,
103
+ anchor: C,
104
+ actualReference: r,
105
+ panel: x,
104
106
  floating: n,
105
- restoreReferenceFocus: V,
106
- request: v
107
- }), { handlers: h, tab: I } = o, P = xe(i, E, {
108
- pointerenter: h.pointerEnter,
109
- pointerleave: h.pointerLeave,
110
- focusin: h.focusIn,
111
- focusout: h.focusOut,
112
- click: h.click,
113
- contextmenu: h.contextmenu,
114
- keydown: h.key
107
+ restoreReferenceFocus: K,
108
+ request: f,
109
+ allowTabExit: u == null ? void 0 : u.allowTabExit
110
+ }), { handlers: p, tab: H } = l, W = Ce(v, R, {
111
+ pointerenter: p.pointerEnter,
112
+ pointerleave: p.pointerLeave,
113
+ focusin: p.focusIn,
114
+ focusout: p.focusOut,
115
+ click: p.click,
116
+ contextmenu: p.contextmenu,
117
+ keydown: p.key
115
118
  });
116
- function T() {
119
+ function F() {
117
120
  var a;
118
- const e = l.value && d.value ? c.value : void 0;
119
- P.attach(
121
+ const e = c.value && m.value ? r.value : void 0;
122
+ W.attach(
120
123
  e && !((a = g.value) != null && a.contains(e)) ? e : void 0,
121
124
  n.open.value
122
125
  );
123
126
  }
124
- let x, A = 0, $ = -1, K = -1;
125
- function F() {
127
+ let h, T = 0, G = -1, J = -1;
128
+ function L() {
126
129
  var e;
127
- R.value && !w.value && M.current.value && ((e = O.value) != null && e.isConnected) ? (z.value = !0, n.show(!0)) : n.close(!1, !0);
130
+ A.value && !O.value && M.current.value && ((e = C.value) != null && e.isConnected) ? (B.value = !0, n.show(!0)) : n.close(!1, !0);
128
131
  }
129
- async function v(e, a = !1) {
130
- var m, W;
131
- if (o.clearDelays(), !l.value || e && (!R.value || n.restoringFocus.value || !((m = O.value) != null && m.isConnected)))
132
+ async function f(e, a = !1, o = "programmatic", w = !0) {
133
+ var Q, X, Y, Z, _;
134
+ const z = n.open.value;
135
+ if (!e && z && ((Q = u == null ? void 0 : u.allowClose) == null ? void 0 : Q.call(u, o)) === !1 || (l.clearDelays(), !c.value || e && (!A.value || n.restoringFocus.value || !((X = C.value) != null && X.isConnected))))
132
136
  return !1;
133
- e || o.resetReasons(), w.value = !1;
134
- let r = Object.is(M.current.value, e);
135
- return r || (r = await M.commit(
137
+ e || l.resetReasons(), O.value = !1;
138
+ let I = Object.is(M.current.value, e);
139
+ return I || (I = await M.commit(
136
140
  e,
137
- (U) => {
138
- y("update:open", U), y("update:modelValue", U);
141
+ ($) => {
142
+ y("update:open", $), y("update:modelValue", $);
139
143
  },
140
144
  () => {
141
145
  }
142
- )), l.value ? (r && (e ? F() : (n.close(!1, !0), a && ((W = O.value) != null && W.isConnected) && V())), r) : !1;
146
+ )), c.value ? (I && (e ? L() : (n.close(!1, !0), a && ((Y = u == null ? void 0 : u.shouldRestoreFocus) == null ? void 0 : Y.call(u)) !== !1 && ((Z = C.value) != null && Z.isConnected) && K(), z && w && ((_ = u == null ? void 0 : u.onDismiss) == null || _.call(u, o)))), I) : !1;
143
147
  }
144
- function j() {
145
- x == null || x.disconnect(), x = void 0;
148
+ function D() {
149
+ h == null || h.disconnect(), h = void 0;
146
150
  }
147
- function X() {
148
- j(), !(!n.open.value || !b.value || typeof ResizeObserver > "u") && (x = new ResizeObserver(n.schedule), x.observe(b.value), c.value && x.observe(c.value));
151
+ function ne() {
152
+ D(), !(!n.open.value || !x.value || typeof ResizeObserver > "u") && (h = new ResizeObserver(n.schedule), h.observe(x.value), r.value && h.observe(r.value));
149
153
  }
150
- function H() {
151
- o.reset(), o.clearAuto(), P.detach(), j(), document.removeEventListener("keydown", I, !0), n.close(!1, !0);
154
+ function P() {
155
+ l.reset(), l.clearAuto(), W.detach(), D(), document.removeEventListener("keydown", H, !0), n.close(!1, !0);
152
156
  }
153
- f(
157
+ d(
154
158
  M.current,
155
159
  () => {
156
- w.value = !1, F();
160
+ O.value = !1, L();
157
161
  },
158
162
  { flush: "post" }
159
- ), f(
160
- [R, g, d],
163
+ ), d(
164
+ [A, g, m],
161
165
  () => {
162
- R.value || (o.reset(), o.clearAuto()), F(), T();
166
+ A.value || (l.reset(), l.clearAuto()), L(), F();
163
167
  },
164
168
  { flush: "post", immediate: !0 }
165
- ), f(
169
+ ), d(
166
170
  () => s == null ? void 0 : s.value,
167
171
  (e) => {
168
- e === !1 && (w.value = !0, H());
172
+ e === !1 && (O.value = !0, P());
169
173
  },
170
174
  { flush: "sync" }
171
- ), f(() => t.autoClose, o.startAuto), f(
172
- [c, d],
175
+ ), d(() => t.autoClose, l.startAuto), d(
176
+ [r, m],
173
177
  () => {
174
- o.reset(), n.schedule(), T();
178
+ l.reset(), n.schedule(), F();
175
179
  },
176
180
  { flush: "post" }
177
- ), f(
181
+ ), d(
178
182
  () => t.trigger,
179
183
  () => {
180
- o.reset();
184
+ l.reset();
181
185
  }
182
- ), f(
186
+ ), d(
183
187
  () => [
184
188
  t.placement,
185
189
  t.offset,
@@ -192,101 +196,88 @@ function Se(t, i, y) {
192
196
  ],
193
197
  n.schedule,
194
198
  { flush: "post" }
195
- ), f([n.open, b, c], X, { flush: "post" }), f(
199
+ ), d([n.open, x, r], ne, { flush: "post" }), d(
196
200
  n.open,
197
201
  (e) => {
198
- A++, P.syncAria(e), y("visibleChange", e), y("openChange", e), y(e ? "show" : "hide"), document.removeEventListener("keydown", I, !0), e ? (z.value = !0, document.addEventListener("keydown", I, !0), o.startAuto()) : (o.reset(), o.clearAuto(), j());
202
+ T++, W.syncAria(e), y("visibleChange", e), y("openChange", e), y(e ? "show" : "hide"), document.removeEventListener("keydown", H, !0), e ? (B.value = !0, document.addEventListener("keydown", H, !0), l.startAuto()) : (l.reset(), l.clearAuto(), D());
199
203
  },
200
204
  { flush: "sync" }
201
205
  );
202
- async function Y() {
203
- const e = A;
204
- await G(), l.value && n.open.value && e === A && $ !== e && ($ = e, y("opened"));
206
+ async function ae() {
207
+ const e = T;
208
+ await k(), c.value && n.open.value && e === T && G !== e && (G = e, y("opened"));
205
209
  }
206
- async function Z() {
207
- const e = A;
208
- await G(), l.value && !n.open.value && e === A && K !== e && (K = e, y("closed"));
210
+ async function ue() {
211
+ const e = T;
212
+ await k(), c.value && !n.open.value && e === T && J !== e && (J = e, y("closed"));
209
213
  }
210
- function _() {
211
- w.value = !0, H();
214
+ function le() {
215
+ O.value = !0, P();
212
216
  }
213
- ie(() => {
214
- F(), T();
215
- }), se(() => {
216
- l.value = !0, T();
217
- }), ve(() => {
218
- l.value = !1, w.value = !0, H();
219
- }), fe(() => {
220
- l.value = !1, H();
217
+ me(() => {
218
+ L(), F();
219
+ }), pe(() => {
220
+ c.value = !0, F();
221
+ }), ye(() => {
222
+ c.value = !1, O.value = !0, P();
223
+ }), ge(() => {
224
+ c.value = !1, P();
221
225
  });
222
- const ee = u(
223
- () => n.open.value || t.forceRender || t.destroyOnHide === !1 && z.value
224
- ), te = u(() => {
225
- const e = (t.effect ?? (i === "tooltip" ? "dark" : "light")) === "dark";
226
- return {
227
- "--hys-ui-popup-surface": t.color || (e ? "#172744" : "var(--hys-ui-surface,var(--hys-ui-theme-surface))"),
228
- "--hys-ui-popup-color": t.textColor || (e ? "#fff" : "var(--hys-ui-text,var(--hys-ui-theme-text))"),
229
- "--hys-ui-popup-border": t.color || (e ? "#172744" : "var(--hys-ui-border,var(--hys-ui-theme-border))")
230
- };
231
- }), ne = u(() => ({
232
- ...t.overlayStyle,
233
- ...n.style.value,
234
- ...te.value,
235
- overflow: "visible",
236
- maxWidth: `min(${q(t.maxWidth) ?? (i === "tooltip" ? "320px" : "360px")},calc(100vw - 20px))`,
237
- minWidth: t.width !== void 0 ? "0" : void 0
238
- })), ae = u(() => ({
239
- ...t.contentStyle,
240
- maxHeight: t.maxHeight !== void 0 ? `min(${q(t.maxHeight)},calc(100vh - 20px))` : "calc(100vh - 20px)"
241
- })), oe = u(() => ({
226
+ const ce = i(
227
+ () => n.open.value || t.forceRender || t.destroyOnHide === !1 && B.value
228
+ ), { style: re, contentStyle: oe } = Ee(
229
+ t,
230
+ v,
231
+ n.style
232
+ ), ie = i(() => ({
242
233
  open: n.open.value,
243
- show: () => v(!0),
244
- close: () => v(!1),
245
- toggle: () => v(!n.open.value),
234
+ show: () => f(!0),
235
+ close: () => f(!1),
236
+ toggle: () => f(!n.open.value),
246
237
  updatePosition: n.schedule
247
- })), ue = u(() => ({
248
- tabindex: d.value ? -1 : S.value ? void 0 : k.value ? -1 : t.triggerTabindex ?? 0,
249
- role: i === "popover" && !S.value && !d.value ? "button" : void 0,
250
- "aria-disabled": !S.value && k.value || void 0,
251
- ...S.value ? {} : i === "tooltip" ? { "aria-describedby": n.open.value ? E : void 0 } : {
252
- "aria-controls": n.open.value ? E : void 0,
238
+ })), se = i(() => ({
239
+ tabindex: m.value ? -1 : S.value ? void 0 : q.value ? -1 : t.triggerTabindex ?? 0,
240
+ role: v === "popover" && !S.value && !m.value ? "button" : void 0,
241
+ "aria-disabled": !S.value && q.value || void 0,
242
+ ...S.value ? {} : v === "tooltip" ? { "aria-describedby": n.open.value ? R : void 0 } : {
243
+ "aria-controls": n.open.value ? R : void 0,
253
244
  "aria-expanded": n.open.value,
254
245
  "aria-haspopup": "dialog"
255
246
  }
256
247
  }));
257
248
  return {
258
249
  wrapper: g,
259
- referenceElement: p,
260
- panel: b,
261
- actualReference: c,
250
+ referenceElement: b,
251
+ panel: x,
252
+ actualReference: r,
262
253
  nativeReference: S,
263
- id: E,
264
- titleId: J,
254
+ id: R,
255
+ titleId: ee,
265
256
  open: n.open,
266
257
  placement: n.placement,
267
- active: u(() => l.value && (s == null ? void 0 : s.value) !== !1),
268
- mounted: ee,
269
- teleportTo: D,
270
- arrowStyle: N,
271
- style: ne,
272
- contentStyle: ae,
273
- scope: oe,
274
- wrapperAttrs: ue,
275
- ...h,
276
- afterEnter: Y,
277
- afterLeave: Z,
278
- inactive: _,
279
- request: v,
280
- show: () => v(!0),
281
- hide: () => v(!1),
282
- toggle: () => v(!n.open.value),
258
+ active: i(() => c.value && (s == null ? void 0 : s.value) !== !1),
259
+ mounted: ce,
260
+ teleportTo: N,
261
+ arrowStyle: U,
262
+ style: re,
263
+ contentStyle: oe,
264
+ scope: ie,
265
+ wrapperAttrs: se,
266
+ ...p,
267
+ afterEnter: ae,
268
+ afterLeave: ue,
269
+ inactive: le,
270
+ request: f,
271
+ show: () => f(!0),
272
+ hide: () => f(!1),
273
+ toggle: () => f(!n.open.value),
283
274
  updatePosition: n.schedule,
284
275
  focus: () => {
285
276
  var e;
286
- return (e = O.value) == null ? void 0 : e.focus();
277
+ return (e = C.value) == null ? void 0 : e.focus();
287
278
  }
288
279
  };
289
280
  }
290
281
  export {
291
- Se as usePopupSurface
282
+ Ie as usePopupSurface
292
283
  };