import{r as t,h as n,H as o}from"./p-38dcedc4.js";import{n as e}from"./p-8d47f7b8.js";import{O as i,a as r}from"./p-63e3a721.js";import"./p-c3d35135.js";import"./p-202e7480.js";import"./p-f2660943.js";import"./p-5a5a5c96.js";function l(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function s(t){return function n(o){return 0===arguments.length||l(o)?n:t.apply(this,arguments)}}var c=s((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function a(t,n,o,e){var i,r=function(i){for(var r=n.length,l=0;l<r;){if(t===n[l])return o[l];l+=1}for(var s in n[l+1]=t,o[l+1]=i,t)i[s]=e?a(t[s],n,o,!0):t[s];return i};switch(c(t)){case"Object":return r({});case"Array":return r([]);case"Date":return new Date(t.valueOf());case"RegExp":return i=t,new RegExp(i.source,(i.global?"g":"")+(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.sticky?"y":"")+(i.unicode?"u":""));default:return t}}var u=s((function(t){return null!=t&&"function"==typeof t.clone?t.clone():a(t,[],[],!0)}));const h=class{constructor(n){t(this,n),this.model=null,this.modelObj={},this.cfg=[],this.showCfg=[]}watchModel(){this.calcShowCfg()}watchModelObj(){this.calcShowCfg()}watchCfg(){this.calcShowCfg()}componentWillLoad(){this.calcShowCfg()}calcShowCfg(){this.showCfg=[],u(this.cfg).filter((t=>{t.methods=t.methods.filter((t=>this.modelObj[t.name])),e(t.methods)&&this.showCfg.push(t)}))}openModelView(t){t.isArray?i.arrModel(t):t.isObj&&i.objModel(t)}render(){return n(o,null,this.showCfg.map((t=>n("ion-list",null,n("ion-list-header",{lines:"full",color:"light"},n("ion-label",null,t.group)),(t.methods||[]).map((t=>{const o=this.modelObj[t.name];if(!o)return null;const e=`${t.desc}(${o.key})`;return n("ion-item",{button:!o.isDefault,detail:!o.isDefault,onClick:()=>this.openModelView(o)},n("ion-label",null,n("h3",{title:e},e),o.isArray||o.isObj?null:n("ion-note",{title:o.value},n("ion-note",{color:"secondary"},"值："),o.value)),o.isArray?n("ion-badge",{color:"secondary",slot:"end"},o.data.length):o.enableOpenDesign?n("div",{class:"list-item-actions",slot:"end"},n("ion-button",{onClick:t=>{t.stopPropagation(),r.openDesignView(o.model)}},"设计")):null)}))))))}static get watchers(){return{model:["watchModel"],modelObj:["watchModelObj"],cfg:["watchCfg"]}}};h.style=":host{display:block}";export{h as ibz_model_list}