import{parseFragment as e,registerTemplate as a,freezeTemplate as s,registerDecorators as i,registerComponent as t}from"@kdcloudjs/kwc";import{c as r}from"../classSet-DY6Qvt6E.js";import{isNativeComponent as n}from"./utilsPrivate.js";import"./features.js";import{V as l}from"../normalize-B0BwrqbQ.js";import d from"./shadowBaseClassPrivate.js";import"../client-Ddi3i8XR.js";import"../ssr-C2pjZzfv.js";import"../observable-tloG64m6.js";import"../empty_html-CjXB8rB4.js";import"../i18n-B98kiI7M.js";import"../normalize-C0Pp7GJL.js";import"./iso8601Utils.js";import"../colorValid-qIPgkqGp.js";const o=e`<div class="kdds-form-element__control${0}"${2}><span class="kdds-radio${0}"${2}><input type="radio"${"a2:id"}${"a2:aria-keyshortcuts"}${"a2:aria-disabled"}${"a2:aria-roledescription"}${"a2:aria-invalid"}${"a2:accesskey"}${"a2:name"}${"a2:required"}${"a2:readonly"}${"a2:disabled"}${"a2:aria-label"}${3}><label${"a3:for"} class="kdds-radio__label${0}"${2}><span class="kdds-radio_faux${0}"${2}></span><span${"c5"}${2}>${"t6"}</span></label></span></div>`,c=e`<span class="kdds-assistive-text${0}"${2}>${"t1"}</span>`,h={"kdds-form-element__help":!0};function p(e,a,s,i){const{b:t,gid:r,ncls:n,d:l,sp:d,st:p,t:u,h:m}=e,{_m0:g}=i;return[p(o,1,[d(2,{on:g||(i._m0={blur:t(a.handleBlur),focus:t(a.handleFocus),change:t(a.handleChange)}),attrs:{id:r("radio"),"aria-keyshortcuts":a.ariaKeyShortcuts,"aria-disabled":a.ariaDisabled,"aria-roledescription":a.ariaRoleDescription,"aria-invalid":a.ariaInvalid,accesskey:a.accessKey,name:a.name,required:a.required?"":null,readonly:a.readOnly?"":null,disabled:a.disabled?"":null,"aria-label":a.ariaLabel}},null),d(3,{attrs:{for:r("radio")}},null),d(5,{className:n(a.computedLabelClass)},null),d(6,null,l(a.label))]),m("div",{classMap:h,attrs:{id:r("help-message"),"data-name":a.name,"data-help-message":"",part:"help-text",role:"status"},key:2},[a.helpMessage?p(c,4,[d(1,null,l(a.label))]):null,a.helpMessage?u(l(a.helpMessage)):null])]}var u=a(p);p.stylesheets=[],p.stylesheetToken="kwc-6ffgaputn0h",p.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveInputRadio-undefined_primitiveInputRadio",s(p);class m extends d{constructor(...e){super(...e),this.variant=void 0,this.ariaInvalid=void 0,this.ariaKeyShortcuts=void 0,this.ariaDisabled=void 0,this.ariaRoleDescription=void 0,this.accessKey=void 0,this.name=void 0,this.required=void 0,this.readOnly=void 0,this.disabled=void 0,this.label=void 0,this.ariaLabel=void 0,this.helpMessage=void 0}get checked(){return this._checked}set checked(e){this._setChecked(e)}get ariaDescribedByElements(){return this.template.querySelector("[data-help-message]")}get ariaErrorMessageElement(){return this.template.querySelector("[data-help-message]")}get isNativeShadow(){return this._isNativeShadow}get inputElement(){if(!this._cachedInputElement){const e=this.template.querySelector("input");this._cachedInputElement=e}return this._cachedInputElement}get isLabelHidden(){return this.variant===l.LABEL_HIDDEN}get computedLabelClass(){return r("kdds-form-element__label").add({"kdds-assistive-text":this.isLabelHidden}).toString()}_setChecked(e){e=Boolean(e),this._checked=e,this.rendered&&this.inputElement.checked!==this._checked&&(this.inputElement.checked=this._checked)}handleBlur(){this.dispatchEvent(new CustomEvent("blur"))}handleFocus(){this.dispatchEvent(new CustomEvent("focus"))}handleChange(e){this._setChecked(e.target.checked);const a=new CustomEvent("change",{bubbles:!0,composed:!0,detail:{checked:e.target.checked}});this.dispatchEvent(a)}connectedCallback(){super.connectedCallback(),this._isNativeShadow=n(this)}renderedCallback(){this.rendered||(this.inputElement.checked=this.checked),this.rendered=!0}disconnectedCallback(){this._cachedInputElement=void 0,this.rendered=!1}}i(m,{publicProps:{variant:{config:0},ariaInvalid:{config:0},ariaKeyShortcuts:{config:0},ariaDisabled:{config:0},ariaRoleDescription:{config:0},accessKey:{config:0},name:{config:0},required:{config:0},readOnly:{config:0},disabled:{config:0},label:{config:0},ariaLabel:{config:0},helpMessage:{config:0},checked:{config:3},ariaDescribedByElements:{config:1},ariaErrorMessageElement:{config:1},isNativeShadow:{config:1},inputElement:{config:1}}});const g=t(m,{tmpl:u,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveInputRadio-",apiVersion:63});export{g as default};
