@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
- "use strict";var e=require("@kdcloudjs/kwc"),t=require("../baseInput-BMsvcc48.js"),s=require("./icon.js"),n=require("./utilsPrivate.js"),a=require("../index.esm-skOXaaoq.js"),i=require("../normalize-DKPi18vK.js"),o=require("../utils-HAAanx64.js");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("./iso8601Utils.js"),require("../colorValid-BBnkvgd_.js"),require("./features.js"),require("../normalize-knoDHLvk.js");var l=[t.stylesheet0,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 r=e.parseFragment`<div dir="auto"${"a0:title"}${3}>${"t1"}</div>`,u=e.parseFragment`<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>`,c=e.parseFragment`<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}>`,d=e.parseFragment`<div dir="auto" class="kdds-status-message${0}"${2}>${"t1"}</div>`,h=e.parseFragment`<div class="kdds-data-count${0}"${2}>${"t1"}</div>`,p={"kdds-input-element":!0},m={classMap:{"kdds-input-container-label":!0},key:2},g={props:{iconName:"kdfont-required-indicator"},key:5},k={classMap:{"kdds-icon-container":!0},key:7},w={classMap:{"kdds-icon-container":!0},key:13},_={"kdds-icon-button":!0},y={"kdds-icon-button":!0,"kdds-icon-search":!0};function b(e,t,n,a){const{b:i,ncls:o,d:l,sp:b,st:x,c:$,h:f,gid:I}=e,{_m0:v,_m1:z,_m2:S,_m3:L,_m4:N,_m5:j,_m6:q,_m7:C,_m8:T,_m9:V}=a;return[f("div",{classMap:p,key:0,on:v||(a._m0={click:i(t.focus)})},[f("div",{className:o(t.computeInputContainerClass),ref:"container",key:1,on:z||(a._m1={mouseenter:i(t.handleMouseEnter),mouseleave:i(t.handleMouseLeave)})},[f("label",m,[x(r,4,[b(0,{attrs:{title:t.label}},null),b(1,null,l(t.label))]),t.required?$("kd-icon",s,g):null]),f("div",{className:o(t.computedInputPartClass),key:6},[f("div",k,[t.showPrefixIcon?$("kd-icon",s,{props:{iconName:t.prefixIcon},key:8}):null]),t.isTextarea?x(u,10,[b(0,{on:L||(a._m3={paste:i(t.handlePaste),click:i(t.handleClick),keydown:i(t.handleKeydown),blur:i(t.handleBlur),change:i(t.handleChange),focus:i(t.handleFocus),input:i(t.handleInput)}),className:o(t.computeInputClass),attrs:{rows:t.rows,autocomplete:t.autocomplete,autosize:t.autoSize,disabled:t.disabled?"":null,id:I("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:x(c,12,[b(0,{on:j||(a._m5={paste:i(t.handlePaste),click:i(t.handleClick),keydown:i(t.handleKeydown),blur:i(t.handleBlur),change:i(t.handleChange),focus:i(t.handleFocus),input:i(t.handleInput)}),className:o(t.computeInputClass),attrs:{autocomplete:t.autocomplete,disabled:t.disabled?"":null,id:I("input"),name:t.name,maxlength:t.maxLength,minlength:t.minLength,placeholder:t.placeholder,type:t.type,title:t._value,readonly:t.readOnly?"":null}},null)]),f("div",w,[t.showInputIcon?f("div",{className:o(t.computedInputIconClass),key:14,on:q||(a._m6={click:i(t.clearAndSetFocusOnInput),mousedown:i(t.handleInputIconMouseDown)})},[$("kd-icon",s,{props:{iconName:t.inputIconName,size:t.getIconSize},key:15})]):null,t.showToggleButton?f("div",{classMap:_,key:16,on:C||(a._m7={click:i(t.togglePasswordVisible),mousedown:i(t.handleInputIconMouseDown)})},[$("kd-icon",s,{props:{iconName:t.toggleIconName,size:t.getIconSize},key:17})]):null,t.showSearchIcon?f("div",{classMap:y,key:18,on:T||(a._m8={click:i(t.handleSearch)})},[$("kd-icon",s,{props:{iconName:"kdfont-sousuo2",size:t.getIconSize},key:19})]):null,t.showSuffixIcon?f("div",{classMap:_,key:20,on:V||(a._m9={click:i(t.handleSuffixIconClick),mousedown:i(t.handleSuffixIconMouseDown)})},[$("kd-icon",s,{props:{iconName:t.suffixIcon,size:t.getIconSize},key:21})]):null])])]),t.isShowMessage?x(d,23,[b(1,null,l(t.message))]):null,t.isTextarea?x(h,25,[b(1,null,l(t.countData))]):null])]}var x=e.registerTemplate(b);b.hasRefs=!0,b.stylesheets=[],b.stylesheetToken="kwc-6da59epmbb4",b.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-undefined_input",l&&b.stylesheets.push.apply(b.stylesheets,l),e.freezeTemplate(b);class $ extends t.__kwc_component_class_internal{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){n.isNotUndefinedOrNull(e)&&(this._maxLength=Math.min(e,this._maxLength))}get passwordVisible(){return this._passwordVisible}set passwordVisible(e){this._passwordVisible=i.normalizeBoolean(e)}get rows(){return this._rows}set rows(e){this._rows=i.normalizeNumber(e,{fallbackValue:3})}get autoSize(){return this._autoSize}set autoSize(e){if(!("[object Object]"!==Object.prototype.toString.call(e)||i.isNotNumber(e.minRows)&&i.isNotNumber(e.maxRows))){const t={};return i.isNotNumber(e.minRows)||(t.minRows=e.minRows),i.isNotNumber(e.maxRows)||(t.maxRows=e.maxRows),void(this._autoSize=Object.keys(t).length>0&&t)}this._autoSize=i.normalizeBoolean(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=o.calculateNodeHeight(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(a.g("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()}}e.registerDecorators($,{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 f=e.registerComponent($,{tmpl:x,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-",apiVersion:63});module.exports=f;
1
+ "use strict";var e=require("@kdcloudjs/kwc"),t=require("../baseInput-BMsvcc48.js"),s=require("./icon.js"),n=require("./utilsPrivate.js"),a=require("../index.esm-skOXaaoq.js"),i=require("../normalize-DKPi18vK.js"),o=require("../utils-HAAanx64.js");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("./iso8601Utils.js"),require("../colorValid-BBnkvgd_.js"),require("./features.js"),require("../normalize-knoDHLvk.js");var l=[t.stylesheet0,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 r=e.parseFragment`<div dir="auto"${"a0:title"}${3}>${"t1"}</div>`,u=e.parseFragment`<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>`,c=e.parseFragment`<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}>`,d=e.parseFragment`<div dir="auto" class="kdds-status-message${0}"${2}>${"t1"}</div>`,h=e.parseFragment`<div class="kdds-data-count${0}"${2}>${"t1"}</div>`,p={"kdds-input-element":!0},m={classMap:{"kdds-input-container-label":!0},key:2},g={props:{iconName:"kdfont-required-indicator"},key:5},k={classMap:{"kdds-icon-container":!0},key:7},w={classMap:{"kdds-icon-container":!0},key:13},y={"kdds-icon-button":!0},_={"kdds-icon-button":!0,"kdds-icon-search":!0};function b(e,t,n,a){const{b:i,ncls:o,d:l,sp:b,st:x,c:$,h:f,gid:I}=e,{_m0:v,_m1:z,_m2:S,_m3:L,_m4:N,_m5:j,_m6:q,_m7:C,_m8:T,_m9:V}=a;return[f("div",{classMap:p,key:0,on:v||(a._m0={click:i(t.focus)})},[f("div",{className:o(t.computeInputContainerClass),ref:"container",key:1,on:z||(a._m1={mouseenter:i(t.handleMouseEnter),mouseleave:i(t.handleMouseLeave)})},[f("label",m,[x(r,4,[b(0,{attrs:{title:t.label}},null),b(1,null,l(t.label))]),t.required?$("kd-icon",s,g):null]),f("div",{className:o(t.computedInputPartClass),key:6},[f("div",k,[t.showPrefixIcon?$("kd-icon",s,{props:{iconName:t.prefixIcon},key:8}):null]),t.isTextarea?x(u,10,[b(0,{on:L||(a._m3={paste:i(t.handlePaste),click:i(t.handleClick),keydown:i(t.handleKeydown),blur:i(t.handleBlur),change:i(t.handleChange),focus:i(t.handleFocus),input:i(t.handleInput)}),className:o(t.computeInputClass),attrs:{rows:t.rows,autocomplete:t.autocomplete,autosize:t.autoSize,disabled:t.disabled?"":null,id:I("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:x(c,12,[b(0,{on:j||(a._m5={paste:i(t.handlePaste),click:i(t.handleClick),keydown:i(t.handleKeydown),blur:i(t.handleBlur),change:i(t.handleChange),focus:i(t.handleFocus),input:i(t.handleInput)}),className:o(t.computeInputClass),attrs:{autocomplete:t.autocomplete,disabled:t.disabled?"":null,id:I("input"),name:t.name,maxlength:t.maxLength,minlength:t.minLength,placeholder:t.placeholder,type:t.type,title:t._value,readonly:t.readOnly?"":null}},null)]),f("div",w,[t.showInputIcon?f("div",{className:o(t.computedInputIconClass),key:14,on:q||(a._m6={click:i(t.clearAndSetFocusOnInput),mousedown:i(t.handleInputIconMouseDown)})},[$("kd-icon",s,{props:{iconName:t.inputIconName,size:t.getIconSize},key:15})]):null,t.showToggleButton?f("div",{classMap:y,key:16,on:C||(a._m7={click:i(t.togglePasswordVisible),mousedown:i(t.handleInputIconMouseDown)})},[$("kd-icon",s,{props:{iconName:t.toggleIconName,size:t.getIconSize},key:17})]):null,t.showSearchIcon?f("div",{classMap:_,key:18,on:T||(a._m8={click:i(t.handleSearch)})},[$("kd-icon",s,{props:{iconName:"kdfont-sousuo2",size:t.getIconSize},key:19})]):null,t.showSuffixIcon?f("div",{classMap:y,key:20,on:V||(a._m9={click:i(t.handleSuffixIconClick),mousedown:i(t.handleSuffixIconMouseDown)})},[$("kd-icon",s,{props:{iconName:t.suffixIcon,size:t.getIconSize},key:21})]):null])])]),t.isShowMessage?x(d,23,[b(1,null,l(t.message))]):null,t.isTextarea?x(h,25,[b(1,null,l(t.countData))]):null])]}var x=e.registerTemplate(b);b.hasRefs=!0,b.stylesheets=[],b.stylesheetToken="kwc-6da59epmbb4",b.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-undefined_input",l&&b.stylesheets.push.apply(b.stylesheets,l),e.freezeTemplate(b);class $ extends t.__kwc_component_class_internal{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){n.isNotUndefinedOrNull(e)&&(this._maxLength=Math.min(e,this._maxLength))}get passwordVisible(){return!(this.disabled||this.readonly)&&this._passwordVisible}set passwordVisible(e){this._passwordVisible=i.normalizeBoolean(e)}get rows(){return this._rows}set rows(e){this._rows=i.normalizeNumber(e,{fallbackValue:3})}get autoSize(){return this._autoSize}set autoSize(e){if(!("[object Object]"!==Object.prototype.toString.call(e)||i.isNotNumber(e.minRows)&&i.isNotNumber(e.maxRows))){const t={};return i.isNotNumber(e.minRows)||(t.minRows=e.minRows),i.isNotNumber(e.maxRows)||(t.maxRows=e.maxRows),void(this._autoSize=Object.keys(t).length>0&&t)}this._autoSize=i.normalizeBoolean(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=o.calculateNodeHeight(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(a.g("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()}}e.registerDecorators($,{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 f=e.registerComponent($,{tmpl:x,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\input-",apiVersion:63});module.exports=f;