mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-28 07:23:34 +08:00
1 line
1.4 KiB
JavaScript
1 line
1.4 KiB
JavaScript
import{Cn as e,Gn as t,_n as n,kn as r,t as i,wn as a}from"./Card-DpMmwG-0.js";import{z as o}from"./toString-BWDzaUQG.js";import{Jt as s,mt as c}from"./store-D8OSBe2K.js";import{t as l}from"./useContextmenuCoordinate-_wOf0rL4.js";import{m as u}from"./Switch-BFGmG5oX.js";import{t as d}from"./DemoPage-CeDM_n-V.js";import{t as f}from"./DemoResult-DPV5lrU3.js";function p(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!r(e)}var m=[`review`,`archive`,`restore`],h=a({name:`ContextMenuDemo`,setup(){let{t:r}=c(`demoDetails`),a=t(`stage`),{x:h,y:g,show:_,updateShow:v}=l(a,{ignore:[`.r-demo-context-popup`]}),y=o(),b=n(()=>m.map(e=>({key:e,label:r(`context.${e}`)}))),x=e=>{y.value=e,v(!1)};return()=>{let t;return e(d,{title:r(`context.title`),description:r(`context.intro`)},{default:()=>[e(i,{title:`RAY-024`},{default:()=>[e(`div`,{class:`r-demo-card-stack`},[e(`div`,{ref:`stage`,class:`r-demo-stage`},[e(`div`,{class:`r-demo-card-stack`},[e(`strong`,null,[r(`context.target`)]),e(s,{options:b.value,trigger:`click`,onSelect:x},{default:()=>[e(u,{secondary:!0},p(t=r(`context.open`))?t:{default:()=>[t]})]})])]),e(f,{label:r(`context.last`)},{default:()=>[y.value?r(`context.${y.value}`):r(`empty`)]})])]}),e(s,{show:_.value,x:h.value,y:g.value,options:b.value,trigger:`manual`,menuProps:()=>({class:`r-demo-context-popup`}),onSelect:x,onClickoutside:()=>v(!1)},null)]})}}});export{h as default}; |