This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
1 lines (1 loc) · 2.64 KB
/
index.js
1
(function(){"use strict";const F="",R="";function a(n,e,t,r,o,f,d,$){var i=typeof n=="function"?n.options:n;e&&(i.render=e,i.staticRenderFns=t,i._compiled=!0),r&&(i.functional=!0),f&&(i._scopeId="data-v-"+f);var l;if(d?(l=function(s){s=s||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!s&&typeof __VUE_SSR_CONTEXT__<"u"&&(s=__VUE_SSR_CONTEXT__),o&&o.call(this,s),s&&s._registeredComponents&&s._registeredComponents.add(d)},i._ssrRegister=l):o&&(l=$?function(){o.call(this,(i.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(i.functional){i._injectStyles=l;var C=i.render;i.render=function(w,_){return l.call(_),C(w,_)}}else{var c=i.beforeCreate;i.beforeCreate=c?[].concat(c,l):[l]}return{exports:n,options:i}}const u={props:{endpoints:Object,fields:Object,label:String,toggle:Boolean,icon:String,value:!0,name:!0},data(){let n=localStorage[`entity-open:${this.endpoints.field}`]!=="false";return{isOpen:!this.toggle||n}},computed:{form(){let n={};return Object.keys(this.fields).forEach(e=>{let t=this.fields[e];t.section=this.name,t.endpoints={field:this.endpoints.field+"+"+e,section:this.endpoints.section,model:this.endpoints.model},n[e]=t}),n}},methods:{toggleForm(){this.isOpen=!this.isOpen,localStorage[`entity-open:${this.endpoints.field}`]=this.isOpen}}};var p=function(){var e=this,t=e._self._c;return t("k-field",e._b({class:["k-structure-form",{"is-open":e.isOpen}]},"k-field",e.$props,!1),[t("section",[t(e.toggle?"button":"div",{tag:"component",staticClass:"k-entity-header",attrs:{type:e.toggle?"button":null},on:{click:function(r){e.toggle&&e.toggleForm()}}},[t("div",{staticClass:"k-entity-header-title"},[e.icon?t("k-icon",{attrs:{type:e.icon}}):e._e(),t("label",{staticClass:"k-field-label"},[e._v(e._s(e.label))])],1),e.toggle?t("k-icon",{attrs:{type:e.isOpen?"angle-up":"angle-down"}}):e._e()],1),t("k-form",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],ref:"form",staticClass:"k-structure-form-fields",attrs:{fields:e.form,value:e.value},on:{input:function(r){return e.$emit("input",r)}}})],1)])},v=[],h=a(u,p,v,!1,null,"27735f7c",null,null);const b=h.exports,g={props:{value:Object,column:Object,field:Object,row:Object},computed:{bubbles(){let n=Object.keys(this.field.fields);return[{text:`${n.length} ${this.$t(`oblik.entity-field.${n.length===1?"field":"fields"}`)}`}]}}};var m=function(){var e=this,t=e._self._c;return t("div",{staticClass:"k-bubbles-field-preview"},[t("k-bubbles",{attrs:{bubbles:e.bubbles}})],1)},y=[],k=a(g,m,y,!1,null,null,null,null);const O=k.exports;panel.plugin("oblik/entity-field",{fields:{entity:b},components:{"k-entity-field-preview":O}})})();