@astryx-vue/core 0.2.6 → 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 (524) hide show
  1. package/THIRD_PARTY_NOTICES.md +9 -0
  2. package/dist/AlertDialog/index.js +1 -1
  3. package/dist/{AlertDialog-BBhl5P1X.js → AlertDialog-C2inDZWG.js} +13 -7
  4. package/dist/AppShell/index.d.ts +1 -1
  5. package/dist/AppShell/index.js +1 -1
  6. package/dist/{AppShell-mrflO0Uy.js → AppShell-CumzH-8z.js} +3 -3
  7. package/dist/Avatar/index.d.ts +1 -1
  8. package/dist/Avatar/index.js +1 -1
  9. package/dist/{Avatar-pPZ4dI_s.js → Avatar-BW0TE8t9.js} +47 -34
  10. package/dist/AvatarGroup/index.d.ts +1 -1
  11. package/dist/AvatarGroup/index.js +1 -1
  12. package/dist/{AvatarGroup-B--NQSB3.js → AvatarGroup-DLC_FFR5.js} +57 -13
  13. package/dist/Banner/index.d.ts +1 -1
  14. package/dist/Banner/index.js +1 -1
  15. package/dist/{Banner-GbGxrqQO.js → Banner-C5VAwo4D.js} +68 -34
  16. package/dist/Blockquote/index.js +1 -1
  17. package/dist/Blockquote-DRoKdcxZ.js +27 -0
  18. package/dist/BottomSheet/index.d.ts +1 -1
  19. package/dist/BottomSheet/index.js +2 -2
  20. package/dist/{BottomSheet-eJ3FzTBD.js → BottomSheet-B4sc3F1S.js} +288 -140
  21. package/dist/{BottomSheet-DIVwbGr3.js → BottomSheet-m54uCMJN.js} +20 -4
  22. package/dist/Breadcrumbs/index.d.ts +2 -2
  23. package/dist/Breadcrumbs/index.js +2 -2
  24. package/dist/Breadcrumbs-CTaz7Kh4.js +223 -0
  25. package/dist/Button/index.d.ts +1 -1
  26. package/dist/Button/index.js +1 -1
  27. package/dist/{Button-B6Hj_O_s.js → Button-ONOoHdkg.js} +25 -15
  28. package/dist/ButtonGroup/index.d.ts +1 -1
  29. package/dist/ButtonGroup/index.js +1 -1
  30. package/dist/ButtonGroup-DnkSZ9a5.js +87 -0
  31. package/dist/{ButtonTooltip-nWWrth8j.js → ButtonTooltip-CNKOQHYR.js} +7 -4
  32. package/dist/Calendar/index.d.ts +1 -1
  33. package/dist/Calendar/index.js +1 -1
  34. package/dist/{Calendar-B7vIowKq.js → Calendar-BAqzzQm2.js} +5 -5
  35. package/dist/Card/index.d.ts +2 -2
  36. package/dist/Card/index.js +1 -1
  37. package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
  38. package/dist/Carousel/index.js +1 -1
  39. package/dist/{Carousel-DAkOa7KK.js → Carousel-DXC22UWq.js} +50 -33
  40. package/dist/Chat/index.d.ts +1 -1
  41. package/dist/Chat/index.js +1 -1
  42. package/dist/{Chat-DVoI6UOA.js → Chat-BdJW6IX5.js} +152 -83
  43. package/dist/CheckboxIndicator/index.js +1 -1
  44. package/dist/{CheckboxIndicator-D37cm2Rh.js → CheckboxIndicator-fH4d-JE1.js} +9 -3
  45. package/dist/CheckboxInput/index.d.ts +1 -1
  46. package/dist/CheckboxInput/index.js +1 -1
  47. package/dist/{CheckboxInput-BS9J6edf.js → CheckboxInput-DJHCbwgC.js} +19 -11
  48. package/dist/CheckboxList/index.d.ts +1 -1
  49. package/dist/CheckboxList/index.js +1 -1
  50. package/dist/{CheckboxList-CX1i_jVP.js → CheckboxList-BdZIP4_J.js} +155 -38
  51. package/dist/Citation/index.js +1 -1
  52. package/dist/{Citation-Djgwa0ko.js → Citation-DbZn2vms.js} +8 -3
  53. package/dist/ClickableCard/index.d.ts +1 -1
  54. package/dist/ClickableCard/index.js +1 -1
  55. package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-ChAfiw9T.js} +10 -7
  56. package/dist/Code/index.d.ts +1 -1
  57. package/dist/Code/index.js +3 -3
  58. package/dist/{Code-XnPuGxey.js → Code-Bg7GBdxy.js} +2 -1
  59. package/dist/{CodeBlock-BUM3czCS.js → CodeBlock-Caaflp7C.js} +7 -3
  60. package/dist/Collapsible/index.d.ts +1 -1
  61. package/dist/Collapsible/index.js +1 -1
  62. package/dist/{Collapsible-Cov3Pyq5.js → Collapsible-Bdj0WYpb.js} +13 -11
  63. package/dist/CommandPalette/index.d.ts +1 -1
  64. package/dist/CommandPalette/index.js +1 -1
  65. package/dist/{CommandPalette-D6wYS30d.js → CommandPalette-C_MClfAg.js} +146 -62
  66. package/dist/ComplexSelector/index.d.ts +1 -1
  67. package/dist/ComplexSelector/index.js +1 -1
  68. package/dist/{ComplexSelector-Bil81sfq.js → ComplexSelector-BeVQaqRf.js} +94 -22
  69. package/dist/ContextMenu/index.d.ts +2 -2
  70. package/dist/ContextMenu/index.js +2 -2
  71. package/dist/{ContextMenu-DdLJnxNN.js → ContextMenu-C6hPYvYz.js} +299 -179
  72. package/dist/DateInput/index.d.ts +1 -1
  73. package/dist/DateInput/index.js +1 -1
  74. package/dist/{DateInput-u2XKccpK.js → DateInput-BjLdmYor.js} +567 -76
  75. package/dist/DateRangeInput/index.d.ts +1 -1
  76. package/dist/DateRangeInput/index.js +1 -1
  77. package/dist/{DateRangeInput-u7LhH6up.js → DateRangeInput-Br3wVEfD.js} +99 -28
  78. package/dist/DateTimeInput/index.d.ts +1 -1
  79. package/dist/DateTimeInput/index.js +1 -1
  80. package/dist/DateTimeInput-CAZBwoRe.js +562 -0
  81. package/dist/Dialog/index.d.ts +1 -1
  82. package/dist/Dialog/index.js +2 -2
  83. package/dist/{Dialog-BiOSKQso.js → Dialog-Dce4Y97V.js} +28 -11
  84. package/dist/{Dialog-FGHfDu5M.js → Dialog-fhyxB00e.js} +32 -5
  85. package/dist/Divider/index.d.ts +1 -1
  86. package/dist/Divider/index.js +1 -1
  87. package/dist/{Divider-BtwnL18I.js → Divider-mOZ6vIQw.js} +5 -1
  88. package/dist/DropdownMenu/index.d.ts +2 -2
  89. package/dist/DropdownMenu/index.js +3 -3
  90. package/dist/{DropdownMenu-SM_BEOgM.js → DropdownMenu-BdGmQVb1.js} +85 -57
  91. package/dist/{DropdownMenu-BEasdJ6R.js → DropdownMenu-BzQrNV9C.js} +481 -264
  92. package/dist/{DropdownMenuRadioItem.vue-CXEURBcq.d.ts → DropdownMenuRadioItem.vue-Qd-8Rg4Q.d.ts} +236 -230
  93. package/dist/EmptyState/index.js +1 -1
  94. package/dist/{EmptyState-C_GH7IV5.js → EmptyState-CmOQf2SH.js} +2 -2
  95. package/dist/Field/index.d.ts +4 -3
  96. package/dist/Field/index.js +4 -3
  97. package/dist/{Field-D5gUEGw4.js → Field--OEsLBfE.js} +4 -3
  98. package/dist/{FieldInfoTip-Ds-sW_jY.js → FieldInfoTip-gxsnfkZw.js} +3 -3
  99. package/dist/{FieldLabel-BNeXRuGH.js → FieldLabel-jxIiWgLw.js} +12 -7
  100. package/dist/FieldStatus/index.d.ts +1 -1
  101. package/dist/FileInput/index.d.ts +1 -1
  102. package/dist/FileInput/index.js +1 -1
  103. package/dist/{FileInput-BpdiO1V8.js → FileInput-B_pUxB0Y.js} +106 -29
  104. package/dist/FormLayout/index.d.ts +1 -1
  105. package/dist/FormLayout/index.js +1 -1
  106. package/dist/{FormLayout-D47FjiOq.js → FormLayout-B9dUB6Ps.js} +1 -1
  107. package/dist/Heading/index.d.ts +1 -1
  108. package/dist/Heading/index.js +1 -1
  109. package/dist/{Heading-BnwWEWkp.js → Heading-BzBunfN7.js} +1 -1
  110. package/dist/HoverCard/index.js +1 -1
  111. package/dist/{HoverCard-ycY50pRN.js → HoverCard-BpJhT0sn.js} +35 -22
  112. package/dist/Icon/index.d.ts +4 -4
  113. package/dist/Icon/index.js +1 -1
  114. package/dist/{Icon-bteSId7T.js → Icon-KDnUyY7f.js} +12 -20
  115. package/dist/IconButton/index.js +1 -1
  116. package/dist/{IconButton-DDNgNl7B.js → IconButton-DI-XBbtV.js} +1 -1
  117. package/dist/Indicator/index.d.ts +2 -2
  118. package/dist/Indicator/index.js +2 -1
  119. package/dist/InputClearButton-CwXPan8c.js +40 -0
  120. package/dist/InputGroup/index.d.ts +1 -1
  121. package/dist/InputGroup/index.js +2 -2
  122. package/dist/{InputGroup-CA03Smrs.js → InputGroup-DiiocoIW.js} +2 -2
  123. package/dist/InternationalizationProvider/index.d.ts +1 -1
  124. package/dist/InternationalizationProvider/index.js +1 -1
  125. package/dist/{InternationalizationProvider-DJay_w3B.js → InternationalizationProvider-kBapgKAQ.js} +5 -9
  126. package/dist/{Item-KhFKX9St.js → Item-DWMIjN8n.js} +34 -9
  127. package/dist/Kbd/index.js +1 -1
  128. package/dist/{Kbd-BB-Dw6zE.js → Kbd-CV3LO2Ge.js} +18 -2
  129. package/dist/LayerContentBoundary-CvsKxwwm.js +27 -0
  130. package/dist/LayerProvider/index.js +1 -1
  131. package/dist/{LayerProvider-D9NsQFzL.js → LayerProvider-B6zpMBWC.js} +15 -3
  132. package/dist/Layout/index.d.ts +1 -1
  133. package/dist/Layout/index.js +2 -2
  134. package/dist/{Layout-9X6eCUoY.js → Layout-JJRCG7Mf.js} +1 -1
  135. package/dist/{LayoutPanel-DeOh00p5.js → LayoutPanel-zM5vjrKS.js} +15 -8
  136. package/dist/Lightbox/index.js +1 -1
  137. package/dist/{Lightbox-DTF9EdTG.js → Lightbox-D8wyPgMK.js} +8 -6
  138. package/dist/Link/index.d.ts +2 -2
  139. package/dist/Link/index.js +1 -1
  140. package/dist/{Link-BqHCtiyt.js → Link-DweIpOtN.js} +29 -12
  141. package/dist/List/index.d.ts +1 -1
  142. package/dist/List/index.js +2 -2
  143. package/dist/{ListItem-8RWT8XAG.js → ListItem-BQXMu1Tb.js} +1 -1
  144. package/dist/Markdown/index.d.ts +5 -2
  145. package/dist/Markdown/index.js +5 -2
  146. package/dist/Markdown/parser/index.d.ts +4 -0
  147. package/dist/Markdown/parser/index.js +3 -0
  148. package/dist/Markdown/plugin-protocol/index.d.ts +35 -0
  149. package/dist/Markdown/plugin-protocol/index.js +107 -0
  150. package/dist/Markdown/plugin-renderer/index.d.ts +31 -0
  151. package/dist/Markdown/plugin-renderer/index.js +42 -0
  152. package/dist/{Markdown-2CVyZDuB.js → Markdown-DhVfOvXk.js} +195 -484
  153. package/dist/MediaTheme-DlLqYhDy.js +433 -0
  154. package/dist/MetadataList/index.js +1 -1
  155. package/dist/{MetadataList-B-OelQlt.js → MetadataList-CEYceIlN.js} +15 -7
  156. package/dist/MobileNav/index.js +1 -1
  157. package/dist/{MobileNavToggle-C3dkrM98.js → MobileNavToggle-pdoJFZHx.js} +60 -19
  158. package/dist/MoreMenu/index.d.ts +1 -1
  159. package/dist/MoreMenu/index.js +1 -1
  160. package/dist/{MoreMenu-D1WFGqGU.js → MoreMenu-CFNqSRev.js} +87 -67
  161. package/dist/MultiSelector/index.d.ts +1 -1
  162. package/dist/MultiSelector/index.js +1 -1
  163. package/dist/MultiSelector-DuVatmq5.js +1456 -0
  164. package/dist/{NavDisclosure-C_fugrQ3.js → NavDisclosure-Bq9DTZLO.js} +29 -7
  165. package/dist/{NavHeadingSurface-B3yJspSN.js → NavHeadingSurface-C4v_MtkX.js} +29 -26
  166. package/dist/NavItem/index.d.ts +1 -1
  167. package/dist/NavItem/index.js +2 -2
  168. package/dist/{NavItem-BBIGSvDj.js → NavItem-BPb3yfgz.js} +17 -4
  169. package/dist/NavMenu/index.d.ts +1 -1
  170. package/dist/NavMenu/index.js +3 -3
  171. package/dist/{NavMenu-ThXguZAz.js → NavMenu-BYIDzjix.js} +42 -15
  172. package/dist/{NavMenuItem-BvJNsDFC.js → NavMenuItem-D3FO90GR.js} +14 -12
  173. package/dist/NumberInput/index.d.ts +1 -1
  174. package/dist/NumberInput/index.js +1 -1
  175. package/dist/NumberInput-B0vzOg3N.js +727 -0
  176. package/dist/Outline/index.d.ts +2 -2
  177. package/dist/Outline/index.js +2 -2
  178. package/dist/{Outline-755h-lMP.js → Outline-CfGv2F1o.js} +91 -6
  179. package/dist/OverflowList/index.d.ts +2 -2
  180. package/dist/OverflowList/index.js +1 -1
  181. package/dist/{OverflowList-NmrSMbxb.js → OverflowList-BgRLZ3dh.js} +23 -6
  182. package/dist/Pagination/index.d.ts +1 -1
  183. package/dist/Pagination/index.js +1 -1
  184. package/dist/{Pagination-Cc4BrjQg.js → Pagination-Bfe12018.js} +2 -2
  185. package/dist/PickerWheel-CSwUYfes.js +69 -0
  186. package/dist/Popover/index.d.ts +1 -1
  187. package/dist/Popover/index.js +1 -1
  188. package/dist/{Popover-CtoBfVlD.js → Popover-78dFjTb9.js} +28 -17
  189. package/dist/PowerSearch/index.d.ts +1 -1
  190. package/dist/PowerSearch/index.js +1 -1
  191. package/dist/{PowerSearch-DHoiObLn.js → PowerSearch-BoAMdFaT.js} +776 -586
  192. package/dist/ProgressBar/index.d.ts +1 -1
  193. package/dist/ProgressBar/index.js +1 -1
  194. package/dist/{ProgressBar-CVLzdoBK.js → ProgressBar-VP4JS7vm.js} +10 -7
  195. package/dist/Radio/index.d.ts +1 -1
  196. package/dist/Radio/index.js +1 -1
  197. package/dist/{RadioGroup-Bfu6JSNV.js → RadioGroup-BIipql-L.js} +94 -26
  198. package/dist/RadioList/index.d.ts +1 -1
  199. package/dist/RadioList/index.js +1 -1
  200. package/dist/{RadioList-xY1cwLdZ.js → RadioList-GyhgBg4j.js} +57 -8
  201. package/dist/Resizable/index.d.ts +1 -1
  202. package/dist/Resizable/index.js +1 -1
  203. package/dist/{ResizeHandle-q4nD_586.js → ResizeHandle-TPlUCAHD.js} +103 -50
  204. package/dist/ScrollableArea/index.d.ts +1 -1
  205. package/dist/ScrollableArea/index.js +1 -1
  206. package/dist/{ScrollableArea-CJiaALHm.js → ScrollableArea-0u6RWtGG.js} +14 -3
  207. package/dist/Scrollbars/index.d.ts +2 -0
  208. package/dist/Scrollbars/index.js +3 -0
  209. package/dist/Scrollbars-D_93hJYK.js +75 -0
  210. package/dist/SegmentedControl/index.js +1 -1
  211. package/dist/{SegmentedControl-ChHmFrrC.js → SegmentedControl-D1wWGBZo.js} +11 -5
  212. package/dist/SelectableCard/index.d.ts +1 -1
  213. package/dist/SelectableCard/index.js +1 -1
  214. package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-BEqnhPaX.js} +17 -12
  215. package/dist/Selector/index.d.ts +1 -1
  216. package/dist/Selector/index.js +1 -1
  217. package/dist/Selector-CPISLzp7.js +1049 -0
  218. package/dist/SideNav/index.d.ts +1 -1
  219. package/dist/SideNav/index.js +1 -1
  220. package/dist/{SideNav-Dtv8eA2j.js → SideNav-CN2QeAtY.js} +64 -41
  221. package/dist/Slider/index.d.ts +1 -1
  222. package/dist/Slider/index.js +1 -1
  223. package/dist/{Slider-DWobsPgm.js → Slider-pdC0jpHu.js} +172 -46
  224. package/dist/Spinner/index.js +1 -1
  225. package/dist/Spinner-DdVUadii.js +200 -0
  226. package/dist/Stack/index.d.ts +1 -1
  227. package/dist/Stack/index.js +2 -2
  228. package/dist/{Stack-CjQEavuq.js → Stack-Bb_h60t3.js} +10 -3
  229. package/dist/{Stack-D_Bhs-3r.js → Stack-Bp-XN9J4.js} +20 -9
  230. package/dist/StatusDot/index.d.ts +1 -1
  231. package/dist/StatusDot/index.js +1 -1
  232. package/dist/{StatusDot-BPUhMOff.js → StatusDot-BS_ohXhd.js} +8 -4
  233. package/dist/Stepper/index.d.ts +1 -1
  234. package/dist/Stepper/index.js +1 -1
  235. package/dist/{Stepper-CE8dHysu.js → Stepper-CyaSRSdu.js} +101 -79
  236. package/dist/Switch/index.d.ts +1 -1
  237. package/dist/Switch/index.js +1 -1
  238. package/dist/{Switch-DaVPRxvN.js → Switch-Z2Vfiiic.js} +38 -22
  239. package/dist/TabList/index.d.ts +2 -2
  240. package/dist/TabList/index.js +1 -1
  241. package/dist/{TabList-DIkK9sgK.js → TabList-DRqP0Hrv.js} +205 -63
  242. package/dist/Table/index.d.ts +3 -3
  243. package/dist/Table/index.js +1 -1
  244. package/dist/{Table-hqZMmzfU.js → Table-BcrrylMX.js} +727 -448
  245. package/dist/Text/index.d.ts +2 -2
  246. package/dist/Text/index.js +1 -1
  247. package/dist/{Text-CV3LmscH.js → Text-CmTOgYXf.js} +1 -1
  248. package/dist/TextArea/index.d.ts +1 -1
  249. package/dist/TextArea/index.js +1 -1
  250. package/dist/{TextArea-Ab5Sw60T.js → TextArea-DA9CCG_J.js} +104 -50
  251. package/dist/TextInput/index.d.ts +1 -1
  252. package/dist/TextInput/index.js +1 -1
  253. package/dist/{TextInput-zFT1_qgI.js → TextInput-CI96einV.js} +71 -38
  254. package/dist/Theme/index.d.ts +3 -3
  255. package/dist/Theme/index.js +3 -2
  256. package/dist/Theme-BbDT8B_C.js +2125 -0
  257. package/dist/Thumbnail/index.js +1 -1
  258. package/dist/{Thumbnail-C3NnJUFG.js → Thumbnail-B2ZAY59J.js} +13 -10
  259. package/dist/{TimeField-ByiJKBRM.js → TimeField-CpAgja9D.js} +299 -40
  260. package/dist/TimeInput/index.d.ts +1 -1
  261. package/dist/TimeInput/index.js +1 -1
  262. package/dist/{TimeInput-S8n946tp.js → TimeInput-Bw_lHS4M.js} +78 -9
  263. package/dist/Timer/index.d.ts +1 -1
  264. package/dist/Timer/index.js +1 -1
  265. package/dist/{Timer-avMQk5DN.js → Timer-CH7GsEVu.js} +1 -1
  266. package/dist/Timestamp/index.d.ts +1 -1
  267. package/dist/Timestamp/index.js +1 -1
  268. package/dist/{Timestamp-xpQKCk0d.js → Timestamp-BFNuoTZ0.js} +5 -5
  269. package/dist/Toast/index.d.ts +1 -1
  270. package/dist/Toast/index.js +1 -1
  271. package/dist/Toast-DwnPjx6j.js +685 -0
  272. package/dist/ToggleButton/index.d.ts +1 -1
  273. package/dist/ToggleButton/index.js +1 -1
  274. package/dist/{ToggleButton-B-C-Q7XP.js → ToggleButton-cLjh9W-x.js} +5 -4
  275. package/dist/Token/index.d.ts +1 -1
  276. package/dist/Token/index.js +1 -1
  277. package/dist/{Token-DsntTYhQ.js → Token-BfS4vi__.js} +32 -17
  278. package/dist/Tokenizer/index.d.ts +1 -1
  279. package/dist/Tokenizer/index.js +1 -1
  280. package/dist/{Tokenizer-41p035dX.js → Tokenizer-Ci3E5bvP.js} +109 -23
  281. package/dist/Toolbar/index.d.ts +2 -2
  282. package/dist/Toolbar/index.js +1 -1
  283. package/dist/{Toolbar-BrgvvTCk.js → Toolbar-C0pMWL4S.js} +1 -1
  284. package/dist/Tooltip/index.d.ts +1 -1
  285. package/dist/Tooltip/index.js +1 -1
  286. package/dist/{Tooltip-C4Vaqd3G.js → Tooltip-sAM8i1eO.js} +23 -19
  287. package/dist/TopNav/index.d.ts +1 -1
  288. package/dist/TopNav/index.js +1 -1
  289. package/dist/{TopNav-CeSeEMX3.js → TopNav-gW59zp1o.js} +16 -15
  290. package/dist/TreeList/index.d.ts +1 -1
  291. package/dist/TreeList/index.js +1 -1
  292. package/dist/{TreeList-BUz-KZJd.js → TreeList-DaoI7zaH.js} +124 -41
  293. package/dist/Typeahead/index.d.ts +1 -1
  294. package/dist/Typeahead/index.js +2 -2
  295. package/dist/{Typeahead-k3xhFxkr.js → Typeahead-D4JjvjK4.js} +125 -26
  296. package/dist/{TypeaheadMenu-DBW6rHeO.js → TypeaheadMenu-BQlMrfqX.js} +141 -51
  297. package/dist/{announce-Cnio10Wk.js → announce-B210eJVf.js} +17 -2
  298. package/dist/characterReferences-BJ-jLhsR.js +65 -0
  299. package/dist/characters-rcDbGt71.d.ts +29 -0
  300. package/dist/characters-wTnzjkkR.js +58 -0
  301. package/dist/{colorMode-CBgdgDSn.js → colorMode-BxqfDP4P.js} +1 -4
  302. package/dist/composables/index.d.ts +5 -4
  303. package/dist/composables/index.js +23 -18
  304. package/dist/{composables-CbKx9C1Y.js → composables-Bc02zKAO.js} +167 -197
  305. package/dist/context-B6UElI5X.js +5 -0
  306. package/dist/{context-Cfjh8te1.js → context-Cfml4jaK.js} +5 -3
  307. package/dist/{context-iABt_ueM.js → context-DWfi56sq.js} +451 -122
  308. package/dist/context-IvbU9c3T.js +8 -0
  309. package/dist/context-pjBxaMSh.js +28 -0
  310. package/dist/fieldParts--SyRZVQG.js +44 -0
  311. package/dist/fieldParts-LXpQMKE8.d.ts +27 -0
  312. package/dist/{focus-CpficIgf.js → focus-l8jVTcqd.js} +1 -1
  313. package/dist/hoverIntent-DMHGb85c.js +115 -0
  314. package/dist/{index-Cde5JvtX.d.ts → index-B-nESNam.d.ts} +8 -7
  315. package/dist/{index-CsNi1I8j.d.ts → index-B08-Uxhv.d.ts} +4 -2
  316. package/dist/{index-Cn-sSds-.d.ts → index-B56j4eI2.d.ts} +24 -1
  317. package/dist/{index-BJMJ09K-.d.ts → index-BEZ4ezJk.d.ts} +1 -1
  318. package/dist/{index-DeQwYJbg.d.ts → index-BNaRK-s5.d.ts} +10 -1
  319. package/dist/{index-CQCTKjIO.d.ts → index-BO9TY87G.d.ts} +5 -4
  320. package/dist/{index-BJSxFVXH.d.ts → index-BQEJj72c.d.ts} +21 -8
  321. package/dist/{index-BXk7Wng7.d.ts → index-BULhhnGf.d.ts} +1 -1
  322. package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
  323. package/dist/{index-BPYzIIYn.d.ts → index-BZKgbyN9.d.ts} +2 -2
  324. package/dist/index-BkUkm6Al.d.ts +11 -0
  325. package/dist/{index-ClNU2Th8.d.ts → index-Bn-v89Vt.d.ts} +10 -6
  326. package/dist/{index-Bu8NA2SD.d.ts → index-BnEhvmdR.d.ts} +16 -7
  327. package/dist/index-Bo-ofFyg.d.ts +166 -0
  328. package/dist/{index-i0tNFWfz.d.ts → index-BqhgeAT4.d.ts} +2 -0
  329. package/dist/{index-DWh2WC8W.d.ts → index-C4Cjz6OK.d.ts} +2 -2
  330. package/dist/{index-B7yhzGUT.d.ts → index-C7sam-SB.d.ts} +2 -2
  331. package/dist/{index-BrJzFA5X.d.ts → index-C90l2rH1.d.ts} +1 -1
  332. package/dist/{index-vP0EtrJJ.d.ts → index-C9gAlDt_.d.ts} +6 -3
  333. package/dist/{index-csA1lH_0.d.ts → index-CJ6ajsUC.d.ts} +2 -2
  334. package/dist/{index-CY-KvZ9B.d.ts → index-CK-Dbh0f.d.ts} +1 -1
  335. package/dist/index-CKUfpmFL.d.ts +375 -0
  336. package/dist/{index-DXpSFlPG.d.ts → index-CKgBTAzC.d.ts} +4 -4
  337. package/dist/{index-EFqQF2Bx.d.ts → index-CPtDjmcX.d.ts} +4 -4
  338. package/dist/{index-12QYAbiz.d.ts → index-CRrSHbok.d.ts} +3 -2
  339. package/dist/{index-DG52Bg0W.d.ts → index-CTf3SK0b.d.ts} +6 -0
  340. package/dist/{index-BNy3SW4S.d.ts → index-CTjkJP4x.d.ts} +32 -3
  341. package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
  342. package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
  343. package/dist/{index-BUEPz7BL.d.ts → index-CikMzeab.d.ts} +3 -3
  344. package/dist/{index-CdtZjkmG.d.ts → index-CpNlPLBF.d.ts} +183 -129
  345. package/dist/{index-N7OVZ38M.d.ts → index-Cs1xsHKi.d.ts} +28 -16
  346. package/dist/{index-Cyb9Du5Z.d.ts → index-CtTGt6Dv.d.ts} +1 -1
  347. package/dist/{index-HV6W3xCx.d.ts → index-D05JGsT3.d.ts} +5 -2
  348. package/dist/{index-CsTbMVDS.d.ts → index-D0_HsuC3.d.ts} +4 -4
  349. package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
  350. package/dist/{index-CkKPMIeX.d.ts → index-D7XRtUTY.d.ts} +9 -0
  351. package/dist/{index-TntQsADQ.d.ts → index-DEm3kRBO.d.ts} +4 -3
  352. package/dist/{index-DamRHh1i.d.ts → index-DLAG3m9W.d.ts} +11 -1
  353. package/dist/{index-DUnDGFQE.d.ts → index-DNA2l1RN.d.ts} +1 -1
  354. package/dist/{index-WnUY4Kxu.d.ts → index-DRJZ-v1E.d.ts} +4 -4
  355. package/dist/{index-DYp2RWkM.d.ts → index-DY8Wph-A.d.ts} +3 -3
  356. package/dist/{index-B1WJxt-n.d.ts → index-DfC05uKG.d.ts} +17 -7
  357. package/dist/{index-C5e-7Obr.d.ts → index-Dj1_1t3j.d.ts} +19 -6
  358. package/dist/{index-jW-mP58D.d.ts → index-Dr4b_oji.d.ts} +22 -15
  359. package/dist/{index-uKnRGtzi.d.ts → index-Ds201-d2.d.ts} +18 -4
  360. package/dist/{index-DIXAzTKL.d.ts → index-DxxudRgB.d.ts} +1 -1
  361. package/dist/{index-DQmK3Lq_.d.ts → index-IfsSCj8J.d.ts} +19 -6
  362. package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
  363. package/dist/{index-XuAAcYiP.d.ts → index-f3d9cVtj.d.ts} +1 -1
  364. package/dist/index-fAZaRruV.d.ts +125 -0
  365. package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
  366. package/dist/{index-T2FOcOuI.d.ts → index-jOwU3YoR.d.ts} +400 -90
  367. package/dist/{index-DdGck82Y.d.ts → index-pNtfr-RW.d.ts} +2 -2
  368. package/dist/{index-BhpAUzUr.d.ts → index-unAZVFGz.d.ts} +2 -2
  369. package/dist/index.d.ts +84 -77
  370. package/dist/index.js +151 -134
  371. package/dist/inlineSize-BNe8wggI.js +66 -0
  372. package/dist/inputPresentation-BOyHkCDr.js +62 -0
  373. package/dist/interactionModality-ACpTMhak.js +44 -0
  374. package/dist/isApplePlatform-B1ju6F5B.js +27 -0
  375. package/dist/isRenderable-BnKHIqfd.js +21 -0
  376. package/dist/layerDepth-CNDh-IHb.js +181 -0
  377. package/dist/link-DuuA2eCL.js +30 -0
  378. package/dist/{loadCatalog-BGHKG_9N.d.ts → loadCatalog-DlLFZreI.d.ts} +281 -7
  379. package/dist/loadCatalog-eopw74qb.js +424 -0
  380. package/dist/locale/index.d.ts +2 -2
  381. package/dist/locale/index.js +4 -3
  382. package/dist/locale-CabGJlGp.js +343 -0
  383. package/dist/modalOutlet-CUOcrhIu.js +56 -0
  384. package/dist/optionAction-Cg7xQLUA.d.ts +6 -0
  385. package/dist/{power-search-DrDfcoL1.d.ts → power-search-gHLIYXs5.d.ts} +2 -0
  386. package/dist/protocol-DHxY0NI8.js +113 -0
  387. package/dist/protocol-RSeMzAN1.d.ts +238 -0
  388. package/dist/publicParser-B0MRoikr.d.ts +141 -0
  389. package/dist/publicParser-uHC_T0Fo.js +895 -0
  390. package/dist/resizableChannel-3vivrEcT.js +20 -0
  391. package/dist/safeUrl-CsvfcZ9m.js +54 -0
  392. package/dist/scopedProvide-C-Df7c15.js +30 -0
  393. package/dist/scrollKeyboardDelegation-D7cumnOl.js +238 -0
  394. package/dist/scrollLock-C3aT4-0z.js +102 -0
  395. package/dist/{searchResultMessage-hXXNOFJP.js → searchResultMessage-mCpJBvra.js} +5 -14
  396. package/dist/{semantic-CKH9XVqa.d.ts → semantic-BF_AjLvk.d.ts} +6 -3
  397. package/dist/slug-C65CUsf9.js +32 -0
  398. package/dist/syntaxContext-DmIfNNtb.js +4 -0
  399. package/dist/triggerVariant-BsL8jMHs.js +16 -0
  400. package/dist/{types-0Q_SJv_F.d.ts → types-Bb7OGivY.d.ts} +6 -1
  401. package/dist/{types-H4Bbbxiw.d.ts → types-BnNTzEnd.d.ts} +1 -1
  402. package/dist/{types-CwyibrRB.d.ts → types-C5GQ2KCK.d.ts} +23 -3
  403. package/dist/{types-BBWrcHMD.d.ts → types-Ckih2YJi.d.ts} +3 -2
  404. package/dist/{types-gKsEkk2g.d.ts → types-CsqwQkf1.d.ts} +143 -10
  405. package/dist/upstreamMap-xr3gvREu.js +731 -0
  406. package/dist/{useAnchoredListbox-DwztMNjP.js → useAnchoredListbox-DGxxKHZb.js} +2 -2
  407. package/dist/{useAsyncSource-xpQovjV_.d.ts → useAsyncSource-aGzrvRkI.d.ts} +3 -0
  408. package/dist/{useClickableContainer-DyNpnSEa.js → useClickableContainer-CdGp_Cev.js} +1 -1
  409. package/dist/{useClipboard-BDfbEsWd.js → useClipboard-Dk8cS810.js} +1 -1
  410. package/dist/useHoverLayerDismiss-kYJ_NqL4.js +27 -0
  411. package/dist/{useIndicator-i1NORM7W.js → useIndicator-MZmfBWid.js} +5 -23
  412. package/dist/{useInputContainer-CpgDe2-4.js → useInputContainer-CLcYrby4.js} +1 -1
  413. package/dist/{useInputStatusIcon-DBOwxV4x.js → useInputStatusIcon-DAE7PExr.js} +1 -1
  414. package/dist/useLayerMountTarget-BmZyeKWE.js +156 -0
  415. package/dist/{useListFocus-D0iOJl39.js → useListFocus-ChxLg0b4.js} +3 -2
  416. package/dist/{useMenuDrillIn-DzKGkTho.js → useMenuDrillIn-DhUnPvKs.js} +6 -5
  417. package/dist/useMenuHover-Djreu23i.js +170 -0
  418. package/dist/useMenuPress-8foxY8z4.js +764 -0
  419. package/dist/{useMergedRefs-CfHHlCsn.js → useMergedRefs-Cb6_w93m.js} +24 -4
  420. package/dist/{useNumberField-4-dIGVed.js → useNumberField-Dk1BE3-K.js} +3 -3
  421. package/dist/useOptionActionGrid-CkJcuvaU.js +97 -0
  422. package/dist/{usePositionedLayer-Cru9_00b.js → usePositionedLayer-B7cvG-_v.js} +43 -49
  423. package/dist/usePressFeedback-BJCpjEpv.js +319 -0
  424. package/dist/{useResizable-DDwPpPe6.d.ts → useResizable-1MHPNaRD.d.ts} +19 -1
  425. package/dist/{useResizable-B3ahKLoZ.js → useResizable-I3BCiLSL.js} +72 -40
  426. package/dist/useResolvedLabelHidden-B2rlWiaI.js +30 -0
  427. package/dist/{useRestoreFocus-Djw9RUIf.js → useRestoreFocus-XEKs5-gp.js} +49 -7
  428. package/dist/useScrollOverflow-DuMoGXmm.js +67 -0
  429. package/dist/useScrollableArea-BE8b3qm7.js +222 -0
  430. package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
  431. package/dist/{useTimeValue-6ufHM15W.js → useTimeValue-BJd0xBhG.js} +4 -22
  432. package/dist/useTranslator-BmWt2BBt.js +35 -0
  433. package/dist/{useTypeahead-PAK8lMYz.js → useTypeahead-BvtflkRk.js} +4 -5
  434. package/dist/utils/index.d.ts +3 -0
  435. package/dist/utils/index.js +5 -0
  436. package/dist/{utils-D33VQDnk.js → utils-ClVseK2w.js} +29 -2
  437. package/dist/utils-z3Q6BGIJ.js +819 -0
  438. package/locales/SOURCE.json +1 -1
  439. package/package.json +24 -3
  440. package/reset.css +364 -1
  441. package/styles/avatar-group.css +9 -1
  442. package/styles/badge.css +8 -5
  443. package/styles/banner.css +124 -26
  444. package/styles/blockquote.css +1 -0
  445. package/styles/bordered-control.css +1 -1
  446. package/styles/bottom-sheet.css +74 -6
  447. package/styles/breadcrumbs.css +16 -2
  448. package/styles/button-group.css +3 -1
  449. package/styles/button.css +53 -11
  450. package/styles/card.css +1 -1
  451. package/styles/chat.css +16 -6
  452. package/styles/checkbox-input.css +10 -0
  453. package/styles/clickable-card.css +10 -3
  454. package/styles/collapsible.css +12 -5
  455. package/styles/command-palette.css +29 -14
  456. package/styles/complex-selector.css +22 -5
  457. package/styles/context-menu.css +3 -3
  458. package/styles/date-input.css +111 -1
  459. package/styles/dialog-header.css +4 -1
  460. package/styles/dialog.css +7 -0
  461. package/styles/dropdown-menu.css +12 -3
  462. package/styles/field.css +5 -0
  463. package/styles/form-layout.css +1 -0
  464. package/styles/heading.css +18 -8
  465. package/styles/icon.css +4 -0
  466. package/styles/kbd.css +1 -1
  467. package/styles/layer.css +72 -0
  468. package/styles/list.css +9 -2
  469. package/styles/metadata-list.css +1 -0
  470. package/styles/mobile-nav.css +4 -1
  471. package/styles/multi-selector.css +48 -1
  472. package/styles/nav-item.css +9 -2
  473. package/styles/nav-menu.css +12 -2
  474. package/styles/number-input.css +9 -1
  475. package/styles/overflow-list.css +1 -1
  476. package/styles/popover.css +2 -1
  477. package/styles/power-search.css +5 -3
  478. package/styles/pressable.css +63 -22
  479. package/styles/progress-bar.css +15 -3
  480. package/styles/radio.css +16 -0
  481. package/styles/resize-handle.css +42 -0
  482. package/styles/scrollbars.css +28 -0
  483. package/styles/segmented-control.css +12 -4
  484. package/styles/selector.css +53 -1
  485. package/styles/side-nav.css +19 -0
  486. package/styles/slider.css +4 -3
  487. package/styles/spinner.css +48 -42
  488. package/styles/stepper.css +58 -4
  489. package/styles/switch.css +26 -0
  490. package/styles/tab-list.css +132 -3
  491. package/styles/table.css +88 -10
  492. package/styles/text-area.css +1 -1
  493. package/styles/text-input.css +1 -1
  494. package/styles/text.css +6 -6
  495. package/styles/thumbnail.css +11 -3
  496. package/styles/time-input.css +8 -0
  497. package/styles/toast.css +37 -3
  498. package/styles/token.css +2 -2
  499. package/styles/tokenizer.css +1 -1
  500. package/styles/toolbar.css +4 -1
  501. package/styles/tree-list.css +1 -1
  502. package/styles/typeahead.css +34 -1
  503. package/styles.css +1 -0
  504. package/dist/Blockquote-DFqBv_oJ.js +0 -18
  505. package/dist/Breadcrumbs-DPVaziH4.js +0 -141
  506. package/dist/ButtonGroup-ySQWanDP.js +0 -125
  507. package/dist/DateTimeInput-DHp683jZ.js +0 -268
  508. package/dist/MultiSelector-BeV98x7X.js +0 -988
  509. package/dist/NumberInput-AZ9x3oja.js +0 -473
  510. package/dist/Selector-DuVozKNq.js +0 -675
  511. package/dist/Spinner-9cYUCnDy.js +0 -84
  512. package/dist/Theme-CtaUWo4g.js +0 -1246
  513. package/dist/Toast-BuqIZV5z.js +0 -322
  514. package/dist/context-4PuqD1Ic.js +0 -4
  515. package/dist/context-D5-MwxnN.js +0 -4
  516. package/dist/index-BH9PzQ1F.d.ts +0 -87
  517. package/dist/link-C4_WogdF.js +0 -18
  518. package/dist/loadCatalog-CXKqEB9s.js +0 -877
  519. package/dist/locale-DgkZEMTn.js +0 -105
  520. package/dist/platform-B_9W_aHW.js +0 -33
  521. package/dist/scrollLock-BzIvIimL.js +0 -42
  522. package/dist/useMenuPress-D-FRNrBW.js +0 -573
  523. package/dist/useScrollableArea-DDk_CluT.js +0 -172
  524. /package/dist/{index-lgvUFSCO.d.ts → index-CryFtTT6.d.ts} +0 -0
