@astryx-vue/core 0.3.0 → 0.4.1

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