"use strict";var e=require("@kdcloudjs/kwc"),i=require("./icon.js"),t=require("./shadowBaseClassPrivate.js");require("../utilsPrivate-DL4VBetH.js"),require("../client-Co_j5m_k.js"),require("../ssr-RXknEJpO.js"),require("../observable-BXDJFaLN.js"),require("../empty_html-hFq4zm9t.js"),require("../i18n-CP31jeWH.js"),require("./iso8601Utils.js"),require("../colorValid-BBnkvgd_.js");var d=[function(e,i,t){var d=e?"["+e+"]":"",s=e?"["+e+"-host]":"";return(i?":host .kdds-menu-item":s+" .kdds-menu-item")+d+" {display: flex;position: relative;padding: var(--kdds-c-button-menu-item-padding-top, 6px) var(--kdds-c-button-menu-item-padding-right, 12px);font-size: var(--kdds-c-button-menu-item-font-size, 14px);color: var(--kdds-c-button-menu-item-color, #212121);background-color: var(--kdds-c-button-menu-item-background, #FFFFFF);cursor: pointer;overflow: hidden;line-height: var(--kdds-c-button-menu-item-line-height, 1.5);transition: color 0.3s ease-in-out,\r\n background-color 0.3s ease-in-out;max-width: var(--kdds-c-menu-item-max-width, 576px);}"+(i?":host .kdds-menu-item:hover":s+" .kdds-menu-item:hover")+d+" {background-color: var(--kdds-c-button-menu-item-background-hover,#F5F5F5);}"+(i?":host .kdds-menu-item-divider":s+" .kdds-menu-item-divider")+d+"::after {content: '';position: absolute;bottom: 0;left: 0;width: 100%;height: var(--kdds-c-button-menu-item-divider-border-width, 1px);background-color: var(--kdds-c-button-menu-item-divider-border, #E6E8EE);}"+(i?":host .kdds-menu-item.kdds-button-disabled":s+" .kdds-menu-item.kdds-button-disabled")+d+" {cursor: not-allowed;color: var(--kdds-c-button-menu-item-color-disabled, #B2B2B2);background-color: var(--kdds-c-button-menu-item-background-disabled, #FFFFFF);}"+(i?":host .kdds-menu-item.kdds-button-loading":s+" .kdds-menu-item.kdds-button-loading")+d+" {color: var(--kdds-c-button-menu-item-color-disabled, #B2B2B2);background-color: var(--kdds-c-button-menu-item-background-disabled, #FFFFFF);}"+(i?":host .kdds-menu-item-container":s+" .kdds-menu-item-container")+d+" {position: relative;display: flex;min-width: 0;}"+(i?":host .kdds-menu-item-icon":s+" .kdds-menu-item-icon")+d+" {margin-right: var(--kdds-c-button-menu-item-icon-margin-right, 4px);}"+(i?":host .kdds-menu-item-loading-container":s+" .kdds-menu-item-loading-container")+d+" {position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);color: var(--kdds-c-button-menu-item-loading-color, #276FF5);}"+(i?":host .kdds-menu-item-label":s+" .kdds-menu-item-label")+d+" {flex: 1;min-width: 0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}"}];const s=e.parseFragment`<span class="kdds-menu-item-label${0}"${2}>${"t1"}</span>`,n={classMap:{"kdds-menu-item-container":!0},key:1},o={"kdds-menu-item-icon":!0},a={classMap:{"kdds-menu-item-loading-container":!0},key:3},r={props:{iconName:"kdfont-loadingqianjing",spin:!0},key:4},l={key:7},u=[];function c(e,t,d,c){const{ncls:m,b:k,c:b,h:h,d:p,sp:v,st:g,s:f}=e,{_m0:F}=c;return[h("div",{className:m(t.computedItemClass),attrs:{title:t.label},key:0,on:F||(c._m0={click:k(t.handleClick)})},[h("span",n,[t.prefixicon?b("kd-icon",i,{classMap:o,props:{iconName:t.prefixicon},key:2}):null,t.loading?h("div",a,[b("kd-icon",i,r)]):null,g(s,6,[v(1,null,p(t.label))]),f("",l,u,d)])])]}var m=e.registerTemplate(c);c.slots=[""],c.stylesheets=[],c.stylesheetToken="kwc-44aqs8dblea",c.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\menuItem-undefined_menuItem",d&&c.stylesheets.push.apply(c.stylesheets,d),e.freezeTemplate(c);class k extends t{constructor(...e){super(...e),this.label=void 0,this.divider=void 0,this.disabled=void 0,this.prefixicon=void 0,this.loading=void 0,this.value=void 0}get computedItemClass(){return["kdds-menu-item",!0===this.disabled||"true"===this.disabled?"kdds-button-disabled":"",!0===this.loading||"true"===this.loading?"kdds-button-loading":"",!0===this.divider||"true"===this.divider?"kdds-menu-item-divider":""].filter(Boolean).join(" ")}dispatchSelect(){return this.dispatchEvent(new CustomEvent("privateselect",{bubbles:!0,cancelable:!0,detail:{value:this.value,disabled:!0===this.disabled||"true"===this.disabled||!0===this.loading||"true"===this.loading}}))}handleClick(e){e.stopPropagation(),this.disabled||this.loading||(this.dispatchEvent(new CustomEvent("click",{detail:{value:this.value,label:this.label,disabled:this.disabled,loading:this.loading}})),this.dispatchSelect())}}e.registerDecorators(k,{publicProps:{label:{config:0},divider:{config:0},disabled:{config:0},prefixicon:{config:0},loading:{config:0},value:{config:0}}});const b=e.registerComponent(k,{tmpl:m,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\menuItem-",apiVersion:63});module.exports=b;
