bromcom-ui 2.5.3-rc.12 → 2.5.3-rc.15
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.
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-8f5b45c1.entry.js → p-03dc0201.entry.js} +1 -1
- package/dist/bromcom-ui/{p-246fdf39.entry.js → p-05852696.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e9555c01.entry.js → p-061e6ed9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1ddbe999.entry.js → p-0ed023fd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1cfc284a.entry.js → p-18c578c3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9dfae3c8.entry.js → p-24747caa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-03e70a0f.entry.js → p-2b2ac5e4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a1b91c5c.entry.js → p-2f22d606.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d37c7e16.entry.js → p-3a351dcf.entry.js} +1 -1
- package/dist/bromcom-ui/p-3ecde9fb.js +1 -0
- package/dist/bromcom-ui/{p-fd9b3bed.entry.js → p-54f3f4e6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0e7bd7ae.entry.js → p-590ade37.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6f820747.entry.js → p-60b856e4.entry.js} +1 -1
- package/dist/bromcom-ui/p-621c8833.entry.js +1 -0
- package/dist/bromcom-ui/{p-94942523.entry.js → p-68dceb0c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-90c833e1.entry.js → p-6d2684e5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0fb1ce1f.entry.js → p-8222f957.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7ead2f00.entry.js → p-8dbcf336.entry.js} +1 -1
- package/dist/bromcom-ui/p-b1db1597.entry.js +1 -0
- package/dist/bromcom-ui/{p-cd5b3aca.entry.js → p-b81d626f.entry.js} +1 -1
- package/dist/bromcom-ui/p-d57b41e9.entry.js +1 -0
- package/dist/bromcom-ui/{p-b8f5b72a.js → p-d5c1d800.js} +1 -1
- package/dist/bromcom-ui/{p-1c217ae4.entry.js → p-d6704059.entry.js} +1 -1
- package/dist/bromcom-ui/{p-08b12ba7.entry.js → p-eee74d8a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-60bd0bfb.js → p-f6ac3812.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-6b9df4d0.entry.js +0 -1
- package/dist/bromcom-ui/p-c2310a66.entry.js +0 -1
- package/dist/bromcom-ui/p-e01e2951.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e}from"./p-74df82e2.js";import"./p-112455b1.js";import{c as h}from"./p-7294ec8e.js";import{G as a}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i,H as e}from"./p-74df82e2.js";import"./p-112455b1.js";import{c as h}from"./p-7294ec8e.js";import{G as a}from"./p-f6ac3812.js";import{a as r}from"./p-7e73190d.js";import"./p-6d018a8f.js";import{d as n}from"./p-84313244.js";import{C as l}from"./p-6d80e6e8.js";import{I as c}from"./p-960bf518.js";var o;!function(t){t.none="none",t.both="both",t.horizontal="horizontal",t.vertical="vertical",t.initial="initial",t.inherit="inherit"}(o||(o={}));const p=class{constructor(i){t(this,i),this.focus=s(this,"bcm-focus",7),this.blur=s(this,"bcm-blur",7),this.clear=s(this,"bcm-clear",7),this.change=s(this,"bcm-change",7),this.input=s(this,"bcm-input",7),this._id=a.UID(),this._internal_id=a.UID(),this.hidden=!1,this.required=!1,this.noCaption=!1,this.captionType=r.Status.default,this.rows=3,this.size=r.Size.medium,this.readonly=!1,this.resize=o.vertical,this.fullWidth=!1,this.focused=!1}connectedCallback(){this.captionCache=this.caption,this.captionTypeCache=this.captionType}async onBcmFocus(){this.textarea.focus()}async onBcmBlur(){this.textarea.blur()}async onBcmSelect(){this.textarea.select()}async set(t){await this.setValue(t)}async get(){return this.value||null}async setValue(t){return this.textarea.value=t,this.value=t,this.handleChange(),t}async setClear(){return this.textarea.value="",this.value="",await n(10),Promise.resolve()}async resetCaption(){this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null}async getValue(){return this.value}watchValue(){this.handleChange()}handleFocus(){this.focused=!0,this.focus.emit()}handleBlur(){this.focused=!1,this.blur.emit()}handleChange(){this.value=this.textarea.value,this.change.emit(this.value)}handleInput(){this.value=this.textarea.value,this.input.emit(this.value)}handleClear(t){this.textarea.value="",this.value="",this.clear.emit(),this.textarea.focus(),t.stopPropagation()}render(){const{_id:t,hidden:s,readonly:a,fullWidth:n,size:o,rows:p,disabled:d,clearable:u,label:m,focused:b,noCaption:f,caption:y,captionError:C,captionType:g,value:j,resize:w,maxLength:v,placeholder:B,required:x}=this,z=h("bcm-input",{hidden:s,"full-width":n});return i(e,{class:z},m&&i("bcm-label",{type:g,value:m,required:x,htmlFor:t}),i(c,{elementType:r.HtmlElementType.textarea,id:t,value:j,rows:p,disabled:d,maxLength:v,placeholder:B,clearable:u,resize:w,readonly:a,size:o,focused:b,handleFocus:()=>this.handleFocus(),handleBlur:()=>this.handleBlur(),handleChange:()=>this.handleChange(),handleInput:()=>this.handleInput(),handleClear:t=>this.handleClear(t),ref:t=>this.textarea=t}),i(l,{noCaption:f,captionType:g,captionError:C,caption:y,value:j,maxLength:v}))}static get watchers(){return{value:["watchValue"]}}};export{p as bcm_textarea}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as s,h as t,H as h}from"./p-74df82e2.js";import"./p-112455b1.js";import{c as e}from"./p-7294ec8e.js";import{G as a}from"./p-
|
|
1
|
+
import{r as i,c as s,h as t,H as h}from"./p-74df82e2.js";import"./p-112455b1.js";import{c as e}from"./p-7294ec8e.js";import{G as a}from"./p-f6ac3812.js";import{a as r}from"./p-7e73190d.js";import"./p-6d018a8f.js";import{d as n}from"./p-84313244.js";import{S as l}from"./p-5f3c0fe2.js";import{C as o}from"./p-6d80e6e8.js";import{N as c}from"./p-44d6172f.js";import{V as u}from"./p-7bc3a736.js";import{I as p}from"./p-960bf518.js";const d=class{constructor(t){i(this,t),this.focus=s(this,"bcm-focus",7),this.blur=s(this,"bcm-blur",7),this.clear=s(this,"bcm-clear",7),this.change=s(this,"bcm-change",7),this.input=s(this,"bcm-input",7),this._id=a.UID(),this._internal_id=a.UID(),this.value="",this.size=r.Size.medium,this.disabled=!1,this.readonly=!1,this.clearable=!1,this.type=r.InputType.text,this.hidden=!1,this.required=!1,this.fullWidth=!1,this.noMargin=!1,this.disableWatchValue=!1,this.passwordToggle=!1,this.maxLength=null,this.unitPrefix=null,this.decimal=!0,this.noCaption=!1,this.captionType=r.Status.default,this.inValid=!1,this.valueCache="",this.focused=!1,this.isPasswordVisible=!1,this.isBlur=!1}connectedCallback(){this.valueCache=this.value,this.captionCache=this.caption,this.captionTypeCache=this.captionType}componentWillRender(){const{type:i,isBlur:s,value:t}=this;if(t)switch(i){case"number":!this.checkValid("number")&&this.validationRange();break;case"email":s&&this.checkValid("email");break;case"tel":s&&this.checkValid("phone")}}async onBcmFocus(){this.inputElement.focus()}async onBcmBlur(){this.inputElement.blur()}async onBcmSelect(){this.inputElement.select()}async set(i){await this.setValue(i)}async get(){return this.value||null}async setValue(i){return this.inputElement.value=i,this.value=i,this.handleChange(),i}async setClear(){return this.inputElement.value="",this.value="",await n(10),Promise.resolve()}async resetCaption(){this.caption=this.captionCache,this.captionType=this.captionTypeCache,this.captionError=null}async getValue(){return this.value}watchValue(){this.disableWatchValue||"number"==this.type||this.handleChange()}listenKeyDown(i){if(!this.disabled&&!this.readonly&&(this.onBcmFocus(),"number"==this.type)){var s=i.which||0,t=i.key;38==s&&(i.preventDefault(),this.stepUpOrDown("up")),40==s&&(i.preventDefault(),this.stepUpOrDown("down")),(190==s||110==s||"."==t)&&this.value.indexOf(".")>-1&&i.preventDefault(),189!=s&&109!=s&&"-"!=t||("-"==this.value.charAt(0)||this.value.indexOf("-")>-1)&&i.preventDefault()}}handleFocus(){this.focused=!0,this.focus.emit(),this.whatchHasFocus()}handleBlur(){this.focused=!1,this.isBlur=!0,this.whatchHasFocus(),this.blur.emit()}handleChange(){this.value=this.inputElement.value,this.change.emit(this.value)}handleInput(){this.value=this.inputElement.value,this.input.emit(this.value)}handleClear(i){this.inputElement.value="",this.value="",this.inputElement.focus(),this.clear.emit(i),i.stopPropagation()}changePasswordVisibility(){this.isPasswordVisible=!this.isPasswordVisible}setCaption(i=null,s=null){this.caption=i||this.captionCache,this.captionType=s||this.captionTypeCache,this.captionError="error"==s?i:null}stepUpOrDown(i){if(!this.inValid&&!this.disabled&&!this.readonly){let s=+this.step||1,t=+this.value;t="up"==i?+(t+s):+(t-s),this.value=t}}validationRange(){const{min:i,max:s,value:t}=this;if(t)if(i&&s){if(t<i||t>s)return this.setCaption(l.getMessage("between",[i,s]),"error"),!1}else if(i){if(t<i)return this.setCaption(l.getMessage("min",[i]),"error"),!1}else if(s&&t>s)return this.setCaption(l.getMessage("max",[s]),"error"),!1;return this.setCaption(),!0}checkValid(i){const{value:s}=this;return u.isValidate(s,i)?(this.setCaption(),this.inValid=!1):(this.setCaption(l.getMessage(i),"error"),this.inValid=!0),this.inValid}whatchHasFocus(){const{type:i,focused:s,valueCache:t,inValid:h}=this;i==r.InputType.number&&h&&(this.value=s?"":l.isNullOrEmpty(this.value)?t:this.value?this.fixToNumber(this.value):"")}fixToNumber(i){if(i){const s=c.getDecimalLength(this.step);return s>0?c.parseFloatFixed(i,s):i}return i}render(){const{value:i,size:s,label:a,type:r,captionType:n,caption:l,captionError:c,placeholder:u,fullWidth:d,disabled:m,readonly:f,clearable:b,passwordToggle:y,isPasswordVisible:w,noDefaultIcon:g,unit:C,inValid:V,focused:j,unitPrefix:v,noCaption:x,required:B,hidden:P,noMargin:I,_id:T}=this,k=(null==i?void 0:i.length)>0&&b,F=e("bcm-input",{hidden:P,"no-margin":I,"full-width":d,"size-1":"small"===s||"medium"===s,"size-2":"large"===s});return t(h,{tabindex:"-1",onfocus:()=>this.onBcmFocus(),class:F,onClick:()=>this.onBcmFocus()},a&&t("bcm-label",{tooltip:this.tooltip,type:n,value:a,required:B,htmlFor:T}),t(p,{id:T,type:r,value:i,placeholder:u,disabled:m,readonly:f,clearable:k,passwordToggle:y,isPasswordVisible:w,noDefaultIcon:g,focused:j,inValid:V,unitPrefix:v,maxLength:this.maxLength,internalId:this._internal_id,captionType:n,unit:C,size:s,handleFocus:()=>this.handleFocus(),handleBlur:()=>this.handleBlur(),handleChange:()=>this.handleChange(),handleInput:()=>this.handleInput(),steps:i=>this.stepUpOrDown(i),changePasswordVisibility:()=>this.changePasswordVisibility(),handleClear:i=>this.handleClear(i),ref:i=>this.inputElement=i,_suffix:this._suffix,_prefix:this._prefix}),t(o,{noCaption:x,captionType:n,captionError:c,caption:l}))}static get watchers(){return{value:["watchValue"]}}};export{d as bcm_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,H as a,g as i}from"./p-74df82e2.js";import"./p-112455b1.js";import"./p-7294ec8e.js";import{G as n}from"./p-
|
|
1
|
+
import{r as t,c as s,h as e,H as a,g as i}from"./p-74df82e2.js";import"./p-112455b1.js";import"./p-7294ec8e.js";import{G as n}from"./p-f6ac3812.js";import{a as l}from"./p-7e73190d.js";import{c as h}from"./p-a5403cdb.js";import{s as r}from"./p-6d018a8f.js";import{d as c}from"./p-84313244.js";import{S as d}from"./p-5f3c0fe2.js";import{I as o}from"./p-960bf518.js";import{J as u}from"./p-20d1fe2f.js";const{state:p}=h({value:new Map}),m=(t,s)=>{let e=[];return t&&(e=t.map((t=>Object.assign(Object.assign(Object.assign({},t),{parentId:r((()=>s),null)}),t.items&&t.items.length>0&&{items:r((()=>m(t.items,t.id)),[])})))),e},f=t=>r((()=>p.value.get(t)),{}),v=(t,s,e)=>{let a=[],i=[],n=[],l=[];const{searchIsOnlyChilds:h}=f(t);return s&&s.length>0&&s.forEach((s=>{let r=h&&null!==s.parentId;if(d.slugify(s.text).indexOf(d.slugify(e))>-1&&(!h||h&&r)){if(n.push(s.id),a.push(s.id),i.push(s.id),l.push({id:s.id,text:s.text,parentId:s.parentId}),s.items&&s.items.length>0){const i=v(t,s.items,e);i.matching.length>0&&i.matching.forEach((t=>{a.push(t)}))}}else if(s.items&&s.items.length>0){const h=v(t,s.items,e);h.result.length>0&&(h.result.forEach((t=>{n.push(t)})),n.push(s.id),i.push(s.id),l.push({id:s.id,text:s.text,parentId:s.parentId,items:h.nestedResult})),h.matching.length>0&&a.push(...h.matching)}})),{result:n,matching:a,parentIndex:i,nestedResult:l}},j=(t,s,e)=>{let a;a=e&&e.length>0?e:f(t).dataSource;let i=[];return a&&i.push(v(t,a,s)),{result:n.flatArray(i[0].result),matching:i[0].matching,parentIndex:i[0].parentIndex,nestedResult:i[0].nestedResult}};const b=class{constructor(e){t(this,e),this.bcmOnSearch=s(this,"bcm-on-search",7),this.bcmOnSearchClear=s(this,"bcm-on-search-clear",7),this._id=n.UID(),this.placeholder="Search",this.disabled=!1,this.readonly=!1,this.clearable=!0,this.size=l.Size.medium,this.limit=10,this.searchIsOnlyChilds=!1,this.data=[],this.tick={},this.isActiveClearable=!1,this.debounceHandler=n.debounceInput((t=>this.onSearchValue(t,this)),300,!1,(()=>{var t,s;this.isActiveClearable=(null===(s=null===(t=this.inputElement)||void 0===t?void 0:t.value)||void 0===s?void 0:s.length)>0&&this.clearable}))}async componentDidLoad(){await this.initState()}async dataChanged(t,s){t!==s&&await this.initState()}async initState(){await(t=>{const{id:s,dataSource:e}=t,a={id:r((()=>s),n.UID),dataSource:e&&e.length>0&&m(e),searchIsOnlyChilds:t.searchIsOnlyChilds};p.value.set(a.id,a)})({id:this._id,dataSource:this.data,searchIsOnlyChilds:this.searchIsOnlyChilds}),await this.markForCheck()}markForCheck(){this.tick=n.UID()}handleInput(){}async onBcmFocus(){this.inputElement.focus()}async onBcmBlur(){this.inputElement.blur()}async onBcmSelect(){this.inputElement.select()}async setValue(t){this.inputElement.value=t}handleFocus(){}handleBlur(){}handleChange(){}async handleClear(t=!0){this.inputElement.value="";const{value:s,id:e}=this.inputElement;return j(e,s),this.isActiveClearable=!1,this.bcmOnSearch.emit({result:null,value:null,matching:null,parentIndex:null}),this.bcmOnSearchClear.emit(t),await c(10),Promise.resolve()}onSearchValue(t,s){const{value:e,id:a}=t.target,i=(null==e?void 0:e.length)>=2?j(a,e,null):null,{bcmOnSearch:n,inputElement:l}=s;n.emit({result:null==i?void 0:i.result,value:null==l?void 0:l.value,matching:null==i?void 0:i.matching,parentIndex:null==i?void 0:i.parentIndex,nestedResult:null==i?void 0:i.nestedResult})}render(){const{_id:t,placeholder:s,disabled:i,readonly:n}=this;return e(a,{onClick:()=>{this.onBcmFocus(),this.onBcmSelect()}},e(o,{size:this.size,id:t,type:"search",placeholder:s,disabled:i,"full-width":!0,readonly:n,clearable:this.isActiveClearable,handleFocus:()=>this.handleFocus(),handleBlur:()=>this.handleBlur(),handleChange:()=>this.handleChange(),handleClear:()=>this.handleClear(),handleInput:this.debounceHandler,ref:t=>this.inputElement=t}))}get el(){return i(this)}static get watchers(){return{data:["dataChanged"]}}};!function(t,s,e,a){var i,n=arguments.length,l=n<3?s:null===a?a=Object.getOwnPropertyDescriptor(s,e):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,s,e,a);else for(var h=t.length-1;h>=0;h--)(i=t[h])&&(l=(n<3?i(l):n>3?i(s,e,l):i(s,e))||l);n>3&&l&&Object.defineProperty(s,e,l)}([u("data")],b.prototype,"data",void 0);export{b as bcm_search_2}
|