bromcom-ui 2.6.2-rc.2 → 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.
- package/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-0c3a753e.entry.js +1 -0
- package/dist/bromcom-ui/{p-53e90cc7.entry.js → p-110d0b3c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6f668896.entry.js → p-188f8767.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4d50937f.entry.js → p-2262c963.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4d60a245.entry.js → p-2e79b5d3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e1048959.entry.js → p-3dd8a22e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d0094756.entry.js → p-522994e9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1ac0a418.entry.js → p-5562f3b4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cf55e6f6.entry.js → p-59332333.entry.js} +1 -1
- package/dist/bromcom-ui/{p-175be4f6.entry.js → p-613e2e52.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c2434e91.entry.js → p-61479e44.entry.js} +1 -1
- package/dist/bromcom-ui/{p-93755d42.entry.js → p-61692f02.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b193b79b.entry.js → p-651d6741.entry.js} +1 -1
- package/dist/bromcom-ui/{p-88947288.entry.js → p-6ef9fe57.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bd08f7d5.js → p-814daad2.js} +1 -1
- package/dist/bromcom-ui/{p-90299e83.entry.js → p-8778b94d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8aa72ee7.entry.js → p-8817b2de.entry.js} +1 -1
- package/dist/bromcom-ui/p-b0a06a20.entry.js +1 -0
- package/dist/bromcom-ui/{p-bdd7ab5c.entry.js → p-b4b089b5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-988ea49a.entry.js → p-bc9603ef.entry.js} +1 -1
- package/dist/bromcom-ui/{p-90541ece.entry.js → p-d002ff02.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b873746a.entry.js → p-d1e5903a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-21d3d5f8.entry.js → p-d77bba9b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-76f8a564.entry.js → p-dd5b678d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a23b2b20.entry.js → p-e0ee87b1.entry.js} +1 -1
- package/dist/bromcom-ui/p-e169f368.js +1 -0
- package/dist/bromcom-ui/{p-60c93508.entry.js → p-edf5560b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-56eb12fb.entry.js → p-f294e57b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-976f5b05.entry.js → p-f49d6ed7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ef678571.entry.js → p-fed284ae.entry.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-c89bac13.entry.js +0 -1
- package/dist/bromcom-ui/p-d66fe737.entry.js +0 -1
- package/dist/bromcom-ui/p-e4a29f1d.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-
|
|
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}
|