bromcom-ui 2.6.2-rc.4 → 2.6.2-rc.5

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 (35) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/p-0c3a753e.entry.js +1 -0
  3. package/dist/bromcom-ui/{p-cc15d4c3.entry.js → p-110d0b3c.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-5f329991.entry.js → p-188f8767.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-4e1cc302.entry.js → p-2262c963.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-599d3d84.entry.js → p-2e79b5d3.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-0e2a6011.entry.js → p-3dd8a22e.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-c8c705d8.entry.js → p-522994e9.entry.js} +1 -1
  9. package/dist/bromcom-ui/{p-4c4c041a.entry.js → p-5562f3b4.entry.js} +1 -1
  10. package/dist/bromcom-ui/{p-f6c14afb.entry.js → p-59332333.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-f06fe023.entry.js → p-613e2e52.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-a2c8f6a9.entry.js → p-61479e44.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-4308e76a.entry.js → p-61692f02.entry.js} +1 -1
  14. package/dist/bromcom-ui/{p-9e837d41.entry.js → p-651d6741.entry.js} +1 -1
  15. package/dist/bromcom-ui/{p-559a8618.entry.js → p-6ef9fe57.entry.js} +1 -1
  16. package/dist/bromcom-ui/{p-69bccbbc.js → p-814daad2.js} +1 -1
  17. package/dist/bromcom-ui/{p-60ad80b9.entry.js → p-8778b94d.entry.js} +1 -1
  18. package/dist/bromcom-ui/{p-14a01c99.entry.js → p-8817b2de.entry.js} +1 -1
  19. package/dist/bromcom-ui/p-b0a06a20.entry.js +1 -0
  20. package/dist/bromcom-ui/{p-eff1e78e.entry.js → p-b4b089b5.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-419460c7.entry.js → p-bc9603ef.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-ba062e32.entry.js → p-d002ff02.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-050a804f.entry.js → p-d1e5903a.entry.js} +1 -1
  24. package/dist/bromcom-ui/{p-9d1fb4ad.entry.js → p-d77bba9b.entry.js} +1 -1
  25. package/dist/bromcom-ui/{p-5421ac6c.entry.js → p-dd5b678d.entry.js} +1 -1
  26. package/dist/bromcom-ui/{p-b1f64013.entry.js → p-e0ee87b1.entry.js} +1 -1
  27. package/dist/bromcom-ui/p-e169f368.js +1 -0
  28. package/dist/bromcom-ui/{p-9d1353f5.entry.js → p-edf5560b.entry.js} +1 -1
  29. package/dist/bromcom-ui/{p-3d40f551.entry.js → p-f294e57b.entry.js} +1 -1
  30. package/dist/bromcom-ui/{p-d15e29c8.entry.js → p-f49d6ed7.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-bca6ad80.entry.js → p-fed284ae.entry.js} +1 -1
  32. package/package.json +1 -1
  33. package/dist/bromcom-ui/p-016b55b6.entry.js +0 -1
  34. package/dist/bromcom-ui/p-80d10b1b.entry.js +0 -1
  35. package/dist/bromcom-ui/p-e3137520.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as e,H as r,g as i}from"./p-9d960649.js";import{G as a}from"./p-814daad2.js";import"./p-60271ed7.js";import"./p-112455b1.js";import{s as d}from"./p-6d018a8f.js";import{S as o}from"./p-b8aebe79.js";const l=class{constructor(e){t(this,e),this.bcmItems=s(this,"bcm-items",7),this._id=a.UID()}connectedCallback(){if(this.el.children&&this.el.children.length>0){let t=d((()=>{var t;return Array.from(null===(t=this.el)||void 0===t?void 0:t.children).map((t=>({id:t.getAttribute("id")||a.UID(),text:t.getAttribute("text")||t.textContent.trim(),isHtmlContent:t.innerHTML.trim(),disabled:o.elementBooleanCheck(t.getAttribute("disabled")),selected:o.elementBooleanCheck(t.getAttribute("selected")),checked:o.elementBooleanCheck(t.getAttribute("checked")),readonly:o.elementBooleanCheck(t.getAttribute("readonly"))})))}),[]);this.bcmItems.emit(t),this.el.remove()}}render(){return e(r,null,e("slot",null))}get el(){return i(this)}};export{l as bcm_items}
@@ -1 +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-69bccbbc.js";import{B as l}from"./p-60271ed7.js";import"./p-112455b1.js";import"./p-7294ec8e.js";import{s as h}from"./p-6d018a8f.js";import{c as r}from"./p-a8b797d7.js";import{S as c}from"./p-b8aebe79.js";import{d}from"./p-a80ff3e5.js";import{I as o}from"./p-b7e75cee.js";import{J as u}from"./p-bb6e1bdc.js";const{state:p}=r({value:new Map}),m=(t,e)=>{let s=[];return t&&(s=t.map((t=>Object.assign(Object.assign(Object.assign({},t),{parentId:h((()=>e),null)}),t.items&&t.items.length>0&&{items:h((()=>m(t.items,t.id)),[])})))),s},f=t=>h((()=>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(c.slugify(e.text).indexOf(c.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=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:h((()=>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(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}
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-814daad2.js";import{B as l}from"./p-60271ed7.js";import"./p-112455b1.js";import"./p-7294ec8e.js";import{s as h}from"./p-6d018a8f.js";import{c as r}from"./p-a8b797d7.js";import{S as c}from"./p-b8aebe79.js";import{d}from"./p-a80ff3e5.js";import{I as o}from"./p-b7e75cee.js";import{J as u}from"./p-bb6e1bdc.js";const{state:p}=r({value:new Map}),m=(t,e)=>{let s=[];return t&&(s=t.map((t=>Object.assign(Object.assign(Object.assign({},t),{parentId:h((()=>e),null)}),t.items&&t.items.length>0&&{items:h((()=>m(t.items,t.id)),[])})))),s},f=t=>h((()=>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(c.slugify(e.text).indexOf(c.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=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:h((()=>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(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}