@@ -1,26 +1,32 @@
1
- import { t as _sfc_main$5 } from "./Button-B6Hj_O_s.js";
2
- import { t as useAnnounce } from "./announce-Cnio10Wk.js";
1
+ import { t as _sfc_main$5 } from "./Button-ONOoHdkg.js";
2
+ import { r as truncateCharacters, t as characterCount } from "./characters-wTnzjkkR.js";
3
+ import { t as useAnnounce } from "./announce-B210eJVf.js";
3
4
  import { t as createStaticSource } from "./useAsyncSource-Gk0VtE7_.js";
4
- import { n as useDismiss } from "./usePositionedLayer-Cru9_00b.js";
5
- import { a as useAstryxLocale, o as useAstryxMessages } from "./context-iABt_ueM.js";
5
+ import { n as useDismiss } from "./usePositionedLayer-B7cvG-_v.js";
6
+ import { o as useAstryxLocale, s as useAstryxMessages } from "./context-DWfi56sq.js";
7
+ import { i as useLayerGutter } from "./context-M-er0-Rk.js";
6
8
  import { n as useOverflow } from "./useOverflow-VrwF5oek.js";
7
- import { t as _sfc_main$6 } from "./Tooltip-C4Vaqd3G.js";
8
- import { t as _sfc_main$7 } from "./Icon-bteSId7T.js";
9
- import { t as _sfc_main$8 } from "./Field-D5gUEGw4.js";
10
- import { t as _sfc_main$9 } from "./DateInput-u2XKccpK.js";
11
- import { t as _sfc_main$10 } from "./DateRangeInput-u7LhH6up.js";
12
- import { t as _sfc_main$11 } from "./DateTimeInput-DHp683jZ.js";
13
- import { t as _sfc_main$12 } from "./Token-DsntTYhQ.js";
14
- import { n as useAnchoredListbox, t as scrollOptionIntoView } from "./useAnchoredListbox-DwztMNjP.js";
15
- import { t as _sfc_main$13 } from "./MultiSelector-BeV98x7X.js";
16
- import { t as _sfc_main$14 } from "./NumberInput-AZ9x3oja.js";
17
- import { t as _sfc_main$15 } from "./Selector-DuVozKNq.js";
18
- import { r as useTypeaheadMenu } from "./TypeaheadMenu-DBW6rHeO.js";
19
- import { t as _sfc_main$16 } from "./TextInput-zFT1_qgI.js";
20
- import { t as _sfc_main$17 } from "./TimeInput-S8n946tp.js";
21
- import { t as _sfc_main$18 } from "./Tokenizer-41p035dX.js";
22
- import { t as _sfc_main$19 } from "./Typeahead-k3xhFxkr.js";
23
- import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
9
+ import { t as useResolvedLabelHidden } from "./useResolvedLabelHidden-B2rlWiaI.js";
10
+ import { t as _sfc_main$6 } from "./Tooltip-sAM8i1eO.js";
11
+ import { t as useScrollbars } from "./useScrollbars-C2NJ6Qwq.js";
12
+ import { t as _sfc_main$7 } from "./Icon-KDnUyY7f.js";
13
+ import { t as _sfc_main$8 } from "./Field--OEsLBfE.js";
14
+ import { t as useFieldPartStyling } from "./fieldParts--SyRZVQG.js";
15
+ import { t as _sfc_main$9 } from "./DateInput-BjLdmYor.js";
16
+ import { t as _sfc_main$10 } from "./DateRangeInput-Br3wVEfD.js";
17
+ import { t as _sfc_main$11 } from "./DateTimeInput-CAZBwoRe.js";
18
+ import { t as _sfc_main$12 } from "./Token-BfS4vi__.js";
19
+ import { n as useAnchoredListbox, t as scrollOptionIntoView } from "./useAnchoredListbox-DGxxKHZb.js";
20
+ import { t as _sfc_main$13 } from "./MultiSelector-DuVatmq5.js";
21
+ import { n as resolveNumberInputCommit, t as _sfc_main$14 } from "./NumberInput-B0vzOg3N.js";
22
+ import { t as _sfc_main$15 } from "./Selector-CPISLzp7.js";
23
+ import { i as useTypeaheadMenu } from "./TypeaheadMenu-BQlMrfqX.js";
24
+ import { t as _sfc_main$16 } from "./TextInput-CI96einV.js";
25
+ import { t as _sfc_main$17 } from "./TimeInput-Bw_lHS4M.js";
26
+ import { t as _sfc_main$18 } from "./Tokenizer-Ci3E5bvP.js";
27
+ import { t as _sfc_main$19 } from "./Typeahead-D4JjvjK4.js";
28
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
29
+ import "../styles/layer.css";
24
30
  import "../styles/visually-hidden-utility.css";
