@robot-admin/naive-ui-components 0.40.4 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (495) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +62 -214
  3. package/README_EN.md +62 -195
  4. package/dist/ActionOverflow.cjs +1 -0
  5. package/dist/ActionOverflow.js +1 -0
  6. package/dist/C_ActionBar.css +63 -53
  7. package/dist/C_ActionBar2.cjs +1 -1
  8. package/dist/C_ActionBar2.js +1 -1
  9. package/dist/C_ApprovalViewer.cjs +1 -0
  10. package/dist/C_ApprovalViewer.css +79 -0
  11. package/dist/C_ApprovalViewer.d.cts +2 -0
  12. package/dist/C_ApprovalViewer.d.ts +2 -0
  13. package/dist/C_ApprovalViewer.js +1 -0
  14. package/dist/C_ApprovalViewer2.cjs +1 -0
  15. package/dist/C_ApprovalViewer2.js +1 -0
  16. package/dist/C_Attachments.cjs +1 -0
  17. package/dist/C_Attachments.css +204 -0
  18. package/dist/C_Attachments.d.cts +2 -0
  19. package/dist/C_Attachments.d.ts +2 -0
  20. package/dist/C_Attachments.js +1 -0
  21. package/dist/C_Attachments2.cjs +1 -0
  22. package/dist/C_Attachments2.js +1 -0
  23. package/dist/C_AudioPlayer.d.cts +1 -1
  24. package/dist/C_AudioPlayer.d.ts +1 -1
  25. package/dist/C_AutoComplete.d.cts +2 -2
  26. package/dist/C_AutoComplete.d.ts +2 -2
  27. package/dist/C_AvatarGroup.d.cts +1 -1
  28. package/dist/C_AvatarGroup.d.ts +1 -1
  29. package/dist/C_Barcode.d.cts +1 -1
  30. package/dist/C_Barcode.d.ts +1 -1
  31. package/dist/C_BatchResult.css +10 -10
  32. package/dist/C_BatchResult.d.cts +1 -1
  33. package/dist/C_BatchResult.d.ts +1 -1
  34. package/dist/C_BatchResult2.cjs +1 -1
  35. package/dist/C_BatchResult2.js +1 -1
  36. package/dist/C_Breadcrumb.d.cts +2 -2
  37. package/dist/C_Breadcrumb.d.ts +1 -1
  38. package/dist/C_Cascade.d.cts +1 -1
  39. package/dist/C_Cascade.d.ts +1 -1
  40. package/dist/C_ChangeReview.cjs +1 -0
  41. package/dist/C_ChangeReview.css +49 -0
  42. package/dist/C_ChangeReview.d.cts +2 -0
  43. package/dist/C_ChangeReview.d.ts +2 -0
  44. package/dist/C_ChangeReview.js +1 -0
  45. package/dist/C_ChangeReview2.cjs +1 -0
  46. package/dist/C_ChangeReview2.js +1 -0
  47. package/dist/C_Chat.css +120 -67
  48. package/dist/C_Chat.d.cts +2 -2
  49. package/dist/C_Chat.d.ts +2 -2
  50. package/dist/C_Chat2.cjs +1 -1
  51. package/dist/C_Chat2.js +1 -1
  52. package/dist/C_City.d.cts +1 -1
  53. package/dist/C_City.d.ts +1 -1
  54. package/dist/C_Code.d.cts +1 -1
  55. package/dist/C_Code.d.ts +1 -1
  56. package/dist/C_ContextMenu.d.cts +1 -1
  57. package/dist/C_ContextMenu.d.ts +1 -1
  58. package/dist/C_DataPicker.cjs +1 -1
  59. package/dist/C_DataPicker.css +125 -50
  60. package/dist/C_DataPicker.d.cts +3 -3
  61. package/dist/C_DataPicker.d.ts +4 -3
  62. package/dist/C_DataPicker.js +1 -1
  63. package/dist/C_DataPicker2.cjs +1 -1
  64. package/dist/C_DataPicker2.js +1 -1
  65. package/dist/C_Date.d.cts +1 -1
  66. package/dist/C_Date.d.ts +1 -1
  67. package/dist/C_Density.d.cts +1 -1
  68. package/dist/C_Density.d.ts +1 -1
  69. package/dist/C_Descriptions.cjs +1 -0
  70. package/dist/C_Descriptions.css +86 -0
  71. package/dist/C_Descriptions.d.cts +2 -0
  72. package/dist/C_Descriptions.d.ts +2 -0
  73. package/dist/C_Descriptions.js +1 -0
  74. package/dist/C_Descriptions2.cjs +1 -0
  75. package/dist/C_Descriptions2.js +1 -0
  76. package/dist/C_Editor.d.cts +1 -1
  77. package/dist/C_Editor.d.ts +1 -1
  78. package/dist/C_Editor2.cjs +1 -1
  79. package/dist/C_Editor2.js +1 -1
  80. package/dist/C_ErrorSummary.d.cts +1 -1
  81. package/dist/C_ErrorSummary.d.ts +1 -1
  82. package/dist/C_FilePreview.cjs +1 -1
  83. package/dist/C_FilePreview.d.cts +2 -1
  84. package/dist/C_FilePreview.d.ts +2 -1
  85. package/dist/C_FilePreview.js +1 -1
  86. package/dist/C_FilePreview2.cjs +1 -1
  87. package/dist/C_FilePreview2.js +1 -1
  88. package/dist/C_FilterBuilder.cjs +1 -0
  89. package/dist/C_FilterBuilder.css +59 -0
  90. package/dist/C_FilterBuilder.d.cts +2 -0
  91. package/dist/C_FilterBuilder.d.ts +2 -0
  92. package/dist/C_FilterBuilder.js +1 -0
  93. package/dist/C_FilterBuilder2.cjs +1 -0
  94. package/dist/C_FilterBuilder2.js +1 -0
  95. package/dist/C_Form.base.css +16 -16
  96. package/dist/C_Form.css +16 -16
  97. package/dist/C_Form.d.cts +1 -1
  98. package/dist/C_Form.d.ts +3 -3
  99. package/dist/C_FormModal.css +64 -54
  100. package/dist/C_FormModal.d.cts +2 -2
  101. package/dist/C_FormModal.d.ts +4 -4
  102. package/dist/C_FormModal2.cjs +1 -1
  103. package/dist/C_FormModal2.js +1 -1
  104. package/dist/C_FormSearch.d.cts +2 -1
  105. package/dist/C_FormSearch.d.ts +3 -2
  106. package/dist/C_GlobalSearch.css +156 -137
  107. package/dist/C_GlobalSearch.d.cts +2 -2
  108. package/dist/C_GlobalSearch.d.ts +2 -2
  109. package/dist/C_GlobalSearch2.cjs +1 -1
  110. package/dist/C_GlobalSearch2.js +1 -1
  111. package/dist/C_Guide.css +49 -3
  112. package/dist/C_Guide.d.cts +1 -1
  113. package/dist/C_Guide.d.ts +1 -1
  114. package/dist/C_Guide2.cjs +1 -1
  115. package/dist/C_Guide2.js +1 -1
  116. package/dist/C_Icon.d.cts +1 -1
  117. package/dist/C_Icon.d.ts +1 -1
  118. package/dist/C_ImageAnnotator.cjs +1 -0
  119. package/dist/C_ImageAnnotator.css +143 -0
  120. package/dist/C_ImageAnnotator.d.cts +2 -0
  121. package/dist/C_ImageAnnotator.d.ts +2 -0
  122. package/dist/C_ImageAnnotator.js +1 -0
  123. package/dist/C_ImageAnnotator2.cjs +1 -0
  124. package/dist/C_ImageAnnotator2.js +1 -0
  125. package/dist/C_ImportWizard.cjs +1 -0
  126. package/dist/C_ImportWizard.css +42 -0
  127. package/dist/C_ImportWizard.d.cts +2 -0
  128. package/dist/C_ImportWizard.d.ts +2 -0
  129. package/dist/C_ImportWizard.js +1 -0
  130. package/dist/C_ImportWizard2.cjs +1 -0
  131. package/dist/C_ImportWizard2.js +1 -0
  132. package/dist/C_Language.d.cts +1 -1
  133. package/dist/C_Language.d.ts +1 -1
  134. package/dist/C_Loading.d.cts +1 -1
  135. package/dist/C_Loading.d.ts +1 -1
  136. package/dist/C_Login.d.cts +1 -1
  137. package/dist/C_Login.d.ts +1 -1
  138. package/dist/C_Markdown.d.cts +1 -1
  139. package/dist/C_Markdown.d.ts +1 -1
  140. package/dist/C_Markdown2.cjs +1 -1
  141. package/dist/C_Markdown2.js +1 -1
  142. package/dist/C_Menu.d.cts +2 -2
  143. package/dist/C_Menu.d.ts +1 -1
  144. package/dist/C_NotificationCenter.cjs +1 -1
  145. package/dist/C_NotificationCenter.css +39 -39
  146. package/dist/C_NotificationCenter.d.cts +2 -1
  147. package/dist/C_NotificationCenter.d.ts +2 -1
  148. package/dist/C_NotificationCenter.js +1 -1
  149. package/dist/C_NotificationCenter2.cjs +1 -1
  150. package/dist/C_NotificationCenter2.js +1 -1
  151. package/dist/C_NotificationInbox.cjs +1 -0
  152. package/dist/C_NotificationInbox.css +154 -0
  153. package/dist/C_NotificationInbox.d.cts +2 -0
  154. package/dist/C_NotificationInbox.d.ts +2 -0
  155. package/dist/C_NotificationInbox.js +1 -0
  156. package/dist/C_NotificationInbox2.cjs +1 -0
  157. package/dist/C_NotificationInbox2.js +1 -0
  158. package/dist/C_OrgChart.d.cts +1 -1
  159. package/dist/C_OrgChart.d.ts +1 -1
  160. package/dist/C_Progress.d.cts +1 -1
  161. package/dist/C_Progress.d.ts +1 -1
  162. package/dist/C_QRCode2.cjs +1 -1
  163. package/dist/C_QRCode2.js +1 -1
  164. package/dist/C_RecordList.cjs +1 -0
  165. package/dist/C_RecordList.css +70 -0
  166. package/dist/C_RecordList.d.cts +2 -0
  167. package/dist/C_RecordList.d.ts +2 -0
  168. package/dist/C_RecordList.js +1 -0
  169. package/dist/C_RecordList2.cjs +1 -0
  170. package/dist/C_RecordList2.js +1 -0
  171. package/dist/C_RecurrenceEditor.cjs +1 -0
  172. package/dist/C_RecurrenceEditor.css +68 -0
  173. package/dist/C_RecurrenceEditor.d.cts +2 -0
  174. package/dist/C_RecurrenceEditor.d.ts +2 -0
  175. package/dist/C_RecurrenceEditor.js +1 -0
  176. package/dist/C_RecurrenceEditor2.cjs +1 -0
  177. package/dist/C_RecurrenceEditor2.js +1 -0
  178. package/dist/C_RelationshipExplorer.cjs +1 -0
  179. package/dist/C_RelationshipExplorer.css +76 -0
  180. package/dist/C_RelationshipExplorer.d.cts +2 -0
  181. package/dist/C_RelationshipExplorer.d.ts +2 -0
  182. package/dist/C_RelationshipExplorer.js +1 -0
  183. package/dist/C_RelationshipExplorer2.cjs +1 -0
  184. package/dist/C_RelationshipExplorer2.js +1 -0
  185. package/dist/C_ResourceSchedule.cjs +1 -0
  186. package/dist/C_ResourceSchedule.css +104 -0
  187. package/dist/C_ResourceSchedule.d.cts +2 -0
  188. package/dist/C_ResourceSchedule.d.ts +2 -0
  189. package/dist/C_ResourceSchedule.js +1 -0
  190. package/dist/C_ResourceSchedule2.cjs +1 -0
  191. package/dist/C_ResourceSchedule2.js +1 -0
  192. package/dist/C_ScanInput.cjs +1 -0
  193. package/dist/C_ScanInput.css +33 -0
  194. package/dist/C_ScanInput.d.cts +2 -0
  195. package/dist/C_ScanInput.d.ts +2 -0
  196. package/dist/C_ScanInput.js +1 -0
  197. package/dist/C_ScanInput2.cjs +1 -0
  198. package/dist/C_ScanInput2.js +1 -0
  199. package/dist/C_SectionNav.d.cts +1 -1
  200. package/dist/C_SectionNav.d.ts +1 -1
  201. package/dist/C_Select.d.cts +2 -2
  202. package/dist/C_Select.d.ts +2 -2
  203. package/dist/C_Skeleton.d.cts +1 -1
  204. package/dist/C_Skeleton.d.ts +1 -1
  205. package/dist/C_Steps.d.cts +1 -1
  206. package/dist/C_Steps.d.ts +1 -1
  207. package/dist/C_Table.base.css +194 -184
  208. package/dist/C_Table.css +178 -168
  209. package/dist/C_Table.d.cts +2 -2
  210. package/dist/C_Table.d.ts +15 -14
  211. package/dist/C_Table2.cjs +3 -3
  212. package/dist/C_Table2.js +3 -3
  213. package/dist/C_TagsView.d.cts +2 -2
  214. package/dist/C_TagsView.d.ts +1 -1
  215. package/dist/C_TaskBoard.cjs +1 -0
  216. package/dist/C_TaskBoard.css +58 -0
  217. package/dist/C_TaskBoard.d.cts +2 -0
  218. package/dist/C_TaskBoard.d.ts +2 -0
  219. package/dist/C_TaskBoard.js +1 -0
  220. package/dist/C_TaskBoard2.cjs +1 -0
  221. package/dist/C_TaskBoard2.js +1 -0
  222. package/dist/C_TaskPanel.cjs +1 -0
  223. package/dist/C_TaskPanel.css +68 -0
  224. package/dist/C_TaskPanel.d.cts +2 -0
  225. package/dist/C_TaskPanel.d.ts +2 -0
  226. package/dist/C_TaskPanel.js +1 -0
  227. package/dist/C_TaskPanel2.cjs +1 -0
  228. package/dist/C_TaskPanel2.js +1 -0
  229. package/dist/C_Theme.d.cts +1 -1
  230. package/dist/C_Theme.d.ts +1 -1
  231. package/dist/C_Timeline.d.cts +1 -1
  232. package/dist/C_Timeline.d.ts +1 -1
  233. package/dist/C_Timeline2.cjs +1 -1
  234. package/dist/C_Timeline2.js +1 -1
  235. package/dist/C_Transfer.css +108 -41
  236. package/dist/C_Transfer.d.cts +2 -2
  237. package/dist/C_Transfer.d.ts +2 -2
  238. package/dist/C_Transfer2.cjs +1 -1
  239. package/dist/C_Transfer2.js +1 -1
  240. package/dist/C_Tree.d.cts +1 -1
  241. package/dist/C_Tree.d.ts +13 -12
  242. package/dist/C_Upload.cjs +1 -1
  243. package/dist/C_Upload.d.cts +2 -1
  244. package/dist/C_Upload.d.ts +2 -1
  245. package/dist/C_Upload.js +1 -1
  246. package/dist/C_Upload2.cjs +1 -1
  247. package/dist/C_Upload2.js +1 -1
  248. package/dist/C_UserPicker.d.cts +1 -1
  249. package/dist/C_UserPicker.d.ts +2 -2
  250. package/dist/C_WorkFlow.d.ts +2 -2
  251. package/dist/ExportMenu.cjs +1 -0
  252. package/dist/ExportMenu.js +1 -0
  253. package/dist/NotificationItem.cjs +1 -0
  254. package/dist/NotificationItem.js +1 -0
  255. package/dist/component-config.d.ts +33 -10
  256. package/dist/config.d.cts +1 -1
  257. package/dist/config.d.ts +1 -1
  258. package/dist/constants.cjs +1 -0
  259. package/dist/constants.d.cts +2 -2
  260. package/dist/constants.d.ts +2 -2
  261. package/dist/constants.js +1 -0
  262. package/dist/constants2.d.cts +2 -2
  263. package/dist/constants2.d.ts +2 -2
  264. package/dist/constants3.d.cts +6 -232
  265. package/dist/constants3.d.ts +6 -232
  266. package/dist/constants4.d.cts +9 -199
  267. package/dist/constants4.d.ts +9 -199
  268. package/dist/constants5.d.cts +2 -2
  269. package/dist/constants5.d.ts +2 -2
  270. package/dist/context.d.cts +33 -10
  271. package/dist/data2.d.cts +8 -8
  272. package/dist/data2.d.ts +8 -8
  273. package/dist/dateRange.d.cts +4 -263
  274. package/dist/dateRange.d.ts +4 -263
  275. package/dist/editors.d.cts +11 -11
  276. package/dist/editors.d.ts +11 -11
  277. package/dist/excel.cjs +1 -0
  278. package/dist/excel.js +1 -0
  279. package/dist/fieldRenderers.cjs +1 -1
  280. package/dist/fieldRenderers.js +1 -1
  281. package/dist/fileUrl.cjs +1 -0
  282. package/dist/fileUrl.js +1 -0
  283. package/dist/html2.cjs +1 -0
  284. package/dist/html2.js +1 -0
  285. package/dist/index.cjs +1 -1
  286. package/dist/index.d.cts +88 -69
  287. package/dist/index.d.ts +87 -68
  288. package/dist/index.js +1 -1
  289. package/dist/index.vue.d.cts +54 -75
  290. package/dist/index.vue.d.ts +54 -75
  291. package/dist/index10.vue.d.cts +25 -27
  292. package/dist/index10.vue.d.ts +54 -41
  293. package/dist/index11.vue.d.cts +54 -41
  294. package/dist/index11.vue.d.ts +133 -75
  295. package/dist/index12.vue.d.cts +133 -75
  296. package/dist/index12.vue.d.ts +24 -6
  297. package/dist/index13.vue.d.cts +24 -6
  298. package/dist/index13.vue.d.ts +39 -57
  299. package/dist/index14.vue.d.cts +39 -57
  300. package/dist/index14.vue.d.ts +80 -16
  301. package/dist/index15.vue.d.cts +80 -16
  302. package/dist/index15.vue.d.ts +16 -56
  303. package/dist/index16.vue.d.cts +16 -56
  304. package/dist/index16.vue.d.ts +40 -118
  305. package/dist/index17.vue.d.cts +40 -118
  306. package/dist/index17.vue.d.ts +58 -52
  307. package/dist/index18.vue.d.cts +58 -52
  308. package/dist/index18.vue.d.ts +16 -20
  309. package/dist/index19.vue.d.cts +16 -20
  310. package/dist/index19.vue.d.ts +67 -14
  311. package/dist/index2.vue.d.cts +55 -17
  312. package/dist/index2.vue.d.ts +55 -17
  313. package/dist/index20.vue.d.cts +67 -14
  314. package/dist/index20.vue.d.ts +127 -123
  315. package/dist/index21.vue.d.cts +127 -123
  316. package/dist/index21.vue.d.ts +51 -76
  317. package/dist/index22.vue.d.cts +51 -76
  318. package/dist/index22.vue.d.ts +31 -71
  319. package/dist/index23.vue.d.cts +31 -129
  320. package/dist/index23.vue.d.ts +62 -118
  321. package/dist/index24.vue.d.cts +75 -50
  322. package/dist/index24.vue.d.ts +20 -49
  323. package/dist/index25.vue.d.cts +18 -18
  324. package/dist/index25.vue.d.ts +14 -22
  325. package/dist/index26.vue.d.cts +16 -26
  326. package/dist/index26.vue.d.ts +129 -24
  327. package/dist/index27.vue.d.cts +113 -81
  328. package/dist/index27.vue.d.ts +78 -96
  329. package/dist/index28.vue.d.cts +76 -29
  330. package/dist/index28.vue.d.ts +73 -31
  331. package/dist/index29.vue.d.cts +65 -13
  332. package/dist/index29.vue.d.ts +65 -13
  333. package/dist/index3.vue.d.cts +67 -70
  334. package/dist/index3.vue.d.ts +67 -70
  335. package/dist/index30.vue.d.cts +130 -81
  336. package/dist/index30.vue.d.ts +130 -81
  337. package/dist/index31.vue.d.cts +41 -94
  338. package/dist/index31.vue.d.ts +41 -94
  339. package/dist/index32.vue.d.cts +44 -61
  340. package/dist/index32.vue.d.ts +44 -61
  341. package/dist/index33.vue.d.cts +58 -0
  342. package/dist/index33.vue.d.ts +58 -0
  343. package/dist/index34.vue.d.cts +62 -0
  344. package/dist/index34.vue.d.ts +62 -0
  345. package/dist/index35.vue.d.cts +42 -0
  346. package/dist/index35.vue.d.ts +42 -0
  347. package/dist/index36.vue.d.cts +28 -0
  348. package/dist/index36.vue.d.ts +28 -0
  349. package/dist/index37.vue.d.cts +30 -0
  350. package/dist/index37.vue.d.ts +30 -0
  351. package/dist/index38.vue.d.cts +103 -0
  352. package/dist/index38.vue.d.ts +103 -0
  353. package/dist/index39.vue.d.cts +38 -0
  354. package/dist/index39.vue.d.ts +38 -0
  355. package/dist/index4.vue.d.cts +27 -36
  356. package/dist/index4.vue.d.ts +27 -36
  357. package/dist/index40.vue.d.cts +19 -0
  358. package/dist/index40.vue.d.ts +19 -0
  359. package/dist/index41.vue.d.cts +89 -0
  360. package/dist/index41.vue.d.ts +89 -0
  361. package/dist/index42.vue.d.cts +110 -0
  362. package/dist/index42.vue.d.ts +110 -0
  363. package/dist/index43.vue.d.cts +89 -0
  364. package/dist/index43.vue.d.ts +89 -0
  365. package/dist/index44.vue.d.cts +71 -0
  366. package/dist/index44.vue.d.ts +71 -0
  367. package/dist/index45.vue.d.cts +50 -0
  368. package/dist/index45.vue.d.ts +50 -0
  369. package/dist/index5.vue.d.cts +78 -17
  370. package/dist/index5.vue.d.ts +78 -17
  371. package/dist/index6.vue.d.cts +34 -132
  372. package/dist/index6.vue.d.ts +31 -34
  373. package/dist/index7.vue.d.cts +20 -34
  374. package/dist/index7.vue.d.ts +20 -28
  375. package/dist/index8.vue.d.cts +130 -29
  376. package/dist/index8.vue.d.ts +33 -118
  377. package/dist/index9.vue.d.cts +33 -118
  378. package/dist/index9.vue.d.ts +25 -27
  379. package/dist/localSource.cjs +1 -0
  380. package/dist/{formField.d.cts → localSource.d.cts} +42 -2
  381. package/dist/{formField.d.ts → localSource.d.ts} +42 -2
  382. package/dist/localSource.js +1 -0
  383. package/dist/mapUtils.d.cts +5 -5
  384. package/dist/mapUtils.d.ts +5 -5
  385. package/dist/model.d.cts +88 -0
  386. package/dist/model.d.ts +88 -0
  387. package/dist/presets.d.cts +2 -2
  388. package/dist/presets.d.ts +2 -2
  389. package/dist/previewLimits.cjs +1 -0
  390. package/dist/previewLimits.js +1 -0
  391. package/dist/resolver.cjs +1 -1
  392. package/dist/resolver.d.cts +1 -1
  393. package/dist/resolver.d.ts +1 -1
  394. package/dist/resolver.js +1 -1
  395. package/dist/rule.d.cts +51 -0
  396. package/dist/rule.d.ts +51 -0
  397. package/dist/source.cjs +1 -1
  398. package/dist/source.d.cts +2 -2
  399. package/dist/source.d.ts +2 -2
  400. package/dist/source.js +1 -1
  401. package/dist/style.css +1974 -542
  402. package/dist/types.d.cts +4 -0
  403. package/dist/types.d.ts +4 -0
  404. package/dist/types10.d.cts +229 -0
  405. package/dist/types10.d.ts +285 -0
  406. package/dist/types11.d.cts +285 -0
  407. package/dist/types2.d.cts +188 -31
  408. package/dist/types2.d.ts +188 -31
  409. package/dist/types3.d.cts +84 -101
  410. package/dist/types3.d.ts +82 -105
  411. package/dist/types4.d.cts +24 -106
  412. package/dist/types4.d.ts +30 -55
  413. package/dist/types5.d.cts +106 -55
  414. package/dist/types5.d.ts +130 -41
  415. package/dist/types6.d.cts +130 -41
  416. package/dist/types6.d.ts +244 -265
  417. package/dist/types7.d.cts +244 -265
  418. package/dist/types7.d.ts +60 -0
  419. package/dist/types8.d.cts +60 -0
  420. package/dist/types8.d.ts +50 -0
  421. package/dist/types9.d.cts +50 -0
  422. package/dist/types9.d.ts +229 -0
  423. package/dist/useCalendarEvents.d.cts +2 -2
  424. package/dist/useCalendarEvents.d.ts +2 -2
  425. package/dist/useCollapsePanel.d.cts +7 -7
  426. package/dist/useCollapsePanel.d.ts +7 -7
  427. package/dist/useComponentTheme.cjs +1 -1
  428. package/dist/useComponentTheme.js +1 -1
  429. package/dist/useCropperCore.d.cts +8 -8
  430. package/dist/useCropperCore.d.ts +8 -8
  431. package/dist/useDynamicFormState.d.cts +5 -4
  432. package/dist/useDynamicFormState.d.ts +5 -4
  433. package/dist/useEdgeInteraction.d.cts +2 -2
  434. package/dist/useEdgeInteraction.d.ts +2 -2
  435. package/dist/useFormArray.cjs +1 -1
  436. package/dist/useFormArray.d.cts +39 -3
  437. package/dist/useFormArray.d.ts +39 -3
  438. package/dist/useFormArray.js +1 -1
  439. package/dist/useFormRenderer.d.cts +6 -2
  440. package/dist/useFormRenderer.d.ts +6 -2
  441. package/dist/useFullscreen.d.cts +7 -99
  442. package/dist/useFullscreen.d.ts +7 -99
  443. package/dist/useGlobalSearch.d.cts +45 -3
  444. package/dist/useGlobalSearch.d.ts +45 -3
  445. package/dist/useInfiniteScroll.d.cts +2 -2
  446. package/dist/useInfiniteScroll.d.ts +2 -2
  447. package/dist/useLocalFileUrl.cjs +1 -0
  448. package/dist/useLocalFileUrl.js +1 -0
  449. package/dist/useQRCode.d.cts +3 -3
  450. package/dist/useQRCode.d.ts +3 -3
  451. package/dist/useSignatureHistory.d.cts +6 -6
  452. package/dist/useSignatureHistory.d.ts +6 -6
  453. package/dist/useSplitResize.d.cts +10 -10
  454. package/dist/useSplitResize.d.ts +10 -10
  455. package/dist/useWorkflowValidation.d.cts +108 -108
  456. package/dist/useWorkflowValidation.d.ts +108 -108
  457. package/dist/verification.d.cts +2 -2
  458. package/dist/verification.d.ts +2 -2
  459. package/dist/workflows.cjs +1 -1
  460. package/dist/workflows.d.cts +2 -2
  461. package/dist/workflows.d.ts +2 -2
  462. package/dist/workflows.js +1 -1
  463. package/docs/components.en.md +125 -135
  464. package/docs/components.md +125 -135
  465. package/docs/engineering.en.md +12 -4
  466. package/docs/engineering.md +12 -4
  467. package/docs/guides/api-migration.md +17 -1
  468. package/docs/guides/approval-viewer.md +50 -0
  469. package/docs/guides/attachments.md +39 -0
  470. package/docs/guides/batch-results.md +3 -1
  471. package/docs/guides/change-review.md +49 -0
  472. package/docs/guides/component-contracts.md +8 -0
  473. package/docs/guides/data-picker.md +75 -1
  474. package/docs/guides/data-workflows.md +27 -1
  475. package/docs/guides/dockable-workbench.md +49 -0
  476. package/docs/guides/filter-builder.md +47 -0
  477. package/docs/guides/global-search.md +49 -0
  478. package/docs/guides/image-annotator.md +27 -0
  479. package/docs/guides/import-wizard.md +40 -0
  480. package/docs/guides/notification-center.md +29 -0
  481. package/docs/guides/resource-schedule.md +58 -0
  482. package/docs/guides/scene-components.md +53 -0
  483. package/docs/guides/search-workflows.md +2 -0
  484. package/docs/guides/split-pane.md +2 -0
  485. package/docs/guides/table-density.md +47 -1
  486. package/docs/guides/task-board.md +53 -0
  487. package/docs/guides/task-panel.md +30 -0
  488. package/docs/guides/transfer.md +35 -0
  489. package/docs/guides/usage.en.md +23 -17
  490. package/docs/guides/usage.md +10 -24
  491. package/package.json +1 -1
  492. package/dist/formField.cjs +0 -1
  493. package/dist/formField.js +0 -1
  494. package/dist/html.cjs +0 -1
  495. package/dist/html.js +0 -1
