"use strict";var e=require("@kdcloudjs/kwc"),a=require("../classSet-B5xuJbNb.js"),s=require("./utilsPrivate.js");require("./features.js");var i=require("../normalize-knoDHLvk.js"),t=require("./shadowBaseClassPrivate.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("../normalize-DKPi18vK.js"),require("./iso8601Utils.js"),require("../colorValid-BBnkvgd_.js");const r=e.parseFragment`<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>`,n=e.parseFragment`<span class="kdds-assistive-text${0}"${2}>${"t1"}</span>`,l={"kdds-form-element__help":!0};function d(e,a,s,i){const{b:t,gid:d,ncls:c,d:o,sp:h,st:u,t:p,h:m}=e,{_m0:g}=i;return[u(r,1,[h(2,{on:g||(i._m0={blur:t(a.handleBlur),focus:t(a.handleFocus),change:t(a.handleChange)}),attrs:{id:d("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),h(3,{attrs:{for:d("radio")}},null),h(5,{className:c(a.computedLabelClass)},null),h(6,null,o(a.label))]),m("div",{classMap:l,attrs:{id:d("help-message"),"data-name":a.name,"data-help-message":"",part:"help-text",role:"status"},key:2},[a.helpMessage?u(n,4,[h(1,null,o(a.label))]):null,a.helpMessage?p(o(a.helpMessage)):null])]}var c=e.registerTemplate(d);d.stylesheets=[],d.stylesheetToken="kwc-6ffgaputn0h",d.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveInputRadio-undefined_primitiveInputRadio",e.freezeTemplate(d);class o extends t{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===i.VARIANT.LABEL_HIDDEN}get computedLabelClass(){return a.classSet("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=s.isNativeComponent(this)}renderedCallback(){this.rendered||(this.inputElement.checked=this.checked),this.rendered=!0}disconnectedCallback(){this._cachedInputElement=void 0,this.rendered=!1}}e.registerDecorators(o,{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 h=e.registerComponent(o,{tmpl:c,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveInputRadio-",apiVersion:63});module.exports=h;
