@robot-admin/naive-ui-components 0.31.5 → 0.33.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 +18 -0
- package/README.md +11 -5
- package/README_EN.md +11 -5
- package/dist/C_AutoComplete.cjs +1 -0
- package/dist/C_AutoComplete.css +36 -0
- package/dist/C_AutoComplete.d.cts +4 -0
- package/dist/C_AutoComplete.d.ts +4 -0
- package/dist/C_AutoComplete.js +1 -0
- package/dist/C_AutoComplete2.cjs +1 -0
- package/dist/C_AutoComplete2.js +1 -0
- package/dist/C_AvatarGroup.d.cts +1 -1
- package/dist/C_AvatarGroup.d.ts +1 -1
- package/dist/C_Barcode.d.cts +1 -1
- package/dist/C_Barcode.d.ts +1 -1
- package/dist/C_BatchResult.d.cts +1 -1
- package/dist/C_BatchResult.d.ts +1 -1
- package/dist/C_Breadcrumb.d.cts +2 -2
- package/dist/C_Breadcrumb.d.ts +1 -1
- package/dist/C_Cascade.d.cts +1 -1
- package/dist/C_Cascade.d.ts +1 -1
- package/dist/C_Chat.d.cts +1 -1
- package/dist/C_Chat.d.ts +1 -1
- package/dist/C_City.d.cts +1 -1
- package/dist/C_City.d.ts +1 -1
- package/dist/C_Code.d.cts +1 -1
- package/dist/C_Code.d.ts +1 -1
- package/dist/C_ContextMenu.d.cts +1 -1
- package/dist/C_ContextMenu.d.ts +1 -1
- package/dist/C_DataPicker.css +235 -31
- package/dist/C_DataPicker.d.cts +2 -2
- package/dist/C_DataPicker.d.ts +2 -2
- package/dist/C_Date.d.cts +1 -1
- package/dist/C_Date.d.ts +1 -1
- package/dist/C_Density.d.cts +1 -1
- package/dist/C_Density.d.ts +1 -1
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_ErrorSummary.d.cts +1 -1
- package/dist/C_ErrorSummary.d.ts +1 -1
- package/dist/C_Form.base.css +68 -1
- package/dist/C_Form.cjs +1 -1
- package/dist/C_Form.css +68 -1
- package/dist/C_Form.d.cts +3 -3
- package/dist/C_Form.d.ts +5 -3
- package/dist/C_Form.js +1 -1
- package/dist/C_FormModal.cjs +1 -1
- package/dist/C_FormModal.d.cts +1 -1
- package/dist/C_FormModal.d.ts +3 -1
- package/dist/C_FormModal.js +1 -1
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +160 -72
- package/dist/C_FormSearch.d.cts +3 -3
- package/dist/C_FormSearch.d.ts +3 -3
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Guide.d.cts +1 -1
- package/dist/C_Guide.d.ts +1 -1
- package/dist/C_Icon.d.cts +1 -1
- package/dist/C_Icon.d.ts +1 -1
- package/dist/C_Language.d.cts +1 -1
- package/dist/C_Language.d.ts +1 -1
- package/dist/C_Loading.d.cts +1 -1
- package/dist/C_Loading.d.ts +1 -1
- package/dist/C_Login.d.cts +1 -1
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Markdown.d.cts +1 -1
- package/dist/C_Markdown.d.ts +1 -1
- package/dist/C_Menu.d.cts +2 -2
- package/dist/C_Menu.d.ts +1 -1
- package/dist/C_OrgChart.d.cts +1 -1
- package/dist/C_OrgChart.d.ts +1 -1
- package/dist/C_Progress.d.cts +1 -1
- package/dist/C_Progress.d.ts +1 -1
- package/dist/C_SectionNav.d.cts +1 -1
- package/dist/C_SectionNav.d.ts +1 -1
- package/dist/C_Select.css +32 -1
- package/dist/C_Select.d.cts +4 -2
- package/dist/C_Select.d.ts +4 -2
- package/dist/C_Select2.cjs +1 -1
- package/dist/C_Select2.js +1 -1
- package/dist/C_Skeleton.d.cts +1 -1
- package/dist/C_Skeleton.d.ts +1 -1
- package/dist/C_Steps.d.cts +1 -1
- package/dist/C_Steps.d.ts +1 -1
- package/dist/C_Table.base.css +214 -147
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +146 -146
- package/dist/C_Table.d.cts +3 -3
- package/dist/C_Table.d.ts +13 -10
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +4 -3
- package/dist/C_Table2.js +4 -3
- package/dist/C_TagsView.css +51 -51
- package/dist/C_TagsView.d.cts +2 -2
- package/dist/C_TagsView.d.ts +1 -1
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Theme.d.cts +1 -1
- package/dist/C_Theme.d.ts +1 -1
- package/dist/C_Timeline.d.cts +1 -1
- package/dist/C_Timeline.d.ts +1 -1
- package/dist/C_Transfer.d.cts +1 -1
- package/dist/C_Transfer.d.ts +1 -1
- package/dist/C_Tree.cjs +1 -1
- package/dist/C_Tree.css +60 -23
- package/dist/C_Tree.d.cts +2 -2
- package/dist/C_Tree.d.ts +12 -9
- package/dist/C_Tree.js +1 -1
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/OptionStatus.cjs +1 -0
- package/dist/OptionStatus.js +1 -0
- package/dist/SearchFieldSettings.cjs +1 -0
- package/dist/SearchFieldSettings.js +1 -0
- package/dist/constants4.d.cts +9 -9
- package/dist/constants4.d.ts +9 -9
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/data.d.cts +2 -1
- package/dist/data.d.ts +2 -1
- package/dist/data2.d.cts +7 -7
- package/dist/data2.d.ts +7 -7
- package/dist/dateRange.d.cts +52 -7
- package/dist/dateRange.d.ts +52 -7
- package/dist/editors.cjs +1 -0
- package/dist/{useTableQuery.d.cts → editors.d.cts} +120 -13
- package/dist/{useTableQuery.d.ts → editors.d.ts} +120 -13
- package/dist/editors.js +1 -0
- package/dist/fieldRenderers.cjs +1 -0
- package/dist/fieldRenderers.js +1 -0
- package/dist/formField.cjs +1 -1
- package/dist/formField.d.cts +79 -29
- package/dist/formField.d.ts +79 -29
- package/dist/formField.js +1 -1
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +63 -59
- package/dist/index.d.ts +63 -58
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +5 -5
- package/dist/index.vue.d.ts +5 -5
- package/dist/index10.vue.d.cts +27 -35
- package/dist/index10.vue.d.ts +37 -80
- package/dist/index11.vue.d.cts +37 -80
- package/dist/index11.vue.d.ts +83 -16
- package/dist/index12.vue.d.cts +83 -16
- package/dist/index12.vue.d.ts +16 -59
- package/dist/index13.vue.d.cts +16 -59
- package/dist/index13.vue.d.ts +57 -17
- package/dist/index14.vue.d.cts +57 -17
- package/dist/index14.vue.d.ts +18 -55
- package/dist/index15.vue.d.cts +18 -55
- package/dist/index15.vue.d.ts +53 -124
- package/dist/index16.vue.d.cts +53 -124
- package/dist/index16.vue.d.ts +123 -51
- package/dist/index17.vue.d.cts +123 -51
- package/dist/index17.vue.d.ts +52 -25
- package/dist/index18.vue.d.cts +52 -25
- package/dist/index18.vue.d.ts +25 -12
- package/dist/index19.vue.d.cts +25 -12
- package/dist/index19.vue.d.ts +13 -129
- package/dist/index2.vue.d.cts +26 -82
- package/dist/index2.vue.d.ts +26 -82
- package/dist/index20.vue.d.cts +13 -129
- package/dist/index20.vue.d.ts +129 -76
- package/dist/index21.vue.d.cts +129 -76
- package/dist/index21.vue.d.ts +78 -72
- package/dist/index22.vue.d.cts +75 -97
- package/dist/index22.vue.d.ts +68 -96
- package/dist/index23.vue.d.cts +91 -40
- package/dist/index23.vue.d.ts +91 -40
- package/dist/index24.vue.d.cts +49 -23
- package/dist/index24.vue.d.ts +49 -23
- package/dist/index25.vue.d.cts +19 -46
- package/dist/index25.vue.d.ts +19 -46
- package/dist/index26.vue.d.cts +25 -98
- package/dist/index26.vue.d.ts +25 -98
- package/dist/index27.vue.d.cts +95 -37
- package/dist/index27.vue.d.ts +95 -37
- package/dist/index28.vue.d.cts +34 -8
- package/dist/index28.vue.d.ts +34 -8
- package/dist/index29.vue.d.cts +9 -86
- package/dist/index29.vue.d.ts +9 -86
- package/dist/index3.vue.d.cts +80 -30
- package/dist/index3.vue.d.ts +80 -30
- package/dist/index30.vue.d.cts +85 -99
- package/dist/index30.vue.d.ts +85 -99
- package/dist/index31.vue.d.cts +94 -63
- package/dist/index31.vue.d.ts +94 -63
- package/dist/index32.vue.d.cts +79 -0
- package/dist/index32.vue.d.ts +79 -0
- package/dist/index4.vue.d.cts +30 -19
- package/dist/index4.vue.d.ts +30 -19
- package/dist/index5.vue.d.cts +19 -128
- package/dist/index5.vue.d.ts +17 -34
- package/dist/index6.vue.d.cts +127 -35
- package/dist/index6.vue.d.ts +30 -22
- package/dist/index7.vue.d.cts +30 -22
- package/dist/index7.vue.d.ts +25 -118
- package/dist/index8.vue.d.cts +25 -118
- package/dist/index8.vue.d.ts +112 -21
- package/dist/index9.vue.d.cts +112 -21
- package/dist/index9.vue.d.ts +27 -35
- package/dist/mapUtils.d.cts +3 -3
- package/dist/mapUtils.d.ts +3 -3
- package/dist/optionSource.d.cts +30 -0
- package/dist/optionSource.d.ts +30 -0
- package/dist/public.d.ts +2 -0
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.d.cts +1 -1
- package/dist/resolver.d.ts +1 -1
- package/dist/resolver.js +1 -1
- package/dist/selectPresentation.cjs +1 -1
- package/dist/selectPresentation.js +1 -1
- package/dist/serializeSearch.cjs +1 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/sourceControls.cjs +1 -0
- package/dist/sourceControls.js +1 -0
- package/dist/style.css +513 -324
- package/dist/types2.d.cts +29 -103
- package/dist/types2.d.ts +30 -55
- package/dist/types3.d.cts +106 -55
- package/dist/types3.d.ts +60 -0
- package/dist/types4.d.cts +60 -0
- package/dist/types4.d.ts +50 -0
- package/dist/types5.d.cts +50 -0
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +3 -3
- package/dist/useCollapsePanel.d.ts +3 -3
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +9 -9
- package/dist/useCropperCore.d.ts +9 -9
- package/dist/useDataResource.cjs +1 -1
- package/dist/useDataResource.js +1 -1
- package/dist/useDraggableLayout.d.cts +2 -2
- package/dist/useDraggableLayout.d.ts +2 -2
- package/dist/useDynamicFormState.d.cts +17 -3
- package/dist/useDynamicFormState.d.ts +17 -3
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useFormConfig.d.cts +5 -2
- package/dist/useFormConfig.d.ts +5 -2
- package/dist/useFormRenderer.d.cts +1 -1
- package/dist/useFormRenderer.d.ts +1 -1
- package/dist/useFullscreen.d.cts +2 -2
- package/dist/useFullscreen.d.ts +2 -2
- package/dist/useGlobalSearch.d.cts +8 -0
- package/dist/useGlobalSearch.d.ts +8 -0
- package/dist/useInfiniteScroll.d.cts +2 -2
- package/dist/useInfiniteScroll.d.ts +2 -2
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useSplitResize.d.cts +7 -7
- package/dist/useSplitResize.d.ts +7 -7
- package/dist/useWorkflowValidation.d.cts +4 -4
- package/dist/useWorkflowValidation.d.ts +4 -4
- package/dist/verification.d.cts +6 -6
- package/dist/verification.d.ts +6 -6
- package/docs/architecture.md +3 -1
- package/docs/components.en.md +2 -1
- package/docs/components.md +2 -1
- package/docs/engineering.en.md +11 -1
- package/docs/engineering.md +11 -1
- package/docs/guides/component-contracts.md +72 -0
- package/docs/guides/data-picker.md +37 -1
- package/docs/guides/remote-options.md +117 -0
- package/docs/guides/search-workflows.md +162 -2
- package/docs/guides/table-editing.md +79 -0
- package/docs/guides/tree.en.md +41 -0
- package/docs/guides/tree.md +80 -1
- package/docs/search-selection-coverage.md +59 -0
- package/docs/wl-ui-produce-coverage.md +2 -0
- package/package.json +6 -3
- package/dist/helpers2.cjs +0 -1
- package/dist/helpers2.js +0 -1
- package/dist/temporalField.cjs +0 -1
- package/dist/temporalField.js +0 -1
- package/dist/useTableQuery.cjs +0 -1
- package/dist/useTableQuery.js +0 -1
package/dist/C_FormModal2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./observer.cjs`),n=require(`./data2.cjs`),r=require(`./feedback.cjs`),i=require(`./export-helper.cjs`),a=require(`./useActionTask.cjs`),o=require(`./C_ActionBar2.cjs`),s=require(`./useFormConfig.cjs`),c=require(`./
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./observer.cjs`),n=require(`./data2.cjs`),r=require(`./feedback.cjs`),i=require(`./export-helper.cjs`),a=require(`./useActionTask.cjs`),o=require(`./C_ActionBar2.cjs`),s=require(`./useFormConfig.cjs`),c=require(`./fieldRenderers.cjs`),l=require(`./formModal.cjs`);let u=require(`vue`),d=require(`naive-ui`);const f={key:0,role:`status`,style:{margin:`0 0 8px`}},p=(0,u.defineComponent)({name:`C_FormModal`,__name:`index`,props:{editor:{},options:{},config:{default:()=>({})},renderers:{},width:{default:`min(620px, calc(100vw - 24px))`},createText:{default:`创建`},saveText:{default:`保存`},cancelText:{default:`取消`},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0}},emits:[`submit`,`close`],setup(i,{emit:p}){let m=i,h=p,g=(0,u.ref)(null),_=s.o(),v=(0,u.computed)(()=>s.r(m.config,_)),y=r.t(()=>v.value.feedback),b=(0,u.computed)(()=>m.config?.density??_.density??`compact`),x=(0,u.computed)({get:()=>m.editor.visible.value,set:e=>{e||M()}}),S=(0,u.computed)(()=>m.editor.title.value),C=(0,u.ref)(0),w=(0,u.ref)(!1),T=a.t(),E=(0,u.computed)(()=>T.isRunning(C.value)),D=(0,u.computed)(()=>E.value||m.editor.loading.value||!!g.value?.isSubmitting);(0,u.watch)([()=>m.editor,()=>m.editor.visible.value],([e,t],[n])=>{(t||e!==n)&&(C.value++,w.value=!1)},{flush:`sync`}),(0,u.onScopeDispose)(()=>{C.value++});let O=(0,u.computed)(()=>l.t(m.width,b.value)),k=(0,u.computed)({get:()=>m.editor.model.value??{},set:e=>{E.value||m.editor.setModel(e)}}),A=e=>e===void 0||n.a(e,g.value?.getModel())?!0:(w.value=!0,!1),j=(0,u.computed)(()=>({...m.config,...E.value?{disabled:!0}:{},density:b.value,mode:m.editor.mode.value,showActions:!1,submitSuccessText:``,onSubmit:async(e,r)=>{let{editor:i,config:a}=m,o=C.value;w.value=!1;let s=()=>o===C.value&&!r?.signal.aborted&&i.visible.value,c;a?.onSubmit&&(c=n.t(e.model),await a.onSubmit(e,r));let l=await T.run(o,()=>i.submit(e.model),()=>s()&&A(c));if(!l.executed)return;let u=l.value;if(o!==C.value||!u&&!s())return;h(`submit`,e,u);let d=v.value.submitSuccessText;u&&d&&t.t(()=>y.success(d))}})),M=()=>{D.value||!x.value||(m.editor.close(),h(`close`))},N=(0,u.computed)(()=>{let t=e.t(b.value);return{align:`right`,size:v.value.size??(b.value===`compact`?`tiny`:t.size),gap:t.gap,compact:b.value===`compact`}}),P=(0,u.computed)(()=>o.a([{key:`cancel`,label:m.cancelText,disabled:D,onClick:M},{key:m.editor.mode.value===`create`?`create`:`save`,label:m.editor.mode.value===`create`?m.createText:m.saveText,loading:D,onClick:async()=>{await g.value?.submit()}}]));return(e,t)=>((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(d.NModal),{show:x.value,"onUpdate:show":t[1]||=e=>x.value=e,preset:`card`,title:S.value,"aria-label":S.value,style:(0,u.normalizeStyle)(O.value.shell),"header-style":O.value.header,"content-style":O.value.content,"footer-style":O.value.footer,"footer-class":`c-form-modal__footer`,"mask-closable":i.maskClosable&&!D.value,"close-on-esc":i.closeOnEsc&&!D.value,closable:i.closable&&!D.value,class:(0,u.normalizeClass)([`c-form-modal`,`c-form-modal--${b.value}`])},{footer:(0,u.withCtx)(()=>[w.value?((0,u.openBlock)(),(0,u.createElementBlock)(`p`,f,` 表单已修改,请重新保存。 `)):(0,u.createCommentVNode)(`v-if`,!0),((0,u.openBlock)(),(0,u.createBlock)(o.t,{key:C.value,actions:P.value,config:N.value},null,8,[`actions`,`config`]))]),default:(0,u.withCtx)(()=>[x.value&&i.editor.model.value?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(c.o),{key:C.value,ref_key:`formRef`,ref:g,modelValue:k.value,"onUpdate:modelValue":t[0]||=e=>k.value=e,options:i.options,config:j.value,renderers:i.renderers,inert:E.value},(0,u.createSlots)({_:2},[(0,u.renderList)(e.$slots,(t,n)=>({name:n,fn:(0,u.withCtx)(t=>[(0,u.renderSlot)(e.$slots,n,(0,u.normalizeProps)((0,u.guardReactiveProps)(t)),void 0,!0)])}))]),1032,[`modelValue`,`options`,`config`,`renderers`,`inert`])):(0,u.createCommentVNode)(`v-if`,!0)]),_:3},8,[`show`,`title`,`aria-label`,`style`,`header-style`,`content-style`,`footer-style`,`mask-closable`,`close-on-esc`,`closable`,`class`]))}});var m=i.t(p,[[`__scopeId`,`data-v-ac918c0a`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|
package/dist/C_FormModal2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./density.js";import{t}from"./observer.js";import{a as n,t as r}from"./data2.js";import{t as i}from"./feedback.js";import{t as a}from"./export-helper.js";import{t as o}from"./useActionTask.js";import{a as s,t as c}from"./C_ActionBar2.js";import{o as l,r as u}from"./useFormConfig.js";import{
|
|
1
|
+
import{t as e}from"./density.js";import{t}from"./observer.js";import{a as n,t as r}from"./data2.js";import{t as i}from"./feedback.js";import{t as a}from"./export-helper.js";import{t as o}from"./useActionTask.js";import{a as s,t as c}from"./C_ActionBar2.js";import{o as l,r as u}from"./useFormConfig.js";import{o as d}from"./fieldRenderers.js";import{t as f}from"./formModal.js";import{computed as p,createBlock as m,createCommentVNode as h,createElementBlock as g,createSlots as _,defineComponent as v,guardReactiveProps as y,normalizeClass as b,normalizeProps as x,normalizeStyle as S,onScopeDispose as C,openBlock as w,ref as T,renderList as E,renderSlot as D,unref as O,watch as k,withCtx as A}from"vue";import{NModal as j}from"naive-ui";const M={key:0,role:`status`,style:{margin:`0 0 8px`}};var N=a(v({name:`C_FormModal`,__name:`index`,props:{editor:{},options:{},config:{default:()=>({})},renderers:{},width:{default:`min(620px, calc(100vw - 24px))`},createText:{default:`创建`},saveText:{default:`保存`},cancelText:{default:`取消`},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0}},emits:[`submit`,`close`],setup(a,{emit:v}){let N=a,P=v,F=T(null),I=l(),L=p(()=>u(N.config,I)),R=i(()=>L.value.feedback),z=p(()=>N.config?.density??I.density??`compact`),B=p({get:()=>N.editor.visible.value,set:e=>{e||Z()}}),V=p(()=>N.editor.title.value),H=T(0),U=T(!1),W=o(),G=p(()=>W.isRunning(H.value)),K=p(()=>G.value||N.editor.loading.value||!!F.value?.isSubmitting);k([()=>N.editor,()=>N.editor.visible.value],([e,t],[n])=>{(t||e!==n)&&(H.value++,U.value=!1)},{flush:`sync`}),C(()=>{H.value++});let q=p(()=>f(N.width,z.value)),J=p({get:()=>N.editor.model.value??{},set:e=>{G.value||N.editor.setModel(e)}}),Y=e=>e===void 0||n(e,F.value?.getModel())?!0:(U.value=!0,!1),X=p(()=>({...N.config,...G.value?{disabled:!0}:{},density:z.value,mode:N.editor.mode.value,showActions:!1,submitSuccessText:``,onSubmit:async(e,n)=>{let{editor:i,config:a}=N,o=H.value;U.value=!1;let s=()=>o===H.value&&!n?.signal.aborted&&i.visible.value,c;a?.onSubmit&&(c=r(e.model),await a.onSubmit(e,n));let l=await W.run(o,()=>i.submit(e.model),()=>s()&&Y(c));if(!l.executed)return;let u=l.value;if(o!==H.value||!u&&!s())return;P(`submit`,e,u);let d=L.value.submitSuccessText;u&&d&&t(()=>R.success(d))}})),Z=()=>{K.value||!B.value||(N.editor.close(),P(`close`))},Q=p(()=>{let t=e(z.value);return{align:`right`,size:L.value.size??(z.value===`compact`?`tiny`:t.size),gap:t.gap,compact:z.value===`compact`}}),$=p(()=>s([{key:`cancel`,label:N.cancelText,disabled:K,onClick:Z},{key:N.editor.mode.value===`create`?`create`:`save`,label:N.editor.mode.value===`create`?N.createText:N.saveText,loading:K,onClick:async()=>{await F.value?.submit()}}]));return(e,t)=>(w(),m(O(j),{show:B.value,"onUpdate:show":t[1]||=e=>B.value=e,preset:`card`,title:V.value,"aria-label":V.value,style:S(q.value.shell),"header-style":q.value.header,"content-style":q.value.content,"footer-style":q.value.footer,"footer-class":`c-form-modal__footer`,"mask-closable":a.maskClosable&&!K.value,"close-on-esc":a.closeOnEsc&&!K.value,closable:a.closable&&!K.value,class:b([`c-form-modal`,`c-form-modal--${z.value}`])},{footer:A(()=>[U.value?(w(),g(`p`,M,` 表单已修改,请重新保存。 `)):h(`v-if`,!0),(w(),m(c,{key:H.value,actions:$.value,config:Q.value},null,8,[`actions`,`config`]))]),default:A(()=>[B.value&&a.editor.model.value?(w(),m(O(d),{key:H.value,ref_key:`formRef`,ref:F,modelValue:J.value,"onUpdate:modelValue":t[0]||=e=>J.value=e,options:a.options,config:X.value,renderers:a.renderers,inert:G.value},_({_:2},[E(e.$slots,(t,n)=>({name:n,fn:A(t=>[D(e.$slots,n,x(y(t)),void 0,!0)])}))]),1032,[`modelValue`,`options`,`config`,`renderers`,`inert`])):h(`v-if`,!0)]),_:3},8,[`show`,`title`,`aria-label`,`style`,`header-style`,`content-style`,`footer-style`,`mask-closable`,`close-on-esc`,`closable`,`class`]))}}),[[`__scopeId`,`data-v-ac918c0a`]]);export{N as t};
|
package/dist/C_FormSearch.css
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
@import "./shared-tokens.css";
|
|
2
|
+
.c-option-status {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
padding: 6px 2px;
|
|
8
|
+
color: inherit;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
line-height: 1.5;
|
|
11
|
+
}
|
|
12
|
+
.c-option-status--compact {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
padding: 0;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
.c-option-status button {
|
|
18
|
+
border: 0;
|
|
19
|
+
padding: 0 2px;
|
|
20
|
+
background: transparent;
|
|
21
|
+
color: var(--n-loading-color, var(--n-caret-color, var(--c-primary, #18a058)));
|
|
22
|
+
font: inherit;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
.c-option-status button:focus-visible {
|
|
26
|
+
outline: 2px solid currentColor;
|
|
27
|
+
outline-offset: 2px;
|
|
28
|
+
}
|
|
29
|
+
.c-select-field {
|
|
30
|
+
min-width: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
2
33
|
.c-select {
|
|
3
34
|
min-width: 0;
|
|
4
35
|
max-width: 100%;
|
|
@@ -27,15 +58,51 @@
|
|
|
27
58
|
}
|
|
28
59
|
|
|
29
60
|
/* layer: default */
|
|
30
|
-
.blur[data-v-
|
|
61
|
+
.blur[data-v-50c4de6d]{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
|
62
|
+
|
|
63
|
+
.c-option-status {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 8px;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
padding: 6px 2px;
|
|
69
|
+
color: inherit;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
line-height: 1.5;
|
|
72
|
+
}
|
|
73
|
+
.c-option-status--compact {
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
padding: 0;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
78
|
+
.c-option-status button {
|
|
79
|
+
border: 0;
|
|
80
|
+
padding: 0 2px;
|
|
81
|
+
background: transparent;
|
|
82
|
+
color: var(--n-loading-color, var(--n-caret-color, var(--c-primary, #18a058)));
|
|
83
|
+
font: inherit;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
86
|
+
.c-option-status button:focus-visible {
|
|
87
|
+
outline: 2px solid currentColor;
|
|
88
|
+
outline-offset: 2px;
|
|
89
|
+
}
|
|
90
|
+
.c-auto-complete {
|
|
91
|
+
min-width: 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* layer: default */
|
|
96
|
+
.fixed[data-v-52f22b9b]{position:fixed;}
|
|
97
|
+
.blur[data-v-52f22b9b]{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
|
31
98
|
|
|
32
|
-
.form-search-card[data-v-
|
|
99
|
+
.form-search-card[data-v-edc120a0] {
|
|
33
100
|
min-width: 0;
|
|
34
101
|
}
|
|
35
|
-
.form-search-card[data-v-
|
|
102
|
+
.form-search-card[data-v-edc120a0] :is(.n-card-content, .n-card__content) {
|
|
36
103
|
padding: var(--c-search-padding, 20px);
|
|
37
104
|
}
|
|
38
|
-
.form-search-layout[data-v-
|
|
105
|
+
.form-search-layout[data-v-edc120a0] {
|
|
39
106
|
display: flex;
|
|
40
107
|
flex: 1 1 var(--c-search-layout-min-width, var(--c-search-control-width));
|
|
41
108
|
flex-wrap: wrap;
|
|
@@ -43,28 +110,28 @@
|
|
|
43
110
|
gap: var(--c-search-layout-gap);
|
|
44
111
|
min-width: 0;
|
|
45
112
|
}
|
|
46
|
-
.form-search-input-control[data-v-
|
|
113
|
+
.form-search-input-control[data-v-edc120a0] {
|
|
47
114
|
position: relative;
|
|
48
115
|
min-width: 0;
|
|
49
116
|
max-width: 100%;
|
|
50
117
|
}
|
|
51
|
-
.form-search .form-search-number-range[data-v-
|
|
118
|
+
.form-search .form-search-number-range[data-v-edc120a0] {
|
|
52
119
|
display: flex;
|
|
53
120
|
gap: 8px;
|
|
54
121
|
width: var(--c-search-control-width);
|
|
55
122
|
max-width: 100%;
|
|
56
123
|
min-width: 0;
|
|
57
124
|
}
|
|
58
|
-
.form-search .form-search-number-range[data-v-
|
|
125
|
+
.form-search .form-search-number-range[data-v-edc120a0] .n-input-number {
|
|
59
126
|
flex: 1;
|
|
60
127
|
min-width: 0;
|
|
61
128
|
width: 0;
|
|
62
129
|
}
|
|
63
|
-
.form-search .form-search-number-range[data-v-
|
|
130
|
+
.form-search .form-search-number-range[data-v-edc120a0] .n-input {
|
|
64
131
|
width: 100%;
|
|
65
132
|
min-width: 0;
|
|
66
133
|
}
|
|
67
|
-
.form-search .form-search-hidden-count[data-v-
|
|
134
|
+
.form-search .form-search-hidden-count[data-v-edc120a0] {
|
|
68
135
|
position: absolute;
|
|
69
136
|
inline-size: 1px;
|
|
70
137
|
block-size: 1px;
|
|
@@ -72,45 +139,45 @@
|
|
|
72
139
|
clip-path: inset(50%);
|
|
73
140
|
white-space: nowrap;
|
|
74
141
|
}
|
|
75
|
-
.form-search-actions[data-v-
|
|
142
|
+
.form-search-actions[data-v-edc120a0] {
|
|
76
143
|
flex: 0 0 auto;
|
|
77
144
|
width: max-content;
|
|
78
145
|
max-width: 100%;
|
|
79
146
|
margin-inline-start: auto;
|
|
80
147
|
}
|
|
81
|
-
.form-search-action-buttons[data-v-
|
|
148
|
+
.form-search-action-buttons[data-v-edc120a0] {
|
|
82
149
|
max-width: 100%;
|
|
83
150
|
}
|
|
84
|
-
.form-search-action-buttons .form-search-icon-button[data-v-
|
|
151
|
+
.form-search-action-buttons .form-search-icon-button[data-v-edc120a0] {
|
|
85
152
|
flex: none;
|
|
86
153
|
width: var(--n-height);
|
|
87
154
|
padding: 0;
|
|
88
155
|
}
|
|
89
|
-
.form-search-action-buttons .form-search-icon-button[data-v-
|
|
156
|
+
.form-search-action-buttons .form-search-icon-button[data-v-edc120a0] .n-button__icon {
|
|
90
157
|
margin: 0;
|
|
91
158
|
}
|
|
92
|
-
.form-search-action-buttons .form-search-hidden-trigger[data-v-
|
|
159
|
+
.form-search-action-buttons .form-search-hidden-trigger[data-v-edc120a0] {
|
|
93
160
|
padding-inline: 8px;
|
|
94
161
|
font-size: 12px;
|
|
95
162
|
white-space: nowrap;
|
|
96
163
|
}
|
|
97
|
-
.form-search-hidden-panel[data-v-
|
|
164
|
+
.form-search-hidden-panel[data-v-edc120a0] {
|
|
98
165
|
min-inline-size: min(10rem, 100vw - 2rem);
|
|
99
166
|
max-inline-size: min(16rem, 100vw - 2rem);
|
|
100
167
|
font-size: 13px;
|
|
101
168
|
}
|
|
102
|
-
.form-search-hidden-panel p[data-v-
|
|
169
|
+
.form-search-hidden-panel p[data-v-edc120a0] {
|
|
103
170
|
margin-block: 4px 8px;
|
|
104
171
|
font-size: 12px;
|
|
105
172
|
}
|
|
106
|
-
.form-search-hidden-panel ul[data-v-
|
|
173
|
+
.form-search-hidden-panel ul[data-v-edc120a0] {
|
|
107
174
|
max-block-size: min(16rem, 55vh);
|
|
108
175
|
margin: 0;
|
|
109
176
|
padding: 0;
|
|
110
177
|
overflow: auto;
|
|
111
178
|
list-style: none;
|
|
112
179
|
}
|
|
113
|
-
.form-search-hidden-panel li[data-v-
|
|
180
|
+
.form-search-hidden-panel li[data-v-edc120a0] {
|
|
114
181
|
display: flex;
|
|
115
182
|
justify-content: space-between;
|
|
116
183
|
align-items: baseline;
|
|
@@ -118,12 +185,12 @@
|
|
|
118
185
|
padding-block: 4px;
|
|
119
186
|
overflow-wrap: anywhere;
|
|
120
187
|
}
|
|
121
|
-
.form-search-hidden-panel small[data-v-
|
|
188
|
+
.form-search-hidden-panel small[data-v-edc120a0] {
|
|
122
189
|
flex: none;
|
|
123
190
|
font-size: 11px;
|
|
124
191
|
opacity: 0.75;
|
|
125
192
|
}
|
|
126
|
-
.form-search[data-v-
|
|
193
|
+
.form-search[data-v-edc120a0] {
|
|
127
194
|
--c-search-control-width: var(--c-search-field-width, 260px);
|
|
128
195
|
--c-search-layout-gap: var(--c-search-row-gap, 20px) var(--c-search-gap, 32px);
|
|
129
196
|
display: flex;
|
|
@@ -131,24 +198,24 @@
|
|
|
131
198
|
align-items: start;
|
|
132
199
|
gap: var(--c-search-layout-gap);
|
|
133
200
|
}
|
|
134
|
-
.form-search .form-search-item-box[data-v-
|
|
201
|
+
.form-search .form-search-item-box[data-v-edc120a0] {
|
|
135
202
|
min-width: 0;
|
|
136
203
|
max-width: 100%;
|
|
137
204
|
}
|
|
138
|
-
.form-search .form-search-item-box .form-item-input[data-v-
|
|
205
|
+
.form-search .form-search-item-box .form-item-input[data-v-edc120a0] {
|
|
139
206
|
position: relative;
|
|
140
207
|
}
|
|
141
|
-
.form-search .form-search-item-box .form-item-input[data-v-
|
|
142
|
-
.form-search .form-search-item-box .form-item-input[data-v-
|
|
143
|
-
.form-search .form-search-item-box .form-item-input[data-v-
|
|
144
|
-
.form-search .form-search-item-box .form-item-input[data-v-
|
|
208
|
+
.form-search .form-search-item-box .form-item-input[data-v-edc120a0] .n-input,
|
|
209
|
+
.form-search .form-search-item-box .form-item-input[data-v-edc120a0] .n-select,
|
|
210
|
+
.form-search .form-search-item-box .form-item-input[data-v-edc120a0] .n-input-number,
|
|
211
|
+
.form-search .form-search-item-box .form-item-input[data-v-edc120a0] .n-date-picker {
|
|
145
212
|
width: var(--c-search-control-width);
|
|
146
213
|
max-width: 100%;
|
|
147
214
|
}
|
|
148
|
-
.form-search .form-search-item-box .form-item-input[data-v-
|
|
215
|
+
.form-search .form-search-item-box .form-item-input[data-v-edc120a0] .n-form-item-blank {
|
|
149
216
|
min-width: 0;
|
|
150
217
|
}
|
|
151
|
-
.form-search .form-search-item-box .form-item-input .input-history[data-v-
|
|
218
|
+
.form-search .form-search-item-box .form-item-input .input-history[data-v-edc120a0] {
|
|
152
219
|
width: 100%;
|
|
153
220
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
154
221
|
border: 1px solid var(--n-border-color);
|
|
@@ -164,7 +231,7 @@
|
|
|
164
231
|
max-height: 240px;
|
|
165
232
|
overflow-y: auto;
|
|
166
233
|
}
|
|
167
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-item[data-v-
|
|
234
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-item[data-v-edc120a0] {
|
|
168
235
|
padding: 10px 12px;
|
|
169
236
|
display: flex;
|
|
170
237
|
align-items: center;
|
|
@@ -175,24 +242,24 @@
|
|
|
175
242
|
transition: all 0.2s ease;
|
|
176
243
|
position: relative;
|
|
177
244
|
}
|
|
178
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-item[data-v-
|
|
245
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-item[data-v-edc120a0]:hover {
|
|
179
246
|
background: var(--n-option-color-hover);
|
|
180
247
|
}
|
|
181
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-item:hover .delete-icon[data-v-
|
|
248
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-item:hover .delete-icon[data-v-edc120a0] {
|
|
182
249
|
opacity: 1;
|
|
183
250
|
transform: scale(1);
|
|
184
251
|
}
|
|
185
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-item[data-v-
|
|
252
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-item[data-v-edc120a0]:not(:last-of-type) {
|
|
186
253
|
border-bottom: 1px solid var(--n-divider-color);
|
|
187
254
|
}
|
|
188
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-item .history-text[data-v-
|
|
255
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-item .history-text[data-v-edc120a0] {
|
|
189
256
|
flex: 1;
|
|
190
257
|
overflow: hidden;
|
|
191
258
|
text-overflow: ellipsis;
|
|
192
259
|
white-space: nowrap;
|
|
193
260
|
margin-right: 8px;
|
|
194
261
|
}
|
|
195
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-item .delete-icon[data-v-
|
|
262
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-item .delete-icon[data-v-edc120a0] {
|
|
196
263
|
opacity: 0;
|
|
197
264
|
transform: scale(0.8);
|
|
198
265
|
transition: all 0.2s ease;
|
|
@@ -204,114 +271,135 @@
|
|
|
204
271
|
align-items: center;
|
|
205
272
|
justify-content: center;
|
|
206
273
|
}
|
|
207
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-item .delete-icon[data-v-
|
|
274
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-item .delete-icon[data-v-edc120a0]:hover {
|
|
208
275
|
background: var(--n-close-color-hover);
|
|
209
276
|
color: var(--n-close-color-pressed);
|
|
210
277
|
transform: scale(1.1);
|
|
211
278
|
}
|
|
212
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-footer[data-v-
|
|
279
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-footer[data-v-edc120a0] {
|
|
213
280
|
padding: 8px 12px;
|
|
214
281
|
border-top: 1px solid var(--n-divider-color);
|
|
215
282
|
background: var(--n-modal-color);
|
|
216
283
|
}
|
|
217
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-footer .clear-all[data-v-
|
|
284
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-footer .clear-all[data-v-edc120a0] {
|
|
218
285
|
color: var(--n-text-color-disabled);
|
|
219
286
|
font-size: 12px;
|
|
220
287
|
cursor: pointer;
|
|
221
288
|
transition: all 0.2s ease;
|
|
222
289
|
}
|
|
223
|
-
.form-search .form-search-item-box .form-item-input .input-history .history-footer .clear-all[data-v-
|
|
290
|
+
.form-search .form-search-item-box .form-item-input .input-history .history-footer .clear-all[data-v-edc120a0]:hover {
|
|
224
291
|
color: var(--n-error-color);
|
|
225
292
|
}
|
|
226
|
-
.form-search .form-search-item-box .form-item-input .input-history[data-v-
|
|
293
|
+
.form-search .form-search-item-box .form-item-input .input-history[data-v-edc120a0] {
|
|
227
294
|
/* custom scrollbar */
|
|
228
295
|
}
|
|
229
|
-
.form-search .form-search-item-box .form-item-input .input-history[data-v-
|
|
296
|
+
.form-search .form-search-item-box .form-item-input .input-history[data-v-edc120a0]::-webkit-scrollbar {
|
|
230
297
|
width: 6px;
|
|
231
298
|
}
|
|
232
|
-
.form-search .form-search-item-box .form-item-input .input-history[data-v-
|
|
299
|
+
.form-search .form-search-item-box .form-item-input .input-history[data-v-edc120a0]::-webkit-scrollbar-track {
|
|
233
300
|
background: transparent;
|
|
234
301
|
}
|
|
235
|
-
.form-search .form-search-item-box .form-item-input .input-history[data-v-
|
|
302
|
+
.form-search .form-search-item-box .form-item-input .input-history[data-v-edc120a0]::-webkit-scrollbar-thumb {
|
|
236
303
|
background: var(--n-scrollbar-color);
|
|
237
304
|
border-radius: 3px;
|
|
238
305
|
}
|
|
239
|
-
.form-search .form-search-item-box .form-item-input .input-history[data-v-
|
|
306
|
+
.form-search .form-search-item-box .form-item-input .input-history[data-v-edc120a0]::-webkit-scrollbar-thumb:hover {
|
|
240
307
|
background: var(--n-scrollbar-color-hover);
|
|
241
308
|
}
|
|
242
309
|
|
|
243
310
|
/* responsive */
|
|
244
311
|
@media (max-width: 1400px) {
|
|
245
|
-
.form-search[data-v-
|
|
312
|
+
.form-search[data-v-edc120a0] {
|
|
246
313
|
--c-search-control-width: var(--c-search-field-width, 240px);
|
|
247
314
|
--c-search-layout-gap: var(--c-search-row-gap, 16px)
|
|
248
315
|
var(--c-search-gap, 28px);
|
|
249
316
|
}
|
|
250
317
|
}
|
|
251
318
|
@media (max-width: 1200px) {
|
|
252
|
-
.form-search[data-v-
|
|
319
|
+
.form-search[data-v-edc120a0] {
|
|
253
320
|
--c-search-control-width: var(--c-search-field-width, 220px);
|
|
254
321
|
--c-search-layout-gap: var(--c-search-row-gap, 16px)
|
|
255
322
|
var(--c-search-gap, 24px);
|
|
256
323
|
}
|
|
257
324
|
}
|
|
258
325
|
@media (max-width: 900px) {
|
|
259
|
-
.form-search[data-v-
|
|
326
|
+
.form-search[data-v-edc120a0] {
|
|
260
327
|
--c-search-control-width: var(--c-search-field-width, 200px);
|
|
261
328
|
--c-search-layout-gap: var(--c-search-row-gap, 12px)
|
|
262
329
|
var(--c-search-gap, 20px);
|
|
263
330
|
}
|
|
264
331
|
}
|
|
265
332
|
@media (max-width: 600px) {
|
|
266
|
-
.form-search-card[data-v-
|
|
333
|
+
.form-search-card[data-v-edc120a0] :is(.n-card-content, .n-card__content) {
|
|
267
334
|
padding: var(--c-search-padding, 16px);
|
|
268
335
|
}
|
|
269
|
-
.form-search[data-v-
|
|
336
|
+
.form-search[data-v-edc120a0] {
|
|
270
337
|
--c-search-control-width: 100%;
|
|
271
338
|
--c-search-layout-gap: var(--c-search-row-gap, 12px) 0;
|
|
272
339
|
}
|
|
273
|
-
.form-search .form-search-layout[data-v-
|
|
340
|
+
.form-search .form-search-layout[data-v-edc120a0] {
|
|
274
341
|
flex-basis: 100%;
|
|
275
342
|
}
|
|
276
|
-
.form-search .form-search-layout .form-search-item-box[data-v-
|
|
343
|
+
.form-search .form-search-layout .form-search-item-box[data-v-edc120a0] {
|
|
277
344
|
width: 100%;
|
|
278
345
|
}
|
|
279
|
-
.form-search .form-item-input .input-history .history-item .delete-icon[data-v-
|
|
346
|
+
.form-search .form-item-input .input-history .history-item .delete-icon[data-v-edc120a0] {
|
|
280
347
|
opacity: 1;
|
|
281
348
|
}
|
|
282
349
|
}
|
|
283
350
|
/* grid 由容器宽度决定列数;所有控件占轨道宽度,字段 span 在逻辑层钳制。 */
|
|
284
|
-
.form-search.form-search--grid .form-search-layout[data-v-
|
|
351
|
+
.form-search.form-search--grid .form-search-layout[data-v-edc120a0] {
|
|
285
352
|
display: grid;
|
|
286
353
|
grid-template-columns: minmax(0, 1fr);
|
|
287
354
|
}
|
|
288
|
-
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-
|
|
355
|
+
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-edc120a0] {
|
|
289
356
|
min-width: 0;
|
|
290
357
|
}
|
|
291
|
-
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-
|
|
292
|
-
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-
|
|
293
|
-
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-
|
|
294
|
-
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-
|
|
295
|
-
.form-search.form-search--grid .form-search-layout .form-item-input .form-search-input-control[data-v-
|
|
296
|
-
.form-search.form-search--grid .form-search-layout .form-item-input .form-search-number-range[data-v-
|
|
358
|
+
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-edc120a0] .n-input,
|
|
359
|
+
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-edc120a0] .n-select,
|
|
360
|
+
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-edc120a0] .n-input-number,
|
|
361
|
+
.form-search.form-search--grid .form-search-layout .form-item-input[data-v-edc120a0] .n-date-picker,
|
|
362
|
+
.form-search.form-search--grid .form-search-layout .form-item-input .form-search-input-control[data-v-edc120a0],
|
|
363
|
+
.form-search.form-search--grid .form-search-layout .form-item-input .form-search-number-range[data-v-edc120a0] {
|
|
297
364
|
width: 100%;
|
|
298
365
|
min-width: 0;
|
|
299
366
|
}
|
|
300
|
-
.form-search.form-search--grid .form-search-number-range[data-v-
|
|
367
|
+
.form-search.form-search--grid .form-search-number-range[data-v-edc120a0] .n-input-number {
|
|
301
368
|
width: 0;
|
|
302
369
|
}
|
|
370
|
+
.form-search-hierarchy[data-v-edc120a0] {
|
|
371
|
+
width: var(--c-search-control-width);
|
|
372
|
+
max-width: 100%;
|
|
373
|
+
min-width: 0;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* layer: icons */
|
|
377
|
+
.i-mdi\:chevron-down[data-v-edc120a0]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
378
|
+
.i-mdi\:chevron-up[data-v-edc120a0]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
379
|
+
.i-mdi\:close[data-v-edc120a0]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
380
|
+
.i-mdi\:filter-variant[data-v-edc120a0]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M6 13h12v-2H6M3 6v2h18V6M10 18h4v-2h-4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
381
|
+
.i-mdi\:refresh[data-v-edc120a0]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
382
|
+
.i-mdi\:search[data-v-edc120a0]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
383
|
+
/* layer: default */
|
|
384
|
+
.visible[data-v-edc120a0]{visibility:visible;}
|
|
385
|
+
.grid[data-v-edc120a0]{display:grid;}
|
|
386
|
+
.inline[data-v-edc120a0]{display:inline;}
|
|
387
|
+
.h-4[data-v-edc120a0]{height:1rem;}
|
|
388
|
+
.w-4[data-v-edc120a0]{width:1rem;}
|
|
389
|
+
.px[data-v-edc120a0]{padding-left:1rem;padding-right:1rem;}
|
|
390
|
+
|
|
391
|
+
.search-field-settings[data-v-71cdd87c] {
|
|
392
|
+
max-inline-size: min(20rem, 100vw - 3rem);
|
|
393
|
+
}
|
|
394
|
+
.search-field-settings[data-v-71cdd87c] .n-checkbox-group {
|
|
395
|
+
display: grid;
|
|
396
|
+
gap: 8px;
|
|
397
|
+
max-block-size: min(24rem, 55vh);
|
|
398
|
+
overflow: auto;
|
|
399
|
+
margin-block-end: 12px;
|
|
400
|
+
}
|
|
303
401
|
|
|
304
402
|
/* layer: icons */
|
|
305
|
-
.i-mdi\:
|
|
306
|
-
.i-mdi\:chevron-up[data-v-4e0fef8d]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
307
|
-
.i-mdi\:close[data-v-4e0fef8d]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
308
|
-
.i-mdi\:filter-variant[data-v-4e0fef8d]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M6 13h12v-2H6M3 6v2h18V6M10 18h4v-2h-4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
309
|
-
.i-mdi\:refresh[data-v-4e0fef8d]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
310
|
-
.i-mdi\:search[data-v-4e0fef8d]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
403
|
+
.i-mdi\:tune-variant[data-v-71cdd87c]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8 13c-1.86 0-3.41 1.28-3.86 3H2v2h2.14c.45 1.72 2 3 3.86 3s3.41-1.28 3.86-3H22v-2H11.86c-.45-1.72-2-3-3.86-3m0 6c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2M19.86 6c-.45-1.72-2-3-3.86-3s-3.41 1.28-3.86 3H2v2h10.14c.45 1.72 2 3 3.86 3s3.41-1.28 3.86-3H22V6zM16 9c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
311
404
|
/* layer: default */
|
|
312
|
-
.
|
|
313
|
-
.grid[data-v-4e0fef8d]{display:grid;}
|
|
314
|
-
.inline[data-v-4e0fef8d]{display:inline;}
|
|
315
|
-
.h-4[data-v-4e0fef8d]{height:1rem;}
|
|
316
|
-
.w-4[data-v-4e0fef8d]{width:1rem;}
|
|
317
|
-
.px[data-v-4e0fef8d]{padding-left:1rem;padding-right:1rem;}
|
|
405
|
+
.grid[data-v-71cdd87c]{display:grid;}
|
package/dist/C_FormSearch.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as OptionsState } from "./options.cjs";
|
|
2
1
|
import { t as ComponentDensity } from "./density.cjs";
|
|
3
|
-
import {
|
|
2
|
+
import { t as OptionsState } from "./options.cjs";
|
|
3
|
+
import { _ as SearchOptionItem, a as SerializeSearchOptions, c as FormSearchExpose, d as SearchFieldContext, f as SearchFieldSettings, g as SearchNumberRangeValue, h as SearchFormParams, i as useSearchHistory, l as FormSearchProps, m as SearchFormItem, n as SearchDateRangeValue, o as serializeSearch, p as SearchFieldType, r as useSearchState, s as FormSearchEmits, t as DateRangeInput, u as SearchConfig, v as SearchQueryEncoding } from "./dateRange.cjs";
|
|
4
4
|
import { AllowedComponentProps, ComponentCustomProps, EmitFn, VNode, VNodeProps } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/C_FormSearch/index.d.ts
|
|
@@ -17,4 +17,4 @@ type SearchComponent = <T extends object = SearchFormParams>(props: FormSearchPr
|
|
|
17
17
|
};
|
|
18
18
|
declare const C_FormSearch: SearchComponent;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { C_FormSearch, type ComponentDensity, type DateRangeInput, type FormSearchEmits, type FormSearchExpose, type FormSearchProps, type OptionsState, type SearchConfig, type SearchDateRangeValue, type SearchFieldContext, type SearchFieldType, type SearchFormItem, type SearchFormParams, type SearchNumberRangeValue, type SearchOptionItem, type SearchQueryEncoding, type SerializeSearchOptions, serializeSearch, useSearchHistory, useSearchState };
|
|
20
|
+
export { C_FormSearch, type ComponentDensity, type DateRangeInput, type FormSearchEmits, type FormSearchExpose, type FormSearchProps, type OptionsState, type SearchConfig, type SearchDateRangeValue, type SearchFieldContext, type SearchFieldSettings, type SearchFieldType, type SearchFormItem, type SearchFormParams, type SearchNumberRangeValue, type SearchOptionItem, type SearchQueryEncoding, type SerializeSearchOptions, serializeSearch, useSearchHistory, useSearchState };
|
package/dist/C_FormSearch.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { K as OptionsState } from "./useFormConfig.js";
|
|
2
1
|
import { t as ComponentDensity } from "./density.js";
|
|
2
|
+
import { K as OptionsState } from "./useFormConfig.js";
|
|
3
3
|
import "./config2.js";
|
|
4
|
-
import { _ as
|
|
4
|
+
import { _ as SearchOptionItem, a as SerializeSearchOptions, c as FormSearchExpose, d as SearchFieldContext, f as SearchFieldSettings, g as SearchNumberRangeValue, h as SearchFormParams, i as useSearchHistory, l as FormSearchProps, m as SearchFormItem, n as SearchDateRangeValue, o as serializeSearch, p as SearchFieldType, r as useSearchState, s as FormSearchEmits, t as DateRangeInput, u as SearchConfig, v as SearchQueryEncoding } from "./dateRange.js";
|
|
5
5
|
import { AllowedComponentProps, ComponentCustomProps, EmitFn, VNode, VNodeProps } from "vue";
|
|
6
6
|
|
|
7
7
|
//#region src/components/C_FormSearch/index.d.ts
|
|
@@ -18,4 +18,4 @@ type SearchComponent = <T extends object = SearchFormParams>(props: FormSearchPr
|
|
|
18
18
|
};
|
|
19
19
|
declare const C_FormSearch: SearchComponent;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { C_FormSearch, type ComponentDensity, type DateRangeInput, type FormSearchEmits, type FormSearchExpose, type FormSearchProps, type OptionsState, type SearchConfig, type SearchDateRangeValue, type SearchFieldContext, type SearchFieldType, type SearchFormItem, type SearchFormParams, type SearchNumberRangeValue, type SearchOptionItem, type SearchQueryEncoding, type SerializeSearchOptions, serializeSearch, useSearchHistory, useSearchState };
|
|
21
|
+
export { C_FormSearch, type ComponentDensity, type DateRangeInput, type FormSearchEmits, type FormSearchExpose, type FormSearchProps, type OptionsState, type SearchConfig, type SearchDateRangeValue, type SearchFieldContext, type SearchFieldSettings, type SearchFieldType, type SearchFormItem, type SearchFormParams, type SearchNumberRangeValue, type SearchOptionItem, type SearchQueryEncoding, type SerializeSearchOptions, serializeSearch, useSearchHistory, useSearchState };
|
package/dist/C_GlobalSearch2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`),t=require(`./virtualList.cjs`);let n=require(`vue`);const r=e=>e.replace(/^\//,``).replace(/\//g,` > `)||`首页`;function i(e){let t=new Map,n=new Map;return{entries:e.map(e=>{let{key:i}=e,a=r(i);return t.set(i,a),n.set(i,e),{item:e,label:e.label.toLowerCase(),path:a.toLowerCase()}}),paths:t,byKey:n}}function a(e,t){if(!t.trim())return[];let n=t.toLowerCase();return e.entries.filter(e=>e.label.includes(n)||e.path.includes(n)).map(e=>e.item)}function o(e){let t=typeof e==`string`?{query:e}:e;if(!t||typeof t!=`object`)return[];let{query:n,menuKey:r,menuItem:i,timestamp:a}=t,o=typeof r==`string`?r:i?.key,s=Number.isFinite(a)?a:0;return typeof o==`string`?[{menuKey:o,timestamp:s}]:typeof n!=`string`||!n.trim()?[]:[{query:n.slice(0,200),menuKey:null,timestamp:s}]}function s(e){let t=()=>(0,n.toValue)(e),s=()=>t().menuItems(),c=(0,n.computed)(()=>t().storageKey??`robot-search-history`),l=(0,n.computed)(()=>Math.min(100,Math.max(0,Math.trunc(t().maxHistory??10)))),ee=(0,n.computed)(()=>Math.min(l.value,Math.max(0,Math.trunc(t().maxDisplayHistory??5)))),u=(0,n.ref)(!1),d=(0,n.ref)(``),f=(0,n.ref)(0),p=(0,n.ref)(),m=(0,n.ref)([]),h=(0,n.ref)(!1),g=(0,n.computed)(()=>t().isDark?.()??!1),_=(0,n.computed)(()=>i(s())),v=(0,n.computed)(()=>d.value.trim()?a(_.value,d.value):[]),y=(0,n.computed)(()=>{let e=[];for(let[t,n]of m.value.entries()){if(e.length>=ee.value)break;let{menuKey:r,query:i,timestamp:a}=n,o=r===null?null:_.value.byKey.get(r),s=o?.label??i;o===void 0||s===void 0||e.push({item:{query:s,menuItem:o,timestamp:a},sourceIndex:t})}return e}),b=(0,n.computed)(()=>y.value.map(({item:e})=>e)),x=(0,n.computed)(()=>v.value.length>0),S=(0,n.computed)(()=>!!d.value.trim()||b.value.length>0),C=(0,n.computed)(()=>d.value.trim()?v.value.length:b.value.length),te=(e,t)=>[`robot-result-item`,t&&`robot-history-item`,{"robot-result-item-selected":f.value===e}],w=(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()}))},T=e=>_.value.paths.get(e)??r(e),E=()=>{if(!(typeof localStorage>`u`))try{localStorage.setItem(c.value,JSON.stringify(m.value))}catch{}},D=e=>{if(!e.label.trim())return;let t=m.value.filter(t=>t.menuKey!==e.key);m.value=[{menuKey:e.key,timestamp:Date.now()},...t].slice(0,l.value),E()},O=()=>{if(m.value=[],!(typeof localStorage>`u`))try{let e=localStorage.getItem(c.value);if(e){let t=JSON.parse(e);if(!Array.isArray(t))return;m.value=t.flatMap(o).slice(0,l.value)}}catch{m.value=[]}},k=()=>{if(m.value=[],!(typeof localStorage>`u`))try{localStorage.removeItem(c.value)}catch{}},A=e=>{let t=y.value[e];t&&(m.value.splice(t.sourceIndex,1),E(),f.value=Math.max(0,Math.min(f.value,b.value.length-1)))},j=async()=>{u.value=!0,d.value=``,f.value=0,h.value=!1,await(0,n.nextTick)(),p.value?.focus()},M=()=>{u.value=!1,d.value=``,f.value=0,h.value=!1},N=e=>{if(e.menuItem){let n=_.value.byKey.get(e.menuItem.key);if(!n)return;t().onSelect?.(n.key,!!n.children?.length),M()}else d.value=e.query,f.value=0},P=e=>{let n=_.value.byKey.get(e.key);n&&(D(n),t().onSelect?.(n.key,!!n.children?.length),M())},F=e=>h.value||!!(e&&(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)),I=e=>{if(F(e))return;f.value=Math.max(0,Math.min(f.value,C.value-1));let t=!d.value.trim()&&b.value.length>0,n=d.value.trim()&&v.value.length>0;if(t){let t=b.value[f.value];t&&(e?.preventDefault(),N(t))}else if(n){let t=v.value[f.value];t&&(e?.preventDefault(),P(t))}},L=e=>{F(e)||(e?.preventDefault(),f.value=Math.max(0,Math.min(f.value+1,C.value-1)))},R=e=>{F(e)||(e?.preventDefault(),f.value=Math.max(0,Math.min(f.value-1,C.value-1)))},z=e=>{e.key!==`Escape`||F(e)||(e.preventDefault(),M())},B=e=>{e.key===`ArrowDown`?L(e):e.key===`ArrowUp`?R(e):e.key===`Enter`?I(e):z(e)};(0,n.watch)(d,()=>{f.value=0}),(0,n.watch)(C,e=>{f.value=Math.max(0,Math.min(f.value,e-1))}),(0,n.watch)(c,O);let V=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||h.value||(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),j())};return(0,n.onMounted)(()=>{O(),document.addEventListener(`keydown`,V)}),(0,n.onUnmounted)(()=>document.removeEventListener(`keydown`,V)),{showDialog:u,searchValue:d,selectedIndex:f,searchInputRef:p,isDark:g,filteredMenuItems:v,displayHistory:b,hasResults:x,hasContent:S,getItemClasses:te,highlightMatch:w,formatMenuPath:T,clearHistory:k,removeHistoryItem:A,openDialog:j,closeDialog:M,selectHistoryItem:N,selectItem:P,handleEnter:I,focusNext:L,focusPrev:R,handleInputKeydown:B,handleDialogKeydown:z,handleCompositionStart:()=>{h.value=!0},handleCompositionEnd:()=>{h.value=!1}}}const c={class:`robot-search-palette`},l={class:`robot-search-header`},ee=[`placeholder`,`aria-expanded`,`aria-activedescendant`],u={key:0,class:`robot-empty-state`},d={class:`robot-search-results`},f={class:`robot-result-group`},p={class:`robot-group-title`},m={class:`robot-group-count`},h=[`id`,`aria-selected`,`data-option-index`,`onClick`,`onMouseenter`],g={key:1,class:`robot-item-icon robot-default-icon`},_={class:`robot-item-content`},v={class:`robot-item-label`},y={class:`robot-item-desc`},b=[`onClick`],x={class:`robot-search-results`},S={key:0,class:`robot-empty-state`},C={class:`robot-result-group`},te={class:`robot-group-title`},w={class:`robot-group-count`},T=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`title`,`onClick`,`onMouseenter`],E={key:1,class:`robot-item-icon robot-default-icon`},D={class:`robot-item-content`},O={class:`robot-item-label`},k={key:0,class:`robot-highlight`},A={class:`robot-item-desc`},j={key:2,class:`robot-item-badge`},M={class:`robot-search-footer`},N={key:0,class:`robot-footer-info`},P={key:0},F={key:1},I=(0,n.defineComponent)({name:`C_GlobalSearch`,__name:`index`,props:{options:{},placeholder:{default:`搜索导航菜单...`},emptyText:{default:`输入关键词搜索菜单`},resultGroupTitle:{default:`菜单导航`}},setup(e,{expose:r}){let i=e,{showDialog:a,searchValue:o,selectedIndex:I,searchInputRef:L,isDark:R,filteredMenuItems:z,displayHistory:B,hasResults:V,hasContent:H,getItemClasses:U,highlightMatch:ne,formatMenuPath:W,clearHistory:G,removeHistoryItem:re,openDialog:K,closeDialog:q,selectHistoryItem:ie,selectItem:ae,handleInputKeydown:oe,handleDialogKeydown:J,handleCompositionStart:Y,handleCompositionEnd:X}=s(()=>i.options),Z=`robot-search-options-${(0,n.useId)()}`,Q=e=>`${Z}-${e}`,se=(0,n.computed)(()=>(o.value.trim()?z.value.length:B.value.length)>0?Q(I.value):void 0),ce=(0,n.ref)(),le=(0,n.ref)(),$=!1,ue=async()=>{$||($=!0,await(0,n.nextTick)(),$=!1,a.value&&(o.value.trim()?z.value.length&&ce.value?.scrollTo({index:I.value}):le.value?.querySelector(`[data-option-index="${I.value}"]`)?.scrollIntoView({block:`nearest`})))},de=e=>{let t=e.defaultPrevented;oe(e),!t&&e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&ue()};return(0,n.watch)([I,z,B,a],ue,{flush:`post`}),r({openDialog:K,closeDialog:q}),(r,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,c,[(0,n.createCommentVNode)(` 搜索触发按钮 `),(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`robot-search-trigger`,{"trigger-dark":(0,n.unref)(R)}]),onClick:i[0]||=(...e)=>(0,n.unref)(K)&&(0,n.unref)(K)(...e)},[...i[9]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:search robot-trigger-icon`},null,-1),(0,n.createElementVNode)(`span`,{class:`robot-trigger-text`},`搜索`,-1),(0,n.createElementVNode)(`span`,{class:`robot-trigger-shortcut`},`Ctrl K`,-1)]],2),(0,n.createCommentVNode)(` 搜索对话框 `),((0,n.openBlock)(),(0,n.createBlock)(n.Teleport,{to:`body`},[(0,n.createVNode)(n.Transition,{name:`robot-dialog`},{default:(0,n.withCtx)(()=>[(0,n.unref)(a)?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,class:`robot-dialog-overlay`,onClick:i[7]||=(...e)=>(0,n.unref)(q)&&(0,n.unref)(q)(...e),onKeydown:i[8]||=(...e)=>(0,n.unref)(J)&&(0,n.unref)(J)(...e)},[(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`robot-dialog-container`,{"dialog-dark":(0,n.unref)(R)}]),role:`dialog`,"aria-modal":`true`,"aria-label":`全局搜索`,onClick:i[6]||=(0,n.withModifiers)(()=>{},[`stop`])},[(0,n.createCommentVNode)(` 搜索头部 `),(0,n.createElementVNode)(`div`,l,[i[11]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:magnify robot-search-icon`},null,-1),(0,n.withDirectives)((0,n.createElementVNode)(`input`,{ref_key:`searchInputRef`,ref:L,"onUpdate:modelValue":i[1]||=e=>(0,n.isRef)(o)?o.value=e:null,type:`text`,placeholder:e.placeholder,class:`robot-search-input`,role:`combobox`,"aria-label":`搜索菜单`,"aria-autocomplete":`list`,"aria-expanded":(0,n.unref)(a),"aria-controls":Z,"aria-activedescendant":se.value,onKeydown:de,onCompositionstart:i[2]||=(...e)=>(0,n.unref)(Y)&&(0,n.unref)(Y)(...e),onCompositionend:i[3]||=(...e)=>(0,n.unref)(X)&&(0,n.unref)(X)(...e)},null,40,ee),[[n.vModelText,(0,n.unref)(o)]]),(0,n.createElementVNode)(`button`,{class:`robot-close-btn`,"aria-label":`关闭搜索`,onClick:i[4]||=(...e)=>(0,n.unref)(q)&&(0,n.unref)(q)(...e)},[...i[10]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]])]),(0,n.createCommentVNode)(` 搜索内容 `),(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`robot-search-content`,{"robot-search-content--virtual":(0,n.unref)(o).trim()&&(0,n.unref)(V)}])},[(0,n.createCommentVNode)(` 空状态 `),(0,n.unref)(H)?!(0,n.unref)(o).trim()&&(0,n.unref)(B).length>0?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(` 搜索历史 `),(0,n.createElementVNode)(`div`,d,[(0,n.createElementVNode)(`div`,f,[(0,n.createElementVNode)(`div`,p,[i[14]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:clock-time-four-outline robot-group-icon`},null,-1),i[15]||=(0,n.createTextVNode)(` 最近搜索 `,-1),(0,n.createElementVNode)(`span`,m,(0,n.toDisplayString)((0,n.unref)(B).length),1),(0,n.createElementVNode)(`button`,{class:`robot-clear-history`,onClick:i[5]||=(...e)=>(0,n.unref)(G)&&(0,n.unref)(G)(...e),title:`清空历史`},[...i[13]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:delete-outline`},null,-1)]])]),(0,n.createElementVNode)(`div`,{id:Z,ref_key:`historyItemsRef`,ref:le,class:`robot-group-items`,role:`listbox`,"aria-label":`最近搜索`},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(B),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:`history-${t}`,id:Q(t),class:(0,n.normalizeClass)((0,n.unref)(U)(t,!0)),role:`option`,"aria-selected":(0,n.unref)(I)===t,"data-option-index":t,onClick:t=>(0,n.unref)(ie)(e),onMouseenter:e=>I.value=t},[e.menuItem?.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.menuItem.icon),{key:0,class:`robot-item-icon`})):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,g,[...i[16]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,n.createElementVNode)(`div`,_,[(0,n.createElementVNode)(`div`,v,(0,n.toDisplayString)(e.query),1),(0,n.createElementVNode)(`div`,y,(0,n.toDisplayString)((0,n.unref)(W)(e.menuItem?.key||``)),1)]),(0,n.createElementVNode)(`button`,{class:`robot-history-delete`,onClick:(0,n.withModifiers)(e=>(0,n.unref)(re)(t),[`stop`]),title:`删除此记录`},[...i[17]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]],8,b)],42,h))),128))],512)])])],64)):(0,n.unref)(o).trim()?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:2},[(0,n.createCommentVNode)(` 搜索结果 `),(0,n.createElementVNode)(`div`,x,[(0,n.createCommentVNode)(` 无结果状态 `),(0,n.unref)(V)?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(` 搜索结果列表 `),(0,n.createElementVNode)(`div`,C,[(0,n.createElementVNode)(`div`,te,[i[19]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:menu robot-group-icon`},null,-1),(0,n.createTextVNode)(` `+(0,n.toDisplayString)(e.resultGroupTitle)+` `,1),(0,n.createElementVNode)(`span`,w,(0,n.toDisplayString)((0,n.unref)(z).length),1)]),(0,n.createVNode)((0,n.unref)(t.t),{id:Z,ref_key:`resultListRef`,ref:ce,class:`robot-group-items robot-virtual-items`,role:`listbox`,"aria-label":e.resultGroupTitle,items:(0,n.unref)(z),"item-size":64,style:(0,n.normalizeStyle)({height:`${Math.min((0,n.unref)(z).length*64,336)}px`})},{default:(0,n.withCtx)(({item:e,index:t})=>[(0,n.createElementVNode)(`div`,{id:Q(t),class:(0,n.normalizeClass)((0,n.unref)(U)(t,!1)),role:`option`,"aria-selected":(0,n.unref)(I)===t,"aria-posinset":t+1,"aria-setsize":(0,n.unref)(z).length,title:`${e.label} · ${(0,n.unref)(W)(e.key)}`,onClick:t=>(0,n.unref)(ae)(e),onMouseenter:e=>I.value=t},[e.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon),{key:0,class:`robot-item-icon`})):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,E,[...i[20]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,n.createElementVNode)(`div`,D,[(0,n.createElementVNode)(`div`,O,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(ne)(e.label,(0,n.unref)(o)),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:t},[e.matched?((0,n.openBlock)(),(0,n.createElementBlock)(`mark`,k,(0,n.toDisplayString)(e.text),1)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createTextVNode)((0,n.toDisplayString)(e.text),1)],64))],64))),128))]),(0,n.createElementVNode)(`div`,A,(0,n.toDisplayString)((0,n.unref)(W)(e.key)),1)]),e.children?.length?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,j,(0,n.toDisplayString)(e.children.length),1)):(0,n.createCommentVNode)(`v-if`,!0)],42,T)]),_:1},8,[`aria-label`,`items`,`style`])])],2112)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,S,[i[18]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,n.createElementVNode)(`p`,null,`未找到 "`+(0,n.toDisplayString)((0,n.unref)(o))+`" 相关内容`,1)]))])],64)):(0,n.createCommentVNode)(`v-if`,!0):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,[i[12]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,n.createElementVNode)(`p`,null,(0,n.toDisplayString)(e.emptyText),1)]))],2),(0,n.createCommentVNode)(` 搜索底部 `),(0,n.createElementVNode)(`div`,M,[i[21]||=(0,n.createElementVNode)(`div`,{class:`robot-footer-actions`},[(0,n.createElementVNode)(`div`,{class:`robot-action-item`},[(0,n.createElementVNode)(`kbd`,null,`↵`),(0,n.createElementVNode)(`span`,null,`选择`)]),(0,n.createElementVNode)(`div`,{class:`robot-action-item`},[(0,n.createElementVNode)(`kbd`,null,`↑↓`),(0,n.createElementVNode)(`span`,null,`导航`)]),(0,n.createElementVNode)(`div`,{class:`robot-action-item`},[(0,n.createElementVNode)(`kbd`,null,`esc`),(0,n.createElementVNode)(`span`,null,`关闭`)])],-1),(0,n.unref)(H)?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,N,[(0,n.unref)(o).trim()&&(0,n.unref)(V)?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,P,` 共 `+(0,n.toDisplayString)((0,n.unref)(z).length)+` 项结果 `,1)):!(0,n.unref)(o).trim()&&(0,n.unref)(B).length>0?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,F,(0,n.toDisplayString)((0,n.unref)(B).length)+` 条历史记录 `,1)):(0,n.createCommentVNode)(`v-if`,!0)])):(0,n.createCommentVNode)(`v-if`,!0)])],2)],32)):(0,n.createCommentVNode)(`v-if`,!0)]),_:1})]))]))}});var L=e.t(I,[[`__scopeId`,`data-v-c2819875`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return L}});
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`),t=require(`./virtualList.cjs`);let n=require(`vue`);const r=e=>e.replace(/^\//,``).replace(/\//g,` > `)||`首页`;function i(e){let t=new Map,n=new Map;return{entries:e.map(e=>{let{key:i}=e,o=r(i);t.set(i,o),n.set(i,e);let s=e.label.toLowerCase();return{item:e,label:s,path:o.toLowerCase(),normalizedLabel:a(s),text:a([s,o,e.breadcrumb??``,...e.keywords??[]].join(` `))}}),paths:t,byKey:n}}function a(e){return e.normalize(`NFKC`).toLowerCase().trim().replace(/\s+/g,` `)}function o(e,t,n=`literal`){if(!t.trim())return[];if(n===`tokens`){let n=a(t),r=n.split(` `);return e.entries.filter(e=>r.every(t=>e.text.includes(t))).map(e=>({item:e.item,rank:e.normalizedLabel===n?0:e.normalizedLabel.startsWith(n)?1:e.normalizedLabel.includes(n)?2:3})).sort((e,t)=>e.rank-t.rank).map(e=>e.item)}let r=t.toLowerCase();return e.entries.filter(e=>e.label.includes(r)||e.path.includes(r)).map(e=>e.item)}function s(e){let t=typeof e==`string`?{query:e}:e;if(!t||typeof t!=`object`)return[];let{query:n,menuKey:r,menuItem:i,timestamp:a}=t,o=typeof r==`string`?r:i?.key,s=Number.isFinite(a)?a:0;return typeof o==`string`?[{menuKey:o,timestamp:s}]:typeof n!=`string`||!n.trim()?[]:[{query:n.slice(0,200),menuKey:null,timestamp:s}]}function c(e){let t=()=>(0,n.toValue)(e),a=()=>t().menuItems(),c=(0,n.computed)(()=>t().storageKey??`robot-search-history`),l=(0,n.computed)(()=>Math.min(100,Math.max(0,Math.trunc(t().maxHistory??10)))),u=(0,n.computed)(()=>Math.min(l.value,Math.max(0,Math.trunc(t().maxDisplayHistory??5)))),d=(0,n.ref)(!1),f=(0,n.ref)(``),p=(0,n.ref)(0),m=(0,n.ref)(),h=(0,n.ref)([]),g=(0,n.ref)(!1),_=(0,n.computed)(()=>t().isDark?.()??!1),v=(0,n.computed)(()=>i(a())),y=(0,n.computed)(()=>{if(!f.value.trim())return[];let e=v.value,{search:n,matchMode:r}=t();if(!n)return o(e,f.value,r);let i=new Set;return n(f.value,e.entries.map(e=>e.item)).flatMap(t=>{let n=e.byKey.get(t.key);return!n||i.has(t.key)?[]:(i.add(t.key),[n])})}),b=(0,n.computed)(()=>{let e=[];for(let[t,n]of h.value.entries()){if(e.length>=u.value)break;let{menuKey:r,query:i,timestamp:a}=n,o=r===null?null:v.value.byKey.get(r),s=o?.label??i;o===void 0||s===void 0||e.push({item:{query:s,menuItem:o,timestamp:a},sourceIndex:t})}return e}),x=(0,n.computed)(()=>b.value.map(({item:e})=>e)),ee=(0,n.computed)(()=>y.value.length>0),te=(0,n.computed)(()=>!!f.value.trim()||x.value.length>0),S=(0,n.computed)(()=>f.value.trim()?y.value.length:x.value.length),C=(e,t)=>[`robot-result-item`,t&&`robot-history-item`,{"robot-result-item-selected":p.value===e}],w=(e,n)=>{if(!n)return[{text:e,matched:!1}];let r=t().matchMode===`tokens`?n.trim().split(/\s+/).filter(Boolean).sort((e,t)=>t.length-e.length):[n];if(!r.length)return[{text:e,matched:!1}];let i=RegExp(`(${r.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})`,`gi`);return e.split(i).filter(Boolean).map(e=>({text:e,matched:r.some(t=>e.toLocaleLowerCase()===t.toLocaleLowerCase())}))},T=e=>v.value.paths.get(e)??r(e),E=()=>{if(!(typeof localStorage>`u`))try{localStorage.setItem(c.value,JSON.stringify(h.value))}catch{}},D=e=>{if(!e.label.trim())return;let t=h.value.filter(t=>t.menuKey!==e.key);h.value=[{menuKey:e.key,timestamp:Date.now()},...t].slice(0,l.value),E()},O=()=>{if(h.value=[],!(typeof localStorage>`u`))try{let e=localStorage.getItem(c.value);if(e){let t=JSON.parse(e);if(!Array.isArray(t))return;h.value=t.flatMap(s).slice(0,l.value)}}catch{h.value=[]}},k=()=>{if(h.value=[],!(typeof localStorage>`u`))try{localStorage.removeItem(c.value)}catch{}},A=e=>{let t=b.value[e];t&&(h.value.splice(t.sourceIndex,1),E(),p.value=Math.max(0,Math.min(p.value,x.value.length-1)))},j=async()=>{d.value=!0,f.value=``,p.value=0,g.value=!1,await(0,n.nextTick)(),m.value?.focus()},M=()=>{d.value=!1,f.value=``,p.value=0,g.value=!1},N=e=>{if(e.menuItem){let n=v.value.byKey.get(e.menuItem.key);if(!n)return;t().onSelect?.(n.key,!!n.children?.length),M()}else f.value=e.query,p.value=0},P=e=>{let n=v.value.byKey.get(e.key);n&&(D(n),t().onSelect?.(n.key,!!n.children?.length),M())},F=e=>g.value||!!(e&&(e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)),I=e=>{if(F(e))return;p.value=Math.max(0,Math.min(p.value,S.value-1));let t=!f.value.trim()&&x.value.length>0,n=f.value.trim()&&y.value.length>0;if(t){let t=x.value[p.value];t&&(e?.preventDefault(),N(t))}else if(n){let t=y.value[p.value];t&&(e?.preventDefault(),P(t))}},L=e=>{F(e)||(e?.preventDefault(),p.value=Math.max(0,Math.min(p.value+1,S.value-1)))},R=e=>{F(e)||(e?.preventDefault(),p.value=Math.max(0,Math.min(p.value-1,S.value-1)))},z=e=>{e.key!==`Escape`||F(e)||(e.preventDefault(),M())},B=e=>{e.key===`ArrowDown`?L(e):e.key===`ArrowUp`?R(e):e.key===`Enter`?I(e):z(e)};(0,n.watch)(f,()=>{p.value=0}),(0,n.watch)(S,e=>{p.value=Math.max(0,Math.min(p.value,e-1))}),(0,n.watch)(c,O);let V=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||g.value||(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),j())};return(0,n.onMounted)(()=>{O(),document.addEventListener(`keydown`,V)}),(0,n.onUnmounted)(()=>document.removeEventListener(`keydown`,V)),{showDialog:d,searchValue:f,selectedIndex:p,searchInputRef:m,isDark:_,filteredMenuItems:y,displayHistory:x,hasResults:ee,hasContent:te,getItemClasses:C,highlightMatch:w,formatMenuPath:T,clearHistory:k,removeHistoryItem:A,openDialog:j,closeDialog:M,selectHistoryItem:N,selectItem:P,handleEnter:I,focusNext:L,focusPrev:R,handleInputKeydown:B,handleDialogKeydown:z,handleCompositionStart:()=>{g.value=!0},handleCompositionEnd:()=>{g.value=!1}}}const l={class:`robot-search-palette`},u={class:`robot-search-header`},d=[`placeholder`,`aria-expanded`,`aria-activedescendant`],f={key:0,class:`robot-empty-state`},p={class:`robot-search-results`},m={class:`robot-result-group`},h={class:`robot-group-title`},g={class:`robot-group-count`},_=[`id`,`aria-selected`,`data-option-index`,`onClick`,`onMouseenter`],v={key:1,class:`robot-item-icon robot-default-icon`},y={class:`robot-item-content`},b={class:`robot-item-label`},x={class:`robot-item-desc`},ee=[`onClick`],te={class:`robot-search-results`},S={key:0,class:`robot-empty-state`},C={class:`robot-result-group`},w={class:`robot-group-title`},T={class:`robot-group-count`},E=[`id`,`aria-selected`,`aria-posinset`,`aria-setsize`,`title`,`onClick`,`onMouseenter`],D={key:1,class:`robot-item-icon robot-default-icon`},O={class:`robot-item-content`},k={class:`robot-item-label`},A={key:0,class:`robot-highlight`},j={class:`robot-item-desc`},M={key:2,class:`robot-item-badge`},N={class:`robot-search-footer`},P={key:0,class:`robot-footer-info`},F={key:0},I={key:1},L=(0,n.defineComponent)({name:`C_GlobalSearch`,__name:`index`,props:{options:{},placeholder:{default:`搜索导航菜单...`},emptyText:{default:`输入关键词搜索菜单`},resultGroupTitle:{default:`菜单导航`}},setup(e,{expose:r}){let i=e,{showDialog:a,searchValue:o,selectedIndex:s,searchInputRef:L,isDark:R,filteredMenuItems:z,displayHistory:B,hasResults:V,hasContent:H,getItemClasses:U,highlightMatch:ne,formatMenuPath:W,clearHistory:G,removeHistoryItem:re,openDialog:K,closeDialog:q,selectHistoryItem:ie,selectItem:ae,handleInputKeydown:oe,handleDialogKeydown:J,handleCompositionStart:Y,handleCompositionEnd:X}=c(()=>i.options),Z=`robot-search-options-${(0,n.useId)()}`,Q=e=>`${Z}-${e}`,se=(0,n.computed)(()=>(o.value.trim()?z.value.length:B.value.length)>0?Q(s.value):void 0),ce=(0,n.ref)(),le=(0,n.ref)(),$=!1,ue=async()=>{$||($=!0,await(0,n.nextTick)(),$=!1,a.value&&(o.value.trim()?z.value.length&&ce.value?.scrollTo({index:s.value}):le.value?.querySelector(`[data-option-index="${s.value}"]`)?.scrollIntoView({block:`nearest`})))},de=e=>{let t=e.defaultPrevented;oe(e),!t&&e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&ue()};return(0,n.watch)([s,z,B,a],ue,{flush:`post`}),r({openDialog:K,closeDialog:q}),(r,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,l,[(0,n.createCommentVNode)(` 搜索触发按钮 `),(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`robot-search-trigger`,{"trigger-dark":(0,n.unref)(R)}]),onClick:i[0]||=(...e)=>(0,n.unref)(K)&&(0,n.unref)(K)(...e)},[...i[9]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:search robot-trigger-icon`},null,-1),(0,n.createElementVNode)(`span`,{class:`robot-trigger-text`},`搜索`,-1),(0,n.createElementVNode)(`span`,{class:`robot-trigger-shortcut`},`Ctrl K`,-1)]],2),(0,n.createCommentVNode)(` 搜索对话框 `),((0,n.openBlock)(),(0,n.createBlock)(n.Teleport,{to:`body`},[(0,n.createVNode)(n.Transition,{name:`robot-dialog`},{default:(0,n.withCtx)(()=>[(0,n.unref)(a)?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,class:`robot-dialog-overlay`,onClick:i[7]||=(...e)=>(0,n.unref)(q)&&(0,n.unref)(q)(...e),onKeydown:i[8]||=(...e)=>(0,n.unref)(J)&&(0,n.unref)(J)(...e)},[(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`robot-dialog-container`,{"dialog-dark":(0,n.unref)(R)}]),role:`dialog`,"aria-modal":`true`,"aria-label":`全局搜索`,onClick:i[6]||=(0,n.withModifiers)(()=>{},[`stop`])},[(0,n.createCommentVNode)(` 搜索头部 `),(0,n.createElementVNode)(`div`,u,[i[11]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:magnify robot-search-icon`},null,-1),(0,n.withDirectives)((0,n.createElementVNode)(`input`,{ref_key:`searchInputRef`,ref:L,"onUpdate:modelValue":i[1]||=e=>(0,n.isRef)(o)?o.value=e:null,type:`text`,placeholder:e.placeholder,class:`robot-search-input`,role:`combobox`,"aria-label":`搜索菜单`,"aria-autocomplete":`list`,"aria-expanded":(0,n.unref)(a),"aria-controls":Z,"aria-activedescendant":se.value,onKeydown:de,onCompositionstart:i[2]||=(...e)=>(0,n.unref)(Y)&&(0,n.unref)(Y)(...e),onCompositionend:i[3]||=(...e)=>(0,n.unref)(X)&&(0,n.unref)(X)(...e)},null,40,d),[[n.vModelText,(0,n.unref)(o)]]),(0,n.createElementVNode)(`button`,{class:`robot-close-btn`,"aria-label":`关闭搜索`,onClick:i[4]||=(...e)=>(0,n.unref)(q)&&(0,n.unref)(q)(...e)},[...i[10]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]])]),(0,n.createCommentVNode)(` 搜索内容 `),(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`robot-search-content`,{"robot-search-content--virtual":(0,n.unref)(o).trim()&&(0,n.unref)(V)}])},[(0,n.createCommentVNode)(` 空状态 `),(0,n.unref)(H)?!(0,n.unref)(o).trim()&&(0,n.unref)(B).length>0?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(` 搜索历史 `),(0,n.createElementVNode)(`div`,p,[(0,n.createElementVNode)(`div`,m,[(0,n.createElementVNode)(`div`,h,[i[14]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:clock-time-four-outline robot-group-icon`},null,-1),i[15]||=(0,n.createTextVNode)(` 最近搜索 `,-1),(0,n.createElementVNode)(`span`,g,(0,n.toDisplayString)((0,n.unref)(B).length),1),(0,n.createElementVNode)(`button`,{class:`robot-clear-history`,onClick:i[5]||=(...e)=>(0,n.unref)(G)&&(0,n.unref)(G)(...e),title:`清空历史`},[...i[13]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:delete-outline`},null,-1)]])]),(0,n.createElementVNode)(`div`,{id:Z,ref_key:`historyItemsRef`,ref:le,class:`robot-group-items`,role:`listbox`,"aria-label":`最近搜索`},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(B),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:`history-${t}`,id:Q(t),class:(0,n.normalizeClass)((0,n.unref)(U)(t,!0)),role:`option`,"aria-selected":(0,n.unref)(s)===t,"data-option-index":t,onClick:t=>(0,n.unref)(ie)(e),onMouseenter:e=>s.value=t},[e.menuItem?.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.menuItem.icon),{key:0,class:`robot-item-icon`})):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,v,[...i[16]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,n.createElementVNode)(`div`,y,[(0,n.createElementVNode)(`div`,b,(0,n.toDisplayString)(e.query),1),(0,n.createElementVNode)(`div`,x,(0,n.toDisplayString)((0,n.unref)(W)(e.menuItem?.key||``)),1)]),(0,n.createElementVNode)(`button`,{class:`robot-history-delete`,onClick:(0,n.withModifiers)(e=>(0,n.unref)(re)(t),[`stop`]),title:`删除此记录`},[...i[17]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:close`},null,-1)]],8,ee)],42,_))),128))],512)])])],64)):(0,n.unref)(o).trim()?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:2},[(0,n.createCommentVNode)(` 搜索结果 `),(0,n.createElementVNode)(`div`,te,[(0,n.createCommentVNode)(` 无结果状态 `),(0,n.unref)(V)?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(` 搜索结果列表 `),(0,n.createElementVNode)(`div`,C,[(0,n.createElementVNode)(`div`,w,[i[19]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:menu robot-group-icon`},null,-1),(0,n.createTextVNode)(` `+(0,n.toDisplayString)(e.resultGroupTitle)+` `,1),(0,n.createElementVNode)(`span`,T,(0,n.toDisplayString)((0,n.unref)(z).length),1)]),(0,n.createVNode)((0,n.unref)(t.t),{id:Z,ref_key:`resultListRef`,ref:ce,class:`robot-group-items robot-virtual-items`,role:`listbox`,"aria-label":e.resultGroupTitle,items:(0,n.unref)(z),"item-size":64,style:(0,n.normalizeStyle)({height:`${Math.min((0,n.unref)(z).length*64,336)}px`})},{default:(0,n.withCtx)(({item:e,index:t})=>[(0,n.createElementVNode)(`div`,{id:Q(t),class:(0,n.normalizeClass)((0,n.unref)(U)(t,!1)),role:`option`,"aria-selected":(0,n.unref)(s)===t,"aria-posinset":t+1,"aria-setsize":(0,n.unref)(z).length,title:`${e.label} · ${(0,n.unref)(W)(e.key)}`,onClick:t=>(0,n.unref)(ae)(e),onMouseenter:e=>s.value=t},[e.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon),{key:0,class:`robot-item-icon`})):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,D,[...i[20]||=[(0,n.createElementVNode)(`div`,{class:`i-mdi:file-document-outline`},null,-1)]])),(0,n.createElementVNode)(`div`,O,[(0,n.createElementVNode)(`div`,k,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(ne)(e.label,(0,n.unref)(o)),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:t},[e.matched?((0,n.openBlock)(),(0,n.createElementBlock)(`mark`,A,(0,n.toDisplayString)(e.text),1)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createTextVNode)((0,n.toDisplayString)(e.text),1)],64))],64))),128))]),(0,n.createElementVNode)(`div`,j,(0,n.toDisplayString)((0,n.unref)(W)(e.key)),1)]),e.children?.length?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,M,(0,n.toDisplayString)(e.children.length),1)):(0,n.createCommentVNode)(`v-if`,!0)],42,E)]),_:1},8,[`aria-label`,`items`,`style`])])],2112)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,S,[i[18]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,n.createElementVNode)(`p`,null,`未找到 "`+(0,n.toDisplayString)((0,n.unref)(o))+`" 相关内容`,1)]))])],64)):(0,n.createCommentVNode)(`v-if`,!0):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,f,[i[12]||=(0,n.createElementVNode)(`div`,{class:`i-mdi:magnify robot-empty-icon`},null,-1),(0,n.createElementVNode)(`p`,null,(0,n.toDisplayString)(e.emptyText),1)]))],2),(0,n.createCommentVNode)(` 搜索底部 `),(0,n.createElementVNode)(`div`,N,[i[21]||=(0,n.createElementVNode)(`div`,{class:`robot-footer-actions`},[(0,n.createElementVNode)(`div`,{class:`robot-action-item`},[(0,n.createElementVNode)(`kbd`,null,`↵`),(0,n.createElementVNode)(`span`,null,`选择`)]),(0,n.createElementVNode)(`div`,{class:`robot-action-item`},[(0,n.createElementVNode)(`kbd`,null,`↑↓`),(0,n.createElementVNode)(`span`,null,`导航`)]),(0,n.createElementVNode)(`div`,{class:`robot-action-item`},[(0,n.createElementVNode)(`kbd`,null,`esc`),(0,n.createElementVNode)(`span`,null,`关闭`)])],-1),(0,n.unref)(H)?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,P,[(0,n.unref)(o).trim()&&(0,n.unref)(V)?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,F,` 共 `+(0,n.toDisplayString)((0,n.unref)(z).length)+` 项结果 `,1)):!(0,n.unref)(o).trim()&&(0,n.unref)(B).length>0?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,I,(0,n.toDisplayString)((0,n.unref)(B).length)+` 条历史记录 `,1)):(0,n.createCommentVNode)(`v-if`,!0)])):(0,n.createCommentVNode)(`v-if`,!0)])],2)],32)):(0,n.createCommentVNode)(`v-if`,!0)]),_:1})]))]))}});var R=e.t(L,[[`__scopeId`,`data-v-c2819875`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return R}});
|