import{r as t,h as e,d as i}from"./p-5ab6b26f.js";import{_ as s}from"./p-a41b3114.js";class r{constructor(e){t(this,e),this.options=[],this.header=s("webmapgl.attribute-values.header"),this.limit=1,this.valueMaxWidth="200px"}componentWillLoad(){this.parseAttributeOptions()}parseAttributeOptions(){this.options="string"==typeof this.attributeOptions?JSON.parse(this.attributeOptions):this.attributeOptions}getItemsForFeature(t,i){return i.filter(e=>e.name!=this.headerAttribute&&void 0!==t.properties[e.name]).map(i=>e("ion-item",null,e("ion-label",{position:this.labelPosition},i.alias||i.name),e("ion-note",{slot:"stacked"!=this.labelPosition?"end":null,"text-wrap":!0,style:{"max-width":this.valueMaxWidth}},t.properties[i.name])))}generateOptions(t){let e=[];for(let i in t.properties)e.push({name:i});return e}render(){if(!this.features||!this.features.length)return null;let t=[];for(let i of this.features.slice(0,this.limit)){t.push(e("ion-item-divider",null,e("ion-label",null,this.headerAttribute?i.properties[this.headerAttribute]:this.header)));let s=this.options||this.generateOptions(i);Array.prototype.push.apply(t,this.getItemsForFeature(i,s))}return e("ion-list",null,t)}get el(){return i(this)}static get watchers(){return{attributeOptions:["parseAttributeOptions"]}}static get style(){return"gl-attribute-values ion-note{font-size:14px;line-height:14px;padding-top:16px;text-align:right}"}}export{r as gl_attribute_values};