System.register(["./index-c820db66.system.js","./index-2d937df8.system.js","./_commonjsHelpers-c8881874.system.js"],(function(t){"use strict";var e,i,s,o,l;return{setters:[function(t){e=t.r;i=t.j;s=t.h;o=t.g},function(t){l=t.d},function(){}],execute:function(){var n={Edit:"Redigera",Delete:"Radera",Add:"Lägg till",Cancel:"Avbryt",Save:"Spara"};function a(t){return l.create({sv:n},t)}var d=".sc-ig-display-edit-h{display:block}[hidden].sc-ig-display-edit-h{display:none}smoothly-submit.sc-ig-display-edit,smoothly-submit.sc-ig-display-edit>button.sc-ig-display-edit{background-color:transparent;border:none;cursor:pointer;color:transparent;width:auto;float:right;margin-bottom:.5em}smoothly-input.sc-ig-display-edit,smoothly-select.sc-ig-display-edit{border:1px solid rgb(var(--smoothly-medium-color))}smoothly-select.sc-ig-display-edit{display:grid}.sc-ig-display-edit-h:hover>form.sc-ig-display-edit>smoothly-popup.sc-ig-display-edit{display:block;margin:0;float:right}.sc-ig-display-edit-h>form.sc-ig-display-edit>smoothly-popup.sc-ig-display-edit{display:none}smoothly-icon.sc-ig-display-edit{cursor:pointer}.sc-ig-display-edit-h:hover>form.sc-ig-display-edit>smoothly-icon.sc-ig-display-edit{visibility:visible}.sc-ig-display-edit-h>form.sc-ig-display-edit>smoothly-icon.sc-ig-display-edit{margin:0;float:right;margin-top:-1.8em;visibility:hidden}";var c=t("ig_display_edit",function(){function t(t){e(this,t);this.changed=i(this,"changed",7);this.type="text";this.deletable=true;this.adding=false;this.mode="display"}t.prototype.componentWillLoad=function(){if(this.select&&this.value)this.selected=this.value;this.t=a(this.element)};t.prototype.onSubmit=function(t){var e;this.mode="display";this.changed.emit(this.value=this.select?(e=this.selected)!==null&&e!==void 0?e:this.select[this.select.length-1]:t.detail.value)};t.prototype.onDelete=function(){this.changed.emit(this.value=undefined);this.reset()};t.prototype.reset=function(){this.mode="display";this.adding=false};t.prototype.onSelectionChanged=function(t){this.selected=t.detail.value};t.prototype.render=function(){var t=this;return s("form",null,this.mode=="display"&&this.value?[s("smoothly-popup",null,s("smoothly-icon",{name:"ellipsis-vertical-outline",size:"small"}),s("div",{color:"light",slot:"popup"},s("smoothly-icon",{size:"small",name:"pencil-outline",toolTip:this.t("Edit"),onClick:function(){return t.mode="input"}}),this.deletable?s("smoothly-icon",{size:"small",name:"trash",toolTip:this.t("Delete"),onClick:function(){return t.onDelete()}}):[]))]:[],!this.value||this.value==""?s("smoothly-icon",{name:"add-circle",toolTip:this.t("Add"),fill:"clear",size:"medium",color:"success",style:this.adding?{display:"none"}:{},onClick:function(){return t.adding=true,t.mode="input"}}):[],this.mode=="display"?s("smoothly-display",{type:this.type,value:this.value}):[this.select?s("smoothly-select",{background:"transparent"},this.select.map((function(e){return t.selected&&t.selected==e?s("option",{value:e,selected:true},e.charAt(0).toUpperCase()+e.slice(1)):s("option",{value:e},e.charAt(0).toUpperCase()+e.slice(1))}))):s("smoothly-input",{type:this.type,value:this.value,name:"value"},this.name),s("div",null,s("smoothly-submit",{prevent:true,onSubmit:function(e){return t.onSubmit(e)}},s("smoothly-icon",{name:"checkmark-circle",toolTip:this.t("Save"),color:"success",fill:"clear",size:"small"})),s("smoothly-submit",{prevent:true,onSubmit:function(){return t.reset()}},s("smoothly-icon",{name:"close-circle",toolTip:this.t("Cancel"),color:"light",fill:"clear",size:"small"})))])};Object.defineProperty(t.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());c.style=d}}}));