@@ -1,2 +1,2 @@
1
- import { a as SearchMenuItem, i as HistoryItem, n as _default, r as GlobalSearchOptions, t as useGlobalSearch } from "./useGlobalSearch.cjs";
2
- export { _default as C_GlobalSearch, type GlobalSearchOptions, type HistoryItem, type SearchMenuItem, useGlobalSearch };
1
+ import { a as GlobalSearchCommandSource, c as SearchMenuItem, i as GlobalSearchCommandOptions, n as _default, o as GlobalSearchOptions, r as GlobalSearchCommandItem, s as HistoryItem, t as useGlobalSearch } from "./useGlobalSearch.cjs";
2
+ export { _default as C_GlobalSearch, type GlobalSearchCommandItem, type GlobalSearchCommandOptions, type GlobalSearchCommandSource, type GlobalSearchOptions, type HistoryItem, type SearchMenuItem, useGlobalSearch };
@@ -1,2 +1,2 @@
1
- import { a as SearchMenuItem, i as HistoryItem, n as _default, r as GlobalSearchOptions, t as useGlobalSearch } from "./useGlobalSearch.js";
2
- export { _default as C_GlobalSearch, type GlobalSearchOptions, type HistoryItem, type SearchMenuItem, useGlobalSearch };
1
+ import { a as GlobalSearchCommandSource, c as SearchMenuItem, i as GlobalSearchCommandOptions, n as _default, o as GlobalSearchOptions, r as GlobalSearchCommandItem, s as HistoryItem, t as useGlobalSearch } from "./useGlobalSearch.js";
2
+ export { _default as C_GlobalSearch, type GlobalSearchCommandItem, type GlobalSearchCommandOptions, type GlobalSearchCommandSource, type GlobalSearchOptions, type HistoryItem, type SearchMenuItem, useGlobalSearch };
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./useScopedComponentLocale.cjs`),r=require(`./virtualList.cjs`);let i=require(`vue`);const a=e=>e.replace(/^\//,``).replace(/\//g,` > `)||`首页`;function o(e){let t=new Map,n=new Map;return{entries:e.map(e=>{let{key:r}=e,i=a(r);t.set(r,i),n.set(r,e);let o=e.label.toLowerCase();return{item:e,label:o,path:i.toLowerCase(),normalizedLabel:s(o),text:s([o,i,e.breadcrumb??``,...e.keywords??[]].join(` `))}}),paths:t,byKey:n}}function s(e){return e.normalize(`NFKC`).toLowerCase().trim().replace(/\s+/g,` `)}function c(e,t,n=`literal`){if(!t.trim())return[];if(n===`tokens`){let n=s(t),r=n.split(` `);return e.entries.filter(e=>r.every(t=>e.text.includes(t))).map(e=>({item:e.item,rank:e.normalizedLabel===n?0:e.normalizedLabel.startsWith(n)?1:e.normalizedLabel.includes(n)?2:3})).sort((e,t)=>e.rank-t.rank).map(e=>e.item)}let r=t.toLowerCase();return e.entries.filter(e=>e.label.includes(r)||e.path.includes(r)).map(e=>e.item)}function l(e){let t=typeof e==`string`?{query:e}:e;if(!t||typeof t!=`object`)return[];let{query:n,menuKey:r,menuItem:i,timestamp:a}=t,o=typeof r==`string`?r:i?.key,s=Number.isFinite(a)?a:0;return typeof o==`string`?[{menuKey:o,timestamp:s}]:typeof n!=`string`||!n.trim()?[]:[{query:n.slice(0,200),menuKey:null,timestamp:s}]}function u(t){let n=()=>(0,i.toValue)(t),r=()=>n().menuItems(),s=(0,i.computed)(()=>n().storageKey??`robot-search-history`),u=(0,i.computed)(()=>Math.min(100,Math.max(0,Math.trunc(n().maxHistory??10)))),d=(0,i.computed)(()=>Math.min(u.value,Math.max(0,Math.trunc(n().maxDisplayHistory??5)))),f=(0,i.ref)(!1),p=(0,i.ref)(``),m=(0,i.ref)(0),h=(0,i.ref)(),g=(0,i.ref)([]),_=(0,i.ref)(!1),ee=e.t(()=>{let e=n().isDark?.();return e===void 0?void 0:e?`dark`:`light`}),te=(0,i.computed)(()=>ee.value===`dark`),v=(0,i.computed)(()=>o(r())),y=(0,i.computed)(()=>{if(!p.value.trim())return[];let e=v.value,{search:t,matchMode:r}=n();if(!t)return c(e,p.value,r);let i=new Set;return t(p.value,e.entries.map(e=>e.item)).flatMap(t=>{let n=e.byKey.get(t.key);return!n||i.has(t.key)?[]:(i.add(t.key),[n])})}),b=(0,i.computed)(()=>{let e=[];for(let[t,n]of g.value.entries()){if(e.length>=d.value)break;let{menuKey:r,query:i,timestamp:a}=n,o=r===null?null:v.value.byKey.get(r),s=o?.label??i;o===void 0||s===void 0||e.push({item:{query:s,menuItem:o,timestamp:a},sourceIndex:t})}return e}),x=(0,i.computed)(()=>b.value.map(({item:e})=>e)),ne=(0,i.computed)(()=>y.value.length>0),S=(0,i.computed)(()=>!!p.value.trim()||x.value.length>0),C=(0,i.computed)(()=>p.value.trim()?y.value.length:x.value.length),w=(e,t)=>[`robot-result-item`,t&&`robot-history-item`,{"robot-result-item-selected":m.value===e}],T=(e,t)=>{if(!t)return[{text:e,matched:!1}];let r=n().matchMode===`tokens`?t.trim().split(/\s+/).filter(Boolean).sort((e,t)=>t.length-e.length):[t];if(!r.length)return[{text:e,matched:!1}];let i=RegExp(`(${r.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})`,`gi`);return e.split(i).filter(Boolean).map(e=>({text:e,matched:r.some(t=>e.toLocaleLowerCase()===t.toLocaleLowerCase())}))},re=e=>v.value.paths.get(e)??a(e),E=()=>{if(!(typeof localStorage>`u`))try{localStorage.setItem(s.value,JSON.stringify(g.value))}catch{}},D=e=>{if(!e.label.trim())return;let t=g.value.filter(t=>t.menuKey!==e.key);g.value=[{menuKey:e.key,timestamp:Date.now()},...t].slice(0,u.value),E()},O=()=>{if(g.value=[],!(typeof localStorage>`u`))try{let e=localStorage.getItem(s.value);if(e){let t=JSON.parse(e);if(!Array.isArray(t))return;g.value=t.flatMap(l).slice(0,u.value)}}catch{g.value=[]}},k=()=>{if(g.value=[],!(typeof localStorage>`u`))try{localStorage.removeItem(s.value)}catch{}},ie=e=>{let t=b.value[e];t&&(g.value.splice(t.sourceIndex,1),E(),m.value=Math.max(0,Math.min(m.value,x.value.length-1)))},A=null,j=0,M=!1,N=async()=>{!f.value&&typeof document<`u`&&typeof HTMLElement<`u`&&(A=document.activeElement instanceof HTMLElement?document.activeElement:null);let e=++j;f.value=!0,p.value=``,m.value=0,_.value=!1,await(0,i.nextTick)(),!M&&e===j&&f.value&&h.value?.focus()},P=()=>{let e=f.value,t=A;A=null;let n=++j;f.value=!1,p.value=``,m.value=0,_.value=!1,e&&(0,i.nextTick)(()=>{!M&&n===j&&t?.isConnected&&t.focus({preventScroll:!0})})},F=e=>{if(e.menuItem){let t=v.value.byKey.get(e.menuItem.key);if(!t)return;n().onSelect?.(t.key,!!t.children?.length),P()}else p.value=e.query,m.value=0},I=e=>{let t=v.value.byKey.get(e.key);t&&(D(t),n().onSelect?.(t.key,!!t.children?.length),P())},L=e=>_.value||!!(e&&(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)),R=e=>{if(L(e))return;m.value=Math.max(0,Math.min(m.value,C.value-1));let t=!p.value.trim()&&x.value.length>0,n=p.value.trim()&&y.value.length>0;if(t){let t=x.value[m.value];t&&(e?.preventDefault(),F(t))}else if(n){let t=y.value[m.value];t&&(e?.preventDefault(),I(t))}},z=e=>{L(e)||(e?.preventDefault(),m.value=Math.max(0,Math.min(m.value+1,C.value-1)))},B=e=>{L(e)||(e?.preventDefault(),m.value=Math.max(0,Math.min(m.value-1,C.value-1)))},ae=e=>{let t=h.value?.closest(`[role="dialog"]`);if(!t)return;let n=Array.from(t.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex]`)).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&!e.closest(`[hidden], [inert]`)),r=n[0],i=n[n.length-1],a=e.shiftKey?r:i;!a||document.activeElement!==a||(e.preventDefault(),(e.shiftKey?i:r)?.focus())},V=e=>{if(e.key===`Tab`&&!e.defaultPrevented&&!e.isComposing){ae(e);return}e.key!==`Escape`||L(e)||(e.preventDefault(),P())},H=e=>{e.key===`ArrowDown`?z(e):e.key===`ArrowUp`?B(e):e.key===`Enter`?R(e):V(e)};(0,i.watch)(p,()=>{m.value=0}),(0,i.watch)(C,e=>{m.value=Math.max(0,Math.min(m.value,e-1))}),(0,i.watch)(s,O);let U=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||_.value||(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),N())};return(0,i.onMounted)(()=>{O(),document.addEventListener(`keydown`,U)}),(0,i.onUnmounted)(()=>{M=!0,j++,A=null,document.removeEventListener(`keydown`,U)}),{showDialog:f,searchValue:p,selectedIndex:m,searchInputRef:h,isDark:te,filteredMenuItems:y,displayHistory:x,hasResults:ne,hasContent:S,getItemClasses:w,highlightMatch:T,formatMenuPath:re,clearHistory:k,removeHistoryItem:ie,openDialog:N,closeDialog:P,selectHistoryItem:F,selectItem:I,handleEnter:R,focusNext:z,focusPrev:B,handleInputKeydown:H,handleDialogKeydown:V,handleCompositionStart:()=>{_.value=!0},handleCompositionEnd:()=>{_.value=!1}}}const d=Object.freeze({"globalSearch.trigger":`搜索`,"globalSearch.dialog":`全局搜索`,"globalSearch.input":`搜索菜单`,"globalSearch.close":`关闭搜索`,"globalSearch.recent":`最近搜索`,"globalSearch.clearHistory":`清空历史`,"globalSearch.removeHistory":`删除此记录`,"globalSearch.noResults":`未找到 "{query}" 相关内容`,"globalSearch.select":`选择`,"globalSearch.navigate":`导航`,"globalSearch.closeHint":`关闭`,"globalSearch.resultCount":`共 {count} 项结果`,"globalSearch.historyCount":`{count} 条历史记录`,"globalSearch.placeholder":`搜索导航菜单...`,"globalSearch.empty":`输入关键词搜索菜单`,"globalSearch.group":`菜单导航`,"globalSearch.home":`首页`}),f=Object.freeze({"globalSearch.trigger":`Search`,"globalSearch.dialog":`Global search`,"globalSearch.input":`Search menus`,"globalSearch.close":`Close search`,"globalSearch.recent":`Recent searches`,"globalSearch.clearHistory":`Clear history`,"globalSearch.removeHistory":`Remove this record`,"globalSearch.noResults":`No results for "{query}"`,"globalSearch.select":`Select`,"globalSearch.navigate":`Navigate`,"globalSearch.closeHint":`Close`,"globalSearch.resultCount":`{count} results`,"globalSearch.historyCount":`{count} recent searches`,"globalSearch.placeholder":`Search navigation menus...`,"globalSearch.empty":`Type to search menus`,"globalSearch.group":`Navigation menus`,"globalSearch.home":`Home`}),p=()=>n.t(d,f),m={class:`robot-trigger-text`},h=[`aria-label`],g={class:`robot-search-header`},_=[`placeholder`,`aria-label`,`aria-expanded`,`aria-activedescendant`],ee=[`aria-label`],te={key:0,class:`robot-empty-state`},v={class:`robot-search-results`},y={class:`robot-result-group`},b={class:`robot-group-title`},x={class:`robot-group-count`},ne=[`title`,`aria-label`],S=[`aria-label`],C=[`id`,`aria-selected`,`data-option-index`,`onClick`,`onMouseenter`],w={key:1,class:`robot-item-icon robot-default-icon`},T={class:`robot-item-content`},re={class:`robot-item-label`},E={class:`robot-item-desc`},D=[`onClick`,`title`,`aria-label`],O={class:`robot-search-results`},k={key:0,class:`robot-empty-state`},ie={class:`robot-result-group`},A={class:`robot-group-title`},j={class:`robot-group-count`},M=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`title`,`onClick`,`onMouseenter`],N={key:1,class:`robot-item-icon robot-default-icon`},P={class:`robot-item-content`},F={class:`robot-item-label`},I={key:0,class:`robot-highlight`},L={class:`robot-item-desc`},R={key:2,class:`robot-item-badge`},z={class:`robot-search-footer`},B={class:`robot-footer-actions`},ae={class:`robot-action-item`},V={class:`robot-action-item`},H={class:`robot-action-item`},U={key:0,class:`robot-footer-info`},oe={key:0},se={key:1},W=(0,i.defineComponent)({name:`C_GlobalSearch`,__name:`index`,props:{options:{},placeholder:{},emptyText:{},resultGroupTitle:{}},setup(t,{expose:n}){let{t:a}=p(),o=t,{showDialog:s,searchValue:c,selectedIndex:l,searchInputRef:d,isDark:f,filteredMenuItems:W,displayHistory:G,hasResults:K,hasContent:q,getItemClasses:ce,highlightMatch:le,formatMenuPath:ue,clearHistory:de,removeHistoryItem:fe,openDialog:J,closeDialog:Y,selectHistoryItem:pe,selectItem:me,handleInputKeydown:he,handleDialogKeydown:ge,handleCompositionStart:_e,handleCompositionEnd:ve}=u(()=>o.options),ye=e.n(()=>f.value?`dark`:`light`),X=e=>e===``||e===`/`?a(`globalSearch.home`):ue(e),Z=`robot-search-options-${(0,i.useId)()}`,Q=e=>`${Z}-${e}`,be=(0,i.computed)(()=>(c.value.trim()?W.value.length:G.value.length)>0?Q(l.value):void 0),xe=(0,i.ref)(),Se=(0,i.ref)(),$=!1,Ce=async()=>{$||($=!0,await(0,i.nextTick)(),$=!1,s.value&&(c.value.trim()?W.value.length&&xe.value?.scrollTo({index:l.value}):Se.value?.querySelector(`[data-option-index="${l.value}"]`)?.scrollIntoView({block:`nearest`})))},we=e=>{let t=e.defaultPrevented;he(e),!t&&e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&Ce()};return(0,i.watch)([l,W,G,s],Ce,{flush:`post`}),n({openDialog:J,closeDialog:Y}),(e,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{class:`robot-search-palette`,style:(0,i.normalizeStyle)((0,i.unref)(ye))},[(0,i.createCommentVNode)(` 搜索触发按钮 `),(0,i.createElementVNode)(`button`,{type:`button`,class:(0,i.normalizeClass)([`robot-search-trigger`,{"trigger-dark":(0,i.unref)(f)}]),onClick:n[0]||=(...e)=>(0,i.unref)(J)&&(0,i.unref)(J)(...e)},[n[9]||=(0,i.createElementVNode)(`span`,{class:`i-mdi:search robot-trigger-icon`},null,-1),(0,i.createElementVNode)(`span`,m,(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.trigger`)),1),n[10]||=(0,i.createElementVNode)(`span`,{class:`robot-trigger-shortcut`},`Ctrl K`,-1)],2),(0,i.createCommentVNode)(` 搜索对话框 `),((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{to:`body`},[(0,i.createVNode)(i.Transition,{name:`robot-dialog`},{default:(0,i.withCtx)(()=>[(0,i.unref)(s)?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`robot-dialog-overlay`,style:(0,i.normalizeStyle)((0,i.unref)(ye)),onClick:n[7]||=(...e)=>(0,i.unref)(Y)&&(0,i.unref)(Y)(...e),onKeydown:n[8]||=(...e)=>(0,i.unref)(ge)&&(0,i.unref)(ge)(...e)},[(0,i.createElementVNode)(`div`,{class:(0,i.normalizeClass)([`robot-dialog-container`,{"dialog-dark":(0,i.unref)(f)}]),role:`dialog`,"aria-modal":`true`,"aria-label":(0,i.unref)(a)(`globalSearch.dialog`),onClick:n[6]||=(0,i.withModifiers)(()=>{},[`stop`])},[(0,i.createCommentVNode)(` 搜索头部 `),(0,i.createElementVNode)(`div`,g,[n[12]||=(0,i.createElementVNode)(`div`,{class:`i-mdi:magnify robot-search-icon`},null,-1),(0,i.withDirectives)((0,i.createElementVNode)(`input`,{ref_key:`searchInputRef`,ref:d,"onUpdate:modelValue":n[1]||=e=>(0,i.isRef)(c)?c.value=e:null,type:`text`,placeholder:t.placeholder??(0,i.unref)(a)(`globalSearch.placeholder`),class:`robot-search-input`,role:`combobox`,"aria-label":(0,i.unref)(a)(`globalSearch.input`),"aria-autocomplete":`list`,"aria-expanded":(0,i.unref)(s),"aria-controls":Z,"aria-activedescendant":be.value,onKeydown:we,onCompositionstart:n[2]||=(...e)=>(0,i.unref)(_e)&&(0,i.unref)(_e)(...e),onCompositionend:n[3]||=(...e)=>(0,i.unref)(ve)&&(0,i.unref)(ve)(...e)},null,40,_),[[i.vModelText,(0,i.unref)(c)]]),(0,i.createElementVNode)(`button`,{class:`robot-close-btn`,"aria-label":(0,i.unref)(a)(`globalSearch.close`),onClick:n[4]||=(...e)=>(0,i.unref)(Y)&&(0,i.unref)(Y)(...e)},[...n[11]||=[(0,i.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]],8,ee)]),(0,i.createCommentVNode)(` 搜索内容 `),(0,i.createElementVNode)(`div`,{class:(0,i.normalizeClass)([`robot-search-content`,{"robot-search-content--virtual":(0,i.unref)(c).trim()&&(0,i.unref)(K)}])},[(0,i.createCommentVNode)(` 空状态 `),(0,i.unref)(q)?!(0,i.unref)(c).trim()&&(0,i.unref)(G).length>0?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:1},[(0,i.createCommentVNode)(` 搜索历史 `),(0,i.createElementVNode)(`div`,v,[(0,i.createElementVNode)(`div`,y,[(0,i.createElementVNode)(`div`,b,[n[15]||=(0,i.createElementVNode)(`div`,{class:`i-mdi:clock-time-four-outline robot-group-icon`},null,-1),(0,i.createTextVNode)(` `+(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.recent`))+` `,1),(0,i.createElementVNode)(`span`,x,(0,i.toDisplayString)((0,i.unref)(G).length),1),(0,i.createElementVNode)(`button`,{class:`robot-clear-history`,onClick:n[5]||=(...e)=>(0,i.unref)(de)&&(0,i.unref)(de)(...e),title:(0,i.unref)(a)(`globalSearch.clearHistory`),"aria-label":(0,i.unref)(a)(`globalSearch.clearHistory`)},[...n[14]||=[(0,i.createElementVNode)(`div`,{class:`i-mdi:delete-outline`},null,-1)]],8,ne)]),(0,i.createElementVNode)(`div`,{id:Z,ref_key:`historyItemsRef`,ref:Se,class:`robot-group-items`,role:`listbox`,"aria-label":(0,i.unref)(a)(`globalSearch.recent`)},[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(G),(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:`history-${t}`,id:Q(t),class:(0,i.normalizeClass)((0,i.unref)(ce)(t,!0)),role:`option`,"aria-selected":(0,i.unref)(l)===t,"data-option-index":t,onClick:t=>(0,i.unref)(pe)(e),onMouseenter:e=>l.value=t},[e.menuItem?.icon?((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(e.menuItem.icon),{key:0,class:`robot-item-icon`})):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,w,[...n[16]||=[(0,i.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,i.createElementVNode)(`div`,T,[(0,i.createElementVNode)(`div`,re,(0,i.toDisplayString)(e.query),1),(0,i.createElementVNode)(`div`,E,(0,i.toDisplayString)(X(e.menuItem?.key||``)),1)]),(0,i.createElementVNode)(`button`,{class:`robot-history-delete`,onClick:(0,i.withModifiers)(e=>(0,i.unref)(fe)(t),[`stop`]),title:(0,i.unref)(a)(`globalSearch.removeHistory`),"aria-label":(0,i.unref)(a)(`globalSearch.removeHistory`)},[...n[17]||=[(0,i.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]],8,D)],42,C))),128))],8,S)])])],64)):(0,i.unref)(c).trim()?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:2},[(0,i.createCommentVNode)(` 搜索结果 `),(0,i.createElementVNode)(`div`,O,[(0,i.createCommentVNode)(` 无结果状态 `),(0,i.unref)(K)?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:1},[(0,i.createCommentVNode)(` 搜索结果列表 `),(0,i.createElementVNode)(`div`,ie,[(0,i.createElementVNode)(`div`,A,[n[19]||=(0,i.createElementVNode)(`div`,{class:`i-mdi:menu robot-group-icon`},null,-1),(0,i.createTextVNode)(` `+(0,i.toDisplayString)(t.resultGroupTitle??(0,i.unref)(a)(`globalSearch.group`))+` `,1),(0,i.createElementVNode)(`span`,j,(0,i.toDisplayString)((0,i.unref)(W).length),1)]),(0,i.createVNode)((0,i.unref)(r.t),{id:Z,ref_key:`resultListRef`,ref:xe,class:`robot-group-items robot-virtual-items`,role:`listbox`,"aria-label":t.resultGroupTitle??(0,i.unref)(a)(`globalSearch.group`),items:(0,i.unref)(W),"item-size":64,style:(0,i.normalizeStyle)({height:`${Math.min((0,i.unref)(W).length*64,336)}px`})},{default:(0,i.withCtx)(({item:e,index:t})=>[(0,i.createElementVNode)(`div`,{id:Q(t),class:(0,i.normalizeClass)((0,i.unref)(ce)(t,!1)),role:`option`,"aria-selected":(0,i.unref)(l)===t,"aria-posinset":t+1,"aria-setsize":(0,i.unref)(W).length,title:`${e.label} · ${X(e.key)}`,onClick:t=>(0,i.unref)(me)(e),onMouseenter:e=>l.value=t},[e.icon?((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(e.icon),{key:0,class:`robot-item-icon`})):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,N,[...n[20]||=[(0,i.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,i.createElementVNode)(`div`,P,[(0,i.createElementVNode)(`div`,F,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(le)(e.label,(0,i.unref)(c)),(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:t},[e.matched?((0,i.openBlock)(),(0,i.createElementBlock)(`mark`,I,(0,i.toDisplayString)(e.text),1)):((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:1},[(0,i.createTextVNode)((0,i.toDisplayString)(e.text),1)],64))],64))),128))]),(0,i.createElementVNode)(`div`,L,(0,i.toDisplayString)(X(e.key)),1)]),e.children?.length?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,R,(0,i.toDisplayString)(e.children.length),1)):(0,i.createCommentVNode)(`v-if`,!0)],42,M)]),_:1},8,[`aria-label`,`items`,`style`])])],2112)):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,k,[n[18]||=(0,i.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,i.createElementVNode)(`p`,null,(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.noResults`,{query:(0,i.unref)(c)})),1)]))])],64)):(0,i.createCommentVNode)(`v-if`,!0):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,te,[n[13]||=(0,i.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,i.createElementVNode)(`p`,null,(0,i.toDisplayString)(t.emptyText??(0,i.unref)(a)(`globalSearch.empty`)),1)]))],2),(0,i.createCommentVNode)(` 搜索底部 `),(0,i.createElementVNode)(`div`,z,[(0,i.createElementVNode)(`div`,B,[(0,i.createElementVNode)(`div`,ae,[n[21]||=(0,i.createElementVNode)(`kbd`,null,`↵`,-1),(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.select`)),1)]),(0,i.createElementVNode)(`div`,V,[n[22]||=(0,i.createElementVNode)(`kbd`,null,`↑↓`,-1),(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.navigate`)),1)]),(0,i.createElementVNode)(`div`,H,[n[23]||=(0,i.createElementVNode)(`kbd`,null,`esc`,-1),(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.closeHint`)),1)])]),(0,i.unref)(q)?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,U,[(0,i.unref)(c).trim()&&(0,i.unref)(K)?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,oe,(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.resultCount`,{count:(0,i.unref)(W).length})),1)):!(0,i.unref)(c).trim()&&(0,i.unref)(G).length>0?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,se,(0,i.toDisplayString)((0,i.unref)(a)(`globalSearch.historyCount`,{count:(0,i.unref)(G).length})),1)):(0,i.createCommentVNode)(`v-if`,!0)])):(0,i.createCommentVNode)(`v-if`,!0)])],10,h)],36)):(0,i.createCommentVNode)(`v-if`,!0)]),_:1})]))],4))}});var G=t.t(W,[[`__scopeId`,`data-v-18b636a8`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return G}});
1
+ require(`./chunk.cjs`);const e=require(`./useDataResource.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`),r=require(`./useScopedComponentLocale.cjs`),i=require(`./virtualList.cjs`);let a=require(`vue`);function o(e,t){let n=new Set;return e.flatMap(e=>{let{key:r,title:i,minChars:a,search:o}=e;return!r||n.has(r)?[]:(n.add(r),t<(a!==void 0&&Number.isSafeInteger(a)?Math.max(a,1):1)?[]:[{key:r,title:i,search:o.bind(e)}])})}function s(e){if(!Array.isArray(e))throw TypeError(`Command source must return an array`);let t=[],n=new Set;for(let r of e)if(!(!r||typeof r.label!=`string`||!r.label.trim())&&!(typeof r.key!=`string`&&!Number.isFinite(r.key))&&!n.has(r.key)&&(n.add(r.key),t.push(r),t.length>=20))break;return t}async function c({sources:e,query:t,scope:n},r){let i=[],a=0;async function o(e){let{key:i,title:a}=e;try{let o=await e.search(t,{signal:r,scope:n});return r.throwIfAborted(),{key:i,title:a,items:s(o)}}catch{return{key:i,title:a,items:[],failed:!0}}}async function c(){if(r.aborted||a>=e.length)return;let t=a++;return i[t]=await o(e[t]),c()}return await Promise.all(Array.from({length:Math.min(3,e.length)},c)),i}function l(t,n){let r=(0,a.computed)(()=>!!t()?.sources.length),i=(0,a.computed)(()=>{let e=n().trim(),r=t();if(!e||!r)return;let i=o(r.sources,e.length);return i.length?{query:e,scope:r.scope,sources:i}:void 0}),s=(0,a.shallowRef)(null),l=(0,a.shallowRef)(!1),u,d,f=0,p=e.t({key:s,load:({signal:e})=>c(u,e)});function m(e,t){clearTimeout(d),s.value=null,l.value=e!==void 0,e&&(d=setTimeout(()=>{u=e,s.value=++f,l.value=!1},t))}(0,a.watch)(i,e=>{let n=t()?.debounce;m(e,n!==void 0&&Number.isFinite(n)?Math.max(0,n):200)},{immediate:!0,flush:`sync`}),(0,a.onScopeDispose)(()=>clearTimeout(d));let h=(0,a.computed)(()=>p.data.value??[]);return{enabled:r,groups:h,loading:(0,a.computed)(()=>l.value||p.loading.value),failed:(0,a.computed)(()=>h.value.some(e=>e.failed)),retry:()=>{!l.value&&!p.loading.value&&m(i.value,0)}}}const u=e=>e.replace(/^\//,``).replace(/\//g,` > `)||`首页`;function d(e){let t=new Map,n=new Map;return{entries:e.map(e=>{let{key:r}=e,i=u(r);t.set(r,i),n.set(r,e);let a=e.label.toLowerCase();return{item:e,label:a,path:i.toLowerCase(),normalizedLabel:f(a),text:f([a,i,e.breadcrumb??``,...e.keywords??[]].join(` `))}}),paths:t,byKey:n}}function f(e){return e.normalize(`NFKC`).toLowerCase().trim().replace(/\s+/g,` `)}function p(e,t,n=`literal`){if(!t.trim())return[];if(n===`tokens`){let n=f(t),r=n.split(` `);return e.entries.filter(e=>r.every(t=>e.text.includes(t))).map(e=>({item:e.item,rank:e.normalizedLabel===n?0:e.normalizedLabel.startsWith(n)?1:e.normalizedLabel.includes(n)?2:3})).sort((e,t)=>e.rank-t.rank).map(e=>e.item)}let r=t.toLowerCase();return e.entries.filter(e=>e.label.includes(r)||e.path.includes(r)).map(e=>e.item)}function m(e){let t=typeof e==`string`?{query:e}:e;if(!t||typeof t!=`object`)return[];let{query:n,menuKey:r,menuItem:i,timestamp:a}=t,o=typeof r==`string`?r:i?.key,s=Number.isFinite(a)?a:0;return typeof o==`string`?[{menuKey:o,timestamp:s}]:typeof n!=`string`||!n.trim()?[]:[{query:n.slice(0,200),menuKey:null,timestamp:s}]}function h(e,n){let r=()=>(0,a.toValue)(e),i=()=>r().menuItems(),o=(0,a.computed)(()=>r().storageKey??`robot-search-history`),s=(0,a.computed)(()=>Math.min(100,Math.max(0,Math.trunc(r().maxHistory??10)))),c=(0,a.computed)(()=>Math.min(s.value,Math.max(0,Math.trunc(r().maxDisplayHistory??5)))),f=(0,a.ref)(!1),h=(0,a.ref)(``),g=(0,a.ref)(0),_=(0,a.ref)(),v=(0,a.ref)([]),y=(0,a.ref)(!1),ee=t.t(()=>{let e=r().isDark?.();return e===void 0?void 0:e?`dark`:`light`}),te=(0,a.computed)(()=>ee.value===`dark`),b=(0,a.computed)(()=>d(i())),x=(0,a.computed)(()=>{if(!h.value.trim())return[];let e=b.value,{search:t,matchMode:n}=r();if(!t)return p(e,h.value,n);let i=new Set;return t(h.value,e.entries.map(e=>e.item)).flatMap(t=>{let n=e.byKey.get(t.key);return!n||i.has(t.key)?[]:(i.add(t.key),[n])})}),S=(0,a.computed)(()=>{let e=[];for(let[t,n]of v.value.entries()){if(e.length>=c.value)break;let{menuKey:r,query:i,timestamp:a}=n,o=r===null?null:b.value.byKey.get(r),s=o?.label??i;o===void 0||s===void 0||e.push({item:{query:s,menuItem:o,timestamp:a},sourceIndex:t})}return e}),C=(0,a.computed)(()=>S.value.map(({item:e})=>e)),w=l(()=>r().commands,()=>f.value&&!y.value?h.value:``),T=(0,a.computed)(()=>{let e=x.value.length;return w.groups.value.map(t=>{let n={...t,start:e};return e+=t.items.length,n})}),E=(0,a.computed)(()=>T.value.flatMap(e=>e.items.map(t=>({source:e.key,item:t})))),D=(0,a.computed)(()=>x.value.length+E.value.length),ne=(0,a.computed)(()=>D.value>0),re=(0,a.computed)(()=>!!h.value.trim()||C.value.length>0),O=(0,a.computed)(()=>h.value.trim()?D.value:C.value.length),ie=(e,t)=>[`robot-result-item`,t&&`robot-history-item`,{"robot-result-item-selected":g.value===e}],ae=(e,t)=>{if(!t)return[{text:e,matched:!1}];let n=r().matchMode===`tokens`?t.trim().split(/\s+/).filter(Boolean).sort((e,t)=>t.length-e.length):[t];if(!n.length)return[{text:e,matched:!1}];let i=RegExp(`(${n.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})`,`gi`);return e.split(i).filter(Boolean).map(e=>({text:e,matched:n.some(t=>e.toLocaleLowerCase()===t.toLocaleLowerCase())}))},oe=e=>b.value.paths.get(e)??u(e),se=()=>{if(!(typeof localStorage>`u`))try{localStorage.setItem(o.value,JSON.stringify(v.value))}catch{}},ce=e=>{if(!e.label.trim())return;let t=v.value.filter(t=>t.menuKey!==e.key);v.value=[{menuKey:e.key,timestamp:Date.now()},...t].slice(0,s.value),se()},le=()=>{if(v.value=[],!(typeof localStorage>`u`))try{let e=localStorage.getItem(o.value);if(e){let t=JSON.parse(e);if(!Array.isArray(t))return;v.value=t.flatMap(m).slice(0,s.value)}}catch{v.value=[]}},ue=()=>{if(v.value=[],!(typeof localStorage>`u`))try{localStorage.removeItem(o.value)}catch{}},de=e=>{let t=S.value[e];t&&(v.value.splice(t.sourceIndex,1),se(),g.value=Math.max(0,Math.min(g.value,C.value.length-1)))},k=null,A=0,j=!1,M=async()=>{!f.value&&typeof document<`u`&&typeof HTMLElement<`u`&&(k=document.activeElement instanceof HTMLElement?document.activeElement:null);let e=++A;f.value=!0,h.value=``,g.value=0,y.value=!1,await(0,a.nextTick)(),!j&&e===A&&f.value&&_.value?.focus()},N=()=>{let e=f.value,t=k;k=null;let n=++A;f.value=!1,h.value=``,g.value=0,y.value=!1,e&&(0,a.nextTick)(()=>{!j&&n===A&&t?.isConnected&&t.focus({preventScroll:!0})})},P=e=>{if(e.menuItem){let t=b.value.byKey.get(e.menuItem.key);if(!t)return;r().onSelect?.(t.key,!!t.children?.length),N()}else h.value=e.query,g.value=0},F=e=>{let t=b.value.byKey.get(e.key);t&&(ce(t),r().onSelect?.(t.key,!!t.children?.length),N())},I=(e,t)=>{if(!f.value||!E.value.some(n=>n.source===e&&n.item===t))return;let i=r().commands?.onSelect;N(),i?.(e,t),n?.(e,t)},L=e=>y.value||!!(e&&(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)),R=e=>{if(L(e))return;if(g.value=Math.max(0,Math.min(g.value,O.value-1)),!h.value.trim()&&C.value.length>0){let t=C.value[g.value];t&&(e?.preventDefault(),P(t));return}let t=x.value[g.value];if(t){e?.preventDefault(),F(t);return}let n=E.value[g.value-x.value.length];n&&(e?.preventDefault(),I(n.source,n.item))},z=e=>{L(e)||(e?.preventDefault(),g.value=Math.max(0,Math.min(g.value+1,O.value-1)))},B=e=>{L(e)||(e?.preventDefault(),g.value=Math.max(0,Math.min(g.value-1,O.value-1)))},fe=e=>{let t=_.value?.closest(`[role="dialog"]`);if(!t)return;let n=Array.from(t.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex]`)).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&!e.closest(`[hidden], [inert]`)),r=n[0],i=n[n.length-1],a=e.shiftKey?r:i;!a||document.activeElement!==a||(e.preventDefault(),(e.shiftKey?i:r)?.focus())},V=e=>{if(e.key===`Tab`&&!e.defaultPrevented&&!e.isComposing){fe(e);return}e.key!==`Escape`||L(e)||(e.preventDefault(),N())},pe=e=>{e.key===`ArrowDown`?z(e):e.key===`ArrowUp`?B(e):e.key===`Enter`?R(e):V(e)};(0,a.watch)(h,()=>{g.value=0}),(0,a.watch)(O,e=>{g.value=Math.max(0,Math.min(g.value,e-1))}),(0,a.watch)(o,le);let H=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||y.value||(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),M())};return(0,a.onMounted)(()=>{le(),document.addEventListener(`keydown`,H)}),(0,a.onDeactivated)(N),(0,a.onUnmounted)(()=>{j=!0,A++,k=null,document.removeEventListener(`keydown`,H)}),{showDialog:f,searchValue:h,selectedIndex:g,searchInputRef:_,isDark:te,filteredMenuItems:x,commandGroups:T,commandEnabled:w.enabled,commandLoading:w.loading,commandFailed:w.failed,retryCommands:w.retry,selectCommand:I,resultCount:D,displayHistory:C,hasResults:ne,hasContent:re,getItemClasses:ie,highlightMatch:ae,formatMenuPath:oe,clearHistory:ue,removeHistoryItem:de,openDialog:M,closeDialog:N,selectHistoryItem:P,selectItem:F,handleEnter:R,focusNext:z,focusPrev:B,handleInputKeydown:pe,handleDialogKeydown:V,handleCompositionStart:()=>{y.value=!0},handleCompositionEnd:()=>{y.value=!1}}}const g=Object.freeze({"globalSearch.trigger":`搜索`,"globalSearch.dialog":`全局搜索`,"globalSearch.input":`搜索菜单`,"globalSearch.close":`关闭搜索`,"globalSearch.recent":`最近搜索`,"globalSearch.clearHistory":`清空历史`,"globalSearch.removeHistory":`删除此记录`,"globalSearch.noResults":`未找到 "{query}" 相关内容`,"globalSearch.select":`选择`,"globalSearch.navigate":`导航`,"globalSearch.closeHint":`关闭`,"globalSearch.resultCount":`共 {count} 项结果`,"globalSearch.historyCount":`{count} 条历史记录`,"globalSearch.placeholder":`搜索导航菜单...`,"globalSearch.empty":`输入关键词搜索菜单`,"globalSearch.group":`菜单导航`,"globalSearch.home":`首页`,"globalSearch.commandInput":`搜索菜单或业务记录`,"globalSearch.commandPlaceholder":`搜索菜单、业务记录和快捷操作…`,"globalSearch.commandEmpty":`输入关键词查找菜单、业务记录和快捷操作`,"globalSearch.commandResults":`全局搜索结果`,"globalSearch.commandLoading":`正在搜索其他来源…`,"globalSearch.commandFailed":`部分搜索来源加载失败`,"globalSearch.commandRetry":`重试`}),_=Object.freeze({"globalSearch.trigger":`Search`,"globalSearch.dialog":`Global search`,"globalSearch.input":`Search menus`,"globalSearch.close":`Close search`,"globalSearch.recent":`Recent searches`,"globalSearch.clearHistory":`Clear history`,"globalSearch.removeHistory":`Remove this record`,"globalSearch.noResults":`No results for "{query}"`,"globalSearch.select":`Select`,"globalSearch.navigate":`Navigate`,"globalSearch.closeHint":`Close`,"globalSearch.resultCount":`{count} results`,"globalSearch.historyCount":`{count} recent searches`,"globalSearch.placeholder":`Search navigation menus...`,"globalSearch.empty":`Type to search menus`,"globalSearch.group":`Navigation menus`,"globalSearch.home":`Home`,"globalSearch.commandInput":`Search menus or records`,"globalSearch.commandPlaceholder":`Search menus, records and actions…`,"globalSearch.commandEmpty":`Type to search menus, records and actions`,"globalSearch.commandResults":`Global search results`,"globalSearch.commandLoading":`Searching additional sources…`,"globalSearch.commandFailed":`Some search sources failed to load`,"globalSearch.commandRetry":`Retry`}),v=()=>r.t(g,_),y={class:`robot-trigger-text`},ee=[`aria-label`],te={class:`robot-search-header`},b=[`placeholder`,`aria-label`,`aria-expanded`,`aria-controls`,`aria-activedescendant`],x=[`aria-label`],S={key:0,class:`robot-empty-state`},C={class:`robot-search-results`},w={class:`robot-result-group`},T={class:`robot-group-title`},E={class:`robot-group-count`},D=[`title`,`aria-label`],ne=[`aria-label`],re=[`id`,`aria-selected`,`data-option-index`,`onClick`,`onMouseenter`],O={key:1,class:`robot-item-icon robot-default-icon`},ie={class:`robot-item-content`},ae={class:`robot-item-label`},oe={class:`robot-item-desc`},se=[`onClick`,`title`,`aria-label`],ce={class:`robot-search-results`},le={key:0,class:`robot-command-status`,role:`status`},ue={key:1,class:`robot-command-status`,role:`status`},de={key:2,class:`robot-empty-state`},k=[`id`,`role`,`aria-label`],A={key:0,class:`robot-result-group`},j={class:`robot-group-title`},M={class:`robot-group-count`},N=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`title`,`onClick`,`onMouseenter`],P={key:1,class:`robot-item-icon robot-default-icon`},F={class:`robot-item-content`},I={class:`robot-item-label`},L={key:0,class:`robot-highlight`},R={class:`robot-item-desc`},z={key:2,class:`robot-item-badge`},B=[`aria-label`],fe={class:`robot-group-title`,"aria-hidden":`true`},V={class:`robot-group-count`},pe=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`data-command-index`,`onClick`,`onMouseenter`],H={key:1,class:`robot-item-icon robot-default-icon`},me={class:`robot-item-content`},he={class:`robot-item-label`},ge={key:0,class:`robot-item-desc`},_e={class:`robot-search-footer`},ve={class:`robot-footer-actions`},ye={class:`robot-action-item`},be={class:`robot-action-item`},xe={class:`robot-action-item`},Se={key:0,class:`robot-footer-info`},Ce={key:0},we={key:1},U=(0,a.defineComponent)({name:`C_GlobalSearch`,__name:`index`,props:{options:{},placeholder:{},emptyText:{},resultGroupTitle:{}},emits:[`command-select`],setup(e,{expose:n,emit:r}){let{t:o}=v(),s=e,c=r,{showDialog:l,searchValue:u,selectedIndex:d,searchInputRef:f,isDark:p,filteredMenuItems:m,commandGroups:g,commandEnabled:_,commandLoading:U,commandFailed:W,retryCommands:Te,selectCommand:Ee,resultCount:G,displayHistory:K,hasResults:q,hasContent:De,getItemClasses:J,highlightMatch:Oe,formatMenuPath:ke,clearHistory:Ae,removeHistoryItem:je,openDialog:Y,closeDialog:X,selectHistoryItem:Me,selectItem:Ne,handleInputKeydown:Pe,handleDialogKeydown:Fe,handleCompositionStart:Ie,handleCompositionEnd:Le}=h(()=>s.options,(e,t)=>c(`command-select`,e,t)),Re=t.n(()=>p.value?`dark`:`light`);function ze(){Te(),f.value?.focus()}let Be=e=>e===``||e===`/`?o(`globalSearch.home`):ke(e),Z=`robot-search-options-${(0,a.useId)()}`,Q=e=>`${Z}-${e}`,Ve=(0,a.computed)(()=>(u.value.trim()?G.value:K.value.length)>0?Q(d.value):void 0),He=(0,a.ref)(),Ue=(0,a.ref)(),We=(0,a.ref)(),$=!1;function Ge(e){if(e>=m.value.length){Ue.value?.querySelector(`[data-command-index="${e}"]`)?.scrollIntoView({block:`nearest`});return}He.value?.scrollTo({index:e}),_.value&&Ue.value?.querySelector(`.robot-virtual-items`)?.scrollIntoView({block:`nearest`})}let Ke=async()=>{$||($=!0,await(0,a.nextTick)(),$=!1,l.value&&(u.value.trim()?Ge(d.value):We.value?.querySelector(`[data-option-index="${d.value}"]`)?.scrollIntoView({block:`nearest`})))},qe=e=>{let t=e.defaultPrevented;Pe(e),!t&&e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&Ke()};return(0,a.watch)([d,m,g,K,l],Ke,{flush:`post`}),n({openDialog:Y,closeDialog:X}),(t,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{class:`robot-search-palette`,style:(0,a.normalizeStyle)((0,a.unref)(Re))},[(0,a.createCommentVNode)(` 搜索触发按钮 `),(0,a.createElementVNode)(`button`,{type:`button`,class:(0,a.normalizeClass)([`robot-search-trigger`,{"trigger-dark":(0,a.unref)(p)}]),onClick:n[0]||=(...e)=>(0,a.unref)(Y)&&(0,a.unref)(Y)(...e)},[n[9]||=(0,a.createElementVNode)(`span`,{class:`i-mdi:search robot-trigger-icon`},null,-1),(0,a.createElementVNode)(`span`,y,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.trigger`)),1),n[10]||=(0,a.createElementVNode)(`span`,{class:`robot-trigger-shortcut`},`Ctrl K`,-1)],2),(0,a.createCommentVNode)(` 搜索对话框 `),((0,a.openBlock)(),(0,a.createBlock)(a.Teleport,{to:`body`},[(0,a.createVNode)(a.Transition,{name:`robot-dialog`},{default:(0,a.withCtx)(()=>[(0,a.unref)(l)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,class:`robot-dialog-overlay`,style:(0,a.normalizeStyle)((0,a.unref)(Re)),onClick:n[7]||=(...e)=>(0,a.unref)(X)&&(0,a.unref)(X)(...e),onKeydown:n[8]||=(...e)=>(0,a.unref)(Fe)&&(0,a.unref)(Fe)(...e)},[(0,a.createElementVNode)(`div`,{class:(0,a.normalizeClass)([`robot-dialog-container`,{"dialog-dark":(0,a.unref)(p)}]),role:`dialog`,"aria-modal":`true`,"aria-label":(0,a.unref)(o)(`globalSearch.dialog`),onClick:n[6]||=(0,a.withModifiers)(()=>{},[`stop`])},[(0,a.createCommentVNode)(` 搜索头部 `),(0,a.createElementVNode)(`div`,te,[n[12]||=(0,a.createElementVNode)(`div`,{class:`i-mdi:magnify robot-search-icon`},null,-1),(0,a.withDirectives)((0,a.createElementVNode)(`input`,{ref_key:`searchInputRef`,ref:f,"onUpdate:modelValue":n[1]||=e=>(0,a.isRef)(u)?u.value=e:null,type:`text`,placeholder:e.placeholder??(0,a.unref)(o)((0,a.unref)(_)?`globalSearch.commandPlaceholder`:`globalSearch.placeholder`),class:`robot-search-input`,role:`combobox`,"aria-label":(0,a.unref)(o)((0,a.unref)(_)?`globalSearch.commandInput`:`globalSearch.input`),"aria-autocomplete":`list`,"aria-expanded":(0,a.unref)(l),"aria-controls":Ve.value?Z:void 0,"aria-activedescendant":Ve.value,onKeydown:qe,onCompositionstart:n[2]||=(...e)=>(0,a.unref)(Ie)&&(0,a.unref)(Ie)(...e),onCompositionend:n[3]||=(...e)=>(0,a.unref)(Le)&&(0,a.unref)(Le)(...e)},null,40,b),[[a.vModelText,(0,a.unref)(u)]]),(0,a.createElementVNode)(`button`,{class:`robot-close-btn`,"aria-label":(0,a.unref)(o)(`globalSearch.close`),onClick:n[4]||=(...e)=>(0,a.unref)(X)&&(0,a.unref)(X)(...e)},[...n[11]||=[(0,a.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]],8,x)]),(0,a.createCommentVNode)(` 搜索内容 `),(0,a.createElementVNode)(`div`,{ref_key:`searchContentRef`,ref:Ue,class:(0,a.normalizeClass)([`robot-search-content`,{"robot-search-content--virtual":!(0,a.unref)(_)&&(0,a.unref)(u).trim()&&(0,a.unref)(q)}])},[(0,a.createCommentVNode)(` 空状态 `),(0,a.unref)(De)?!(0,a.unref)(u).trim()&&(0,a.unref)(K).length>0?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[(0,a.createCommentVNode)(` 搜索历史 `),(0,a.createElementVNode)(`div`,C,[(0,a.createElementVNode)(`div`,w,[(0,a.createElementVNode)(`div`,T,[n[15]||=(0,a.createElementVNode)(`div`,{class:`i-mdi:clock-time-four-outline robot-group-icon`},null,-1),(0,a.createTextVNode)(` `+(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.recent`))+` `,1),(0,a.createElementVNode)(`span`,E,(0,a.toDisplayString)((0,a.unref)(K).length),1),(0,a.createElementVNode)(`button`,{class:`robot-clear-history`,onClick:n[5]||=(...e)=>(0,a.unref)(Ae)&&(0,a.unref)(Ae)(...e),title:(0,a.unref)(o)(`globalSearch.clearHistory`),"aria-label":(0,a.unref)(o)(`globalSearch.clearHistory`)},[...n[14]||=[(0,a.createElementVNode)(`div`,{class:`i-mdi:delete-outline`},null,-1)]],8,D)]),(0,a.createElementVNode)(`div`,{id:Z,ref_key:`historyItemsRef`,ref:We,class:`robot-group-items`,role:`listbox`,"aria-label":(0,a.unref)(o)(`globalSearch.recent`)},[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(K),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`history-${t}`,id:Q(t),class:(0,a.normalizeClass)((0,a.unref)(J)(t,!0)),role:`option`,"aria-selected":(0,a.unref)(d)===t,"data-option-index":t,onClick:t=>(0,a.unref)(Me)(e),onMouseenter:e=>d.value=t},[e.menuItem?.icon?((0,a.openBlock)(),(0,a.createBlock)((0,a.resolveDynamicComponent)(e.menuItem.icon),{key:0,class:`robot-item-icon`})):((0,a.openBlock)(),(0,a.createElementBlock)(`div`,O,[...n[16]||=[(0,a.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,a.createElementVNode)(`div`,ie,[(0,a.createElementVNode)(`div`,ae,(0,a.toDisplayString)(e.query),1),(0,a.createElementVNode)(`div`,oe,(0,a.toDisplayString)(Be(e.menuItem?.key||``)),1)]),(0,a.createElementVNode)(`button`,{class:`robot-history-delete`,onClick:(0,a.withModifiers)(e=>(0,a.unref)(je)(t),[`stop`]),title:(0,a.unref)(o)(`globalSearch.removeHistory`),"aria-label":(0,a.unref)(o)(`globalSearch.removeHistory`)},[...n[17]||=[(0,a.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]],8,se)],42,re))),128))],8,ne)])])],64)):(0,a.unref)(u).trim()?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createCommentVNode)(` 搜索结果 `),(0,a.createElementVNode)(`div`,ce,[(0,a.unref)(U)?((0,a.openBlock)(),(0,a.createElementBlock)(`p`,le,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.commandLoading`)),1)):(0,a.createCommentVNode)(`v-if`,!0),(0,a.unref)(W)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,ue,[(0,a.createTextVNode)((0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.commandFailed`))+` `,1),(0,a.createElementVNode)(`button`,{type:`button`,onClick:ze},(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.commandRetry`)),1)])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` 无结果状态 `),!(0,a.unref)(q)&&!(0,a.unref)(U)&&!(0,a.unref)(W)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,de,[n[18]||=(0,a.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,a.createElementVNode)(`p`,null,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.noResults`,{query:(0,a.unref)(u)})),1)])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.unref)(q)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:3,id:(0,a.unref)(_)?Z:void 0,role:(0,a.unref)(_)?`listbox`:void 0,"aria-label":(0,a.unref)(_)?(0,a.unref)(o)(`globalSearch.commandResults`):void 0},[(0,a.unref)(m).length?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,A,[(0,a.createElementVNode)(`div`,j,[n[19]||=(0,a.createElementVNode)(`div`,{class:`i-mdi:menu robot-group-icon`},null,-1),(0,a.createTextVNode)(` `+(0,a.toDisplayString)(e.resultGroupTitle??(0,a.unref)(o)(`globalSearch.group`))+` `,1),(0,a.createElementVNode)(`span`,M,(0,a.toDisplayString)((0,a.unref)(m).length),1)]),(0,a.createVNode)((0,a.unref)(i.t),{id:(0,a.unref)(_)?void 0:Z,ref_key:`resultListRef`,ref:He,class:`robot-group-items robot-virtual-items`,role:(0,a.unref)(_)?`group`:`listbox`,"aria-label":e.resultGroupTitle??(0,a.unref)(o)(`globalSearch.group`),items:(0,a.unref)(m),"item-size":64,style:(0,a.normalizeStyle)({height:`${Math.min((0,a.unref)(m).length*64,336)}px`})},{default:(0,a.withCtx)(({item:e,index:t})=>[(0,a.createElementVNode)(`div`,{id:Q(t),class:(0,a.normalizeClass)((0,a.unref)(J)(t,!1)),role:`option`,"aria-selected":(0,a.unref)(d)===t,"aria-posinset":t+1,"aria-setsize":(0,a.unref)(G),title:`${e.label} · ${Be(e.key)}`,onClick:t=>(0,a.unref)(Ne)(e),onMouseenter:e=>d.value=t},[e.icon?((0,a.openBlock)(),(0,a.createBlock)((0,a.resolveDynamicComponent)(e.icon),{key:0,class:`robot-item-icon`})):((0,a.openBlock)(),(0,a.createElementBlock)(`div`,P,[...n[20]||=[(0,a.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,a.createElementVNode)(`div`,F,[(0,a.createElementVNode)(`div`,I,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(Oe)(e.label,(0,a.unref)(u)),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:t},[e.matched?((0,a.openBlock)(),(0,a.createElementBlock)(`mark`,L,(0,a.toDisplayString)(e.text),1)):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[(0,a.createTextVNode)((0,a.toDisplayString)(e.text),1)],64))],64))),128))]),(0,a.createElementVNode)(`div`,R,(0,a.toDisplayString)(Be(e.key)),1)]),e.children?.length?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,z,(0,a.toDisplayString)(e.children.length),1)):(0,a.createCommentVNode)(`v-if`,!0)],42,N)]),_:1},8,[`id`,`role`,`aria-label`,`items`,`style`])])):(0,a.createCommentVNode)(`v-if`,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(g),e=>((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:e.key},[e.items.length?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,class:`robot-result-group`,role:`group`,"aria-label":e.title},[(0,a.createElementVNode)(`div`,fe,[(0,a.createTextVNode)((0,a.toDisplayString)(e.title)+` `,1),(0,a.createElementVNode)(`span`,V,(0,a.toDisplayString)(e.items.length),1)]),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(e.items,(t,r)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`${typeof t.key}:${t.key}`,id:Q(e.start+r),class:(0,a.normalizeClass)((0,a.unref)(J)(e.start+r,!1)),"aria-selected":(0,a.unref)(d)===e.start+r,"aria-posinset":e.start+r+1,"aria-setsize":(0,a.unref)(G),"data-command-index":e.start+r,role:`option`,onClick:n=>(0,a.unref)(Ee)(e.key,t),onMouseenter:t=>d.value=e.start+r},[t.icon?((0,a.openBlock)(),(0,a.createBlock)((0,a.resolveDynamicComponent)(t.icon),{key:0,class:`robot-item-icon`})):((0,a.openBlock)(),(0,a.createElementBlock)(`div`,H,[...n[21]||=[(0,a.createElementVNode)(`div`,{class:`i-mdi:flash-outline`},null,-1)]])),(0,a.createElementVNode)(`div`,me,[(0,a.createElementVNode)(`div`,he,(0,a.toDisplayString)(t.label),1),t.description?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,ge,(0,a.toDisplayString)(t.description),1)):(0,a.createCommentVNode)(`v-if`,!0)])],42,pe))),128))],8,B)):(0,a.createCommentVNode)(`v-if`,!0)],64))),128))],8,k)):(0,a.createCommentVNode)(`v-if`,!0)])],64)):(0,a.createCommentVNode)(`v-if`,!0):((0,a.openBlock)(),(0,a.createElementBlock)(`div`,S,[n[13]||=(0,a.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,a.createElementVNode)(`p`,null,(0,a.toDisplayString)(e.emptyText??(0,a.unref)(o)((0,a.unref)(_)?`globalSearch.commandEmpty`:`globalSearch.empty`)),1)]))],2),(0,a.createCommentVNode)(` 搜索底部 `),(0,a.createElementVNode)(`div`,_e,[(0,a.createElementVNode)(`div`,ve,[(0,a.createElementVNode)(`div`,ye,[n[22]||=(0,a.createElementVNode)(`kbd`,null,`↵`,-1),(0,a.createElementVNode)(`span`,null,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.select`)),1)]),(0,a.createElementVNode)(`div`,be,[n[23]||=(0,a.createElementVNode)(`kbd`,null,`↑↓`,-1),(0,a.createElementVNode)(`span`,null,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.navigate`)),1)]),(0,a.createElementVNode)(`div`,xe,[n[24]||=(0,a.createElementVNode)(`kbd`,null,`esc`,-1),(0,a.createElementVNode)(`span`,null,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.closeHint`)),1)])]),(0,a.unref)(De)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,Se,[(0,a.unref)(u).trim()&&(0,a.unref)(q)?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,Ce,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.resultCount`,{count:(0,a.unref)(G)})),1)):!(0,a.unref)(u).trim()&&(0,a.unref)(K).length>0?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,we,(0,a.toDisplayString)((0,a.unref)(o)(`globalSearch.historyCount`,{count:(0,a.unref)(K).length})),1)):(0,a.createCommentVNode)(`v-if`,!0)])):(0,a.createCommentVNode)(`v-if`,!0)])],10,ee)],36)):(0,a.createCommentVNode)(`v-if`,!0)]),_:1})]))],4))}});var W=n.t(U,[[`__scopeId`,`data-v-ee5a0539`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return W}});
@@ -1 +1 @@
1
- import{n as e,t}from"./useComponentTheme.js";import{t as n}from"./export-helper.js";import{t as r}from"./useScopedComponentLocale.js";import{t as i}from"./virtualList.js";import{Fragment as a,Teleport as o,Transition as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createTextVNode as p,createVNode as m,defineComponent as h,isRef as g,nextTick as _,normalizeClass as v,normalizeStyle as y,onMounted as b,onUnmounted as x,openBlock as S,ref as C,renderList as w,resolveDynamicComponent as T,toDisplayString as E,toValue as D,unref as O,useId as ee,vModelText as te,watch as k,withCtx as A,withDirectives as ne,withModifiers as j}from"vue";const M=e=>e.replace(/^\//,``).replace(/\//g,` > `)||`首页`;function N(e){let t=new Map,n=new Map;return{entries:e.map(e=>{let{key:r}=e,i=M(r);t.set(r,i),n.set(r,e);let a=e.label.toLowerCase();return{item:e,label:a,path:i.toLowerCase(),normalizedLabel:P(a),text:P([a,i,e.breadcrumb??``,...e.keywords??[]].join(` `))}}),paths:t,byKey:n}}function P(e){return e.normalize(`NFKC`).toLowerCase().trim().replace(/\s+/g,` `)}function F(e,t,n=`literal`){if(!t.trim())return[];if(n===`tokens`){let n=P(t),r=n.split(` `);return e.entries.filter(e=>r.every(t=>e.text.includes(t))).map(e=>({item:e.item,rank:e.normalizedLabel===n?0:e.normalizedLabel.startsWith(n)?1:e.normalizedLabel.includes(n)?2:3})).sort((e,t)=>e.rank-t.rank).map(e=>e.item)}let r=t.toLowerCase();return e.entries.filter(e=>e.label.includes(r)||e.path.includes(r)).map(e=>e.item)}function I(e){let t=typeof e==`string`?{query:e}:e;if(!t||typeof t!=`object`)return[];let{query:n,menuKey:r,menuItem:i,timestamp:a}=t,o=typeof r==`string`?r:i?.key,s=Number.isFinite(a)?a:0;return typeof o==`string`?[{menuKey:o,timestamp:s}]:typeof n!=`string`||!n.trim()?[]:[{query:n.slice(0,200),menuKey:null,timestamp:s}]}function L(e){let n=()=>D(e),r=()=>n().menuItems(),i=c(()=>n().storageKey??`robot-search-history`),a=c(()=>Math.min(100,Math.max(0,Math.trunc(n().maxHistory??10)))),o=c(()=>Math.min(a.value,Math.max(0,Math.trunc(n().maxDisplayHistory??5)))),s=C(!1),l=C(``),u=C(0),d=C(),f=C([]),p=C(!1),m=t(()=>{let e=n().isDark?.();return e===void 0?void 0:e?`dark`:`light`}),h=c(()=>m.value===`dark`),g=c(()=>N(r())),v=c(()=>{if(!l.value.trim())return[];let e=g.value,{search:t,matchMode:r}=n();if(!t)return F(e,l.value,r);let i=new Set;return t(l.value,e.entries.map(e=>e.item)).flatMap(t=>{let n=e.byKey.get(t.key);return!n||i.has(t.key)?[]:(i.add(t.key),[n])})}),y=c(()=>{let e=[];for(let[t,n]of f.value.entries()){if(e.length>=o.value)break;let{menuKey:r,query:i,timestamp:a}=n,s=r===null?null:g.value.byKey.get(r),c=s?.label??i;s===void 0||c===void 0||e.push({item:{query:c,menuItem:s,timestamp:a},sourceIndex:t})}return e}),S=c(()=>y.value.map(({item:e})=>e)),w=c(()=>v.value.length>0),T=c(()=>!!l.value.trim()||S.value.length>0),E=c(()=>l.value.trim()?v.value.length:S.value.length),O=(e,t)=>[`robot-result-item`,t&&`robot-history-item`,{"robot-result-item-selected":u.value===e}],ee=(e,t)=>{if(!t)return[{text:e,matched:!1}];let r=n().matchMode===`tokens`?t.trim().split(/\s+/).filter(Boolean).sort((e,t)=>t.length-e.length):[t];if(!r.length)return[{text:e,matched:!1}];let i=RegExp(`(${r.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})`,`gi`);return e.split(i).filter(Boolean).map(e=>({text:e,matched:r.some(t=>e.toLocaleLowerCase()===t.toLocaleLowerCase())}))},te=e=>g.value.paths.get(e)??M(e),A=()=>{if(!(typeof localStorage>`u`))try{localStorage.setItem(i.value,JSON.stringify(f.value))}catch{}},ne=e=>{if(!e.label.trim())return;let t=f.value.filter(t=>t.menuKey!==e.key);f.value=[{menuKey:e.key,timestamp:Date.now()},...t].slice(0,a.value),A()},j=()=>{if(f.value=[],!(typeof localStorage>`u`))try{let e=localStorage.getItem(i.value);if(e){let t=JSON.parse(e);if(!Array.isArray(t))return;f.value=t.flatMap(I).slice(0,a.value)}}catch{f.value=[]}},P=()=>{if(f.value=[],!(typeof localStorage>`u`))try{localStorage.removeItem(i.value)}catch{}},L=e=>{let t=y.value[e];t&&(f.value.splice(t.sourceIndex,1),A(),u.value=Math.max(0,Math.min(u.value,S.value.length-1)))},R=null,z=0,B=!1,V=async()=>{!s.value&&typeof document<`u`&&typeof HTMLElement<`u`&&(R=document.activeElement instanceof HTMLElement?document.activeElement:null);let e=++z;s.value=!0,l.value=``,u.value=0,p.value=!1,await _(),!B&&e===z&&s.value&&d.value?.focus()},H=()=>{let e=s.value,t=R;R=null;let n=++z;s.value=!1,l.value=``,u.value=0,p.value=!1,e&&_(()=>{!B&&n===z&&t?.isConnected&&t.focus({preventScroll:!0})})},U=e=>{if(e.menuItem){let t=g.value.byKey.get(e.menuItem.key);if(!t)return;n().onSelect?.(t.key,!!t.children?.length),H()}else l.value=e.query,u.value=0},W=e=>{let t=g.value.byKey.get(e.key);t&&(ne(t),n().onSelect?.(t.key,!!t.children?.length),H())},G=e=>p.value||!!(e&&(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)),K=e=>{if(G(e))return;u.value=Math.max(0,Math.min(u.value,E.value-1));let t=!l.value.trim()&&S.value.length>0,n=l.value.trim()&&v.value.length>0;if(t){let t=S.value[u.value];t&&(e?.preventDefault(),U(t))}else if(n){let t=v.value[u.value];t&&(e?.preventDefault(),W(t))}},q=e=>{G(e)||(e?.preventDefault(),u.value=Math.max(0,Math.min(u.value+1,E.value-1)))},J=e=>{G(e)||(e?.preventDefault(),u.value=Math.max(0,Math.min(u.value-1,E.value-1)))},re=e=>{let t=d.value?.closest(`[role="dialog"]`);if(!t)return;let n=Array.from(t.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex]`)).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&!e.closest(`[hidden], [inert]`)),r=n[0],i=n[n.length-1],a=e.shiftKey?r:i;!a||document.activeElement!==a||(e.preventDefault(),(e.shiftKey?i:r)?.focus())},Y=e=>{if(e.key===`Tab`&&!e.defaultPrevented&&!e.isComposing){re(e);return}e.key!==`Escape`||G(e)||(e.preventDefault(),H())},ie=e=>{e.key===`ArrowDown`?q(e):e.key===`ArrowUp`?J(e):e.key===`Enter`?K(e):Y(e)};k(l,()=>{u.value=0}),k(E,e=>{u.value=Math.max(0,Math.min(u.value,e-1))}),k(i,j);let X=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||p.value||(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),V())};return b(()=>{j(),document.addEventListener(`keydown`,X)}),x(()=>{B=!0,z++,R=null,document.removeEventListener(`keydown`,X)}),{showDialog:s,searchValue:l,selectedIndex:u,searchInputRef:d,isDark:h,filteredMenuItems:v,displayHistory:S,hasResults:w,hasContent:T,getItemClasses:O,highlightMatch:ee,formatMenuPath:te,clearHistory:P,removeHistoryItem:L,openDialog:V,closeDialog:H,selectHistoryItem:U,selectItem:W,handleEnter:K,focusNext:q,focusPrev:J,handleInputKeydown:ie,handleDialogKeydown:Y,handleCompositionStart:()=>{p.value=!0},handleCompositionEnd:()=>{p.value=!1}}}const R=Object.freeze({"globalSearch.trigger":`搜索`,"globalSearch.dialog":`全局搜索`,"globalSearch.input":`搜索菜单`,"globalSearch.close":`关闭搜索`,"globalSearch.recent":`最近搜索`,"globalSearch.clearHistory":`清空历史`,"globalSearch.removeHistory":`删除此记录`,"globalSearch.noResults":`未找到 "{query}" 相关内容`,"globalSearch.select":`选择`,"globalSearch.navigate":`导航`,"globalSearch.closeHint":`关闭`,"globalSearch.resultCount":`共 {count} 项结果`,"globalSearch.historyCount":`{count} 条历史记录`,"globalSearch.placeholder":`搜索导航菜单...`,"globalSearch.empty":`输入关键词搜索菜单`,"globalSearch.group":`菜单导航`,"globalSearch.home":`首页`}),z=Object.freeze({"globalSearch.trigger":`Search`,"globalSearch.dialog":`Global search`,"globalSearch.input":`Search menus`,"globalSearch.close":`Close search`,"globalSearch.recent":`Recent searches`,"globalSearch.clearHistory":`Clear history`,"globalSearch.removeHistory":`Remove this record`,"globalSearch.noResults":`No results for "{query}"`,"globalSearch.select":`Select`,"globalSearch.navigate":`Navigate`,"globalSearch.closeHint":`Close`,"globalSearch.resultCount":`{count} results`,"globalSearch.historyCount":`{count} recent searches`,"globalSearch.placeholder":`Search navigation menus...`,"globalSearch.empty":`Type to search menus`,"globalSearch.group":`Navigation menus`,"globalSearch.home":`Home`}),B=()=>r(R,z),V={class:`robot-trigger-text`},H=[`aria-label`],U={class:`robot-search-header`},W=[`placeholder`,`aria-label`,`aria-expanded`,`aria-activedescendant`],G=[`aria-label`],K={key:0,class:`robot-empty-state`},q={class:`robot-search-results`},J={class:`robot-result-group`},re={class:`robot-group-title`},Y={class:`robot-group-count`},ie=[`title`,`aria-label`],X=[`aria-label`],ae=[`id`,`aria-selected`,`data-option-index`,`onClick`,`onMouseenter`],oe={key:1,class:`robot-item-icon robot-default-icon`},se={class:`robot-item-content`},ce={class:`robot-item-label`},le={class:`robot-item-desc`},ue=[`onClick`,`title`,`aria-label`],de={class:`robot-search-results`},fe={key:0,class:`robot-empty-state`},pe={class:`robot-result-group`},me={class:`robot-group-title`},he={class:`robot-group-count`},ge=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`title`,`onClick`,`onMouseenter`],_e={key:1,class:`robot-item-icon robot-default-icon`},ve={class:`robot-item-content`},ye={class:`robot-item-label`},be={key:0,class:`robot-highlight`},xe={class:`robot-item-desc`},Se={key:2,class:`robot-item-badge`},Ce={class:`robot-search-footer`},we={class:`robot-footer-actions`},Te={class:`robot-action-item`},Ee={class:`robot-action-item`},De={class:`robot-action-item`},Oe={key:0,class:`robot-footer-info`},ke={key:0},Ae={key:1};var je=n(h({name:`C_GlobalSearch`,__name:`index`,props:{options:{},placeholder:{},emptyText:{},resultGroupTitle:{}},setup(t,{expose:n}){let{t:r}=B(),h=t,{showDialog:b,searchValue:x,selectedIndex:D,searchInputRef:M,isDark:N,filteredMenuItems:P,displayHistory:F,hasResults:I,hasContent:R,getItemClasses:z,highlightMatch:je,formatMenuPath:Me,clearHistory:Ne,removeHistoryItem:Pe,openDialog:Z,closeDialog:Q,selectHistoryItem:Fe,selectItem:Ie,handleInputKeydown:Le,handleDialogKeydown:Re,handleCompositionStart:ze,handleCompositionEnd:Be}=L(()=>h.options),Ve=e(()=>N.value?`dark`:`light`),He=e=>e===``||e===`/`?r(`globalSearch.home`):Me(e),$=`robot-search-options-${ee()}`,Ue=e=>`${$}-${e}`,We=c(()=>(x.value.trim()?P.value.length:F.value.length)>0?Ue(D.value):void 0),Ge=C(),Ke=C(),qe=!1,Je=async()=>{qe||(qe=!0,await _(),qe=!1,b.value&&(x.value.trim()?P.value.length&&Ge.value?.scrollTo({index:D.value}):Ke.value?.querySelector(`[data-option-index="${D.value}"]`)?.scrollIntoView({block:`nearest`})))},Ye=e=>{let t=e.defaultPrevented;Le(e),!t&&e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&Je()};return k([D,P,F,b],Je,{flush:`post`}),n({openDialog:Z,closeDialog:Q}),(e,n)=>(S(),d(`div`,{class:`robot-search-palette`,style:y(O(Ve))},[u(` 搜索触发按钮 `),f(`button`,{type:`button`,class:v([`robot-search-trigger`,{"trigger-dark":O(N)}]),onClick:n[0]||=(...e)=>O(Z)&&O(Z)(...e)},[n[9]||=f(`span`,{class:`i-mdi:search robot-trigger-icon`},null,-1),f(`span`,V,E(O(r)(`globalSearch.trigger`)),1),n[10]||=f(`span`,{class:`robot-trigger-shortcut`},`Ctrl K`,-1)],2),u(` 搜索对话框 `),(S(),l(o,{to:`body`},[m(s,{name:`robot-dialog`},{default:A(()=>[O(b)?(S(),d(`div`,{key:0,class:`robot-dialog-overlay`,style:y(O(Ve)),onClick:n[7]||=(...e)=>O(Q)&&O(Q)(...e),onKeydown:n[8]||=(...e)=>O(Re)&&O(Re)(...e)},[f(`div`,{class:v([`robot-dialog-container`,{"dialog-dark":O(N)}]),role:`dialog`,"aria-modal":`true`,"aria-label":O(r)(`globalSearch.dialog`),onClick:n[6]||=j(()=>{},[`stop`])},[u(` 搜索头部 `),f(`div`,U,[n[12]||=f(`div`,{class:`i-mdi:magnify robot-search-icon`},null,-1),ne(f(`input`,{ref_key:`searchInputRef`,ref:M,"onUpdate:modelValue":n[1]||=e=>g(x)?x.value=e:null,type:`text`,placeholder:t.placeholder??O(r)(`globalSearch.placeholder`),class:`robot-search-input`,role:`combobox`,"aria-label":O(r)(`globalSearch.input`),"aria-autocomplete":`list`,"aria-expanded":O(b),"aria-controls":$,"aria-activedescendant":We.value,onKeydown:Ye,onCompositionstart:n[2]||=(...e)=>O(ze)&&O(ze)(...e),onCompositionend:n[3]||=(...e)=>O(Be)&&O(Be)(...e)},null,40,W),[[te,O(x)]]),f(`button`,{class:`robot-close-btn`,"aria-label":O(r)(`globalSearch.close`),onClick:n[4]||=(...e)=>O(Q)&&O(Q)(...e)},[...n[11]||=[f(`div`,{class:`i-mdi:close`},null,-1)]],8,G)]),u(` 搜索内容 `),f(`div`,{class:v([`robot-search-content`,{"robot-search-content--virtual":O(x).trim()&&O(I)}])},[u(` 空状态 `),O(R)?!O(x).trim()&&O(F).length>0?(S(),d(a,{key:1},[u(` 搜索历史 `),f(`div`,q,[f(`div`,J,[f(`div`,re,[n[15]||=f(`div`,{class:`i-mdi:clock-time-four-outline robot-group-icon`},null,-1),p(` `+E(O(r)(`globalSearch.recent`))+` `,1),f(`span`,Y,E(O(F).length),1),f(`button`,{class:`robot-clear-history`,onClick:n[5]||=(...e)=>O(Ne)&&O(Ne)(...e),title:O(r)(`globalSearch.clearHistory`),"aria-label":O(r)(`globalSearch.clearHistory`)},[...n[14]||=[f(`div`,{class:`i-mdi:delete-outline`},null,-1)]],8,ie)]),f(`div`,{id:$,ref_key:`historyItemsRef`,ref:Ke,class:`robot-group-items`,role:`listbox`,"aria-label":O(r)(`globalSearch.recent`)},[(S(!0),d(a,null,w(O(F),(e,t)=>(S(),d(`div`,{key:`history-${t}`,id:Ue(t),class:v(O(z)(t,!0)),role:`option`,"aria-selected":O(D)===t,"data-option-index":t,onClick:t=>O(Fe)(e),onMouseenter:e=>D.value=t},[e.menuItem?.icon?(S(),l(T(e.menuItem.icon),{key:0,class:`robot-item-icon`})):(S(),d(`div`,oe,[...n[16]||=[f(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),f(`div`,se,[f(`div`,ce,E(e.query),1),f(`div`,le,E(He(e.menuItem?.key||``)),1)]),f(`button`,{class:`robot-history-delete`,onClick:j(e=>O(Pe)(t),[`stop`]),title:O(r)(`globalSearch.removeHistory`),"aria-label":O(r)(`globalSearch.removeHistory`)},[...n[17]||=[f(`div`,{class:`i-mdi:close`},null,-1)]],8,ue)],42,ae))),128))],8,X)])])],64)):O(x).trim()?(S(),d(a,{key:2},[u(` 搜索结果 `),f(`div`,de,[u(` 无结果状态 `),O(I)?(S(),d(a,{key:1},[u(` 搜索结果列表 `),f(`div`,pe,[f(`div`,me,[n[19]||=f(`div`,{class:`i-mdi:menu robot-group-icon`},null,-1),p(` `+E(t.resultGroupTitle??O(r)(`globalSearch.group`))+` `,1),f(`span`,he,E(O(P).length),1)]),m(O(i),{id:$,ref_key:`resultListRef`,ref:Ge,class:`robot-group-items robot-virtual-items`,role:`listbox`,"aria-label":t.resultGroupTitle??O(r)(`globalSearch.group`),items:O(P),"item-size":64,style:y({height:`${Math.min(O(P).length*64,336)}px`})},{default:A(({item:e,index:t})=>[f(`div`,{id:Ue(t),class:v(O(z)(t,!1)),role:`option`,"aria-selected":O(D)===t,"aria-posinset":t+1,"aria-setsize":O(P).length,title:`${e.label} · ${He(e.key)}`,onClick:t=>O(Ie)(e),onMouseenter:e=>D.value=t},[e.icon?(S(),l(T(e.icon),{key:0,class:`robot-item-icon`})):(S(),d(`div`,_e,[...n[20]||=[f(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),f(`div`,ve,[f(`div`,ye,[(S(!0),d(a,null,w(O(je)(e.label,O(x)),(e,t)=>(S(),d(a,{key:t},[e.matched?(S(),d(`mark`,be,E(e.text),1)):(S(),d(a,{key:1},[p(E(e.text),1)],64))],64))),128))]),f(`div`,xe,E(He(e.key)),1)]),e.children?.length?(S(),d(`div`,Se,E(e.children.length),1)):u(`v-if`,!0)],42,ge)]),_:1},8,[`aria-label`,`items`,`style`])])],2112)):(S(),d(`div`,fe,[n[18]||=f(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),f(`p`,null,E(O(r)(`globalSearch.noResults`,{query:O(x)})),1)]))])],64)):u(`v-if`,!0):(S(),d(`div`,K,[n[13]||=f(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),f(`p`,null,E(t.emptyText??O(r)(`globalSearch.empty`)),1)]))],2),u(` 搜索底部 `),f(`div`,Ce,[f(`div`,we,[f(`div`,Te,[n[21]||=f(`kbd`,null,`↵`,-1),f(`span`,null,E(O(r)(`globalSearch.select`)),1)]),f(`div`,Ee,[n[22]||=f(`kbd`,null,`↑↓`,-1),f(`span`,null,E(O(r)(`globalSearch.navigate`)),1)]),f(`div`,De,[n[23]||=f(`kbd`,null,`esc`,-1),f(`span`,null,E(O(r)(`globalSearch.closeHint`)),1)])]),O(R)?(S(),d(`div`,Oe,[O(x).trim()&&O(I)?(S(),d(`span`,ke,E(O(r)(`globalSearch.resultCount`,{count:O(P).length})),1)):!O(x).trim()&&O(F).length>0?(S(),d(`span`,Ae,E(O(r)(`globalSearch.historyCount`,{count:O(F).length})),1)):u(`v-if`,!0)])):u(`v-if`,!0)])],10,H)],36)):u(`v-if`,!0)]),_:1})]))],4))}}),[[`__scopeId`,`data-v-18b636a8`]]);export{L as n,je as t};
1
+ import{t as e}from"./useDataResource.js";import{n as t,t as n}from"./useComponentTheme.js";import{t as r}from"./export-helper.js";import{t as i}from"./useScopedComponentLocale.js";import{t as a}from"./virtualList.js";import{Fragment as o,Teleport as s,Transition as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createTextVNode as m,createVNode as ee,defineComponent as h,isRef as g,nextTick as te,normalizeClass as _,normalizeStyle as v,onDeactivated as ne,onMounted as y,onScopeDispose as b,onUnmounted as x,openBlock as S,ref as C,renderList as w,resolveDynamicComponent as T,shallowRef as E,toDisplayString as D,toValue as O,unref as k,useId as A,vModelText as re,watch as j,withCtx as ie,withDirectives as ae,withModifiers as M}from"vue";function N(e,t){let n=new Set;return e.flatMap(e=>{let{key:r,title:i,minChars:a,search:o}=e;return!r||n.has(r)?[]:(n.add(r),t<(a!==void 0&&Number.isSafeInteger(a)?Math.max(a,1):1)?[]:[{key:r,title:i,search:o.bind(e)}])})}function P(e){if(!Array.isArray(e))throw TypeError(`Command source must return an array`);let t=[],n=new Set;for(let r of e)if(!(!r||typeof r.label!=`string`||!r.label.trim())&&!(typeof r.key!=`string`&&!Number.isFinite(r.key))&&!n.has(r.key)&&(n.add(r.key),t.push(r),t.length>=20))break;return t}async function F({sources:e,query:t,scope:n},r){let i=[],a=0;async function o(e){let{key:i,title:a}=e;try{let o=await e.search(t,{signal:r,scope:n});return r.throwIfAborted(),{key:i,title:a,items:P(o)}}catch{return{key:i,title:a,items:[],failed:!0}}}async function s(){if(r.aborted||a>=e.length)return;let t=a++;return i[t]=await o(e[t]),s()}return await Promise.all(Array.from({length:Math.min(3,e.length)},s)),i}function I(t,n){let r=l(()=>!!t()?.sources.length),i=l(()=>{let e=n().trim(),r=t();if(!e||!r)return;let i=N(r.sources,e.length);return i.length?{query:e,scope:r.scope,sources:i}:void 0}),a=E(null),o=E(!1),s,c,u=0,d=e({key:a,load:({signal:e})=>F(s,e)});function f(e,t){clearTimeout(c),a.value=null,o.value=e!==void 0,e&&(c=setTimeout(()=>{s=e,a.value=++u,o.value=!1},t))}j(i,e=>{let n=t()?.debounce;f(e,n!==void 0&&Number.isFinite(n)?Math.max(0,n):200)},{immediate:!0,flush:`sync`}),b(()=>clearTimeout(c));let p=l(()=>d.data.value??[]);return{enabled:r,groups:p,loading:l(()=>o.value||d.loading.value),failed:l(()=>p.value.some(e=>e.failed)),retry:()=>{!o.value&&!d.loading.value&&f(i.value,0)}}}const L=e=>e.replace(/^\//,``).replace(/\//g,` > `)||`首页`;function oe(e){let t=new Map,n=new Map;return{entries:e.map(e=>{let{key:r}=e,i=L(r);t.set(r,i),n.set(r,e);let a=e.label.toLowerCase();return{item:e,label:a,path:i.toLowerCase(),normalizedLabel:R(a),text:R([a,i,e.breadcrumb??``,...e.keywords??[]].join(` `))}}),paths:t,byKey:n}}function R(e){return e.normalize(`NFKC`).toLowerCase().trim().replace(/\s+/g,` `)}function z(e,t,n=`literal`){if(!t.trim())return[];if(n===`tokens`){let n=R(t),r=n.split(` `);return e.entries.filter(e=>r.every(t=>e.text.includes(t))).map(e=>({item:e.item,rank:e.normalizedLabel===n?0:e.normalizedLabel.startsWith(n)?1:e.normalizedLabel.includes(n)?2:3})).sort((e,t)=>e.rank-t.rank).map(e=>e.item)}let r=t.toLowerCase();return e.entries.filter(e=>e.label.includes(r)||e.path.includes(r)).map(e=>e.item)}function B(e){let t=typeof e==`string`?{query:e}:e;if(!t||typeof t!=`object`)return[];let{query:n,menuKey:r,menuItem:i,timestamp:a}=t,o=typeof r==`string`?r:i?.key,s=Number.isFinite(a)?a:0;return typeof o==`string`?[{menuKey:o,timestamp:s}]:typeof n!=`string`||!n.trim()?[]:[{query:n.slice(0,200),menuKey:null,timestamp:s}]}function V(e,t){let r=()=>O(e),i=()=>r().menuItems(),a=l(()=>r().storageKey??`robot-search-history`),o=l(()=>Math.min(100,Math.max(0,Math.trunc(r().maxHistory??10)))),s=l(()=>Math.min(o.value,Math.max(0,Math.trunc(r().maxDisplayHistory??5)))),c=C(!1),u=C(``),d=C(0),f=C(),p=C([]),m=C(!1),ee=n(()=>{let e=r().isDark?.();return e===void 0?void 0:e?`dark`:`light`}),h=l(()=>ee.value===`dark`),g=l(()=>oe(i())),_=l(()=>{if(!u.value.trim())return[];let e=g.value,{search:t,matchMode:n}=r();if(!t)return z(e,u.value,n);let i=new Set;return t(u.value,e.entries.map(e=>e.item)).flatMap(t=>{let n=e.byKey.get(t.key);return!n||i.has(t.key)?[]:(i.add(t.key),[n])})}),v=l(()=>{let e=[];for(let[t,n]of p.value.entries()){if(e.length>=s.value)break;let{menuKey:r,query:i,timestamp:a}=n,o=r===null?null:g.value.byKey.get(r),c=o?.label??i;o===void 0||c===void 0||e.push({item:{query:c,menuItem:o,timestamp:a},sourceIndex:t})}return e}),b=l(()=>v.value.map(({item:e})=>e)),S=I(()=>r().commands,()=>c.value&&!m.value?u.value:``),w=l(()=>{let e=_.value.length;return S.groups.value.map(t=>{let n={...t,start:e};return e+=t.items.length,n})}),T=l(()=>w.value.flatMap(e=>e.items.map(t=>({source:e.key,item:t})))),E=l(()=>_.value.length+T.value.length),D=l(()=>E.value>0),k=l(()=>!!u.value.trim()||b.value.length>0),A=l(()=>u.value.trim()?E.value:b.value.length),re=(e,t)=>[`robot-result-item`,t&&`robot-history-item`,{"robot-result-item-selected":d.value===e}],ie=(e,t)=>{if(!t)return[{text:e,matched:!1}];let n=r().matchMode===`tokens`?t.trim().split(/\s+/).filter(Boolean).sort((e,t)=>t.length-e.length):[t];if(!n.length)return[{text:e,matched:!1}];let i=RegExp(`(${n.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})`,`gi`);return e.split(i).filter(Boolean).map(e=>({text:e,matched:n.some(t=>e.toLocaleLowerCase()===t.toLocaleLowerCase())}))},ae=e=>g.value.paths.get(e)??L(e),M=()=>{if(!(typeof localStorage>`u`))try{localStorage.setItem(a.value,JSON.stringify(p.value))}catch{}},N=e=>{if(!e.label.trim())return;let t=p.value.filter(t=>t.menuKey!==e.key);p.value=[{menuKey:e.key,timestamp:Date.now()},...t].slice(0,o.value),M()},P=()=>{if(p.value=[],!(typeof localStorage>`u`))try{let e=localStorage.getItem(a.value);if(e){let t=JSON.parse(e);if(!Array.isArray(t))return;p.value=t.flatMap(B).slice(0,o.value)}}catch{p.value=[]}},F=()=>{if(p.value=[],!(typeof localStorage>`u`))try{localStorage.removeItem(a.value)}catch{}},R=e=>{let t=v.value[e];t&&(p.value.splice(t.sourceIndex,1),M(),d.value=Math.max(0,Math.min(d.value,b.value.length-1)))},V=null,H=0,U=!1,W=async()=>{!c.value&&typeof document<`u`&&typeof HTMLElement<`u`&&(V=document.activeElement instanceof HTMLElement?document.activeElement:null);let e=++H;c.value=!0,u.value=``,d.value=0,m.value=!1,await te(),!U&&e===H&&c.value&&f.value?.focus()},G=()=>{let e=c.value,t=V;V=null;let n=++H;c.value=!1,u.value=``,d.value=0,m.value=!1,e&&te(()=>{!U&&n===H&&t?.isConnected&&t.focus({preventScroll:!0})})},K=e=>{if(e.menuItem){let t=g.value.byKey.get(e.menuItem.key);if(!t)return;r().onSelect?.(t.key,!!t.children?.length),G()}else u.value=e.query,d.value=0},q=e=>{let t=g.value.byKey.get(e.key);t&&(N(t),r().onSelect?.(t.key,!!t.children?.length),G())},J=(e,n)=>{if(!c.value||!T.value.some(t=>t.source===e&&t.item===n))return;let i=r().commands?.onSelect;G(),i?.(e,n),t?.(e,n)},Y=e=>m.value||!!(e&&(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)),se=e=>{if(Y(e))return;if(d.value=Math.max(0,Math.min(d.value,A.value-1)),!u.value.trim()&&b.value.length>0){let t=b.value[d.value];t&&(e?.preventDefault(),K(t));return}let t=_.value[d.value];if(t){e?.preventDefault(),q(t);return}let n=T.value[d.value-_.value.length];n&&(e?.preventDefault(),J(n.source,n.item))},ce=e=>{Y(e)||(e?.preventDefault(),d.value=Math.max(0,Math.min(d.value+1,A.value-1)))},le=e=>{Y(e)||(e?.preventDefault(),d.value=Math.max(0,Math.min(d.value-1,A.value-1)))},ue=e=>{let t=f.value?.closest(`[role="dialog"]`);if(!t)return;let n=Array.from(t.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex]`)).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&!e.closest(`[hidden], [inert]`)),r=n[0],i=n[n.length-1],a=e.shiftKey?r:i;!a||document.activeElement!==a||(e.preventDefault(),(e.shiftKey?i:r)?.focus())},de=e=>{if(e.key===`Tab`&&!e.defaultPrevented&&!e.isComposing){ue(e);return}e.key!==`Escape`||Y(e)||(e.preventDefault(),G())},fe=e=>{e.key===`ArrowDown`?ce(e):e.key===`ArrowUp`?le(e):e.key===`Enter`?se(e):de(e)};j(u,()=>{d.value=0}),j(A,e=>{d.value=Math.max(0,Math.min(d.value,e-1))}),j(a,P);let pe=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||m.value||(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),W())};return y(()=>{P(),document.addEventListener(`keydown`,pe)}),ne(G),x(()=>{U=!0,H++,V=null,document.removeEventListener(`keydown`,pe)}),{showDialog:c,searchValue:u,selectedIndex:d,searchInputRef:f,isDark:h,filteredMenuItems:_,commandGroups:w,commandEnabled:S.enabled,commandLoading:S.loading,commandFailed:S.failed,retryCommands:S.retry,selectCommand:J,resultCount:E,displayHistory:b,hasResults:D,hasContent:k,getItemClasses:re,highlightMatch:ie,formatMenuPath:ae,clearHistory:F,removeHistoryItem:R,openDialog:W,closeDialog:G,selectHistoryItem:K,selectItem:q,handleEnter:se,focusNext:ce,focusPrev:le,handleInputKeydown:fe,handleDialogKeydown:de,handleCompositionStart:()=>{m.value=!0},handleCompositionEnd:()=>{m.value=!1}}}const H=Object.freeze({"globalSearch.trigger":`搜索`,"globalSearch.dialog":`全局搜索`,"globalSearch.input":`搜索菜单`,"globalSearch.close":`关闭搜索`,"globalSearch.recent":`最近搜索`,"globalSearch.clearHistory":`清空历史`,"globalSearch.removeHistory":`删除此记录`,"globalSearch.noResults":`未找到 "{query}" 相关内容`,"globalSearch.select":`选择`,"globalSearch.navigate":`导航`,"globalSearch.closeHint":`关闭`,"globalSearch.resultCount":`共 {count} 项结果`,"globalSearch.historyCount":`{count} 条历史记录`,"globalSearch.placeholder":`搜索导航菜单...`,"globalSearch.empty":`输入关键词搜索菜单`,"globalSearch.group":`菜单导航`,"globalSearch.home":`首页`,"globalSearch.commandInput":`搜索菜单或业务记录`,"globalSearch.commandPlaceholder":`搜索菜单、业务记录和快捷操作…`,"globalSearch.commandEmpty":`输入关键词查找菜单、业务记录和快捷操作`,"globalSearch.commandResults":`全局搜索结果`,"globalSearch.commandLoading":`正在搜索其他来源…`,"globalSearch.commandFailed":`部分搜索来源加载失败`,"globalSearch.commandRetry":`重试`}),U=Object.freeze({"globalSearch.trigger":`Search`,"globalSearch.dialog":`Global search`,"globalSearch.input":`Search menus`,"globalSearch.close":`Close search`,"globalSearch.recent":`Recent searches`,"globalSearch.clearHistory":`Clear history`,"globalSearch.removeHistory":`Remove this record`,"globalSearch.noResults":`No results for "{query}"`,"globalSearch.select":`Select`,"globalSearch.navigate":`Navigate`,"globalSearch.closeHint":`Close`,"globalSearch.resultCount":`{count} results`,"globalSearch.historyCount":`{count} recent searches`,"globalSearch.placeholder":`Search navigation menus...`,"globalSearch.empty":`Type to search menus`,"globalSearch.group":`Navigation menus`,"globalSearch.home":`Home`,"globalSearch.commandInput":`Search menus or records`,"globalSearch.commandPlaceholder":`Search menus, records and actions…`,"globalSearch.commandEmpty":`Type to search menus, records and actions`,"globalSearch.commandResults":`Global search results`,"globalSearch.commandLoading":`Searching additional sources…`,"globalSearch.commandFailed":`Some search sources failed to load`,"globalSearch.commandRetry":`Retry`}),W=()=>i(H,U),G={class:`robot-trigger-text`},K=[`aria-label`],q={class:`robot-search-header`},J=[`placeholder`,`aria-label`,`aria-expanded`,`aria-controls`,`aria-activedescendant`],Y=[`aria-label`],se={key:0,class:`robot-empty-state`},ce={class:`robot-search-results`},le={class:`robot-result-group`},ue={class:`robot-group-title`},de={class:`robot-group-count`},fe=[`title`,`aria-label`],pe=[`aria-label`],me=[`id`,`aria-selected`,`data-option-index`,`onClick`,`onMouseenter`],he={key:1,class:`robot-item-icon robot-default-icon`},ge={class:`robot-item-content`},_e={class:`robot-item-label`},ve={class:`robot-item-desc`},ye=[`onClick`,`title`,`aria-label`],be={class:`robot-search-results`},xe={key:0,class:`robot-command-status`,role:`status`},Se={key:1,class:`robot-command-status`,role:`status`},Ce={key:2,class:`robot-empty-state`},we=[`id`,`role`,`aria-label`],Te={key:0,class:`robot-result-group`},Ee={class:`robot-group-title`},De={class:`robot-group-count`},Oe=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`title`,`onClick`,`onMouseenter`],ke={key:1,class:`robot-item-icon robot-default-icon`},Ae={class:`robot-item-content`},je={class:`robot-item-label`},Me={key:0,class:`robot-highlight`},Ne={class:`robot-item-desc`},Pe={key:2,class:`robot-item-badge`},Fe=[`aria-label`],Ie={class:`robot-group-title`,"aria-hidden":`true`},Le={class:`robot-group-count`},Re=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`data-command-index`,`onClick`,`onMouseenter`],ze={key:1,class:`robot-item-icon robot-default-icon`},Be={class:`robot-item-content`},Ve={class:`robot-item-label`},He={key:0,class:`robot-item-desc`},Ue={class:`robot-search-footer`},We={class:`robot-footer-actions`},Ge={class:`robot-action-item`},Ke={class:`robot-action-item`},qe={class:`robot-action-item`},Je={key:0,class:`robot-footer-info`},Ye={key:0},Xe={key:1};var X=r(h({name:`C_GlobalSearch`,__name:`index`,props:{options:{},placeholder:{},emptyText:{},resultGroupTitle:{}},emits:[`command-select`],setup(e,{expose:n,emit:r}){let{t:i}=W(),h=e,ne=r,{showDialog:y,searchValue:b,selectedIndex:x,searchInputRef:E,isDark:O,filteredMenuItems:N,commandGroups:P,commandEnabled:F,commandLoading:I,commandFailed:L,retryCommands:oe,selectCommand:R,resultCount:z,displayHistory:B,hasResults:H,hasContent:U,getItemClasses:X,highlightMatch:Ze,formatMenuPath:Qe,clearHistory:$e,removeHistoryItem:et,openDialog:tt,closeDialog:Z,selectHistoryItem:nt,selectItem:rt,handleInputKeydown:it,handleDialogKeydown:at,handleCompositionStart:ot,handleCompositionEnd:st}=V(()=>h.options,(e,t)=>ne(`command-select`,e,t)),ct=t(()=>O.value?`dark`:`light`);function lt(){oe(),E.value?.focus()}let ut=e=>e===``||e===`/`?i(`globalSearch.home`):Qe(e),Q=`robot-search-options-${A()}`,$=e=>`${Q}-${e}`,dt=l(()=>(b.value.trim()?z.value:B.value.length)>0?$(x.value):void 0),ft=C(),pt=C(),mt=C(),ht=!1;function gt(e){if(e>=N.value.length){pt.value?.querySelector(`[data-command-index="${e}"]`)?.scrollIntoView({block:`nearest`});return}ft.value?.scrollTo({index:e}),F.value&&pt.value?.querySelector(`.robot-virtual-items`)?.scrollIntoView({block:`nearest`})}let _t=async()=>{ht||(ht=!0,await te(),ht=!1,y.value&&(b.value.trim()?gt(x.value):mt.value?.querySelector(`[data-option-index="${x.value}"]`)?.scrollIntoView({block:`nearest`})))},vt=e=>{let t=e.defaultPrevented;it(e),!t&&e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&_t()};return j([x,N,P,B,y],_t,{flush:`post`}),n({openDialog:tt,closeDialog:Z}),(t,n)=>(S(),f(`div`,{class:`robot-search-palette`,style:v(k(ct))},[d(` 搜索触发按钮 `),p(`button`,{type:`button`,class:_([`robot-search-trigger`,{"trigger-dark":k(O)}]),onClick:n[0]||=(...e)=>k(tt)&&k(tt)(...e)},[n[9]||=p(`span`,{class:`i-mdi:search robot-trigger-icon`},null,-1),p(`span`,G,D(k(i)(`globalSearch.trigger`)),1),n[10]||=p(`span`,{class:`robot-trigger-shortcut`},`Ctrl K`,-1)],2),d(` 搜索对话框 `),(S(),u(s,{to:`body`},[ee(c,{name:`robot-dialog`},{default:ie(()=>[k(y)?(S(),f(`div`,{key:0,class:`robot-dialog-overlay`,style:v(k(ct)),onClick:n[7]||=(...e)=>k(Z)&&k(Z)(...e),onKeydown:n[8]||=(...e)=>k(at)&&k(at)(...e)},[p(`div`,{class:_([`robot-dialog-container`,{"dialog-dark":k(O)}]),role:`dialog`,"aria-modal":`true`,"aria-label":k(i)(`globalSearch.dialog`),onClick:n[6]||=M(()=>{},[`stop`])},[d(` 搜索头部 `),p(`div`,q,[n[12]||=p(`div`,{class:`i-mdi:magnify robot-search-icon`},null,-1),ae(p(`input`,{ref_key:`searchInputRef`,ref:E,"onUpdate:modelValue":n[1]||=e=>g(b)?b.value=e:null,type:`text`,placeholder:e.placeholder??k(i)(k(F)?`globalSearch.commandPlaceholder`:`globalSearch.placeholder`),class:`robot-search-input`,role:`combobox`,"aria-label":k(i)(k(F)?`globalSearch.commandInput`:`globalSearch.input`),"aria-autocomplete":`list`,"aria-expanded":k(y),"aria-controls":dt.value?Q:void 0,"aria-activedescendant":dt.value,onKeydown:vt,onCompositionstart:n[2]||=(...e)=>k(ot)&&k(ot)(...e),onCompositionend:n[3]||=(...e)=>k(st)&&k(st)(...e)},null,40,J),[[re,k(b)]]),p(`button`,{class:`robot-close-btn`,"aria-label":k(i)(`globalSearch.close`),onClick:n[4]||=(...e)=>k(Z)&&k(Z)(...e)},[...n[11]||=[p(`div`,{class:`i-mdi:close`},null,-1)]],8,Y)]),d(` 搜索内容 `),p(`div`,{ref_key:`searchContentRef`,ref:pt,class:_([`robot-search-content`,{"robot-search-content--virtual":!k(F)&&k(b).trim()&&k(H)}])},[d(` 空状态 `),k(U)?!k(b).trim()&&k(B).length>0?(S(),f(o,{key:1},[d(` 搜索历史 `),p(`div`,ce,[p(`div`,le,[p(`div`,ue,[n[15]||=p(`div`,{class:`i-mdi:clock-time-four-outline robot-group-icon`},null,-1),m(` `+D(k(i)(`globalSearch.recent`))+` `,1),p(`span`,de,D(k(B).length),1),p(`button`,{class:`robot-clear-history`,onClick:n[5]||=(...e)=>k($e)&&k($e)(...e),title:k(i)(`globalSearch.clearHistory`),"aria-label":k(i)(`globalSearch.clearHistory`)},[...n[14]||=[p(`div`,{class:`i-mdi:delete-outline`},null,-1)]],8,fe)]),p(`div`,{id:Q,ref_key:`historyItemsRef`,ref:mt,class:`robot-group-items`,role:`listbox`,"aria-label":k(i)(`globalSearch.recent`)},[(S(!0),f(o,null,w(k(B),(e,t)=>(S(),f(`div`,{key:`history-${t}`,id:$(t),class:_(k(X)(t,!0)),role:`option`,"aria-selected":k(x)===t,"data-option-index":t,onClick:t=>k(nt)(e),onMouseenter:e=>x.value=t},[e.menuItem?.icon?(S(),u(T(e.menuItem.icon),{key:0,class:`robot-item-icon`})):(S(),f(`div`,he,[...n[16]||=[p(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),p(`div`,ge,[p(`div`,_e,D(e.query),1),p(`div`,ve,D(ut(e.menuItem?.key||``)),1)]),p(`button`,{class:`robot-history-delete`,onClick:M(e=>k(et)(t),[`stop`]),title:k(i)(`globalSearch.removeHistory`),"aria-label":k(i)(`globalSearch.removeHistory`)},[...n[17]||=[p(`div`,{class:`i-mdi:close`},null,-1)]],8,ye)],42,me))),128))],8,pe)])])],64)):k(b).trim()?(S(),f(o,{key:2},[d(` 搜索结果 `),p(`div`,be,[k(I)?(S(),f(`p`,xe,D(k(i)(`globalSearch.commandLoading`)),1)):d(`v-if`,!0),k(L)?(S(),f(`div`,Se,[m(D(k(i)(`globalSearch.commandFailed`))+` `,1),p(`button`,{type:`button`,onClick:lt},D(k(i)(`globalSearch.commandRetry`)),1)])):d(`v-if`,!0),d(` 无结果状态 `),!k(H)&&!k(I)&&!k(L)?(S(),f(`div`,Ce,[n[18]||=p(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),p(`p`,null,D(k(i)(`globalSearch.noResults`,{query:k(b)})),1)])):d(`v-if`,!0),k(H)?(S(),f(`div`,{key:3,id:k(F)?Q:void 0,role:k(F)?`listbox`:void 0,"aria-label":k(F)?k(i)(`globalSearch.commandResults`):void 0},[k(N).length?(S(),f(`div`,Te,[p(`div`,Ee,[n[19]||=p(`div`,{class:`i-mdi:menu robot-group-icon`},null,-1),m(` `+D(e.resultGroupTitle??k(i)(`globalSearch.group`))+` `,1),p(`span`,De,D(k(N).length),1)]),ee(k(a),{id:k(F)?void 0:Q,ref_key:`resultListRef`,ref:ft,class:`robot-group-items robot-virtual-items`,role:k(F)?`group`:`listbox`,"aria-label":e.resultGroupTitle??k(i)(`globalSearch.group`),items:k(N),"item-size":64,style:v({height:`${Math.min(k(N).length*64,336)}px`})},{default:ie(({item:e,index:t})=>[p(`div`,{id:$(t),class:_(k(X)(t,!1)),role:`option`,"aria-selected":k(x)===t,"aria-posinset":t+1,"aria-setsize":k(z),title:`${e.label} · ${ut(e.key)}`,onClick:t=>k(rt)(e),onMouseenter:e=>x.value=t},[e.icon?(S(),u(T(e.icon),{key:0,class:`robot-item-icon`})):(S(),f(`div`,ke,[...n[20]||=[p(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),p(`div`,Ae,[p(`div`,je,[(S(!0),f(o,null,w(k(Ze)(e.label,k(b)),(e,t)=>(S(),f(o,{key:t},[e.matched?(S(),f(`mark`,Me,D(e.text),1)):(S(),f(o,{key:1},[m(D(e.text),1)],64))],64))),128))]),p(`div`,Ne,D(ut(e.key)),1)]),e.children?.length?(S(),f(`div`,Pe,D(e.children.length),1)):d(`v-if`,!0)],42,Oe)]),_:1},8,[`id`,`role`,`aria-label`,`items`,`style`])])):d(`v-if`,!0),(S(!0),f(o,null,w(k(P),e=>(S(),f(o,{key:e.key},[e.items.length?(S(),f(`div`,{key:0,class:`robot-result-group`,role:`group`,"aria-label":e.title},[p(`div`,Ie,[m(D(e.title)+` `,1),p(`span`,Le,D(e.items.length),1)]),(S(!0),f(o,null,w(e.items,(t,r)=>(S(),f(`div`,{key:`${typeof t.key}:${t.key}`,id:$(e.start+r),class:_(k(X)(e.start+r,!1)),"aria-selected":k(x)===e.start+r,"aria-posinset":e.start+r+1,"aria-setsize":k(z),"data-command-index":e.start+r,role:`option`,onClick:n=>k(R)(e.key,t),onMouseenter:t=>x.value=e.start+r},[t.icon?(S(),u(T(t.icon),{key:0,class:`robot-item-icon`})):(S(),f(`div`,ze,[...n[21]||=[p(`div`,{class:`i-mdi:flash-outline`},null,-1)]])),p(`div`,Be,[p(`div`,Ve,D(t.label),1),t.description?(S(),f(`div`,He,D(t.description),1)):d(`v-if`,!0)])],42,Re))),128))],8,Fe)):d(`v-if`,!0)],64))),128))],8,we)):d(`v-if`,!0)])],64)):d(`v-if`,!0):(S(),f(`div`,se,[n[13]||=p(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),p(`p`,null,D(e.emptyText??k(i)(k(F)?`globalSearch.commandEmpty`:`globalSearch.empty`)),1)]))],2),d(` 搜索底部 `),p(`div`,Ue,[p(`div`,We,[p(`div`,Ge,[n[22]||=p(`kbd`,null,`↵`,-1),p(`span`,null,D(k(i)(`globalSearch.select`)),1)]),p(`div`,Ke,[n[23]||=p(`kbd`,null,`↑↓`,-1),p(`span`,null,D(k(i)(`globalSearch.navigate`)),1)]),p(`div`,qe,[n[24]||=p(`kbd`,null,`esc`,-1),p(`span`,null,D(k(i)(`globalSearch.closeHint`)),1)])]),k(U)?(S(),f(`div`,Je,[k(b).trim()&&k(H)?(S(),f(`span`,Ye,D(k(i)(`globalSearch.resultCount`,{count:k(z)})),1)):!k(b).trim()&&k(B).length>0?(S(),f(`span`,Xe,D(k(i)(`globalSearch.historyCount`,{count:k(B).length})),1)):d(`v-if`,!0)])):d(`v-if`,!0)])],10,K)],36)):d(`v-if`,!0)]),_:1})]))],4))}}),[[`__scopeId`,`data-v-ee5a0539`]]);export{V as n,X as t};
package/dist/C_Guide.css CHANGED
@@ -85,11 +85,57 @@
85
85
  * @Description: 引导入口键盘焦点样式,不依赖宿主样式
86
86
  * Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
87
87
  */
88
- .c-guide-trigger[data-v-28c9b4f0]:focus-visible {
88
+ .c-guide-trigger[data-v-96c38480]:focus-visible {
89
89
  outline: 2px solid var(--c-primary, var(--c-theme-primary, #2080f0));
90
90
  outline-offset: 4px;
91
91
  border-radius: 4px;
92
92
  }
93
+ .c-guide-checklist[data-v-96c38480] {
94
+ display: grid;
95
+ gap: 8px;
96
+ color: var(--c-text-1, var(--c-theme-text-1));
97
+ }
98
+ .c-guide-checklist header[data-v-96c38480],
99
+ .c-guide-checklist button[data-v-96c38480] {
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: space-between;
103
+ gap: 8px;
104
+ overflow-wrap: anywhere;
105
+ }
106
+ .c-guide-checklist ul[data-v-96c38480] {
107
+ display: grid;
108
+ gap: 4px;
109
+ margin: 0;
110
+ padding: 0;
111
+ list-style: none;
112
+ }
113
+ .c-guide-checklist button[data-v-96c38480] {
114
+ width: 100%;
115
+ padding: 6px 8px;
116
+ border: 1px solid var(--c-border, var(--c-theme-border));
117
+ border-radius: var(--c-radius, var(--c-theme-radius));
118
+ background: var(--c-bg-card, var(--c-theme-bg-card));
119
+ color: inherit;
120
+ font: inherit;
121
+ text-align: start;
122
+ cursor: pointer;
123
+ }
124
+ .c-guide-checklist button[data-v-96c38480]:hover:not(:disabled) {
125
+ background: var(--c-bg-hover, var(--c-theme-bg-hover));
126
+ }
127
+ .c-guide-checklist button[data-v-96c38480]:focus-visible {
128
+ outline: 2px solid var(--c-primary, var(--c-theme-primary));
129
+ outline-offset: 2px;
130
+ }
131
+ .c-guide-checklist header span[data-v-96c38480],
132
+ .c-guide-checklist button span[data-v-96c38480]:last-child {
133
+ color: var(--c-text-2, var(--c-theme-text-2));
134
+ font-size: 0.875em;
135
+ }
136
+ .c-guide-checklist button .is-complete[data-v-96c38480] {
137
+ color: var(--c-success, var(--c-theme-success));
138
+ }
93
139
  /*
94
140
  * @Author: ChenYu ycyplus@gmail.com
95
141
  * @Date: 2026-10-04
@@ -203,5 +249,5 @@
203
249
  }
204
250
 
205
251
  /* layer: default */
206
- .m62[data-v-28c9b4f0]{margin:15.5rem;}
207
- .hidden[data-v-28c9b4f0]{display:none;}
252
+ .m62[data-v-96c38480]{margin:15.5rem;}
253
+ .hidden[data-v-96c38480]{display:none;}
@@ -1,2 +1,2 @@
1
- import { a as GuideProps, c as GuideTheme, i as GuidePersistence, n as GuideExpose, o as GuideStep, r as GuideIllustration, s as GuideTarget, t as _default } from "./index17.vue.cjs";
1
+ import { a as GuideProps, c as GuideTheme, i as GuidePersistence, n as GuideExpose, o as GuideStep, r as GuideIllustration, s as GuideTarget, t as _default } from "./index21.vue.cjs";
2
2
  export { _default as C_Guide, type GuideExpose, type GuideIllustration, type GuidePersistence, type GuideProps, type GuideStep, type GuideTarget, type GuideTheme };
package/dist/C_Guide.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as GuideProps, c as GuideTheme, i as GuidePersistence, n as GuideExpose, o as GuideStep, r as GuideIllustration, s as GuideTarget, t as _default } from "./index16.vue.js";
1
+ import { a as GuideProps, c as GuideTheme, i as GuidePersistence, n as GuideExpose, o as GuideStep, r as GuideIllustration, s as GuideTarget, t as _default } from "./index20.vue.js";
2
2
  export { _default as C_Guide, type GuideExpose, type GuideIllustration, type GuidePersistence, type GuideProps, type GuideStep, type GuideTarget, type GuideTheme };
package/dist/C_Guide2.cjs CHANGED
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Icon2.cjs`),r=require(`./useScopedComponentLocale.cjs`);let i=require(`vue`),a=require(`naive-ui`);const o={navigation:`<rect x="34" y="12" width="56" height="72" rx="6" fill="currentColor" opacity=".12"/><path d="M46 30h30M46 48h30M46 66h20"/><rect x="108" y="12" width="118" height="72" rx="6" fill="currentColor" opacity=".07"/><path d="M122 32h64M122 48h90M122 64h74"/>`,search:`<rect x="28" y="26" width="204" height="44" rx="10" fill="currentColor" opacity=".09"/><circle cx="56" cy="46" r="8"/><path d="m62 52 6 6M86 44h104M86 55h70"/>`,tabs:`<rect x="28" y="24" width="204" height="56" rx="6" fill="currentColor" opacity=".07"/><rect x="40" y="16" width="58" height="26" rx="6" fill="currentColor" opacity=".2"/><path d="M50 29h25m10-3 6 6m0-6-6 6M112 29h38M166 29h38M44 56h100M44 67h144"/>`,account:`<circle cx="60" cy="48" r="22" fill="currentColor" opacity=".12"/><circle cx="60" cy="41" r="6"/><path d="M49 60c0-13 22-13 22 0M94 40h40m-8-6 8 6-8 6M94 58h40m-32-6-8 6 8 6"/><rect x="154" y="20" width="62" height="56" rx="6" fill="currentColor" opacity=".09"/><path d="M168 36h34M168 48h34M168 60h22"/>`,overview:`<rect x="28" y="14" width="204" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M42 30h76M42 42h52"/><rect x="42" y="54" width="48" height="16" rx="4"/><rect x="106" y="54" width="48" height="16" rx="4"/><rect x="170" y="54" width="48" height="16" rx="4"/>`,notification:`<circle cx="130" cy="48" r="36" fill="currentColor" opacity=".07"/><path d="M109 63h42l-6-10V40a15 15 0 0 0-30 0v13l-6 10ZM124 71h12"/><circle cx="150" cy="26" r="8" fill="currentColor" opacity=".3"/>`,fullscreen:`<rect x="50" y="14" width="160" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M66 40V28h20M174 28h20v12M66 56v12h20M174 68h20V56"/><rect x="106" y="34" width="48" height="28" rx="4"/>`,language:`<rect x="54" y="18" width="72" height="54" rx="8" fill="currentColor" opacity=".1"/><rect x="134" y="24" width="72" height="54" rx="8" fill="currentColor" opacity=".07"/><path d="M70 34h40M90 27v7M79 34c2 15 9 22 27 28M101 34c-3 15-13 24-28 29M151 64l16-27 16 27M158 53h18"/>`,theme:`<circle cx="78" cy="48" r="15" fill="currentColor" opacity=".12"/><path d="M78 24v-6M78 78v-6M54 48h-6M108 48h-6M61 31l-5-5M100 70l-5-5M61 65l-5 5M100 26l-5 5M168 22a26 26 0 1 0 28 42 26 26 0 0 1-28-42Z"/>`,settings:`<rect x="44" y="14" width="172" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M62 31h136M62 48h136M62 65h136"/><circle cx="94" cy="31" r="5" fill="currentColor"/><circle cx="168" cy="48" r="5" fill="currentColor"/><circle cx="124" cy="65" r="5" fill="currentColor"/>`};function s(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function c(e){if(!(!e||typeof document>`u`))return(typeof e==`string`?Array.from(document.querySelectorAll(e)):[typeof e==`function`?e():e]).find(e=>{if(!e?.isConnected)return!1;let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView?.getComputedStyle(e);return s(t)&&n?.visibility!==`hidden`})}function l(e){let{illustration:t}=e.popover,n=t&&o[t];return n?`<div class="c-guide-figure"><svg viewBox="0 0 260 96" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">${n}</svg></div><div class="c-guide-copy">${e.popover.description}</div>`:e.popover.description}const u=Object.freeze({"guide.done":`完成`,"guide.next":`下一步`,"guide.previous":`上一步`,"guide.skip":`跳过引导`,"guide.trigger":`功能引导`}),d=Object.freeze({"guide.done":`Done`,"guide.next":`Next`,"guide.previous":`Previous`,"guide.skip":`Skip guide`,"guide.trigger":`Feature guide`}),f=()=>r.t(u,d),p=(0,i.defineComponent)({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},doneBtnText:{},nextBtnText:{},prevBtnText:{},showSkipButton:{type:Boolean,default:!0},skipBtnText:{},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},skipMissingElements:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`skip`,`step-change`,`error`],setup(t,{expose:r,emit:o}){let s=e.n(),{t:u}=f(),d=t,p=o,m=(0,i.computed)(()=>({done:d.doneBtnText??u(`guide.done`),next:d.nextBtnText??u(`guide.next`),previous:d.prevBtnText??u(`guide.previous`),skip:d.skipBtnText??u(`guide.skip`)})),h=(0,i.ref)(!1),g=(0,i.computed)(()=>`${d.persistence?.keyPrefix??`c_guide`}_completed`),_=null,v,y=0,b=()=>{if(!d.persistence?.enabled)return!1;try{return localStorage.getItem(g.value)===`true`}catch{return!1}},x=()=>{if(d.persistence?.enabled)try{localStorage.setItem(g.value,`true`)}catch{}},S=()=>{try{localStorage.removeItem(g.value)}catch{}},C=()=>{y++,h.value=!1;let e=v;v=void 0,e?.()},w=()=>{let e=d.theme??{};return{"--c-guide-bg":e.popoverBgColor??`var(--c-bg-surface, var(--c-theme-bg-surface))`,"--c-guide-text":e.popoverTextColor??`var(--c-text-1, var(--c-theme-text-1))`,"--c-guide-text-secondary":e.popoverTextColor??`var(--c-text-2, var(--c-theme-text-2))`,"--c-guide-text-muted":`var(--c-text-3, var(--c-theme-text-3))`,"--c-guide-primary":e.primaryColor??`var(--c-primary, var(--c-theme-primary))`,"--c-guide-primary-hover":e.primaryColor??`var(--c-primary-hover, var(--c-theme-primary-hover))`,"--c-guide-border":`var(--c-border, var(--c-theme-border))`,"--c-guide-radius":e.borderRadius??`14px`}},T=[],E=e=>{for(let t of T)e.wrapper.style.removeProperty(t);let t=w();for(let[e,n]of Object.entries(s.value))n!=null&&(t[e]=String(n));T=Object.keys(t);for(let[n,r]of Object.entries(t))e.wrapper.style.setProperty(n,r)},D=()=>d.theme?.overlayOpacity===void 0?{}:{overlayOpacity:d.theme.overlayOpacity},O=e=>h.value||!e&&b(),k=async(e=!1)=>{if(O(e))return;C();let t=y;h.value=!0;try{let{driver:e}=await import(`driver.js`);if(t!==y)return;let n=d.steps.filter(e=>!e.skipIf?.()&&(!d.skipMissingElements||!e.element||c(e.element)));if(!n.length)return;let r=`close`,i=0,a=!1,o=!1,s=e=>{e.nextButton.disabled=o,e.previousButton.disabled=o},u=()=>{a||(a=!0,_===b&&(_=null,v=void 0),r===`complete`?(x(),p(`complete`)):r!==`dispose`&&(r===`skip`&&p(`skip`,i),p(`close`,i)))},f=()=>{b.destroy(),u()},h=()=>{o||(b.isLastStep()?(r=`complete`,f()):b.moveNext())},g=D(),b=e({popoverClass:`c-guide-popover ${d.popoverClass}`.trim(),animate:d.animate&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,showProgress:d.showProgress,progressText:`{{current}} / {{total}}`,allowClose:d.allowClose,allowKeyboardControl:d.keyboard,skipMissingElement:d.skipMissingElements,...g,doneBtnText:m.value.done,nextBtnText:m.value.next,prevBtnText:m.value.previous,steps:n.map(e=>({element:e.element?()=>c(e.element):void 0,popover:{...e.popover,description:l(e)},onHighlightStarted:(t,n,{state:r})=>{o=!0,i=r.activeIndex??i,e.onHighlightStarted?.(t,e),p(`step-change`,i,e)},onHighlighted:()=>{o=!1;let{popover:e}=b.getState();e&&s(e)},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(E(e),s(e),d.showSkipButton&&d.allowClose){let t=document.createElement(`button`);t.type=`button`,t.className=`c-guide-skip-btn`,t.textContent=m.value.skip,t.addEventListener(`click`,()=>{r=`skip`,f()}),e.footer.prepend(t)}},onNextClick:h,onPrevClick:()=>{o||b.movePrevious()},onDestroyStarted:f,onDestroyed:u});_=b,v=()=>{r=`dispose`,f()},p(`start`),t===y&&b.drive()}catch(e){t===y&&(C(),p(`error`,e))}finally{t===y&&(h.value=!1)}};return(0,i.watch)(m,({done:e,next:t,previous:n,skip:r})=>{if(!_)return;_.setConfig({..._.getConfig(),doneBtnText:e,nextBtnText:t,prevBtnText:n});let{popover:i}=_.getState();if(i){i.nextButton.textContent=_.isLastStep()?e:t,i.previousButton.textContent=n;let a=i.footer.querySelector(`.c-guide-skip-btn`);a&&(a.textContent=r)}}),(0,i.onBeforeUnmount)(C),(0,i.watch)(()=>d.steps,C),(0,i.watch)([s,()=>d.theme],()=>{let e=_?.getState().popover;e&&E(e)},{deep:!0}),r({startGuide:k,stopGuide:C,resetCompleted:S,isCompleted:b}),(e,t)=>d.showTrigger?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(a.NTooltip),{key:0,placement:`bottom`,trigger:`hover`},{trigger:(0,i.withCtx)(()=>[(0,i.createVNode)((0,i.unref)(a.NButton),{class:`c-guide-trigger`,style:(0,i.normalizeStyle)((0,i.unref)(s)),text:``,loading:h.value,"aria-label":d.triggerTooltip??(0,i.unref)(u)(`guide.trigger`),onClick:t[0]||=e=>k(!0)},{default:(0,i.withCtx)(()=>[(0,i.createVNode)(n.t,{name:d.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`style`,`loading`,`aria-label`])]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(d.triggerTooltip??(0,i.unref)(u)(`guide.trigger`)),1)]),_:1})):(0,i.createCommentVNode)(`v-if`,!0)}});var m=t.t(p,[[`__scopeId`,`data-v-28c9b4f0`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
1
+ require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Icon2.cjs`),r=require(`./useScopedComponentLocale.cjs`);let i=require(`vue`),a=require(`naive-ui`);const o={navigation:`<rect x="34" y="12" width="56" height="72" rx="6" fill="currentColor" opacity=".12"/><path d="M46 30h30M46 48h30M46 66h20"/><rect x="108" y="12" width="118" height="72" rx="6" fill="currentColor" opacity=".07"/><path d="M122 32h64M122 48h90M122 64h74"/>`,search:`<rect x="28" y="26" width="204" height="44" rx="10" fill="currentColor" opacity=".09"/><circle cx="56" cy="46" r="8"/><path d="m62 52 6 6M86 44h104M86 55h70"/>`,tabs:`<rect x="28" y="24" width="204" height="56" rx="6" fill="currentColor" opacity=".07"/><rect x="40" y="16" width="58" height="26" rx="6" fill="currentColor" opacity=".2"/><path d="M50 29h25m10-3 6 6m0-6-6 6M112 29h38M166 29h38M44 56h100M44 67h144"/>`,account:`<circle cx="60" cy="48" r="22" fill="currentColor" opacity=".12"/><circle cx="60" cy="41" r="6"/><path d="M49 60c0-13 22-13 22 0M94 40h40m-8-6 8 6-8 6M94 58h40m-32-6-8 6 8 6"/><rect x="154" y="20" width="62" height="56" rx="6" fill="currentColor" opacity=".09"/><path d="M168 36h34M168 48h34M168 60h22"/>`,overview:`<rect x="28" y="14" width="204" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M42 30h76M42 42h52"/><rect x="42" y="54" width="48" height="16" rx="4"/><rect x="106" y="54" width="48" height="16" rx="4"/><rect x="170" y="54" width="48" height="16" rx="4"/>`,notification:`<circle cx="130" cy="48" r="36" fill="currentColor" opacity=".07"/><path d="M109 63h42l-6-10V40a15 15 0 0 0-30 0v13l-6 10ZM124 71h12"/><circle cx="150" cy="26" r="8" fill="currentColor" opacity=".3"/>`,fullscreen:`<rect x="50" y="14" width="160" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M66 40V28h20M174 28h20v12M66 56v12h20M174 68h20V56"/><rect x="106" y="34" width="48" height="28" rx="4"/>`,language:`<rect x="54" y="18" width="72" height="54" rx="8" fill="currentColor" opacity=".1"/><rect x="134" y="24" width="72" height="54" rx="8" fill="currentColor" opacity=".07"/><path d="M70 34h40M90 27v7M79 34c2 15 9 22 27 28M101 34c-3 15-13 24-28 29M151 64l16-27 16 27M158 53h18"/>`,theme:`<circle cx="78" cy="48" r="15" fill="currentColor" opacity=".12"/><path d="M78 24v-6M78 78v-6M54 48h-6M108 48h-6M61 31l-5-5M100 70l-5-5M61 65l-5 5M100 26l-5 5M168 22a26 26 0 1 0 28 42 26 26 0 0 1-28-42Z"/>`,settings:`<rect x="44" y="14" width="172" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M62 31h136M62 48h136M62 65h136"/><circle cx="94" cy="31" r="5" fill="currentColor"/><circle cx="168" cy="48" r="5" fill="currentColor"/><circle cx="124" cy="65" r="5" fill="currentColor"/>`};function s(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function c(e){if(!(!e||typeof document>`u`))return(typeof e==`string`?Array.from(document.querySelectorAll(e)):[typeof e==`function`?e():e]).find(e=>{if(!e?.isConnected)return!1;let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView?.getComputedStyle(e);return s(t)&&n?.visibility!==`hidden`})}function l(e){let{illustration:t}=e.popover,n=t&&o[t];return n?`<div class="c-guide-figure"><svg viewBox="0 0 260 96" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">${n}</svg></div><div class="c-guide-copy">${e.popover.description}</div>`:e.popover.description}const u=Object.freeze({"guide.done":`完成`,"guide.next":`下一步`,"guide.previous":`上一步`,"guide.skip":`跳过引导`,"guide.trigger":`功能引导`,"guide.waitingForAction":`完成当前操作后继续`,"guide.checklist":`操作清单`,"guide.checklistProgress":`已完成 {done} / {total} 项`,"guide.checklistDone":`已完成`,"guide.checklistPending":`待完成`}),d=Object.freeze({"guide.done":`Done`,"guide.next":`Next`,"guide.previous":`Previous`,"guide.skip":`Skip guide`,"guide.trigger":`Feature guide`,"guide.waitingForAction":`Complete the current action to continue`,"guide.checklist":`Task checklist`,"guide.checklistProgress":`{done} of {total} tasks complete`,"guide.checklistDone":`Complete`,"guide.checklistPending":`Pending`}),f=()=>r.t(u,d),p=[`aria-label`],m={role:`status`},h=[`disabled`,`onClick`],g=(0,i.defineComponent)({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},checklist:{},doneBtnText:{},nextBtnText:{},prevBtnText:{},showSkipButton:{type:Boolean,default:!0},skipBtnText:{},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},skipMissingElements:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`skip`,`step-change`,`error`],setup(t,{expose:r,emit:o}){let s=e.n(),{t:u}=f(),d=t,g=o,_=(0,i.computed)(()=>({done:d.doneBtnText??u(`guide.done`),next:d.nextBtnText??u(`guide.next`),previous:d.prevBtnText??u(`guide.previous`),skip:d.skipBtnText??u(`guide.skip`)})),v=(0,i.ref)(!1),y=(0,i.computed)(()=>{if(!d.checklist)return[];let e=new Set(d.checklist.completedIds);return d.steps.flatMap(t=>t.id&&!t.skipIf?.()?[{id:t.id,title:t.popover.title,done:e.has(t.id)}]:[])}),b=(0,i.computed)(()=>y.value.filter(e=>e.done).length),x=(0,i.computed)(()=>`${d.persistence?.keyPrefix??`c_guide`}_completed`),S=null,C,w,T=0,E=()=>{if(!d.persistence?.enabled)return!1;try{return localStorage.getItem(x.value)===`true`}catch{return!1}},D=()=>{if(d.persistence?.enabled)try{localStorage.setItem(x.value,`true`)}catch{}},O=()=>{try{localStorage.removeItem(x.value)}catch{}},k=()=>{T++,v.value=!1;let e=C;C=void 0,w=void 0,e?.()},A=()=>{let e=d.theme??{};return{"--c-guide-bg":e.popoverBgColor??`var(--c-bg-surface, var(--c-theme-bg-surface))`,"--c-guide-text":e.popoverTextColor??`var(--c-text-1, var(--c-theme-text-1))`,"--c-guide-text-secondary":e.popoverTextColor??`var(--c-text-2, var(--c-theme-text-2))`,"--c-guide-text-muted":`var(--c-text-3, var(--c-theme-text-3))`,"--c-guide-primary":e.primaryColor??`var(--c-primary, var(--c-theme-primary))`,"--c-guide-primary-hover":e.primaryColor??`var(--c-primary-hover, var(--c-theme-primary-hover))`,"--c-guide-border":`var(--c-border, var(--c-theme-border))`,"--c-guide-radius":e.borderRadius??`14px`}},j=[],M=e=>{for(let t of j)e.wrapper.style.removeProperty(t);let t=A();for(let[e,n]of Object.entries(s.value))n!=null&&(t[e]=String(n));j=Object.keys(t);for(let[n,r]of Object.entries(t))e.wrapper.style.setProperty(n,r)},N=()=>d.theme?.overlayOpacity===void 0?{}:{overlayOpacity:d.theme.overlayOpacity},P=e=>v.value||!e&&E(),F=()=>d.animate&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;function I(e){let t=d.steps.filter(e=>!e.skipIf?.()&&(!d.skipMissingElements||!e.element||c(e.element))),n=e===void 0?0:t.findIndex(t=>t.id===e);if(t[n])return{activeSteps:t,initialIndex:n}}let L=async(e=!1,t)=>{if(P(e))return;k();let n=T;v.value=!0;try{let{driver:e}=await import(`driver.js`);if(n!==T)return;let r=I(t);if(!r)return;let{activeSteps:i,initialIndex:a}=r,o=`close`,s=a,f=!1,p=!1,m=new Set(d.checklist?.completedIds),h=new Set(i.flatMap((e,t)=>e.id&&m.has(e.id)?[t]:[])),v=!1,y=()=>!!i[s]?.action&&!h.has(s),b=e=>{let t=y();e.nextButton.disabled=p||t,t?e.nextButton.title=u(`guide.waitingForAction`):e.nextButton.removeAttribute(`title`),e.previousButton.disabled=p},x=()=>{f||(f=!0,S===A&&(S=null,C=void 0,w=void 0),o===`complete`?(D(),g(`complete`)):o!==`dispose`&&(o===`skip`&&g(`skip`,s),g(`close`,s)))},E=()=>{A.destroy(),x()},O=()=>{p||y()||(A.isLastStep()?(o=`complete`,E()):A.moveNext())},k=N(),A=e({popoverClass:`c-guide-popover ${d.popoverClass}`.trim(),animate:F(),showProgress:d.showProgress,progressText:`{{current}} / {{total}}`,allowClose:d.allowClose,allowKeyboardControl:d.keyboard,skipMissingElement:d.skipMissingElements,...k,doneBtnText:_.value.done,nextBtnText:_.value.next,prevBtnText:_.value.previous,steps:i.map(e=>({element:e.element?()=>c(e.element):void 0,popover:{...e.popover,description:l(e)},onHighlightStarted:(t,n,{state:r})=>{p=!0,s=r.activeIndex??s,e.onHighlightStarted?.(t,e),g(`step-change`,s,e)},onHighlighted:()=>{p=!1;let{popover:e}=A.getState();if(e&&b(e),v){v=!1;let e=s;queueMicrotask(()=>{S===A&&e===s&&O()})}},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(M(e),b(e),d.showSkipButton&&d.allowClose){let t=document.createElement(`button`);t.type=`button`,t.className=`c-guide-skip-btn`,t.textContent=_.value.skip,t.addEventListener(`click`,()=>{o=`skip`,E()}),e.footer.prepend(t)}},onNextClick:O,onPrevClick:()=>{p||A.movePrevious()},onDestroyStarted:E,onDestroyed:x});S=A,w=e=>A.getActiveIndex()!==s||!y()||i[s]?.action!==e?!1:(h.add(s),p?v=!0:O(),!0),C=()=>{o=`dispose`,E()},g(`start`),n===T&&A.drive(a)}catch(e){n===T&&(k(),g(`error`,e))}finally{n===T&&(v.value=!1)}};return(0,i.watch)(_,({done:e,next:t,previous:n,skip:r})=>{if(!S)return;S.setConfig({...S.getConfig(),doneBtnText:e,nextBtnText:t,prevBtnText:n});let{popover:i}=S.getState();if(i){i.nextButton.textContent=S.isLastStep()?e:t,i.previousButton.textContent=n;let a=i.footer.querySelector(`.c-guide-skip-btn`);a&&(a.textContent=r)}}),(0,i.onBeforeUnmount)(k),(0,i.watch)(()=>d.steps,k),(0,i.watch)([s,()=>d.theme],()=>{let e=S?.getState().popover;e&&M(e)},{deep:!0}),r({startGuide:L,completeAction:e=>w?.(e)??!1,stopGuide:k,resetCompleted:O,isCompleted:E}),(e,t)=>d.checklist?((0,i.openBlock)(),(0,i.createElementBlock)(`section`,{key:0,class:`c-guide-checklist`,style:(0,i.normalizeStyle)((0,i.unref)(s)),"aria-label":d.checklist.title||(0,i.unref)(u)(`guide.checklist`)},[(0,i.createElementVNode)(`header`,null,[(0,i.createElementVNode)(`strong`,null,(0,i.toDisplayString)(d.checklist.title||(0,i.unref)(u)(`guide.checklist`)),1),(0,i.createElementVNode)(`span`,m,(0,i.toDisplayString)((0,i.unref)(u)(`guide.checklistProgress`,{done:b.value,total:y.value.length})),1)]),(0,i.createElementVNode)(`ul`,null,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(y.value,e=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{key:e.id},[(0,i.createElementVNode)(`button`,{type:`button`,disabled:v.value,onClick:t=>L(!0,e.id)},[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(e.title),1),(0,i.createElementVNode)(`span`,{class:(0,i.normalizeClass)({"is-complete":e.done})},(0,i.toDisplayString)((0,i.unref)(u)(e.done?`guide.checklistDone`:`guide.checklistPending`)),3)],8,h)]))),128))])],12,p)):d.showTrigger?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(a.NTooltip),{key:1,placement:`bottom`,trigger:`hover`},{trigger:(0,i.withCtx)(()=>[(0,i.createVNode)((0,i.unref)(a.NButton),{class:`c-guide-trigger`,style:(0,i.normalizeStyle)((0,i.unref)(s)),text:``,loading:v.value,"aria-label":d.triggerTooltip??(0,i.unref)(u)(`guide.trigger`),onClick:t[0]||=e=>L(!0)},{default:(0,i.withCtx)(()=>[(0,i.createVNode)(n.t,{name:d.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`style`,`loading`,`aria-label`])]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)(d.triggerTooltip??(0,i.unref)(u)(`guide.trigger`)),1)]),_:1})):(0,i.createCommentVNode)(`v-if`,!0)}});var _=t.t(g,[[`__scopeId`,`data-v-96c38480`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}});
package/dist/C_Guide2.js CHANGED
@@ -1 +1 @@
1
- import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./C_Icon2.js";import{t as r}from"./useScopedComponentLocale.js";import{computed as i,createBlock as a,createCommentVNode as o,createElementVNode as s,createVNode as c,defineComponent as l,normalizeStyle as u,onBeforeUnmount as d,openBlock as f,ref as p,toDisplayString as m,unref as h,watch as g,withCtx as _}from"vue";import{NButton as v,NTooltip as y}from"naive-ui";const b={navigation:`<rect x="34" y="12" width="56" height="72" rx="6" fill="currentColor" opacity=".12"/><path d="M46 30h30M46 48h30M46 66h20"/><rect x="108" y="12" width="118" height="72" rx="6" fill="currentColor" opacity=".07"/><path d="M122 32h64M122 48h90M122 64h74"/>`,search:`<rect x="28" y="26" width="204" height="44" rx="10" fill="currentColor" opacity=".09"/><circle cx="56" cy="46" r="8"/><path d="m62 52 6 6M86 44h104M86 55h70"/>`,tabs:`<rect x="28" y="24" width="204" height="56" rx="6" fill="currentColor" opacity=".07"/><rect x="40" y="16" width="58" height="26" rx="6" fill="currentColor" opacity=".2"/><path d="M50 29h25m10-3 6 6m0-6-6 6M112 29h38M166 29h38M44 56h100M44 67h144"/>`,account:`<circle cx="60" cy="48" r="22" fill="currentColor" opacity=".12"/><circle cx="60" cy="41" r="6"/><path d="M49 60c0-13 22-13 22 0M94 40h40m-8-6 8 6-8 6M94 58h40m-32-6-8 6 8 6"/><rect x="154" y="20" width="62" height="56" rx="6" fill="currentColor" opacity=".09"/><path d="M168 36h34M168 48h34M168 60h22"/>`,overview:`<rect x="28" y="14" width="204" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M42 30h76M42 42h52"/><rect x="42" y="54" width="48" height="16" rx="4"/><rect x="106" y="54" width="48" height="16" rx="4"/><rect x="170" y="54" width="48" height="16" rx="4"/>`,notification:`<circle cx="130" cy="48" r="36" fill="currentColor" opacity=".07"/><path d="M109 63h42l-6-10V40a15 15 0 0 0-30 0v13l-6 10ZM124 71h12"/><circle cx="150" cy="26" r="8" fill="currentColor" opacity=".3"/>`,fullscreen:`<rect x="50" y="14" width="160" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M66 40V28h20M174 28h20v12M66 56v12h20M174 68h20V56"/><rect x="106" y="34" width="48" height="28" rx="4"/>`,language:`<rect x="54" y="18" width="72" height="54" rx="8" fill="currentColor" opacity=".1"/><rect x="134" y="24" width="72" height="54" rx="8" fill="currentColor" opacity=".07"/><path d="M70 34h40M90 27v7M79 34c2 15 9 22 27 28M101 34c-3 15-13 24-28 29M151 64l16-27 16 27M158 53h18"/>`,theme:`<circle cx="78" cy="48" r="15" fill="currentColor" opacity=".12"/><path d="M78 24v-6M78 78v-6M54 48h-6M108 48h-6M61 31l-5-5M100 70l-5-5M61 65l-5 5M100 26l-5 5M168 22a26 26 0 1 0 28 42 26 26 0 0 1-28-42Z"/>`,settings:`<rect x="44" y="14" width="172" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M62 31h136M62 48h136M62 65h136"/><circle cx="94" cy="31" r="5" fill="currentColor"/><circle cx="168" cy="48" r="5" fill="currentColor"/><circle cx="124" cy="65" r="5" fill="currentColor"/>`};function x(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function S(e){if(!(!e||typeof document>`u`))return(typeof e==`string`?Array.from(document.querySelectorAll(e)):[typeof e==`function`?e():e]).find(e=>{if(!e?.isConnected)return!1;let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView?.getComputedStyle(e);return x(t)&&n?.visibility!==`hidden`})}function C(e){let{illustration:t}=e.popover,n=t&&b[t];return n?`<div class="c-guide-figure"><svg viewBox="0 0 260 96" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">${n}</svg></div><div class="c-guide-copy">${e.popover.description}</div>`:e.popover.description}const w=Object.freeze({"guide.done":`完成`,"guide.next":`下一步`,"guide.previous":`上一步`,"guide.skip":`跳过引导`,"guide.trigger":`功能引导`}),T=Object.freeze({"guide.done":`Done`,"guide.next":`Next`,"guide.previous":`Previous`,"guide.skip":`Skip guide`,"guide.trigger":`Feature guide`}),E=()=>r(w,T);var D=t(l({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},doneBtnText:{},nextBtnText:{},prevBtnText:{},showSkipButton:{type:Boolean,default:!0},skipBtnText:{},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},skipMissingElements:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`skip`,`step-change`,`error`],setup(t,{expose:r,emit:l}){let b=e(),{t:x}=E(),w=t,T=l,D=i(()=>({done:w.doneBtnText??x(`guide.done`),next:w.nextBtnText??x(`guide.next`),previous:w.prevBtnText??x(`guide.previous`),skip:w.skipBtnText??x(`guide.skip`)})),O=p(!1),k=i(()=>`${w.persistence?.keyPrefix??`c_guide`}_completed`),A=null,j,M=0,N=()=>{if(!w.persistence?.enabled)return!1;try{return localStorage.getItem(k.value)===`true`}catch{return!1}},P=()=>{if(w.persistence?.enabled)try{localStorage.setItem(k.value,`true`)}catch{}},F=()=>{try{localStorage.removeItem(k.value)}catch{}},I=()=>{M++,O.value=!1;let e=j;j=void 0,e?.()},L=()=>{let e=w.theme??{};return{"--c-guide-bg":e.popoverBgColor??`var(--c-bg-surface, var(--c-theme-bg-surface))`,"--c-guide-text":e.popoverTextColor??`var(--c-text-1, var(--c-theme-text-1))`,"--c-guide-text-secondary":e.popoverTextColor??`var(--c-text-2, var(--c-theme-text-2))`,"--c-guide-text-muted":`var(--c-text-3, var(--c-theme-text-3))`,"--c-guide-primary":e.primaryColor??`var(--c-primary, var(--c-theme-primary))`,"--c-guide-primary-hover":e.primaryColor??`var(--c-primary-hover, var(--c-theme-primary-hover))`,"--c-guide-border":`var(--c-border, var(--c-theme-border))`,"--c-guide-radius":e.borderRadius??`14px`}},R=[],z=e=>{for(let t of R)e.wrapper.style.removeProperty(t);let t=L();for(let[e,n]of Object.entries(b.value))n!=null&&(t[e]=String(n));R=Object.keys(t);for(let[n,r]of Object.entries(t))e.wrapper.style.setProperty(n,r)},B=()=>w.theme?.overlayOpacity===void 0?{}:{overlayOpacity:w.theme.overlayOpacity},V=e=>O.value||!e&&N(),H=async(e=!1)=>{if(V(e))return;I();let t=M;O.value=!0;try{let{driver:e}=await import(`driver.js`);if(t!==M)return;let n=w.steps.filter(e=>!e.skipIf?.()&&(!w.skipMissingElements||!e.element||S(e.element)));if(!n.length)return;let r=`close`,i=0,a=!1,o=!1,s=e=>{e.nextButton.disabled=o,e.previousButton.disabled=o},c=()=>{a||(a=!0,A===f&&(A=null,j=void 0),r===`complete`?(P(),T(`complete`)):r!==`dispose`&&(r===`skip`&&T(`skip`,i),T(`close`,i)))},l=()=>{f.destroy(),c()},u=()=>{o||(f.isLastStep()?(r=`complete`,l()):f.moveNext())},d=B(),f=e({popoverClass:`c-guide-popover ${w.popoverClass}`.trim(),animate:w.animate&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,showProgress:w.showProgress,progressText:`{{current}} / {{total}}`,allowClose:w.allowClose,allowKeyboardControl:w.keyboard,skipMissingElement:w.skipMissingElements,...d,doneBtnText:D.value.done,nextBtnText:D.value.next,prevBtnText:D.value.previous,steps:n.map(e=>({element:e.element?()=>S(e.element):void 0,popover:{...e.popover,description:C(e)},onHighlightStarted:(t,n,{state:r})=>{o=!0,i=r.activeIndex??i,e.onHighlightStarted?.(t,e),T(`step-change`,i,e)},onHighlighted:()=>{o=!1;let{popover:e}=f.getState();e&&s(e)},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(z(e),s(e),w.showSkipButton&&w.allowClose){let t=document.createElement(`button`);t.type=`button`,t.className=`c-guide-skip-btn`,t.textContent=D.value.skip,t.addEventListener(`click`,()=>{r=`skip`,l()}),e.footer.prepend(t)}},onNextClick:u,onPrevClick:()=>{o||f.movePrevious()},onDestroyStarted:l,onDestroyed:c});A=f,j=()=>{r=`dispose`,l()},T(`start`),t===M&&f.drive()}catch(e){t===M&&(I(),T(`error`,e))}finally{t===M&&(O.value=!1)}};return g(D,({done:e,next:t,previous:n,skip:r})=>{if(!A)return;A.setConfig({...A.getConfig(),doneBtnText:e,nextBtnText:t,prevBtnText:n});let{popover:i}=A.getState();if(i){i.nextButton.textContent=A.isLastStep()?e:t,i.previousButton.textContent=n;let a=i.footer.querySelector(`.c-guide-skip-btn`);a&&(a.textContent=r)}}),d(I),g(()=>w.steps,I),g([b,()=>w.theme],()=>{let e=A?.getState().popover;e&&z(e)},{deep:!0}),r({startGuide:H,stopGuide:I,resetCompleted:F,isCompleted:N}),(e,t)=>w.showTrigger?(f(),a(h(y),{key:0,placement:`bottom`,trigger:`hover`},{trigger:_(()=>[c(h(v),{class:`c-guide-trigger`,style:u(h(b)),text:``,loading:O.value,"aria-label":w.triggerTooltip??h(x)(`guide.trigger`),onClick:t[0]||=e=>H(!0)},{default:_(()=>[c(n,{name:w.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`style`,`loading`,`aria-label`])]),default:_(()=>[s(`span`,null,m(w.triggerTooltip??h(x)(`guide.trigger`)),1)]),_:1})):o(`v-if`,!0)}}),[[`__scopeId`,`data-v-28c9b4f0`]]);export{D as t};
1
+ import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./C_Icon2.js";import{t as r}from"./useScopedComponentLocale.js";import{Fragment as i,computed as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createElementVNode as l,createVNode as u,defineComponent as d,normalizeClass as f,normalizeStyle as p,onBeforeUnmount as m,openBlock as h,ref as g,renderList as _,toDisplayString as v,unref as y,watch as b,withCtx as x}from"vue";import{NButton as S,NTooltip as C}from"naive-ui";const w={navigation:`<rect x="34" y="12" width="56" height="72" rx="6" fill="currentColor" opacity=".12"/><path d="M46 30h30M46 48h30M46 66h20"/><rect x="108" y="12" width="118" height="72" rx="6" fill="currentColor" opacity=".07"/><path d="M122 32h64M122 48h90M122 64h74"/>`,search:`<rect x="28" y="26" width="204" height="44" rx="10" fill="currentColor" opacity=".09"/><circle cx="56" cy="46" r="8"/><path d="m62 52 6 6M86 44h104M86 55h70"/>`,tabs:`<rect x="28" y="24" width="204" height="56" rx="6" fill="currentColor" opacity=".07"/><rect x="40" y="16" width="58" height="26" rx="6" fill="currentColor" opacity=".2"/><path d="M50 29h25m10-3 6 6m0-6-6 6M112 29h38M166 29h38M44 56h100M44 67h144"/>`,account:`<circle cx="60" cy="48" r="22" fill="currentColor" opacity=".12"/><circle cx="60" cy="41" r="6"/><path d="M49 60c0-13 22-13 22 0M94 40h40m-8-6 8 6-8 6M94 58h40m-32-6-8 6 8 6"/><rect x="154" y="20" width="62" height="56" rx="6" fill="currentColor" opacity=".09"/><path d="M168 36h34M168 48h34M168 60h22"/>`,overview:`<rect x="28" y="14" width="204" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M42 30h76M42 42h52"/><rect x="42" y="54" width="48" height="16" rx="4"/><rect x="106" y="54" width="48" height="16" rx="4"/><rect x="170" y="54" width="48" height="16" rx="4"/>`,notification:`<circle cx="130" cy="48" r="36" fill="currentColor" opacity=".07"/><path d="M109 63h42l-6-10V40a15 15 0 0 0-30 0v13l-6 10ZM124 71h12"/><circle cx="150" cy="26" r="8" fill="currentColor" opacity=".3"/>`,fullscreen:`<rect x="50" y="14" width="160" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M66 40V28h20M174 28h20v12M66 56v12h20M174 68h20V56"/><rect x="106" y="34" width="48" height="28" rx="4"/>`,language:`<rect x="54" y="18" width="72" height="54" rx="8" fill="currentColor" opacity=".1"/><rect x="134" y="24" width="72" height="54" rx="8" fill="currentColor" opacity=".07"/><path d="M70 34h40M90 27v7M79 34c2 15 9 22 27 28M101 34c-3 15-13 24-28 29M151 64l16-27 16 27M158 53h18"/>`,theme:`<circle cx="78" cy="48" r="15" fill="currentColor" opacity=".12"/><path d="M78 24v-6M78 78v-6M54 48h-6M108 48h-6M61 31l-5-5M100 70l-5-5M61 65l-5 5M100 26l-5 5M168 22a26 26 0 1 0 28 42 26 26 0 0 1-28-42Z"/>`,settings:`<rect x="44" y="14" width="172" height="68" rx="8" fill="currentColor" opacity=".07"/><path d="M62 31h136M62 48h136M62 65h136"/><circle cx="94" cy="31" r="5" fill="currentColor"/><circle cx="168" cy="48" r="5" fill="currentColor"/><circle cx="124" cy="65" r="5" fill="currentColor"/>`};function T(e){return e.width>0&&e.height>0&&e.right>0&&e.bottom>0&&e.left<window.innerWidth&&e.top<window.innerHeight}function E(e){if(!(!e||typeof document>`u`))return(typeof e==`string`?Array.from(document.querySelectorAll(e)):[typeof e==`function`?e():e]).find(e=>{if(!e?.isConnected)return!1;let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView?.getComputedStyle(e);return T(t)&&n?.visibility!==`hidden`})}function D(e){let{illustration:t}=e.popover,n=t&&w[t];return n?`<div class="c-guide-figure"><svg viewBox="0 0 260 96" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">${n}</svg></div><div class="c-guide-copy">${e.popover.description}</div>`:e.popover.description}const O=Object.freeze({"guide.done":`完成`,"guide.next":`下一步`,"guide.previous":`上一步`,"guide.skip":`跳过引导`,"guide.trigger":`功能引导`,"guide.waitingForAction":`完成当前操作后继续`,"guide.checklist":`操作清单`,"guide.checklistProgress":`已完成 {done} / {total} 项`,"guide.checklistDone":`已完成`,"guide.checklistPending":`待完成`}),k=Object.freeze({"guide.done":`Done`,"guide.next":`Next`,"guide.previous":`Previous`,"guide.skip":`Skip guide`,"guide.trigger":`Feature guide`,"guide.waitingForAction":`Complete the current action to continue`,"guide.checklist":`Task checklist`,"guide.checklistProgress":`{done} of {total} tasks complete`,"guide.checklistDone":`Complete`,"guide.checklistPending":`Pending`}),A=()=>r(O,k),j=[`aria-label`],M={role:`status`},N=[`disabled`,`onClick`];var P=t(d({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},checklist:{},doneBtnText:{},nextBtnText:{},prevBtnText:{},showSkipButton:{type:Boolean,default:!0},skipBtnText:{},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},skipMissingElements:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`skip`,`step-change`,`error`],setup(t,{expose:r,emit:d}){let w=e(),{t:T}=A(),O=t,k=d,P=a(()=>({done:O.doneBtnText??T(`guide.done`),next:O.nextBtnText??T(`guide.next`),previous:O.prevBtnText??T(`guide.previous`),skip:O.skipBtnText??T(`guide.skip`)})),F=g(!1),I=a(()=>{if(!O.checklist)return[];let e=new Set(O.checklist.completedIds);return O.steps.flatMap(t=>t.id&&!t.skipIf?.()?[{id:t.id,title:t.popover.title,done:e.has(t.id)}]:[])}),L=a(()=>I.value.filter(e=>e.done).length),R=a(()=>`${O.persistence?.keyPrefix??`c_guide`}_completed`),z=null,B,V,H=0,U=()=>{if(!O.persistence?.enabled)return!1;try{return localStorage.getItem(R.value)===`true`}catch{return!1}},W=()=>{if(O.persistence?.enabled)try{localStorage.setItem(R.value,`true`)}catch{}},G=()=>{try{localStorage.removeItem(R.value)}catch{}},K=()=>{H++,F.value=!1;let e=B;B=void 0,V=void 0,e?.()},q=()=>{let e=O.theme??{};return{"--c-guide-bg":e.popoverBgColor??`var(--c-bg-surface, var(--c-theme-bg-surface))`,"--c-guide-text":e.popoverTextColor??`var(--c-text-1, var(--c-theme-text-1))`,"--c-guide-text-secondary":e.popoverTextColor??`var(--c-text-2, var(--c-theme-text-2))`,"--c-guide-text-muted":`var(--c-text-3, var(--c-theme-text-3))`,"--c-guide-primary":e.primaryColor??`var(--c-primary, var(--c-theme-primary))`,"--c-guide-primary-hover":e.primaryColor??`var(--c-primary-hover, var(--c-theme-primary-hover))`,"--c-guide-border":`var(--c-border, var(--c-theme-border))`,"--c-guide-radius":e.borderRadius??`14px`}},J=[],Y=e=>{for(let t of J)e.wrapper.style.removeProperty(t);let t=q();for(let[e,n]of Object.entries(w.value))n!=null&&(t[e]=String(n));J=Object.keys(t);for(let[n,r]of Object.entries(t))e.wrapper.style.setProperty(n,r)},X=()=>O.theme?.overlayOpacity===void 0?{}:{overlayOpacity:O.theme.overlayOpacity},Z=e=>F.value||!e&&U(),Q=()=>O.animate&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;function ee(e){let t=O.steps.filter(e=>!e.skipIf?.()&&(!O.skipMissingElements||!e.element||E(e.element))),n=e===void 0?0:t.findIndex(t=>t.id===e);if(t[n])return{activeSteps:t,initialIndex:n}}let $=async(e=!1,t)=>{if(Z(e))return;K();let n=H;F.value=!0;try{let{driver:e}=await import(`driver.js`);if(n!==H)return;let r=ee(t);if(!r)return;let{activeSteps:i,initialIndex:a}=r,o=`close`,s=a,c=!1,l=!1,u=new Set(O.checklist?.completedIds),d=new Set(i.flatMap((e,t)=>e.id&&u.has(e.id)?[t]:[])),f=!1,p=()=>!!i[s]?.action&&!d.has(s),m=e=>{let t=p();e.nextButton.disabled=l||t,t?e.nextButton.title=T(`guide.waitingForAction`):e.nextButton.removeAttribute(`title`),e.previousButton.disabled=l},h=()=>{c||(c=!0,z===y&&(z=null,B=void 0,V=void 0),o===`complete`?(W(),k(`complete`)):o!==`dispose`&&(o===`skip`&&k(`skip`,s),k(`close`,s)))},g=()=>{y.destroy(),h()},_=()=>{l||p()||(y.isLastStep()?(o=`complete`,g()):y.moveNext())},v=X(),y=e({popoverClass:`c-guide-popover ${O.popoverClass}`.trim(),animate:Q(),showProgress:O.showProgress,progressText:`{{current}} / {{total}}`,allowClose:O.allowClose,allowKeyboardControl:O.keyboard,skipMissingElement:O.skipMissingElements,...v,doneBtnText:P.value.done,nextBtnText:P.value.next,prevBtnText:P.value.previous,steps:i.map(e=>({element:e.element?()=>E(e.element):void 0,popover:{...e.popover,description:D(e)},onHighlightStarted:(t,n,{state:r})=>{l=!0,s=r.activeIndex??s,e.onHighlightStarted?.(t,e),k(`step-change`,s,e)},onHighlighted:()=>{l=!1;let{popover:e}=y.getState();if(e&&m(e),f){f=!1;let e=s;queueMicrotask(()=>{z===y&&e===s&&_()})}},onDeselected:t=>e.onDeselected?.(t,e)})),onPopoverRender:e=>{if(Y(e),m(e),O.showSkipButton&&O.allowClose){let t=document.createElement(`button`);t.type=`button`,t.className=`c-guide-skip-btn`,t.textContent=P.value.skip,t.addEventListener(`click`,()=>{o=`skip`,g()}),e.footer.prepend(t)}},onNextClick:_,onPrevClick:()=>{l||y.movePrevious()},onDestroyStarted:g,onDestroyed:h});z=y,V=e=>y.getActiveIndex()!==s||!p()||i[s]?.action!==e?!1:(d.add(s),l?f=!0:_(),!0),B=()=>{o=`dispose`,g()},k(`start`),n===H&&y.drive(a)}catch(e){n===H&&(K(),k(`error`,e))}finally{n===H&&(F.value=!1)}};return b(P,({done:e,next:t,previous:n,skip:r})=>{if(!z)return;z.setConfig({...z.getConfig(),doneBtnText:e,nextBtnText:t,prevBtnText:n});let{popover:i}=z.getState();if(i){i.nextButton.textContent=z.isLastStep()?e:t,i.previousButton.textContent=n;let a=i.footer.querySelector(`.c-guide-skip-btn`);a&&(a.textContent=r)}}),m(K),b(()=>O.steps,K),b([w,()=>O.theme],()=>{let e=z?.getState().popover;e&&Y(e)},{deep:!0}),r({startGuide:$,completeAction:e=>V?.(e)??!1,stopGuide:K,resetCompleted:G,isCompleted:U}),(e,t)=>O.checklist?(h(),c(`section`,{key:0,class:`c-guide-checklist`,style:p(y(w)),"aria-label":O.checklist.title||y(T)(`guide.checklist`)},[l(`header`,null,[l(`strong`,null,v(O.checklist.title||y(T)(`guide.checklist`)),1),l(`span`,M,v(y(T)(`guide.checklistProgress`,{done:L.value,total:I.value.length})),1)]),l(`ul`,null,[(h(!0),c(i,null,_(I.value,e=>(h(),c(`li`,{key:e.id},[l(`button`,{type:`button`,disabled:F.value,onClick:t=>$(!0,e.id)},[l(`span`,null,v(e.title),1),l(`span`,{class:f({"is-complete":e.done})},v(y(T)(e.done?`guide.checklistDone`:`guide.checklistPending`)),3)],8,N)]))),128))])],12,j)):O.showTrigger?(h(),o(y(C),{key:1,placement:`bottom`,trigger:`hover`},{trigger:x(()=>[u(y(S),{class:`c-guide-trigger`,style:p(y(w)),text:``,loading:F.value,"aria-label":O.triggerTooltip??y(T)(`guide.trigger`),onClick:t[0]||=e=>$(!0)},{default:x(()=>[u(n,{name:O.triggerIcon,size:18},null,8,[`name`])]),_:1},8,[`style`,`loading`,`aria-label`])]),default:x(()=>[l(`span`,null,v(O.triggerTooltip??y(T)(`guide.trigger`)),1)]),_:1})):s(`v-if`,!0)}}),[[`__scopeId`,`data-v-96c38480`]]);export{P as t};
package/dist/C_Icon.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as IconProps, t as _default } from "./index18.vue.cjs";
1
+ import { n as IconProps, t as _default } from "./index22.vue.cjs";
2
2
  export { _default as C_Icon, type IconProps };
package/dist/C_Icon.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as IconProps, t as _default } from "./index17.vue.js";
1
+ import { n as IconProps, t as _default } from "./index21.vue.js";
2
2
  export { _default as C_Icon, type IconProps };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./C_ImageAnnotator2.cjs`);exports.C_ImageAnnotator=e.t;
