"use strict";var e=require("@kdcloudjs/kwc"),t=require("../kddsCommon-CICoPypw.js"),r=require("./shadowBaseClassPrivate.js");require("../observable-BXDJFaLN.js"),require("../i18n-CP31jeWH.js");var s=require("./utilsPrivate.js"),i=require("./routingService.js");require("../client-Co_j5m_k.js"),require("../ssr-RXknEJpO.js"),require("../empty_html-hFq4zm9t.js"),require("../normalize-DKPi18vK.js"),require("./iso8601Utils.js"),require("../colorValid-BBnkvgd_.js");var l=[[t.stylesheet0]];const a=e.parseFragment`<a${"a0:href"}${"a0:title"}${"a0:target"}${"a0:tabindex"}${3}>${"t1"}</a>`;function o(e,t,r,s){const{ti:i,b:l,d:o,sp:c,st:n}=e,{_m0:u,_m1:h}=s;return[t.hasValue?n(a,1,[c(0,{on:h||(s._m1={click:l(t.handleClick)}),attrs:{href:t.computedUrl,title:t.tooltip,target:t.target,tabindex:i(t.tabIndex)}},null),c(1,null,o(t.computedLabel))]):null]}var c=e.registerTemplate(o);o.stylesheets=[],o.stylesheetToken="kwc-4srcbceqndb",o.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedUrl-undefined_formattedUrl",l&&o.stylesheets.push.apply(o.stylesheets,l),e.freezeTemplate(o);class n extends r{constructor(...e){super(...e),this.target=void 0,this.tooltip=void 0,this.label=void 0,this.tabIndex=void 0,this._url=void 0,this._value=void 0,this._connected=!1,this._dispatcher=()=>{}}get value(){return this._value}set value(e){this._value=e,this._connected&&this.updateLinkInfo(e)}connectedCallback(){super.connectedCallback(),this._connected=!0,this.updateLinkInfo(this.value)}disconnectedCallback(){this._connected=!1}focus(){this.urlAnchor&&this.urlAnchor.focus()}blur(){this.urlAnchor&&this.urlAnchor.blur()}click(){const e=this.urlAnchor;e&&e.click&&e.click()}get urlAnchor(){if(this._connected&&this.hasValue)return this.template.querySelector("a")}handleClick(e){this._dispatcher(e)}updateLinkInfo(e){i.updateRawLinkInfo(this,{url:s.formatUrl(e),target:this.target}).then(e=>{this._url=e.url,this._dispatcher=e.dispatcher})}get computedLabel(){const{label:e,computedUrl:t}=this;return null!=e&&""!==e?e:t}get computedUrl(){return this._url||s.formatUrl(this.value)}get hasValue(){const e=this.value;return null!=e&&""!==e}}e.registerDecorators(n,{publicProps:{target:{config:0},tooltip:{config:0},label:{config:0},tabIndex:{config:0},value:{config:3}},publicMethods:["focus","blur","click"],track:{_url:1,_value:1},fields:["_connected","_dispatcher"]});const u=e.registerComponent(n,{tmpl:c,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedUrl-",apiVersion:63});module.exports=u;
