import{parseFragment as e,registerTemplate as t,freezeTemplate as s,registerDecorators as o,registerComponent as n}from"@kdcloudjs/kwc";import{s as i}from"../kddsCommon-CucK_w70.js";import r from"./shadowBaseClassPrivate.js";import"../observable-tloG64m6.js";import{toNorthAmericanPhoneNumber as l}from"./utilsPrivate.js";import"../client-Ddi3i8XR.js";import"../ssr-C2pjZzfv.js";import"../empty_html-CjXB8rB4.js";import"../i18n-B98kiI7M.js";import"../normalize-C0Pp7GJL.js";import"./iso8601Utils.js";import"../colorValid-qIPgkqGp.js";var c=[[function(e,t,s){return(t?(s?"":'[dir="rtl"]')+" :host":(s?"":'[dir="rtl"]')+" "+(e?"["+e+"-host]":""))+(s?":dir(rtl)":"")+" {direction: ltr;unicode-bidi: embed;}"}],[i]];const a=e`<a${"a0:href"}${"a0:tabindex"}${3}>${"t1"}</a>`,d=e`<span${3}>${"t1"}</span>`;function h(e,t,s,o){const{ti:n,d:i,sp:r,st:l}=e;return[t.showLink?t.disabled?null:l(a,1,[r(0,{attrs:{href:t.link,tabindex:n(t.tabIndex)}},null),r(1,null,i(t.formattedPhoneNumber))]):null,t.showLink&&t.disabled?l(d,3,[r(1,null,i(t.formattedPhoneNumber))]):null]}var u=t(h);h.stylesheets=[],h.stylesheetToken="kwc-7f8bcvsdlka",h.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedPhone-undefined_formattedPhone",c&&h.stylesheets.push.apply(h.stylesheets,c),s(h);class p extends r{constructor(...e){super(...e),this.value=void 0,this.disabled=!1,this.tabIndex=void 0,this._connected=!1}connectedCallback(){super.connectedCallback(),this._connected=!0}disconnectedCallback(){this._connected=!1}focus(){this.phoneAnchor&&this.phoneAnchor.focus()}blur(){this.phoneAnchor&&this.phoneAnchor.blur()}click(){const e=this.phoneAnchor;e&&e.click&&e.click()}get phoneAnchor(){if(this._connected&&this.showLink&&!this.disabled)return this.template.querySelector("a")}get showLink(){return null!=this.value&&""!==this.value}get formattedPhoneNumber(){return l(this.value)}get link(){return`tel:${this.value}`}}o(p,{publicProps:{value:{config:0},disabled:{config:0},tabIndex:{config:0}},publicMethods:["focus","blur","click"],fields:["_connected"]});const m=n(p,{tmpl:u,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedPhone-",apiVersion:63});export{m as default};
