@kdcloudjs/kingdee-base-components 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{parseFragment as e,registerTemplate as t,freezeTemplate as s,registerDecorators as n,registerComponent as a}from"@kdcloudjs/kwc";import{s as i,_ as o}from"../baseInput-KeVoo1vH.js";import l from"./icon.js";import{isNotUndefinedOrNull as r}from"./utilsPrivate.js";import{g as c}from"../index.esm-DycIHCS9.js";import{b as d,a as u,i as p}from"../normalize-C0Pp7GJL.js";import{c as m}from"../utils-CB_20U-G.js";import"./shadowBaseClassPrivate.js";import"../client-Ddi3i8XR.js";import"../ssr-C2pjZzfv.js";import"../observable-tloG64m6.js";import"../empty_html-CjXB8rB4.js";import"../i18n-B98kiI7M.js";import"./iso8601Utils.js";import"../colorValid-qIPgkqGp.js";import"./features.js";import"../normalize-B0BwrqbQ.js";var h=[i,function(e,t,s){var n=e?"["+e+"]":"";return(t?":host .kdds-input-container.kdds-input-container-large":(e?"["+e+"-host]":"")+" .kdds-input-container.kdds-input-container-large")+n+" .kdds-icon-container"+n+"{--kdds-c-icon-font-size: 20px;}"}];const g=e`<div dir="auto"${"a0:title"}${3}>${"t1"}</div>`,k=e`<textarea${"a0:rows"}${"a0:autocomplete"}${"a0:autosize"}${"c0"}${"a0:disabled"}${"a0:id"} part="input"${"a0:name"}${"a0:maxlength"}${"a0:minlength"}${"a0:placeholder"}${"a0:type"}${"a0:readonly"}${2}></textarea>`,w=e`<input${"a0:autocomplete"}${"c0"}${"a0:disabled"}${"a0:id"} part="input"${"a0:name"}${"a0:maxlength"}${"a0:minlength"}${"a0:placeholder"}${"a0:type"}${"a0:title"}${"a0:readonly"}${2}>`,y=e`<div dir="auto" class="kdds-status-message${0}"${2}>${"t1"}</div>`,_=e`<div class="kdds-data-count${0}"${2}>${"t1"}</div>`,x={"kdds-input-element":!0},b={classMap:{"kdds-input-container-label":!0},key:2},f={props:{iconName:"kdfont-required-indicator"},key:5},$={classMap:{"kdds-icon-container":!0},key:7},I={classMap:{"kdds-icon-container":!0},key:13},v={"kdds-icon-button":!0},S={"kdds-icon-button":!0,"kdds-icon-search":!0};function L(e,t,s,n){const{b:a,ncls:i,d:o,sp:r,st:c,c:d,h:u,gid:p}=e,{_m0:m,_m1:h,_m2:L,_m3:z,_m4:j,_m5:C,_m6:V,_m7:M,_m8:N,_m9:T}=n;return[u("div",{classMap:x,key:0,on:m||(n._m0={click:a(t.focus)})},[u("div",{className:i(t.computeInputContainerClass),ref:"container",key:1,on:h||(n._m1={mouseenter:a(t.handleMouseEnter),mouseleave:a(t.handleMouseLeave)})},[u("label",b,[c(g,4,[r(0,{attrs:{title:t.label}},null),r(1,null,o(t.label))]),t.required?d("kd-icon",l,f):null]),u("div",{className:i(t.computedInputPartClass),key:6},[u("div",$,[t.showPrefixIcon?d("kd-icon",l,{props:{iconName:t.prefixIcon},key:8}):null]),t.isTextarea?c(k,10,[r(0,{on:z||(n._m3={paste:a(t.handlePaste),click:a(t.handleClick),keydown:a(t.handleKeydown),blur:a(t.handleBlur),change:a(t.handleChange),focus:a(t.handleFocus),input:a(t.handleInput)}),className:i(t.computeInputClass),attrs:{rows:t.rows,autocomplete:t.autocomplete,autosize:t.autoSize,disabled:t.disabled?"":null,id:p("textarea"),name:t.name,maxlength:t.maxLength,minlength:t.minLength,placeholder:t.placeholder,type:t.type,readonly:t.readOnly?"":null}},null)]):null,t.isTextarea?null:c(w,12,[r(0,{on:C||(n._m5={paste:a(t.handlePaste),click:a(t.handleClick),keydown:a(t.handleKeydown),blur:a(t.handleBlur),change:a(t.handleChange),focus:a(t.handleFocus),input:a(t.handleInput)}),className:i(t.computeInputClass),attrs:{autocomplete:t.autocomplete,disabled:t.disabled?"":null,id:p("input"),name:t.name,maxlength:t.maxLength,minlength:t.minLength,placeholder:t.placeholder,type:t.type,title:t._value,readonly:t.readOnly?"":null}},null)]),u("div",I,[t.showInputIcon?u("div",{className:i(t.computedInputIconClass),key:14,on:V||(n._m6={click:a(t.clearAndSetFocusOnInput),mousedown:a(t.handleInputIconMouseDown)})},[d("kd-icon",l,{props:{iconName:t.inputIconName,size:t.getIconSize},key:15})]):null,t.showToggleButton?u("div",{classMap:v,key:16,on:M||(n._m7={click:a(t.togglePasswordVisible),mousedown:a(t.handleInputIconMouseDown)})},[d("kd-icon",l,{props:{iconName:t.toggleIconName,size:t.getIconSize},key:17})]):null,t.showSearchIcon?u("div",{classMap:S,key:18,on:N||(n._m8={click:a(t.handleSearch)})},[d("kd-icon",l,{props:{iconName:"kdfont-sousuo2",size:t.getIconSize},key:19})]):null,t.showSuffixIcon?u("div",{classMap:v,key:20,on:T||(n._m9={click:a(t.handleSuffixIconClick),mousedown:a(t.handleSuffixIconMouseDown)})},[d("kd-icon",l,{props:{iconName:t.suffixIcon,size:t.getIconSize},key:21})]):null])])]),t.isShowMessage?c(y,23,[r(1,null,o(t.message))]):null,t.isTextarea?c(_,25,[r(1,null,o(t.countData))]):null])]}var z=t(L);L.hasRefs=!0,L.stylesheets=[],L.stylesheetToken="kwc-6da59epmbb4",L.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-undefined_input",h&&L.stylesheets.push.apply(L.stylesheets,h),s(L);class j extends o{constructor(...e){super(...e),this._passwordVisible=!1,this._maxLength=2e3,this._minLength=void 0,this._autoSize=!1}get minLength(){return this._minLength}set minLength(e){this._minLength=e}get maxLength(){return this._maxLength}set maxLength(e){r(e)&&(this._maxLength=Math.min(e,this._maxLength))}get passwordVisible(){return this._passwordVisible}set passwordVisible(e){this._passwordVisible=d(e)}get rows(){return this._rows}set rows(e){this._rows=u(e,{fallbackValue:3})}get autoSize(){return this._autoSize}set autoSize(e){if(!("[object Object]"!==Object.prototype.toString.call(e)||p(e.minRows)&&p(e.maxRows))){const t={};return p(e.minRows)||(t.minRows=e.minRows),p(e.maxRows)||(t.maxRows=e.maxRows),void(this._autoSize=Object.keys(t).length>0&&t)}this._autoSize=d(e)}get showToggleButton(){return this.passwordVisible&&"password"===this._initialType}get showSearchIcon(){return"search"===this._initialType}get isTextarea(){return"textarea"===this._initialType}get toggleIconName(){return"password"!==this._type?"kdfont-biyan":"kdfont-xianshikongjian2"}get computeInputClass(){return"kdds-input "+(this.showSearchIcon?`kdds-input-${this.size}`:"")}get countData(){return this._maxLength>0?`${this._value.length}/${this.maxLength}`:""}setTextareaStyle(){if(this.isTextarea&&this.inputElement&&this._autoSize){const{minRows:e=null,maxRows:t=null}=this._autoSize,s=m(this.inputElement,e,t);s&&this.inputElement.setAttribute("style",s)}}_handleBlur(e){this.checkValidity(e.target.value)}checkValidity(e){e.length<this.minLength&&this.setCustomValidity(c("input.minLength",{params:{minLength:this.minLength}}))}handleClick(){this.dispatchEvent(new CustomEvent("privateclick"))}togglePasswordVisible(e){e.stopPropagation(),"password"===this.type?this._type="text":this._type="password"}renderedCallback(){this.setTextareaStyle()}}n(j,{publicProps:{minLength:{config:3},maxLength:{config:3},passwordVisible:{config:3},rows:{config:3},autoSize:{config:3}},track:{_passwordVisible:1,_maxLength:1,_minLength:1,_autoSize:1}});const C=a(j,{tmpl:z,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-",apiVersion:63});export{C as default};
1
+ import{parseFragment as e,registerTemplate as t,freezeTemplate as s,registerDecorators as n,registerComponent as a}from"@kdcloudjs/kwc";import{s as i,_ as o}from"../baseInput-KeVoo1vH.js";import l from"./icon.js";import{isNotUndefinedOrNull as r}from"./utilsPrivate.js";import{g as d}from"../index.esm-DycIHCS9.js";import{b as c,a as u,i as p}from"../normalize-C0Pp7GJL.js";import{c as h}from"../utils-CB_20U-G.js";import"./shadowBaseClassPrivate.js";import"../client-Ddi3i8XR.js";import"../ssr-C2pjZzfv.js";import"../observable-tloG64m6.js";import"../empty_html-CjXB8rB4.js";import"../i18n-B98kiI7M.js";import"./iso8601Utils.js";import"../colorValid-qIPgkqGp.js";import"./features.js";import"../normalize-B0BwrqbQ.js";var m=[i,function(e,t,s){var n=e?"["+e+"]":"";return(t?":host .kdds-input-container.kdds-input-container-large":(e?"["+e+"-host]":"")+" .kdds-input-container.kdds-input-container-large")+n+" .kdds-icon-container"+n+"{--kdds-c-icon-font-size: 20px;}"}];const g=e`<div dir="auto"${"a0:title"}${3}>${"t1"}</div>`,k=e`<textarea${"a0:rows"}${"a0:autocomplete"}${"a0:autosize"}${"c0"}${"a0:disabled"}${"a0:id"} part="input"${"a0:name"}${"a0:maxlength"}${"a0:minlength"}${"a0:placeholder"}${"a0:type"}${"a0:readonly"}${2}></textarea>`,w=e`<input${"a0:autocomplete"}${"c0"}${"a0:disabled"}${"a0:id"} part="input"${"a0:name"}${"a0:maxlength"}${"a0:minlength"}${"a0:placeholder"}${"a0:type"}${"a0:title"}${"a0:readonly"}${2}>`,y=e`<div dir="auto" class="kdds-status-message${0}"${2}>${"t1"}</div>`,_=e`<div class="kdds-data-count${0}"${2}>${"t1"}</div>`,x={"kdds-input-element":!0},b={classMap:{"kdds-input-container-label":!0},key:2},f={props:{iconName:"kdfont-required-indicator"},key:5},$={classMap:{"kdds-icon-container":!0},key:7},I={classMap:{"kdds-icon-container":!0},key:13},v={"kdds-icon-button":!0},S={"kdds-icon-button":!0,"kdds-icon-search":!0};function L(e,t,s,n){const{b:a,ncls:i,d:o,sp:r,st:d,c:c,h:u,gid:p}=e,{_m0:h,_m1:m,_m2:L,_m3:z,_m4:j,_m5:C,_m6:V,_m7:M,_m8:N,_m9:T}=n;return[u("div",{classMap:x,key:0,on:h||(n._m0={click:a(t.focus)})},[u("div",{className:i(t.computeInputContainerClass),ref:"container",key:1,on:m||(n._m1={mouseenter:a(t.handleMouseEnter),mouseleave:a(t.handleMouseLeave)})},[u("label",b,[d(g,4,[r(0,{attrs:{title:t.label}},null),r(1,null,o(t.label))]),t.required?c("kd-icon",l,f):null]),u("div",{className:i(t.computedInputPartClass),key:6},[u("div",$,[t.showPrefixIcon?c("kd-icon",l,{props:{iconName:t.prefixIcon},key:8}):null]),t.isTextarea?d(k,10,[r(0,{on:z||(n._m3={paste:a(t.handlePaste),click:a(t.handleClick),keydown:a(t.handleKeydown),blur:a(t.handleBlur),change:a(t.handleChange),focus:a(t.handleFocus),input:a(t.handleInput)}),className:i(t.computeInputClass),attrs:{rows:t.rows,autocomplete:t.autocomplete,autosize:t.autoSize,disabled:t.disabled?"":null,id:p("textarea"),name:t.name,maxlength:t.maxLength,minlength:t.minLength,placeholder:t.placeholder,type:t.type,readonly:t.readOnly?"":null}},null)]):null,t.isTextarea?null:d(w,12,[r(0,{on:C||(n._m5={paste:a(t.handlePaste),click:a(t.handleClick),keydown:a(t.handleKeydown),blur:a(t.handleBlur),change:a(t.handleChange),focus:a(t.handleFocus),input:a(t.handleInput)}),className:i(t.computeInputClass),attrs:{autocomplete:t.autocomplete,disabled:t.disabled?"":null,id:p("input"),name:t.name,maxlength:t.maxLength,minlength:t.minLength,placeholder:t.placeholder,type:t.type,title:t._value,readonly:t.readOnly?"":null}},null)]),u("div",I,[t.showInputIcon?u("div",{className:i(t.computedInputIconClass),key:14,on:V||(n._m6={click:a(t.clearAndSetFocusOnInput),mousedown:a(t.handleInputIconMouseDown)})},[c("kd-icon",l,{props:{iconName:t.inputIconName,size:t.getIconSize},key:15})]):null,t.showToggleButton?u("div",{classMap:v,key:16,on:M||(n._m7={click:a(t.togglePasswordVisible),mousedown:a(t.handleInputIconMouseDown)})},[c("kd-icon",l,{props:{iconName:t.toggleIconName,size:t.getIconSize},key:17})]):null,t.showSearchIcon?u("div",{classMap:S,key:18,on:N||(n._m8={click:a(t.handleSearch)})},[c("kd-icon",l,{props:{iconName:"kdfont-sousuo2",size:t.getIconSize},key:19})]):null,t.showSuffixIcon?u("div",{classMap:v,key:20,on:T||(n._m9={click:a(t.handleSuffixIconClick),mousedown:a(t.handleSuffixIconMouseDown)})},[c("kd-icon",l,{props:{iconName:t.suffixIcon,size:t.getIconSize},key:21})]):null])])]),t.isShowMessage?d(y,23,[r(1,null,o(t.message))]):null,t.isTextarea?d(_,25,[r(1,null,o(t.countData))]):null])]}var z=t(L);L.hasRefs=!0,L.stylesheets=[],L.stylesheetToken="kwc-6da59epmbb4",L.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-undefined_input",m&&L.stylesheets.push.apply(L.stylesheets,m),s(L);class j extends o{constructor(...e){super(...e),this._passwordVisible=!1,this._maxLength=2e3,this._minLength=void 0,this._autoSize=!1}get minLength(){return this._minLength}set minLength(e){this._minLength=e}get maxLength(){return this._maxLength}set maxLength(e){r(e)&&(this._maxLength=Math.min(e,this._maxLength))}get passwordVisible(){return!(this.disabled||this.readonly)&&this._passwordVisible}set passwordVisible(e){this._passwordVisible=c(e)}get rows(){return this._rows}set rows(e){this._rows=u(e,{fallbackValue:3})}get autoSize(){return this._autoSize}set autoSize(e){if(!("[object Object]"!==Object.prototype.toString.call(e)||p(e.minRows)&&p(e.maxRows))){const t={};return p(e.minRows)||(t.minRows=e.minRows),p(e.maxRows)||(t.maxRows=e.maxRows),void(this._autoSize=Object.keys(t).length>0&&t)}this._autoSize=c(e)}get showToggleButton(){return this.passwordVisible&&"password"===this._initialType}get showSearchIcon(){return"search"===this._initialType}get isTextarea(){return"textarea"===this._initialType}get toggleIconName(){return"password"!==this._type?"kdfont-biyan":"kdfont-xianshikongjian2"}get computeInputClass(){return"kdds-input "+(this.showSearchIcon?`kdds-input-${this.size}`:"")}get countData(){return this._maxLength>0?`${this._value.length}/${this.maxLength}`:""}setTextareaStyle(){if(this.isTextarea&&this.inputElement&&this._autoSize){const{minRows:e=null,maxRows:t=null}=this._autoSize,s=h(this.inputElement,e,t);s&&this.inputElement.setAttribute("style",s)}}_handleBlur(e){this.checkValidity(e.target.value)}checkValidity(e){e.length<this.minLength&&this.setCustomValidity(d("input.minLength",{params:{minLength:this.minLength}}))}handleClick(){this.dispatchEvent(new CustomEvent("privateclick"))}togglePasswordVisible(e){e.stopPropagation(),"password"===this.type?this._type="text":this._type="password"}renderedCallback(){super.renderedCallback(),this.setTextareaStyle()}}n(j,{publicProps:{minLength:{config:3},maxLength:{config:3},passwordVisible:{config:3},rows:{config:3},autoSize:{config:3}},track:{_passwordVisible:1,_maxLength:1,_minLength:1,_autoSize:1}});const C=a(j,{tmpl:z,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-",apiVersion:63});export{C as default};