bromcom-ui 2.5.3-rc.15 → 2.5.3-rc.18

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.
Files changed (37) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/{p-52455882.js → p-05d2a648.js} +1 -1
  3. package/dist/bromcom-ui/{p-6d2684e5.entry.js → p-05e103f7.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-18c578c3.entry.js → p-1796c087.entry.js} +1 -1
  5. package/dist/bromcom-ui/p-243736fd.entry.js +1 -0
  6. package/dist/bromcom-ui/{p-24747caa.entry.js → p-2eb57504.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-590ade37.entry.js → p-44b9d2db.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-3d631014.js → p-54694837.js} +1 -1
  9. package/dist/bromcom-ui/{p-eee74d8a.entry.js → p-6de27fac.entry.js} +1 -1
  10. package/dist/bromcom-ui/{p-5f3c0fe2.js → p-7ed3562c.js} +1 -1
  11. package/dist/bromcom-ui/{p-b1db1597.entry.js → p-915cf7ab.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-d6704059.entry.js → p-94f2aa5f.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-3a351dcf.entry.js → p-97dfd027.entry.js} +1 -1
  14. package/dist/bromcom-ui/{p-b81d626f.entry.js → p-9abfae2b.entry.js} +1 -1
  15. package/dist/bromcom-ui/{p-2f22d606.entry.js → p-9f7de753.entry.js} +1 -1
  16. package/dist/bromcom-ui/p-a86584a2.entry.js +1 -0
  17. package/dist/bromcom-ui/{p-0ed023fd.entry.js → p-ae69d418.entry.js} +1 -1
  18. package/dist/bromcom-ui/{p-68dceb0c.entry.js → p-b9bec852.entry.js} +1 -1
  19. package/dist/bromcom-ui/p-bfb9ca66.entry.js +1 -0
  20. package/dist/bromcom-ui/{p-05852696.entry.js → p-c052e03e.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-8dbcf336.entry.js → p-cbf9c9bb.entry.js} +1 -1
  22. package/dist/bromcom-ui/p-d2c1fddf.entry.js +1 -0
  23. package/dist/bromcom-ui/p-d6985186.entry.js +1 -0
  24. package/dist/bromcom-ui/p-d6a61c5c.js +1 -0
  25. package/dist/bromcom-ui/{p-2b2ac5e4.entry.js → p-dc22f1fa.entry.js} +1 -1
  26. package/dist/bromcom-ui/{p-54f3f4e6.entry.js → p-e3f787bb.entry.js} +1 -1
  27. package/dist/bromcom-ui/p-e6762230.js +1 -0
  28. package/dist/bromcom-ui/{p-f6ac3812.js → p-eba5a5bd.js} +1 -1
  29. package/dist/bromcom-ui/{p-061e6ed9.entry.js → p-fd59f281.entry.js} +1 -1
  30. package/package.json +1 -1
  31. package/dist/bromcom-ui/p-03dc0201.entry.js +0 -1
  32. package/dist/bromcom-ui/p-60b856e4.entry.js +0 -1
  33. package/dist/bromcom-ui/p-621c8833.entry.js +0 -1
  34. package/dist/bromcom-ui/p-8222f957.entry.js +0 -1
  35. package/dist/bromcom-ui/p-d57b41e9.entry.js +0 -1
  36. package/dist/bromcom-ui/p-d5c1d800.js +0 -1
  37. package/dist/bromcom-ui/p-eb9cfe95.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-74df82e2.js";import"./p-112455b1.js";import"./p-7294ec8e.js";import{G as n}from"./p-eba5a5bd.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-7ed3562c.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,e)=>{let s=[];return t&&(s=t.map((t=>Object.assign(Object.assign(Object.assign({},t),{parentId:r((()=>e),null)}),t.items&&t.items.length>0&&{items:r((()=>m(t.items,t.id)),[])})))),s},f=t=>r((()=>p.value.get(t)),{}),v=(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(d.slugify(e.text).indexOf(d.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=v(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=v(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}},b=(t,e,s)=>{let a;a=s&&s.length>0?s:f(t).dataSource;let i=[];return a&&i.push(v(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=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,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:r((()=>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 b(s,e),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,e){const{value:s,id:a}=t.target,i=(null==s?void 0:s.length)>=2?b(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(o,{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)}([u("data")],j.prototype,"data",void 0);export{j as bcm_search_2}