bromcom-ui 2.6.2 → 2.6.3-new-ds.0
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-1defa77c.entry.js → p-009ea4ef.entry.js} +1 -1
- package/dist/bromcom-ui/p-054aad50.entry.js +1 -0
- package/dist/bromcom-ui/{p-df7d1483.entry.js → p-07aef975.entry.js} +1 -1
- package/dist/bromcom-ui/{p-af736ecb.entry.js → p-082e82d2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4ed1ba44.entry.js → p-0d4564e3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e8e33254.entry.js → p-138fbaec.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0820aa81.entry.js → p-14640d95.entry.js} +1 -1
- package/dist/bromcom-ui/p-16c7679f.entry.js +1 -0
- package/dist/bromcom-ui/{p-5b3acc5c.entry.js → p-276615cc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-03706b1d.entry.js → p-27734b80.entry.js} +1 -1
- package/dist/bromcom-ui/{p-17e96453.js → p-2db6a141.js} +1 -1
- package/dist/bromcom-ui/p-3373816b.entry.js +1 -0
- package/dist/bromcom-ui/{p-9efbaee9.entry.js → p-373a1ef4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6add756e.entry.js → p-3b37bf88.entry.js} +1 -1
- package/dist/bromcom-ui/p-406a7903.entry.js +1 -0
- package/dist/bromcom-ui/{p-fe283dc8.entry.js → p-41845a80.entry.js} +1 -1
- package/dist/bromcom-ui/{p-179451c0.entry.js → p-4b3d8b4b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2b12f3e0.entry.js → p-4e9bac37.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c2df4205.entry.js → p-5c9027ac.entry.js} +1 -1
- package/dist/bromcom-ui/p-5efac4c9.entry.js +1 -0
- package/dist/bromcom-ui/{p-a92fd73a.js → p-5f7aead2.js} +1 -1
- package/dist/bromcom-ui/{p-ed65a727.entry.js → p-638cf0e3.entry.js} +1 -1
- package/dist/bromcom-ui/p-6595d6c0.js +1 -0
- package/dist/bromcom-ui/p-66fbf8c0.js +1 -0
- package/dist/bromcom-ui/p-696e433b.entry.js +1 -0
- package/dist/bromcom-ui/{p-617dea7f.entry.js → p-6b0beb02.entry.js} +1 -1
- package/dist/bromcom-ui/{p-09998e65.js → p-71a83f4e.js} +1 -1
- package/dist/bromcom-ui/{p-27b9048b.entry.js → p-79484032.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ebf56611.entry.js → p-7b3bba17.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8c85689c.entry.js → p-7ba63e35.entry.js} +1 -1
- package/dist/bromcom-ui/p-8099c451.js +1 -0
- package/dist/bromcom-ui/{p-32d9f532.entry.js → p-861c1c38.entry.js} +1 -1
- package/dist/bromcom-ui/{p-65a8caa1.entry.js → p-89805518.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c3bd6b9d.entry.js → p-9b03f34e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c6087a34.js → p-9e7d3618.js} +1 -1
- package/dist/bromcom-ui/{p-0d1d3a57.entry.js → p-a578a6f0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fb7acf10.entry.js → p-b414e783.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d716cdb0.entry.js → p-bba86e15.entry.js} +1 -1
- package/dist/bromcom-ui/{p-96953d2a.entry.js → p-bc394d89.entry.js} +1 -1
- package/dist/bromcom-ui/p-bfe2448b.js +1 -0
- package/dist/bromcom-ui/p-c05b0867.entry.js +1 -0
- package/dist/bromcom-ui/p-d48a8f83.entry.js +1 -0
- package/dist/bromcom-ui/{p-04601eb4.entry.js → p-e3ccb280.entry.js} +1 -1
- package/dist/bromcom-ui/p-e4258c2a.entry.js +1 -0
- package/dist/bromcom-ui/{p-bffbcb80.entry.js → p-f72e7e82.entry.js} +1 -1
- package/dist/bromcom-ui/p-fbd97b73.entry.js +1 -0
- package/package.json +68 -68
- package/dist/bromcom-ui/p-1e1bda6a.entry.js +0 -1
- package/dist/bromcom-ui/p-249e1720.entry.js +0 -1
- package/dist/bromcom-ui/p-2bcb4c83.entry.js +0 -1
- package/dist/bromcom-ui/p-523fa22b.js +0 -1
- package/dist/bromcom-ui/p-88874c1c.js +0 -1
- package/dist/bromcom-ui/p-963478f0.entry.js +0 -1
- package/dist/bromcom-ui/p-a2a09c40.js +0 -1
- package/dist/bromcom-ui/p-bec993db.js +0 -1
- package/dist/bromcom-ui/p-c8504217.entry.js +0 -1
- package/dist/bromcom-ui/p-c9cfcb10.entry.js +0 -1
- package/dist/bromcom-ui/p-d0ee79aa.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as e,H as a,g as i}from"./p-9d960649.js";import{G as n}from"./p-8099c451.js";import"./p-112455b1.js";import"./p-7294ec8e.js";import{B as l}from"./p-af3de684.js";import{s as h}from"./p-6d018a8f.js";import{c as r}from"./p-a8b797d7.js";import{S as c}from"./p-66fbf8c0.js";import{J as d}from"./p-bb6e1bdc.js";import{d as o}from"./p-a80ff3e5.js";import{I as u}from"./p-9e7d3618.js";const{state:p}=r({value:new Map}),m=(t,s)=>{let e=[];return t&&(e=t.map((t=>Object.assign(Object.assign(Object.assign({},t),{parentId:h((()=>s),null)}),t.items&&t.items.length>0&&{items:h((()=>m(t.items,t.id)),[])})))),e},f=t=>h((()=>p.value.get(t)),{}),b=(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(c.slugify(s.text).indexOf(c.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=b(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=b(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}},v=(t,s,e)=>{let a;a=e&&e.length>0?e:f(t).dataSource;let i=[];return a&&i.push(b(t,a,s)),{result:n.flatArray(i[0].result),matching:i[0].matching,parentIndex:i[0].parentIndex,nestedResult:i[0].nestedResult}};const j=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:h((()=>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 v(e,s),this.isActiveClearable=!1,this.bcmOnSearch.emit({result:null,value:null,matching:null,parentIndex:null}),this.bcmOnSearchClear.emit(t),await o(10),Promise.resolve()}onSearchValue(t,s){const{value:e,id:a}=t.target,i=(null==e?void 0:e.length)>=2?v(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(u,{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)}([d("data")],j.prototype,"data",void 0);export{j as bcm_search_2}
|