@@ -0,0 +1,143 @@
1
+ @import "./shared-tokens.css";
2
+ .c-image-annotator[data-v-9d54c609] {
3
+ --c-image-annotator-border: var(--c-border, var(--c-theme-border, #dce3ed));
4
+ --c-image-annotator-muted: var(
5
+ --c-bg-muted,
6
+ var(--c-theme-bg-muted, #f1f5f9)
7
+ );
8
+ --c-image-annotator-primary: var(
9
+ --c-primary,
10
+ var(--c-theme-primary, #2563eb)
11
+ );
12
+ --c-image-annotator-radius: var(
13
+ --c-radius-panel,
14
+ var(--c-theme-radius-panel, 8px)
15
+ );
16
+ display: grid;
17
+ min-width: 0;
18
+ gap: 12px;
19
+ container-type: inline-size;
20
+ }
21
+ .c-image-annotator__header[data-v-9d54c609], .c-image-annotator__actions[data-v-9d54c609] {
22
+ display: flex;
23
+ flex-wrap: wrap;
24
+ align-items: center;
25
+ gap: 8px 12px;
26
+ }
27
+ .c-image-annotator__header[data-v-9d54c609] {
28
+ justify-content: space-between;
29
+ }
30
+ .c-image-annotator__content[data-v-9d54c609] {
31
+ display: grid;
32
+ min-width: 0;
33
+ grid-template-columns: minmax(0, 1fr) minmax(214px, 28%);
34
+ gap: 12px;
35
+ }
36
+ @container (max-width: 620px) {
37
+ .c-image-annotator__content[data-v-9d54c609] {
38
+ grid-template-columns: minmax(0, 1fr);
39
+ }
40
+ }
41
+ .c-image-annotator__preview[data-v-9d54c609], .c-image-annotator__panel[data-v-9d54c609] {
42
+ min-width: 0;
43
+ padding: 12px;
44
+ border: 1px solid var(--c-image-annotator-border);
45
+ border-radius: var(--c-image-annotator-radius);
46
+ }
47
+ .c-image-annotator__preview[data-v-9d54c609] {
48
+ display: grid;
49
+ min-height: 160px;
50
+ place-items: center;
51
+ background: var(--c-image-annotator-muted);
52
+ }
53
+ .c-image-annotator__canvas[data-v-9d54c609] {
54
+ position: relative;
55
+ max-width: 100%;
56
+ user-select: none;
57
+ }
58
+ .c-image-annotator__canvas.is-drawable[data-v-9d54c609] {
59
+ touch-action: none;
60
+ cursor: crosshair;
61
+ }
62
+ .c-image-annotator__canvas img[data-v-9d54c609] {
63
+ display: block;
64
+ max-width: 100%;
65
+ max-height: 560px;
66
+ }
67
+ .c-image-annotator__box[data-v-9d54c609] {
68
+ box-sizing: border-box;
69
+ position: absolute;
70
+ padding: 0;
71
+ border: 2px solid var(--c-image-annotator-primary);
72
+ background: color-mix(in srgb, var(--c-image-annotator-primary) 13%, transparent);
73
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
74
+ cursor: pointer;
75
+ }
76
+ .c-image-annotator__box.is-active[data-v-9d54c609] {
77
+ border-width: 3px;
78
+ }
79
+ .c-image-annotator__box.is-preview[data-v-9d54c609] {
80
+ border-style: dashed;
81
+ pointer-events: none;
82
+ }
83
+ .c-image-annotator__panel[data-v-9d54c609], .c-image-annotator__editor[data-v-9d54c609] {
84
+ display: grid;
85
+ align-content: start;
86
+ gap: 8px;
87
+ }
88
+ .c-image-annotator__list[data-v-9d54c609] {
89
+ display: grid;
90
+ max-height: 180px;
91
+ gap: 4px;
92
+ margin: 0;
93
+ padding: 0;
94
+ overflow: auto;
95
+ list-style: none;
96
+ }
97
+ .c-image-annotator__list button[data-v-9d54c609] {
98
+ width: 100%;
99
+ padding: 6px 8px;
100
+ border: 1px solid transparent;
101
+ border-radius: var(--c-radius, var(--c-theme-radius, 6px));
102
+ background: transparent;
103
+ color: inherit;
104
+ font: inherit;
105
+ text-align: start;
106
+ overflow-wrap: anywhere;
107
+ cursor: pointer;
108
+ }
109
+ .c-image-annotator__list button[data-v-9d54c609]:hover, .c-image-annotator__list button[aria-current=true][data-v-9d54c609] {
110
+ background: var(--c-image-annotator-muted);
111
+ }
112
+ .c-image-annotator__list button[aria-current=true][data-v-9d54c609] {
113
+ border-color: var(--c-image-annotator-primary);
114
+ }
115
+ .c-image-annotator__list button[data-v-9d54c609]:focus-visible {
116
+ outline: 2px solid var(--c-image-annotator-primary);
117
+ outline-offset: -2px;
118
+ }
119
+ .c-image-annotator__coordinates[data-v-9d54c609] {
120
+ display: grid;
121
+ grid-template-columns: repeat(2, minmax(0, 1fr));
122
+ gap: 8px;
123
+ }
124
+ .c-image-annotator__coordinates div[data-v-9d54c609] {
125
+ display: grid;
126
+ gap: 4px;
127
+ }
128
+ .c-image-annotator__coordinates label[data-v-9d54c609] {
129
+ font-size: 12px;
130
+ }
131
+ .c-image-annotator__placeholder[data-v-9d54c609], .c-image-annotator__note[data-v-9d54c609], .c-image-annotator__error[data-v-9d54c609] {
132
+ margin: 0;
133
+ overflow-wrap: anywhere;
134
+ }
135
+ .c-image-annotator__note[data-v-9d54c609] {
136
+ white-space: pre-wrap;
137
+ }
138
+ .c-image-annotator__error[data-v-9d54c609] {
139
+ color: var(--c-error, var(--c-theme-error, #b91c1c));
140
+ }
141
+
142
+ /* layer: default */
143
+ .visible[data-v-9d54c609]{visibility:visible;}
@@ -0,0 +1,2 @@
1
+ import { i as ImageAnnotatorProps, n as ImageAnnotation, r as ImageAnnotationBox, t as _default } from "./index23.vue.cjs";
2
+ export { _default as C_ImageAnnotator, type ImageAnnotation, type ImageAnnotationBox, type ImageAnnotatorProps };
@@ -0,0 +1,2 @@
1
+ import { i as ImageAnnotatorProps, n as ImageAnnotation, r as ImageAnnotationBox, t as _default } from "./index22.vue.js";
2
+ export { _default as C_ImageAnnotator, type ImageAnnotation, type ImageAnnotationBox, type ImageAnnotatorProps };
@@ -0,0 +1 @@
1
+ import{t as e}from"./C_ImageAnnotator2.js";export{e as C_ImageAnnotator};