import{e as v,H as y,x as b,A as l,v as s,R as k,o as z,B as x,I as P,y as p,J as w,c as R,K as _}from"./iframe-Bl-fVlm8.js";import{p as L,a as S}from"./configs-DshpCAYO.js";import{_ as V}from"./PzIcon-cRuuou9i.js";import{P as T}from"./PzText-D5PUnIjq.js";import{p as A}from"./configs-B15JgQZ-.js";import{P as $}from"./PzLink-DjFfrqMo.js";import"./preload-helper-C1FmrZbK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const n=v({name:"PzRouterLink",inheritAttrs:!1,__name:"PzRouterLink",props:{to:{},replace:{type:Boolean,default:!1},variant:{default:"primary"},target:{default:"_self"},rel:{default:void 0},disabled:{type:Boolean,default:!1},inline:{type:Boolean,default:!0},bold:{type:Boolean,default:!1},italic:{type:Boolean,default:!1},lineThrough:{type:Boolean,default:!1},typography:{}},setup(e){const t=e,o=y(),r=(a,u)=>{t.disabled||t.target!=="_self"||u(a)};return(a,u)=>(z(),b(s(k),{custom:"",to:t.to,replace:t.replace},{default:l(({href:m,navigate:h})=>[x(s($),w(s(o),{href:m,variant:t.variant,target:t.target,rel:t.rel,disabled:t.disabled,inline:t.inline,bold:t.bold,italic:t.italic,"line-through":t.lineThrough,typography:t.typography,onClick:g=>r(g,h)}),P({default:l(()=>[p(a.$slots,"default")]),_:2},[a.$slots.prefix?{name:"prefix",fn:l(()=>[p(a.$slots,"prefix")]),key:"0"}:void 0,a.$slots.suffix?{name:"suffix",fn:l(()=>[p(a.$slots,"suffix")]),key:"1"}:void 0]),1040,["href","variant","target","rel","disabled","inline","bold","italic","line-through","typography","onClick"])]),_:3},8,["to","replace"]))}});n.__docgenInfo=Object.assign({displayName:n.name??n.__name},{name:"PzRouterLink",exportName:"default",displayName:"PzRouterLink",description:"",tags:{},props:[{name:"to",required:!0,type:{name:"PzRouterLinkTo"}},{name:"replace",required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"variant",defaultValue:{func:!1,value:'"primary"'}},{name:"target",defaultValue:{func:!1,value:'"_self"'}},{name:"rel",defaultValue:{func:!1,value:"undefined"}},{name:"disabled",defaultValue:{func:!1,value:"false"}},{name:"inline",defaultValue:{func:!1,value:"true"}},{name:"bold",defaultValue:{func:!1,value:"false"}},{name:"italic",defaultValue:{func:!1,value:"false"}},{name:"lineThrough",defaultValue:{func:!1,value:"false"}}],slots:[{name:"prefix"},{name:"default"},{name:"suffix"}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Actions/PzRouterLink/PzRouterLink.vue"]});const B=e=>{const o=[`to="${typeof e.to=="string"?e.to:JSON.stringify(e.to)}"`,e.variant!=="primary"?`variant="${e.variant}"`:null,e.target!=="_self"?`target="${e.target}"`:null,e.disabled?':disabled="true"':null,e.inline===!1?':inline="false"':null,e.bold?':bold="true"':null,e.italic?':italic="true"':null,e.lineThrough?':line-through="true"':null,e.replace?':replace="true"':null].filter(a=>!!a).join(" "),r=[e.showPrefix?`    <template #prefix>
      <PzIcon name="arrow_back" size="16" />
    </template>`:null,`    ${e.label}`,e.showSuffix?`    <template #suffix>
      <PzIcon name="arrow_forward" size="16" />
    </template>`:null].filter(a=>!!a);return`<template>
  <PzRouterLink ${o}>
${r.join(`
`)}
  </PzRouterLink>
</template>`},I={title:"Components/Actions/PzRouterLink",component:n,parameters:{prototype:{caption:"Router-aware link component",note:"Use `PzRouterLink` for in-app navigation with vue-router while keeping the same visual API as `PzLink`."},docs:{description:{component:"Use `PzRouterLink` when navigation should stay inside a Vue Router application without forcing a full page reload. It wraps `PzLink` and forwards the same visual props and slots."},source:{transform:(e,t)=>B(t.args??I.args)}}},args:{to:"/tenders/active",variant:"primary",target:"_self",disabled:!1,inline:!0,bold:!1,italic:!1,lineThrough:!1,replace:!1,typography:void 0,label:"Open active tenders",showPrefix:!1,showSuffix:!0},argTypes:{to:{control:"text",description:"Vue Router target location."},variant:{control:"inline-radio",options:S,description:"Visual link treatment."},target:{control:"select",options:L,description:"Anchor target attribute. `_self` keeps router navigation enabled."},disabled:{control:"boolean",description:"Prevents navigation and applies disabled styling."},inline:{control:"boolean",description:"Renders inline-flex or block flex layout."},bold:{control:"boolean",description:"Applies stronger text weight."},italic:{control:"boolean",description:"Applies italic text style."},lineThrough:{control:"boolean",description:"Adds line-through decoration to the content."},replace:{control:"boolean",description:"Uses router replace navigation instead of push."},typography:{control:"select",options:[void 0,...A],description:"Overrides typography using a PzText variant."},label:{control:"text",description:"Slot content preview text.",table:{category:"Slots"}},showPrefix:{control:"boolean",description:"Shows a prefix icon slot in the preview.",table:{category:"Slots"}},showSuffix:{control:"boolean",description:"Shows a suffix icon slot in the preview.",table:{category:"Slots"}}},render:e=>({components:{pzRouterLink:n,pzIcon:V,pzText:T},setup(){const t=_(),o=R(()=>t.fullPath);return{args:e,currentPath:o}},template:`
      <div class="pz-link-story">
        <section class="pz-link-story-board">
          <div class="pz-link-story-header">
            <div>
              <span class="pz-link-story-eyebrow">Router API</span>
              <pz-text variant="h4-bold">SPA navigation wrapper</pz-text>
            </div>
            <span class="pz-link-story-chip">{{ currentPath }}</span>
          </div>

          <div class="pz-link-story-preview">
            <pz-router-link
              :to="args.to"
              :variant="args.variant"
              :target="args.target"
              :disabled="args.disabled"
              :inline="args.inline"
              :bold="args.bold"
              :italic="args.italic"
              :line-through="args.lineThrough"
              :replace="args.replace"
              :typography="args.typography"
            >
              <template v-if="args.showPrefix" #prefix>
                <pz-icon
                  name="arrow_back"
                  size="16"
                  label="Router link prefix icon"
                />
              </template>

              {{ args.label }}

              <template v-if="args.showSuffix" #suffix>
                <pz-icon
                  name="arrow_forward"
                  size="16"
                  label="Router link suffix icon"
                />
              </template>
            </pz-router-link>
          </div>
        </section>
      </div>
    `})},i={};var c,f,d;i.parameters={...i.parameters,docs:{...(c=i.parameters)==null?void 0:c.docs,source:{originalSource:"{}",...(d=(f=i.parameters)==null?void 0:f.docs)==null?void 0:d.source}}};const F=["Playground"];export{i as Playground,F as __namedExportsOrder,I as default};
