@robot-admin/naive-ui-components 0.40.2 → 0.40.4
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 +2 -2
- package/README_EN.md +17 -17
- 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 +10 -10
- package/dist/C_ContextMenu2.cjs +1 -1
- package/dist/C_ContextMenu2.js +1 -1
- package/dist/C_DataPicker.css +32 -32
- package/dist/C_DataPicker2.cjs +1 -1
- package/dist/C_DataPicker2.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_FormSearch.css +72 -72
- package/dist/C_FullCalendar2.cjs +1 -1
- package/dist/C_FullCalendar2.js +1 -1
- 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_Table.d.ts +1 -0
- 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_Tree.d.ts +1 -0
- package/dist/C_Upload.css +80 -80
- 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 +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants3.d.cts +1 -1
- package/dist/constants3.d.ts +1 -1
- package/dist/constants4.d.cts +6 -6
- package/dist/constants4.d.ts +7 -6
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/context.d.cts +2 -0
- package/dist/data2.d.cts +10 -10
- package/dist/data2.d.ts +10 -10
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.cts +3 -3
- package/dist/editors.d.ts +3 -3
- package/dist/editors.js +1 -1
- package/dist/graphEditSession.cjs +1 -0
- package/dist/graphEditSession.js +1 -0
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.cts +2 -3
- package/dist/index10.vue.d.ts +10 -7
- package/dist/index11.vue.d.cts +10 -7
- package/dist/index11.vue.d.ts +4 -4
- package/dist/index12.vue.d.cts +4 -4
- package/dist/index13.vue.d.ts +16 -13
- package/dist/index14.vue.d.cts +16 -13
- package/dist/index16.vue.d.ts +6 -11
- package/dist/index17.vue.d.cts +6 -11
- package/dist/index17.vue.d.ts +6 -6
- package/dist/index18.vue.d.cts +6 -6
- package/dist/index18.vue.d.ts +4 -9
- package/dist/index19.vue.d.cts +4 -9
- package/dist/index20.vue.d.ts +1 -2
- package/dist/index21.vue.d.cts +1 -2
- package/dist/index21.vue.d.ts +19 -17
- package/dist/index22.vue.d.cts +19 -17
- package/dist/index24.vue.d.cts +9 -6
- package/dist/index24.vue.d.ts +9 -6
- package/dist/index27.vue.d.cts +3 -3
- package/dist/index27.vue.d.ts +3 -3
- package/dist/index28.vue.d.cts +12 -19
- package/dist/index28.vue.d.ts +12 -19
- package/dist/index3.vue.d.cts +3 -3
- package/dist/index3.vue.d.ts +3 -3
- package/dist/index30.vue.d.cts +3 -10
- package/dist/index30.vue.d.ts +3 -10
- package/dist/index31.vue.d.cts +5 -5
- package/dist/index31.vue.d.ts +5 -5
- package/dist/index32.vue.d.cts +4 -4
- package/dist/index32.vue.d.ts +4 -4
- package/dist/index4.vue.d.cts +12 -9
- package/dist/index4.vue.d.ts +12 -9
- package/dist/index7.vue.d.ts +14 -14
- package/dist/index8.vue.d.cts +14 -14
- package/dist/index8.vue.d.ts +1 -1
- package/dist/index9.vue.d.cts +1 -1
- package/dist/index9.vue.d.ts +2 -3
- package/dist/locale.cjs +1 -0
- package/dist/locale.js +1 -0
- package/dist/mapUtils.d.cts +4 -4
- package/dist/mapUtils.d.ts +4 -4
- 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 +1250 -1200
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +10 -10
- package/dist/useCropperCore.d.ts +10 -10
- package/dist/useDynamicFormState.d.cts +2 -2
- package/dist/useDynamicFormState.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFullscreen.d.cts +1 -1
- package/dist/useFullscreen.d.ts +1 -1
- 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 +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useScopedComponentLocale.cjs +1 -0
- package/dist/useScopedComponentLocale.js +1 -0
- package/dist/useSignatureHistory.d.cts +9 -4
- package/dist/useSignatureHistory.d.ts +9 -4
- package/dist/useSplitResize.d.cts +8 -8
- package/dist/useSplitResize.d.ts +8 -8
- package/dist/useWorkflowValidation.d.cts +39 -34
- package/dist/useWorkflowValidation.d.ts +39 -34
- package/dist/verification.d.cts +2 -2
- package/dist/verification.d.ts +2 -2
- package/docs/architecture.en.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/component-audit-closure-0.40.4.md +62 -0
- package/docs/engineering.en.md +3 -2
- package/docs/engineering.md +3 -2
- 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 +25 -2
- package/docs/guides/workflow.md +5 -1
- package/docs/stability-boundaries-0.40.3.md +38 -0
- 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
|
@@ -108,17 +108,17 @@ interface CronEmits {
|
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/C_Cron/index.vue.d.ts
|
|
110
110
|
declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
111
|
-
change: (value: string) => any;
|
|
112
111
|
"update:modelValue": (value: string) => any;
|
|
112
|
+
change: (value: string) => any;
|
|
113
113
|
"validation-change": (result: CronValidation) => any;
|
|
114
114
|
}, string, vue.PublicProps, Readonly<CronProps> & Readonly<{
|
|
115
|
-
onChange?: ((value: string) => any) | undefined;
|
|
116
115
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
116
|
+
onChange?: ((value: string) => any) | undefined;
|
|
117
117
|
"onValidation-change"?: ((result: CronValidation) => any) | undefined;
|
|
118
118
|
}>, {
|
|
119
119
|
disabled: boolean;
|
|
120
|
-
showTemplates: boolean;
|
|
121
120
|
showPreview: boolean;
|
|
121
|
+
showTemplates: 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
|
@@ -108,17 +108,17 @@ interface CronEmits {
|
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/C_Cron/index.vue.d.ts
|
|
110
110
|
declare const __VLS_export: vue.DefineComponent<CronProps, CronExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
111
|
-
change: (value: string) => any;
|
|
112
111
|
"update:modelValue": (value: string) => any;
|
|
112
|
+
change: (value: string) => any;
|
|
113
113
|
"validation-change": (result: CronValidation) => any;
|
|
114
114
|
}, string, vue.PublicProps, Readonly<CronProps> & Readonly<{
|
|
115
|
-
onChange?: ((value: string) => any) | undefined;
|
|
116
115
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
116
|
+
onChange?: ((value: string) => any) | undefined;
|
|
117
117
|
"onValidation-change"?: ((result: CronValidation) => any) | undefined;
|
|
118
118
|
}>, {
|
|
119
119
|
disabled: boolean;
|
|
120
|
-
showTemplates: boolean;
|
|
121
120
|
showPreview: boolean;
|
|
121
|
+
showTemplates: boolean;
|
|
122
122
|
showSecond: boolean;
|
|
123
123
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
124
124
|
declare const _default: typeof __VLS_export;
|
package/dist/constants2.d.cts
CHANGED
|
@@ -125,12 +125,12 @@ interface FormulaEditorExpose {
|
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/components/C_FormulaEditor/index.vue.d.ts
|
|
127
127
|
declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEditorExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
128
|
-
change: (value: string) => any;
|
|
129
128
|
"update:modelValue": (value: string) => any;
|
|
129
|
+
change: (value: string) => any;
|
|
130
130
|
"validation-change": (result: FormulaValidation) => any;
|
|
131
131
|
}, string, vue.PublicProps, Readonly<FormulaEditorProps> & Readonly<{
|
|
132
|
-
onChange?: ((value: string) => any) | undefined;
|
|
133
132
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
133
|
+
onChange?: ((value: string) => any) | undefined;
|
|
134
134
|
"onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
|
|
135
135
|
}>, {
|
|
136
136
|
disabled: boolean;
|
package/dist/constants2.d.ts
CHANGED
|
@@ -125,12 +125,12 @@ interface FormulaEditorExpose {
|
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/components/C_FormulaEditor/index.vue.d.ts
|
|
127
127
|
declare const __VLS_export: vue.DefineComponent<FormulaEditorProps, FormulaEditorExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
128
|
-
change: (value: string) => any;
|
|
129
128
|
"update:modelValue": (value: string) => any;
|
|
129
|
+
change: (value: string) => any;
|
|
130
130
|
"validation-change": (result: FormulaValidation) => any;
|
|
131
131
|
}, string, vue.PublicProps, Readonly<FormulaEditorProps> & Readonly<{
|
|
132
|
-
onChange?: ((value: string) => any) | undefined;
|
|
133
132
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
133
|
+
onChange?: ((value: string) => any) | undefined;
|
|
134
134
|
"onValidation-change"?: ((result: FormulaValidation) => any) | undefined;
|
|
135
135
|
}>, {
|
|
136
136
|
disabled: boolean;
|
package/dist/constants3.d.cts
CHANGED
|
@@ -250,12 +250,12 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
|
|
|
250
250
|
onNavigate?: ((url: string) => any) | undefined;
|
|
251
251
|
onViewAll?: (() => any) | undefined;
|
|
252
252
|
}>, {
|
|
253
|
+
storageKey: string;
|
|
253
254
|
autoStart: boolean;
|
|
254
255
|
desktopNotification: boolean;
|
|
255
256
|
maxBadgeCount: number;
|
|
256
257
|
pollingInterval: number;
|
|
257
258
|
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
|
@@ -250,12 +250,12 @@ declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, Notificat
|
|
|
250
250
|
onNavigate?: ((url: string) => any) | undefined;
|
|
251
251
|
onViewAll?: (() => any) | undefined;
|
|
252
252
|
}>, {
|
|
253
|
+
storageKey: string;
|
|
253
254
|
autoStart: boolean;
|
|
254
255
|
desktopNotification: boolean;
|
|
255
256
|
maxBadgeCount: number;
|
|
256
257
|
pollingInterval: number;
|
|
257
258
|
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,31 +198,31 @@ 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
|
+
error: (file: UploadFileItem, error: Error) => any;
|
|
202
|
+
success: (file: UploadFileItem, response: unknown) => any;
|
|
201
203
|
change: (fileList: UploadFileItem[]) => any;
|
|
202
204
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
|
-
success: (file: UploadFileItem, response: unknown) => any;
|
|
204
|
-
error: (file: UploadFileItem, error: Error) => 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
|
+
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
210
|
+
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
209
211
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
210
212
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
|
-
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
212
|
-
onError?: ((file: UploadFileItem, error: Error) => 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
|
-
|
|
219
|
+
maxSize: number;
|
|
220
220
|
draggable: boolean;
|
|
221
221
|
action: string;
|
|
222
|
+
multiple: boolean;
|
|
222
223
|
headers: Record<string, string>;
|
|
223
224
|
directory: boolean;
|
|
224
225
|
accept: string;
|
|
225
|
-
maxSize: number;
|
|
226
226
|
maxCount: number;
|
|
227
227
|
pasteable: boolean;
|
|
228
228
|
chunked: boolean;
|
package/dist/constants4.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as vue from "vue";
|
|
2
2
|
import { Ref } from "vue";
|
|
3
|
+
import "naive-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/C_Upload/types.d.ts
|
|
5
6
|
/**
|
|
@@ -198,31 +199,31 @@ type __VLS_Slots = {} & {
|
|
|
198
199
|
area?: (props: typeof __VLS_11) => any;
|
|
199
200
|
};
|
|
200
201
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
202
|
+
error: (file: UploadFileItem, error: Error) => any;
|
|
203
|
+
success: (file: UploadFileItem, response: unknown) => any;
|
|
201
204
|
change: (fileList: UploadFileItem[]) => any;
|
|
202
205
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
|
-
success: (file: UploadFileItem, response: unknown) => any;
|
|
204
|
-
error: (file: UploadFileItem, error: Error) => any;
|
|
205
206
|
remove: (file: UploadFileItem) => any;
|
|
206
207
|
finish: (fileList: UploadFileItem[]) => any;
|
|
207
208
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
208
209
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
210
|
+
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
211
|
+
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
209
212
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
210
213
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
|
-
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
212
|
-
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
213
214
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
214
215
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
215
216
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
216
217
|
}>, {
|
|
217
218
|
data: Record<string, unknown>;
|
|
218
219
|
disabled: boolean;
|
|
219
|
-
|
|
220
|
+
maxSize: number;
|
|
220
221
|
draggable: boolean;
|
|
221
222
|
action: string;
|
|
223
|
+
multiple: boolean;
|
|
222
224
|
headers: Record<string, string>;
|
|
223
225
|
directory: boolean;
|
|
224
226
|
accept: string;
|
|
225
|
-
maxSize: number;
|
|
226
227
|
maxCount: number;
|
|
227
228
|
pasteable: boolean;
|
|
228
229
|
chunked: boolean;
|
package/dist/constants5.d.cts
CHANGED
|
@@ -262,8 +262,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
|
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/components/C_VideoPlayer/index.vue.d.ts
|
|
264
264
|
declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
265
|
-
error: (error: Error) => any;
|
|
266
265
|
ready: () => any;
|
|
266
|
+
error: (error: Error) => any;
|
|
267
267
|
ended: () => any;
|
|
268
268
|
stateChange: (state: PlayerState) => any;
|
|
269
269
|
qualityChange: (quality: QualityLevel) => any;
|
|
@@ -275,8 +275,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
|
|
|
275
275
|
quizAnswer: (quizId: string, answer: string | string[], isCorrect: boolean) => any;
|
|
276
276
|
timeUpdate: (currentTime: number, duration: number) => any;
|
|
277
277
|
}, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
|
|
278
|
-
onError?: ((error: Error) => any) | undefined;
|
|
279
278
|
onReady?: (() => any) | undefined;
|
|
279
|
+
onError?: ((error: Error) => any) | undefined;
|
|
280
280
|
onEnded?: (() => any) | undefined;
|
|
281
281
|
onStateChange?: ((state: PlayerState) => any) | undefined;
|
|
282
282
|
onQualityChange?: ((quality: QualityLevel) => any) | undefined;
|
package/dist/constants5.d.ts
CHANGED
|
@@ -262,8 +262,8 @@ type PlayerInstance = InstanceType<typeof xgplayer.default>;
|
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/components/C_VideoPlayer/index.vue.d.ts
|
|
264
264
|
declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
265
|
-
error: (error: Error) => any;
|
|
266
265
|
ready: () => any;
|
|
266
|
+
error: (error: Error) => any;
|
|
267
267
|
ended: () => any;
|
|
268
268
|
stateChange: (state: PlayerState) => any;
|
|
269
269
|
qualityChange: (quality: QualityLevel) => any;
|
|
@@ -275,8 +275,8 @@ declare const __VLS_export: vue.DefineComponent<VideoPlayerProps, VideoPlayerExp
|
|
|
275
275
|
quizAnswer: (quizId: string, answer: string | string[], isCorrect: boolean) => any;
|
|
276
276
|
timeUpdate: (currentTime: number, duration: number) => any;
|
|
277
277
|
}, string, vue.PublicProps, Readonly<VideoPlayerProps> & Readonly<{
|
|
278
|
-
onError?: ((error: Error) => any) | undefined;
|
|
279
278
|
onReady?: (() => any) | undefined;
|
|
279
|
+
onError?: ((error: Error) => any) | undefined;
|
|
280
280
|
onEnded?: (() => any) | undefined;
|
|
281
281
|
onStateChange?: ((state: PlayerState) => any) | undefined;
|
|
282
282
|
onQualityChange?: ((quality: QualityLevel) => any) | undefined;
|
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;
|
|
69
|
-
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
70
68
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
+
add: () => any;
|
|
71
70
|
close: (value: TabsValue) => any;
|
|
71
|
+
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
-
onAdd?: (() => any) | undefined;
|
|
74
|
-
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
75
73
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
+
onAdd?: (() => any) | undefined;
|
|
76
75
|
onClose?: ((value: TabsValue) => any) | undefined;
|
|
76
|
+
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
size: TabsSize;
|
|
79
|
-
items: readonly TabsItem[];
|
|
80
|
-
type: TabsType;
|
|
81
78
|
modelValue: TabsValue | null;
|
|
79
|
+
type: TabsType;
|
|
80
|
+
items: readonly TabsItem[];
|
|
81
|
+
size: TabsSize;
|
|
82
|
+
justifyContent: TabsJustifyContent;
|
|
82
83
|
defaultValue: TabsValue | null;
|
|
83
84
|
placement: TabsPlacement;
|
|
84
|
-
displayDirective: TabsDisplayDirective;
|
|
85
85
|
animated: boolean;
|
|
86
|
-
addable: boolean;
|
|
87
|
-
justifyContent: TabsJustifyContent;
|
|
88
86
|
closable: boolean;
|
|
87
|
+
addable: boolean;
|
|
89
88
|
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;
|
|
69
|
-
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
70
68
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
+
add: () => any;
|
|
71
70
|
close: (value: TabsValue) => any;
|
|
71
|
+
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
|
-
onAdd?: (() => any) | undefined;
|
|
74
|
-
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
75
73
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
+
onAdd?: (() => any) | undefined;
|
|
76
75
|
onClose?: ((value: TabsValue) => any) | undefined;
|
|
76
|
+
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
size: TabsSize;
|
|
79
|
-
items: readonly TabsItem[];
|
|
80
|
-
type: TabsType;
|
|
81
78
|
modelValue: TabsValue | null;
|
|
79
|
+
type: TabsType;
|
|
80
|
+
items: readonly TabsItem[];
|
|
81
|
+
size: TabsSize;
|
|
82
|
+
justifyContent: TabsJustifyContent;
|
|
82
83
|
defaultValue: TabsValue | null;
|
|
83
84
|
placement: TabsPlacement;
|
|
84
|
-
displayDirective: TabsDisplayDirective;
|
|
85
85
|
animated: boolean;
|
|
86
|
-
addable: boolean;
|
|
87
|
-
justifyContent: TabsJustifyContent;
|
|
88
86
|
closable: boolean;
|
|
87
|
+
addable: boolean;
|
|
89
88
|
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.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./observer.cjs`),t=require(`./data2.cjs`),n=require(`./sourceControls.cjs`);let r=require(`vue`);const i=(e,t)=>Number.isFinite(e)?Math.max(1,Math.floor(e)):t;function a(n){let a=(0,r.shallowRef)([]),o=(0,r.ref)(!1),s=(0,r.shallowRef)(),c=(0,r.ref)(0),l=t.t(n.initialQuery),u=(0,r.ref)(i(n.initialPage,1)),d=(0,r.ref)(i(n.pageSize,20)),f=(0,r.shallowRef)(t.t(l)),p=0,m=null,h=!1,g=(e,t)=>!h&&e===p&&m===t&&!t.signal.aborted,_=async()=>{if(h)return!1;let r=++p,i=m,l=new AbortController;m=l;try{if(i?.abort(),!g(r,l)||(o.value=!0,!g(r,l))||(s.value=void 0,!g(r,l)))return!1;let p=await n.request({page:u.value,pageSize:d.value,query:t.t(f.value),signal:l.signal});if(!g(r,l))return!1;if(!Array.isArray(p.data)||!Number.isFinite(p.total))throw TypeError(`[C_Table] request 必须返回 { data: T[], total: number }`);return a.value=t.t([...p.data]),!g(r,l)||(c.value=Math.max(0,Math.floor(p.total)),!g(r,l))?!1:(e.t(()=>n.onSuccess?.({data:a.value,total:c.value})),g(r,l))}catch(t){return g(r,l)?(s.value=t,g(r,l)&&e.t(()=>n.onError?.(t)),!1):!1}finally{r===p&&m===l&&(m=null,o.value=!1)}},v=async(e,n=!0)=>h?!1:(f.value=t.t(typeof e==`function`?e(f.value):{...f.value,...e}),u.value=1,n?_():!0),y=async(e,t)=>h?!1:(u.value=i(e,u.value),d.value=i(t,d.value),_()),b=async(e=!0)=>h?!1:(f.value=t.t(l),u.value=1,e?_():!0),x=(0,r.computed)(()=>{let e=(0,r.toValue)(n.config)??{},t=typeof e.pagination==`object`?e.pagination:{};return{data:a.value,loading:o.value,columns:(0,r.toValue)(n.columns),rowKey:n.rowKey??`id`,config:{...e,pagination:{...t,enabled:!0,remote:!0,page:u.value,pageSize:d.value,total:c.value}}}}),S=(0,r.computed)(()=>({...x.value,onPaginationChange:y})),C=()=>{let e=++p,t=m;m=null,t?.abort(),e===p&&(o.value=!1)};return n.immediate!==!1&&(0,r.onMounted)(()=>void _()),(0,r.onScopeDispose)(()=>{h=!0,C()}),{data:a,loading:o,error:s,total:c,page:u,pageSize:d,query:f,tableProps:x,execute:_,reload:_,setQuery:v,resetQuery:b,handlePaginationChange:y,bindings:S,cancel:C}}function o(e){let{source:t,onSelect:i,...a}=e;return(e,o,s,c)=>(0,r.createVNode)(n.n,{...a,modelValue:e,size:a.size??c.size,source:typeof t==`function`?t(o,s):t,disabled:c.disabled||a.disabled,"onUpdate:modelValue":c.onUpdate,onSelect:async e=>{await(0,r.nextTick)(),i?.(e,{row:o,index:s,updateValue:c.onUpdate})}})}function s(e){let{source:t,onSelect:i,...a}=e;return(e,o,s,c)=>(0,r.createVNode)(n.t,{...a,modelValue:e,size:a.size??c.size,source:typeof t==`function`?t(o,s):t,disabled:c.disabled||a.disabled,"onUpdate:modelValue":c.onUpdate,onSelect:async e=>{await(0,r.nextTick)(),i?.(e,{row:o,index:s,updateValue:c.onUpdate})}})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
package/dist/editors.d.cts
CHANGED
|
@@ -557,16 +557,16 @@ declare function setupHighlight(app: App, options?: HighlightPluginOptions): Hig
|
|
|
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
559
|
"onUpdate:expandedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "expand" | "collapse" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
560
|
-
onAdd?: ((parentNode?: T | undefined) => any) | undefined;
|
|
561
560
|
onRefresh?: (() => any) | undefined;
|
|
561
|
+
onAdd?: ((parentNode?: T | undefined) => any) | undefined;
|
|
562
562
|
"onLoad-error"?: ((error: unknown, node: T) => any) | undefined;
|
|
563
|
-
"onSearch-error"?: ((error: unknown) => any) | undefined;
|
|
564
563
|
"onUpdate:searchPattern"?: ((pattern: string) => any) | undefined;
|
|
565
564
|
"onUpdate:selectedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "expand" | "collapse" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
566
565
|
"onUpdate:checkedKeys"?: ((keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "expand" | "collapse" | "unselect" | "check" | "uncheck">) => any) | undefined;
|
|
567
566
|
"onNode-select"?: ((node: T | null, selectedKeys: TreeKey[]) => any) | undefined;
|
|
568
567
|
"onNode-action"?: ((action: string, node: T) => any) | undefined;
|
|
569
568
|
"onNode-drop"?: ((info: DropInfo<T>) => any) | undefined;
|
|
569
|
+
"onSearch-error"?: ((error: unknown) => any) | undefined;
|
|
570
570
|
}> & (typeof globalThis extends {
|
|
571
571
|
__VLS_PROPS_FALLBACK: infer P;
|
|
572
572
|
} ? P : {});
|
|
@@ -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" | "expand" | "collapse" | "unselect" | "check" | "uncheck">) => void) & ((evt: "
|
|
584
|
+
emit: ((evt: "update:expandedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "expand" | "collapse" | "unselect" | "check" | "uncheck">) => void) & ((evt: "refresh") => void) & ((evt: "add", parentNode?: T | undefined) => void) & ((evt: "load-error", error: unknown, node: T) => void) & ((evt: "update:searchPattern", pattern: string) => void) & ((evt: "update:selectedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "expand" | "collapse" | "unselect" | "check" | "uncheck">) => void) & ((evt: "update:checkedKeys", keys: TreeKey[], options: (T | null)[], meta: TreeUpdateMeta<T, "select" | "filter" | "expand" | "collapse" | "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: "search-error", error: unknown) => void);
|
|
585
585
|
}>) => vue.VNode & {
|
|
586
586
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
587
587
|
};
|