bromcom-ui 2.6.3-new-ds.8 → 2.6.3-new-ds.9
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-74aa2176.entry.js → p-0000432d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d9425fbe.entry.js → p-011ec14e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-09142901.entry.js → p-04f23a6b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6a859d69.entry.js → p-162f1dec.entry.js} +1 -1
- package/dist/bromcom-ui/p-17212b08.js +1 -0
- package/dist/bromcom-ui/{p-89c25214.entry.js → p-1b4aba6e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cf5ad9d4.entry.js → p-1c575d5e.entry.js} +1 -1
- package/dist/bromcom-ui/p-1f8f1206.entry.js +1 -0
- package/dist/bromcom-ui/{p-70a660e0.entry.js → p-398cb9e8.entry.js} +1 -1
- package/dist/bromcom-ui/p-3bad21e1.entry.js +1 -0
- package/dist/bromcom-ui/{p-47ed86a8.entry.js → p-40597d4f.entry.js} +1 -1
- package/dist/bromcom-ui/p-454ec0e2.entry.js +1 -0
- package/dist/bromcom-ui/{p-928cee2d.entry.js → p-539448e6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c4dea783.entry.js → p-5e06fe0a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-70799f2a.js → p-5f27ea68.js} +1 -1
- package/dist/bromcom-ui/{p-faf83b02.entry.js → p-62fbfdf5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-954793b0.entry.js → p-674ac6e3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3b49e87b.entry.js → p-69b1b925.entry.js} +1 -1
- package/dist/bromcom-ui/{p-12f814a7.entry.js → p-6dbabdb4.entry.js} +1 -1
- package/dist/bromcom-ui/p-6e62aaf0.entry.js +1 -0
- package/dist/bromcom-ui/{p-3e9f1a7d.entry.js → p-70ed2d65.entry.js} +1 -1
- package/dist/bromcom-ui/{p-92ea4a0c.entry.js → p-73fb4bd5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bdbabd34.entry.js → p-77b00fb3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0f107ed9.entry.js → p-79aa0679.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e89ee7b2.entry.js → p-7b823512.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e21b1cc4.entry.js → p-813c55ce.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c1bb16b8.entry.js → p-847f11b9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1a490f2e.entry.js → p-9828fa7e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bad9a42c.entry.js → p-a6f07c65.entry.js} +1 -1
- package/dist/bromcom-ui/{p-863863ba.js → p-b9dc88ef.js} +1 -1
- package/dist/bromcom-ui/{p-4d6d86d7.entry.js → p-bf01eb5a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b56f235c.entry.js → p-c4690b81.entry.js} +1 -1
- package/dist/bromcom-ui/{p-526d9fd3.entry.js → p-c62abe10.entry.js} +1 -1
- package/dist/bromcom-ui/{p-30117311.entry.js → p-cb374b2a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1f5458a0.entry.js → p-d0760324.entry.js} +1 -1
- package/dist/bromcom-ui/p-d176e589.entry.js +1 -0
- package/dist/bromcom-ui/{p-a7a0c136.entry.js → p-d5ce81d7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d177b66c.entry.js → p-d6b5bd80.entry.js} +1 -1
- package/dist/bromcom-ui/{p-15b9e894.entry.js → p-da5e27ac.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fb1b8035.entry.js → p-e1d13bed.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f228fa2f.entry.js → p-e1e01dc9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-01d5c069.entry.js → p-e965e8c6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ce68ba55.entry.js → p-f096166d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a4c15f4f.entry.js → p-fd428bbb.entry.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-01304b46.entry.js +0 -1
- package/dist/bromcom-ui/p-22551623.entry.js +0 -1
- package/dist/bromcom-ui/p-5315e23d.entry.js +0 -1
- package/dist/bromcom-ui/p-8cda3d39.entry.js +0 -1
- package/dist/bromcom-ui/p-a64df54a.entry.js +0 -1
- package/dist/bromcom-ui/p-bd52a6af.entry.js +0 -1
- package/dist/bromcom-ui/p-c34d9014.entry.js +0 -1
- package/dist/bromcom-ui/p-cabaa43d.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as s,H as a,g as i}from"./p-9d960649.js";import{G as n}from"./p-5f27ea68.js";import{s as l}from"./p-6d018a8f.js";import{J as h}from"./p-bb6e1bdc.js";import{B as r}from"./p-beba9505.js";import"./p-112455b1.js";import"./p-7294ec8e.js";import{c}from"./p-a8b797d7.js";import{S as o}from"./p-208caef1.js";import{d}from"./p-a80ff3e5.js";import{I as u}from"./p-17212b08.js";const{state:p}=c({value:new Map}),m=(t,e)=>{let s=[];return t&&(s=t.map((t=>Object.assign(Object.assign(Object.assign({},t),{parentId:l((()=>e),null)}),t.items&&t.items.length>0&&{items:l((()=>m(t.items,t.id)),[])})))),s},f=t=>l((()=>p.value.get(t)),{}),b=(t,e,s)=>{let a=[],i=[],n=[],l=[];const{searchIsOnlyChilds:h}=f(t);return e&&e.length>0&&e.forEach((e=>{let r=h&&null!==e.parentId;if(o.slugify(e.text).indexOf(o.slugify(s))>-1&&(!h||h&&r)){if(n.push(e.id),a.push(e.id),i.push(e.id),l.push({id:e.id,text:e.text,parentId:e.parentId}),e.items&&e.items.length>0){const i=b(t,e.items,s);i.matching.length>0&&i.matching.forEach((t=>{a.push(t)}))}}else if(e.items&&e.items.length>0){const h=b(t,e.items,s);h.result.length>0&&(h.result.forEach((t=>{n.push(t)})),n.push(e.id),i.push(e.id),l.push({id:e.id,text:e.text,parentId:e.parentId,items:h.nestedResult})),h.matching.length>0&&a.push(...h.matching)}})),{result:n,matching:a,parentIndex:i,nestedResult:l}},v=(t,e,s)=>{let a;a=s&&s.length>0?s:f(t).dataSource;let i=[];return a&&i.push(b(t,a,e)),{result:n.flatArray(i[0].result),matching:i[0].matching,parentIndex:i[0].parentIndex,nestedResult:i[0].nestedResult}};const j=class{constructor(s){t(this,s),this.bcmOnSearch=e(this,"bcm-on-search",7),this.bcmOnSearchClear=e(this,"bcm-on-search-clear",7),this._id=n.UID(),this.placeholder="Search",this.disabled=!1,this.readonly=!1,this.clearable=!0,this.size=r.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,e;this.isActiveClearable=(null===(e=null===(t=this.inputElement)||void 0===t?void 0:t.value)||void 0===e?void 0:e.length)>0&&this.clearable}))}async componentDidLoad(){await this.initState()}async dataChanged(t,e){t!==e&&await this.initState()}async initState(){await(t=>{const{id:e,dataSource:s}=t,a={id:l((()=>e),n.UID),dataSource:s&&s.length>0&&m(s),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:e,id:s}=this.inputElement;return v(s,e),this.isActiveClearable=!1,this.bcmOnSearch.emit({result:null,value:null,matching:null,parentIndex:null}),this.bcmOnSearchClear.emit(t),await d(10),Promise.resolve()}onSearchValue(t,e){const{value:s,id:a}=t.target,i=(null==s?void 0:s.length)>=2?v(a,s,null):null,{bcmOnSearch:n,inputElement:l}=e;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:e,disabled:i,readonly:n}=this;return s(a,{onClick:()=>{this.onBcmFocus(),this.onBcmSelect()}},s(u,{size:this.size,id:t,type:"search",placeholder:e,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,e,s,a){var i,n=arguments.length,l=n<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,s):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,s,a);else for(var h=t.length-1;h>=0;h--)(i=t[h])&&(l=(n<3?i(l):n>3?i(e,s,l):i(e,s))||l);n>3&&l&&Object.defineProperty(e,s,l)}([h("data")],j.prototype,"data",void 0);export{j as bcm_search_2}
|