This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
1 lines (1 loc) · 25.1 KB
/
index.js
1
(function () {function z(a){return a&&a.__esModule?{d:a.default}:{d:a}}var t=this;function rb(t){return(rb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var ga="object"==typeof t&&t&&t.Object===Object&&t;var me="object"==typeof self&&self&&self.Object===Object&&self,c=ga||me||Function("return this")();var e=c.Symbol;var Ca=Object.prototype,ge=Ca.hasOwnProperty,fe=Ca.toString,p=e?e.toStringTag:void 0;function Pc($){var r=ge.call($,p),t=$[p];try{$[p]=void 0;var n=!0}catch(o){}var a=fe.call($);return n&&(r?$[p]=t:delete $[p]),a}var ec=Object.prototype,Sb=ec.toString;function Qb(t){return Sb.call(t)}var Jb="[object Null]",Hb="[object Undefined]",fa=e?e.toStringTag:void 0;function k($){return null==$?void 0===$?Hb:Jb:fa&&fa in Object($)?Pc($):Qb($)}function n(t){return null!=t&&"object"==typeof t}var ub="[object Symbol]";function sb($){return"symbol"==typeof $||n($)&&k($)==ub}function ab(e,r){for(var t=-1,$=null==e?0:e.length,a=Array($);++t<$;)a[t]=r(e[t],t,e);return a}var y=Array.isArray;var Ya=1/0,W=e?e.prototype:void 0,Z=W?W.toString:void 0;function ne($){if("string"==typeof $)return $;if(y($))return ab($,ne)+"";if(sb($))return Z?Z.call($):"";var r=$+"";return"0"==r&&1/$==-Ya?"-0":r}function u(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function g(t,e){var $=zc(t,e);return xc($)?$:void 0}var Yb="[object AsyncFunction]",Uc="[object Function]",Qc="[object GeneratorFunction]",Dc="[object Proxy]";function na($){if(!u($))return!1;var t=k($);return t==Uc||t==Qc||t==Yb||t==Dc}var J=c["__core-js_shared__"];var ma=function(){var $=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}();function uc($){return!!ma&&ma in $}var $a=Function.prototype,Hc=$a.toString;function i(t){if(null!=t){try{return Hc.call(t)}catch(r){}try{return t+""}catch(r){}}return""}var Cc=/[\\^$.*+?()[\]{}|]/g,Gc=/^\[object .+?Constructor\]$/,cc=Function.prototype,Md=Object.prototype,wb=cc.toString,bc=Md.hasOwnProperty,tc=RegExp("^"+wb.call(bc).replace(Cc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xc($){return!(!u($)||uc($))&&(na($)?tc:Gc).test(i($))}function zc($,t){return null==$?void 0:$[t]}var P=g(c,"WeakMap");var ia=Object.create,Vc=function(){function e(){}return function(t){if(!u(t))return{};if(ia)return ia(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Zc(r,t){var $=-1,e=r.length;for(t||(t=Array(e));++$<e;)t[$]=r[$];return t}var S=function(){try{var t=g(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();function bb(t,$){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==$(t[e],e,t););return t}var fb=9007199254740991,gb=/^(?:0|[1-9]\d*)$/;function lb($,o){var r=typeof $;return!!(o=null==o?fb:o)&&("number"==r||"symbol"!=r&&gb.test($))&&$>-1&&$%1==0&&$<o}function T(e,r,$){"__proto__"==r&&S?S(e,r,{configurable:!0,enumerable:!0,value:$,writable:!0}):e[r]=$}function U($,t){return $===t||$!=$&&t!=t}var dc=Object.prototype,qc=dc.hasOwnProperty;function V($,r,e){var a=$[r];qc.call($,r)&&U(a,e)&&(void 0!==e||r in $)||T($,r,e)}function x(e,$,r,a){var s=!r;r||(r={});for(var t=-1,i=$.length;++t<i;){var u=$[t],l=a?a(r[u],e[u],u,r,e):void 0;void 0===l&&(l=e[u]),s?T(r,u,l):V(r,u,l)}return r}function X($){return null!=$&&Y($.length)&&!na($)}var Bc=9007199254740991;function Y($){return"number"==typeof $&&$>-1&&$%1==0&&$<=Bc}var Ec=Object.prototype;function N(t){var o=t&&t.constructor;return t===("function"==typeof o&&o.prototype||Ec)}function O(r){return X(r)?ca(r):kb(r)}function Ic(r,$){for(var t=-1,e=Array(r);++t<r;)e[t]=$(t);return e}var Jc="[object Arguments]";function $(e){return n(e)&&k(e)==Jc}var _=Object.prototype,$c=_.hasOwnProperty,yd=_.propertyIsEnumerable,Cd=$(function(){return arguments}())?$:function(r){return n(r)&&$c.call(r,"callee")&&!yd.call(r,"callee")};function Hd(){return!1}var aa=function(){var t={exports:this};this.__esModule=!0;var e="object"==typeof this&&this&&!this.nodeType&&this,r=e&&"object"==typeof t&&t&&!t.nodeType&&t,o=r&&r.exports===e?c.Buffer:void 0,s=(o?o.isBuffer:void 0)||Hd;return this.default=s,t.exports}.call({});var Qd="[object Arguments]",je="[object Array]",le="[object Boolean]",Da="[object Date]",Ea="[object Error]",Fa="[object Function]",Ga="[object Map]",Ha="[object Number]",Ia="[object Object]",Ja="[object RegExp]",Ka="[object Set]",La="[object String]",Ma="[object WeakMap]",Na="[object ArrayBuffer]",Oa="[object DataView]",Pa="[object Float32Array]",Qa="[object Float64Array]",Ra="[object Int8Array]",Sa="[object Int16Array]",Ta="[object Int32Array]",Ua="[object Uint8Array]",Va="[object Uint8ClampedArray]",Wa="[object Uint16Array]",Xa="[object Uint32Array]",a={};function Za($){return n($)&&Y($.length)&&!!a[k($)]}a[Pa]=a[Qa]=a[Ra]=a[Sa]=a[Ta]=a[Ua]=a[Va]=a[Wa]=a[Xa]=!0,a[Qd]=a[je]=a[Na]=a[le]=a[Oa]=a[Da]=a[Ea]=a[Fa]=a[Ga]=a[Ha]=a[Ia]=a[Ja]=a[Ka]=a[La]=a[Ma]=!1;function M(t){return function($){return t($)}}var _a=function(){var e={exports:this};this.__esModule=!0;var t="object"==typeof this&&this&&!this.nodeType&&this,r=t&&"object"==typeof e&&e&&!e.nodeType&&e,o=r&&r.exports===t&&ga.process,i=function(){try{var e=r&&r.require&&r.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(t){}}();return this.default=i,e.exports}.call({});var l=z(_a);var ba=l.d&&l.d.isTypedArray,cb=ba?M(ba):Za;var db=Object.prototype,eb=db.hasOwnProperty;function ca(r,e){var $wmt$$interop$default=z(aa);var $=y(r),a=!$&&Cd(r),t=!$&&!a&&$wmt$$interop$default.d(r),s=!$&&!a&&!t&&cb(r),i=$||a||t||s,x=i?Ic(r.length,String):[],A=x.length;for(var p in r)!e&&!eb.call(r,p)||i&&("length"==p||t&&("offset"==p||"parent"==p)||s&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||lb(p,A))||x.push(p);return x}function da(t,u){return function($){return t(u($))}}var hb=da(Object.keys,Object);var ib=Object.prototype,jb=ib.hasOwnProperty;function kb(r){if(!N(r))return hb(r);var $=[];for(var t in Object(r))jb.call(r,t)&&"constructor"!=t&&$.push(t);return $}function ea(e){return X(e)?ca(e,!0):pb(e)}function mb(r){var t=[];if(null!=r)for(var $ in Object(r))t.push($);return t}var nb=Object.prototype,ob=nb.hasOwnProperty;function pb(r){if(!u(r))return mb(r);var $=N(r),e=[];for(var t in r)("constructor"!=t||!$&&ob.call(r,t))&&e.push(t);return e}var qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pe=/^\w*$/;function f(e){var $=-1,t=null==e?0:e.length;for(this.clear();++$<t;){var a=e[$];this.set(a[0],a[1])}}function tb(){this.size=0,this.__data__={hash:new h,map:new(q||d),string:new h}}function h(t){var e=-1,$=null==t?0:t.length;for(this.clear();++e<$;){var r=t[e];this.set(r[0],r[1])}}function vb(){this.__data__=o?o(null):{},this.size=0}var o=g(Object,"create");function xb(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var yb="__lodash_hash_undefined__",zb=Object.prototype,Ab=zb.hasOwnProperty;function Bb(r){var $=this.__data__;if(o){var e=$[r];return e===yb?void 0:e}return Ab.call($,r)?$[r]:void 0}var Cb=Object.prototype,Db=Cb.hasOwnProperty;function Eb(r){var $=this.__data__;return o?void 0!==$[r]:Db.call($,r)}var Fb="__lodash_hash_undefined__";function Gb($,e){var i=this.__data__;return this.size+=this.has($)?0:1,i[$]=o&&void 0===e?Fb:e,this}h.prototype.clear=vb,h.prototype.delete=xb,h.prototype.get=Bb,h.prototype.has=Eb,h.prototype.set=Gb;function d(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}function Ib(){this.__data__=[],this.size=0}function s(e,r){for(var $=e.length;$--;)if(U(e[$][0],r))return $;return-1}var Kb=Array.prototype,Lb=Kb.splice;function Mb($){var r=this.__data__,a=s(r,$);return!(a<0)&&(a==r.length-1?r.pop():Lb.call(r,a,1),--this.size,!0)}function Nb($){var e=this.__data__,r=s(e,$);return r<0?void 0:e[r][1]}function Ob($){return s(this.__data__,$)>-1}function Pb($,e){var t=this.__data__,r=s(t,$);return r<0?(++this.size,t.push([$,e])):t[r][1]=e,this}d.prototype.clear=Ib,d.prototype.delete=Mb,d.prototype.get=Nb,d.prototype.has=Ob,d.prototype.set=Pb;var q=g(c,"Map");function Rb(e){var t=v(this,e).delete(e);return this.size-=t?1:0,t}function v(e,$){var r=e.__data__;return Tb($)?r["string"==typeof $?"string":"hash"]:r.map}function Tb(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Ub(t){return v(this,t).get(t)}function Vb(t){return v(this,t).has(t)}function Wb(t,e){var $=v(this,t),a=$.size;return $.set(t,e),this.size+=$.size==a?0:1,this}f.prototype.clear=tb,f.prototype.delete=Rb,f.prototype.get=Ub,f.prototype.has=Vb,f.prototype.set=Wb;var Xb="Expected a function";function E(e,$){if("function"!=typeof e||null!=$&&"function"!=typeof $)throw new TypeError(Xb);var t=function(){var a=arguments,r=$?$.apply(this,a):a[0],p=t.cache;if(p.has(r))return p.get(r);var c=e.apply(this,a);return t.cache=p.set(r,c)||p,c};return t.cache=new(E.Cache||f),t}E.Cache=f;var Zb=500;function $b($){var e=E($,function($){return r.size===Zb&&r.clear(),$}),r=e.cache;return e}var _b=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ac=/\\(\\)?/g,oe=$b(function(e){var $=[];return 46===e.charCodeAt(0)&&$.push(""),e.replace(_b,function(e,r,a,p){$.push(a?p.replace(ac,"$1"):r||e)}),$});function R(t,e){for(var $=-1,r=e.length,o=t.length;++$<r;)t[o+$]=e[$];return t}var ha=da(Object.getPrototypeOf,Object);function j(e){var t=this.__data__=new d(e);this.size=t.size}function fc(){this.__data__=new d,this.size=0}function gc(t){var e=this.__data__,$=e.delete(t);return this.size=e.size,$}function hc(t){return this.__data__.get(t)}function ic(t){return this.__data__.has(t)}var jc=200;function kc(p,$){var e=this.__data__;if(e instanceof d){var a=e.__data__;if(!q||a.length<jc-1)return a.push([p,$]),this.size=++e.size,this;e=this.__data__=new f(a)}return e.set(p,$),this.size=e.size,this}j.prototype.clear=fc,j.prototype.delete=gc,j.prototype.get=hc,j.prototype.has=ic,j.prototype.set=kc;function lc($,e){return $&&x(e,O(e),$)}function mc(t,$){return t&&x($,ea($),t)}var nc=function(){var t={exports:this};this.__esModule=!0;var e="object"==typeof this&&this&&!this.nodeType&&this,o=e&&"object"==typeof t&&t&&!t.nodeType&&t,r=o&&o.exports===e?c.Buffer:void 0,s=r?r.allocUnsafe:void 0;return this.default=function(t,e){if(e)return t.slice();var o=t.length,r=s?s(o):new t.constructor(o);return t.copy(r),r},t.exports}.call({});function oc($,e){return x($,L($),e)}function pc(r,t){for(var u=-1,$=null==r?0:r.length,e=0,d=[];++u<$;){var a=r[u];t(a,u,r)&&(d[e++]=a)}return d}function Q(){return[]}var rc=Object.prototype,sc=rc.propertyIsEnumerable,ja=Object.getOwnPropertySymbols,L=ja?function(r){return null==r?[]:(r=Object(r),pc(ja(r),function($){return sc.call(r,$)}))}:Q;function vc(t,$){return x(t,ka(t),$)}var wc=Object.getOwnPropertySymbols,ka=wc?function(r){for(var $=[];r;)R($,L(r)),r=ha(r);return $}:Q;function yc(e){return la(e,O,L)}function la(r,$,e){var a=$(r);return y(r)?a:R(a,e(r))}function Ac(e){return la(e,ea,ka)}var K=g(c,"DataView");var I=g(c,"Promise");var H=g(c,"Set");var oa="[object Map]",Fc="[object Object]",pa="[object Promise]",qa="[object Set]",ra="[object WeakMap]",sa="[object DataView]",Kc=i(K),Lc=i(q),Mc=i(I),Nc=i(H),Oc=i(P),m=k;(K&&m(new K(new ArrayBuffer(1)))!=sa||q&&m(new q)!=oa||I&&m(I.resolve())!=pa||H&&m(new H)!=qa||P&&m(new P)!=ra)&&(m=function($){var r=k($),a=r==Fc?$.constructor:void 0,e=a?i(a):"";if(e)switch(e){case Kc:return sa;case Lc:return oa;case Mc:return pa;case Nc:return qa;case Oc:return ra;}return r});var G=m;var Rc=Object.prototype,Sc=Rc.hasOwnProperty;function Tc(t){var r=t.length,$=new t.constructor(r);return r&&"string"==typeof t[0]&&Sc.call(t,"index")&&($.index=t.index,$.input=t.input),$}function F(r){var t=new r.constructor(r.byteLength);return new ta(t).set(new ta(r)),t}var ta=c.Uint8Array;function Wc(e,r){var t=r?F(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var Xc=/\w*$/;function Yc($){var e=new $.constructor($.source,Xc.exec($));return e.lastIndex=$.lastIndex,e}var ua=e?e.prototype:void 0,va=ua?ua.valueOf:void 0;function _c($){return va?Object(va.call($)):{}}function ad(r,e){var u=e?F(r.buffer):r.buffer;return new r.constructor(u,r.byteOffset,r.length)}var bd="[object Boolean]",cd="[object Date]",dd="[object Map]",ed="[object Number]",fd="[object RegExp]",gd="[object Set]",hd="[object String]",id="[object Symbol]",jd="[object ArrayBuffer]",kd="[object DataView]",ld="[object Float32Array]",md="[object Float64Array]",nd="[object Int8Array]",od="[object Int16Array]",pd="[object Int32Array]",qd="[object Uint8Array]",rd="[object Uint8ClampedArray]",sd="[object Uint16Array]",td="[object Uint32Array]";function ud(a,$,t){var r=a.constructor;switch($){case jd:return F(a);case bd:case cd:return new r(+a);case kd:return Wc(a,t);case ld:case md:case nd:case od:case pd:case qd:case rd:case sd:case td:return ad(a,t);case dd:return new r;case ed:case hd:return new r(a);case fd:return Yc(a);case gd:return new r;case id:return _c(a);}}function vd(e){return"function"!=typeof e.constructor||N(e)?{}:Vc(ha(e))}var wd="[object Map]";function xd($){return n($)&&G($)==wd}var wa=l.d&&l.d.isMap,zd=wa?M(wa):xd;var Ad="[object Set]";function Bd($){return n($)&&G($)==Ad}var xa=l.d&&l.d.isSet,Dd=xa?M(xa):Bd;var Ed=1,Fd=2,Gd=4,ya="[object Arguments]",Id="[object Array]",Jd="[object Boolean]",Kd="[object Date]",Ld="[object Error]",za="[object Function]",Nd="[object GeneratorFunction]",Od="[object Map]",Pd="[object Number]",Aa="[object Object]",Rd="[object RegExp]",Sd="[object Set]",Td="[object String]",Ud="[object Symbol]",Vd="[object WeakMap]",Wd="[object ArrayBuffer]",Xd="[object DataView]",Yd="[object Float32Array]",Zd="[object Float64Array]",$d="[object Int8Array]",_d="[object Int16Array]",ae="[object Int32Array]",be="[object Uint8Array]",ce="[object Uint8ClampedArray]",de="[object Uint16Array]",ee="[object Uint32Array]",b={};function w($,a,r,e,s,N){var t,P=a&Ed,Y=a&Fd,o=a&Gd;if(r&&(t=s?r($,e,s,N):r($)),void 0!==t)return t;if(!u($))return $;var l=y($);if(l){if(t=Tc($),!P)return Zc($,t)}else{var g=G($),i=g==za||g==Nd;var $wmt$$interop$default=z(aa);var $sSk5$$interop$default=z(nc);if($wmt$$interop$default.d($))return $sSk5$$interop$default.d($,P);if(g==Aa||g==ya||i&&!s){if(t=Y||i?{}:vd($),!P)return Y?vc($,mc(t,$)):oc($,lc(t,$))}else{if(!b[g])return s?$:{};t=ud($,g,P)}}N||(N=new j);var n=N.get($);if(n)return n;N.set($,t),Dd($)?$.forEach(function(e){t.add(w(e,a,r,e,$,N))}):zd($)&&$.forEach(function(e,s){t.set(s,w(e,a,r,s,$,N))});var c=o?Y?Ac:yc:Y?keysIn:O,v=l?void 0:c($);return bb(v||$,function(e,s){v&&(e=$[s=e]),V(t,s,w(e,a,r,s,$,N))}),t}b[ya]=b[Id]=b[Wd]=b[Xd]=b[Jd]=b[Kd]=b[Yd]=b[Zd]=b[$d]=b[_d]=b[ae]=b[Od]=b[Pd]=b[Aa]=b[Rd]=b[Sd]=b[Td]=b[Ud]=b[be]=b[ce]=b[de]=b[ee]=!0,b[Ld]=b[za]=b[Vd]=!1;var he=1,ie=4;function Ba($){return w($,he|ie)}function ke(t){return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var C={props:{colspan:{type:Number,default:1}},data:function(){return{type:"value"}}};if(typeof C==="function"){C=C.options}Object.assign(C,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("tfoot",{staticClass:"k-je-foot"},[_c("tr",[_c("td",{staticClass:"k-structure-table-index"}),_vm._v(" "),_c("td",{attrs:{"colspan":_vm.colspan}},[_c("p",{staticClass:"k-structure-table-text"},[_c("k-input",{attrs:{"options":[{value:"object",text:_vm.$t("oblik.json.object")},{value:"array",text:_vm.$t("oblik.json.array")},{value:"value",text:_vm.$t("oblik.json.value")}],"type":"radio"},model:{value:_vm.type,callback:function($$v){_vm.type=$$v},expression:"type"}})],1)]),_vm._v(" "),_c("td",{staticClass:"k-structure-table-option"},[_c("k-button",{attrs:{"icon":"add"},on:{"click":function($event){return _vm.$emit("add",_vm.type)}}})],1)])])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var r={components:{Foot:C},props:{value:Object,settings:Object},data:function(){return{list:null,updatingList:!1}},computed:{dragOptions:function(){return{disabled:!this.settings.isSortable,fallbackClass:"k-sortable-row-fallback"}}},methods:{keys:Object.keys,isArray:Array.isArray,generateEntryId:function(){return this.list.length},serialize:function(){return this.list.map(function(t){return t.value})},updateList:function(t){var e=this;this.updatingList=!0,this.list=[],this.value&&"object"===ke(this.value)&&(this.list=Object.keys(this.value).map(function(t){return{key:t,value:e.value[t]}})),this.$nextTick(function(){e.updatingList=!1})},add:function(t){var e={key:this.generateEntryId()};switch(t){case"value":e.value="Value";break;case"array":e.value=[];break;case"object":e.value={};}this.settings.isMutatable&&this.list.push(e)},remove:function(t){this.settings.isMutatable&&(this.list=this.list.filter(function(e){return e.key!==t}))}},watch:{value:{deep:!0,immediate:!0,handler:function(t){this.updateList(t)}},list:{deep:!0,handler:function(t){this.updatingList||this.$emit("input",this.serialize())}}}};if(typeof r==="function"){r=r.options}Object.assign(r,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",[_c("table",{staticClass:"k-structure-table",attrs:{"data-sortable":_vm.settings.isSortable?"true":false}},[_vm.list.length?_c("thead",[_c("tr",[_c("th",{staticClass:"k-structure-table-index"},[_vm._v("#")]),_vm._v(" "),_c("th",{staticClass:"k-structure-table-column"},[_vm._v(_vm._s(_vm.$t("oblik.json.value")))]),_vm._v(" "),_c("th")])]):_vm._e(),_vm._v(" "),_c("k-draggable",{attrs:{"element":"tbody","list":_vm.list,"handle":true,"options":_vm.dragOptions}},_vm._l(_vm.list,function(entry,index){return _c("tr",{key:entry.key},[_c("td",{staticClass:"k-structure-table-index"},[_vm.settings.isSortable?_c("k-sort-handle"):_vm._e(),_vm._v(" "),_c("span",{staticClass:"k-structure-table-index-number"},[_vm._v(_vm._s(index))])],1),_vm._v(" "),_c("td",{staticClass:"k-structure-table-column"},[_c("p",{staticClass:"k-structure-table-text",class:{"k-je-not-editable":!_vm.settings.isValuesEditable}},[!entry.value||typeof entry.value!=="object"?[_vm.settings.isValuesEditable?_c("k-input",{attrs:{"name":"text","type":"text"},model:{value:entry.value,callback:function($$v){_vm.$set(entry,"value",$$v)},expression:"entry.value"}}):_c("span",[_vm._v(_vm._s(entry.value))])]:_c("k-button",{attrs:{"icon":"open"},on:{"click":function($event){return _vm.$emit("open",entry.key)}}},[_vm._v(" "+_vm._s(_vm.$t("oblik.json."+(_vm.isArray(entry.value)?"array":"object")))+" ("+_vm._s(_vm.keys(entry.value).length)+" "+_vm._s(_vm.$t("oblik.json.values"))+") ")])],2)]),_vm._v(" "),_c("td",{staticClass:"k-structure-table-option"},[_c("k-button",{class:{"k-je-not-allowed":!_vm.settings.isMutatable},attrs:{"icon":"remove"},on:{"click":function($event){return _vm.remove(entry.key)}}})],1)])}),0),_vm._v(" "),_vm.settings.isMutatable?_c("Foot",{on:{"add":_vm.add}}):_vm._e()],1)])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var B={extends:r,methods:{generateEntryId:function(){return"key"+(Math.floor(9e3*Math.random())+1e3)},serialize:function(e){var r={};return this.list.forEach(function(e){void 0!==e.key&&(r[e.key]=e.value)}),r}}};if(typeof B==="function"){B=B.options}Object.assign(B,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",[_c("table",{staticClass:"k-structure-table",attrs:{"data-sortable":_vm.settings.isSortable?"true":false}},[_vm.list.length?_c("thead",[_c("tr",[_c("th",{staticClass:"k-structure-table-index"},[_vm._v("#")]),_vm._v(" "),_c("th",{staticClass:"k-structure-table-column k-je-column-header-key"},[_vm._v(_vm._s(_vm.$t("oblik.json.key")))]),_vm._v(" "),_c("th",{staticClass:"k-structure-table-column"},[_vm._v(_vm._s(_vm.$t("oblik.json.value")))]),_vm._v(" "),_c("th")])]):_vm._e(),_vm._v(" "),_c("k-draggable",{attrs:{"element":"tbody","list":_vm.list,"handle":true,"options":_vm.dragOptions}},_vm._l(_vm.list,function(entry,index){return _c("tr",{key:index},[_c("td",{staticClass:"k-structure-table-index"},[_vm.settings.isSortable?_c("k-sort-handle"):_vm._e(),_vm._v(" "),_c("span",{staticClass:"k-structure-table-index-number"},[_vm._v(_vm._s(index+1))])],1),_vm._v(" "),_c("td",{staticClass:"k-structure-table-column"},[_c("p",{staticClass:"k-structure-table-text",class:{"k-je-not-editable":!_vm.settings.isKeysEditable}},[_vm.settings.isKeysEditable?_c("k-input",{attrs:{"name":"text","type":"text"},model:{value:entry.key,callback:function($$v){_vm.$set(entry,"key",$$v)},expression:"entry.key"}}):_c("span",[_vm._v(_vm._s(entry.key))])],1)]),_vm._v(" "),_c("td",{staticClass:"k-structure-table-column"},[_c("p",{staticClass:"k-structure-table-text",class:{"k-je-not-editable":!_vm.settings.isValuesEditable}},[!entry.value||typeof entry.value!=="object"?[_vm.settings.isValuesEditable?_c("k-input",{attrs:{"name":"text","type":"text"},model:{value:entry.value,callback:function($$v){_vm.$set(entry,"value",$$v)},expression:"entry.value"}}):_c("span",[_vm._v(_vm._s(entry.value))])]:_c("k-button",{attrs:{"icon":"open"},on:{"click":function($event){return _vm.$emit("open",entry.key)}}},[_vm._v(" "+_vm._s(_vm.$t("oblik.json."+(_vm.isArray(entry.value)?"array":"object")))+" ("+_vm._s(_vm.keys(entry.value).length)+" "+_vm._s(_vm.$t("values"))+") ")])],2)]),_vm._v(" "),_c("td",{staticClass:"k-structure-table-option"},[_c("k-button",{class:{"k-je-not-allowed":!_vm.settings.isMutatable},attrs:{"icon":"remove"},on:{"click":function($event){return _vm.remove(entry.key)}}})],1)])}),0),_vm._v(" "),_vm.settings.isMutatable?_c("Foot",{attrs:{"colspan":2},on:{"add":_vm.add}}):_vm._e()],1)])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var A={components:{ObjectTable:B,ArrayTable:r},props:{value:Object,options:Object,label:{default:"Root"}},data:function(){return{data:null,path:[],settings:Object.assign({},{isKeysEditable:!0,isValuesEditable:!0,isMutatable:!0,isSortable:!0},this.options)}},computed:{location:function(){for(var t=null,e=null,a=this.data,n=0;n<this.path.length;n++){if(e=a,!a[t=this.path[n]]){this.path.splice(n);break}a=a[t]}return t&&e?{key:t,parent:e}:null},object:{get:function(){return this.location?this.location.parent[this.location.key]:this.data},set:function(t){this.location?this.location.parent[this.location.key]=t:this.data=t}},displayPath:function(){var t=this.path.map(function(t,e){return{name:t,index:e}});return t.unshift({name:this.label,index:-1}),t}},methods:{isArray:Array.isArray,openKey:function(t){this.path.push(t)},openPath:function(t){this.path.splice(t+1)},input:function(t){this.$emit("input",this.data)},isEmpty:function(t){return t&&"object"===rb(t)?!Object.keys(t).length:null}},watch:{value:{immediate:!0,handler:function(t){this.data=Ba(t)}}}};if(typeof A==="function"){A=A.options}Object.assign(A,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("k-field",[_c("header",{staticClass:"k-field-header",attrs:{"slot":"header"},slot:"header"},[_c("label",{staticClass:"k-field-label",on:{"click":function($event){$event.preventDefault()}}},[_vm._l(_vm.displayPath,function(entry){return[_c("div",{key:entry.index,staticClass:"k-je-crumb"},[entry.index<_vm.path.length-1?[_c("button",{staticClass:"k-je-label-button",on:{"click":function($event){return _vm.openPath(entry.index)}}},[_vm._v(_vm._s(entry.name))]),_vm._v(" "),_c("span",{staticClass:"k-je-separator"},[_vm._v("/")])]:_c("span",[_vm._v(_vm._s(entry.name))])],2)]})],2)]),_vm._v(" "),!_vm.isEmpty(_vm.object)||_vm.settings.isMutatable?_c(_vm.isArray(_vm.object)?"ArrayTable":"ObjectTable",{tag:"component",attrs:{"settings":_vm.settings},on:{"input":_vm.input,"open":_vm.openKey},model:{value:_vm.object,callback:function($$v){_vm.object=$$v},expression:"object"}}):_c("k-box",{attrs:{"theme":"info","text":_vm.$t("oblik.json.message.empty")}})],1)};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());function qb(t){return(qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var D={props:{value:Object,label:String,array:{default:!1},keys:{default:!1},values:{default:!0},mutate:{default:!1},sort:{default:!0}},data:function(){return{data:null,options:{isKeysEditable:this.keys,isValuesEditable:this.values,isMutatable:this.mutate,isSortable:this.sort}}},methods:{input:function(){this.$emit("input",this.data)}},watch:{value:{immediate:!0,handler:function(t){var e=Array.isArray(t),a=t&&"object"===qb(t)&&!e;this.array?e||(t=[]):a||(t={}),this.data=Ba(t)}}}};if(typeof D==="function"){D=D.options}Object.assign(D,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("k-json-editor",{attrs:{"label":_vm.label,"options":_vm.options},on:{"input":_vm.input},model:{value:_vm.data,callback:function($$v){_vm.data=$$v},expression:"data"}})};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());panel.plugin("oblik/json",{components:{"k-json-editor":A},fields:{json:D}});})();