import{parseFragment as t,registerTemplate as e,freezeTemplate as s,registerDecorators as i,registerComponent as a}from"@kdcloudjs/kwc";import{s as o}from"../kddsCommon-CucK_w70.js";import{i as r}from"../ssr-C2pjZzfv.js";import"../observable-tloG64m6.js";import"../i18n-B98kiI7M.js";import{b as d}from"../normalize-C0Pp7GJL.js";import{getLinkInfo as c}from"./routingService.js";import n from"./shadowBaseClassPrivate.js";import"../empty_html-CjXB8rB4.js";import"../client-Ddi3i8XR.js";import"./utilsPrivate.js";import"./iso8601Utils.js";import"../colorValid-qIPgkqGp.js";var l=[[o]];const h=t`<a${"a0:href"}${"a0:tabindex"}${3}>${"t1"}</a>`;function u(t,e,s,i){const{ti:a,b:o,d:r,sp:d,st:c,t:n}=t,{_m0:l,_m1:u}=i;return[e.isNavigable?c(h,1,[d(0,{on:u||(i._m1={click:o(e.handleClick)}),attrs:{href:e.state.url,tabindex:a(e.tabIndex)}},null),d(1,null,r(e.displayValue))]):null,e.isNavigable?null:n(r(e.displayValue))]}var p=e(u);u.stylesheets=[],u.stylesheetToken="kwc-5357u26cao",u.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedLookup-undefined_formattedLookup",l&&u.stylesheets.push.apply(u.stylesheets,l),s(u);class b extends CustomEvent{constructor(t){super(b.NAME,{composed:!0,cancelable:!0,bubbles:!0,detail:Object.assign({},t)})}}b.NAME="privatelookupitempicked";const m={PrivateLookupItemPickedEvent:b};class v extends n{set recordId(t){this.state.recordId=t,this.updateLinkData()}get recordId(){return this.state.recordId}get disabled(){return this.state.disabled}set disabled(t){this.state.disabled=d(t),this.isNavigable=!this.disabled&&!!this.dispatcher&&!!this.state.url}constructor(){super(),this.displayValue=void 0,this.tabIndex=void 0,this._connected=void 0,this._dataNavigation=void 0,this.dispatcher=void 0,this.state={disabled:!1,recordId:null,url:null,isNavigable:!1},this._connected=!1,this.dispatcher=null}connectedCallback(){super.connectedCallback(),this._connected=!0,this.updateLinkData(),"enable"===this.getAttribute("data-navigation")&&(this._dataNavigation=!0,this.removeAttribute("data-navigation"))}disconnectedCallback(){this._connected=!1}focus(){this.anchor&&this.anchor.focus()}blur(){this.anchor&&this.anchor.blur()}click(){this.anchor&&this.anchor.click()}get anchor(){if(r&&this._connected&&this.isNavigable)return this.template.querySelector("a")}get isNavigable(){return this.state.isNavigable}set isNavigable(t){const e=d(t);this.state.isNavigable=e,this._connected&&this._dataNavigation&&(e?this.setAttribute("data-navigation","enable"):this.removeAttribute("data-navigation"))}updateLinkData(){r&&this._connected&&this.state.recordId&&c(this,{stateType:"standard__recordPage",attributes:{recordId:this.state.recordId,actionName:"view"}}).then(t=>{this.state.url=t.url,this.dispatcher=t.dispatcher,this.isNavigable=!this.disabled&&!!this.dispatcher&&!!this.state.url})}handleClick(t){this.dispatchEvent(new b({recordId:this.recordId})),this.dispatcher(t)}}i(v,{publicProps:{displayValue:{config:0},tabIndex:{config:0},recordId:{config:3},disabled:{config:3}},publicMethods:["focus","blur","click"],track:{state:1},fields:["_connected","_dataNavigation","dispatcher"]});const k=a(v,{tmpl:p,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedLookup-",apiVersion:63});export{m as EVENTS,k as default};