25
31
  import "../styles/typeahead.css";
26
32
  import "../styles/power-search.css";
@@ -118,9 +124,7 @@ function createPowerSearchLookup(config) {
118
124
  //#endregion
119
125
  //#region src/PowerSearch/format.ts
120
126
  function truncate(value, maxLength) {
121
- const chars = Array.from(value);
122
- if (chars.length <= maxLength) return value;
123
- return `${chars.slice(0, Math.max(0, maxLength)).join("")}…`;
127
+ return truncateCharacters(value, maxLength);
124
128
  }
125
129
  function enumLabel(value, values) {
126
130
  return values.find((item) => item.value === value)?.label ?? value;
@@ -153,7 +157,7 @@ function joinOrCount(labels, maxLength, countLabel) {
153
157
  if (labels.length === 0) return "";
154
158
  if (labels.length === 1) return truncate(labels[0] ?? "", maxLength);
155
159
  const joined = labels.join(", ");
156
- if (Array.from(joined).length <= maxLength) return joined;
160
+ if (characterCount(joined) <= maxLength) return joined;
157
161
  return countLabel(labels.length);
158
162
  }
159
163
  function formatFilterValue(operatorValue, filterValue, maxLength, messages, locale, timeZone) {
@@ -226,8 +230,11 @@ function resolveOperatorLabel(operator, messages) {
226
230
  * 视口放不下 400 时,下限让给视口。只有被 720 压窄时,才改贴打开控件更近的外缘。
227
231
  */
228
232
  function resolveEditorPlacement(input) {
229
- const inset = input.viewportInset ?? 8;
230
- const available = Math.max(0, input.viewportWidth - inset * 2);
233
+ const fallback = input.viewportInset ?? 16;
234
+ const inlineStart = input.inlineStart ?? fallback;
235
+ const inlineEnd = input.inlineEnd ?? fallback;
236
+ const blockInset = input.blockInset ?? fallback;
237
+ const available = Math.max(0, input.viewportWidth - inlineStart - inlineEnd);
231
238
  const floor = Math.min(400, available);
232
239
  const ceiling = Math.min(720, available);
233
240
  let width = input.outer.width;
@@ -244,13 +251,13 @@ function resolveEditorPlacement(input) {
244
251
  else edge = input.direction === "rtl" ? "right" : "left";
245
252
  }
246
253
  let left = edge === "left" ? input.outer.left : input.outer.right - width;
247
- const maxLeft = input.viewportWidth - inset - width;
248
- if (left < inset) left = inset;
249
- if (left > maxLeft) left = Math.max(inset, maxLeft);
254
+ const maxLeft = input.viewportWidth - inlineEnd - width;
255
+ if (left < inlineStart) left = inlineStart;
256
+ if (left > maxLeft) left = Math.max(inlineStart, maxLeft);
250
257
  const gap = 4;
251
258
  const estimatedHeight = 280;
252
259
  let top = input.anchorBottom + gap;
253
- if (top + estimatedHeight > input.viewportHeight - inset && input.anchorTop - gap - estimatedHeight > inset) top = input.anchorTop - gap - estimatedHeight;
260
+ if (top + estimatedHeight > input.viewportHeight - blockInset && input.anchorTop - gap - estimatedHeight > blockInset) top = input.anchorTop - gap - estimatedHeight;
254
261
  return {
255
262
  width,
256
263
  capped,
@@ -260,6 +267,241 @@ function resolveEditorPlacement(input) {
260
267
  };
261
268
  }
262
269
  //#endregion
270
+ //#region src/PowerSearch/menuPresentation.ts
271
+ function powerSearchGroupLabel(entries, index) {
272
+ const group = entries[index]?.item.auxiliaryData?.group;
273
+ if (group == null || group === "") return void 0;
274
+ return group !== (index > 0 ? entries[index - 1]?.item.auxiliaryData?.group : void 0) ? group : void 0;
275
+ }
276
+ function powerSearchItemIcon(item, lookup) {
277
+ const data = item.auxiliaryData;
278
+ const type = (data?.operatorKey ? lookup.getOperator(data.fieldKey, data.operatorKey) : void 0)?.value.type;
279
+ if (type === "date_absolute" || type === "date_range" || type === "date_relative") return "calendar";
280
+ if (type === "time") return "clock";
281
+ if (type === "enum" || type === "enum_list") return "funnel";
282
+ return "search";
283
+ }
284
+ //#endregion
285
+ //#region src/PowerSearch/PowerSearchToken.vue
286
+ const _hoisted_1$4 = { class: "astryx-power-search-token-value" };
287
+ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
288
+ name: "AstryxPowerSearchToken",
289
+ __name: "PowerSearchToken",
290
+ props: {
291
+ fieldLabel: {},
292
+ operator: {},
293
+ filter: {},
294
+ maxLength: {},
295
+ messages: {},
296
+ locale: {},
297
+ timeZone: {},
298
+ size: {},
299
+ disabled: { type: Boolean },
300
+ removable: { type: Boolean }
301
+ },
302
+ emits: ["activate", "remove"],
303
+ setup(__props, { emit: __emit }) {
304
+ const props = __props;
305
+ const emit = __emit;
306
+ const operatorLabel = computed(() => resolveOperatorLabel(props.operator, props.messages));
307
+ const tokenLabel = computed(() => `${props.fieldLabel}: ${operatorLabel.value}`);
308
+ const valueText = computed(() => {
309
+ const room = Math.max(props.maxLength - characterCount(props.fieldLabel) - characterCount(operatorLabel.value), 10);
310
+ return formatFilterValue(props.operator.value, props.filter.value, room, props.messages, props.locale, props.timeZone);
311
+ });
312
+ return (_ctx, _cache) => {
313
+ return openBlock(), createBlock(_sfc_main$12, {
314
+ label: tokenLabel.value,
315
+ size: __props.size,
316
+ disabled: __props.disabled,
317
+ removable: __props.removable,
318
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("activate")),
319
+ onRemove: _cache[1] || (_cache[1] = ($event) => emit("remove"))
320
+ }, createSlots({ _: 2 }, [valueText.value ? {
321
+ name: "end",
322
+ fn: withCtx(() => [createElementVNode("span", _hoisted_1$4, toDisplayString(valueText.value), 1)]),
323
+ key: "0"
324
+ } : void 0]), 1032, [
325
+ "label",
326
+ "size",
327
+ "disabled",
328
+ "removable"
329
+ ]);
330
+ };
331
+ }
332
+ });
333
+ //#endregion
334
+ //#region src/PowerSearch/source.ts
335
+ const MAX_BROWSE_ITEMS = 1e3;
336
+ function resolveValueMatches(operator, rawValue) {
337
+ const kind = operator.value.type;
338
+ if (kind === "string") return [{
339
+ displayValue: rawValue,
340
+ filterValue: {
341
+ type: "string",
342
+ value: rawValue
343
+ },
344
+ quoted: true
345
+ }];
346
+ if (kind === "string_list") return [{
347
+ displayValue: rawValue,
348
+ filterValue: {
349
+ type: "string_list",
350
+ value: [rawValue]
351
+ },
352
+ quoted: true
353
+ }];
354
+ if (kind === "enum" || kind === "enum_list") {
355
+ const lower = rawValue.toLowerCase();
356
+ return operator.value.values.filter((item) => item.label.toLowerCase().includes(lower)).map((item) => ({
357
+ displayValue: item.label,
358
+ filterValue: kind === "enum" ? {
359
+ type: "enum",
360
+ value: item.value
361
+ } : {
362
+ type: "enum_list",
363
+ value: [item.value]
364
+ },
365
+ quoted: false
366
+ }));
367
+ }
368
+ return [];
369
+ }
370
+ function browseItems(lookup) {
371
+ const grouped = /* @__PURE__ */ new Map();
372
+ const ungrouped = [];
373
+ for (const field of lookup.getVisibleFields()) {
374
+ const operator = lookup.getDefaultOperator(field.key);
375
+ const item = {
376
+ id: field.key,
377
+ label: field.label,
378
+ description: field.description,
379
+ auxiliaryData: {
380
+ fieldKey: field.key,
381
+ operatorKey: operator?.key,
382
+ group: field.group
383
+ }
384
+ };
385
+ if (field.group) {
386
+ const bucket = grouped.get(field.group) ?? [];
387
+ bucket.push(item);
388
+ grouped.set(field.group, bucket);
389
+ } else ungrouped.push(item);
390
+ }
391
+ const ordered = [...ungrouped];
392
+ for (const items of grouped.values()) ordered.push(...items);
393
+ return ordered.slice(0, MAX_BROWSE_ITEMS);
394
+ }
395
+ function searchPowerSearchFields(lookup, query, messages, maxTypedResults) {
396
+ const trimmed = query.trim();
397
+ if (trimmed === "") return browseItems(lookup);
398
+ const lower = trimmed.toLowerCase();
399
+ const results = [];
400
+ const seen = /* @__PURE__ */ new Set();
401
+ const labelOf = (operator) => resolveOperatorLabel(operator, messages);
402
+ for (const field of lookup.getVisibleFields()) {
403
+ if (field.typeaheadMinQueryLength != null && lower.length < field.typeaheadMinQueryLength) continue;
404
+ if ((field.label.toLowerCase().includes(lower) || field.typeaheadAliases?.some((alias) => alias.toLowerCase().includes(lower)) === true) && !seen.has(field.key)) {
405
+ seen.add(field.key);
406
+ const operator = lookup.getDefaultOperator(field.key);
407
+ results.push({
408
+ id: field.key,
409
+ label: field.label,
410
+ description: field.description,
411
+ auxiliaryData: {
412
+ fieldKey: field.key,
413
+ operatorKey: operator?.key,
414
+ group: field.group
415
+ }
416
+ });
417
+ }
418
+ for (const operator of field.operators) {
419
+ const combined = `${field.label} ${labelOf(operator)}`.toLowerCase();
420
+ const id = `${field.key}:${operator.key}`;
421
+ if (combined.includes(lower) && !seen.has(id)) {
422
+ seen.add(id);
423
+ results.push({
424
+ id,
425
+ label: `${field.label} ${labelOf(operator)}`,
426
+ description: field.description,
427
+ auxiliaryData: {
428
+ fieldKey: field.key,
429
+ operatorKey: operator.key,
430
+ group: field.group
431
+ }
432
+ });
433
+ }
434
+ }
435
+ }
436
+ for (const field of lookup.getVisibleFields()) {
437
+ if (field.isValueMatchAllowed === false) continue;
438
+ const fieldLabel = field.label.toLowerCase();
439
+ let exactOperator = false;
440
+ for (const operator of field.operators) {
441
+ const prefix = `${fieldLabel} ${labelOf(operator).toLowerCase()} `;
442
+ if (!lower.startsWith(prefix) || lower.length <= prefix.length) continue;
443
+ const matches = resolveValueMatches(operator, trimmed.slice(prefix.length));
444
+ if (matches.length > 0) exactOperator = true;
445
+ for (const match of matches) {
446
+ const id = `${field.key}:${operator.key}:value:${match.displayValue}`;
447
+ if (seen.has(id)) continue;
448
+ seen.add(id);
449
+ const shown = match.quoted ? `"${match.displayValue}"` : match.displayValue;
450
+ results.push({
451
+ id,
452
+ label: `${field.label} ${labelOf(operator)} ${shown}`,
453
+ auxiliaryData: {
454
+ fieldKey: field.key,
455
+ operatorKey: operator.key,
456
+ filterValue: match.filterValue
457
+ }
458
+ });
459
+ }
460
+ }
461
+ const fieldPrefix = `${fieldLabel} `;
462
+ if (!exactOperator && lower.startsWith(fieldPrefix) && lower.length > fieldPrefix.length) {
463
+ const remainder = lower.slice(fieldPrefix.length);
464
+ if (!field.operators.some((operator) => labelOf(operator).toLowerCase().startsWith(remainder))) {
465
+ const rawValue = trimmed.slice(fieldPrefix.length);
466
+ for (const operator of field.operators) for (const match of resolveValueMatches(operator, rawValue)) {
467
+ const id = `${field.key}:${operator.key}:value:${match.displayValue}`;
468
+ if (seen.has(id)) continue;
469
+ seen.add(id);
470
+ const shown = match.quoted ? `"${match.displayValue}"` : match.displayValue;
471
+ results.push({
472
+ id,
473
+ label: `${field.label} ${labelOf(operator)} ${shown}`,
474
+ auxiliaryData: {
475
+ fieldKey: field.key,
476
+ operatorKey: operator.key,
477
+ filterValue: match.filterValue
478
+ }
479
+ });
480
+ }
481
+ }
482
+ }
483
+ }
484
+ const contentKey = lookup.config.contentSearchFieldKey;
485
+ const exact = lookup.getVisibleFields().some((field) => field.label.toLowerCase() === lower || field.operators.some((operator) => `${field.label} ${labelOf(operator)}`.toLowerCase() === lower));
486
+ if (contentKey && !exact) {
487
+ const field = lookup.getField(contentKey);
488
+ const operator = lookup.getDefaultOperator(contentKey);
489
+ if (field && operator) results.unshift({
490
+ id: `__content_search__:${trimmed}`,
491
+ label: `"${trimmed}"`,
492
+ auxiliaryData: {
493
+ fieldKey: contentKey,
494
+ operatorKey: operator.key,
495
+ filterValue: {
496
+ type: "string",
497
+ value: trimmed
498
+ }
499
+ }
500
+ });
501
+ }
502
+ return results.slice(0, maxTypedResults);
503
+ }
504
+ //#endregion
263
505
  //#region src/PowerSearch/range.ts
264
506
  const SECONDS_BY_UNIT = {
265
507
  second: 1,
@@ -353,7 +595,7 @@ function absoluteRange(start, end) {
353
595
  }
354
596
  //#endregion
355
597
  //#region src/PowerSearch/PowerSearchValueField.vue
356
- const _hoisted_1$4 = {
598
+ const _hoisted_1$3 = {
357
599
  key: 7,
358
600
  class: "astryx-power-search-value__stack"
359
601
  };
@@ -363,7 +605,7 @@ const _hoisted_2$3 = {
363
605
  };
364
606
  const _hoisted_3$3 = ["aria-label"];
365
607
  const _hoisted_4$2 = ["disabled", "onClick"];
366
- const _sfc_main$4 = /*@__PURE__*/ defineComponent({
608
+ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
367
609
  name: "AstryxPowerSearchValueField",
368
610
  __name: "PowerSearchValueField",
369
611
  props: {
@@ -379,6 +621,27 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
379
621
  const props = __props;
380
622
  const emit = __emit;
381
623
  const text = computed(() => props.messages.value);
624
+ const locale = useAstryxLocale();
625
+ const numberDecision = ref(null);
626
+ function rememberNumberDraft(event) {
627
+ const target = event.target;
628
+ const operator = props.operatorValue;
629
+ if (!(target instanceof HTMLInputElement) || target.getAttribute("role") !== "spinbutton") return;
630
+ if (operator.type !== "integer" && operator.type !== "float") return;
631
+ numberDecision.value = resolveNumberInputCommit(target.value, {
632
+ min: operator.minValue,
633
+ max: operator.maxValue,
634
+ isIntegerOnly: operator.type === "integer",
635
+ locale: locale.value,
636
+ hasClear: false
637
+ });
638
+ }
639
+ function onNumberKeydown(event) {
640
+ if (event.key !== "Enter" || event.isComposing) return;
641
+ const decision = numberDecision.value;
642
+ numberDecision.value = null;
643
+ if (decision != null && decision.type !== "commit") event.stopPropagation();
644
+ }
382
645
  const stringValue = computed(() => props.filterValue?.type === "string" ? props.filterValue.value : "");
383
646
  const numberValue = computed(() => props.filterValue?.type === "integer" || props.filterValue?.type === "float" ? props.filterValue.value : null);
384
647
  const timeValue = computed(() => props.filterValue?.type === "time" ? props.filterValue.value : null);
@@ -592,8 +855,12 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
592
855
  "disabled",
593
856
  "creatable",
594
857
  "max-menu-items"
595
- ])) : __props.operatorValue.type === "integer" || __props.operatorValue.type === "float" ? (openBlock(), createBlock(_sfc_main$14, {
596
- key: 3,
858
+ ])) : __props.operatorValue.type === "integer" || __props.operatorValue.type === "float" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" eslint-disable-next-line vue-a11y/no-static-element-interactions -- 只听里面数字框冒上来的输入和回车,自己不是控件。 "), createElementVNode("div", {
859
+ class: "astryx-power-search-value",
860
+ onFocusin: _cache[3] || (_cache[3] = ($event) => numberDecision.value = null),
861
+ onInput: rememberNumberDraft,
862
+ onKeydown: onNumberKeydown
863
+ }, [createVNode(_sfc_main$14, {
597
864
  label: text.value.value,
598
865
  "is-label-hidden": "",
599
866
  "model-value": numberValue.value,
@@ -616,7 +883,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
616
883
  "max",
617
884
  "step",
618
885
  "units"
619
- ])) : __props.operatorValue.type === "time" ? (openBlock(), createBlock(_sfc_main$17, {
886
+ ])], 32)], 2112)) : __props.operatorValue.type === "time" ? (openBlock(), createBlock(_sfc_main$17, {
620
887
  key: 4,
621
888
  label: text.value.time,
622
889
  "is-label-hidden": "",
@@ -653,7 +920,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
653
920
  "label",
654
921
  "model-value",
655
922
  "is-disabled"
656
- ])) : __props.operatorValue.type === "date_relative" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [relativeOptions.value.length > 0 ? (openBlock(), createBlock(_sfc_main$15, {
923
+ ])) : __props.operatorValue.type === "date_relative" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [relativeOptions.value.length > 0 ? (openBlock(), createBlock(_sfc_main$15, {
657
924
  key: 0,
658
925
  label: text.value.relativeDate,
659
926
  "is-label-hidden": "",
@@ -661,7 +928,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
661
928
  "model-value": relativeValue.value,
662
929
  placeholder: text.value.selectPlaceholder,
663
930
  disabled: __props.disabled,
664
- "onUpdate:modelValue": _cache[3] || (_cache[3] = (value) => emit("change", {
931
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = (value) => emit("change", {
665
932
  type: "date_relative",
666
933
  value: String(value ?? "")
667
934
  }, true))
@@ -677,7 +944,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
677
944
  "model-value": relativeValue.value,
678
945
  placeholder: text.value.enterValuePlaceholder,
679
946
  disabled: __props.disabled,
680
- "onUpdate:modelValue": _cache[4] || (_cache[4] = (value) => emit("change", {
947
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = (value) => emit("change", {
681
948
  type: "date_relative",
682
949
  value: String(value ?? "")
683
950
  }))
@@ -717,7 +984,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
717
984
  "model-value": enumValue.value,
718
985
  placeholder: text.value.selectPlaceholder,
719
986
  disabled: __props.disabled,
720
- "onUpdate:modelValue": _cache[5] || (_cache[5] = (value) => emit("change", {
987
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = (value) => emit("change", {
721
988
  type: "enum",
722
989
  value: String(value ?? "")
723
990
  }, true))
@@ -735,7 +1002,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
735
1002
  "model-value": enumList.value,
736
1003
  placeholder: text.value.selectValuesPlaceholder,
737
1004
  disabled: __props.disabled,
738
- "onUpdate:modelValue": _cache[6] || (_cache[6] = (value) => emit("change", {
1005
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = (value) => emit("change", {
739
1006
  type: "enum_list",
740
1007
  value: value.map(String)
741
1008
  }))
@@ -785,10 +1052,10 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
785
1052
  });
786
1053
  //#endregion
787
1054
  //#region src/PowerSearch/PowerSearchNestedRows.vue
788
- const _hoisted_1$3 = { class: "astryx-power-search-nested" };
1055
+ const _hoisted_1$2 = { class: "astryx-power-search-nested" };
789
1056
  const _hoisted_2$2 = { class: "astryx-power-search-editor-row" };
790
1057
  const _hoisted_3$2 = ["aria-label", "onClick"];
791
- const _sfc_main$3 = /*@__PURE__*/ defineComponent({
1058
+ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
792
1059
  name: "AstryxPowerSearchNestedRows",
793
1060
  __name: "PowerSearchNestedRows",
794
1061
  props: {
@@ -879,7 +1146,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
879
1146
  }
880
1147
  return (_ctx, _cache) => {
881
1148
  const _component_PowerSearchNestedRows = resolveComponent("PowerSearchNestedRows", true);
882
- return openBlock(), createElementBlock("div", _hoisted_1$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (row, index) => {
1149
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (row, index) => {
883
1150
  return openBlock(), createElementBlock("div", {
884
1151
  key: `${row.field}-${index}`,
885
1152
  class: "astryx-power-search-nested-row"
@@ -913,7 +1180,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
913
1180
  "disabled",
914
1181
  "onUpdate:modelValue"
915
1182
  ])) : createCommentVNode("v-if", true),
916
- operatorOf(row) && operatorOf(row)?.value.type !== "empty" && operatorOf(row)?.value.type !== "nested" ? (openBlock(), createBlock(_sfc_main$4, {
1183
+ operatorOf(row) && operatorOf(row)?.value.type !== "empty" && operatorOf(row)?.value.type !== "nested" ? (openBlock(), createBlock(_sfc_main$3, {
917
1184
  key: `${row.field}:${row.operator ?? ""}`,
918
1185
  "operator-value": operatorOf(row).value,
919
1186
  "filter-value": row.value,
@@ -969,7 +1236,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
969
1236
  });
970
1237
  //#endregion
971
1238
  //#region src/PowerSearch/PowerSearchEditor.vue
972
- const _hoisted_1$2 = ["aria-label"];
1239
+ const _hoisted_1$1 = ["aria-label"];
973
1240
  const _hoisted_2$1 = { class: "astryx-power-search-editor-row" };
974
1241
  const _hoisted_3$1 = {
975
1242
  key: 0,
@@ -983,7 +1250,7 @@ const _hoisted_5$1 = {
983
1250
  const _hoisted_6$1 = { key: 1 };
984
1251
  const _hoisted_7$1 = { class: "astryx-power-search-editor-actions" };
985
1252
  const focusable = "input:not([disabled]), button:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
986
- const _sfc_main$2 = /*@__PURE__*/ defineComponent({
1253
+ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
987
1254
  name: "AstryxPowerSearchEditor",
988
1255
  __name: "PowerSearchEditor",
989
1256
  props: {
@@ -1143,7 +1410,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
1143
1410
  ref_key: "valueRoot",
1144
1411
  ref: valueRoot,
1145
1412
  class: "astryx-power-search-editor-value"
1146
- }, [(openBlock(), createBlock(_sfc_main$4, {
1413
+ }, [(openBlock(), createBlock(_sfc_main$3, {
1147
1414
  key: `${fieldKey.value}:${operatorKey.value}`,
1148
1415
  "operator-value": operatorValue.value,
1149
1416
  "filter-value": draft.value,
@@ -1161,7 +1428,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
1161
1428
  "max-menu-items"
1162
1429
  ]))], 512)) : createCommentVNode("v-if", true)
1163
1430
  ]),
1164
- operatorValue.value?.type === "nested" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [createElementVNode("div", _hoisted_4$1, toDisplayString(text.value.editor.group), 1), createVNode(_sfc_main$3, {
1431
+ operatorValue.value?.type === "nested" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [createElementVNode("div", _hoisted_4$1, toDisplayString(text.value.editor.group), 1), createVNode(_sfc_main$2, {
1165
1432
  config: __props.config,
1166
1433
  "model-value": children.value,
1167
1434
  disabled: __props.readOnly,
@@ -1193,229 +1460,273 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
1193
1460
  "is-disabled": completed.value == null,
1194
1461
  onClick: save
1195
1462
  }, null, 8, ["label", "is-disabled"])])])) : createCommentVNode("v-if", true)
1196
- ], 40, _hoisted_1$2)], 2112);
1463
+ ], 40, _hoisted_1$1)], 2112);
1197
1464
  };
1198
1465
  }
1199
1466
  });
1200
1467
  //#endregion
1201
- //#region src/PowerSearch/PowerSearchToken.vue
1202
- const _hoisted_1$1 = { class: "astryx-power-search-token-value" };
1203
- const _sfc_main$1 = /*@__PURE__*/ defineComponent({
1204
- name: "AstryxPowerSearchToken",
1205
- __name: "PowerSearchToken",
1206
- props: {
1207
- fieldLabel: {},
1208
- operator: {},
1209
- filter: {},
1210
- maxLength: {},
1211
- messages: {},
1212
- locale: {},
1213
- timeZone: {},
1214
- size: {},
1215
- disabled: { type: Boolean },
1216
- removable: { type: Boolean }
1217
- },
1218
- emits: ["activate", "remove"],
1219
- setup(__props, { emit: __emit }) {
1220
- const props = __props;
1221
- const emit = __emit;
1222
- const operatorLabel = computed(() => resolveOperatorLabel(props.operator, props.messages));
1223
- const tokenLabel = computed(() => `${props.fieldLabel}: ${operatorLabel.value}`);
1224
- const valueText = computed(() => {
1225
- const room = Math.max(props.maxLength - props.fieldLabel.length - operatorLabel.value.length, 10);
1226
- return formatFilterValue(props.operator.value, props.filter.value, room, props.messages, props.locale, props.timeZone);
1227
- });
1228
- return (_ctx, _cache) => {
1229
- return openBlock(), createBlock(_sfc_main$12, {
1230
- label: tokenLabel.value,
1231
- size: __props.size,
1232
- disabled: __props.disabled,
1233
- removable: __props.removable,
1234
- onClick: _cache[0] || (_cache[0] = ($event) => emit("activate")),
1235
- onRemove: _cache[1] || (_cache[1] = ($event) => emit("remove"))
1236
- }, createSlots({ _: 2 }, [valueText.value ? {
1237
- name: "end",
1238
- fn: withCtx(() => [createElementVNode("span", _hoisted_1$1, toDisplayString(valueText.value), 1)]),
1239
- key: "0"
1240
- } : void 0]), 1032, [
1241
- "label",
1242
- "size",
1243
- "disabled",
1244
- "removable"
1245
- ]);
1468
+ //#region src/PowerSearch/usePowerSearchActions.ts
1469
+ function usePowerSearchActions(options) {
1470
+ const { props, emit, menu, lookup, text, announce } = options;
1471
+ const gutter = useLayerGutter();
1472
+ const internal = ref([]);
1473
+ const filters = computed(() => props.filters ?? internal.value);
1474
+ const session = ref(null);
1475
+ const openingControl = ref(null);
1476
+ const editorOpen = computed(() => session.value != null);
1477
+ const tokenEls = /* @__PURE__ */ new Map();
1478
+ const editorStyle = computed(() => {
1479
+ const place = session.value?.placement;
1480
+ if (place == null) return void 0;
1481
+ return {
1482
+ top: `${place.top}px`,
1483
+ left: `${place.left}px`,
1484
+ width: `${place.width}px`
1246
1485
  };
1486
+ });
1487
+ const editorComponent = computed(() => {
1488
+ const filter = session.value?.filter;
1489
+ if (filter?.operator == null) return _sfc_main$1;
1490
+ const type = lookup.value.getOperator(filter.field, filter.operator)?.value.type;
1491
+ return (type ? props.components?.[type]?.editor : void 0) ?? _sfc_main$1;
1492
+ });
1493
+ function commit(next, changeType, index) {
1494
+ internal.value = next;
1495
+ emit("update:filters", next);
1496
+ emit("change", next, changeType, index);
1247
1497
  }
1248
- });
1249
- //#endregion
1250
- //#region src/PowerSearch/source.ts
1251
- const MAX_BROWSE_ITEMS = 1e3;
1252
- function resolveValueMatches(operator, rawValue) {
1253
- const kind = operator.value.type;
1254
- if (kind === "string") return [{
1255
- displayValue: rawValue,
1256
- filterValue: {
1257
- type: "string",
1258
- value: rawValue
1259
- },
1260
- quoted: true
1261
- }];
1262
- if (kind === "string_list") return [{
1263
- displayValue: rawValue,
1264
- filterValue: {
1265
- type: "string_list",
1266
- value: [rawValue]
1267
- },
1268
- quoted: true
1269
- }];
1270
- if (kind === "enum" || kind === "enum_list") {
1271
- const lower = rawValue.toLowerCase();
1272
- return operator.value.values.filter((item) => item.label.toLowerCase().includes(lower)).map((item) => ({
1273
- displayValue: item.label,
1274
- filterValue: kind === "enum" ? {
1275
- type: "enum",
1276
- value: item.value
1277
- } : {
1278
- type: "enum_list",
1279
- value: [item.value]
1498
+ function operatorFor(filter) {
1499
+ return lookup.value.getOperator(filter.field, filter.operator);
1500
+ }
1501
+ function fieldFor(filter) {
1502
+ return lookup.value.getField(filter.field);
1503
+ }
1504
+ function emptyEditorOverridden(components) {
1505
+ return Boolean(components?.empty?.editor || options.hasCustomEditor());
1506
+ }
1507
+ function canEdit(filter) {
1508
+ if (props.disabled || props.readOnly || filter.isReadOnly) return false;
1509
+ const operator = operatorFor(filter);
1510
+ if (operator == null) return false;
1511
+ if (operator.value.type !== "empty") return true;
1512
+ return emptyEditorOverridden(props.components);
1513
+ }
1514
+ function canRemove(filter) {
1515
+ return !props.disabled && !props.readOnly && filter.isReadOnly !== true;
1516
+ }
1517
+ function tokenComponent(filter) {
1518
+ const type = operatorFor(filter)?.value.type;
1519
+ return type ? props.components?.[type]?.token : void 0;
1520
+ }
1521
+ function measure(control) {
1522
+ const outer = options.anchorRef.value;
1523
+ if (outer == null) return null;
1524
+ const target = control ?? outer;
1525
+ const outerRect = outer.getBoundingClientRect();
1526
+ const controlRect = target.getBoundingClientRect();
1527
+ const edges = gutter.value;
1528
+ return resolveEditorPlacement({
1529
+ outer: {
1530
+ left: outerRect.left,
1531
+ right: outerRect.right,
1532
+ width: outerRect.width
1280
1533
  },
1281
- quoted: false
1282
- }));
1534
+ control: {
1535
+ left: controlRect.left,
1536
+ right: controlRect.right,
1537
+ width: controlRect.width
1538
+ },
1539
+ viewportWidth: window.innerWidth,
1540
+ viewportHeight: window.innerHeight,
1541
+ inlineStart: edges.inlineStart,
1542
+ inlineEnd: edges.inlineEnd,
1543
+ blockInset: edges.blockStart,
1544
+ direction: getComputedStyle(outer).direction === "rtl" ? "rtl" : "ltr",
1545
+ anchorTop: controlRect.top,
1546
+ anchorBottom: controlRect.bottom
1547
+ });
1283
1548
  }
1284
- return [];
1285
- }
1286
- function browseItems(lookup) {
1287
- const grouped = /* @__PURE__ */ new Map();
1288
- const ungrouped = [];
1289
- for (const field of lookup.getVisibleFields()) {
1290
- const operator = lookup.getDefaultOperator(field.key);
1291
- const item = {
1292
- id: field.key,
1293
- label: field.label,
1294
- description: field.description,
1295
- auxiliaryData: {
1296
- fieldKey: field.key,
1297
- operatorKey: operator?.key,
1298
- group: field.group
1299
- }
1549
+ function openEditor(mode, filter, index, control) {
1550
+ const placement = measure(control);
1551
+ if (placement == null) return;
1552
+ menu.close();
1553
+ openingControl.value = control;
1554
+ session.value = {
1555
+ mode,
1556
+ index,
1557
+ filter,
1558
+ placement,
1559
+ ready: false,
1560
+ control
1300
1561
  };
1301
- if (field.group) {
1302
- const bucket = grouped.get(field.group) ?? [];
1303
- bucket.push(item);
1304
- grouped.set(field.group, bucket);
1305
- } else ungrouped.push(item);
1306
- }
1307
- const ordered = [...ungrouped];
1308
- for (const items of grouped.values()) ordered.push(...items);
1309
- return ordered.slice(0, MAX_BROWSE_ITEMS);
1310
- }
1311
- function searchPowerSearchFields(lookup, query, messages, maxTypedResults) {
1312
- const trimmed = query.trim();
1313
- if (trimmed === "") return browseItems(lookup);
1314
- const lower = trimmed.toLowerCase();
1315
- const results = [];
1316
- const seen = /* @__PURE__ */ new Set();
1317
- const labelOf = (operator) => resolveOperatorLabel(operator, messages);
1318
- for (const field of lookup.getVisibleFields()) {
1319
- if (field.typeaheadMinQueryLength != null && lower.length < field.typeaheadMinQueryLength) continue;
1320
- if ((field.label.toLowerCase().includes(lower) || field.typeaheadAliases?.some((alias) => alias.toLowerCase().includes(lower)) === true) && !seen.has(field.key)) {
1321
- seen.add(field.key);
1322
- const operator = lookup.getDefaultOperator(field.key);
1323
- results.push({
1324
- id: field.key,
1325
- label: field.label,
1326
- description: field.description,
1327
- auxiliaryData: {
1328
- fieldKey: field.key,
1329
- operatorKey: operator?.key,
1330
- group: field.group
1331
- }
1562
+ nextTick(() => {
1563
+ requestAnimationFrame(() => {
1564
+ if (session.value) session.value = {
1565
+ ...session.value,
1566
+ ready: true
1567
+ };
1332
1568
  });
1333
- }
1334
- for (const operator of field.operators) {
1335
- const combined = `${field.label} ${labelOf(operator)}`.toLowerCase();
1336
- const id = `${field.key}:${operator.key}`;
1337
- if (combined.includes(lower) && !seen.has(id)) {
1338
- seen.add(id);
1339
- results.push({
1340
- id,
1341
- label: `${field.label} ${labelOf(operator)}`,
1342
- description: field.description,
1343
- auxiliaryData: {
1344
- fieldKey: field.key,
1345
- operatorKey: operator.key,
1346
- group: field.group
1347
- }
1348
- });
1349
- }
1350
- }
1569
+ });
1351
1570
  }
1352
- for (const field of lookup.getVisibleFields()) {
1353
- if (field.isValueMatchAllowed === false) continue;
1354
- const fieldLabel = field.label.toLowerCase();
1355
- let exactOperator = false;
1356
- for (const operator of field.operators) {
1357
- const prefix = `${fieldLabel} ${labelOf(operator).toLowerCase()} `;
1358
- if (!lower.startsWith(prefix) || lower.length <= prefix.length) continue;
1359
- const matches = resolveValueMatches(operator, trimmed.slice(prefix.length));
1360
- if (matches.length > 0) exactOperator = true;
1361
- for (const match of matches) {
1362
- const id = `${field.key}:${operator.key}:value:${match.displayValue}`;
1363
- if (seen.has(id)) continue;
1364
- seen.add(id);
1365
- const shown = match.quoted ? `"${match.displayValue}"` : match.displayValue;
1366
- results.push({
1367
- id,
1368
- label: `${field.label} ${labelOf(operator)} ${shown}`,
1369
- auxiliaryData: {
1370
- fieldKey: field.key,
1371
- operatorKey: operator.key,
1372
- filterValue: match.filterValue
1373
- }
1374
- });
1571
+ function closeEditor(restore) {
1572
+ const control = session.value?.control;
1573
+ session.value = null;
1574
+ openingControl.value = null;
1575
+ if (!restore) return;
1576
+ nextTick(() => {
1577
+ if (control instanceof HTMLElement) control.focus();
1578
+ else options.inputRef.value?.focus();
1579
+ });
1580
+ }
1581
+ function focusInput() {
1582
+ nextTick(() => options.inputRef.value?.focus());
1583
+ }
1584
+ function pick(item) {
1585
+ const data = item.auxiliaryData;
1586
+ if (data == null) return;
1587
+ const field = lookup.value.getField(data.fieldKey);
1588
+ const operator = (data.operatorKey ? lookup.value.getOperator(data.fieldKey, data.operatorKey) : void 0) ?? lookup.value.getDefaultOperator(data.fieldKey);
1589
+ if (field == null || operator == null) return;
1590
+ menu.setQuery("");
1591
+ menu.close();
1592
+ if (data.filterValue != null || operator.value.type === "empty") {
1593
+ const value = data.filterValue ?? { type: "empty" };
1594
+ const next = [...filters.value, {
1595
+ field: field.key,
1596
+ operator: operator.key,
1597
+ value
1598
+ }];
1599
+ commit(next, "add", next.length - 1);
1600
+ announce(`${field.label}: ${operator.key}`);
1601
+ focusInput();
1602
+ return;
1603
+ }
1604
+ openEditor("create", {
1605
+ field: field.key,
1606
+ operator: operator.key
1607
+ }, filters.value.length, options.inputRef.value);
1608
+ }
1609
+ function onEditorSave(filter) {
1610
+ const current = session.value;
1611
+ if (current == null) return;
1612
+ if (filter == null) {
1613
+ if (current.mode === "edit") {
1614
+ const dropped = filters.value[current.index];
1615
+ commit(filters.value.filter((_, index) => index !== current.index), "remove", current.index);
1616
+ announce(text.value.removeFilter(dropped ? fieldFor(dropped)?.label ?? dropped.field : ""));
1375
1617
  }
1618
+ closeEditor(false);
1619
+ focusInput();
1620
+ return;
1621
+ }
1622
+ if (current.mode === "edit") commit(filters.value.map((item, index) => index === current.index ? filter : item), "edit", current.index);
1623
+ else {
1624
+ const next = [...filters.value, filter];
1625
+ commit(next, "add", next.length - 1);
1626
+ }
1627
+ const field = lookup.value.getField(filter.field);
1628
+ announce(field?.label ?? filter.field);
1629
+ closeEditor(false);
1630
+ focusInput();
1631
+ }
1632
+ function removeAt(index) {
1633
+ const filter = filters.value[index];
1634
+ if (filter == null || !canRemove(filter)) return;
1635
+ commit(filters.value.filter((_, itemIndex) => itemIndex !== index), "remove", index);
1636
+ announce(text.value.removeFilter(fieldFor(filter)?.label ?? filter.field));
1637
+ focusInput();
1638
+ }
1639
+ function clearAll(event) {
1640
+ event?.stopPropagation();
1641
+ if (props.disabled || filters.value.length === 0) return;
1642
+ commit([], "remove", 0);
1643
+ announce(text.value.clear);
1644
+ menu.close();
1645
+ options.inputRef.value?.focus();
1646
+ }
1647
+ function activate(index) {
1648
+ const filter = filters.value[index];
1649
+ if (filter == null || props.disabled || props.readOnly || filter.isReadOnly) return;
1650
+ if (operatorFor(filter)?.value.type === "empty" && !emptyEditorOverridden(props.components)) {
1651
+ commit(filters.value.map((item, itemIndex) => itemIndex === index ? {
1652
+ field: item.field,
1653
+ operator: item.operator,
1654
+ value: { type: "empty" },
1655
+ isReadOnly: item.isReadOnly
1656
+ } : item), "edit", index);
1657
+ return;
1658
+ }
1659
+ if (!canEdit(filter)) return;
1660
+ openEditor("edit", filter, index, tokenEls.get(index) ?? null);
1661
+ }
1662
+ function setTokenEl(index, element) {
1663
+ if (element instanceof HTMLElement) tokenEls.set(index, element);
1664
+ else tokenEls.delete(index);
1665
+ }
1666
+ function focusToken(index) {
1667
+ nextTick(() => tokenEls.get(index)?.focus());
1668
+ }
1669
+ function onInput(event) {
1670
+ if (props.disabled || props.readOnly) return;
1671
+ menu.setQuery(event.target.value);
1672
+ }
1673
+ function onInputKeyDown(event) {
1674
+ if (session.value != null) return;
1675
+ const input = options.inputRef.value;
1676
+ if (event.key === "Backspace" && menu.query.value === "" && filters.value.length > 0 && canRemove(filters.value[filters.value.length - 1])) {
1677
+ event.preventDefault();
1678
+ removeAt(filters.value.length - 1);
1679
+ return;
1376
1680
  }
1377
- const fieldPrefix = `${fieldLabel} `;
1378
- if (!exactOperator && lower.startsWith(fieldPrefix) && lower.length > fieldPrefix.length) {
1379
- const remainder = lower.slice(fieldPrefix.length);
1380
- if (!field.operators.some((operator) => labelOf(operator).toLowerCase().startsWith(remainder))) {
1381
- const rawValue = trimmed.slice(fieldPrefix.length);
1382
- for (const operator of field.operators) for (const match of resolveValueMatches(operator, rawValue)) {
1383
- const id = `${field.key}:${operator.key}:value:${match.displayValue}`;
1384
- if (seen.has(id)) continue;
1385
- seen.add(id);
1386
- const shown = match.quoted ? `"${match.displayValue}"` : match.displayValue;
1387
- results.push({
1388
- id,
1389
- label: `${field.label} ${labelOf(operator)} ${shown}`,
1390
- auxiliaryData: {
1391
- fieldKey: field.key,
1392
- operatorKey: operator.key,
1393
- filterValue: match.filterValue
1394
- }
1395
- });
1396
- }
1397
- }
1681
+ if (event.key === "ArrowLeft" && input && input.selectionStart === 0 && input.selectionEnd === 0 && filters.value.length > 0) {
1682
+ event.preventDefault();
1683
+ focusToken(Math.min(options.visibleCount(), filters.value.length) - 1);
1684
+ return;
1398
1685
  }
1686
+ if (event.key === "ArrowRight" && input && menu.query.value === "" && input.selectionStart === 0) return;
1687
+ menu.onKeyDown(event);
1399
1688
  }
1400
- const contentKey = lookup.config.contentSearchFieldKey;
1401
- const exact = lookup.getVisibleFields().some((field) => field.label.toLowerCase() === lower || field.operators.some((operator) => `${field.label} ${labelOf(operator)}`.toLowerCase() === lower));
1402
- if (contentKey && !exact) {
1403
- const field = lookup.getField(contentKey);
1404
- const operator = lookup.getDefaultOperator(contentKey);
1405
- if (field && operator) results.unshift({
1406
- id: `__content_search__:${trimmed}`,
1407
- label: `"${trimmed}"`,
1408
- auxiliaryData: {
1409
- fieldKey: contentKey,
1410
- operatorKey: operator.key,
1411
- filterValue: {
1412
- type: "string",
1413
- value: trimmed
1414
- }
1415
- }
1416
- });
1689
+ function onTokenKeyDown(event, index) {
1690
+ const shown = options.visibleCount();
1691
+ if (event.key === "ArrowLeft" && index > 0) {
1692
+ event.preventDefault();
1693
+ focusToken(index - 1);
1694
+ } else if (event.key === "ArrowRight") {
1695
+ event.preventDefault();
1696
+ if (index < shown - 1) focusToken(index + 1);
1697
+ else options.inputRef.value?.focus();
1698
+ } else if (event.key === "Escape") options.inputRef.value?.focus();
1699
+ else if ((event.key === "Backspace" || event.key === "Delete") && canRemove(filters.value[index])) {
1700
+ event.preventDefault();
1701
+ removeAt(index);
1702
+ if (index > 0) focusToken(index - 1);
1703
+ } else if (event.key === "Enter") {
1704
+ event.preventDefault();
1705
+ activate(index);
1706
+ }
1417
1707
  }
1418
- return results.slice(0, maxTypedResults);
1708
+ return {
1709
+ activate,
1710
+ canRemove,
1711
+ clearAll,
1712
+ closeEditor,
1713
+ editorComponent,
1714
+ editorOpen,
1715
+ editorStyle,
1716
+ fieldFor,
1717
+ filters,
1718
+ onEditorSave,
1719
+ onInput,
1720
+ onInputKeyDown,
1721
+ onTokenKeyDown,
1722
+ openingControl,
1723
+ operatorFor,
1724
+ pick,
1725
+ removeAt,
1726
+ session,
1727
+ setTokenEl,
1728
+ tokenComponent
1729
+ };
1419
1730
  }
1420
1731
  //#endregion
1421
1732
  //#region src/PowerSearch/PowerSearch.vue
@@ -1434,12 +1745,14 @@ const _hoisted_4 = {
1434
1745
  class: "astryx-power-search-more"
1435
1746
  };
1436
1747
  const _hoisted_5 = [
1748
+ "id",
1437
1749
  "placeholder",
1438
1750
  "value",
1439
1751
  "disabled",
1440
1752
  "readonly",
1441
1753
  "aria-disabled",
1442
1754
  "aria-expanded",
1755
+ "aria-controls",
1443
1756
  "aria-activedescendant",
1444
1757
  "aria-describedby"
1445
1758
  ];
@@ -1448,42 +1761,47 @@ const _hoisted_6 = {
1448
1761
  class: "astryx-power-search-count"
1449
1762
  };
1450
1763
  const _hoisted_7 = ["aria-label"];
1451
- const _hoisted_8 = {
1764
+ const _hoisted_8 = ["id"];
1765
+ const _hoisted_9 = {
1452
1766
  class: "astryx-visually-hidden",
1453
1767
  "aria-live": "polite"
1454
1768
  };
1455
- const _hoisted_9 = ["aria-label", "data-placement"];
1456
- const _hoisted_10 = {
1769
+ const _hoisted_10 = [
1770
+ "id",
1771
+ "aria-label",
1772
+ "data-placement"
1773
+ ];
1774
+ const _hoisted_11 = {
1457
1775
  class: "astryx-typeahead-menu",
1458
1776
  role: "presentation"
1459
1777
  };
1460
- const _hoisted_11 = {
1778
+ const _hoisted_12 = {
1461
1779
  key: 0,
1462
1780
  class: "astryx-typeahead-state"
1463
1781
  };
1464
- const _hoisted_12 = {
1782
+ const _hoisted_13 = {
1465
1783
  key: 1,
1466
1784
  class: "astryx-typeahead-options",
1467
1785
  role: "presentation"
1468
1786
  };
1469
- const _hoisted_13 = {
1787
+ const _hoisted_14 = {
1470
1788
  key: 0,
1471
1789
  class: "astryx-power-search-menu-group"
1472
1790
  };
1473
- const _hoisted_14 = [
1791
+ const _hoisted_15 = [
1474
1792
  "id",
1475
1793
  "aria-selected",
1476
1794
  "data-option-id",
1477
1795
  "onMouseenter",
1478
1796
  "onClick"
1479
1797
  ];
1480
- const _hoisted_15 = { class: "astryx-typeahead-option-copy" };
1481
- const _hoisted_16 = { class: "astryx-typeahead-option-label" };
1482
- const _hoisted_17 = {
1798
+ const _hoisted_16 = { class: "astryx-typeahead-option-copy" };
1799
+ const _hoisted_17 = { class: "astryx-typeahead-option-label" };
1800
+ const _hoisted_18 = {
1483
1801
  key: 0,
1484
1802
  class: "astryx-typeahead-option-description"
1485
1803
  };
1486
- const _hoisted_18 = ["data-ready"];
1804
+ const _hoisted_19 = ["data-ready"];
1487
1805
  const _sfc_main = /*@__PURE__*/ defineComponent({
1488
1806
  name: "AstryxPowerSearch",
1489
1807
  inheritAttrs: false,
@@ -1492,6 +1810,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1492
1810
  config: {},
1493
1811
  filters: {},
1494
1812
  label: {},
1813
+ isLabelHidden: { type: Boolean },
1495
1814
  labelHidden: {
1496
1815
  type: Boolean,
1497
1816
  default: true
@@ -1530,7 +1849,35 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1530
1849
  overflow: { default: "none" },
1531
1850
  resultCount: {},
1532
1851
  size: { default: "md" },
1533
- components: {}
1852
+ components: {},
1853
+ containerClass: { type: [
1854
+ Boolean,
1855
+ null,
1856
+ String,
1857
+ Object,
1858
+ Array
1859
+ ] },
1860
+ containerStyle: { type: [
1861
+ Boolean,
1862
+ null,
1863
+ String,
1864
+ Object,
1865
+ Array
1866
+ ] },
1867
+ controlClass: { type: [
1868
+ Boolean,
1869
+ null,
1870
+ String,
1871
+ Object,
1872
+ Array
1873
+ ] },
1874
+ controlStyle: { type: [
1875
+ Boolean,
1876
+ null,
1877
+ String,
1878
+ Object,
1879
+ Array
1880
+ ] }
1534
1881
  },
1535
1882
  emits: [
1536
1883
  "update:filters",
@@ -1542,27 +1889,48 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1542
1889
  const props = __props;
1543
1890
  const emit = __emit;
1544
1891
  const slots = useSlots();
1892
+ const attrs = useAttrs();
1893
+ const parts = useFieldPartStyling({
1894
+ component: "PowerSearch",
1895
+ props,
1896
+ attrs,
1897
+ reservedAttrs: [
1898
+ "id",
1899
+ "type",
1900
+ "role",
1901
+ "value",
1902
+ "disabled",
1903
+ "readonly",
1904
+ "placeholder",
1905
+ "autocomplete",
1906
+ "aria-expanded",
1907
+ "aria-controls",
1908
+ "aria-autocomplete",
1909
+ "aria-activedescendant",
1910
+ "aria-describedby",
1911
+ "aria-disabled"
1912
+ ]
1913
+ });
1914
+ const hideLabel = useResolvedLabelHidden(() => props.isLabelHidden, () => props.labelHidden, true);
1545
1915
  const messages = useAstryxMessages();
1546
1916
  const locale = useAstryxLocale();
1547
1917
  const announce = useAnnounce();
1548
- const inputId = `astryx-power-search-${useId()}`;
1549
- const listboxId = `${inputId}-listbox`;
1550
- const disabledId = `${inputId}-disabled`;
1551
- const internal = ref([]);
1552
- const filters = computed(() => props.filters ?? internal.value);
1918
+ const generatedId = `astryx-power-search-${useId()}`;
1919
+ const passedId = computed(() => typeof attrs.id === "string" && attrs.id !== "" ? attrs.id : void 0);
1920
+ const inputId = computed(() => passedId.value ?? generatedId);
1921
+ const listboxId = computed(() => `${inputId.value}-listbox`);
1922
+ const disabledId = computed(() => `${inputId.value}-disabled`);
1553
1923
  const focused = ref(false);
1554
1924
  const placeholderHeight = ref(0);
1555
1925
  const queryMirror = ref("");
1556
1926
  const anchorRef = useTemplateRef("anchorRef");
1557
1927
  const listboxRef = useTemplateRef("listboxRef");
1928
+ useScrollbars(listboxRef);
1558
1929
  const inputRef = useTemplateRef("inputRef");
1559
1930
  const editorRef = useTemplateRef("editorRef");
1560
- const tokenEls = /* @__PURE__ */ new Map();
1561
- const session = ref(null);
1562
- const openingControl = ref(null);
1563
- const editorOpen = computed(() => session.value != null);
1564
1931
  const sawCount = ref(false);
1565
1932
  const liveText = ref("");
1933
+ const visibleCountOf = { current: () => 0 };
1566
1934
  const text = computed(() => messages.value.powerSearch);
1567
1935
  const label = computed(() => props.label ?? text.value.label);
1568
1936
  const placeholder = computed(() => props.placeholder ?? text.value.placeholder);
@@ -1581,20 +1949,28 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1581
1949
  message: props.statusMessage
1582
1950
  };
1583
1951
  });
1584
- const describedBy = computed(() => {
1585
- return [focusableDisabled.value ? disabledId : void 0, props.statusMessage ? `${inputId}-status` : void 0].filter(Boolean).join(" ") || void 0;
1586
- });
1952
+ const externalDescribedBy = computed(() => typeof attrs["aria-describedby"] === "string" ? attrs["aria-describedby"] : void 0);
1953
+ const describedBy = computed(() => [
1954
+ externalDescribedBy.value,
1955
+ focusableDisabled.value ? disabledId.value : void 0,
1956
+ props.statusMessage ? `${inputId.value}-status` : void 0
1957
+ ].filter(Boolean).join(" ") || void 0);
1587
1958
  const source = computed(() => ({ search(query) {
1588
1959
  const limit = query.trim() === "" ? 1e3 : props.maxSearchResults;
1589
1960
  return searchPowerSearchFields(lookup.value, query, text.value, limit);
1590
1961
  } }));
1962
+ const bridge = {
1963
+ pick: (_item) => {},
1964
+ sessionOpen: () => false,
1965
+ closeEditor: (_restore) => {}
1966
+ };
1591
1967
  const menu = useTypeaheadMenu({
1592
1968
  source: () => source.value,
1593
1969
  debounceMs: 0,
1594
1970
  showOnFocus: () => !props.readOnly,
1595
1971
  maxItems: () => queryMirror.value.trim() === "" ? 1e3 : props.maxSearchResults,
1596
- disabled: () => props.disabled || props.readOnly || session.value != null,
1597
- onSelect: (entry) => pick(entry.item),
1972
+ disabled: () => props.disabled || props.readOnly || bridge.sessionOpen(),
1973
+ onSelect: (entry) => bridge.pick(entry.item),
1598
1974
  onQueryChange: (query) => {
1599
1975
  queryMirror.value = query;
1600
1976
  }
@@ -1605,48 +1981,40 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1605
1981
  isOpen: menu.combobox.isOpen,
1606
1982
  onDismiss: () => menu.close()
1607
1983
  });
1984
+ const { activate, canRemove, clearAll, closeEditor, editorComponent, editorOpen, editorStyle, fieldFor, filters, onEditorSave, onInput, onInputKeyDown, onTokenKeyDown, openingControl, operatorFor, pick, removeAt, session, setTokenEl, tokenComponent } = usePowerSearchActions({
1985
+ props,
1986
+ emit,
1987
+ hasCustomEditor: () => slots.editor != null,
1988
+ menu: {
1989
+ query: menu.query,
1990
+ close: () => menu.close(),
1991
+ setQuery: (value) => {
1992
+ menu.query.value = value;
1993
+ },
1994
+ onKeyDown: (event) => menu.onKeyDown(event)
1995
+ },
1996
+ anchorRef,
1997
+ inputRef,
1998
+ lookup,
1999
+ text,
2000
+ announce,
2001
+ visibleCount: () => visibleCountOf.current()
2002
+ });
2003
+ bridge.pick = pick;
2004
+ bridge.sessionOpen = () => session.value != null;
2005
+ bridge.closeEditor = closeEditor;
1608
2006
  useDismiss({
1609
2007
  container: editorRef,
1610
2008
  trigger: openingControl,
1611
2009
  isEnabled: editorOpen,
1612
- enableEscape: ref(false),
2010
+ dismissOnEscape: "ignore",
1613
2011
  onDismiss: () => closeEditor(true)
1614
2012
  });
1615
2013
  const tokenCount = computed(() => filters.value.length);
1616
2014
  const overflowState = useOverflow(tokenCount, { gap: 4 });
1617
2015
  const visibleCount = computed(() => collapsed.value ? overflowState.visibleCount.value : tokenCount.value);
2016
+ visibleCountOf.current = () => visibleCount.value;
1618
2017
  const hiddenCount = computed(() => Math.max(0, tokenCount.value - visibleCount.value));
1619
- const visibleFilters = computed(() => filters.value.slice(0, visibleCount.value));
1620
- const displayCount = computed(() => {
1621
- if (props.resultCount == null) return "";
1622
- return typeof props.resultCount === "number" ? text.value.resultCount(props.resultCount) : props.resultCount;
1623
- });
1624
- const menuStyle = computed(() => {
1625
- const base = anchored.style.value;
1626
- if (props.menuWidth == null) return base;
1627
- const width = `${props.menuWidth}px`;
1628
- return {
1629
- ...base,
1630
- width,
1631
- minWidth: width,
1632
- maxWidth: width
1633
- };
1634
- });
1635
- const editorStyle = computed(() => {
1636
- const place = session.value?.placement;
1637
- if (place == null) return void 0;
1638
- return {
1639
- top: `${place.top}px`,
1640
- left: `${place.left}px`,
1641
- width: `${place.width}px`
1642
- };
1643
- });
1644
- const editorComponent = computed(() => {
1645
- const filter = session.value?.filter;
1646
- if (filter?.operator == null) return _sfc_main$2;
1647
- const type = lookup.value.getOperator(filter.field, filter.operator)?.value.type;
1648
- return (type ? props.components?.[type]?.editor : void 0) ?? _sfc_main$2;
1649
- });
1650
2018
  watch(collapsed, () => {
1651
2019
  nextTick(() => overflowState.remeasure());
1652
2020
  });
@@ -1662,166 +2030,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1662
2030
  if (typeof value === "number") liveText.value = text.value.resultCount(value);
1663
2031
  else if (typeof value === "string") liveText.value = value;
1664
2032
  }, { immediate: true });
1665
- function commit(next, changeType, index) {
1666
- internal.value = next;
1667
- emit("update:filters", next);
1668
- emit("change", next, changeType, index);
1669
- }
1670
- function operatorFor(filter) {
1671
- return lookup.value.getOperator(filter.field, filter.operator);
1672
- }
1673
- function fieldFor(filter) {
1674
- return lookup.value.getField(filter.field);
1675
- }
1676
- function canEdit(filter) {
1677
- if (props.disabled || props.readOnly || filter.isReadOnly) return false;
1678
- const operator = operatorFor(filter);
1679
- if (operator == null) return false;
1680
- if (operator.value.type !== "empty") return true;
1681
- return Boolean(props.components?.empty?.editor || slots.editor);
1682
- }
1683
- function canRemove(filter) {
1684
- return !props.disabled && !props.readOnly && filter.isReadOnly !== true;
1685
- }
1686
- function tokenComponent(filter) {
1687
- const type = operatorFor(filter)?.value.type;
1688
- return type ? props.components?.[type]?.token : void 0;
1689
- }
1690
- function measure(control) {
1691
- const outer = anchorRef.value;
1692
- if (outer == null) return null;
1693
- const target = control ?? outer;
1694
- const outerRect = outer.getBoundingClientRect();
1695
- const controlRect = target.getBoundingClientRect();
1696
- return resolveEditorPlacement({
1697
- outer: {
1698
- left: outerRect.left,
1699
- right: outerRect.right,
1700
- width: outerRect.width
1701
- },
1702
- control: {
1703
- left: controlRect.left,
1704
- right: controlRect.right,
1705
- width: controlRect.width
1706
- },
1707
- viewportWidth: window.innerWidth,
1708
- viewportHeight: window.innerHeight,
1709
- direction: getComputedStyle(outer).direction === "rtl" ? "rtl" : "ltr",
1710
- anchorTop: controlRect.top,
1711
- anchorBottom: controlRect.bottom
1712
- });
1713
- }
1714
- function openEditor(mode, filter, index, control) {
1715
- const placement = measure(control);
1716
- if (placement == null) return;
1717
- menu.close();
1718
- openingControl.value = control;
1719
- session.value = {
1720
- mode,
1721
- index,
1722
- filter,
1723
- placement,
1724
- ready: false,
1725
- control
2033
+ const visibleFilters = computed(() => filters.value.slice(0, visibleCount.value));
2034
+ const displayCount = computed(() => {
2035
+ if (props.resultCount == null) return "";
2036
+ return typeof props.resultCount === "number" ? text.value.resultCount(props.resultCount) : props.resultCount;
2037
+ });
2038
+ const menuStyle = computed(() => {
2039
+ const base = anchored.style.value;
2040
+ if (props.menuWidth == null) return base;
2041
+ const width = `min(${props.menuWidth}px, var(--astryx-layer-max-inline-size, calc(100vw - 32px)))`;
2042
+ return {
2043
+ ...base,
2044
+ width,
2045
+ minWidth: width,
2046
+ maxWidth: width
1726
2047
  };
1727
- nextTick(() => {
1728
- requestAnimationFrame(() => {
1729
- if (session.value) session.value = {
1730
- ...session.value,
1731
- ready: true
1732
- };
1733
- });
1734
- });
1735
- }
1736
- function closeEditor(restore) {
1737
- const control = session.value?.control;
1738
- session.value = null;
1739
- openingControl.value = null;
1740
- if (!restore) return;
1741
- nextTick(() => {
1742
- if (control instanceof HTMLElement) control.focus();
1743
- else inputRef.value?.focus();
1744
- });
1745
- }
1746
- function pick(item) {
1747
- const data = item.auxiliaryData;
1748
- if (data == null) return;
1749
- const field = lookup.value.getField(data.fieldKey);
1750
- const operator = (data.operatorKey ? lookup.value.getOperator(data.fieldKey, data.operatorKey) : void 0) ?? lookup.value.getDefaultOperator(data.fieldKey);
1751
- if (field == null || operator == null) return;
1752
- menu.query.value = "";
1753
- menu.close();
1754
- if (data.filterValue != null || operator.value.type === "empty") {
1755
- const value = data.filterValue ?? { type: "empty" };
1756
- const next = [...filters.value, {
1757
- field: field.key,
1758
- operator: operator.key,
1759
- value
1760
- }];
1761
- commit(next, "add", next.length - 1);
1762
- announce(`${field.label}: ${operator.key}`);
1763
- nextTick(() => inputRef.value?.focus());
1764
- return;
1765
- }
1766
- openEditor("create", {
1767
- field: field.key,
1768
- operator: operator.key
1769
- }, filters.value.length, inputRef.value);
1770
- }
1771
- function onEditorSave(filter) {
1772
- const current = session.value;
1773
- if (current == null) return;
1774
- if (filter == null) {
1775
- if (current.mode === "edit") {
1776
- const removed = filters.value[current.index];
1777
- commit(filters.value.filter((_, index) => index !== current.index), "remove", current.index);
1778
- announce(text.value.removeFilter(removed ? fieldFor(removed)?.label ?? removed.field : ""));
1779
- }
1780
- closeEditor(false);
1781
- nextTick(() => inputRef.value?.focus());
1782
- return;
1783
- }
1784
- if (current.mode === "edit") commit(filters.value.map((item, index) => index === current.index ? filter : item), "edit", current.index);
1785
- else {
1786
- const next = [...filters.value, filter];
1787
- commit(next, "add", next.length - 1);
1788
- }
1789
- const field = lookup.value.getField(filter.field);
1790
- announce(field?.label ?? filter.field);
1791
- closeEditor(false);
1792
- nextTick(() => inputRef.value?.focus());
1793
- }
1794
- function removeAt(index) {
1795
- const filter = filters.value[index];
1796
- if (filter == null || !canRemove(filter)) return;
1797
- commit(filters.value.filter((_, itemIndex) => itemIndex !== index), "remove", index);
1798
- announce(text.value.removeFilter(fieldFor(filter)?.label ?? filter.field));
1799
- nextTick(() => inputRef.value?.focus());
1800
- }
1801
- function clearAll(event) {
1802
- event?.stopPropagation();
1803
- if (props.disabled || filters.value.length === 0) return;
1804
- commit([], "remove", 0);
1805
- announce(text.value.clear);
1806
- menu.close();
1807
- inputRef.value?.focus();
1808
- }
1809
- function activate(index) {
1810
- const filter = filters.value[index];
1811
- if (filter == null || !canEdit(filter)) return;
1812
- openEditor("edit", filter, index, tokenEls.get(index) ?? null);
1813
- }
1814
- function setTokenEl(index, element) {
1815
- if (element instanceof HTMLElement) tokenEls.set(index, element);
1816
- else tokenEls.delete(index);
1817
- }
1818
- function focusToken(index) {
1819
- nextTick(() => tokenEls.get(index)?.focus());
1820
- }
1821
- function onInput(event) {
1822
- if (props.disabled || props.readOnly) return;
1823
- menu.setQuery(event.target.value);
1824
- }
2048
+ });
1825
2049
  function onInputFocus(event) {
1826
2050
  emit("focus", event);
1827
2051
  if (!props.disabled && !props.readOnly && session.value == null) menu.open();
@@ -1836,40 +2060,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1836
2060
  focused.value = false;
1837
2061
  if (session.value == null) menu.close();
1838
2062
  }
1839
- function onInputKeyDown(event) {
1840
- if (session.value != null) return;
1841
- const input = inputRef.value;
1842
- if (event.key === "Backspace" && menu.query.value === "" && filters.value.length > 0 && canRemove(filters.value[filters.value.length - 1])) {
1843
- event.preventDefault();
1844
- removeAt(filters.value.length - 1);
1845
- return;
1846
- }
1847
- if (event.key === "ArrowLeft" && input && input.selectionStart === 0 && input.selectionEnd === 0 && filters.value.length > 0) {
1848
- event.preventDefault();
1849
- focusToken(Math.min(visibleCount.value, filters.value.length) - 1);
1850
- return;
1851
- }
1852
- if (event.key === "ArrowRight" && input && menu.query.value === "" && input.selectionStart === 0) return;
1853
- menu.onKeyDown(event);
1854
- }
1855
- function onTokenKeyDown(event, index) {
1856
- if (event.key === "ArrowLeft" && index > 0) {
1857
- event.preventDefault();
1858
- focusToken(index - 1);
1859
- } else if (event.key === "ArrowRight") {
1860
- event.preventDefault();
1861
- if (index < visibleCount.value - 1) focusToken(index + 1);
1862
- else inputRef.value?.focus();
1863
- } else if (event.key === "Escape") inputRef.value?.focus();
1864
- else if ((event.key === "Backspace" || event.key === "Delete") && canRemove(filters.value[index])) {
1865
- event.preventDefault();
1866
- removeAt(index);
1867
- if (index > 0) focusToken(index - 1);
1868
- } else if (event.key === "Enter") {
1869
- event.preventDefault();
1870
- activate(index);
1871
- }
1872
- }
1873
2063
  function onFieldClick(event) {
1874
2064
  if (props.disabled && !focusableDisabled.value) return;
1875
2065
  const target = event.target;
@@ -1880,21 +2070,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1880
2070
  const entry = menu.entries.value[index];
1881
2071
  if (entry && !entry.disabled) menu.combobox.activeIndex.value = index;
1882
2072
  }
1883
- function groupLabel(index) {
1884
- const group = menu.entries.value[index]?.item.auxiliaryData?.group;
1885
- if (group == null || group === "") return void 0;
1886
- return group !== (index > 0 ? menu.entries.value[index - 1]?.item.auxiliaryData?.group : void 0) ? group : void 0;
1887
- }
1888
- function itemIcon(item) {
1889
- const data = item.auxiliaryData;
1890
- const type = (data?.operatorKey ? lookup.value.getOperator(data.fieldKey, data.operatorKey) : void 0)?.value.type;
1891
- if (type === "date_absolute" || type === "date_range" || type === "date_relative") return "calendar";
1892
- if (type === "time") return "clock";
1893
- if (type === "enum" || type === "enum_list") return "funnel";
1894
- return "search";
1895
- }
1896
2073
  function optionId(index) {
1897
- return `${listboxId}-option-${index}`;
2074
+ return `${listboxId.value}-option-${index}`;
1898
2075
  }
1899
2076
  onMounted(() => {
1900
2077
  if (props.autofocus) inputRef.value?.focus();
@@ -1905,10 +2082,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1905
2082
  });
1906
2083
  return (_ctx, _cache) => {
1907
2084
  return openBlock(), createElementBlock(Fragment, null, [createVNode(_sfc_main$8, {
1908
- class: normalizeClass(["astryx-power-search", [`size-${__props.size}`, { "is-floating": floating.value }]]),
2085
+ class: normalizeClass(["astryx-power-search", [
2086
+ unref(parts).containerClass.value,
2087
+ `size-${__props.size}`,
2088
+ { "is-floating": floating.value }
2089
+ ]]),
2090
+ style: normalizeStyle(unref(parts).containerStyle.value),
1909
2091
  label: label.value,
1910
- "input-id": inputId,
1911
- "is-label-hidden": __props.labelHidden,
2092
+ "input-id": inputId.value,
2093
+ "is-label-hidden": unref(hideLabel),
1912
2094
  "is-disabled": __props.disabled && !focusableDisabled.value,
1913
2095
  status: fieldStatus.value,
1914
2096
  "status-variant": __props.statusVariant
@@ -1926,11 +2108,16 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1926
2108
  default: withCtx(() => [createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/no-static-element-interactions -- 点空白处把焦点交给输入框。 "), createElementVNode("div", {
1927
2109
  ref_key: "anchorRef",
1928
2110
  ref: anchorRef,
1929
- class: normalizeClass(["astryx-power-search-control", [`status-${__props.status}`, {
1930
- "is-open": unref(menu).combobox.isOpen.value,
1931
- "is-disabled": __props.disabled,
1932
- "is-floating": floating.value
1933
- }]]),
2111
+ class: normalizeClass(["astryx-power-search-control", [
2112
+ unref(parts).controlClass(),
2113
+ `status-${__props.status}`,
2114
+ {
2115
+ "is-open": unref(menu).combobox.isOpen.value,
2116
+ "is-disabled": __props.disabled,
2117
+ "is-floating": floating.value
2118
+ }
2119
+ ]]),
2120
+ style: normalizeStyle(unref(parts).controlStyle()),
1934
2121
  onClick: onFieldClick,
1935
2122
  onFocusin: onFocusIn,
1936
2123
  onFocusout: onFocusOut
@@ -1945,29 +2132,29 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1945
2132
  return openBlock(), createElementBlock("span", {
1946
2133
  key: `${filter.field}-${filter.operator}-${index}`,
1947
2134
  ref_for: true,
1948
- ref: (element) => setTokenEl(index, element),
2135
+ ref: (element) => unref(setTokenEl)(index, element),
1949
2136
  class: "astryx-power-search-token",
1950
2137
  tabindex: "-1",
1951
- onKeydown: ($event) => onTokenKeyDown($event, index)
2138
+ onKeydown: ($event) => unref(onTokenKeyDown)($event, index)
1952
2139
  }, [renderSlot(_ctx.$slots, "token", {
1953
2140
  config: __props.config,
1954
2141
  filter,
1955
- field: fieldFor(filter),
1956
- operator: operatorFor(filter),
2142
+ field: unref(fieldFor)(filter),
2143
+ operator: unref(operatorFor)(filter),
1957
2144
  maxLength: __props.maxTokenLength,
1958
2145
  disabled: __props.disabled,
1959
- onClick: () => activate(index),
1960
- onRemove: () => removeAt(index)
1961
- }, () => [tokenComponent(filter) ? (openBlock(), createBlock(resolveDynamicComponent(tokenComponent(filter)), {
2146
+ onClick: () => unref(activate)(index),
2147
+ onRemove: () => unref(removeAt)(index)
2148
+ }, () => [unref(tokenComponent)(filter) ? (openBlock(), createBlock(resolveDynamicComponent(unref(tokenComponent)(filter)), {
1962
2149
  key: 0,
1963
2150
  config: __props.config,
1964
2151
  filter,
1965
- field: fieldFor(filter),
1966
- operator: operatorFor(filter),
2152
+ field: unref(fieldFor)(filter),
2153
+ operator: unref(operatorFor)(filter),
1967
2154
  "max-length": __props.maxTokenLength,
1968
2155
  disabled: __props.disabled,
1969
- "on-click": () => activate(index),
1970
- "on-remove": () => removeAt(index)
2156
+ "on-click": () => unref(activate)(index),
2157
+ "on-remove": () => unref(removeAt)(index)
1971
2158
  }, null, 40, [
1972
2159
  "config",
1973
2160
  "filter",
@@ -1977,10 +2164,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1977
2164
  "disabled",
1978
2165
  "on-click",
1979
2166
  "on-remove"
1980
- ])) : fieldFor(filter) && operatorFor(filter) ? (openBlock(), createBlock(_sfc_main$1, {
2167
+ ])) : unref(fieldFor)(filter) && unref(operatorFor)(filter) ? (openBlock(), createBlock(_sfc_main$4, {
1981
2168
  key: 1,
1982
- "field-label": fieldFor(filter).label,
1983
- operator: operatorFor(filter),
2169
+ "field-label": unref(fieldFor)(filter).label,
2170
+ operator: unref(operatorFor)(filter),
1984
2171
  filter,
1985
2172
  "max-length": __props.maxTokenLength,
1986
2173
  messages: text.value,
@@ -1988,9 +2175,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1988
2175
  "time-zone": resolvedTimeZone.value,
1989
2176
  size: __props.size,
1990
2177
  disabled: __props.disabled,
1991
- removable: canRemove(filter),
1992
- onActivate: ($event) => activate(index),
1993
- onRemove: ($event) => removeAt(index)
2178
+ removable: unref(canRemove)(filter),
2179
+ onActivate: ($event) => unref(activate)(index),
2180
+ onRemove: ($event) => unref(removeAt)(index)
1994
2181
  }, null, 8, [
1995
2182
  "field-label",
1996
2183
  "operator",
@@ -2012,14 +2199,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
2012
2199
  ref: unref(overflowState).measureRef,
2013
2200
  class: "astryx-power-search-measure",
2014
2201
  "aria-hidden": "true"
2015
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(filters.value, (filter, index) => {
2202
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filters), (filter, index) => {
2016
2203
  return openBlock(), createElementBlock("span", {
2017
2204
  key: `${filter.field}-${index}`,
2018
2205
  class: "astryx-power-search-token"
2019
- }, [fieldFor(filter) && operatorFor(filter) ? (openBlock(), createBlock(_sfc_main$1, {
2206
+ }, [unref(fieldFor)(filter) && unref(operatorFor)(filter) ? (openBlock(), createBlock(_sfc_main$4, {
2020
2207
  key: 0,
2021
- "field-label": fieldFor(filter).label,
2022
- operator: operatorFor(filter),
2208
+ "field-label": unref(fieldFor)(filter).label,
2209
+ operator: unref(operatorFor)(filter),
2023
2210
  filter,
2024
2211
  "max-length": __props.maxTokenLength,
2025
2212
  messages: text.value,
@@ -2036,8 +2223,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
2036
2223
  "size"
2037
2224
  ])) : createCommentVNode("v-if", true)]);
2038
2225
  }), 128)), createElementVNode("span", _hoisted_4, toDisplayString(text.value.more(Math.max(hiddenCount.value, 1))), 1)], 512),
2039
- createElementVNode("input", {
2040
- id: inputId,
2226
+ createElementVNode("input", mergeProps(unref(parts).forwardedAttrs(), {
2227
+ id: inputId.value,
2041
2228
  ref_key: "inputRef",
2042
2229
  ref: inputRef,
2043
2230
  class: "astryx-power-search-input",
@@ -2045,64 +2232,66 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
2045
2232
  role: "combobox",
2046
2233
  autocomplete: "off",
2047
2234
  autocapitalize: "off",
2048
- placeholder: filters.value.length === 0 ? placeholder.value : void 0,
2235
+ placeholder: unref(filters).length === 0 ? placeholder.value : void 0,
2049
2236
  value: unref(menu).query.value,
2050
2237
  disabled: __props.disabled && !focusableDisabled.value,
2051
2238
  readonly: __props.readOnly || focusableDisabled.value || void 0,
2052
2239
  "aria-disabled": __props.disabled ? "true" : void 0,
2053
2240
  "aria-expanded": unref(menu).combobox.isOpen.value,
2054
- "aria-controls": listboxId,
2241
+ "aria-controls": listboxId.value,
2055
2242
  "aria-autocomplete": "list",
2056
2243
  "aria-activedescendant": unref(menu).activeId.value ? optionId(unref(menu).combobox.activeIndex.value) : void 0,
2057
2244
  "aria-describedby": describedBy.value,
2058
- onInput,
2059
- onKeydown: onInputKeyDown,
2245
+ onInput: _cache[0] || (_cache[0] = (...args) => unref(onInput) && unref(onInput)(...args)),
2246
+ onKeydown: _cache[1] || (_cache[1] = (...args) => unref(onInputKeyDown) && unref(onInputKeyDown)(...args)),
2060
2247
  onFocus: onInputFocus,
2061
- onBlur: _cache[0] || (_cache[0] = ($event) => emit("blur", $event))
2062
- }, null, 40, _hoisted_5),
2248
+ onBlur: _cache[2] || (_cache[2] = ($event) => emit("blur", $event))
2249
+ }), null, 16, _hoisted_5),
2063
2250
  slots.endContent ? renderSlot(_ctx.$slots, "endContent", {}, void 0, void 0, 1) : renderSlot(_ctx.$slots, "end", {}, void 0, void 0, 2),
2064
2251
  displayCount.value ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(displayCount.value), 1)) : createCommentVNode("v-if", true),
2065
- showsClear.value && filters.value.length > 0 && !__props.disabled && !__props.readOnly ? (openBlock(), createElementBlock("button", {
2252
+ showsClear.value && unref(filters).length > 0 && !__props.disabled && !__props.readOnly ? (openBlock(), createElementBlock("button", {
2066
2253
  key: 4,
2067
2254
  type: "button",
2068
2255
  class: "astryx-power-search-clear",
2069
2256
  "aria-label": text.value.clear,
2070
- onClick: clearAll
2257
+ onClick: _cache[3] || (_cache[3] = (...args) => unref(clearAll) && unref(clearAll)(...args))
2071
2258
  }, [createVNode(_sfc_main$7, {
2072
2259
  icon: "close",
2073
2260
  size: "sm"
2074
2261
  })], 8, _hoisted_7)) : createCommentVNode("v-if", true),
2075
2262
  focusableDisabled.value ? (openBlock(), createElementBlock("span", {
2076
2263
  key: 5,
2077
- id: disabledId,
2264
+ id: disabledId.value,
2078
2265
  class: "astryx-visually-hidden"
2079
- }, toDisplayString(disabledMessage.value), 1)) : createCommentVNode("v-if", true)
2080
- ], 34)]),
2266
+ }, toDisplayString(disabledMessage.value), 9, _hoisted_8)) : createCommentVNode("v-if", true)
2267
+ ], 38)]),
2081
2268
  _: 3
2082
2269
  }, 8, ["content", "is-enabled"]),
2083
- createElementVNode("span", _hoisted_8, toDisplayString(liveText.value), 1)
2270
+ createElementVNode("span", _hoisted_9, toDisplayString(liveText.value), 1)
2084
2271
  ]),
2085
2272
  _: 3
2086
2273
  }, 8, [
2087
2274
  "class",
2275
+ "style",
2088
2276
  "label",
2277
+ "input-id",
2089
2278
  "is-label-hidden",
2090
2279
  "is-disabled",
2091
2280
  "status",
2092
2281
  "status-variant"
2093
2282
  ]), (openBlock(), createBlock(Teleport, { to: "body" }, [withDirectives(createElementVNode("div", {
2094
- id: listboxId,
2283
+ id: listboxId.value,
2095
2284
  ref_key: "listboxRef",
2096
2285
  ref: listboxRef,
2097
- class: "astryx-typeahead-listbox",
2286
+ class: "astryx-typeahead-listbox astryx-layer",
2098
2287
  role: "listbox",
2099
2288
  "aria-label": text.value.results,
2100
2289
  "data-placement": unref(anchored).position.value.placement,
2101
2290
  style: normalizeStyle(menuStyle.value),
2102
2291
  tabindex: "-1"
2103
- }, [createElementVNode("div", _hoisted_10, [unref(menu).entries.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_11, toDisplayString(text.value.empty), 1)) : (openBlock(), createElementBlock("div", _hoisted_12, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(menu).entries.value, (entry, index) => {
2292
+ }, [createElementVNode("div", _hoisted_11, [unref(menu).entries.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_12, toDisplayString(text.value.empty), 1)) : (openBlock(), createElementBlock("div", _hoisted_13, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(menu).entries.value, (entry, index) => {
2104
2293
  return openBlock(), createElementBlock(Fragment, { key: entry.id }, [
2105
- groupLabel(index) ? (openBlock(), createElementBlock("div", _hoisted_13, toDisplayString(groupLabel(index)), 1)) : createCommentVNode("v-if", true),
2294
+ unref(powerSearchGroupLabel)(unref(menu).entries.value, index) ? (openBlock(), createElementBlock("div", _hoisted_14, toDisplayString(unref(powerSearchGroupLabel)(unref(menu).entries.value, index)), 1)) : createCommentVNode("v-if", true),
2106
2295
  createCommentVNode(" eslint-disable-next-line vue-a11y/click-events-have-key-events, vue-a11y/mouse-events-have-key-events -- 选项不进 Tab 序。 "),
2107
2296
  createElementVNode("div", {
2108
2297
  id: optionId(index),
@@ -2114,41 +2303,41 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
2114
2303
  "aria-selected": index === unref(menu).combobox.activeIndex.value ? "true" : "false",
2115
2304
  "data-option-id": entry.id,
2116
2305
  tabindex: "-1",
2117
- onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
2306
+ onMousedown: _cache[4] || (_cache[4] = withModifiers(() => {}, ["prevent"])),
2118
2307
  onMouseenter: ($event) => highlight(index),
2119
- onClick: ($event) => pick(entry.item)
2308
+ onClick: ($event) => unref(pick)(entry.item)
2120
2309
  }, [createVNode(_sfc_main$7, {
2121
- icon: itemIcon(entry.item),
2310
+ icon: unref(powerSearchItemIcon)(entry.item, lookup.value),
2122
2311
  size: "sm"
2123
- }, null, 8, ["icon"]), createElementVNode("span", _hoisted_15, [createElementVNode("span", _hoisted_16, toDisplayString(entry.label), 1), entry.description ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(entry.description), 1)) : createCommentVNode("v-if", true)])], 42, _hoisted_14)
2312
+ }, null, 8, ["icon"]), createElementVNode("span", _hoisted_16, [createElementVNode("span", _hoisted_17, toDisplayString(entry.label), 1), entry.description ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(entry.description), 1)) : createCommentVNode("v-if", true)])], 42, _hoisted_15)
2124
2313
  ], 64);
2125
- }), 128))]))])], 12, _hoisted_9), [[vShow, unref(menu).combobox.isOpen.value]]), session.value ? (openBlock(), createElementBlock("div", {
2314
+ }), 128))]))])], 12, _hoisted_10), [[vShow, unref(menu).combobox.isOpen.value]]), unref(session) ? (openBlock(), createElementBlock("div", {
2126
2315
  key: 0,
2127
2316
  ref_key: "editorRef",
2128
2317
  ref: editorRef,
2129
- class: "astryx-power-search-editor",
2130
- "data-ready": session.value.ready ? "true" : "false",
2131
- style: normalizeStyle(editorStyle.value)
2318
+ class: "astryx-power-search-editor astryx-layer",
2319
+ "data-ready": unref(session).ready ? "true" : "false",
2320
+ style: normalizeStyle(unref(editorStyle))
2132
2321
  }, [renderSlot(_ctx.$slots, "editor", {
2133
2322
  config: __props.config,
2134
- filter: session.value.filter,
2135
- mode: session.value.mode,
2323
+ filter: unref(session).filter,
2324
+ mode: unref(session).mode,
2136
2325
  saveLabel: resolvedSaveLabel.value,
2137
2326
  readOnly: __props.readOnly,
2138
2327
  timeZone: resolvedTimeZone.value,
2139
2328
  maxMenuItems: __props.maxOperatorMenuItems,
2140
- onSave: onEditorSave,
2141
- onCancel: () => closeEditor(true)
2142
- }, () => [(openBlock(), createBlock(resolveDynamicComponent(editorComponent.value), {
2329
+ onSave: unref(onEditorSave),
2330
+ onCancel: () => unref(closeEditor)(true)
2331
+ }, () => [(openBlock(), createBlock(resolveDynamicComponent(unref(editorComponent)), {
2143
2332
  config: __props.config,
2144
- filter: session.value.filter,
2145
- mode: session.value.mode,
2333
+ filter: unref(session).filter,
2334
+ mode: unref(session).mode,
2146
2335
  "save-label": resolvedSaveLabel.value,
2147
2336
  "read-only": __props.readOnly,
2148
2337
  "time-zone": resolvedTimeZone.value,
2149
2338
  "max-menu-items": __props.maxOperatorMenuItems,
2150
- "on-save": onEditorSave,
2151
- "on-cancel": () => closeEditor(true)
2339
+ "on-save": unref(onEditorSave),
2340
+ "on-cancel": () => unref(closeEditor)(true)
2152
2341
  }, null, 40, [
2153
2342
  "config",
2154
2343
  "filter",
@@ -2157,8 +2346,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
2157
2346
  "read-only",
2158
2347
  "time-zone",
2159
2348
  "max-menu-items",
2349
+ "on-save",
2160
2350
  "on-cancel"
2161
- ]))])], 12, _hoisted_18)) : createCommentVNode("v-if", true)]))], 64);
2351
+ ]))])], 12, _hoisted_19)) : createCommentVNode("v-if", true)]))], 64);
2162
2352
  };
2163
2353
  }
2164
2354
  });