@robot-admin/naive-ui-components 0.40.3 → 0.40.5
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 +15 -0
- package/README.md +101 -79
- package/README_EN.md +110 -67
- package/dist/BPMN.cjs +1 -1
- package/dist/BPMN.js +1 -1
- package/dist/C_ActionBar.css +58 -52
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_AntV.css +108 -108
- package/dist/C_AvatarGroup.css +29 -29
- package/dist/C_AvatarGroup2.cjs +1 -1
- package/dist/C_AvatarGroup2.js +1 -1
- package/dist/C_Barcode.css +6 -6
- package/dist/C_Barcode.d.cts +2 -2
- package/dist/C_Barcode.d.ts +2 -2
- package/dist/C_Barcode2.cjs +1 -1
- package/dist/C_Barcode2.js +1 -1
- package/dist/C_Captcha.css +42 -42
- package/dist/C_Captcha2.cjs +1 -1
- package/dist/C_Captcha2.js +1 -1
- package/dist/C_Cascade.css +4 -4
- package/dist/C_Cascade.d.cts +2 -2
- package/dist/C_Cascade.d.ts +2 -2
- package/dist/C_Cascade2.cjs +1 -1
- package/dist/C_Cascade2.js +1 -1
- package/dist/C_City.css +35 -35
- package/dist/C_City2.cjs +1 -1
- package/dist/C_City2.js +1 -1
- package/dist/C_Code.css +27 -27
- package/dist/C_Code.d.cts +2 -2
- package/dist/C_Code.d.ts +2 -2
- package/dist/C_Code2.cjs +1 -1
- package/dist/C_Code2.js +1 -1
- package/dist/C_CollapsePanel2.cjs +1 -1
- package/dist/C_CollapsePanel2.js +1 -1
- package/dist/C_ContextMenu.css +3 -3
- package/dist/C_ContextMenu2.cjs +1 -1
- package/dist/C_ContextMenu2.js +1 -1
- package/dist/C_Editor.css +13 -13
- package/dist/C_Editor.d.cts +2 -2
- package/dist/C_Editor.d.ts +2 -2
- package/dist/C_Editor2.cjs +1 -1
- package/dist/C_Editor2.js +1 -1
- package/dist/C_FilePreview.css +104 -104
- package/dist/C_FilePreview2.cjs +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_FormModal.css +58 -52
- package/dist/C_GlobalSearch.css +139 -136
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Guide.css +3 -3
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_Language.css +2 -2
- package/dist/C_Language2.cjs +1 -1
- package/dist/C_Language2.js +1 -1
- package/dist/C_Login.css +136 -121
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Markdown.css +37 -37
- package/dist/C_Markdown.d.cts +2 -2
- package/dist/C_Markdown.d.ts +2 -2
- package/dist/C_Markdown2.cjs +1 -1
- package/dist/C_Markdown2.js +1 -1
- package/dist/C_NotificationCenter.css +51 -36
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_Progress.d.cts +2 -2
- package/dist/C_Progress.d.ts +2 -2
- package/dist/C_Progress2.cjs +1 -1
- package/dist/C_Progress2.js +1 -1
- package/dist/C_Signature.css +15 -15
- package/dist/C_Signature2.cjs +1 -1
- package/dist/C_Signature2.js +1 -1
- package/dist/C_Steps.css +39 -39
- package/dist/C_Steps.d.cts +2 -2
- package/dist/C_Steps.d.ts +2 -2
- package/dist/C_Steps2.cjs +1 -1
- package/dist/C_Steps2.js +1 -1
- package/dist/C_Table.base.css +58 -52
- package/dist/C_Table.css +58 -52
- package/dist/C_Table2.cjs +2 -2
- package/dist/C_Table2.js +2 -2
- package/dist/C_TagsView.css +60 -50
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Timeline.css +53 -53
- package/dist/C_Timeline2.cjs +1 -1
- package/dist/C_Timeline2.js +1 -1
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_WaterFall.css +41 -41
- package/dist/C_WaterFall.d.cts +2 -2
- package/dist/C_WaterFall.d.ts +2 -2
- package/dist/C_WaterFall2.cjs +1 -1
- package/dist/C_WaterFall2.js +1 -1
- package/dist/C_WorkFlow.css +93 -92
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/ER.cjs +1 -1
- package/dist/ER.js +1 -1
- package/dist/UML.cjs +3 -3
- package/dist/UML.js +3 -3
- package/dist/component-config.d.ts +2 -0
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants3.d.cts +6 -6
- package/dist/constants3.d.ts +6 -6
- package/dist/constants4.d.cts +5 -5
- package/dist/constants4.d.ts +5 -5
- package/dist/context.d.cts +2 -0
- package/dist/data2.d.cts +7 -7
- package/dist/data2.d.ts +7 -7
- package/dist/editors.d.cts +8 -8
- package/dist/editors.d.ts +8 -8
- package/dist/graphEditSession.cjs +1 -0
- package/dist/graphEditSession.js +1 -0
- package/dist/index.d.cts +9 -10
- package/dist/index.d.ts +9 -9
- package/dist/index.vue.d.cts +3 -3
- package/dist/index.vue.d.ts +3 -3
- package/dist/index10.vue.d.cts +0 -1
- package/dist/index10.vue.d.ts +12 -9
- package/dist/index11.vue.d.cts +12 -9
- package/dist/index11.vue.d.ts +4 -4
- package/dist/index12.vue.d.cts +4 -4
- package/dist/index13.vue.d.ts +19 -16
- package/dist/index14.vue.d.cts +19 -16
- package/dist/index16.vue.d.ts +5 -10
- package/dist/index17.vue.d.cts +5 -10
- package/dist/index17.vue.d.ts +6 -6
- package/dist/index18.vue.d.cts +6 -6
- package/dist/index18.vue.d.ts +2 -7
- package/dist/index19.vue.d.cts +2 -7
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index20.vue.d.ts +0 -1
- package/dist/index21.vue.d.cts +0 -1
- package/dist/index21.vue.d.ts +18 -16
- package/dist/index22.vue.d.cts +18 -16
- package/dist/index24.vue.d.cts +10 -7
- package/dist/index24.vue.d.ts +10 -7
- package/dist/index27.vue.d.cts +2 -2
- package/dist/index27.vue.d.ts +2 -2
- package/dist/index28.vue.d.cts +12 -19
- package/dist/index28.vue.d.ts +12 -19
- package/dist/index3.vue.d.cts +2 -2
- package/dist/index3.vue.d.ts +2 -2
- package/dist/index30.vue.d.cts +2 -9
- package/dist/index30.vue.d.ts +2 -9
- package/dist/index31.vue.d.cts +4 -4
- package/dist/index31.vue.d.ts +4 -4
- package/dist/index32.vue.d.cts +2 -2
- package/dist/index32.vue.d.ts +2 -2
- package/dist/index4.vue.d.cts +13 -10
- package/dist/index4.vue.d.ts +13 -10
- package/dist/index7.vue.d.ts +12 -12
- package/dist/index8.vue.d.cts +12 -12
- package/dist/index9.vue.d.ts +0 -1
- package/dist/mapUtils.d.cts +2 -2
- package/dist/mapUtils.d.ts +2 -2
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/serializeSearch.cjs +1 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/style.css +1056 -1006
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +5 -5
- package/dist/useCollapsePanel.d.ts +5 -5
- package/dist/useCropperCore.d.cts +6 -6
- package/dist/useCropperCore.d.ts +6 -6
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFullscreen.d.cts +2 -2
- package/dist/useFullscreen.d.ts +2 -2
- package/dist/useGlobalSearch.d.cts +1 -5
- package/dist/useGlobalSearch.d.ts +1 -5
- package/dist/useInfiniteScroll.d.cts +42 -70
- package/dist/useInfiniteScroll.d.ts +42 -70
- package/dist/useQRCode.d.cts +5 -5
- package/dist/useQRCode.d.ts +5 -5
- package/dist/useScopedComponentLocale.cjs +1 -0
- package/dist/useScopedComponentLocale.js +1 -0
- package/dist/useSignatureHistory.d.cts +11 -6
- package/dist/useSignatureHistory.d.ts +11 -6
- package/dist/useSplitResize.d.cts +4 -4
- package/dist/useSplitResize.d.ts +4 -4
- package/dist/useTimeSelection.d.cts +3 -3
- package/dist/useTimeSelection.d.ts +3 -3
- package/dist/useWorkflowValidation.d.cts +89 -84
- package/dist/useWorkflowValidation.d.ts +89 -84
- package/dist/verification.d.cts +6 -6
- package/dist/verification.d.ts +6 -6
- package/docs/component-audit-closure-0.40.4.md +62 -0
- package/docs/engineering.en.md +6 -0
- package/docs/engineering.md +6 -0
- package/docs/guides/api-migration.md +17 -1
- package/docs/guides/search-workflows.md +2 -0
- package/docs/guides/transfer.md +2 -0
- package/docs/guides/usage.en.md +15 -1
- package/docs/guides/usage.md +24 -1
- package/docs/guides/workflow.md +5 -1
- package/package.json +1 -1
- package/dist/readonlyGraph.cjs +0 -1
- package/dist/readonlyGraph.js +0 -1
package/dist/UML.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./data2.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`),r=require(`./C_Icon2.cjs`),i=require(`./useGraphExport.cjs`),a=require(`./useEdgeInteraction.cjs`),o=require(`./readonlyGraph.cjs`);let s=require(`vue`),c=require(`naive-ui`),l=require(`@antv/x6`);const u={key:0,class:`class-editor`},d={class:`section`},f={class:`section-header`},p={style:{"font-size":`13px`}},m={class:`section`},h={class:`section-header`},g={style:{"font-size":`13px`}},_=(0,s.defineComponent)({__name:`UMLClassEditor`,props:(0,s.mergeModels)({show:{type:Boolean}},{editingClass:{},editingClassModifiers:{}}),emits:(0,s.mergeModels)([`update:show`,`save`,`delete`],[`update:editingClass`]),setup(e,{emit:t}){let n=(0,s.useModel)(e,`editingClass`),i=t;return(t,a)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(c.NDrawer),{show:e.show,width:`450`,title:`编辑类`,"onUpdate:show":a[6]||=e=>i(`update:show`,e)},{default:(0,s.withCtx)(()=>[n.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,u,[(0,s.createVNode)((0,s.unref)(c.NForm),{"label-placement":`top`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`类名`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.name,"onUpdate:value":a[0]||=e=>n.value.name=e,placeholder:`请输入类名`},null,8,[`value`])]),_:1}),(0,s.createVNode)((0,s.unref)(c.NDivider),{style:{margin:`20px 0`}},{default:(0,s.withCtx)(()=>[...a[7]||=[(0,s.createTextVNode)(`属性`,-1)]]),_:1}),(0,s.createElementVNode)(`div`,d,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(n.value.attributes,(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:t,class:`item`},[(0,s.createVNode)((0,s.unref)(c.NCard),{size:`small`,style:{"margin-bottom":`12px`}},{header:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,f,[(0,s.createElementVNode)(`span`,p,`#`+(0,s.toDisplayString)(t+1)+` `+(0,s.toDisplayString)(e.name||`新属性`),1),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:e=>n.value.attributes.splice(t,1),size:`tiny`,type:`error`,quaternary:``,style:{"margin-left":`auto`}},{default:(0,s.withCtx)(()=>[...a[8]||=[(0,s.createTextVNode)(` 删除 `,-1)]]),_:1},8,[`onClick`])])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),{vertical:``,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`属性名`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`属性名`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`类型`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.type,"onUpdate:value":t=>e.type=t,placeholder:`类型`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`可见性`,style:{margin:`0`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadioGroup),{value:e.visibility,"onUpdate:value":t=>e.visibility=t,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`public`},{default:(0,s.withCtx)(()=>[...a[9]||=[(0,s.createTextVNode)(`+ public`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`private`},{default:(0,s.withCtx)(()=>[...a[10]||=[(0,s.createTextVNode)(`- private`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`protected`},{default:(0,s.withCtx)(()=>[...a[11]||=[(0,s.createTextVNode)(`# protected`,-1)]]),_:1})]),_:1},8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024)]),_:2},1024)]))),128)),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[1]||=e=>n.value.attributes.push({name:`newAttribute`,type:`string`,visibility:`private`}),dashed:``,block:``,type:`primary`,ghost:``,size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:plus`,size:16})]),default:(0,s.withCtx)(()=>[a[12]||=(0,s.createTextVNode)(` 添加属性 `,-1)]),_:1})]),(0,s.createVNode)((0,s.unref)(c.NDivider),{style:{margin:`20px 0`}},{default:(0,s.withCtx)(()=>[...a[13]||=[(0,s.createTextVNode)(`方法`,-1)]]),_:1}),(0,s.createElementVNode)(`div`,m,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(n.value.methods,(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:t,class:`item`},[(0,s.createVNode)((0,s.unref)(c.NCard),{size:`small`,style:{"margin-bottom":`12px`}},{header:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,h,[(0,s.createElementVNode)(`span`,g,`#`+(0,s.toDisplayString)(t+1)+` `+(0,s.toDisplayString)(e.name||`新方法`),1),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:e=>n.value.methods.splice(t,1),size:`tiny`,type:`error`,quaternary:``,style:{"margin-left":`auto`}},{default:(0,s.withCtx)(()=>[...a[14]||=[(0,s.createTextVNode)(` 删除 `,-1)]]),_:1},8,[`onClick`])])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),{vertical:``,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`方法名`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`方法名`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`返回类型`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.returnType,"onUpdate:value":t=>e.returnType=t,placeholder:`返回类型`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`可见性`,style:{margin:`0`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadioGroup),{value:e.visibility,"onUpdate:value":t=>e.visibility=t,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`public`},{default:(0,s.withCtx)(()=>[...a[15]||=[(0,s.createTextVNode)(`+ public`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`private`},{default:(0,s.withCtx)(()=>[...a[16]||=[(0,s.createTextVNode)(`- private`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`protected`},{default:(0,s.withCtx)(()=>[...a[17]||=[(0,s.createTextVNode)(`# protected`,-1)]]),_:1})]),_:1},8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024)]),_:2},1024)]))),128)),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[2]||=e=>n.value.methods.push({name:`newMethod`,returnType:`void`,visibility:`public`}),dashed:``,block:``,type:`primary`,ghost:``,size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:plus`,size:16})]),default:(0,s.withCtx)(()=>[a[18]||=(0,s.createTextVNode)(` 添加方法 `,-1)]),_:1})]),(0,s.createVNode)((0,s.unref)(c.NDivider),{style:{margin:`20px 0`}}),(0,s.createVNode)((0,s.unref)(c.NSpace),{justify:`space-between`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[3]||=e=>i(`delete`),type:`error`,ghost:``},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:delete`,size:16})]),default:(0,s.withCtx)(()=>[a[19]||=(0,s.createTextVNode)(` 删除类 `,-1)]),_:1}),(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[4]||=e=>i(`update:show`,!1)},{default:(0,s.withCtx)(()=>[...a[20]||=[(0,s.createTextVNode)(`取消`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[5]||=e=>i(`save`),type:`primary`},{default:(0,s.withCtx)(()=>[...a[21]||=[(0,s.createTextVNode)(` 保存 `,-1)]]),_:1})]),_:1})]),_:1})]),_:1})])):(0,s.createCommentVNode)(`v-if`,!0)]),_:1},8,[`show`]))}});var v=n.t(_,[[`__scopeId`,`data-v-32abd5a2`]]);const y={public:`+`,private:`-`,protected:`#`},b={extends:{strokeDasharray:0,targetMarker:{name:`block`,width:10,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},implement:{strokeDasharray:`8,4`,targetMarker:{name:`block`,width:10,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},dependency:{strokeDasharray:`6,4`,targetMarker:{name:`classic`,size:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}},composition:{strokeDasharray:0,sourceMarker:{name:`diamond`,width:12,height:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`}},aggregation:{strokeDasharray:0,sourceMarker:{name:`diamond`,width:12,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},association:{strokeDasharray:0,targetMarker:{name:`classic`,size:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}}},x=[`top`,`right`,`bottom`,`left`].reduce((e,t)=>{let n=t===`top`?{refX:.5,refY:0}:t===`right`?{refX:1,refY:.5}:t===`bottom`?{refX:.5,refY:1}:{refX:0,refY:.5};return e[`port-${t}`]={ref:`body`,...n,r:4,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:2,magnet:!0,style:{cursor:`crosshair`,opacity:0,transition:`opacity 0.2s`}},e},{}),S={inherit:`rect`,markup:[{tagName:`rect`,selector:`body`},{tagName:`rect`,selector:`name-rect`},{tagName:`rect`,selector:`attrs-rect`},{tagName:`rect`,selector:`methods-rect`},{tagName:`text`,selector:`name-text`},{tagName:`text`,selector:`attrs-text`},{tagName:`text`,selector:`methods-text`},{tagName:`circle`,selector:`port-top`},{tagName:`circle`,selector:`port-right`},{tagName:`circle`,selector:`port-bottom`},{tagName:`circle`,selector:`port-left`}],attrs:{rect:{width:160},body:{stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:1,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,magnet:!1,style:{cursor:`move`}},"name-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"attrs-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"methods-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"name-text":{ref:`name-rect`,refY:.5,refX:.5,textAnchor:`middle`,fontWeight:`bold`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:12,pointerEvents:`none`},"attrs-text":{ref:`attrs-rect`,refY:.5,refX:5,textAnchor:`left`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:10,pointerEvents:`none`},"methods-text":{ref:`methods-rect`,refY:.5,refX:5,textAnchor:`left`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:10,pointerEvents:`none`},...x}},C={router:`manhattan`,connector:{name:`rounded`,args:{radius:8}},allowBlank:!1,allowLoop:!1,allowNode:!1,snap:!0,allowEdge:!1},w={magnetAvailable:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}},magnetAdsorbed:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}}},T={shape:`extends`,attrs:{line:{stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2,targetMarker:{name:`block`,width:8,height:6,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}}}},E=[{id:`animal`,name:`<<Abstract>>
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./data2.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`),r=require(`./C_Icon2.cjs`),i=require(`./useGraphExport.cjs`),a=require(`./useEdgeInteraction.cjs`),o=require(`./graphEditSession.cjs`);let s=require(`vue`),c=require(`naive-ui`),l=require(`@antv/x6`);const u={key:0,class:`class-editor`},d={class:`section`},f={class:`section-header`},p={style:{"font-size":`13px`}},m={class:`section`},h={class:`section-header`},g={style:{"font-size":`13px`}},_=(0,s.defineComponent)({__name:`UMLClassEditor`,props:(0,s.mergeModels)({show:{type:Boolean}},{editingClass:{},editingClassModifiers:{}}),emits:(0,s.mergeModels)([`update:show`,`save`,`delete`],[`update:editingClass`]),setup(e,{emit:t}){let n=(0,s.useModel)(e,`editingClass`),i=t;return(t,a)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(c.NDrawer),{show:e.show,width:`450`,title:`编辑类`,"onUpdate:show":a[6]||=e=>i(`update:show`,e)},{default:(0,s.withCtx)(()=>[n.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,u,[(0,s.createVNode)((0,s.unref)(c.NForm),{"label-placement":`top`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`类名`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:n.value.name,"onUpdate:value":a[0]||=e=>n.value.name=e,placeholder:`请输入类名`},null,8,[`value`])]),_:1}),(0,s.createVNode)((0,s.unref)(c.NDivider),{style:{margin:`20px 0`}},{default:(0,s.withCtx)(()=>[...a[7]||=[(0,s.createTextVNode)(`属性`,-1)]]),_:1}),(0,s.createElementVNode)(`div`,d,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(n.value.attributes,(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:t,class:`item`},[(0,s.createVNode)((0,s.unref)(c.NCard),{size:`small`,style:{"margin-bottom":`12px`}},{header:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,f,[(0,s.createElementVNode)(`span`,p,`#`+(0,s.toDisplayString)(t+1)+` `+(0,s.toDisplayString)(e.name||`新属性`),1),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:e=>n.value.attributes.splice(t,1),size:`tiny`,type:`error`,quaternary:``,style:{"margin-left":`auto`}},{default:(0,s.withCtx)(()=>[...a[8]||=[(0,s.createTextVNode)(` 删除 `,-1)]]),_:1},8,[`onClick`])])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),{vertical:``,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`属性名`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`属性名`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`类型`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.type,"onUpdate:value":t=>e.type=t,placeholder:`类型`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`可见性`,style:{margin:`0`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadioGroup),{value:e.visibility,"onUpdate:value":t=>e.visibility=t,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`public`},{default:(0,s.withCtx)(()=>[...a[9]||=[(0,s.createTextVNode)(`+ public`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`private`},{default:(0,s.withCtx)(()=>[...a[10]||=[(0,s.createTextVNode)(`- private`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`protected`},{default:(0,s.withCtx)(()=>[...a[11]||=[(0,s.createTextVNode)(`# protected`,-1)]]),_:1})]),_:1},8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024)]),_:2},1024)]))),128)),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[1]||=e=>n.value.attributes.push({name:`newAttribute`,type:`string`,visibility:`private`}),dashed:``,block:``,type:`primary`,ghost:``,size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:plus`,size:16})]),default:(0,s.withCtx)(()=>[a[12]||=(0,s.createTextVNode)(` 添加属性 `,-1)]),_:1})]),(0,s.createVNode)((0,s.unref)(c.NDivider),{style:{margin:`20px 0`}},{default:(0,s.withCtx)(()=>[...a[13]||=[(0,s.createTextVNode)(`方法`,-1)]]),_:1}),(0,s.createElementVNode)(`div`,m,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(n.value.methods,(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{key:t,class:`item`},[(0,s.createVNode)((0,s.unref)(c.NCard),{size:`small`,style:{"margin-bottom":`12px`}},{header:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,h,[(0,s.createElementVNode)(`span`,g,`#`+(0,s.toDisplayString)(t+1)+` `+(0,s.toDisplayString)(e.name||`新方法`),1),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:e=>n.value.methods.splice(t,1),size:`tiny`,type:`error`,quaternary:``,style:{"margin-left":`auto`}},{default:(0,s.withCtx)(()=>[...a[14]||=[(0,s.createTextVNode)(` 删除 `,-1)]]),_:1},8,[`onClick`])])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),{vertical:``,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`方法名`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`方法名`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`返回类型`,style:{margin:`0`,flex:`1`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:e.returnType,"onUpdate:value":t=>e.returnType=t,placeholder:`返回类型`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024),(0,s.createVNode)((0,s.unref)(c.NFormItem),{label:`可见性`,style:{margin:`0`}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadioGroup),{value:e.visibility,"onUpdate:value":t=>e.visibility=t,size:`small`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`public`},{default:(0,s.withCtx)(()=>[...a[15]||=[(0,s.createTextVNode)(`+ public`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`private`},{default:(0,s.withCtx)(()=>[...a[16]||=[(0,s.createTextVNode)(`- private`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NRadio),{value:`protected`},{default:(0,s.withCtx)(()=>[...a[17]||=[(0,s.createTextVNode)(`# protected`,-1)]]),_:1})]),_:1},8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024)]),_:2},1024)]))),128)),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[2]||=e=>n.value.methods.push({name:`newMethod`,returnType:`void`,visibility:`public`}),dashed:``,block:``,type:`primary`,ghost:``,size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:plus`,size:16})]),default:(0,s.withCtx)(()=>[a[18]||=(0,s.createTextVNode)(` 添加方法 `,-1)]),_:1})]),(0,s.createVNode)((0,s.unref)(c.NDivider),{style:{margin:`20px 0`}}),(0,s.createVNode)((0,s.unref)(c.NSpace),{justify:`space-between`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[3]||=e=>i(`delete`),type:`error`,ghost:``},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:delete`,size:16})]),default:(0,s.withCtx)(()=>[a[19]||=(0,s.createTextVNode)(` 删除类 `,-1)]),_:1}),(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[4]||=e=>i(`update:show`,!1)},{default:(0,s.withCtx)(()=>[...a[20]||=[(0,s.createTextVNode)(`取消`,-1)]]),_:1}),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:a[5]||=e=>i(`save`),type:`primary`},{default:(0,s.withCtx)(()=>[...a[21]||=[(0,s.createTextVNode)(` 保存 `,-1)]]),_:1})]),_:1})]),_:1})]),_:1})])):(0,s.createCommentVNode)(`v-if`,!0)]),_:1},8,[`show`]))}});var v=n.t(_,[[`__scopeId`,`data-v-32abd5a2`]]);const y={public:`+`,private:`-`,protected:`#`},b={extends:{strokeDasharray:0,targetMarker:{name:`block`,width:10,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},implement:{strokeDasharray:`8,4`,targetMarker:{name:`block`,width:10,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},dependency:{strokeDasharray:`6,4`,targetMarker:{name:`classic`,size:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}},composition:{strokeDasharray:0,sourceMarker:{name:`diamond`,width:12,height:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`}},aggregation:{strokeDasharray:0,sourceMarker:{name:`diamond`,width:12,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},association:{strokeDasharray:0,targetMarker:{name:`classic`,size:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}}},x=[`top`,`right`,`bottom`,`left`].reduce((e,t)=>{let n=t===`top`?{refX:.5,refY:0}:t===`right`?{refX:1,refY:.5}:t===`bottom`?{refX:.5,refY:1}:{refX:0,refY:.5};return e[`port-${t}`]={ref:`body`,...n,r:4,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:2,magnet:!0,style:{cursor:`crosshair`,opacity:0,transition:`opacity 0.2s`}},e},{}),S={inherit:`rect`,markup:[{tagName:`rect`,selector:`body`},{tagName:`rect`,selector:`name-rect`},{tagName:`rect`,selector:`attrs-rect`},{tagName:`rect`,selector:`methods-rect`},{tagName:`text`,selector:`name-text`},{tagName:`text`,selector:`attrs-text`},{tagName:`text`,selector:`methods-text`},{tagName:`circle`,selector:`port-top`},{tagName:`circle`,selector:`port-right`},{tagName:`circle`,selector:`port-bottom`},{tagName:`circle`,selector:`port-left`}],attrs:{rect:{width:160},body:{stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:1,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,magnet:!1,style:{cursor:`move`}},"name-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"attrs-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"methods-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"name-text":{ref:`name-rect`,refY:.5,refX:.5,textAnchor:`middle`,fontWeight:`bold`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:12,pointerEvents:`none`},"attrs-text":{ref:`attrs-rect`,refY:.5,refX:5,textAnchor:`left`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:10,pointerEvents:`none`},"methods-text":{ref:`methods-rect`,refY:.5,refX:5,textAnchor:`left`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:10,pointerEvents:`none`},...x}},C={router:`manhattan`,connector:{name:`rounded`,args:{radius:8}},allowBlank:!1,allowLoop:!1,allowNode:!1,snap:!0,allowEdge:!1},w={magnetAvailable:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}},magnetAdsorbed:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}}},T={shape:`extends`,attrs:{line:{stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2,targetMarker:{name:`block`,width:8,height:6,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}}}},E=[{id:`animal`,name:`<<Abstract>>
|
|
2
2
|
动物`,x:342,y:98,attributes:[{name:`名字`,type:`string`,visibility:`public`}],methods:[{name:`新陈代谢`,returnType:`void`,visibility:`public`},{name:`繁殖`,returnType:`void`,visibility:`public`}]},{id:`bird`,name:`鸟`,x:575,y:280,attributes:[{name:`羽毛`,type:`string`,visibility:`public`},{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`mammal`,name:`哺乳动物`,x:844,y:319,attributes:[{name:`翅膀`,type:`boolean`,visibility:`public`}],methods:[]},{id:`dog`,name:`狗`,x:656,y:456,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`enterprise`,name:`企鹅`,x:984,y:456,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`sparrow`,name:`麻雀`,x:531,y:608,attributes:[{name:`学飞`,type:`boolean`,visibility:`public`}],methods:[]},{id:`interface-flying`,name:`<<interface>>
|
|
3
|
-
飞翔`,x:762,y:608,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`qemu`,name:`气球`,x:981,y:608,attributes:[],methods:[]}],D=[{id:`edge-1`,shape:`extends`,source:`bird`,target:`animal`},{id:`edge-2`,shape:`extends`,source:`mammal`,target:`animal`},{id:`edge-3`,shape:`extends`,source:`dog`,target:`mammal`},{id:`edge-4`,shape:`extends`,source:`enterprise`,target:`mammal`},{id:`edge-5`,shape:`extends`,source:`sparrow`,target:`bird`},{id:`edge-6`,shape:`implement`,source:`sparrow`,target:`interface-flying`},{id:`edge-7`,shape:`implement`,source:`enterprise`,target:`interface-flying`},{id:`edge-8`,shape:`association`,source:`bird`,target:`mammal`,label:`1:2`}],O=e=>y[e]||`+`,k={name:`新类`,attributes:[{name:`attribute`,type:`string`,visibility:`private`}],methods:[{name:`method`,returnType:`void`,visibility:`public`}],position:{x:100,y:100}},A={key:0,class:`toolbar`},j=(0,s.defineComponent)({__name:`index`,props:{data:{},showToolbar:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},width:{default:`100%`},height:{default:`600px`},theme:{}},emits:[`ready`,`data-change`],setup(n,{expose:u,emit:d}){let f=n,p=d,m=(0,s.ref)(),h=t.n(()=>f.theme),g=t.t(()=>f.theme),{graph:_,initGraph:y,centerContent:x,zoomToFit:j,scheduleZoomToFit:M}=i.n(m,(0,s.computed)(()=>g.value===`dark`)),{exportOptions:N,handleExport:P}=i.t(_,`uml-diagram`),{bindInteractions:F}=a.t(_,{defaultColor:`var(--c-primary, var(--c-theme-primary, #2080f0))`,portPositions:[`top`,`right`,`bottom`,`left`],onDataChange:()=>
|
|
4
|
-
`):e.text),l.ObjectExt.setByPath(i,`attrs/${e.type}-rect/height`,t),l.ObjectExt.setByPath(i,`attrs/${e.type}-rect/transform`,`translate(0,${a})`),a+=t}),i.size={width:160,height:a},i}},!0),Object.entries(b).forEach(([e,t])=>{l.Graph.registerEdge(e,{inherit:`edge`,attrs:{line:{strokeWidth:2,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,...t}}},!0)})},
|
|
3
|
+
飞翔`,x:762,y:608,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`qemu`,name:`气球`,x:981,y:608,attributes:[],methods:[]}],D=[{id:`edge-1`,shape:`extends`,source:`bird`,target:`animal`},{id:`edge-2`,shape:`extends`,source:`mammal`,target:`animal`},{id:`edge-3`,shape:`extends`,source:`dog`,target:`mammal`},{id:`edge-4`,shape:`extends`,source:`enterprise`,target:`mammal`},{id:`edge-5`,shape:`extends`,source:`sparrow`,target:`bird`},{id:`edge-6`,shape:`implement`,source:`sparrow`,target:`interface-flying`},{id:`edge-7`,shape:`implement`,source:`enterprise`,target:`interface-flying`},{id:`edge-8`,shape:`association`,source:`bird`,target:`mammal`,label:`1:2`}],O=e=>y[e]||`+`,k={name:`新类`,attributes:[{name:`attribute`,type:`string`,visibility:`private`}],methods:[{name:`method`,returnType:`void`,visibility:`public`}],position:{x:100,y:100}},A={key:0,class:`toolbar`},j=(0,s.defineComponent)({__name:`index`,props:{data:{},showToolbar:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},width:{default:`100%`},height:{default:`600px`},theme:{}},emits:[`ready`,`data-change`],setup(n,{expose:u,emit:d}){let f=n,p=d,m=(0,s.ref)(),h=t.n(()=>f.theme),g=t.t(()=>f.theme),{graph:_,initGraph:y,centerContent:x,zoomToFit:j,scheduleZoomToFit:M}=i.n(m,(0,s.computed)(()=>g.value===`dark`)),{exportOptions:N,handleExport:P}=i.t(_,`uml-diagram`),{bindInteractions:F}=a.t(_,{defaultColor:`var(--c-primary, var(--c-theme-primary, #2080f0))`,portPositions:[`top`,`right`,`bottom`,`left`],onDataChange:()=>q(),isReadonly:()=>f.readonly}),I=(0,s.ref)(!1),L=(0,s.ref)(),R=o.t(e=>K().classes.find(t=>t.id===e),e=>f.data?.classes.find(t=>t.id===e),()=>{I.value=!1,L.value=void 0}),z=()=>{l.Graph.registerNode(`class`,{...S,propHooks(e){let{name:t,attributes:n,methods:r,...i}=e;if(!(t&&n&&r))return e;let a=0;return[{type:`name`,text:t},{type:`attrs`,text:n},{type:`methods`,text:r}].forEach(e=>{let t=Array.isArray(e.text)?e.text.length*12+16:32;l.ObjectExt.setByPath(i,`attrs/${e.type}-text/text`,Array.isArray(e.text)?e.text.join(`
|
|
4
|
+
`):e.text),l.ObjectExt.setByPath(i,`attrs/${e.type}-rect/height`,t),l.ObjectExt.setByPath(i,`attrs/${e.type}-rect/transform`,`translate(0,${a})`),a+=t}),i.size={width:160,height:a},i}},!0),Object.entries(b).forEach(([e,t])=>{l.Graph.registerEdge(e,{inherit:`edge`,attrs:{line:{strokeWidth:2,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,...t}}},!0)})},B=t=>{if(!_.value)return;let n=[`extends`,`composition`,`implement`,`dependency`,`aggregation`,`association`],r=[];t.forEach(t=>{if(n.includes(t.shape)){let n=_.value.createEdge(t);t.data&&n.setData(e.t(t.data)),r.push(n)}else{let{data:n,...i}=t,a=_.value.createNode(i);n&&a.setData(e.t(n)),r.push(a)}}),_.value.resetCells(r),r.length&&M(200,10)},V=e=>({name:e.name,attributes:e.attributes.map(e=>`${O(e.visibility)} ${e.name}: ${e.type}`),methods:e.methods.map(e=>`${O(e.visibility)} ${e.name}(): ${e.returnType}`)}),H=()=>{if(f.readonly||!_.value)return;let t={id:`class_${Date.now()}`,...e.t(k)},n={id:t.id,shape:`class`,x:t.position.x,y:t.position.y,...V(t),data:t};_.value.addCell(_.value.createNode(n)),q()},U=t=>{f.readonly||(R.begin(t.id),L.value=e.t(t),I.value=!0)},W=()=>{let t=L.value;if(f.readonly||!I.value||!_.value||!t||!R.consume(t.id))return;let n=_.value.getCellById(t.id);n.setData(e.t(t)),n.prop(V(t)),q()},G=()=>{let e=L.value;f.readonly||!I.value||!_.value||!e||R.consume(e.id)&&(_.value.getCellById(e.id)?.remove(),q())},K=()=>({classes:_.value?.getNodes().map(t=>({...e.t(t.getData()),position:t.getPosition()}))||[],relations:_.value?.getEdges().map(e=>{let t=e.getData();return{id:e.id,type:e.shape===`extends`?`inheritance`:e.shape===`implement`?`implementation`:e.shape,source:e.getSourceCellId()||``,target:e.getTargetCellId()||``,name:t?.name,multiplicity:t?.multiplicity}})||[]}),q=()=>{f.readonly||p(`data-change`,K())},J=e=>{B([...e.classes.map(e=>({id:e.id,shape:`class`,x:e.position?.x??50,y:e.position?.y??50,...V(e),data:e})),...e.relations.map(e=>({id:e.id,shape:e.type===`inheritance`?`extends`:e.type===`implementation`?`implement`:e.type,source:e.source,target:e.target,data:{name:e.name,multiplicity:e.multiplicity}}))])};return(0,s.watch)(_,e=>{if(!(e instanceof l.Graph))return;z(),o.n(e,()=>f.readonly),F(),e.on(`node:dblclick`,({node:e})=>{!f.readonly&&e.getData()&&U(e.getData())}),e.on(`node:moved`,q),p(`ready`,e);let t=[...E.map(e=>({id:e.id,shape:`class`,x:e.x,y:e.y,...V(e),data:{id:e.id,name:e.name,attributes:e.attributes,methods:e.methods,position:{x:e.x,y:e.y}}})),...D];f.data?J(f.data):B(t)},{immediate:!0}),(0,s.watch)(()=>f.data,e=>{_.value&&e&&(J(e),R.validate())},{deep:!0}),(0,s.watch)(()=>f.readonly,e=>{e&&R.close()},{flush:`sync`}),(0,s.onMounted)(()=>{y({interacting:()=>!f.readonly,connecting:{...C,validateMagnet:()=>!f.readonly,validateEdge:()=>!f.readonly,createEdge:()=>_.value.createEdge(T),validateConnection:({sourceView:e,targetView:t,sourceMagnet:n,targetMagnet:r})=>!f.readonly&&e!==t&&!!n&&!!r&&n.getAttribute(`magnet`)===`true`&&r.getAttribute(`magnet`)===`true`},highlighting:w})}),u({getGraph:()=>_.value,getData:K,addClass:H,centerContent:x,zoomToFit:j}),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:`uml-layout`,style:(0,s.normalizeStyle)((0,s.unref)(h))},[n.showToolbar?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,A,[(0,s.createVNode)((0,s.unref)(c.NSpace),null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:H,disabled:n.readonly,type:`primary`,size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:plus-box`,size:16})]),default:(0,s.withCtx)(()=>[t[3]||=(0,s.createTextVNode)(` 添加类 `,-1)]),_:1},8,[`disabled`]),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:(0,s.unref)(x),size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:image-filter-center-focus`,size:16})]),default:(0,s.withCtx)(()=>[t[4]||=(0,s.createTextVNode)(` 居中 `,-1)]),_:1},8,[`onClick`]),(0,s.createVNode)((0,s.unref)(c.NButton),{onClick:(0,s.unref)(j),size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:fit-to-screen`,size:16})]),default:(0,s.withCtx)(()=>[t[5]||=(0,s.createTextVNode)(` 适应 `,-1)]),_:1},8,[`onClick`]),(0,s.createVNode)((0,s.unref)(c.NDropdown),{options:(0,s.unref)(N),onSelect:t[0]||=e=>(0,s.unref)(P)(e,K)},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NButton),{size:`small`},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(r.t,{name:`mdi:export`,size:16})]),default:(0,s.withCtx)(()=>[t[6]||=(0,s.createTextVNode)(` 导出 `,-1)]),_:1})]),_:1},8,[`options`])]),_:1})])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,{ref_key:`containerRef`,ref:m,class:`graph-container`,style:(0,s.normalizeStyle)({width:f.width,height:f.height})},null,4),(0,s.createVNode)(v,{style:(0,s.normalizeStyle)((0,s.unref)(h)),show:I.value,"editing-class":L.value,"onUpdate:editingClass":t[1]||=e=>L.value=e,"onUpdate:show":t[2]||=e=>I.value=e,onSave:W,onDelete:G},null,8,[`style`,`show`,`editing-class`])],4))}});var M=n.t(j,[[`__scopeId`,`data-v-93a36e3e`]]);exports.default=M;
|
package/dist/UML.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./data2.js";import{n as t,t as n}from"./useComponentTheme.js";import{t as r}from"./export-helper.js";import{t as i}from"./C_Icon2.js";import{n as a,t as
|
|
1
|
+
import{t as e}from"./data2.js";import{n as t,t as n}from"./useComponentTheme.js";import{t as r}from"./export-helper.js";import{t as i}from"./C_Icon2.js";import{n as a,t as o}from"./useGraphExport.js";import{t as ee}from"./useEdgeInteraction.js";import{n as s,t as c}from"./graphEditSession.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createTextVNode as h,createVNode as g,defineComponent as _,mergeModels as v,normalizeStyle as y,onMounted as te,openBlock as b,ref as x,renderList as S,toDisplayString as C,unref as w,useModel as T,watch as E,withCtx as D}from"vue";import{NButton as O,NCard as k,NDivider as A,NDrawer as j,NDropdown as ne,NForm as M,NFormItem as N,NInput as P,NRadio as F,NRadioGroup as I,NSpace as L}from"naive-ui";import{Graph as R,ObjectExt as z}from"@antv/x6";const B={key:0,class:`class-editor`},V={class:`section`},H={class:`section-header`},U={style:{"font-size":`13px`}},W={class:`section`},G={class:`section-header`},K={style:{"font-size":`13px`}};var re=r(_({__name:`UMLClassEditor`,props:v({show:{type:Boolean}},{editingClass:{},editingClassModifiers:{}}),emits:v([`update:show`,`save`,`delete`],[`update:editingClass`]),setup(e,{emit:t}){let n=T(e,`editingClass`),r=t;return(t,a)=>(b(),d(w(j),{show:e.show,width:`450`,title:`编辑类`,"onUpdate:show":a[6]||=e=>r(`update:show`,e)},{default:D(()=>[n.value?(b(),p(`div`,B,[g(w(M),{"label-placement":`top`},{default:D(()=>[g(w(N),{label:`类名`},{default:D(()=>[g(w(P),{value:n.value.name,"onUpdate:value":a[0]||=e=>n.value.name=e,placeholder:`请输入类名`},null,8,[`value`])]),_:1}),g(w(A),{style:{margin:`20px 0`}},{default:D(()=>[...a[7]||=[h(`属性`,-1)]]),_:1}),m(`div`,V,[(b(!0),p(l,null,S(n.value.attributes,(e,t)=>(b(),p(`div`,{key:t,class:`item`},[g(w(k),{size:`small`,style:{"margin-bottom":`12px`}},{header:D(()=>[m(`div`,H,[m(`span`,U,`#`+C(t+1)+` `+C(e.name||`新属性`),1),g(w(O),{onClick:e=>n.value.attributes.splice(t,1),size:`tiny`,type:`error`,quaternary:``,style:{"margin-left":`auto`}},{default:D(()=>[...a[8]||=[h(` 删除 `,-1)]]),_:1},8,[`onClick`])])]),default:D(()=>[g(w(L),{vertical:``,size:`small`},{default:D(()=>[g(w(L),null,{default:D(()=>[g(w(N),{label:`属性名`,style:{margin:`0`,flex:`1`}},{default:D(()=>[g(w(P),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`属性名`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),g(w(N),{label:`类型`,style:{margin:`0`,flex:`1`}},{default:D(()=>[g(w(P),{value:e.type,"onUpdate:value":t=>e.type=t,placeholder:`类型`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024),g(w(N),{label:`可见性`,style:{margin:`0`}},{default:D(()=>[g(w(I),{value:e.visibility,"onUpdate:value":t=>e.visibility=t,size:`small`},{default:D(()=>[g(w(F),{value:`public`},{default:D(()=>[...a[9]||=[h(`+ public`,-1)]]),_:1}),g(w(F),{value:`private`},{default:D(()=>[...a[10]||=[h(`- private`,-1)]]),_:1}),g(w(F),{value:`protected`},{default:D(()=>[...a[11]||=[h(`# protected`,-1)]]),_:1})]),_:1},8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024)]),_:2},1024)]))),128)),g(w(O),{onClick:a[1]||=e=>n.value.attributes.push({name:`newAttribute`,type:`string`,visibility:`private`}),dashed:``,block:``,type:`primary`,ghost:``,size:`small`},{icon:D(()=>[g(i,{name:`mdi:plus`,size:16})]),default:D(()=>[a[12]||=h(` 添加属性 `,-1)]),_:1})]),g(w(A),{style:{margin:`20px 0`}},{default:D(()=>[...a[13]||=[h(`方法`,-1)]]),_:1}),m(`div`,W,[(b(!0),p(l,null,S(n.value.methods,(e,t)=>(b(),p(`div`,{key:t,class:`item`},[g(w(k),{size:`small`,style:{"margin-bottom":`12px`}},{header:D(()=>[m(`div`,G,[m(`span`,K,`#`+C(t+1)+` `+C(e.name||`新方法`),1),g(w(O),{onClick:e=>n.value.methods.splice(t,1),size:`tiny`,type:`error`,quaternary:``,style:{"margin-left":`auto`}},{default:D(()=>[...a[14]||=[h(` 删除 `,-1)]]),_:1},8,[`onClick`])])]),default:D(()=>[g(w(L),{vertical:``,size:`small`},{default:D(()=>[g(w(L),null,{default:D(()=>[g(w(N),{label:`方法名`,style:{margin:`0`,flex:`1`}},{default:D(()=>[g(w(P),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`方法名`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),g(w(N),{label:`返回类型`,style:{margin:`0`,flex:`1`}},{default:D(()=>[g(w(P),{value:e.returnType,"onUpdate:value":t=>e.returnType=t,placeholder:`返回类型`,size:`small`},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024),g(w(N),{label:`可见性`,style:{margin:`0`}},{default:D(()=>[g(w(I),{value:e.visibility,"onUpdate:value":t=>e.visibility=t,size:`small`},{default:D(()=>[g(w(F),{value:`public`},{default:D(()=>[...a[15]||=[h(`+ public`,-1)]]),_:1}),g(w(F),{value:`private`},{default:D(()=>[...a[16]||=[h(`- private`,-1)]]),_:1}),g(w(F),{value:`protected`},{default:D(()=>[...a[17]||=[h(`# protected`,-1)]]),_:1})]),_:1},8,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1024)]),_:2},1024)]))),128)),g(w(O),{onClick:a[2]||=e=>n.value.methods.push({name:`newMethod`,returnType:`void`,visibility:`public`}),dashed:``,block:``,type:`primary`,ghost:``,size:`small`},{icon:D(()=>[g(i,{name:`mdi:plus`,size:16})]),default:D(()=>[a[18]||=h(` 添加方法 `,-1)]),_:1})]),g(w(A),{style:{margin:`20px 0`}}),g(w(L),{justify:`space-between`},{default:D(()=>[g(w(O),{onClick:a[3]||=e=>r(`delete`),type:`error`,ghost:``},{icon:D(()=>[g(i,{name:`mdi:delete`,size:16})]),default:D(()=>[a[19]||=h(` 删除类 `,-1)]),_:1}),g(w(L),null,{default:D(()=>[g(w(O),{onClick:a[4]||=e=>r(`update:show`,!1)},{default:D(()=>[...a[20]||=[h(`取消`,-1)]]),_:1}),g(w(O),{onClick:a[5]||=e=>r(`save`),type:`primary`},{default:D(()=>[...a[21]||=[h(` 保存 `,-1)]]),_:1})]),_:1})]),_:1})]),_:1})])):f(`v-if`,!0)]),_:1},8,[`show`]))}}),[[`__scopeId`,`data-v-32abd5a2`]]);const q={public:`+`,private:`-`,protected:`#`},ie={extends:{strokeDasharray:0,targetMarker:{name:`block`,width:10,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},implement:{strokeDasharray:`8,4`,targetMarker:{name:`block`,width:10,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},dependency:{strokeDasharray:`6,4`,targetMarker:{name:`classic`,size:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}},composition:{strokeDasharray:0,sourceMarker:{name:`diamond`,width:12,height:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`}},aggregation:{strokeDasharray:0,sourceMarker:{name:`diamond`,width:12,height:8,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2}},association:{strokeDasharray:0,targetMarker:{name:`classic`,size:8,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}}},J=[`top`,`right`,`bottom`,`left`].reduce((e,t)=>{let n=t===`top`?{refX:.5,refY:0}:t===`right`?{refX:1,refY:.5}:t===`bottom`?{refX:.5,refY:1}:{refX:0,refY:.5};return e[`port-${t}`]={ref:`body`,...n,r:4,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:2,magnet:!0,style:{cursor:`crosshair`,opacity:0,transition:`opacity 0.2s`}},e},{}),ae={inherit:`rect`,markup:[{tagName:`rect`,selector:`body`},{tagName:`rect`,selector:`name-rect`},{tagName:`rect`,selector:`attrs-rect`},{tagName:`rect`,selector:`methods-rect`},{tagName:`text`,selector:`name-text`},{tagName:`text`,selector:`attrs-text`},{tagName:`text`,selector:`methods-text`},{tagName:`circle`,selector:`port-top`},{tagName:`circle`,selector:`port-right`},{tagName:`circle`,selector:`port-bottom`},{tagName:`circle`,selector:`port-left`}],attrs:{rect:{width:160},body:{stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:1,fill:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,magnet:!1,style:{cursor:`move`}},"name-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"attrs-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"methods-rect":{fill:`var(--c-bg-muted, var(--c-theme-bg-muted, #f1f5f9))`,stroke:`var(--c-bg-card, var(--c-theme-bg-card, #fff))`,strokeWidth:.5,magnet:!1,style:{cursor:`move`}},"name-text":{ref:`name-rect`,refY:.5,refX:.5,textAnchor:`middle`,fontWeight:`bold`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:12,pointerEvents:`none`},"attrs-text":{ref:`attrs-rect`,refY:.5,refX:5,textAnchor:`left`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:10,pointerEvents:`none`},"methods-text":{ref:`methods-rect`,refY:.5,refX:5,textAnchor:`left`,fill:`var(--c-text-1, var(--c-theme-text-1, #262626))`,fontSize:10,pointerEvents:`none`},...J}},oe={router:`manhattan`,connector:{name:`rounded`,args:{radius:8}},allowBlank:!1,allowLoop:!1,allowNode:!1,snap:!0,allowEdge:!1},se={magnetAvailable:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}},magnetAdsorbed:{name:`stroke`,args:{attrs:{fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,opacity:1}}}},ce={shape:`extends`,attrs:{line:{stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,strokeWidth:2,targetMarker:{name:`block`,width:8,height:6,fill:`var(--c-primary, var(--c-theme-primary, #2080f0))`}}}},le=[{id:`animal`,name:`<<Abstract>>
|
|
2
2
|
动物`,x:342,y:98,attributes:[{name:`名字`,type:`string`,visibility:`public`}],methods:[{name:`新陈代谢`,returnType:`void`,visibility:`public`},{name:`繁殖`,returnType:`void`,visibility:`public`}]},{id:`bird`,name:`鸟`,x:575,y:280,attributes:[{name:`羽毛`,type:`string`,visibility:`public`},{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`mammal`,name:`哺乳动物`,x:844,y:319,attributes:[{name:`翅膀`,type:`boolean`,visibility:`public`}],methods:[]},{id:`dog`,name:`狗`,x:656,y:456,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`enterprise`,name:`企鹅`,x:984,y:456,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`sparrow`,name:`麻雀`,x:531,y:608,attributes:[{name:`学飞`,type:`boolean`,visibility:`public`}],methods:[]},{id:`interface-flying`,name:`<<interface>>
|
|
3
|
-
飞翔`,x:762,y:608,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`qemu`,name:`气球`,x:981,y:608,attributes:[],methods:[]}],
|
|
4
|
-
`):e.text),
|
|
3
|
+
飞翔`,x:762,y:608,attributes:[{name:`下蛋`,type:`boolean`,visibility:`public`}],methods:[]},{id:`qemu`,name:`气球`,x:981,y:608,attributes:[],methods:[]}],ue=[{id:`edge-1`,shape:`extends`,source:`bird`,target:`animal`},{id:`edge-2`,shape:`extends`,source:`mammal`,target:`animal`},{id:`edge-3`,shape:`extends`,source:`dog`,target:`mammal`},{id:`edge-4`,shape:`extends`,source:`enterprise`,target:`mammal`},{id:`edge-5`,shape:`extends`,source:`sparrow`,target:`bird`},{id:`edge-6`,shape:`implement`,source:`sparrow`,target:`interface-flying`},{id:`edge-7`,shape:`implement`,source:`enterprise`,target:`interface-flying`},{id:`edge-8`,shape:`association`,source:`bird`,target:`mammal`,label:`1:2`}],Y=e=>q[e]||`+`,de={name:`新类`,attributes:[{name:`attribute`,type:`string`,visibility:`private`}],methods:[{name:`method`,returnType:`void`,visibility:`public`}],position:{x:100,y:100}},fe={key:0,class:`toolbar`};var X=r(_({__name:`index`,props:{data:{},showToolbar:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},width:{default:`100%`},height:{default:`600px`},theme:{}},emits:[`ready`,`data-change`],setup(r,{expose:l,emit:d}){let _=r,v=d,S=x(),C=t(()=>_.theme),T=n(()=>_.theme),{graph:k,initGraph:A,centerContent:j,zoomToFit:M,scheduleZoomToFit:N}=a(S,u(()=>T.value===`dark`)),{exportOptions:P,handleExport:F}=o(k,`uml-diagram`),{bindInteractions:I}=ee(k,{defaultColor:`var(--c-primary, var(--c-theme-primary, #2080f0))`,portPositions:[`top`,`right`,`bottom`,`left`],onDataChange:()=>Q(),isReadonly:()=>_.readonly}),B=x(!1),V=x(),H=c(e=>Z().classes.find(t=>t.id===e),e=>_.data?.classes.find(t=>t.id===e),()=>{B.value=!1,V.value=void 0}),U=()=>{R.registerNode(`class`,{...ae,propHooks(e){let{name:t,attributes:n,methods:r,...i}=e;if(!(t&&n&&r))return e;let a=0;return[{type:`name`,text:t},{type:`attrs`,text:n},{type:`methods`,text:r}].forEach(e=>{let t=Array.isArray(e.text)?e.text.length*12+16:32;z.setByPath(i,`attrs/${e.type}-text/text`,Array.isArray(e.text)?e.text.join(`
|
|
4
|
+
`):e.text),z.setByPath(i,`attrs/${e.type}-rect/height`,t),z.setByPath(i,`attrs/${e.type}-rect/transform`,`translate(0,${a})`),a+=t}),i.size={width:160,height:a},i}},!0),Object.entries(ie).forEach(([e,t])=>{R.registerEdge(e,{inherit:`edge`,attrs:{line:{strokeWidth:2,stroke:`var(--c-primary, var(--c-theme-primary, #2080f0))`,...t}}},!0)})},W=t=>{if(!k.value)return;let n=[`extends`,`composition`,`implement`,`dependency`,`aggregation`,`association`],r=[];t.forEach(t=>{if(n.includes(t.shape)){let n=k.value.createEdge(t);t.data&&n.setData(e(t.data)),r.push(n)}else{let{data:n,...i}=t,a=k.value.createNode(i);n&&a.setData(e(n)),r.push(a)}}),k.value.resetCells(r),r.length&&N(200,10)},G=e=>({name:e.name,attributes:e.attributes.map(e=>`${Y(e.visibility)} ${e.name}: ${e.type}`),methods:e.methods.map(e=>`${Y(e.visibility)} ${e.name}(): ${e.returnType}`)}),K=()=>{if(_.readonly||!k.value)return;let t={id:`class_${Date.now()}`,...e(de)},n={id:t.id,shape:`class`,x:t.position.x,y:t.position.y,...G(t),data:t};k.value.addCell(k.value.createNode(n)),Q()},q=t=>{_.readonly||(H.begin(t.id),V.value=e(t),B.value=!0)},J=()=>{let t=V.value;if(_.readonly||!B.value||!k.value||!t||!H.consume(t.id))return;let n=k.value.getCellById(t.id);n.setData(e(t)),n.prop(G(t)),Q()},X=()=>{let e=V.value;_.readonly||!B.value||!k.value||!e||H.consume(e.id)&&(k.value.getCellById(e.id)?.remove(),Q())},Z=()=>({classes:k.value?.getNodes().map(t=>({...e(t.getData()),position:t.getPosition()}))||[],relations:k.value?.getEdges().map(e=>{let t=e.getData();return{id:e.id,type:e.shape===`extends`?`inheritance`:e.shape===`implement`?`implementation`:e.shape,source:e.getSourceCellId()||``,target:e.getTargetCellId()||``,name:t?.name,multiplicity:t?.multiplicity}})||[]}),Q=()=>{_.readonly||v(`data-change`,Z())},$=e=>{W([...e.classes.map(e=>({id:e.id,shape:`class`,x:e.position?.x??50,y:e.position?.y??50,...G(e),data:e})),...e.relations.map(e=>({id:e.id,shape:e.type===`inheritance`?`extends`:e.type===`implementation`?`implement`:e.type,source:e.source,target:e.target,data:{name:e.name,multiplicity:e.multiplicity}}))])};return E(k,e=>{if(!(e instanceof R))return;U(),s(e,()=>_.readonly),I(),e.on(`node:dblclick`,({node:e})=>{!_.readonly&&e.getData()&&q(e.getData())}),e.on(`node:moved`,Q),v(`ready`,e);let t=[...le.map(e=>({id:e.id,shape:`class`,x:e.x,y:e.y,...G(e),data:{id:e.id,name:e.name,attributes:e.attributes,methods:e.methods,position:{x:e.x,y:e.y}}})),...ue];_.data?$(_.data):W(t)},{immediate:!0}),E(()=>_.data,e=>{k.value&&e&&($(e),H.validate())},{deep:!0}),E(()=>_.readonly,e=>{e&&H.close()},{flush:`sync`}),te(()=>{A({interacting:()=>!_.readonly,connecting:{...oe,validateMagnet:()=>!_.readonly,validateEdge:()=>!_.readonly,createEdge:()=>k.value.createEdge(ce),validateConnection:({sourceView:e,targetView:t,sourceMagnet:n,targetMagnet:r})=>!_.readonly&&e!==t&&!!n&&!!r&&n.getAttribute(`magnet`)===`true`&&r.getAttribute(`magnet`)===`true`},highlighting:se})}),l({getGraph:()=>k.value,getData:Z,addClass:K,centerContent:j,zoomToFit:M}),(e,t)=>(b(),p(`div`,{class:`uml-layout`,style:y(w(C))},[r.showToolbar?(b(),p(`div`,fe,[g(w(L),null,{default:D(()=>[g(w(O),{onClick:K,disabled:r.readonly,type:`primary`,size:`small`},{icon:D(()=>[g(i,{name:`mdi:plus-box`,size:16})]),default:D(()=>[t[3]||=h(` 添加类 `,-1)]),_:1},8,[`disabled`]),g(w(O),{onClick:w(j),size:`small`},{icon:D(()=>[g(i,{name:`mdi:image-filter-center-focus`,size:16})]),default:D(()=>[t[4]||=h(` 居中 `,-1)]),_:1},8,[`onClick`]),g(w(O),{onClick:w(M),size:`small`},{icon:D(()=>[g(i,{name:`mdi:fit-to-screen`,size:16})]),default:D(()=>[t[5]||=h(` 适应 `,-1)]),_:1},8,[`onClick`]),g(w(ne),{options:w(P),onSelect:t[0]||=e=>w(F)(e,Z)},{default:D(()=>[g(w(O),{size:`small`},{icon:D(()=>[g(i,{name:`mdi:export`,size:16})]),default:D(()=>[t[6]||=h(` 导出 `,-1)]),_:1})]),_:1},8,[`options`])]),_:1})])):f(`v-if`,!0),m(`div`,{ref_key:`containerRef`,ref:S,class:`graph-container`,style:y({width:_.width,height:_.height})},null,4),g(re,{style:y(w(C)),show:B.value,"editing-class":V.value,"onUpdate:editingClass":t[1]||=e=>V.value=e,"onUpdate:show":t[2]||=e=>B.value=e,onSave:J,onDelete:X},null,8,[`style`,`show`,`editing-class`])],4))}}),[[`__scopeId`,`data-v-93a36e3e`]]);export{X as default};
|
|
@@ -1096,6 +1096,8 @@ interface UseTableExpandReturn<T extends object = DataRecord, C = DataRecord> {
|
|
|
1096
1096
|
clearSelection: () => void;
|
|
1097
1097
|
clearAllSelections: () => void;
|
|
1098
1098
|
handleSelectionChange: (keys: DataTableRowKey[]) => void;
|
|
1099
|
+
/** 原生子表与公开选择方法共用的资格校验、父子联动和事件提交入口。 */
|
|
1100
|
+
handleChildSelectionChange: (parentKey: DataTableRowKey, childKeys: DataTableRowKey[]) => void;
|
|
1099
1101
|
getTableColumns: (originalColumns: TableColumn<T>[]) => unknown[];
|
|
1100
1102
|
}
|
|
1101
1103
|
/** 行操作按钮配置 */
|
package/dist/constants.d.cts
CHANGED
|
@@ -117,8 +117,8 @@ declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {
|
|
|
117
117
|
"onValidation-change"?: ((result: CronValidation) => any) | undefined;
|
|
118
118
|
}>, {
|
|
119
119
|
disabled: boolean;
|
|
120
|
-
showPreview: boolean;
|
|
121
120
|
showTemplates: boolean;
|
|
121
|
+
showPreview: boolean;
|
|
122
122
|
showSecond: boolean;
|
|
123
123
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
124
124
|
declare const _default: typeof __VLS_export;
|
package/dist/constants.d.ts
CHANGED
|
@@ -117,8 +117,8 @@ declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {
|
|
|
117
117
|
"onValidation-change"?: ((result: CronValidation) => any) | undefined;
|
|
118
118
|
}>, {
|
|
119
119
|
disabled: boolean;
|
|
120
|
-
showPreview: boolean;
|
|
121
120
|
showTemplates: boolean;
|
|
121
|
+
showPreview: boolean;
|
|
122
122
|
showSecond: boolean;
|
|
123
123
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
124
124
|
declare const _default: typeof __VLS_export;
|
package/dist/constants3.d.cts
CHANGED
|
@@ -230,32 +230,32 @@ interface NotificationCenterExpose {
|
|
|
230
230
|
//#region src/components/C_NotificationCenter/index.vue.d.ts
|
|
231
231
|
type __VLS_Slots = NotificationCenterSlots;
|
|
232
232
|
declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
233
|
-
itemClick: (message: NotificationMessage) => any;
|
|
234
233
|
delete: (ids: string[]) => any;
|
|
235
|
-
|
|
234
|
+
itemClick: (message: NotificationMessage) => any;
|
|
236
235
|
read: (ids: string[]) => any;
|
|
237
236
|
allRead: (category?: NotificationCategory | undefined) => any;
|
|
238
237
|
unreadChange: (count: number) => any;
|
|
239
238
|
wsStatusChange: (status: WSConnectionStatus) => any;
|
|
240
239
|
newMessage: (message: NotificationMessage) => any;
|
|
240
|
+
navigate: (url: string) => any;
|
|
241
241
|
viewAll: () => any;
|
|
242
242
|
}, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
|
|
243
|
-
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
244
243
|
onDelete?: ((ids: string[]) => any) | undefined;
|
|
245
|
-
|
|
244
|
+
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
246
245
|
onRead?: ((ids: string[]) => any) | undefined;
|
|
247
246
|
onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
|
|
248
247
|
onUnreadChange?: ((count: number) => any) | undefined;
|
|
249
248
|
onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
|
|
250
249
|
onNewMessage?: ((message: NotificationMessage) => any) | undefined;
|
|
250
|
+
onNavigate?: ((url: string) => any) | undefined;
|
|
251
251
|
onViewAll?: (() => any) | undefined;
|
|
252
252
|
}>, {
|
|
253
|
-
pageSize: number;
|
|
254
|
-
storageKey: string;
|
|
255
253
|
autoStart: boolean;
|
|
256
254
|
desktopNotification: boolean;
|
|
257
255
|
maxBadgeCount: number;
|
|
258
256
|
pollingInterval: number;
|
|
257
|
+
pageSize: number;
|
|
258
|
+
storageKey: string;
|
|
259
259
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
260
260
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
261
261
|
declare const _default: typeof __VLS_export;
|
package/dist/constants3.d.ts
CHANGED
|
@@ -230,32 +230,32 @@ interface NotificationCenterExpose {
|
|
|
230
230
|
//#region src/components/C_NotificationCenter/index.vue.d.ts
|
|
231
231
|
type __VLS_Slots = NotificationCenterSlots;
|
|
232
232
|
declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
233
|
-
itemClick: (message: NotificationMessage) => any;
|
|
234
233
|
delete: (ids: string[]) => any;
|
|
235
|
-
|
|
234
|
+
itemClick: (message: NotificationMessage) => any;
|
|
236
235
|
read: (ids: string[]) => any;
|
|
237
236
|
allRead: (category?: NotificationCategory | undefined) => any;
|
|
238
237
|
unreadChange: (count: number) => any;
|
|
239
238
|
wsStatusChange: (status: WSConnectionStatus) => any;
|
|
240
239
|
newMessage: (message: NotificationMessage) => any;
|
|
240
|
+
navigate: (url: string) => any;
|
|
241
241
|
viewAll: () => any;
|
|
242
242
|
}, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
|
|
243
|
-
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
244
243
|
onDelete?: ((ids: string[]) => any) | undefined;
|
|
245
|
-
|
|
244
|
+
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
246
245
|
onRead?: ((ids: string[]) => any) | undefined;
|
|
247
246
|
onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
|
|
248
247
|
onUnreadChange?: ((count: number) => any) | undefined;
|
|
249
248
|
onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
|
|
250
249
|
onNewMessage?: ((message: NotificationMessage) => any) | undefined;
|
|
250
|
+
onNavigate?: ((url: string) => any) | undefined;
|
|
251
251
|
onViewAll?: (() => any) | undefined;
|
|
252
252
|
}>, {
|
|
253
|
-
pageSize: number;
|
|
254
|
-
storageKey: string;
|
|
255
253
|
autoStart: boolean;
|
|
256
254
|
desktopNotification: boolean;
|
|
257
255
|
maxBadgeCount: number;
|
|
258
256
|
pollingInterval: number;
|
|
257
|
+
pageSize: number;
|
|
258
|
+
storageKey: string;
|
|
259
259
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
260
260
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
261
261
|
declare const _default: typeof __VLS_export;
|
package/dist/constants4.d.cts
CHANGED
|
@@ -198,27 +198,27 @@ type __VLS_Slots = {} & {
|
|
|
198
198
|
area?: (props: typeof __VLS_11) => any;
|
|
199
199
|
};
|
|
200
200
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
201
|
-
change: (fileList: UploadFileItem[]) => any;
|
|
202
201
|
error: (file: UploadFileItem, error: Error) => any;
|
|
203
|
-
progress: (file: UploadFileItem, percent: number) => any;
|
|
204
202
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
203
|
+
change: (fileList: UploadFileItem[]) => any;
|
|
204
|
+
progress: (file: UploadFileItem, percent: number) => any;
|
|
205
205
|
remove: (file: UploadFileItem) => any;
|
|
206
206
|
finish: (fileList: UploadFileItem[]) => any;
|
|
207
207
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
208
208
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
209
|
-
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
210
209
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
211
|
-
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
212
210
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
211
|
+
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
212
|
+
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
213
213
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
214
214
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
215
215
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
216
216
|
}>, {
|
|
217
217
|
data: Record<string, unknown>;
|
|
218
218
|
disabled: boolean;
|
|
219
|
-
multiple: boolean;
|
|
220
219
|
draggable: boolean;
|
|
221
220
|
action: string;
|
|
221
|
+
multiple: boolean;
|
|
222
222
|
headers: Record<string, string>;
|
|
223
223
|
directory: boolean;
|
|
224
224
|
accept: string;
|
package/dist/constants4.d.ts
CHANGED
|
@@ -199,27 +199,27 @@ type __VLS_Slots = {} & {
|
|
|
199
199
|
area?: (props: typeof __VLS_11) => any;
|
|
200
200
|
};
|
|
201
201
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
202
|
-
change: (fileList: UploadFileItem[]) => any;
|
|
203
202
|
error: (file: UploadFileItem, error: Error) => any;
|
|
204
|
-
progress: (file: UploadFileItem, percent: number) => any;
|
|
205
203
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
204
|
+
change: (fileList: UploadFileItem[]) => any;
|
|
205
|
+
progress: (file: UploadFileItem, percent: number) => any;
|
|
206
206
|
remove: (file: UploadFileItem) => any;
|
|
207
207
|
finish: (fileList: UploadFileItem[]) => any;
|
|
208
208
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
209
209
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
210
|
-
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
211
210
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
212
|
-
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
213
211
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
212
|
+
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
213
|
+
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
214
214
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
215
215
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
216
216
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
217
217
|
}>, {
|
|
218
218
|
data: Record<string, unknown>;
|
|
219
219
|
disabled: boolean;
|
|
220
|
-
multiple: boolean;
|
|
221
220
|
draggable: boolean;
|
|
222
221
|
action: string;
|
|
222
|
+
multiple: boolean;
|
|
223
223
|
headers: Record<string, string>;
|
|
224
224
|
directory: boolean;
|
|
225
225
|
accept: string;
|
package/dist/context.d.cts
CHANGED
|
@@ -1089,6 +1089,8 @@ interface UseTableExpandReturn<T extends object = DataRecord, C = DataRecord> {
|
|
|
1089
1089
|
clearSelection: () => void;
|
|
1090
1090
|
clearAllSelections: () => void;
|
|
1091
1091
|
handleSelectionChange: (keys: DataTableRowKey[]) => void;
|
|
1092
|
+
/** 原生子表与公开选择方法共用的资格校验、父子联动和事件提交入口。 */
|
|
1093
|
+
handleChildSelectionChange: (parentKey: DataTableRowKey, childKeys: DataTableRowKey[]) => void;
|
|
1092
1094
|
getTableColumns: (originalColumns: TableColumn<T>[]) => unknown[];
|
|
1093
1095
|
}
|
|
1094
1096
|
/** 行操作按钮配置 */
|
package/dist/data2.d.cts
CHANGED
|
@@ -65,28 +65,28 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof _
|
|
|
65
65
|
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
+
add: () => any;
|
|
68
69
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
70
|
close: (value: TabsValue) => any;
|
|
70
|
-
add: () => any;
|
|
71
71
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
+
onAdd?: (() => any) | undefined;
|
|
73
74
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
75
|
onClose?: ((value: TabsValue) => any) | undefined;
|
|
75
|
-
onAdd?: (() => any) | undefined;
|
|
76
76
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
items: readonly TabsItem[];
|
|
79
|
-
size: TabsSize;
|
|
80
78
|
type: TabsType;
|
|
79
|
+
size: TabsSize;
|
|
81
80
|
modelValue: TabsValue | null;
|
|
81
|
+
items: readonly TabsItem[];
|
|
82
|
+
justifyContent: TabsJustifyContent;
|
|
83
|
+
closable: boolean;
|
|
84
|
+
displayDirective: TabsDisplayDirective;
|
|
82
85
|
defaultValue: TabsValue | null;
|
|
83
86
|
placement: TabsPlacement;
|
|
84
|
-
justifyContent: TabsJustifyContent;
|
|
85
87
|
animated: boolean;
|
|
86
|
-
closable: boolean;
|
|
87
88
|
addable: boolean;
|
|
88
89
|
tabsOnly: boolean;
|
|
89
|
-
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
package/dist/data2.d.ts
CHANGED
|
@@ -65,28 +65,28 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_37>]?: (props: typeof _
|
|
|
65
65
|
declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
|
+
add: () => any;
|
|
68
69
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
70
|
close: (value: TabsValue) => any;
|
|
70
|
-
add: () => any;
|
|
71
71
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
+
onAdd?: (() => any) | undefined;
|
|
73
74
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
75
|
onClose?: ((value: TabsValue) => any) | undefined;
|
|
75
|
-
onAdd?: (() => any) | undefined;
|
|
76
76
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
items: readonly TabsItem[];
|
|
79
|
-
size: TabsSize;
|
|
80
78
|
type: TabsType;
|
|
79
|
+
size: TabsSize;
|
|
81
80
|
modelValue: TabsValue | null;
|
|
81
|
+
items: readonly TabsItem[];
|
|
82
|
+
justifyContent: TabsJustifyContent;
|
|
83
|
+
closable: boolean;
|
|
84
|
+
displayDirective: TabsDisplayDirective;
|
|
82
85
|
defaultValue: TabsValue | null;
|
|
83
86
|
placement: TabsPlacement;
|
|
84
|
-
justifyContent: TabsJustifyContent;
|
|
85
87
|
animated: boolean;
|
|
86
|
-
closable: boolean;
|
|
87
88
|
addable: boolean;
|
|
88
89
|
tabsOnly: boolean;
|
|
89
|
-
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
package/dist/editors.d.cts
CHANGED
|
@@ -556,21 +556,21 @@ declare function setupHighlight(app: App, options?: HighlightPluginOptions): Hig
|
|
|
556
556
|
//#region src/components/C_Tree/index.vue.d.ts
|
|
557
557
|
declare const __VLS_export: <T extends object = TreeNodeData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
558
558
|
props: vue.PublicProps & __VLS_PrettifyLocal<TreeProps$1<T> & {
|
|
559
|
-
"onUpdate:expandedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
559
|
+
"onUpdate:expandedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
560
560
|
onAdd?: ((parentNode?: T | undefined) => any) | undefined;
|
|
561
|
-
|
|
561
|
+
onRefresh?: (() => any) | undefined;
|
|
562
562
|
"onSearch-error"?: ((error: unknown) => any) | undefined;
|
|
563
563
|
"onUpdate:searchPattern"?: ((pattern: string) => any) | undefined;
|
|
564
|
-
"onUpdate:selectedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
565
|
-
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
564
|
+
"onUpdate:selectedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
565
|
+
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
566
566
|
"onNode-select"?: ((node: T | null, selectedKeys: TreeKey[]) => any) | undefined;
|
|
567
567
|
"onNode-action"?: ((action: string, node: T) => any) | undefined;
|
|
568
568
|
"onNode-drop"?: ((info: DropInfo<T>) => any) | undefined;
|
|
569
|
-
|
|
569
|
+
"onLoad-error"?: ((error: unknown, node: T) => any) | undefined;
|
|
570
570
|
}> & (typeof globalThis extends {
|
|
571
571
|
__VLS_PROPS_FALLBACK: infer P;
|
|
572
572
|
} ? P : {});
|
|
573
|
-
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "expandedKeys" | "
|
|
573
|
+
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "expandedKeys" | "checkedKeys" | "selectedKeys" | "searchLoading" | "searchError" | "searchMatchCount" | "searchMatchIndex"> & {
|
|
574
574
|
expandedKeys: vue.Ref<TreeKey[]>;
|
|
575
575
|
selectedKeys: vue.Ref<TreeKey[]>;
|
|
576
576
|
checkedKeys: vue.Ref<TreeKey[]>;
|
|
@@ -581,7 +581,7 @@ declare const __VLS_export: <T extends object = TreeNodeData>(__VLS_props: NonNu
|
|
|
581
581
|
}>) => void;
|
|
582
582
|
attrs: any;
|
|
583
583
|
slots: TreeSlots<T>;
|
|
584
|
-
emit: ((evt: "update:expandedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
584
|
+
emit: ((evt: "update:expandedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => void) & ((evt: "add", parentNode?: T | undefined) => void) & ((evt: "refresh") => void) & ((evt: "search-error", error: unknown) => void) & ((evt: "update:searchPattern", pattern: string) => void) & ((evt: "update:selectedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => void) & ((evt: "update:checkedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => void) & ((evt: "node-select", node: T | null, selectedKeys: TreeKey[]) => void) & ((evt: "node-action", action: string, node: T) => void) & ((evt: "node-drop", info: DropInfo<T>) => void) & ((evt: "load-error", error: unknown, node: T) => void);
|
|
585
585
|
}>) => vue.VNode & {
|
|
586
586
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
587
587
|
};
|
|
@@ -645,7 +645,7 @@ declare function useTreeOperations<T extends object = TreeNodeData>(props: TreeP
|
|
|
645
645
|
handleDrop: (info: DropInfo<T>) => void;
|
|
646
646
|
handleAdd: () => void;
|
|
647
647
|
handleRefresh: () => void;
|
|
648
|
-
expose: Omit<TreeExpose<T>, "expandedKeys" | "
|
|
648
|
+
expose: Omit<TreeExpose<T>, "expandedKeys" | "checkedKeys" | "selectedKeys" | "searchLoading" | "searchError" | "searchMatchCount" | "searchMatchIndex"> & {
|
|
649
649
|
expandedKeys: Ref<TreeKey[]>;
|
|
650
650
|
selectedKeys: Ref<TreeKey[]>;
|
|
651
651
|
checkedKeys: Ref<TreeKey[]>;
|
package/dist/editors.d.ts
CHANGED
|
@@ -546,21 +546,21 @@ declare function setupHighlight(app: App, options?: HighlightPluginOptions): Hig
|
|
|
546
546
|
//#region src/components/C_Tree/index.vue.d.ts
|
|
547
547
|
declare const __VLS_export: <T extends object = TreeNodeData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
548
548
|
props: vue.PublicProps & __VLS_PrettifyLocal<TreeProps$1<T> & {
|
|
549
|
-
"onUpdate:expandedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
549
|
+
"onUpdate:expandedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
550
550
|
onAdd?: ((parentNode?: T | undefined) => any) | undefined;
|
|
551
|
-
|
|
551
|
+
onRefresh?: (() => any) | undefined;
|
|
552
552
|
"onSearch-error"?: ((error: unknown) => any) | undefined;
|
|
553
553
|
"onUpdate:searchPattern"?: ((pattern: string) => any) | undefined;
|
|
554
|
-
"onUpdate:selectedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
555
|
-
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
554
|
+
"onUpdate:selectedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
555
|
+
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
556
556
|
"onNode-select"?: ((node: T | null, selectedKeys: TreeKey[]) => any) | undefined;
|
|
557
557
|
"onNode-action"?: ((action: string, node: T) => any) | undefined;
|
|
558
558
|
"onNode-drop"?: ((info: DropInfo<T>) => any) | undefined;
|
|
559
|
-
|
|
559
|
+
"onLoad-error"?: ((error: unknown, node: T) => any) | undefined;
|
|
560
560
|
}> & (typeof globalThis extends {
|
|
561
561
|
__VLS_PROPS_FALLBACK: infer P;
|
|
562
562
|
} ? P : {});
|
|
563
|
-
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "expandedKeys" | "
|
|
563
|
+
expose: (exposed: vue.ShallowUnwrapRef<Omit<TreeExpose<T>, "expandedKeys" | "checkedKeys" | "selectedKeys" | "searchLoading" | "searchError" | "searchMatchCount" | "searchMatchIndex"> & {
|
|
564
564
|
expandedKeys: vue.Ref<TreeKey[]>;
|
|
565
565
|
selectedKeys: vue.Ref<TreeKey[]>;
|
|
566
566
|
checkedKeys: vue.Ref<TreeKey[]>;
|
|
@@ -571,7 +571,7 @@ declare const __VLS_export: <T extends object = TreeNodeData>(__VLS_props: NonNu
|
|
|
571
571
|
}>) => void;
|
|
572
572
|
attrs: any;
|
|
573
573
|
slots: TreeSlots<T>;
|
|
574
|
-
emit: ((evt: "update:expandedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "
|
|
574
|
+
emit: ((evt: "update:expandedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => void) & ((evt: "add", parentNode?: T | undefined) => void) & ((evt: "refresh") => void) & ((evt: "search-error", error: unknown) => void) & ((evt: "update:searchPattern", pattern: string) => void) & ((evt: "update:selectedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => void) & ((evt: "update:checkedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "collapse" | "expand" | "unselect" | "check" | "uncheck">) => void) & ((evt: "node-select", node: T | null, selectedKeys: TreeKey[]) => void) & ((evt: "node-action", action: string, node: T) => void) & ((evt: "node-drop", info: DropInfo<T>) => void) & ((evt: "load-error", error: unknown, node: T) => void);
|
|
575
575
|
}>) => vue.VNode & {
|
|
576
576
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
577
577
|
};
|
|
@@ -635,7 +635,7 @@ declare function useTreeOperations<T extends object = TreeNodeData>(props: TreeP
|
|
|
635
635
|
handleDrop: (info: DropInfo<T>) => void;
|
|
636
636
|
handleAdd: () => void;
|
|
637
637
|
handleRefresh: () => void;
|
|
638
|
-
expose: Omit<TreeExpose<T>, "expandedKeys" | "
|
|
638
|
+
expose: Omit<TreeExpose<T>, "expandedKeys" | "checkedKeys" | "selectedKeys" | "searchLoading" | "searchError" | "searchMatchCount" | "searchMatchIndex"> & {
|
|
639
639
|
expandedKeys: Ref<TreeKey[]>;
|
|
640
640
|
selectedKeys: Ref<TreeKey[]>;
|
|
641
641
|
checkedKeys: Ref<TreeKey[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./data2.cjs`);function t(e,t){e.on(`cell:change:*`,({cell:e,key:n,previous:r,options:i})=>{t()&&i.ui&&e.prop(n,r,{ui:!1})})}function n(t,n,r){let i,a=()=>{i=void 0,r()},o=()=>{if(!i)return!1;let r=t(i.id),a=n(i.id);return r!==void 0&&e.a(r,i.current)&&(e.a(a,i.source)||e.a(a,i.current))};return{begin(r){i={id:r,current:e.t(t(r)),source:e.t(n(r))}},validate(){i&&!o()&&a()},consume(e){let t=i?.id===e&&o();return a(),t},close:a}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,t}from"./data2.js";function n(e,t){e.on(`cell:change:*`,({cell:e,key:n,previous:r,options:i})=>{t()&&i.ui&&e.prop(n,r,{ui:!1})})}function r(n,r,i){let a,o=()=>{a=void 0,i()},s=()=>{if(!a)return!1;let t=n(a.id),i=r(a.id);return t!==void 0&&e(t,a.current)&&(e(i,a.source)||e(i,a.current))};return{begin(e){a={id:e,current:t(n(e)),source:t(r(e))}},validate(){a&&!s()&&o()},consume(e){let t=a?.id===e&&s();return o(),t},close:o}}export{n,r as t};
|