@robot-admin/naive-ui-components 0.10.3 → 0.11.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.
- package/CHANGELOG.md +111 -100
- package/LICENSE +21 -21
- package/README.md +463 -318
- package/README_EN.md +404 -0
- package/SECURITY.md +23 -0
- package/dist/C_ActionBar.cjs +1 -1
- package/dist/C_ActionBar.css +46 -48
- package/dist/C_ActionBar.d.cts +1 -1
- package/dist/C_ActionBar.js +1 -1
- package/dist/C_ActionBar2.cjs +1 -0
- package/dist/C_ActionBar2.js +1 -2
- package/dist/C_AntV.cjs +1 -1
- package/dist/C_AntV.css +3 -3
- package/dist/C_AntV.d.cts +1 -1
- package/dist/C_AntV.js +1 -1
- package/dist/C_AntV2.cjs +4 -0
- package/dist/C_AntV2.js +3 -4
- package/dist/C_AudioPlayer.cjs +1 -1
- package/dist/C_AudioPlayer.css +15 -7
- package/dist/C_AudioPlayer.d.cts +1 -1
- package/dist/C_AudioPlayer.js +1 -1
- package/dist/C_AudioPlayer2.cjs +1 -0
- package/dist/C_AudioPlayer2.js +1 -2
- package/dist/C_AvatarGroup.cjs +1 -1
- package/dist/C_AvatarGroup.css +15 -7
- package/dist/C_AvatarGroup.d.cts +1 -1
- package/dist/C_AvatarGroup2.cjs +1 -0
- package/dist/C_AvatarGroup2.js +1 -2
- package/dist/C_Barcode.cjs +1 -1
- package/dist/C_Barcode.css +0 -2
- package/dist/C_Barcode.d.cts +1 -1
- package/dist/C_Barcode2.cjs +1 -0
- package/dist/C_Barcode2.js +1 -2
- package/dist/C_Breadcrumb.cjs +1 -1
- package/dist/C_Breadcrumb.css +0 -2
- package/dist/C_Breadcrumb.d.cts +2 -2
- package/dist/C_Breadcrumb.d.ts +1 -2
- package/dist/C_Breadcrumb.js +1 -1
- package/dist/C_Breadcrumb2.cjs +1 -0
- package/dist/C_Breadcrumb2.js +1 -2
- package/dist/C_Captcha.cjs +1 -1
- package/dist/C_Captcha.css +46 -21
- package/dist/C_Captcha.d.cts +3 -2
- package/dist/C_Captcha.d.ts +3 -2
- package/dist/C_Captcha.js +1 -1
- package/dist/C_Captcha2.cjs +1 -0
- package/dist/C_Captcha2.js +1 -2
- package/dist/C_Cascade.cjs +1 -1
- package/dist/C_Cascade.css +0 -2
- package/dist/C_Cascade.d.cts +1 -1
- package/dist/C_Cascade.d.ts +1 -1
- package/dist/C_Cascade2.cjs +1 -0
- package/dist/C_Cascade2.js +1 -2
- package/dist/C_Chat.cjs +1 -1
- package/dist/C_Chat.css +0 -2
- package/dist/C_Chat.d.cts +1 -1
- package/dist/C_Chat.d.ts +1 -1
- package/dist/C_Chat.js +1 -1
- package/dist/C_Chat2.cjs +1 -0
- package/dist/C_Chat2.js +1 -2
- package/dist/C_City.cjs +1 -1
- package/dist/C_City.css +28 -30
- package/dist/C_City.d.cts +1 -1
- package/dist/C_City.d.ts +1 -1
- package/dist/C_City2.cjs +1 -0
- package/dist/C_City2.js +1 -2
- package/dist/C_Code.cjs +1 -1
- package/dist/C_Code.css +241 -4
- package/dist/C_Code.d.cts +1 -1
- package/dist/C_Code.d.ts +1 -1
- package/dist/C_Code.js +1 -1
- package/dist/C_Code2.cjs +1 -0
- package/dist/C_Code2.js +1 -2
- package/dist/C_CollapsePanel.cjs +1 -1
- package/dist/C_CollapsePanel.css +12 -6
- package/dist/C_CollapsePanel.d.cts +1 -1
- package/dist/C_CollapsePanel.js +1 -1
- package/dist/C_CollapsePanel2.cjs +1 -0
- package/dist/C_CollapsePanel2.js +1 -2
- package/dist/C_ContextMenu.cjs +1 -1
- package/dist/C_ContextMenu.css +16 -18
- package/dist/C_ContextMenu.d.cts +1 -1
- package/dist/C_ContextMenu.d.ts +1 -1
- package/dist/C_ContextMenu.js +1 -1
- package/dist/C_ContextMenu2.cjs +1 -0
- package/dist/C_ContextMenu2.js +1 -2
- package/dist/C_Cron.cjs +1 -1
- package/dist/C_Cron.css +18 -8
- package/dist/C_Cron.d.cts +1 -1
- package/dist/C_Cron.js +1 -1
- package/dist/C_Cron2.cjs +1 -0
- package/dist/C_Cron2.js +1 -2
- package/dist/C_Date.cjs +1 -1
- package/dist/C_Date.css +1 -0
- package/dist/C_Date.d.cts +2 -2
- package/dist/C_Date.d.ts +2 -2
- package/dist/C_Date2.cjs +1 -0
- package/dist/C_Date2.js +1 -2
- package/dist/C_Draggable.cjs +1 -1
- package/dist/C_Draggable.css +9 -5
- package/dist/C_Draggable.d.cts +1 -1
- package/dist/C_Draggable2.cjs +1 -0
- package/dist/C_Draggable2.js +1 -2
- package/dist/C_Editor.cjs +1 -1
- package/dist/C_Editor.css +80 -67
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_Editor2.cjs +1 -0
- package/dist/C_Editor2.js +1 -2
- package/dist/C_FilePreview.cjs +1 -1
- package/dist/C_FilePreview.css +0 -2
- package/dist/C_FilePreview.d.cts +1 -1
- package/dist/C_FilePreview.js +1 -1
- package/dist/C_FilePreview2.cjs +1 -0
- package/dist/C_FilePreview2.js +1 -2
- package/dist/C_Form.base.css +980 -0
- package/dist/C_Form.cjs +1 -1
- package/dist/C_Form.css +256 -155
- package/dist/C_Form.d.cts +2 -2
- package/dist/C_Form.d.ts +2 -2
- package/dist/C_Form.js +1 -1
- package/dist/C_Form2.cjs +1 -0
- package/dist/C_Form2.js +1 -2
- package/dist/C_FormSearch.cjs +1 -1
- package/dist/C_FormSearch.css +47 -47
- package/dist/C_FormSearch.d.cts +2 -2
- package/dist/C_FormSearch.d.ts +2 -2
- package/dist/C_FormSearch2.cjs +1 -0
- package/dist/C_FormSearch2.js +1 -2
- package/dist/C_FormulaEditor.cjs +1 -1
- package/dist/C_FormulaEditor.css +64 -38
- package/dist/C_FormulaEditor.d.cts +1 -1
- package/dist/C_FormulaEditor.js +1 -1
- package/dist/C_FormulaEditor2.cjs +2 -0
- package/dist/C_FormulaEditor2.js +2 -2
- package/dist/C_FullCalendar.cjs +1 -1
- package/dist/C_FullCalendar.css +0 -2
- package/dist/C_FullCalendar.d.cts +1 -1
- package/dist/C_FullCalendar2.cjs +1 -0
- package/dist/C_FullCalendar2.js +1 -2
- package/dist/C_GlobalSearch.cjs +1 -1
- package/dist/C_GlobalSearch.css +111 -113
- package/dist/C_GlobalSearch.d.cts +1 -1
- package/dist/C_GlobalSearch2.cjs +1 -0
- package/dist/C_GlobalSearch2.js +1 -2
- package/dist/C_Guide.cjs +1 -1
- package/dist/C_Guide.css +1 -0
- package/dist/C_Guide.d.cts +1 -1
- package/dist/C_Guide.d.ts +1 -1
- package/dist/C_Guide.js +1 -1
- package/dist/C_Guide2.cjs +1 -0
- package/dist/C_Guide2.js +1 -2
- package/dist/C_Icon.cjs +1 -1
- package/dist/C_Icon.css +58 -0
- package/dist/C_Icon.d.cts +1 -1
- package/dist/C_Icon.d.ts +1 -1
- package/dist/C_Icon2.cjs +1 -0
- package/dist/C_Icon2.js +1 -2
- package/dist/C_ImageCropper.cjs +1 -1
- package/dist/C_ImageCropper.css +0 -2
- package/dist/C_ImageCropper.d.cts +1 -1
- package/dist/C_ImageCropper.js +1 -1
- package/dist/C_ImageCropper2.cjs +1 -0
- package/dist/C_ImageCropper2.js +1 -2
- package/dist/C_Language.cjs +1 -1
- package/dist/C_Language.css +1 -0
- package/dist/C_Language.d.cts +1 -1
- package/dist/C_Language.d.ts +1 -1
- package/dist/C_Language.js +1 -1
- package/dist/C_Language2.cjs +1 -0
- package/dist/C_Language2.js +1 -2
- package/dist/C_Login.cjs +1 -1
- package/dist/C_Login.css +92 -76
- package/dist/C_Login.d.cts +1 -1
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Login.js +1 -1
- package/dist/C_Login2.cjs +1 -0
- package/dist/C_Login2.js +1 -2
- package/dist/C_Map.cjs +1 -1
- package/dist/C_Map.css +665 -5
- package/dist/C_Map.d.cts +1 -1
- package/dist/C_Map2.cjs +1 -0
- package/dist/C_Map2.js +1 -2
- package/dist/C_Markdown.cjs +1 -1
- package/dist/C_Markdown.css +940 -35
- package/dist/C_Markdown.d.cts +1 -1
- package/dist/C_Markdown.d.ts +1 -1
- package/dist/C_Markdown2.cjs +1 -0
- package/dist/C_Markdown2.js +1 -2
- package/dist/C_Menu.cjs +1 -1
- package/dist/C_Menu.css +1 -0
- package/dist/C_Menu.d.cts +3 -3
- package/dist/C_Menu.d.ts +3 -4
- package/dist/C_Menu.js +1 -1
- package/dist/C_Menu2.cjs +1 -0
- package/dist/C_Menu2.js +1 -2
- package/dist/C_NotificationCenter.cjs +1 -1
- package/dist/C_NotificationCenter.css +95 -47
- package/dist/C_NotificationCenter.d.cts +1 -1
- package/dist/C_NotificationCenter.js +1 -1
- package/dist/C_NotificationCenter2.cjs +1 -0
- package/dist/C_NotificationCenter2.js +1 -2
- package/dist/C_OrgChart.cjs +1 -1
- package/dist/C_OrgChart.css +6 -4
- package/dist/C_OrgChart.d.cts +1 -1
- package/dist/C_OrgChart.d.ts +1 -1
- package/dist/C_OrgChart2.cjs +1 -0
- package/dist/C_OrgChart2.js +1 -2
- package/dist/C_Progress.cjs +1 -1
- package/dist/C_Progress.css +1 -0
- package/dist/C_Progress.d.cts +1 -1
- package/dist/C_Progress.d.ts +1 -1
- package/dist/C_Progress2.cjs +1 -0
- package/dist/C_Progress2.js +1 -2
- package/dist/C_QRCode.cjs +1 -1
- package/dist/C_QRCode.css +8 -10
- package/dist/C_QRCode.d.cts +1 -1
- package/dist/C_QRCode2.cjs +1 -0
- package/dist/C_QRCode2.js +1 -2
- package/dist/C_Signature.cjs +1 -1
- package/dist/C_Signature.css +0 -2
- package/dist/C_Signature.d.cts +1 -1
- package/dist/C_Signature.js +1 -1
- package/dist/C_Signature2.cjs +1 -0
- package/dist/C_Signature2.js +1 -2
- package/dist/C_Skeleton.cjs +1 -1
- package/dist/C_Skeleton.css +0 -2
- package/dist/C_Skeleton.d.cts +1 -1
- package/dist/C_Skeleton.d.ts +1 -1
- package/dist/C_Skeleton2.cjs +1 -0
- package/dist/C_Skeleton2.js +1 -2
- package/dist/C_SplitPane.cjs +1 -1
- package/dist/C_SplitPane.css +27 -11
- package/dist/C_SplitPane.d.cts +1 -1
- package/dist/C_SplitPane.js +1 -1
- package/dist/C_SplitPane2.cjs +1 -0
- package/dist/C_SplitPane2.js +1 -2
- package/dist/C_Steps.cjs +1 -1
- package/dist/C_Steps.css +37 -39
- package/dist/C_Steps.d.cts +1 -1
- package/dist/C_Steps.d.ts +1 -1
- package/dist/C_Steps2.cjs +1 -0
- package/dist/C_Steps2.js +1 -2
- package/dist/C_Table.base.css +1588 -0
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +1202 -112
- package/dist/C_Table.d.cts +2 -2
- package/dist/C_Table.d.ts +11 -2
- package/dist/C_Table.js +1 -1
- package/dist/C_TagsView.cjs +1 -1
- package/dist/C_TagsView.css +44 -40
- package/dist/C_TagsView.d.cts +2 -2
- package/dist/C_TagsView.d.ts +2 -3
- package/dist/C_TagsView.js +1 -1
- package/dist/C_TagsView2.cjs +1 -0
- package/dist/C_TagsView2.js +1 -2
- package/dist/C_Theme.cjs +1 -1
- package/dist/C_Theme.css +1 -0
- package/dist/C_Theme.d.cts +1 -1
- package/dist/C_Theme.d.ts +1 -1
- package/dist/C_Theme.js +1 -1
- package/dist/C_Theme2.cjs +1 -0
- package/dist/C_Theme2.js +1 -2
- package/dist/C_Time.cjs +1 -1
- package/dist/C_Time.css +0 -2
- package/dist/C_Time.d.cts +2 -2
- package/dist/C_Time.d.ts +2 -2
- package/dist/C_Time2.cjs +1 -0
- package/dist/C_Time2.js +1 -2
- package/dist/C_Timeline.cjs +1 -1
- package/dist/C_Timeline.css +44 -46
- package/dist/C_Timeline.d.cts +1 -1
- package/dist/C_Timeline.js +1 -1
- package/dist/C_Timeline2.cjs +1 -0
- package/dist/C_Timeline2.js +1 -2
- package/dist/C_Transfer.cjs +1 -1
- package/dist/C_Transfer.css +21 -9
- package/dist/C_Transfer.d.cts +1 -1
- package/dist/C_Transfer.js +1 -1
- package/dist/C_Transfer2.cjs +1 -0
- package/dist/C_Transfer2.js +1 -2
- package/dist/C_Tree.cjs +1 -1
- package/dist/C_Tree.css +0 -2
- package/dist/C_Tree.d.cts +1 -1
- package/dist/C_Tree.js +1 -1
- package/dist/C_Tree2.cjs +1 -0
- package/dist/C_Tree2.js +1 -2
- package/dist/C_Upload.cjs +1 -1
- package/dist/C_Upload.css +17 -17
- package/dist/C_Upload.d.cts +1 -1
- package/dist/C_Upload.js +1 -1
- package/dist/C_Upload2.cjs +1 -0
- package/dist/C_Upload2.js +1 -25
- package/dist/C_VideoPlayer.cjs +1 -1
- package/dist/C_VideoPlayer.css +35 -24
- package/dist/C_VideoPlayer.d.cts +2 -2
- package/dist/C_VideoPlayer.d.ts +2 -2
- package/dist/C_VideoPlayer.js +1 -1
- package/dist/C_VideoPlayer2.cjs +3 -0
- package/dist/C_VideoPlayer2.js +3 -4
- package/dist/C_VtableGantt.cjs +1 -1
- package/dist/C_VtableGantt.css +15 -7
- package/dist/C_VtableGantt.d.cts +1 -1
- package/dist/C_VtableGantt.d.ts +1 -1
- package/dist/C_VtableGantt.js +1 -1
- package/dist/C_VtableGantt2.cjs +1 -0
- package/dist/C_VtableGantt2.js +1 -2
- package/dist/C_WaterFall.cjs +1 -1
- package/dist/C_WaterFall.css +15 -17
- package/dist/C_WaterFall.d.cts +1 -1
- package/dist/C_WaterFall2.cjs +1 -0
- package/dist/C_WaterFall2.js +1 -2
- package/dist/C_WorkFlow.cjs +1 -1
- package/dist/C_WorkFlow.css +257 -197
- package/dist/C_WorkFlow.d.cts +1 -1
- package/dist/C_WorkFlow.js +1 -1
- package/dist/C_WorkFlow2.cjs +1 -0
- package/dist/C_WorkFlow2.js +1 -2
- package/dist/city.cjs +1 -0
- package/dist/city.js +1 -2
- package/dist/config.cjs +1 -0
- package/dist/config.d.cts +33 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.js +1 -0
- package/dist/constants.d.cts +272 -0
- package/dist/constants.d.ts +6 -7
- package/dist/constants2.d.cts +177 -0
- package/dist/constants2.d.ts +5 -6
- package/dist/constants3.d.cts +479 -0
- package/dist/constants3.d.ts +17 -13
- package/dist/constants4.d.cts +420 -0
- package/dist/constants4.d.ts +30 -40
- package/dist/constants5.d.cts +491 -0
- package/dist/constants5.d.ts +22 -6
- package/dist/data.cjs +1 -0
- package/dist/data.d.cts +67 -0
- package/dist/data.d.ts +13 -13
- package/dist/data.js +1 -0
- package/dist/export-helper.cjs +1 -0
- package/dist/helpers.cjs +1 -0
- package/dist/helpers.js +1 -0
- package/dist/html.cjs +1 -0
- package/dist/html.js +1 -0
- package/dist/images/marker-icon-2x.png +0 -0
- package/dist/images/marker-icon.png +0 -0
- package/dist/images/marker-shadow.png +0 -0
- package/dist/index.cjs +1 -2
- package/dist/index.d.cts +60 -99
- package/dist/index.d.ts +41 -83
- package/dist/index.js +1 -2
- package/dist/index.vue.d.cts +79 -0
- package/dist/index.vue.d.ts +3 -4
- package/dist/index10.vue.d.cts +47 -0
- package/dist/index10.vue.d.ts +80 -40
- package/dist/index11.vue.d.cts +88 -0
- package/dist/index11.vue.d.ts +68 -78
- package/dist/index12.vue.d.cts +79 -0
- package/dist/index12.vue.d.ts +49 -45
- package/dist/index13.vue.d.cts +64 -0
- package/dist/index13.vue.d.ts +99 -34
- package/dist/index14.vue.d.cts +106 -0
- package/dist/index14.vue.d.ts +82 -99
- package/dist/index15.vue.d.cts +91 -0
- package/dist/index15.vue.d.ts +25 -83
- package/dist/index16.vue.d.cts +34 -0
- package/dist/index16.vue.d.ts +113 -24
- package/dist/index17.vue.d.cts +124 -0
- package/dist/index17.vue.d.ts +76 -110
- package/dist/index18.vue.d.cts +83 -0
- package/dist/index18.vue.d.ts +67 -73
- package/dist/index19.vue.d.cts +101 -0
- package/dist/index19.vue.d.ts +93 -59
- package/dist/index2.vue.d.cts +82 -0
- package/dist/index2.vue.d.ts +1 -2
- package/dist/index20.vue.d.cts +54 -0
- package/dist/index20.vue.d.ts +40 -88
- package/dist/index21.vue.d.cts +103 -0
- package/dist/index21.vue.d.ts +89 -41
- package/dist/index22.vue.d.cts +45 -0
- package/dist/index22.vue.d.ts +37 -96
- package/dist/index23.vue.d.cts +19 -0
- package/dist/index23.vue.d.ts +8 -35
- package/dist/{index28.vue.d.ts → index24.vue.d.cts} +5 -6
- package/dist/index24.vue.d.ts +650 -86
- package/dist/index25.vue.d.cts +96 -0
- package/dist/index25.vue.d.ts +86 -10
- package/dist/index26.vue.d.cts +111 -0
- package/dist/index26.vue.d.ts +3 -4
- package/dist/index27.vue.d.cts +80 -0
- package/dist/index27.vue.d.ts +3 -4
- package/dist/index3.vue.d.cts +87 -0
- package/dist/index3.vue.d.ts +2 -3
- package/dist/index4.vue.d.cts +37 -0
- package/dist/index4.vue.d.ts +5 -6
- package/dist/index5.vue.d.cts +133 -0
- package/dist/index5.vue.d.ts +2 -3
- package/dist/index6.vue.d.cts +29 -0
- package/dist/index6.vue.d.ts +25 -38
- package/dist/index7.vue.d.cts +32 -0
- package/dist/index7.vue.d.ts +117 -23
- package/dist/index8.vue.d.cts +127 -0
- package/dist/index8.vue.d.ts +17 -111
- package/dist/index9.vue.d.cts +34 -0
- package/dist/index9.vue.d.ts +38 -26
- package/dist/{menuAdapter.d.ts → public.d.ts} +2 -3
- package/dist/resolver.cjs +1 -2
- package/dist/resolver.d.cts +6 -4
- package/dist/resolver.d.ts +6 -4
- package/dist/resolver.js +1 -2
- package/dist/storage.cjs +1 -0
- package/dist/storage.js +1 -2
- package/dist/style.css +9864 -7702
- package/dist/types.d.cts +107 -0
- package/dist/types.d.ts +58 -0
- package/dist/types2.d.cts +58 -0
- package/dist/useCalendarEvents.d.cts +150 -0
- package/dist/useCalendarEvents.d.ts +3 -4
- package/dist/useCollapsePanel.d.cts +133 -0
- package/dist/useCollapsePanel.d.ts +1 -2
- package/dist/useCropperCore.d.cts +104 -0
- package/dist/useCropperCore.d.ts +12 -10
- package/dist/useDraggableLayout.d.cts +196 -0
- package/dist/useDraggableLayout.d.ts +18 -16
- package/dist/useDynamicFormState.d.cts +749 -0
- package/dist/useDynamicFormState.d.ts +234 -112
- package/dist/useEdgeInteraction.d.cts +324 -0
- package/dist/useEdgeInteraction.d.ts +6 -7
- package/dist/useFullscreen.d.cts +165 -0
- package/dist/useFullscreen.d.ts +1 -2
- package/dist/useGlobalSearch.d.cts +110 -0
- package/dist/useGlobalSearch.d.ts +17 -9
- package/dist/useInfiniteScroll.d.cts +177 -0
- package/dist/useInfiniteScroll.d.ts +11 -3
- package/dist/useQRCode.d.cts +89 -0
- package/dist/useQRCode.d.ts +7 -5
- package/dist/useSearchState.d.cts +871 -0
- package/dist/useSearchState.d.ts +828 -28
- package/dist/useSignatureHistory.d.cts +197 -0
- package/dist/useSignatureHistory.d.ts +9 -4
- package/dist/useSplitResize.d.cts +157 -0
- package/dist/useSplitResize.d.ts +3 -4
- package/dist/useTableQuery.cjs +3 -0
- package/dist/{useModalEdit.d.ts → useTableQuery.d.cts} +624 -211
- package/dist/useTableQuery.d.ts +1721 -0
- package/dist/useTableQuery.js +3 -0
- package/dist/useTimeSelection.d.cts +116 -0
- package/dist/useTimeSelection.d.ts +19 -8
- package/dist/useTreeOperations.d.cts +185 -0
- package/dist/useTreeOperations.d.ts +14 -12
- package/dist/useWorkflowValidation.d.cts +1051 -0
- package/dist/useWorkflowValidation.d.ts +66 -67
- package/dist/verification.d.cts +58 -0
- package/dist/verification.d.ts +58 -0
- package/package.json +101 -69
- package/dist/C_ActionBar-BAcfOfRw.css.map +0 -1
- package/dist/C_ActionBar-DG2HW7t5.css.map +0 -1
- package/dist/C_ActionBar.js.map +0 -1
- package/dist/C_ActionBar2.js.map +0 -1
- package/dist/C_AntV-D_jTK8oZ.css.map +0 -1
- package/dist/C_AntV-DanTAq22.css.map +0 -1
- package/dist/C_AntV.js.map +0 -1
- package/dist/C_AntV2.js.map +0 -1
- package/dist/C_AudioPlayer-BnYIJXPD.css.map +0 -1
- package/dist/C_AudioPlayer-ldTy9Y34.css.map +0 -1
- package/dist/C_AudioPlayer.js.map +0 -1
- package/dist/C_AudioPlayer2.js.map +0 -1
- package/dist/C_AvatarGroup-B9d-GJ9c.css.map +0 -1
- package/dist/C_AvatarGroup-SIzxuuZr.css.map +0 -1
- package/dist/C_AvatarGroup.js.map +0 -1
- package/dist/C_AvatarGroup2.js.map +0 -1
- package/dist/C_Barcode-CAU2mFcx.css.map +0 -1
- package/dist/C_Barcode-D2oJaEg3.css.map +0 -1
- package/dist/C_Barcode.js.map +0 -1
- package/dist/C_Barcode2.js.map +0 -1
- package/dist/C_Breadcrumb-BiH0d9AI.css.map +0 -1
- package/dist/C_Breadcrumb-Bqqrl8nX.css.map +0 -1
- package/dist/C_Breadcrumb.js.map +0 -1
- package/dist/C_Breadcrumb2.js.map +0 -1
- package/dist/C_Captcha-B3yrtG7t.css.map +0 -1
- package/dist/C_Captcha-D4hDdWDu.css.map +0 -1
- package/dist/C_Captcha.js.map +0 -1
- package/dist/C_Captcha2.js.map +0 -1
- package/dist/C_Cascade-CmCrLVft.css.map +0 -1
- package/dist/C_Cascade-U6A5AJJb.css.map +0 -1
- package/dist/C_Cascade.js.map +0 -1
- package/dist/C_Cascade2.js.map +0 -1
- package/dist/C_Chat-CF1SU7mc.css.map +0 -1
- package/dist/C_Chat-DeUv6uuI.css.map +0 -1
- package/dist/C_Chat.js.map +0 -1
- package/dist/C_Chat2.js.map +0 -1
- package/dist/C_City-DdkX6u64.css.map +0 -1
- package/dist/C_City-iP-dIvui.css.map +0 -1
- package/dist/C_City.js.map +0 -1
- package/dist/C_City2.js.map +0 -1
- package/dist/C_Code-BWmJMNS7.css.map +0 -1
- package/dist/C_Code-k14vjgVl.css.map +0 -1
- package/dist/C_Code.js.map +0 -1
- package/dist/C_Code2.js.map +0 -1
- package/dist/C_CollapsePanel-BSKcWSmY.css.map +0 -1
- package/dist/C_CollapsePanel-DRvRq8tB.css.map +0 -1
- package/dist/C_CollapsePanel.js.map +0 -1
- package/dist/C_CollapsePanel2.js.map +0 -1
- package/dist/C_ContextMenu-Bn_uhJSo.css.map +0 -1
- package/dist/C_ContextMenu-C9iuxG2n.css.map +0 -1
- package/dist/C_ContextMenu.js.map +0 -1
- package/dist/C_ContextMenu2.js.map +0 -1
- package/dist/C_Cron-BIQ2By9v.css.map +0 -1
- package/dist/C_Cron-BNSAGD6A.css.map +0 -1
- package/dist/C_Cron.js.map +0 -1
- package/dist/C_Cron2.js.map +0 -1
- package/dist/C_Date.js.map +0 -1
- package/dist/C_Date2.js.map +0 -1
- package/dist/C_Draggable-BDAbk4s5.css.map +0 -1
- package/dist/C_Draggable-UhfDLXop.css.map +0 -1
- package/dist/C_Draggable.js.map +0 -1
- package/dist/C_Draggable2.js.map +0 -1
- package/dist/C_Editor-CZOaChru.css.map +0 -1
- package/dist/C_Editor-kJAQq5z6.css.map +0 -1
- package/dist/C_Editor.js.map +0 -1
- package/dist/C_Editor2.js.map +0 -1
- package/dist/C_FilePreview-Bs_omgJS.css.map +0 -1
- package/dist/C_FilePreview-DbwoyF2j.css.map +0 -1
- package/dist/C_FilePreview.js.map +0 -1
- package/dist/C_FilePreview2.js.map +0 -1
- package/dist/C_Form-B_2ql62V.css.map +0 -1
- package/dist/C_Form-CX-7xsz3.css.map +0 -1
- package/dist/C_Form.js.map +0 -1
- package/dist/C_Form2.js.map +0 -1
- package/dist/C_FormSearch-C3F8peAY.css.map +0 -1
- package/dist/C_FormSearch-qW56bJPo.css.map +0 -1
- package/dist/C_FormSearch.js.map +0 -1
- package/dist/C_FormSearch2.js.map +0 -1
- package/dist/C_FormulaEditor-ChOvDbsZ.css.map +0 -1
- package/dist/C_FormulaEditor-mfiIUDY4.css.map +0 -1
- package/dist/C_FormulaEditor.js.map +0 -1
- package/dist/C_FormulaEditor2.js.map +0 -1
- package/dist/C_FullCalendar-C2nsqrgS.css.map +0 -1
- package/dist/C_FullCalendar-DdFtXVhy.css.map +0 -1
- package/dist/C_FullCalendar.js.map +0 -1
- package/dist/C_FullCalendar2.js.map +0 -1
- package/dist/C_GlobalSearch-Dq4Wo01K.css.map +0 -1
- package/dist/C_GlobalSearch-RB7J43gu.css.map +0 -1
- package/dist/C_GlobalSearch.js.map +0 -1
- package/dist/C_GlobalSearch2.js.map +0 -1
- package/dist/C_Guide.js.map +0 -1
- package/dist/C_Guide2.js.map +0 -1
- package/dist/C_Icon.js.map +0 -1
- package/dist/C_Icon2.js.map +0 -1
- package/dist/C_ImageCropper-CdTX2nxU.css.map +0 -1
- package/dist/C_ImageCropper-ilOqPklJ.css.map +0 -1
- package/dist/C_ImageCropper.js.map +0 -1
- package/dist/C_ImageCropper2.js.map +0 -1
- package/dist/C_Language.js.map +0 -1
- package/dist/C_Language2.js.map +0 -1
- package/dist/C_Login-B3qYkLrN.css.map +0 -1
- package/dist/C_Login-xMI1_ojE.css.map +0 -1
- package/dist/C_Login.js.map +0 -1
- package/dist/C_Login2.js.map +0 -1
- package/dist/C_Map-CWMMN58_.css.map +0 -1
- package/dist/C_Map-xSR2H-9o.css.map +0 -1
- package/dist/C_Map.js.map +0 -1
- package/dist/C_Map2.js.map +0 -1
- package/dist/C_Markdown-C7lTVJ1S.css.map +0 -1
- package/dist/C_Markdown-CZDm_baQ.css.map +0 -1
- package/dist/C_Markdown.js.map +0 -1
- package/dist/C_Markdown2.js.map +0 -1
- package/dist/C_Menu.js.map +0 -1
- package/dist/C_Menu2.js.map +0 -1
- package/dist/C_NotificationCenter-D7GGGWg7.css.map +0 -1
- package/dist/C_NotificationCenter-SSmeHA45.css.map +0 -1
- package/dist/C_NotificationCenter.js.map +0 -1
- package/dist/C_NotificationCenter2.js.map +0 -1
- package/dist/C_OrgChart-ChZu346B.css.map +0 -1
- package/dist/C_OrgChart-DqBufOv5.css.map +0 -1
- package/dist/C_OrgChart.js.map +0 -1
- package/dist/C_OrgChart2.js.map +0 -1
- package/dist/C_Progress.js.map +0 -1
- package/dist/C_Progress2.js.map +0 -1
- package/dist/C_QRCode-B_1lHUdx.css.map +0 -1
- package/dist/C_QRCode-CuQRYu0s.css.map +0 -1
- package/dist/C_QRCode.js.map +0 -1
- package/dist/C_QRCode2.js.map +0 -1
- package/dist/C_Signature-Bp-RBpAl.css.map +0 -1
- package/dist/C_Signature-Cb2VW1ok.css.map +0 -1
- package/dist/C_Signature.js.map +0 -1
- package/dist/C_Signature2.js.map +0 -1
- package/dist/C_Skeleton-BNPbaut7.css.map +0 -1
- package/dist/C_Skeleton-Djsjw8XY.css.map +0 -1
- package/dist/C_Skeleton.js.map +0 -1
- package/dist/C_Skeleton2.js.map +0 -1
- package/dist/C_SplitPane-CgGWYsRE.css.map +0 -1
- package/dist/C_SplitPane-DGf6WEeR.css.map +0 -1
- package/dist/C_SplitPane.js.map +0 -1
- package/dist/C_SplitPane2.js.map +0 -1
- package/dist/C_Steps-27Exh7PM.css.map +0 -1
- package/dist/C_Steps-DU9ZsFrs.css.map +0 -1
- package/dist/C_Steps.js.map +0 -1
- package/dist/C_Steps2.js.map +0 -1
- package/dist/C_Table--kbQaaBv.css.map +0 -1
- package/dist/C_Table-D631kdXC.css.map +0 -1
- package/dist/C_Table.js.map +0 -1
- package/dist/C_Table2.js +0 -4
- package/dist/C_Table2.js.map +0 -1
- package/dist/C_TagsView-BN8vMRsY.css.map +0 -1
- package/dist/C_TagsView-s1dnSJAV.css.map +0 -1
- package/dist/C_TagsView.js.map +0 -1
- package/dist/C_TagsView2.js.map +0 -1
- package/dist/C_Theme.js.map +0 -1
- package/dist/C_Theme2.js.map +0 -1
- package/dist/C_Time-BQ9PGy8B.css.map +0 -1
- package/dist/C_Time-CO73krC6.css.map +0 -1
- package/dist/C_Time.js.map +0 -1
- package/dist/C_Time2.js.map +0 -1
- package/dist/C_Timeline-4rk0Dzgn.css.map +0 -1
- package/dist/C_Timeline-DdESmqwL.css.map +0 -1
- package/dist/C_Timeline.js.map +0 -1
- package/dist/C_Timeline2.js.map +0 -1
- package/dist/C_Transfer-B-vjvhjI.css.map +0 -1
- package/dist/C_Transfer-EzdHzZNv.css.map +0 -1
- package/dist/C_Transfer.js.map +0 -1
- package/dist/C_Transfer2.js.map +0 -1
- package/dist/C_Tree-CsXgGfhn.css.map +0 -1
- package/dist/C_Tree-P7eRpnOa.css.map +0 -1
- package/dist/C_Tree.js.map +0 -1
- package/dist/C_Tree2.js.map +0 -1
- package/dist/C_Upload-CHjiVVh7.css.map +0 -1
- package/dist/C_Upload-DE3OLsZD.css.map +0 -1
- package/dist/C_Upload.js.map +0 -1
- package/dist/C_Upload2.js.map +0 -1
- package/dist/C_VideoPlayer-CnaNOFtW.css.map +0 -1
- package/dist/C_VideoPlayer-cnP88zNV.css.map +0 -1
- package/dist/C_VideoPlayer.js.map +0 -1
- package/dist/C_VideoPlayer2.js.map +0 -1
- package/dist/C_VtableGantt-CZlJgvpC.css.map +0 -1
- package/dist/C_VtableGantt-DKfQkql0.css.map +0 -1
- package/dist/C_VtableGantt.js.map +0 -1
- package/dist/C_VtableGantt2.js.map +0 -1
- package/dist/C_WaterFall-BJ_39ext.css.map +0 -1
- package/dist/C_WaterFall-cYc1vntE.css.map +0 -1
- package/dist/C_WaterFall.js.map +0 -1
- package/dist/C_WaterFall2.js.map +0 -1
- package/dist/C_WorkFlow-BFzRGGhJ.css.map +0 -1
- package/dist/C_WorkFlow-DSyCOvRp.css.map +0 -1
- package/dist/C_WorkFlow.js.map +0 -1
- package/dist/C_WorkFlow2.js.map +0 -1
- package/dist/_shared.cjs +0 -1
- package/dist/_shared.d.cts +0 -2
- package/dist/_shared.d.ts +0 -2
- package/dist/_shared.js +0 -1
- package/dist/city.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/menuAdapter.js +0 -2
- package/dist/menuAdapter.js.map +0 -1
- package/dist/resolver.cjs.map +0 -1
- package/dist/resolver.js.map +0 -1
- package/dist/storage.js.map +0 -1
- /package/dist/{chunk.js → chunk.cjs} +0 -0
package/dist/C_GlobalSearch2.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./export-helper.js";import{Fragment as t,Teleport as n,Transition as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,isRef as f,nextTick as p,normalizeClass as m,onMounted as h,onUnmounted as g,openBlock as _,ref as v,renderList as y,resolveDynamicComponent as b,toDisplayString as x,unref as S,vModelText as C,watch as w,withCtx as T,withDirectives as E,withKeys as D,withModifiers as O}from"vue";function k(e){let{menuItems:t,isDark:n,onSelect:r,storageKey:a=`robot-search-history`,maxHistory:o=10,maxDisplayHistory:s=5}=e,c=v(!1),
|
|
2
|
-
//# sourceMappingURL=C_GlobalSearch2.js.map
|
|
1
|
+
import{t as e}from"./export-helper.js";import{Fragment as t,Teleport as n,Transition as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,isRef as f,nextTick as p,normalizeClass as m,onMounted as h,onUnmounted as g,openBlock as _,ref as v,renderList as y,resolveDynamicComponent as b,toDisplayString as x,unref as S,vModelText as C,watch as w,withCtx as T,withDirectives as E,withKeys as D,withModifiers as O}from"vue";function k(e){let{menuItems:t,isDark:n,onSelect:r,storageKey:a=`robot-search-history`,maxHistory:o=10,maxDisplayHistory:s=5}=e,c=Math.min(100,Math.max(0,Math.trunc(o))),l=Math.min(c,Math.max(0,Math.trunc(s))),u=v(!1),d=v(``),f=v(0),m=v(),_=v([]),y=i(()=>n?.()??!1),b=i(()=>{if(!d.value.trim())return[];let e=d.value.toLowerCase();return t().filter(t=>t.label.toLowerCase().includes(e)||D(t.key).toLowerCase().includes(e))}),x=i(()=>_.value.slice(0,l)),S=i(()=>b.value.length>0),C=i(()=>S.value||x.value.length>0),T=(e,t)=>[`robot-result-item`,t&&`robot-history-item`,{"robot-result-item-selected":f.value===e}],E=(e,t)=>{if(!t)return[{text:e,matched:!1}];let n=RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)})`,`gi`);return e.split(n).filter(Boolean).map(e=>({text:e,matched:e.toLocaleLowerCase()===t.toLocaleLowerCase()}))},D=e=>e.replace(/^\//,``).replace(/\//g,` > `)||`首页`,O=()=>{if(!(typeof localStorage>`u`))try{let e=_.value.map(e=>({query:e.query,menuKey:e.menuItem?.key??null,timestamp:e.timestamp}));localStorage.setItem(a,JSON.stringify(e))}catch{}},k=e=>{if(!e.label.trim())return;let t=e.label,n=_.value.filter(n=>!(n.query===t&&n.menuItem?.key===e.key));_.value=[{query:t,menuItem:e,timestamp:Date.now()},...n].slice(0,c),O()},A=()=>{if(!(typeof localStorage>`u`))try{let e=localStorage.getItem(a);if(e){let n=JSON.parse(e);if(!Array.isArray(n))return;let r=new Map(t().map(e=>[e.key,e]));_.value=n.flatMap(e=>{if(typeof e==`string`)return[{query:e.slice(0,200),menuItem:null,timestamp:0}];if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.query==`string`?t.query:``;if(!n.trim())return[];let i=t.menuItem&&typeof t.menuItem==`object`?t.menuItem:null,a=typeof t.menuKey==`string`?t.menuKey:typeof i?.key==`string`?i.key:``;return[{query:n.slice(0,200),menuItem:r.get(a)??null,timestamp:typeof t.timestamp==`number`&&Number.isFinite(t.timestamp)?t.timestamp:0}]}).slice(0,c)}}catch{_.value=[]}},j=()=>{if(_.value=[],!(typeof localStorage>`u`))try{localStorage.removeItem(a)}catch{}},M=e=>{_.value.splice(e,1),O(),f.value>=_.value.length&&(f.value=Math.max(0,_.value.length-1))},N=async()=>{u.value=!0,d.value=``,f.value=0,await p(),m.value?.focus()},P=()=>{u.value=!1,d.value=``,f.value=0},F=e=>{if(e.menuItem){let t=!!e.menuItem.children?.length;r?.(e.menuItem.key,t),P()}else d.value=e.query,f.value=0},I=e=>{k(e);let t=!!e.children?.length;r?.(e.key,t),P()};return w(d,()=>{f.value=0}),h(()=>{A();let e=e=>{e.defaultPrevented||(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),N())};document.addEventListener(`keydown`,e),g(()=>document.removeEventListener(`keydown`,e))}),{showDialog:u,searchValue:d,selectedIndex:f,searchInputRef:m,isDark:y,filteredMenuItems:b,displayHistory:x,hasResults:S,hasContent:C,getItemClasses:T,highlightMatch:E,formatMenuPath:D,clearHistory:j,removeHistoryItem:M,openDialog:N,closeDialog:P,selectHistoryItem:F,selectItem:I,handleEnter:()=>{let e=!d.value.trim()&&x.value.length>0,t=d.value.trim()&&b.value.length>0;if(e){let e=x.value[f.value];e&&F(e)}else if(t){let e=b.value[f.value];e&&I(e)}},focusNext:()=>{let e=d.value.trim()?b.value.length-1:x.value.length-1;f.value=Math.min(f.value+1,e)},focusPrev:()=>{f.value=Math.max(f.value-1,0)}}}const A={class:`robot-search-palette`},j={class:`robot-search-header`},M=[`placeholder`],N={class:`robot-search-content`},P={key:0,class:`robot-empty-state`},F={class:`robot-search-results`},I={class:`robot-result-group`},ee={class:`robot-group-title`},te={class:`robot-group-count`},ne={class:`robot-group-items`},re=[`onClick`,`onMouseenter`],ie={key:1,class:`robot-item-icon robot-default-icon`},ae={class:`robot-item-content`},oe={class:`robot-item-label`},se={class:`robot-item-desc`},ce=[`onClick`],le={class:`robot-search-results`},ue={key:0,class:`robot-empty-state`},de={class:`robot-result-group`},L={class:`robot-group-title`},R={class:`robot-group-count`},z={class:`robot-group-items`},B=[`onClick`,`onMouseenter`],V={key:1,class:`robot-item-icon robot-default-icon`},fe={class:`robot-item-content`},pe={class:`robot-item-label`},me={key:0,class:`robot-highlight`},he={class:`robot-item-desc`},ge={key:2,class:`robot-item-badge`},_e={class:`robot-search-footer`},ve={key:0,class:`robot-footer-info`},ye={key:0},be={key:1};var H=e(d({name:`C_GlobalSearch`,__name:`index`,props:{options:{},placeholder:{default:`搜索导航菜单...`},emptyText:{default:`输入关键词搜索菜单`},resultGroupTitle:{default:`菜单导航`}},setup(e,{expose:i}){let{showDialog:d,searchValue:p,selectedIndex:h,searchInputRef:g,isDark:v,filteredMenuItems:w,displayHistory:H,hasResults:U,hasContent:W,getItemClasses:G,highlightMatch:xe,formatMenuPath:K,clearHistory:q,removeHistoryItem:J,openDialog:Y,closeDialog:X,selectHistoryItem:Se,selectItem:Ce,handleEnter:Z,focusNext:Q,focusPrev:$}=k(e.options);return i({openDialog:Y,closeDialog:X}),(i,k)=>(_(),s(`div`,A,[o(` 搜索触发按钮 `),c(`div`,{class:m([`robot-search-trigger`,{"trigger-dark":S(v)}]),onClick:k[0]||=(...e)=>S(Y)&&S(Y)(...e)},[...k[11]||=[c(`div`,{class:`i-mdi:search robot-trigger-icon`},null,-1),c(`span`,{class:`robot-trigger-text`},`搜索`,-1),c(`span`,{class:`robot-trigger-shortcut`},`Ctrl K`,-1)]],2),o(` 搜索对话框 `),(_(),a(n,{to:`body`},[u(r,{name:`robot-dialog`},{default:T(()=>[S(d)?(_(),s(`div`,{key:0,class:`robot-dialog-overlay`,onClick:k[9]||=(...e)=>S(X)&&S(X)(...e),onKeydown:k[10]||=D((...e)=>S(X)&&S(X)(...e),[`esc`])},[c(`div`,{class:m([`robot-dialog-container`,{"dialog-dark":S(v)}]),onClick:k[8]||=O(()=>{},[`stop`])},[o(` 搜索头部 `),c(`div`,j,[k[13]||=c(`div`,{class:`i-mdi:magnify robot-search-icon`},null,-1),E(c(`input`,{ref_key:`searchInputRef`,ref:g,"onUpdate:modelValue":k[1]||=e=>f(p)?p.value=e:null,type:`text`,placeholder:e.placeholder,class:`robot-search-input`,onKeydown:[k[2]||=D((...e)=>S(X)&&S(X)(...e),[`esc`]),k[3]||=D((...e)=>S(Z)&&S(Z)(...e),[`enter`]),k[4]||=D((...e)=>S(Q)&&S(Q)(...e),[`arrow-down`]),k[5]||=D((...e)=>S($)&&S($)(...e),[`arrow-up`])]},null,40,M),[[C,S(p)]]),c(`button`,{class:`robot-close-btn`,onClick:k[6]||=(...e)=>S(X)&&S(X)(...e)},[...k[12]||=[c(`div`,{class:`i-mdi:close`},null,-1)]])]),o(` 搜索内容 `),c(`div`,N,[o(` 空状态 `),S(W)?!S(p).trim()&&S(H).length>0?(_(),s(t,{key:1},[o(` 搜索历史 `),c(`div`,F,[c(`div`,I,[c(`div`,ee,[k[16]||=c(`div`,{class:`i-mdi:clock-time-four-outline robot-group-icon`},null,-1),k[17]||=l(` 最近搜索 `,-1),c(`span`,te,x(S(H).length),1),c(`button`,{class:`robot-clear-history`,onClick:k[7]||=(...e)=>S(q)&&S(q)(...e),title:`清空历史`},[...k[15]||=[c(`div`,{class:`i-mdi:delete-outline`},null,-1)]])]),c(`div`,ne,[(_(!0),s(t,null,y(S(H),(e,t)=>(_(),s(`div`,{key:`history-${t}`,class:m(S(G)(t,!0)),onClick:t=>S(Se)(e),onMouseenter:e=>h.value=t},[e.menuItem?.icon?(_(),a(b(e.menuItem.icon),{key:0,class:`robot-item-icon`})):(_(),s(`div`,ie,[...k[18]||=[c(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),c(`div`,ae,[c(`div`,oe,x(e.query),1),c(`div`,se,x(S(K)(e.menuItem?.key||``)),1)]),c(`button`,{class:`robot-history-delete`,onClick:O(e=>S(J)(t),[`stop`]),title:`删除此记录`},[...k[19]||=[c(`div`,{class:`i-mdi:close`},null,-1)]],8,ce)],42,re))),128))])])])],64)):S(p).trim()?(_(),s(t,{key:2},[o(` 搜索结果 `),c(`div`,le,[o(` 无结果状态 `),S(U)?(_(),s(t,{key:1},[o(` 搜索结果列表 `),c(`div`,de,[c(`div`,L,[k[21]||=c(`div`,{class:`i-mdi:menu robot-group-icon`},null,-1),l(` `+x(e.resultGroupTitle)+` `,1),c(`span`,R,x(S(w).length),1)]),c(`div`,z,[(_(!0),s(t,null,y(S(w),(e,n)=>(_(),s(`div`,{key:e.key,class:m(S(G)(n,!1)),onClick:t=>S(Ce)(e),onMouseenter:e=>h.value=n},[e.icon?(_(),a(b(e.icon),{key:0,class:`robot-item-icon`})):(_(),s(`div`,V,[...k[22]||=[c(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),c(`div`,fe,[c(`div`,pe,[(_(!0),s(t,null,y(S(xe)(e.label,S(p)),(e,n)=>(_(),s(t,{key:n},[e.matched?(_(),s(`mark`,me,x(e.text),1)):(_(),s(t,{key:1},[l(x(e.text),1)],64))],64))),128))]),c(`div`,he,x(S(K)(e.key)),1)]),e.children?.length?(_(),s(`div`,ge,x(e.children.length),1)):o(`v-if`,!0)],42,B))),128))])])],2112)):(_(),s(`div`,ue,[k[20]||=c(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),c(`p`,null,`未找到 "`+x(S(p))+`" 相关内容`,1)]))])],64)):o(`v-if`,!0):(_(),s(`div`,P,[k[14]||=c(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),c(`p`,null,x(e.emptyText),1)]))]),o(` 搜索底部 `),c(`div`,_e,[k[23]||=c(`div`,{class:`robot-footer-actions`},[c(`div`,{class:`robot-action-item`},[c(`kbd`,null,`↵`),c(`span`,null,`选择`)]),c(`div`,{class:`robot-action-item`},[c(`kbd`,null,`↑↓`),c(`span`,null,`导航`)]),c(`div`,{class:`robot-action-item`},[c(`kbd`,null,`esc`),c(`span`,null,`关闭`)])],-1),S(W)?(_(),s(`div`,ve,[S(p).trim()&&S(U)?(_(),s(`span`,ye,` 共 `+x(S(w).length)+` 项结果 `,1)):!S(p).trim()&&S(H).length>0?(_(),s(`span`,be,x(S(H).length)+` 条历史记录 `,1)):o(`v-if`,!0)])):o(`v-if`,!0)])],2)],32)):o(`v-if`,!0)]),_:1})]))]))}}),[[`__scopeId`,`data-v-85c98271`]]);export{k as n,H as t};
|
package/dist/C_Guide.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./C_Icon2.cjs`);const e=require(`./C_Guide2.cjs`);exports.C_Guide=e.t;
|
package/dist/C_Guide.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.driver-popover{all:unset;font-family:var(--driver-popover-font-family,"Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif);box-sizing:border-box;color:#2d2d2d;z-index:1000000000;background-color:#fff;border-radius:5px;min-width:250px;max-width:300px;margin:0;padding:15px;position:fixed;top:0;right:0;box-shadow:0 1px 10px #0006}.driver-popover-title{zoom:1;margin:0;font-size:19px;font-weight:700;line-height:1.5;display:block;position:relative}.driver-popover-close-btn{all:unset;cursor:pointer;color:#d2d2d2;z-index:1;text-align:center;width:32px;height:28px;font-size:18px;font-weight:500;transition:color .2s;position:absolute;top:0;right:0}.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{zoom:1;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.5}.driver-popover-footer{text-align:right;zoom:1;justify-content:space-between;align-items:center;margin-top:15px;display:flex}.driver-popover-progress-text{color:#727272;zoom:1;font-size:13px;font-weight:400}.driver-popover-footer-btn{all:unset;box-sizing:border-box;color:#2d2d2d;cursor:pointer;zoom:1;background-color:#fff;border:1px solid #ccc;border-radius:3px;outline:0;padding:3px 7px;font-size:12px;line-height:1.3;text-decoration:none;display:inline-block}.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}.driver-popover-footer-btn:hover,.driver-popover-footer-btn:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{flex-grow:1;justify-content:flex-end;display:flex}.driver-popover-navigation-btns button+button{margin-left:4px}.driver-popover-arrow{content:"";border:5px solid #fff;position:absolute}.driver-popover-arrow-side-over{display:none}.driver-popover-arrow-side-left{border-top-color:#0000;border-bottom-color:#0000;border-right-color:#0000;left:100%}.driver-popover-arrow-side-right{border-top-color:#0000;border-bottom-color:#0000;border-left-color:#0000;right:100%}.driver-popover-arrow-side-top{border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;top:100%}.driver-popover-arrow-side-bottom{border-top-color:#0000;border-left-color:#0000;border-right-color:#0000;bottom:100%}.driver-popover-arrow-side-center,.driver-popover-arrow-none{display:none}.driver-active .driver-overlay{pointer-events:none}.driver-active.driver-no-scroll{overflow:hidden}.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in var(--driver-animation-duration,.4s) ease-in-out}.driver-fade .driver-popover{animation:animate-fade-in var(--driver-animation-duration,.4s)}.driver-active-element-parent-no-scroll{overflow:hidden!important}.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}
|
package/dist/C_Guide.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as GuideTheme, i as GuideStep, n as GuidePersistence, r as GuideProps, t as _default } from "./index14.vue.
|
|
1
|
+
import { a as GuideTheme, i as GuideStep, n as GuidePersistence, r as GuideProps, t as _default } from "./index14.vue.cjs";
|
|
2
2
|
export { _default as C_Guide, type GuidePersistence, type GuideProps, type GuideStep, type GuideTheme };
|
package/dist/C_Guide.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as GuideTheme, i as GuideStep, n as GuidePersistence, r as GuideProps, t as _default } from "./
|
|
1
|
+
import { a as GuideTheme, i as GuideStep, n as GuidePersistence, r as GuideProps, t as _default } from "./index13.vue.js";
|
|
2
2
|
export { _default as C_Guide, type GuidePersistence, type GuideProps, type GuideStep, type GuideTheme };
|
package/dist/C_Guide.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Guide2.js";export{e as C_Guide};
|
|
1
|
+
import"./C_Icon2.js";import{t as e}from"./C_Guide2.js";export{e as C_Guide};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`);let t=require(`vue`),n=require(`naive-ui`),r=require(`driver.js`);const i=(0,t.defineComponent)({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},doneBtnText:{default:`完成`},nextBtnText:{default:`下一步`},prevBtnText:{default:`上一步`},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{default:`功能引导`},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`step-change`],setup(i,{expose:a,emit:o}){let s=i,c=o,l=null,u=(0,t.computed)(()=>`${s.persistence?.keyPrefix??`c_guide`}_completed`),d=()=>{if(!s.persistence?.enabled)return!1;try{return localStorage.getItem(u.value)===`true`}catch{return!1}},f=()=>{if(s.persistence?.enabled)try{localStorage.setItem(u.value,`true`)}catch{}},p=()=>{try{localStorage.removeItem(u.value)}catch{}},m=()=>s.steps.filter(e=>!e.skipIf?.()),h=()=>s.popoverClass||``,g=(e=!1)=>{if(!e&&d())return;let t=m();if(!t.length){console.warn(`[C_Guide] 未提供引导步骤(steps),请通过 :steps prop 传入。`);return}l?.destroy();let n=0,i=!1,a=(0,r.driver)({popoverClass:h(),animate:s.animate,showProgress:s.showProgress,allowClose:s.allowClose,allowKeyboardControl:s.keyboard,overlayOpacity:s.theme?.overlayOpacity,doneBtnText:s.doneBtnText,nextBtnText:s.nextBtnText,prevBtnText:s.prevBtnText,steps:t.map(e=>({element:e.element,popover:e.popover})),onPopoverRender:e=>{s.theme?.popoverBgColor&&(e.wrapper.style.backgroundColor=s.theme.popoverBgColor),s.theme?.popoverTextColor&&(e.wrapper.style.color=s.theme.popoverTextColor),s.theme?.borderRadius&&(e.wrapper.style.borderRadius=s.theme.borderRadius),s.theme?.primaryColor&&(e.nextButton.style.backgroundColor=s.theme.primaryColor,e.nextButton.style.borderColor=s.theme.primaryColor)},onHighlightStarted:(e,r,{state:i})=>{n=i.activeIndex??n;let a=t[n];a&&(a.onHighlightStarted?.(e,a),c(`step-change`,n,a))},onDeselected:e=>{let r=t[n];r?.onDeselected?.(e,r)},onNextClick:()=>{a.isLastStep()?(i=!0,a.destroy()):a.moveNext()},onDestroyStarted:()=>{i?(f(),c(`complete`)):c(`close`,n),l=null,a.destroy()}});c(`start`),l=a,a.drive()};return(0,t.onBeforeUnmount)(()=>{l?.destroy(),l=null}),a({startGuide:g,resetCompleted:p,isCompleted:d}),(r,i)=>s.showTrigger?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.NTooltip),{key:0,placement:`bottom`,trigger:`hover`},{trigger:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.NButton),{text:``,onClick:g},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(e.t,{name:s.triggerIcon,size:18},null,8,[`name`])]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(s.triggerTooltip),1)]),_:1})):(0,t.createCommentVNode)(`v-if`,!0)}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
package/dist/C_Guide2.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{
|
|
2
|
-
//# sourceMappingURL=C_Guide2.js.map
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{computed as t,createBlock as n,createCommentVNode as r,createElementVNode as i,createVNode as a,defineComponent as o,onBeforeUnmount as s,openBlock as c,toDisplayString as l,unref as u,withCtx as d}from"vue";import{NButton as f,NTooltip as p}from"naive-ui";import{driver as m}from"driver.js";const h=o({name:`C_Guide`,__name:`index`,props:{steps:{default:()=>[]},doneBtnText:{default:`完成`},nextBtnText:{default:`下一步`},prevBtnText:{default:`上一步`},showProgress:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},allowClose:{type:Boolean,default:!0},theme:{},persistence:{},popoverClass:{default:`driverjs-theme`},showTrigger:{type:Boolean,default:!0},triggerTooltip:{default:`功能引导`},triggerIcon:{default:`mdi:sign-routes`}},emits:[`start`,`complete`,`close`,`step-change`],setup(o,{expose:h,emit:g}){let _=o,v=g,y=null,b=t(()=>`${_.persistence?.keyPrefix??`c_guide`}_completed`),x=()=>{if(!_.persistence?.enabled)return!1;try{return localStorage.getItem(b.value)===`true`}catch{return!1}},S=()=>{if(_.persistence?.enabled)try{localStorage.setItem(b.value,`true`)}catch{}},C=()=>{try{localStorage.removeItem(b.value)}catch{}},w=()=>_.steps.filter(e=>!e.skipIf?.()),T=()=>_.popoverClass||``,E=(e=!1)=>{if(!e&&x())return;let t=w();if(!t.length){console.warn(`[C_Guide] 未提供引导步骤(steps),请通过 :steps prop 传入。`);return}y?.destroy();let n=0,r=!1,i=m({popoverClass:T(),animate:_.animate,showProgress:_.showProgress,allowClose:_.allowClose,allowKeyboardControl:_.keyboard,overlayOpacity:_.theme?.overlayOpacity,doneBtnText:_.doneBtnText,nextBtnText:_.nextBtnText,prevBtnText:_.prevBtnText,steps:t.map(e=>({element:e.element,popover:e.popover})),onPopoverRender:e=>{_.theme?.popoverBgColor&&(e.wrapper.style.backgroundColor=_.theme.popoverBgColor),_.theme?.popoverTextColor&&(e.wrapper.style.color=_.theme.popoverTextColor),_.theme?.borderRadius&&(e.wrapper.style.borderRadius=_.theme.borderRadius),_.theme?.primaryColor&&(e.nextButton.style.backgroundColor=_.theme.primaryColor,e.nextButton.style.borderColor=_.theme.primaryColor)},onHighlightStarted:(e,r,{state:i})=>{n=i.activeIndex??n;let a=t[n];a&&(a.onHighlightStarted?.(e,a),v(`step-change`,n,a))},onDeselected:e=>{let r=t[n];r?.onDeselected?.(e,r)},onNextClick:()=>{i.isLastStep()?(r=!0,i.destroy()):i.moveNext()},onDestroyStarted:()=>{r?(S(),v(`complete`)):v(`close`,n),y=null,i.destroy()}});v(`start`),y=i,i.drive()};return s(()=>{y?.destroy(),y=null}),h({startGuide:E,resetCompleted:C,isCompleted:x}),(t,o)=>_.showTrigger?(c(),n(u(p),{key:0,placement:`bottom`,trigger:`hover`},{trigger:d(()=>[a(u(f),{text:``,onClick:E},{default:d(()=>[a(e,{name:_.triggerIcon,size:18},null,8,[`name`])]),_:1})]),default:d(()=>[i(`span`,null,l(_.triggerTooltip),1)]),_:1})):r(`v-if`,!0)}});export{h as t};
|
package/dist/C_Icon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./C_Icon2.cjs`);exports.C_Icon=e.t;
|
package/dist/C_Icon.css
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* unplugin-vue-components disabled */.c-icon[data-v-d0d8dba0] {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
user-select: none;
|
|
6
|
+
transition: all 0.2s ease-in-out;
|
|
7
|
+
}
|
|
8
|
+
.c-icon--clickable[data-v-d0d8dba0] {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
.c-icon--clickable[data-v-d0d8dba0]:hover {
|
|
12
|
+
opacity: 0.8;
|
|
13
|
+
transform: scale(1.05);
|
|
14
|
+
}
|
|
15
|
+
.c-icon--clickable[data-v-d0d8dba0]:active {
|
|
16
|
+
transform: scale(0.95);
|
|
17
|
+
}
|
|
18
|
+
.c-icon--clickable[data-v-d0d8dba0]:focus-visible {
|
|
19
|
+
outline: 2px solid currentColor;
|
|
20
|
+
outline-offset: 2px;
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
}
|
|
23
|
+
.c-icon--loading[data-v-d0d8dba0] {
|
|
24
|
+
opacity: 0.6;
|
|
25
|
+
cursor: wait;
|
|
26
|
+
}
|
|
27
|
+
.c-icon--error[data-v-d0d8dba0] {
|
|
28
|
+
opacity: 0.5;
|
|
29
|
+
}
|
|
30
|
+
.c-icon__loading[data-v-d0d8dba0] {
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
.c-icon__spinner[data-v-d0d8dba0] {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
border: 2px solid currentColor;
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
border-top-color: transparent;
|
|
39
|
+
animation: spin-d0d8dba0 1s linear infinite;
|
|
40
|
+
}
|
|
41
|
+
.c-icon__error[data-v-d0d8dba0] {
|
|
42
|
+
font-size: 0.8em;
|
|
43
|
+
opacity: 0.5;
|
|
44
|
+
}
|
|
45
|
+
.c-icon__rotatable[data-v-d0d8dba0] {
|
|
46
|
+
transition: transform 0.3s ease-in-out;
|
|
47
|
+
}
|
|
48
|
+
.c-icon__flippable[data-v-d0d8dba0] {
|
|
49
|
+
transition: transform 0.3s ease-in-out;
|
|
50
|
+
}
|
|
51
|
+
@keyframes spin-d0d8dba0 {
|
|
52
|
+
0% {
|
|
53
|
+
transform: rotate(0deg);
|
|
54
|
+
}
|
|
55
|
+
100% {
|
|
56
|
+
transform: rotate(360deg);
|
|
57
|
+
}
|
|
58
|
+
}
|
package/dist/C_Icon.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as IconProps, t as _default } from "./index15.vue.
|
|
1
|
+
import { n as IconProps, t as _default } from "./index15.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 "./
|
|
1
|
+
import { n as IconProps, t as _default } from "./index14.vue.js";
|
|
2
2
|
export { _default as C_Icon, type IconProps };
|
package/dist/C_Icon2.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`);let t=require(`vue`),n=require(`@iconify/vue`);const r=async(e,t)=>{if(!e)return``;if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`/`))return e;if(t)try{return await t(e)}catch(t){return console.error(`[useImage] 自定义解析器处理失败: ${e}`,t),``}return e},i=[`title`,`aria-label`,`role`,`tabindex`],a=[`width`,`height`,`viewBox`,`fill`],o=[`d`,`fill`],s=[`src`,`alt`,`width`,`height`],c=[`title`],l=(0,t.defineComponent)({__name:`index`,props:{name:{default:void 0},type:{default:`iconify`},color:{default:`currentColor`},size:{default:18},svgPath:{default:``},viewBox:{default:`0 0 24 24`},alt:{default:``},clickable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fallbackIcon:{default:``},title:{default:``},ariaLabel:{default:``},customClass:{default:``},rotate:{default:0},flip:{default:void 0},componentProps:{default:()=>({})}},emits:[`click`,`error`,`load`],setup(e,{expose:l,emit:u}){let d=e,f=u,p=(0,t.ref)(),m=(0,t.ref)(!1),h=(0,t.ref)(``),g=(0,t.ref)(``),_=(0,t.ref)(!1),v=(0,t.computed)(()=>({fontSize:typeof d.size==`number`?`${d.size}px`:d.size,color:d.color,cursor:d.clickable?`pointer`:`inherit`})),y=(0,t.computed)(()=>{let e={display:`inline-flex`,justifyContent:`center`,alignItems:`center`,width:typeof d.size==`number`?`${d.size}px`:d.size,height:typeof d.size==`number`?`${d.size}px`:d.size};if(d.rotate&&(e.transform=`rotate(${d.rotate}deg)`),d.flip){let t=d.flip===`horizontal`||d.flip===`both`?-1:1,n=d.flip===`vertical`||d.flip===`both`?-1:1;e.transform=`${e.transform||``} scaleX(${t}) scaleY(${n})`.trim()}return e}),b=(0,t.computed)(()=>typeof d.name==`string`?d.name:d.name&&d.name.__name?d.name.__name:d.name&&d.name.name?d.name.name:`Component Icon`),x=(0,t.computed)(()=>[d.customClass,{"c-icon__rotatable":d.rotate!==0,"c-icon__flippable":!!d.flip}]),S=(0,t.computed)(()=>d.type!==`component`||!d.name?null:d.name),C=(e,t,n)=>{if(console.warn(`[C_Icon] ${t}:`,b.value,n),h.value=t,_.value=!1,f(`error`,e,n),d.fallbackIcon&&!m.value){m.value=!1;return}m.value=!0},w=e=>{!d.clickable||d.loading||f(`click`,e)},T=e=>{!d.clickable||d.loading||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(`click`,e))},E=()=>{_.value=!1,f(`load`)},D=async()=>{if(d.type!==`image`||typeof d.name!=`string`){g.value=``;return}if(d.name.startsWith(`http://`)||d.name.startsWith(`https://`)||d.name.startsWith(`//`)||d.name.startsWith(`/`)){g.value=d.name;return}try{_.value=!0;let e=await r(d.name);e?g.value=e:C(`image`,`图片路径解析失败`)}catch(e){C(`image`,`图片加载失败`,e)}finally{_.value=!1}},O={iconify:()=>(d.name.includes(`:`)||console.warn(`[C_Icon] Iconify图标名称格式应为 "prefix:name",如 "mdi:home"`),null),unocss:()=>((typeof d.name!=`string`||!d.name.startsWith(`i-`))&&console.warn(`[C_Icon] UnoCSS图标名称应以 "i-" 开头`),null),component:()=>S.value?null:`无法解析组件`,svg:()=>d.svgPath?null:`SVG路径不能为空`,image:()=>null},k=()=>{if(m.value=!1,h.value=``,!d.name)return C(`validation`,`图标名称不能为空`);let e=O[d.type];if(!e)return C(`type`,`不支持的图标类型`);let t=e();t&&C(d.type,t),d.type===`image`&&D()};return(0,t.watch)(()=>[d.name,d.type,d.svgPath],()=>{(0,t.nextTick)(k)},{immediate:!0}),(0,t.onMounted)(()=>{!m.value&&d.type!==`image`&&f(`load`)}),l({validate:k,hasError:(0,t.readonly)(m),errorMessage:(0,t.readonly)(h),el:p}),(r,l)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`iconRef`,ref:p,class:(0,t.normalizeClass)([`c-icon`,[`c-icon--${e.type}`,{"c-icon--clickable":e.clickable,"c-icon--loading":e.loading,"c-icon--error":m.value}]]),style:(0,t.normalizeStyle)(v.value),title:e.title||void 0,"aria-label":e.ariaLabel||b.value,role:e.clickable?`button`:`img`,tabindex:e.clickable?0:-1,onClick:w,onKeydown:T},[(0,t.createCommentVNode)(` 方式1:Iconify图标(默认方式) `),(e.type===`iconify`||!e.type)&&!m.value&&typeof e.name==`string`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.Icon),{key:0,icon:e.name,width:e.size,height:e.size,color:e.color,style:(0,t.normalizeStyle)(y.value),onError:l[0]||=()=>C(`iconify`,`Iconify图标加载失败`)},null,8,[`icon`,`width`,`height`,`color`,`style`])):e.type===`unocss`&&!m.value&&typeof e.name==`string`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createCommentVNode)(` 方式2:UnoCSS图标 `),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([e.name,x.value]),style:(0,t.normalizeStyle)(y.value),onError:l[1]||=()=>C(`unocss`,`UnoCSS图标渲染失败`)},null,38)],2112)):e.type===`component`&&S.value&&!m.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[(0,t.createCommentVNode)(` 方式3:组件挂载方式 `),((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(S.value),(0,t.mergeProps)({style:y.value},e.componentProps,{onError:l[2]||=()=>C(`component`,`组件图标渲染失败`)}),null,16,[`style`]))],2112)):e.type===`svg`&&e.svgPath&&!m.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:3},[(0,t.createCommentVNode)(` 方式4:SVG路径方式 `),((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{width:e.size,height:e.size,viewBox:e.viewBox,style:(0,t.normalizeStyle)(y.value),fill:e.color,onError:l[3]||=()=>C(`svg`,`SVG图标渲染失败`)},[(0,t.createElementVNode)(`path`,{d:e.svgPath,fill:e.color},null,8,o)],44,a))],2112)):e.type===`image`&&g.value&&!m.value&&!_.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createCommentVNode)(` 方式5:图片方式 - 修复异步加载 `),(0,t.createElementVNode)(`img`,{src:g.value,alt:e.alt||b.value,width:e.size,height:e.size,style:{display:`inline-block`,"vertical-align":`middle`},onError:l[4]||=()=>C(`image`,`图片图标加载失败`),onLoad:E},null,40,s)],2112)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createCommentVNode)(` 图片加载状态 `),(e.loading||_.value)&&!m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:5,class:`c-icon__loading`,style:(0,t.normalizeStyle)(y.value)},[...l[5]||=[(0,t.createElementVNode)(`div`,{class:`c-icon__spinner`},null,-1)]],4)):m.value&&e.fallbackIcon?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:6},[(0,t.createCommentVNode)(` 统一错误状态显示 `),(0,t.createVNode)((0,t.unref)(n.Icon),{icon:e.fallbackIcon,width:e.size,height:e.size,color:e.color,style:(0,t.normalizeStyle)(y.value)},null,8,[`icon`,`width`,`height`,`color`,`style`])],2112)):m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:7,class:`c-icon__error`,style:(0,t.normalizeStyle)(y.value),title:`图标解析失败: ${b.value} (${h.value})`},` ⚠️ `,12,c)):(0,t.createCommentVNode)(`v-if`,!0)],46,i))}});var u=e.t(l,[[`__scopeId`,`data-v-d0d8dba0`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
package/dist/C_Icon2.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{Fragment as
|
|
2
|
-
//# sourceMappingURL=C_Icon2.js.map
|
|
1
|
+
import{t as e}from"./export-helper.js";import{Fragment as t,computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createVNode as s,defineComponent as c,mergeProps as l,nextTick as u,normalizeClass as d,normalizeStyle as f,onMounted as p,openBlock as m,readonly as h,ref as g,resolveDynamicComponent as _,unref as v,watch as y}from"vue";import{Icon as b}from"@iconify/vue";const x=async(e,t)=>{if(!e)return``;if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)||e.startsWith(`/`))return e;if(t)try{return await t(e)}catch(t){return console.error(`[useImage] 自定义解析器处理失败: ${e}`,t),``}return e},S=[`title`,`aria-label`,`role`,`tabindex`],C=[`width`,`height`,`viewBox`,`fill`],w=[`d`,`fill`],T=[`src`,`alt`,`width`,`height`],E=[`title`];var D=e(c({__name:`index`,props:{name:{default:void 0},type:{default:`iconify`},color:{default:`currentColor`},size:{default:18},svgPath:{default:``},viewBox:{default:`0 0 24 24`},alt:{default:``},clickable:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fallbackIcon:{default:``},title:{default:``},ariaLabel:{default:``},customClass:{default:``},rotate:{default:0},flip:{default:void 0},componentProps:{default:()=>({})}},emits:[`click`,`error`,`load`],setup(e,{expose:c,emit:D}){let O=e,k=D,A=g(),j=g(!1),M=g(``),N=g(``),P=g(!1),F=n(()=>({fontSize:typeof O.size==`number`?`${O.size}px`:O.size,color:O.color,cursor:O.clickable?`pointer`:`inherit`})),I=n(()=>{let e={display:`inline-flex`,justifyContent:`center`,alignItems:`center`,width:typeof O.size==`number`?`${O.size}px`:O.size,height:typeof O.size==`number`?`${O.size}px`:O.size};if(O.rotate&&(e.transform=`rotate(${O.rotate}deg)`),O.flip){let t=O.flip===`horizontal`||O.flip===`both`?-1:1,n=O.flip===`vertical`||O.flip===`both`?-1:1;e.transform=`${e.transform||``} scaleX(${t}) scaleY(${n})`.trim()}return e}),L=n(()=>typeof O.name==`string`?O.name:O.name&&O.name.__name?O.name.__name:O.name&&O.name.name?O.name.name:`Component Icon`),R=n(()=>[O.customClass,{"c-icon__rotatable":O.rotate!==0,"c-icon__flippable":!!O.flip}]),z=n(()=>O.type!==`component`||!O.name?null:O.name),B=(e,t,n)=>{if(console.warn(`[C_Icon] ${t}:`,L.value,n),M.value=t,P.value=!1,k(`error`,e,n),O.fallbackIcon&&!j.value){j.value=!1;return}j.value=!0},V=e=>{!O.clickable||O.loading||k(`click`,e)},H=e=>{!O.clickable||O.loading||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),k(`click`,e))},U=()=>{P.value=!1,k(`load`)},W=async()=>{if(O.type!==`image`||typeof O.name!=`string`){N.value=``;return}if(O.name.startsWith(`http://`)||O.name.startsWith(`https://`)||O.name.startsWith(`//`)||O.name.startsWith(`/`)){N.value=O.name;return}try{P.value=!0;let e=await x(O.name);e?N.value=e:B(`image`,`图片路径解析失败`)}catch(e){B(`image`,`图片加载失败`,e)}finally{P.value=!1}},G={iconify:()=>(O.name.includes(`:`)||console.warn(`[C_Icon] Iconify图标名称格式应为 "prefix:name",如 "mdi:home"`),null),unocss:()=>((typeof O.name!=`string`||!O.name.startsWith(`i-`))&&console.warn(`[C_Icon] UnoCSS图标名称应以 "i-" 开头`),null),component:()=>z.value?null:`无法解析组件`,svg:()=>O.svgPath?null:`SVG路径不能为空`,image:()=>null},K=()=>{if(j.value=!1,M.value=``,!O.name)return B(`validation`,`图标名称不能为空`);let e=G[O.type];if(!e)return B(`type`,`不支持的图标类型`);let t=e();t&&B(O.type,t),O.type===`image`&&W()};return y(()=>[O.name,O.type,O.svgPath],()=>{u(K)},{immediate:!0}),p(()=>{!j.value&&O.type!==`image`&&k(`load`)}),c({validate:K,hasError:h(j),errorMessage:h(M),el:A}),(n,c)=>(m(),a(`div`,{ref_key:`iconRef`,ref:A,class:d([`c-icon`,[`c-icon--${e.type}`,{"c-icon--clickable":e.clickable,"c-icon--loading":e.loading,"c-icon--error":j.value}]]),style:f(F.value),title:e.title||void 0,"aria-label":e.ariaLabel||L.value,role:e.clickable?`button`:`img`,tabindex:e.clickable?0:-1,onClick:V,onKeydown:H},[i(` 方式1:Iconify图标(默认方式) `),(e.type===`iconify`||!e.type)&&!j.value&&typeof e.name==`string`?(m(),r(v(b),{key:0,icon:e.name,width:e.size,height:e.size,color:e.color,style:f(I.value),onError:c[0]||=()=>B(`iconify`,`Iconify图标加载失败`)},null,8,[`icon`,`width`,`height`,`color`,`style`])):e.type===`unocss`&&!j.value&&typeof e.name==`string`?(m(),a(t,{key:1},[i(` 方式2:UnoCSS图标 `),o(`div`,{class:d([e.name,R.value]),style:f(I.value),onError:c[1]||=()=>B(`unocss`,`UnoCSS图标渲染失败`)},null,38)],2112)):e.type===`component`&&z.value&&!j.value?(m(),a(t,{key:2},[i(` 方式3:组件挂载方式 `),(m(),r(_(z.value),l({style:I.value},e.componentProps,{onError:c[2]||=()=>B(`component`,`组件图标渲染失败`)}),null,16,[`style`]))],2112)):e.type===`svg`&&e.svgPath&&!j.value?(m(),a(t,{key:3},[i(` 方式4:SVG路径方式 `),(m(),a(`svg`,{width:e.size,height:e.size,viewBox:e.viewBox,style:f(I.value),fill:e.color,onError:c[3]||=()=>B(`svg`,`SVG图标渲染失败`)},[o(`path`,{d:e.svgPath,fill:e.color},null,8,w)],44,C))],2112)):e.type===`image`&&N.value&&!j.value&&!P.value?(m(),a(t,{key:4},[i(` 方式5:图片方式 - 修复异步加载 `),o(`img`,{src:N.value,alt:e.alt||L.value,width:e.size,height:e.size,style:{display:`inline-block`,"vertical-align":`middle`},onError:c[4]||=()=>B(`image`,`图片图标加载失败`),onLoad:U},null,40,T)],2112)):i(`v-if`,!0),i(` 图片加载状态 `),(e.loading||P.value)&&!j.value?(m(),a(`div`,{key:5,class:`c-icon__loading`,style:f(I.value)},[...c[5]||=[o(`div`,{class:`c-icon__spinner`},null,-1)]],4)):j.value&&e.fallbackIcon?(m(),a(t,{key:6},[i(` 统一错误状态显示 `),s(v(b),{icon:e.fallbackIcon,width:e.size,height:e.size,color:e.color,style:f(I.value)},null,8,[`icon`,`width`,`height`,`color`,`style`])],2112)):j.value?(m(),a(`div`,{key:7,class:`c-icon__error`,style:f(I.value),title:`图标解析失败: ${L.value} (${M.value})`},` ⚠️ `,12,E)):i(`v-if`,!0)],46,S))}}),[[`__scopeId`,`data-v-d0d8dba0`]]);export{D as t};
|
package/dist/C_ImageCropper.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./C_Icon2.cjs`);const e=require(`./C_ImageCropper2.cjs`);exports.C_ImageCropper=e.t,exports.useCropperCore=e.n;
|
package/dist/C_ImageCropper.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CropResult, c as ImageCropperProps, i as CropOutputFormat, n as _default, o as ImageCropperEmits, r as AspectRatioPreset, s as ImageCropperExpose, t as useCropperCore } from "./useCropperCore.
|
|
1
|
+
import { a as CropResult, c as ImageCropperProps, i as CropOutputFormat, n as _default, o as ImageCropperEmits, r as AspectRatioPreset, s as ImageCropperExpose, t as useCropperCore } from "./useCropperCore.cjs";
|
|
2
2
|
export { type AspectRatioPreset, _default as C_ImageCropper, type CropOutputFormat, type CropResult, type ImageCropperEmits, type ImageCropperExpose, type ImageCropperProps, useCropperCore };
|
package/dist/C_ImageCropper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./C_ImageCropper2.js";export{t as C_ImageCropper,e as useCropperCore};
|
|
1
|
+
import"./C_Icon2.js";import{n as e,t}from"./C_ImageCropper2.js";export{t as C_ImageCropper,e as useCropperCore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`),i=require(`vue-cropper`);function a(e={}){let t=(0,n.ref)(null);function r(){t.value?.rotateLeft()}function i(){t.value?.rotateRight()}function a(e){let t=Math.round(e/90),n=t>0?i:r;for(let e=0;e<Math.abs(t);e++)n()}function o(e){t.value?.changeScale(e>0?1:-1)}function s(){let e=t.value?.$refs?.img;if(!e)return;let n=e.style.transform||``;n.includes(`scaleX(-1)`)?e.style.transform=n.replace(`scaleX(-1)`,`scaleX(1)`):e.style.transform=n.replace(/scaleX\([^)]*\)/,``)+` scaleX(-1)`}function c(){let e=t.value?.$refs?.img;if(!e)return;let n=e.style.transform||``;n.includes(`scaleY(-1)`)?e.style.transform=n.replace(`scaleY(-1)`,`scaleY(1)`):e.style.transform=n.replace(/scaleY\([^)]*\)/,``)+` scaleY(-1)`}function l(){t.value?.refresh()}function u(t,n){let r=t,i=n,a=e.maxWidth?.value??0,o=e.maxHeight?.value??0;if(a>0&&r>a){let e=a/r;r=a,i=Math.round(i*e)}if(o>0&&i>o){let e=o/i;i=o,r=Math.round(r*e)}return{width:r,height:i}}function d(){return new Promise((n,r)=>{let i=t.value;if(!i)return r(Error(`Cropper not initialized`));let a=e.format?.value??`png`,o=e.quality?.value??.92,s=a===`jpeg`?`image/jpeg`:a===`webp`?`image/webp`:`image/png`;i.getCropData(e=>{i.getCropBlob(t=>{let i=new Image;i.onload=()=>{let{width:r,height:c}=u(i.width,i.height);if(r!==i.width||c!==i.height){let e=document.createElement(`canvas`);e.width=r,e.height=c,e.getContext(`2d`).drawImage(i,0,0,r,c);let t=e.toDataURL(s,o);e.toBlob(e=>{n({base64:t,blob:e,width:r,height:c,format:a})},s,a===`png`?void 0:o)}else n({base64:e,blob:t,width:i.width,height:i.height,format:a})},i.onerror=()=>r(Error(`Failed to load crop result`)),i.src=e})})})}return{cropperRef:t,rotate:a,rotateLeft:r,rotateRight:i,zoom:o,flipX:s,flipY:c,reset:l,getCropResult:d}}const o={class:`cropper-toolbar`},s=(0,n.defineComponent)({__name:`CropperToolbar`,props:{currentRatio:{},ratioPresets:{}},emits:[`ratio`,`rotate`,`flipX`,`flipY`,`zoom`,`reset`],setup(t){return(i,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,o,[(0,n.createVNode)((0,n.unref)(r.NButtonGroup),{size:`small`},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(t.ratioPresets,e=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NButton),{key:e.value,type:t.currentRatio===e.value?`primary`:`default`,onClick:t=>i.$emit(`ratio`,e.value)},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.label),1)]),_:2},1032,[`type`,`onClick`]))),128))]),_:1}),(0,n.createVNode)((0,n.unref)(r.NDivider),{vertical:``}),(0,n.createVNode)((0,n.unref)(r.NTooltip),null,{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{size:`small`,quaternary:``,onClick:a[0]||=e=>i.$emit(`rotate`,-90)},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:rotate-left`})]),_:1})]),default:(0,n.withCtx)(()=>[a[7]||=(0,n.createTextVNode)(` 逆时针旋转 90° `,-1)]),_:1}),(0,n.createVNode)((0,n.unref)(r.NTooltip),null,{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{size:`small`,quaternary:``,onClick:a[1]||=e=>i.$emit(`rotate`,90)},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:rotate-right`})]),_:1})]),default:(0,n.withCtx)(()=>[a[8]||=(0,n.createTextVNode)(` 顺时针旋转 90° `,-1)]),_:1}),(0,n.createVNode)((0,n.unref)(r.NDivider),{vertical:``}),(0,n.createVNode)((0,n.unref)(r.NTooltip),null,{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{size:`small`,quaternary:``,onClick:a[2]||=e=>i.$emit(`flipX`)},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:flip-horizontal`})]),_:1})]),default:(0,n.withCtx)(()=>[a[9]||=(0,n.createTextVNode)(` 水平翻转 `,-1)]),_:1}),(0,n.createVNode)((0,n.unref)(r.NTooltip),null,{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{size:`small`,quaternary:``,onClick:a[3]||=e=>i.$emit(`flipY`)},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:flip-vertical`})]),_:1})]),default:(0,n.withCtx)(()=>[a[10]||=(0,n.createTextVNode)(` 垂直翻转 `,-1)]),_:1}),(0,n.createVNode)((0,n.unref)(r.NDivider),{vertical:``}),(0,n.createVNode)((0,n.unref)(r.NTooltip),null,{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{size:`small`,quaternary:``,onClick:a[4]||=e=>i.$emit(`zoom`,.1)},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:magnify-plus-outline`})]),_:1})]),default:(0,n.withCtx)(()=>[a[11]||=(0,n.createTextVNode)(` 放大 `,-1)]),_:1}),(0,n.createVNode)((0,n.unref)(r.NTooltip),null,{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{size:`small`,quaternary:``,onClick:a[5]||=e=>i.$emit(`zoom`,-.1)},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:magnify-minus-outline`})]),_:1})]),default:(0,n.withCtx)(()=>[a[12]||=(0,n.createTextVNode)(` 缩小 `,-1)]),_:1}),(0,n.createVNode)((0,n.unref)(r.NDivider),{vertical:``}),(0,n.createVNode)((0,n.unref)(r.NTooltip),null,{trigger:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{size:`small`,quaternary:``,onClick:a[6]||=e=>i.$emit(`reset`)},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:refresh`})]),_:1})]),default:(0,n.withCtx)(()=>[a[13]||=(0,n.createTextVNode)(` 重置 `,-1)]),_:1})]))}});var c=t.t(s,[[`__scopeId`,`data-v-499ffd01`]]);const l={class:`cropper-preview`},u={class:`preview-label`},d=[`src`],f={key:1,class:`preview-empty`},p={class:`preview-thumbs`},m=[`src`],h={class:`preview-thumb__label`},g=(0,n.defineComponent)({__name:`CropperPreview`,props:{previewData:{},circular:{type:Boolean}},setup(t){let r=t,i=(0,n.ref)(null),a=(0,n.ref)(200),o=[{label:`80px`,size:80},{label:`48px`,size:48},{label:`32px`,size:32}],s=(0,n.computed)(()=>{let e=r.previewData;return e&&e.url&&e.w>0&&e.h>0}),c=(0,n.computed)(()=>{if(!s.value)return{};let{w:e}=r.previewData;return{zoom:a.value/e,overflow:`hidden`}});function g(e){if(!s.value)return{};let{w:t}=r.previewData;return{zoom:e/t,overflow:`hidden`}}let _=null;return(0,n.onMounted)(()=>{i.value&&(a.value=i.value.clientWidth,_=new ResizeObserver(e=>{requestAnimationFrame(()=>{for(let t of e)a.value=t.contentRect.width})}),_.observe(i.value))}),(0,n.onBeforeUnmount)(()=>{_?.disconnect()}),(r,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,l,[(0,n.createElementVNode)(`div`,u,[(0,n.createVNode)(e.t,{name:`mdi:eye-outline`}),a[0]||=(0,n.createElementVNode)(`span`,null,`裁剪预览`,-1)]),(0,n.createElementVNode)(`div`,{ref_key:`mainBoxRef`,ref:i,class:(0,n.normalizeClass)([`preview-main`,{"preview-main--circular":t.circular}])},[s.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,class:`preview-main__viewport`,style:(0,n.normalizeStyle)(c.value)},[(0,n.createElementVNode)(`div`,{style:(0,n.normalizeStyle)(t.previewData.div)},[(0,n.createElementVNode)(`img`,{src:t.previewData.url,style:(0,n.normalizeStyle)(t.previewData.img),alt:`preview`},null,12,d)],4)],4)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,f,[(0,n.createVNode)(e.t,{name:`mdi:image-outline`,style:{"font-size":`32px`,opacity:`0.2`}})]))],2),(0,n.createElementVNode)(`div`,p,[((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(o,e=>(0,n.createElementVNode)(`div`,{key:e.label,class:`preview-thumb`},[(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`preview-thumb__box`,{"preview-thumb__box--circular":t.circular}]),style:(0,n.normalizeStyle)({width:`${e.size}px`,height:`${e.size}px`})},[s.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,class:`preview-thumb__viewport`,style:(0,n.normalizeStyle)(g(e.size))},[(0,n.createElementVNode)(`div`,{style:(0,n.normalizeStyle)(t.previewData.div)},[(0,n.createElementVNode)(`img`,{src:t.previewData.url,style:(0,n.normalizeStyle)(t.previewData.img),alt:`thumb`},null,12,m)],4)],4)):(0,n.createCommentVNode)(`v-if`,!0)],6),(0,n.createElementVNode)(`span`,h,(0,n.toDisplayString)(e.label),1)])),64))])]))}});var _=t.t(g,[[`__scopeId`,`data-v-cefefdc0`]]);const v={class:`c-image-cropper__body`},y={class:`c-image-cropper__workspace`},b={key:1,class:`c-image-cropper__placeholder`},x={key:0,class:`c-image-cropper__preview-panel`},S={key:1,class:`c-image-cropper`},C={class:`c-image-cropper__body`},w={class:`c-image-cropper__workspace`},T={key:1,class:`c-image-cropper__placeholder`},E={key:0,class:`c-image-cropper__preview-panel`},D=(0,n.defineComponent)({name:`C_ImageCropper`,__name:`index`,props:{src:{default:``},aspectRatio:{default:0},outputFormat:{default:`png`},outputQuality:{default:.92},maxOutputWidth:{default:0},maxOutputHeight:{default:0},showPreview:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!0},circular:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},height:{default:`400px`},modal:{type:Boolean,default:!1},modalTitle:{default:`图片裁剪`}},emits:[`crop`,`ready`,`error`,`confirm`,`cancel`],setup(t,{expose:o,emit:s}){let l=t,u=s,d=(0,n.ref)(l.src),f=(0,n.ref)(l.aspectRatio),p=(0,n.ref)(!1),m=(0,n.ref)(!1),h=(0,n.ref)(null),g=(0,n.ref)(null),D=(0,n.ref)(null),O=(0,n.computed)(()=>l.modal?D.value:g.value),k=(0,n.computed)(()=>typeof l.height==`number`?`${l.height}px`:l.height),A=(0,n.computed)(()=>({png:`png`,jpeg:`jpeg`,webp:`webp`})[l.outputFormat]||`png`),j=(0,n.computed)(()=>f.value>0),M=(0,n.computed)(()=>f.value<=0||f.value===1?[1,1]:Math.abs(f.value-16/9)<.01?[16,9]:Math.abs(f.value-4/3)<.01?[4,3]:Math.abs(f.value-3/2)<.01?[3,2]:[Math.round(f.value*100),100]),N=(0,n.computed)(()=>({width:300,height:f.value>0?300/f.value:200})),P=[{label:`自由`,value:0},{label:`1:1`,value:1},{label:`16:9`,value:16/9},{label:`4:3`,value:4/3},{label:`3:2`,value:3/2}],F=a({format:(0,n.computed)(()=>l.outputFormat),quality:(0,n.computed)(()=>l.outputQuality),maxWidth:(0,n.computed)(()=>l.maxOutputWidth),maxHeight:(0,n.computed)(()=>l.maxOutputHeight)});(0,n.watch)(O,e=>{F.cropperRef.value=e});function I(e){h.value=e}function L(e){e===`success`&&u(`ready`)}function R(e){F.rotate(e)}function z(e){f.value=e}function B(){F.reset()}async function V(){m.value=!0;try{let e=await F.getCropResult();u(`confirm`,e),u(`crop`,e),p.value=!1}finally{m.value=!1}}function H(){p.value=!1,u(`cancel`)}function U(e){let t=new FileReader;t.onload=e=>{d.value=e.target?.result},t.readAsDataURL(e)}return(0,n.watch)(()=>l.src,e=>{d.value=e}),(0,n.watch)(()=>l.aspectRatio,e=>{f.value=e}),o({getCropResult:F.getCropResult,rotate:F.rotate,zoom:F.zoom,flipX:F.flipX,flipY:F.flipY,reset:F.reset,setAspectRatio:e=>{f.value=e},loadFile:U,open:e=>{e&&(d.value=e),p.value=!0},close:()=>{p.value=!1}}),(t,a)=>l.modal?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NModal),{key:0,show:p.value,"onUpdate:show":a[0]||=e=>p.value=e,preset:`card`,title:l.modalTitle||`图片裁剪`,style:{width:`860px`},"mask-closable":!1,closable:!0},{footer:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NSpace),{justify:`end`},{default:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{onClick:H},{default:(0,n.withCtx)(()=>[...a[2]||=[(0,n.createTextVNode)(`取消`,-1)]]),_:1}),(0,n.createVNode)((0,n.unref)(r.NButton),{type:`primary`,loading:m.value,onClick:V},{default:(0,n.withCtx)(()=>[...a[3]||=[(0,n.createTextVNode)(`确认裁剪`,-1)]]),_:1},8,[`loading`])]),_:1})]),default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,v,[l.showToolbar?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0,"current-ratio":f.value,"ratio-presets":P,onRatio:z,onRotate:R,onFlipX:(0,n.unref)(F).flipX,onFlipY:(0,n.unref)(F).flipY,onZoom:(0,n.unref)(F).zoom,onReset:B},null,8,[`current-ratio`,`onFlipX`,`onFlipY`,`onZoom`])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`div`,y,[(0,n.createElementVNode)(`div`,{class:`c-image-cropper__canvas`,style:(0,n.normalizeStyle)({height:k.value})},[d.value?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(i.VueCropper),{key:0,ref_key:`modalCropperRef`,ref:D,img:d.value,"output-size":l.outputQuality,"output-type":A.value,"can-scale":!1,"auto-crop":!0,"auto-crop-width":N.value.width,"auto-crop-height":N.value.height,fixed:j.value,"fixed-number":M.value,"center-box":!0,info:!0,"info-true":!0,"can-move":!0,"can-move-box":!0,original:!1,high:!0,full:!1,mode:`contain`,onRealTime:I,onImgLoad:L},null,8,[`img`,`output-size`,`output-type`,`auto-crop-width`,`auto-crop-height`,`fixed`,`fixed-number`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,b,[(0,n.createVNode)(e.t,{name:`mdi:image-plus-outline`,style:{"font-size":`48px`,opacity:`0.3`}}),a[1]||=(0,n.createElementVNode)(`span`,null,`请选择图片`,-1)]))],4),l.showPreview&&d.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,x,[(0,n.createVNode)(_,{"preview-data":h.value,circular:l.circular},null,8,[`preview-data`,`circular`])])):(0,n.createCommentVNode)(`v-if`,!0)])])]),_:1},8,[`show`,`title`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,S,[(0,n.createElementVNode)(`div`,C,[l.showToolbar?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0,"current-ratio":f.value,"ratio-presets":P,onRatio:z,onRotate:R,onFlipX:(0,n.unref)(F).flipX,onFlipY:(0,n.unref)(F).flipY,onZoom:(0,n.unref)(F).zoom,onReset:B},null,8,[`current-ratio`,`onFlipX`,`onFlipY`,`onZoom`])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`div`,w,[(0,n.createElementVNode)(`div`,{class:`c-image-cropper__canvas`,style:(0,n.normalizeStyle)({height:k.value})},[d.value?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(i.VueCropper),{key:0,ref_key:`inlineCropperRef`,ref:g,img:d.value,"output-size":l.outputQuality,"output-type":A.value,"can-scale":!1,"auto-crop":!0,"auto-crop-width":N.value.width,"auto-crop-height":N.value.height,fixed:j.value,"fixed-number":M.value,"center-box":!0,info:!0,"info-true":!0,"can-move":!0,"can-move-box":!0,original:!1,high:!0,full:!1,mode:`contain`,onRealTime:I,onImgLoad:L},null,8,[`img`,`output-size`,`output-type`,`auto-crop-width`,`auto-crop-height`,`fixed`,`fixed-number`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,T,[(0,n.createVNode)(e.t,{name:`mdi:image-plus-outline`,style:{"font-size":`48px`,opacity:`0.3`}}),a[4]||=(0,n.createElementVNode)(`span`,null,`请选择图片`,-1)]))],4),l.showPreview&&d.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,E,[(0,n.createVNode)(_,{"preview-data":h.value,circular:l.circular},null,8,[`preview-data`,`circular`])])):(0,n.createCommentVNode)(`v-if`,!0)])])]))}});var O=t.t(D,[[`__scopeId`,`data-v-296916a4`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return O}});
|
package/dist/C_ImageCropper2.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{NButton as n,NButtonGroup as r,NDivider as i,NModal as a,NSpace as o,NTooltip as s}from"naive-ui";import{Fragment as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createTextVNode as m,createVNode as h,defineComponent as g,normalizeClass as _,normalizeStyle as v,onBeforeUnmount as y,onMounted as b,openBlock as x,ref as S,renderList as C,toDisplayString as w,unref as T,watch as E,withCtx as D}from"vue";import{VueCropper as O}from"vue-cropper";function k(e={}){let t=S(null);function n(){t.value?.rotateLeft()}function r(){t.value?.rotateRight()}function i(e){let t=Math.round(e/90),i=t>0?r:n;for(let e=0;e<Math.abs(t);e++)i()}function a(e){t.value?.changeScale(e>0?1:-1)}function o(){let e=t.value?.$refs?.img;if(!e)return;let n=e.style.transform||``;n.includes(`scaleX(-1)`)?e.style.transform=n.replace(`scaleX(-1)`,`scaleX(1)`):e.style.transform=n.replace(/scaleX\([^)]*\)/,``)+` scaleX(-1)`}function s(){let e=t.value?.$refs?.img;if(!e)return;let n=e.style.transform||``;n.includes(`scaleY(-1)`)?e.style.transform=n.replace(`scaleY(-1)`,`scaleY(1)`):e.style.transform=n.replace(/scaleY\([^)]*\)/,``)+` scaleY(-1)`}function c(){t.value?.refresh()}function l(t,n){let r=t,i=n,a=e.maxWidth?.value??0,o=e.maxHeight?.value??0;if(a>0&&r>a){let e=a/r;r=a,i=Math.round(i*e)}if(o>0&&i>o){let e=o/i;i=o,r=Math.round(r*e)}return{width:r,height:i}}function u(){return new Promise((n,r)=>{let i=t.value;if(!i)return r(Error(`Cropper not initialized`));let a=e.format?.value??`png`,o=e.quality?.value??.92,s=a===`jpeg`?`image/jpeg`:a===`webp`?`image/webp`:`image/png`;i.getCropData(e=>{i.getCropBlob(t=>{let i=new Image;i.onload=()=>{let{width:r,height:c}=l(i.width,i.height);if(r!==i.width||c!==i.height){let e=document.createElement(`canvas`);e.width=r,e.height=c,e.getContext(`2d`).drawImage(i,0,0,r,c);let t=e.toDataURL(s,o);e.toBlob(e=>{n({base64:t,blob:e,width:r,height:c,format:a})},s,a===`png`?void 0:o)}else n({base64:e,blob:t,width:i.width,height:i.height,format:a})},i.onerror=()=>r(Error(`Failed to load crop result`)),i.src=e})})})}return{cropperRef:t,rotate:i,rotateLeft:n,rotateRight:r,zoom:a,flipX:o,flipY:s,reset:c,getCropResult:u}}const A={class:`cropper-toolbar`};var j=t(g({__name:`CropperToolbar`,props:{currentRatio:{},ratioPresets:{}},emits:[`ratio`,`rotate`,`flipX`,`flipY`,`zoom`,`reset`],setup(t){return(t,a)=>(x(),f(`div`,A,[h(T(r),{size:`small`},{default:D(()=>[(x(!0),f(c,null,C(t.ratioPresets,e=>(x(),u(T(n),{key:e.value,type:t.currentRatio===e.value?`primary`:`default`,onClick:n=>t.$emit(`ratio`,e.value)},{default:D(()=>[m(w(e.label),1)]),_:2},1032,[`type`,`onClick`]))),128))]),_:1}),h(T(i),{vertical:``}),h(T(s),null,{trigger:D(()=>[h(T(n),{size:`small`,quaternary:``,onClick:a[0]||=e=>t.$emit(`rotate`,-90)},{icon:D(()=>[h(e,{name:`mdi:rotate-left`})]),_:1})]),default:D(()=>[a[7]||=m(` 逆时针旋转 90° `,-1)]),_:1,__:[7]}),h(T(s),null,{trigger:D(()=>[h(T(n),{size:`small`,quaternary:``,onClick:a[1]||=e=>t.$emit(`rotate`,90)},{icon:D(()=>[h(e,{name:`mdi:rotate-right`})]),_:1})]),default:D(()=>[a[8]||=m(` 顺时针旋转 90° `,-1)]),_:1,__:[8]}),h(T(i),{vertical:``}),h(T(s),null,{trigger:D(()=>[h(T(n),{size:`small`,quaternary:``,onClick:a[2]||=e=>t.$emit(`flipX`)},{icon:D(()=>[h(e,{name:`mdi:flip-horizontal`})]),_:1})]),default:D(()=>[a[9]||=m(` 水平翻转 `,-1)]),_:1,__:[9]}),h(T(s),null,{trigger:D(()=>[h(T(n),{size:`small`,quaternary:``,onClick:a[3]||=e=>t.$emit(`flipY`)},{icon:D(()=>[h(e,{name:`mdi:flip-vertical`})]),_:1})]),default:D(()=>[a[10]||=m(` 垂直翻转 `,-1)]),_:1,__:[10]}),h(T(i),{vertical:``}),h(T(s),null,{trigger:D(()=>[h(T(n),{size:`small`,quaternary:``,onClick:a[4]||=e=>t.$emit(`zoom`,.1)},{icon:D(()=>[h(e,{name:`mdi:magnify-plus-outline`})]),_:1})]),default:D(()=>[a[11]||=m(` 放大 `,-1)]),_:1,__:[11]}),h(T(s),null,{trigger:D(()=>[h(T(n),{size:`small`,quaternary:``,onClick:a[5]||=e=>t.$emit(`zoom`,-.1)},{icon:D(()=>[h(e,{name:`mdi:magnify-minus-outline`})]),_:1})]),default:D(()=>[a[12]||=m(` 缩小 `,-1)]),_:1,__:[12]}),h(T(i),{vertical:``}),h(T(s),null,{trigger:D(()=>[h(T(n),{size:`small`,quaternary:``,onClick:a[6]||=e=>t.$emit(`reset`)},{icon:D(()=>[h(e,{name:`mdi:refresh`})]),_:1})]),default:D(()=>[a[13]||=m(` 重置 `,-1)]),_:1,__:[13]})]))}}),[[`__scopeId`,`data-v-499ffd01`]]);const M={class:`cropper-preview`},N={class:`preview-label`},P=[`src`],F={key:1,class:`preview-empty`},I={class:`preview-thumbs`},L=[`src`],R={class:`preview-thumb__label`};var z=t(g({__name:`CropperPreview`,props:{previewData:{},circular:{type:Boolean}},setup(t){let n=t,r=S(null),i=S(200),a=[{label:`80px`,size:80},{label:`48px`,size:48},{label:`32px`,size:32}],o=l(()=>{let e=n.previewData;return e&&e.url&&e.w>0&&e.h>0}),s=l(()=>{if(!o.value)return{};let{w:e}=n.previewData;return{zoom:i.value/e,overflow:`hidden`}});function u(e){if(!o.value)return{};let{w:t}=n.previewData;return{zoom:e/t,overflow:`hidden`}}let m=null;return b(()=>{r.value&&(i.value=r.value.clientWidth,m=new ResizeObserver(e=>{requestAnimationFrame(()=>{for(let t of e)i.value=t.contentRect.width})}),m.observe(r.value))}),y(()=>{m?.disconnect()}),(t,n)=>(x(),f(`div`,M,[p(`div`,N,[h(e,{name:`mdi:eye-outline`}),n[0]||=p(`span`,null,`裁剪预览`,-1)]),p(`div`,{ref_key:`mainBoxRef`,ref:r,class:_([`preview-main`,{"preview-main--circular":t.circular}])},[o.value?(x(),f(`div`,{key:0,class:`preview-main__viewport`,style:v(s.value)},[p(`div`,{style:v(t.previewData.div)},[p(`img`,{src:t.previewData.url,style:v(t.previewData.img),alt:`preview`},null,12,P)],4)],4)):(x(),f(`div`,F,[h(e,{name:`mdi:image-outline`,style:{"font-size":`32px`,opacity:`0.2`}})]))],2),p(`div`,I,[(x(),f(c,null,C(a,e=>p(`div`,{key:e.label,class:`preview-thumb`},[p(`div`,{class:_([`preview-thumb__box`,{"preview-thumb__box--circular":t.circular}]),style:v({width:`${e.size}px`,height:`${e.size}px`})},[o.value?(x(),f(`div`,{key:0,class:`preview-thumb__viewport`,style:v(u(e.size))},[p(`div`,{style:v(t.previewData.div)},[p(`img`,{src:t.previewData.url,style:v(t.previewData.img),alt:`thumb`},null,12,L)],4)],4)):d(`v-if`,!0)],6),p(`span`,R,w(e.label),1)])),64))])]))}}),[[`__scopeId`,`data-v-cefefdc0`]]);const B={class:`c-image-cropper__body`},V={class:`c-image-cropper__workspace`},H={key:1,class:`c-image-cropper__placeholder`},U={key:0,class:`c-image-cropper__preview-panel`},W={key:1,class:`c-image-cropper`},G={class:`c-image-cropper__body`},K={class:`c-image-cropper__workspace`},q={key:1,class:`c-image-cropper__placeholder`},ee={key:0,class:`c-image-cropper__preview-panel`};var J=t(g({name:`C_ImageCropper`,__name:`index`,props:{src:{default:``},aspectRatio:{default:0},outputFormat:{default:`png`},outputQuality:{default:.92},maxOutputWidth:{default:0},maxOutputHeight:{default:0},showPreview:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!0},circular:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},height:{default:`400px`},modal:{type:Boolean,default:!1},modalTitle:{default:`图片裁剪`}},emits:[`crop`,`ready`,`error`,`confirm`,`cancel`],setup(t,{expose:r,emit:i}){let s=t,c=i,g=S(s.src),_=S(s.aspectRatio),y=S(!1),b=S(!1),C=S(null),w=S(null),A=S(null),M=l(()=>s.modal?A.value:w.value),N=l(()=>typeof s.height==`number`?`${s.height}px`:s.height),P=l(()=>({png:`png`,jpeg:`jpeg`,webp:`webp`})[s.outputFormat]||`png`),F=l(()=>_.value>0),I=l(()=>_.value<=0||_.value===1?[1,1]:Math.abs(_.value-16/9)<.01?[16,9]:Math.abs(_.value-4/3)<.01?[4,3]:Math.abs(_.value-3/2)<.01?[3,2]:[Math.round(_.value*100),100]),L=l(()=>({width:300,height:_.value>0?300/_.value:200})),R=[{label:`自由`,value:0},{label:`1:1`,value:1},{label:`16:9`,value:16/9},{label:`4:3`,value:4/3},{label:`3:2`,value:3/2}],J=k({format:l(()=>s.outputFormat),quality:l(()=>s.outputQuality),maxWidth:l(()=>s.maxOutputWidth),maxHeight:l(()=>s.maxOutputHeight)});E(M,e=>{J.cropperRef.value=e});function Y(e){C.value=e}function X(e){e===`success`&&c(`ready`)}function Z(e){J.rotate(e)}function Q(e){_.value=e}function $(){J.reset()}async function te(){b.value=!0;try{let e=await J.getCropResult();c(`confirm`,e),c(`crop`,e),y.value=!1}finally{b.value=!1}}function ne(){y.value=!1,c(`cancel`)}function re(e){let t=new FileReader;t.onload=e=>{g.value=e.target?.result},t.readAsDataURL(e)}return E(()=>s.src,e=>{g.value=e}),E(()=>s.aspectRatio,e=>{_.value=e}),r({getCropResult:J.getCropResult,rotate:J.rotate,zoom:J.zoom,flipX:J.flipX,flipY:J.flipY,reset:J.reset,setAspectRatio:e=>{_.value=e},loadFile:re,open:e=>{e&&(g.value=e),y.value=!0},close:()=>{y.value=!1}}),(t,r)=>s.modal?(x(),u(T(a),{key:0,show:y.value,"onUpdate:show":r[0]||=e=>y.value=e,preset:`card`,title:s.modalTitle||`图片裁剪`,style:{width:`860px`},"mask-closable":!1,closable:!0},{footer:D(()=>[h(T(o),{justify:`end`},{default:D(()=>[h(T(n),{onClick:ne},{default:D(()=>r[2]||=[m(`取消`,-1)]),_:1,__:[2]}),h(T(n),{type:`primary`,loading:b.value,onClick:te},{default:D(()=>r[3]||=[m(`确认裁剪`,-1)]),_:1,__:[3]},8,[`loading`])]),_:1})]),default:D(()=>[p(`div`,B,[s.showToolbar?(x(),u(j,{key:0,"current-ratio":_.value,"ratio-presets":R,onRatio:Q,onRotate:Z,onFlipX:T(J).flipX,onFlipY:T(J).flipY,onZoom:T(J).zoom,onReset:$},null,8,[`current-ratio`,`onFlipX`,`onFlipY`,`onZoom`])):d(`v-if`,!0),p(`div`,V,[p(`div`,{class:`c-image-cropper__canvas`,style:v({height:N.value})},[g.value?(x(),u(T(O),{key:0,ref_key:`modalCropperRef`,ref:A,img:g.value,"output-size":s.outputQuality,"output-type":P.value,"can-scale":!1,"auto-crop":!0,"auto-crop-width":L.value.width,"auto-crop-height":L.value.height,fixed:F.value,"fixed-number":I.value,"center-box":!0,info:!0,"info-true":!0,"can-move":!0,"can-move-box":!0,original:!1,high:!0,full:!1,mode:`contain`,onRealTime:Y,onImgLoad:X},null,8,[`img`,`output-size`,`output-type`,`auto-crop-width`,`auto-crop-height`,`fixed`,`fixed-number`])):(x(),f(`div`,H,[h(e,{name:`mdi:image-plus-outline`,style:{"font-size":`48px`,opacity:`0.3`}}),r[1]||=p(`span`,null,`请选择图片`,-1)]))],4),s.showPreview&&g.value?(x(),f(`div`,U,[h(z,{"preview-data":C.value,circular:s.circular},null,8,[`preview-data`,`circular`])])):d(`v-if`,!0)])])]),_:1},8,[`show`,`title`])):(x(),f(`div`,W,[p(`div`,G,[s.showToolbar?(x(),u(j,{key:0,"current-ratio":_.value,"ratio-presets":R,onRatio:Q,onRotate:Z,onFlipX:T(J).flipX,onFlipY:T(J).flipY,onZoom:T(J).zoom,onReset:$},null,8,[`current-ratio`,`onFlipX`,`onFlipY`,`onZoom`])):d(`v-if`,!0),p(`div`,K,[p(`div`,{class:`c-image-cropper__canvas`,style:v({height:N.value})},[g.value?(x(),u(T(O),{key:0,ref_key:`inlineCropperRef`,ref:w,img:g.value,"output-size":s.outputQuality,"output-type":P.value,"can-scale":!1,"auto-crop":!0,"auto-crop-width":L.value.width,"auto-crop-height":L.value.height,fixed:F.value,"fixed-number":I.value,"center-box":!0,info:!0,"info-true":!0,"can-move":!0,"can-move-box":!0,original:!1,high:!0,full:!1,mode:`contain`,onRealTime:Y,onImgLoad:X},null,8,[`img`,`output-size`,`output-type`,`auto-crop-width`,`auto-crop-height`,`fixed`,`fixed-number`])):(x(),f(`div`,q,[h(e,{name:`mdi:image-plus-outline`,style:{"font-size":`48px`,opacity:`0.3`}}),r[4]||=p(`span`,null,`请选择图片`,-1)]))],4),s.showPreview&&g.value?(x(),f(`div`,ee,[h(z,{"preview-data":C.value,circular:s.circular},null,8,[`preview-data`,`circular`])])):d(`v-if`,!0)])])]))}}),[[`__scopeId`,`data-v-296916a4`]]);export{k as n,J as t};
|
|
2
|
-
//# sourceMappingURL=C_ImageCropper2.js.map
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,createVNode as l,defineComponent as u,normalizeClass as d,normalizeStyle as f,onBeforeUnmount as p,onMounted 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,NButtonGroup as C,NDivider as w,NModal as T,NSpace as E,NTooltip as D}from"naive-ui";import{VueCropper as O}from"vue-cropper";function k(e={}){let t=g(null);function n(){t.value?.rotateLeft()}function r(){t.value?.rotateRight()}function i(e){let t=Math.round(e/90),i=t>0?r:n;for(let e=0;e<Math.abs(t);e++)i()}function a(e){t.value?.changeScale(e>0?1:-1)}function o(){let e=t.value?.$refs?.img;if(!e)return;let n=e.style.transform||``;n.includes(`scaleX(-1)`)?e.style.transform=n.replace(`scaleX(-1)`,`scaleX(1)`):e.style.transform=n.replace(/scaleX\([^)]*\)/,``)+` scaleX(-1)`}function s(){let e=t.value?.$refs?.img;if(!e)return;let n=e.style.transform||``;n.includes(`scaleY(-1)`)?e.style.transform=n.replace(`scaleY(-1)`,`scaleY(1)`):e.style.transform=n.replace(/scaleY\([^)]*\)/,``)+` scaleY(-1)`}function c(){t.value?.refresh()}function l(t,n){let r=t,i=n,a=e.maxWidth?.value??0,o=e.maxHeight?.value??0;if(a>0&&r>a){let e=a/r;r=a,i=Math.round(i*e)}if(o>0&&i>o){let e=o/i;i=o,r=Math.round(r*e)}return{width:r,height:i}}function u(){return new Promise((n,r)=>{let i=t.value;if(!i)return r(Error(`Cropper not initialized`));let a=e.format?.value??`png`,o=e.quality?.value??.92,s=a===`jpeg`?`image/jpeg`:a===`webp`?`image/webp`:`image/png`;i.getCropData(e=>{i.getCropBlob(t=>{let i=new Image;i.onload=()=>{let{width:r,height:c}=l(i.width,i.height);if(r!==i.width||c!==i.height){let e=document.createElement(`canvas`);e.width=r,e.height=c,e.getContext(`2d`).drawImage(i,0,0,r,c);let t=e.toDataURL(s,o);e.toBlob(e=>{n({base64:t,blob:e,width:r,height:c,format:a})},s,a===`png`?void 0:o)}else n({base64:e,blob:t,width:i.width,height:i.height,format:a})},i.onerror=()=>r(Error(`Failed to load crop result`)),i.src=e})})})}return{cropperRef:t,rotate:i,rotateLeft:n,rotateRight:r,zoom:a,flipX:o,flipY:s,reset:c,getCropResult:u}}const A={class:`cropper-toolbar`};var j=t(u({__name:`CropperToolbar`,props:{currentRatio:{},ratioPresets:{}},emits:[`ratio`,`rotate`,`flipX`,`flipY`,`zoom`,`reset`],setup(t){return(r,a)=>(h(),o(`div`,A,[l(y(C),{size:`small`},{default:x(()=>[(h(!0),o(n,null,_(t.ratioPresets,e=>(h(),i(y(S),{key:e.value,type:t.currentRatio===e.value?`primary`:`default`,onClick:t=>r.$emit(`ratio`,e.value)},{default:x(()=>[c(v(e.label),1)]),_:2},1032,[`type`,`onClick`]))),128))]),_:1}),l(y(w),{vertical:``}),l(y(D),null,{trigger:x(()=>[l(y(S),{size:`small`,quaternary:``,onClick:a[0]||=e=>r.$emit(`rotate`,-90)},{icon:x(()=>[l(e,{name:`mdi:rotate-left`})]),_:1})]),default:x(()=>[a[7]||=c(` 逆时针旋转 90° `,-1)]),_:1}),l(y(D),null,{trigger:x(()=>[l(y(S),{size:`small`,quaternary:``,onClick:a[1]||=e=>r.$emit(`rotate`,90)},{icon:x(()=>[l(e,{name:`mdi:rotate-right`})]),_:1})]),default:x(()=>[a[8]||=c(` 顺时针旋转 90° `,-1)]),_:1}),l(y(w),{vertical:``}),l(y(D),null,{trigger:x(()=>[l(y(S),{size:`small`,quaternary:``,onClick:a[2]||=e=>r.$emit(`flipX`)},{icon:x(()=>[l(e,{name:`mdi:flip-horizontal`})]),_:1})]),default:x(()=>[a[9]||=c(` 水平翻转 `,-1)]),_:1}),l(y(D),null,{trigger:x(()=>[l(y(S),{size:`small`,quaternary:``,onClick:a[3]||=e=>r.$emit(`flipY`)},{icon:x(()=>[l(e,{name:`mdi:flip-vertical`})]),_:1})]),default:x(()=>[a[10]||=c(` 垂直翻转 `,-1)]),_:1}),l(y(w),{vertical:``}),l(y(D),null,{trigger:x(()=>[l(y(S),{size:`small`,quaternary:``,onClick:a[4]||=e=>r.$emit(`zoom`,.1)},{icon:x(()=>[l(e,{name:`mdi:magnify-plus-outline`})]),_:1})]),default:x(()=>[a[11]||=c(` 放大 `,-1)]),_:1}),l(y(D),null,{trigger:x(()=>[l(y(S),{size:`small`,quaternary:``,onClick:a[5]||=e=>r.$emit(`zoom`,-.1)},{icon:x(()=>[l(e,{name:`mdi:magnify-minus-outline`})]),_:1})]),default:x(()=>[a[12]||=c(` 缩小 `,-1)]),_:1}),l(y(w),{vertical:``}),l(y(D),null,{trigger:x(()=>[l(y(S),{size:`small`,quaternary:``,onClick:a[6]||=e=>r.$emit(`reset`)},{icon:x(()=>[l(e,{name:`mdi:refresh`})]),_:1})]),default:x(()=>[a[13]||=c(` 重置 `,-1)]),_:1})]))}}),[[`__scopeId`,`data-v-499ffd01`]]);const M={class:`cropper-preview`},N={class:`preview-label`},P=[`src`],F={key:1,class:`preview-empty`},I={class:`preview-thumbs`},L=[`src`],R={class:`preview-thumb__label`};var z=t(u({__name:`CropperPreview`,props:{previewData:{},circular:{type:Boolean}},setup(t){let i=t,c=g(null),u=g(200),y=[{label:`80px`,size:80},{label:`48px`,size:48},{label:`32px`,size:32}],b=r(()=>{let e=i.previewData;return e&&e.url&&e.w>0&&e.h>0}),x=r(()=>{if(!b.value)return{};let{w:e}=i.previewData;return{zoom:u.value/e,overflow:`hidden`}});function S(e){if(!b.value)return{};let{w:t}=i.previewData;return{zoom:e/t,overflow:`hidden`}}let C=null;return m(()=>{c.value&&(u.value=c.value.clientWidth,C=new ResizeObserver(e=>{requestAnimationFrame(()=>{for(let t of e)u.value=t.contentRect.width})}),C.observe(c.value))}),p(()=>{C?.disconnect()}),(r,i)=>(h(),o(`div`,M,[s(`div`,N,[l(e,{name:`mdi:eye-outline`}),i[0]||=s(`span`,null,`裁剪预览`,-1)]),s(`div`,{ref_key:`mainBoxRef`,ref:c,class:d([`preview-main`,{"preview-main--circular":t.circular}])},[b.value?(h(),o(`div`,{key:0,class:`preview-main__viewport`,style:f(x.value)},[s(`div`,{style:f(t.previewData.div)},[s(`img`,{src:t.previewData.url,style:f(t.previewData.img),alt:`preview`},null,12,P)],4)],4)):(h(),o(`div`,F,[l(e,{name:`mdi:image-outline`,style:{"font-size":`32px`,opacity:`0.2`}})]))],2),s(`div`,I,[(h(),o(n,null,_(y,e=>s(`div`,{key:e.label,class:`preview-thumb`},[s(`div`,{class:d([`preview-thumb__box`,{"preview-thumb__box--circular":t.circular}]),style:f({width:`${e.size}px`,height:`${e.size}px`})},[b.value?(h(),o(`div`,{key:0,class:`preview-thumb__viewport`,style:f(S(e.size))},[s(`div`,{style:f(t.previewData.div)},[s(`img`,{src:t.previewData.url,style:f(t.previewData.img),alt:`thumb`},null,12,L)],4)],4)):a(`v-if`,!0)],6),s(`span`,R,v(e.label),1)])),64))])]))}}),[[`__scopeId`,`data-v-cefefdc0`]]);const B={class:`c-image-cropper__body`},V={class:`c-image-cropper__workspace`},H={key:1,class:`c-image-cropper__placeholder`},U={key:0,class:`c-image-cropper__preview-panel`},W={key:1,class:`c-image-cropper`},G={class:`c-image-cropper__body`},K={class:`c-image-cropper__workspace`},q={key:1,class:`c-image-cropper__placeholder`},ee={key:0,class:`c-image-cropper__preview-panel`};var J=t(u({name:`C_ImageCropper`,__name:`index`,props:{src:{default:``},aspectRatio:{default:0},outputFormat:{default:`png`},outputQuality:{default:.92},maxOutputWidth:{default:0},maxOutputHeight:{default:0},showPreview:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!0},circular:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},height:{default:`400px`},modal:{type:Boolean,default:!1},modalTitle:{default:`图片裁剪`}},emits:[`crop`,`ready`,`error`,`confirm`,`cancel`],setup(t,{expose:n,emit:u}){let d=t,p=u,m=g(d.src),_=g(d.aspectRatio),v=g(!1),C=g(!1),w=g(null),D=g(null),A=g(null),M=r(()=>d.modal?A.value:D.value),N=r(()=>typeof d.height==`number`?`${d.height}px`:d.height),P=r(()=>({png:`png`,jpeg:`jpeg`,webp:`webp`})[d.outputFormat]||`png`),F=r(()=>_.value>0),I=r(()=>_.value<=0||_.value===1?[1,1]:Math.abs(_.value-16/9)<.01?[16,9]:Math.abs(_.value-4/3)<.01?[4,3]:Math.abs(_.value-3/2)<.01?[3,2]:[Math.round(_.value*100),100]),L=r(()=>({width:300,height:_.value>0?300/_.value:200})),R=[{label:`自由`,value:0},{label:`1:1`,value:1},{label:`16:9`,value:16/9},{label:`4:3`,value:4/3},{label:`3:2`,value:3/2}],J=k({format:r(()=>d.outputFormat),quality:r(()=>d.outputQuality),maxWidth:r(()=>d.maxOutputWidth),maxHeight:r(()=>d.maxOutputHeight)});b(M,e=>{J.cropperRef.value=e});function Y(e){w.value=e}function X(e){e===`success`&&p(`ready`)}function Z(e){J.rotate(e)}function Q(e){_.value=e}function $(){J.reset()}async function te(){C.value=!0;try{let e=await J.getCropResult();p(`confirm`,e),p(`crop`,e),v.value=!1}finally{C.value=!1}}function ne(){v.value=!1,p(`cancel`)}function re(e){let t=new FileReader;t.onload=e=>{m.value=e.target?.result},t.readAsDataURL(e)}return b(()=>d.src,e=>{m.value=e}),b(()=>d.aspectRatio,e=>{_.value=e}),n({getCropResult:J.getCropResult,rotate:J.rotate,zoom:J.zoom,flipX:J.flipX,flipY:J.flipY,reset:J.reset,setAspectRatio:e=>{_.value=e},loadFile:re,open:e=>{e&&(m.value=e),v.value=!0},close:()=>{v.value=!1}}),(t,n)=>d.modal?(h(),i(y(T),{key:0,show:v.value,"onUpdate:show":n[0]||=e=>v.value=e,preset:`card`,title:d.modalTitle||`图片裁剪`,style:{width:`860px`},"mask-closable":!1,closable:!0},{footer:x(()=>[l(y(E),{justify:`end`},{default:x(()=>[l(y(S),{onClick:ne},{default:x(()=>[...n[2]||=[c(`取消`,-1)]]),_:1}),l(y(S),{type:`primary`,loading:C.value,onClick:te},{default:x(()=>[...n[3]||=[c(`确认裁剪`,-1)]]),_:1},8,[`loading`])]),_:1})]),default:x(()=>[s(`div`,B,[d.showToolbar?(h(),i(j,{key:0,"current-ratio":_.value,"ratio-presets":R,onRatio:Q,onRotate:Z,onFlipX:y(J).flipX,onFlipY:y(J).flipY,onZoom:y(J).zoom,onReset:$},null,8,[`current-ratio`,`onFlipX`,`onFlipY`,`onZoom`])):a(`v-if`,!0),s(`div`,V,[s(`div`,{class:`c-image-cropper__canvas`,style:f({height:N.value})},[m.value?(h(),i(y(O),{key:0,ref_key:`modalCropperRef`,ref:A,img:m.value,"output-size":d.outputQuality,"output-type":P.value,"can-scale":!1,"auto-crop":!0,"auto-crop-width":L.value.width,"auto-crop-height":L.value.height,fixed:F.value,"fixed-number":I.value,"center-box":!0,info:!0,"info-true":!0,"can-move":!0,"can-move-box":!0,original:!1,high:!0,full:!1,mode:`contain`,onRealTime:Y,onImgLoad:X},null,8,[`img`,`output-size`,`output-type`,`auto-crop-width`,`auto-crop-height`,`fixed`,`fixed-number`])):(h(),o(`div`,H,[l(e,{name:`mdi:image-plus-outline`,style:{"font-size":`48px`,opacity:`0.3`}}),n[1]||=s(`span`,null,`请选择图片`,-1)]))],4),d.showPreview&&m.value?(h(),o(`div`,U,[l(z,{"preview-data":w.value,circular:d.circular},null,8,[`preview-data`,`circular`])])):a(`v-if`,!0)])])]),_:1},8,[`show`,`title`])):(h(),o(`div`,W,[s(`div`,G,[d.showToolbar?(h(),i(j,{key:0,"current-ratio":_.value,"ratio-presets":R,onRatio:Q,onRotate:Z,onFlipX:y(J).flipX,onFlipY:y(J).flipY,onZoom:y(J).zoom,onReset:$},null,8,[`current-ratio`,`onFlipX`,`onFlipY`,`onZoom`])):a(`v-if`,!0),s(`div`,K,[s(`div`,{class:`c-image-cropper__canvas`,style:f({height:N.value})},[m.value?(h(),i(y(O),{key:0,ref_key:`inlineCropperRef`,ref:D,img:m.value,"output-size":d.outputQuality,"output-type":P.value,"can-scale":!1,"auto-crop":!0,"auto-crop-width":L.value.width,"auto-crop-height":L.value.height,fixed:F.value,"fixed-number":I.value,"center-box":!0,info:!0,"info-true":!0,"can-move":!0,"can-move-box":!0,original:!1,high:!0,full:!1,mode:`contain`,onRealTime:Y,onImgLoad:X},null,8,[`img`,`output-size`,`output-type`,`auto-crop-width`,`auto-crop-height`,`fixed`,`fixed-number`])):(h(),o(`div`,q,[l(e,{name:`mdi:image-plus-outline`,style:{"font-size":`48px`,opacity:`0.3`}}),n[4]||=s(`span`,null,`请选择图片`,-1)]))],4),d.showPreview&&m.value?(h(),o(`div`,ee,[l(z,{"preview-data":w.value,circular:d.circular},null,8,[`preview-data`,`circular`])])):a(`v-if`,!0)])])]))}}),[[`__scopeId`,`data-v-296916a4`]]);export{k as n,J as t};
|
package/dist/C_Language.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./C_Icon2.cjs`);const e=require(`./C_Language2.cjs`);exports.C_Language=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* C_Language has no component-specific styles. */
|
package/dist/C_Language.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as LanguageOption, t as _default } from "./index16.vue.
|
|
1
|
+
import { n as LanguageOption, t as _default } from "./index16.vue.cjs";
|
|
2
2
|
export { _default as C_Language, type LanguageOption };
|
package/dist/C_Language.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as LanguageOption, t as _default } from "./
|
|
1
|
+
import { n as LanguageOption, t as _default } from "./index15.vue.js";
|
|
2
2
|
export { _default as C_Language, type LanguageOption };
|
package/dist/C_Language.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Language2.js";export{e as C_Language};
|
|
1
|
+
import"./C_Icon2.js";import{t as e}from"./C_Language2.js";export{e as C_Language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`);let t=require(`vue`),n=require(`naive-ui`);const r={class:`flex items-center`},i=(0,t.defineComponent)({name:`C_Language`,__name:`index`,props:{modelValue:{default:`zh-cn`},options:{default:()=>[{key:`zh-cn`,label:`简体中文`,iconClass:`mdi:alpha-c`},{key:`en`,label:`English`,iconClass:`mdi:alpha-u`},{key:`ja`,label:`日本語`,iconClass:`mdi:alpha-j`},{key:`ko`,label:`한국어`,iconClass:`mdi:alpha-k`}]},tooltip:{default:`语言切换`}},emits:[`update:modelValue`,`change`],setup(i,{emit:a}){let o=i,s=a,c=(0,t.computed)(()=>o.options.find(e=>e.key===o.modelValue)?.label??o.modelValue),l=(0,t.computed)(()=>`${o.tooltip} (${c.value})`),u=(0,t.computed)(()=>o.options.map(n=>({key:n.key,label:n.label,icon:n.iconClass?()=>(0,t.h)(e.t,{name:n.iconClass,size:16}):void 0}))),d=e=>{e!==o.modelValue&&(s(`update:modelValue`,e),s(`change`,e))};return(a,o)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.NDropdown),{size:`small`,trigger:`hover`,options:u.value,value:i.modelValue,onSelect:d},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.NButton),{text:``},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,r,[(0,t.createVNode)(e.t,{name:`mdi:language`,size:18,title:l.value},null,8,[`title`])])]),_:1})]),_:1},8,[`options`,`value`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
package/dist/C_Language2.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{
|
|
2
|
-
//# sourceMappingURL=C_Language2.js.map
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{computed as t,createBlock as n,createElementVNode as r,createVNode as i,defineComponent as a,h as o,openBlock as s,unref as c,withCtx as l}from"vue";import{NButton as u,NDropdown as d}from"naive-ui";const f={class:`flex items-center`},p=a({name:`C_Language`,__name:`index`,props:{modelValue:{default:`zh-cn`},options:{default:()=>[{key:`zh-cn`,label:`简体中文`,iconClass:`mdi:alpha-c`},{key:`en`,label:`English`,iconClass:`mdi:alpha-u`},{key:`ja`,label:`日本語`,iconClass:`mdi:alpha-j`},{key:`ko`,label:`한국어`,iconClass:`mdi:alpha-k`}]},tooltip:{default:`语言切换`}},emits:[`update:modelValue`,`change`],setup(a,{emit:p}){let m=a,h=p,g=t(()=>m.options.find(e=>e.key===m.modelValue)?.label??m.modelValue),_=t(()=>`${m.tooltip} (${g.value})`),v=t(()=>m.options.map(t=>({key:t.key,label:t.label,icon:t.iconClass?()=>o(e,{name:t.iconClass,size:16}):void 0}))),y=e=>{e!==m.modelValue&&(h(`update:modelValue`,e),h(`change`,e))};return(t,o)=>(s(),n(c(d),{size:`small`,trigger:`hover`,options:v.value,value:a.modelValue,onSelect:y},{default:l(()=>[i(c(u),{text:``},{default:l(()=>[r(`div`,f,[i(e,{name:`mdi:language`,size:18,title:_.value},null,8,[`title`])])]),_:1})]),_:1},8,[`options`,`value`]))}});export{p as t};
|
package/dist/C_Login.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./C_Icon2.cjs`),require(`./C_Captcha2.cjs`),require(`./C_QRCode2.cjs`);const e=require(`./C_Login2.cjs`);exports.C_Login=e.t,exports.DEFAULT_FEATURES=e.n,exports.DEFAULT_SOCIAL_PROVIDERS=e.r;
|