const t=window.webmapgl.h;import{a as e}from"./chunk-cf921ba9.js";import{a as i}from"./chunk-c82b670d.js";class r{constructor(){this.options=[],this.header=e("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(e,i){return i.filter(t=>t.name!=this.headerAttribute&&void 0!==e.properties[t.name]).map(i=>t("ion-item",null,t("ion-label",{position:this.labelPosition},i.alias||i.name),t("ion-note",{slot:"stacked"!=this.labelPosition?"end":null,"text-wrap":!0,style:{"max-width":this.valueMaxWidth}},e.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 e=[];for(let i of this.features.slice(0,this.limit)){e.push(t("ion-item-divider",null,t("ion-label",null,this.headerAttribute?i.properties[this.headerAttribute]:this.header)));let r=this.options||this.generateOptions(i);Array.prototype.push.apply(e,this.getItemsForFeature(i,r))}return t("ion-list",null,e)}static get is(){return"gl-attribute-values"}static get properties(){return{attributeOptions:{type:String,attr:"attribute-options",watchCallbacks:["parseAttributeOptions"]},el:{elementRef:!0},features:{type:"Any",attr:"features"},header:{type:String,attr:"header"},headerAttribute:{type:String,attr:"header-attribute"},labelPosition:{type:String,attr:"label-position"},limit:{type:Number,attr:"limit"},valueMaxWidth:{type:String,attr:"value-max-width"}}}static get style(){return"gl-attribute-values ion-note{font-size:14px;line-height:14px;padding-top:16px;text-align:right}"}}class s{hostData(){return{class:Object.assign({},i(this.color),{[`${this.mode}`]:!0})}}render(){return t("slot",null)}static get is(){return"ion-note"}static get encapsulation(){return"shadow"}static get properties(){return{color:{type:String,attr:"color"},mode:{type:String,attr:"mode"}}}static get style(){return".sc-ion-note-md-h{color:var(--color);font-family:var(--ion-font-family,inherit);-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-note-md-h{color:var(--ion-color-base)}.sc-ion-note-md-h{--color:var(--ion-color-step-600,#666);font-size:14px}"}static get styleMode(){return"md"}}export{r as GlAttributeValues,s as IonNote};