You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue-json-pretty

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-json-pretty - npm Package Compare versions

Comparing version

to
1.8.2

2

lib/vue-json-pretty.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueJsonPretty=t():e.VueJsonPretty=t()}(this,(function(){return function(){"use strict";var e={810:function(e,t,o){function l(e,t,o,l,n,s,a,i){var c,r="function"==typeof e?e.options:e;if(t&&(r.render=t,r.staticRenderFns=o,r._compiled=!0),l&&(r.functional=!0),s&&(r._scopeId="data-v-"+s),a?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},r._ssrRegister=c):n&&(c=i?function(){n.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:n),c)if(r.functional){r._injectStyles=c;var h=r.render;r.render=function(e,t){return c.call(t),h(e,t)}}else{var d=r.beforeCreate;r.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:r}}o.r(t),o.d(t,{default:function(){return h}});var n=l({props:{data:{required:!0,type:String},collapsedOnClickBrackets:Boolean},methods:{toggleBrackets(e){this.collapsedOnClickBrackets&&this.$emit("click",e)}}},(function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{staticClass:"vjs-tree__brackets",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v("\n "+e._s(e.data)+"\n")])}),[],!1,null,null,null).exports,s=l({props:{checked:{type:Boolean,default:!1},isMultiple:Boolean},data:()=>({focus:!1}),computed:{uiType(){return this.isMultiple?"checkbox":"radio"},model:{get(){return this.checked},set(e){this.$emit("input",e)}}}},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("label",{class:["vjs-check-controller",e.checked?"is-checked":""],on:{click:function(e){e.stopPropagation()}}},[o("span",{class:"vjs-check-controller__inner is-"+e.uiType}),e._v(" "),"checkbox"===e.uiType?o("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],class:"vjs-check-controller__original is-"+e.uiType,attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e.model},on:{change:[function(t){var o=e.model,l=t.target,n=!!l.checked;if(Array.isArray(o)){var s=e._i(o,null);l.checked?s<0&&(e.model=o.concat([null])):s>-1&&(e.model=o.slice(0,s).concat(o.slice(s+1)))}else e.model=n},function(t){return e.$emit("change",e.model)}],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):"radio"===e.uiType?o("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],class:"vjs-check-controller__original is-"+e.uiType,attrs:{type:"radio"},domProps:{checked:e._q(e.model,null)},on:{change:[function(t){e.model=null},function(t){return e.$emit("change",e.model)}],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):o("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],class:"vjs-check-controller__original is-"+e.uiType,attrs:{type:e.uiType},domProps:{value:e.model},on:{change:function(t){return e.$emit("change",e.model)},focus:function(t){e.focus=!0},blur:function(t){e.focus=!1},input:function(t){t.target.composing||(e.model=t.target.value)}}})])}),[],!1,null,null,null);function a(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,t="root",o=0,{key:l,index:n,type:s="content",showComma:c=!1,length:r=1}={}){const h=a(e);if("array"===h){const n=e.map(((e,l,n)=>i(e,`${t}[${l}]`,o+1,{index:l,showComma:l!==n.length-1,length:r,type:s}))).reduce(((e,t)=>e.concat(t)),[]);return[i("[",t,o,{key:l,length:e.length,type:"arrayStart"})[0]].concat(n,i("]",t,o,{showComma:c,length:e.length,type:"arrayEnd"})[0])}if("object"===h){const a=Object.keys(e),h=a.map(((l,n,a)=>i(e[l],l.includes(".")?`${t}["${l}"]`:`${t}.${l}`,o+1,{key:l,showComma:n!==a.length-1,length:r,type:s}))).reduce(((e,t)=>e.concat(t)),[]);return[i("{",t,o,{key:l,index:n,length:a.length,type:"objectStart"})[0]].concat(h,i("}",t,o,{showComma:c,length:a.length,type:"objectEnd"})[0])}const d=Object.entries({content:e,level:o,key:l,index:n,path:t,showComma:c,length:r,type:s}).reduce(((e,[t,o])=>void 0!==o?{...e,[t]:o}:e),{});return"object"===a(d)?[d]:d}var c=l({components:{Brackets:n,CheckController:s.exports},props:{node:{required:!0,type:Object},collapsed:Boolean,collapsedOnClickBrackets:Boolean,showDoubleQuotes:Boolean,showLength:Boolean,checked:Boolean,selectableType:{type:String,default:""},showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},selectOnClickNode:{type:Boolean,default:!0},pathSelectable:{type:Function,default:()=>!0},highlightSelectedNode:{type:Boolean,default:!0},customValueFormatter:{type:Function,default:null}},computed:{valueClass(){return"vjs-value vjs-value__"+this.dataType},dataType(){return a(this.node.content)},prettyKey(){return this.showDoubleQuotes?`"${this.node.key}"`:this.node.key},selectable(){return this.pathSelectable(this.node.path,this.node.content)&&(this.isMultiple||this.isSingle)},isMultiple(){return"multiple"===this.selectableType},isSingle(){return"single"===this.selectableType}},methods:{defaultFormatter(e){let t=e+"";return"string"===this.dataType&&(t=`"${t}"`),t},valueFormatter(e){const t=this.customValueFormatter?this.customValueFormatter(e,this.node.key,this.node.path,this.defaultFormatter(e)):this.defaultFormatter(e);return this.node.showComma?t+",":t},onBracketsClick(){this.$emit("brackets-click",!this.collapsed,this.node.path)},onCheckedChange(){this.$emit("selected-change",this.node)},onTreeNodeClick(){this.$emit("tree-node-click",this.node),this.selectable&&this.selectOnClickNode&&this.$emit("selected-change",this.node)}}},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{class:{"vjs-tree__node":!0,"has-selector":e.showSelectController,"is-highlight":e.highlightSelectedNode&&e.checked},on:{click:e.onTreeNodeClick}},[e.showSelectController&&e.selectable&&"objectEnd"!==e.node.type&&"arrayEnd"!==e.node.type?[o("check-controller",{attrs:{"is-multiple":e.isMultiple,checked:e.checked},on:{change:e.onCheckedChange}})]:e._e(),e._v(" "),e._l(e.node.level,(function(t,l){return o("div",{key:l,class:{"vjs-tree__indent":!0,"has-line":e.showLine}})})),e._v(" "),e.node.key?o("span",{staticClass:"vjs-key"},[e._v(e._s(e.prettyKey)+":")]):e._e(),e._v(" "),o("span",["content"!==e.node.type?o("brackets",{attrs:{data:e.node.content,"collapsed-on-click-brackets":e.collapsedOnClickBrackets},on:{click:e.onBracketsClick}}):o("span",{class:e.valueClass,domProps:{innerHTML:e._s(e.valueFormatter(e.node.content))}}),e._v(" "),e.showLength&&e.collapsed?o("span",{staticClass:"vjs-comment"},[e._v(" // "+e._s(e.node.length)+" items ")]):e._e()],1)],2)}),[],!1,null,null,null),r=l({name:"VueJsonPretty",components:{TreeNode:c.exports},props:{data:{type:[String,Number,Boolean,Array,Object],default:null},deep:{type:Number,default:1/0},path:{type:String,default:"root"},virtual:{type:Boolean,default:!1},itemHeight:{type:Number,default:20},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},selectableType:{type:String,default:""},showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},selectOnClickNode:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>""},pathSelectable:{type:Function,default:()=>!0},highlightSelectedNode:{type:Boolean,default:!0},collapsedOnClickBrackets:{type:Boolean,default:!0},customValueFormatter:{type:Function,default:null}},data(){return{translateY:0,visibleData:null,hiddenPaths:i(this.data,this.path).reduce(((e,t)=>"objectStart"!==t.type&&"arrayStart"!==t.type||t.level!==this.deep?e:{...e,[t.path]:1}),{})}},computed:{flatData(){let e=null;return i(this.data,this.path).reduce(((t,o,l)=>{const n={...o,id:l},s=this.hiddenPaths[n.path];if(e&&e.path===n.path){const o="objectStart"===e.type,l={...e,...n,content:o?"{...}":"[...]",type:o?"objectCollapsed":"arrayCollapsed"};return e=null,t.concat(l)}return s&&!e?(e=n,t):e?t:t.concat(n)}),[])},selectedPaths:{get(){return this.value&&"single"===this.selectableType?[this.value]:this.value||[]},set(e){this.$emit("input",e)}},propsError(){return!this.selectableType||this.selectOnClickNode||this.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}},watch:{propsError:{handler(e){if(e)throw new Error("[VueJsonPretty] "+e)},immediate:!0},flatData:{handler(){this.onTreeScroll()},immediate:!0}},methods:{onTreeScroll(){if(this.virtual){const e=10,t=this.$refs.tree&&this.$refs.tree.scrollTop||0,o=Math.floor(t/this.itemHeight);let l=o<0?0:o+e>this.flatData.length?this.flatData.length-e:o;l<0&&(l=0);const n=l+e;this.translateY=l*this.itemHeight,this.visibleData=this.flatData.filter(((e,t)=>t>=l&&t<n))}else this.visibleData=this.flatData},onSelectedChange({path:e}){const t=this.selectableType;if("multiple"===t){const t=this.selectedPaths.findIndex((t=>t===e)),o=[...this.selectedPaths];-1!==t?this.selectedPaths.splice(t,1):this.selectedPaths.push(e),this.$emit("change",this.selectedPaths,o)}else if("single"===t&&this.selectedPaths!==e){const t=this.selectedPaths,o=e;this.selectedPaths=o,this.$emit("change",o,t)}},onTreeNodeClick({content:e,path:t}){this.$emit("click",t,e)},onBracketsClick(e,t){if(e)this.hiddenPaths={...this.hiddenPaths,[t]:1};else{const e={...this.hiddenPaths};delete e[t],this.hiddenPaths=e}}}},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{ref:"tree",class:{"vjs-tree":!0,"is-virtual":e.virtual},on:{scroll:e.onTreeScroll}},[o("div",{style:e.virtual&&{height:e.flatData.length*e.itemHeight+"px"}},[o("div",{style:e.virtual&&{transform:"translateY("+e.translateY+"px)"}},e._l(e.visibleData,(function(t){return o("tree-node",{key:t.id,attrs:{node:t,collapsed:!!e.hiddenPaths[t.path],"custom-value-formatter":e.customValueFormatter,"show-double-quotes":e.showDoubleQuotes,"show-length":e.showLength,"collapsed-on-click-brackets":e.collapsedOnClickBrackets,checked:e.selectedPaths.includes(t.path),"selectable-type":e.selectableType,"show-line":e.showLine,"show-select-controller":e.showSelectController,"select-on-click-node":e.selectOnClickNode,"path-selectable":e.pathSelectable,"highlight-selected-node":e.highlightSelectedNode},on:{"tree-node-click":e.onTreeNodeClick,"brackets-click":e.onBracketsClick,"selected-change":e.onSelectedChange}})})),1)])])}),[],!1,null,null,null).exports,h=Object.assign({},r,{version:"1.8.1"})}},t={};function o(l){if(t[l])return t[l].exports;var n=t[l]={exports:{}};return e[l](n,n.exports,o),n.exports}return o.d=function(e,t){for(var l in t)o.o(t,l)&&!o.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(810)}()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueJsonPretty=t():e.VueJsonPretty=t()}(this,(function(){return function(){"use strict";var e={802:function(e,t,l){function o(e,t,l,o,n,s,a,i){var c,r="function"==typeof e?e.options:e;if(t&&(r.render=t,r.staticRenderFns=l,r._compiled=!0),o&&(r.functional=!0),s&&(r._scopeId="data-v-"+s),a?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},r._ssrRegister=c):n&&(c=i?function(){n.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:n),c)if(r.functional){r._injectStyles=c;var h=r.render;r.render=function(e,t){return c.call(t),h(e,t)}}else{var d=r.beforeCreate;r.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:r}}l.r(t),l.d(t,{default:function(){return h}});var n=o({props:{data:{required:!0,type:String},collapsedOnClickBrackets:Boolean},methods:{toggleBrackets(e){this.collapsedOnClickBrackets&&this.$emit("click",e)}}},(function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{staticClass:"vjs-tree__brackets",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v("\n "+e._s(e.data)+"\n")])}),[],!1,null,null,null).exports,s=o({props:{checked:{type:Boolean,default:!1},isMultiple:Boolean},data:()=>({focus:!1}),computed:{uiType(){return this.isMultiple?"checkbox":"radio"},model:{get(){return this.checked},set(e){this.$emit("input",e)}}}},(function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("label",{class:["vjs-check-controller",e.checked?"is-checked":""],on:{click:function(e){e.stopPropagation()}}},[l("span",{class:"vjs-check-controller__inner is-"+e.uiType}),e._v(" "),"checkbox"===e.uiType?l("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],class:"vjs-check-controller__original is-"+e.uiType,attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e.model},on:{change:[function(t){var l=e.model,o=t.target,n=!!o.checked;if(Array.isArray(l)){var s=e._i(l,null);o.checked?s<0&&(e.model=l.concat([null])):s>-1&&(e.model=l.slice(0,s).concat(l.slice(s+1)))}else e.model=n},function(t){return e.$emit("change",e.model)}],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):"radio"===e.uiType?l("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],class:"vjs-check-controller__original is-"+e.uiType,attrs:{type:"radio"},domProps:{checked:e._q(e.model,null)},on:{change:[function(t){e.model=null},function(t){return e.$emit("change",e.model)}],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):l("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],class:"vjs-check-controller__original is-"+e.uiType,attrs:{type:e.uiType},domProps:{value:e.model},on:{change:function(t){return e.$emit("change",e.model)},focus:function(t){e.focus=!0},blur:function(t){e.focus=!1},input:function(t){t.target.composing||(e.model=t.target.value)}}})])}),[],!1,null,null,null);function a(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,t="root",l=0,{key:o,index:n,type:s="content",showComma:c=!1,length:r=1}={}){const h=a(e);if("array"===h){const n=e.map(((e,o,n)=>i(e,`${t}[${o}]`,l+1,{index:o,showComma:o!==n.length-1,length:r,type:s}))).reduce(((e,t)=>e.concat(t)),[]);return[i("[",t,l,{key:o,length:e.length,type:"arrayStart"})[0]].concat(n,i("]",t,l,{showComma:c,length:e.length,type:"arrayEnd"})[0])}if("object"===h){const a=Object.keys(e),h=a.map(((o,n,a)=>i(e[o],o.includes(".")?`${t}["${o}"]`:`${t}.${o}`,l+1,{key:o,showComma:n!==a.length-1,length:r,type:s}))).reduce(((e,t)=>e.concat(t)),[]);return[i("{",t,l,{key:o,index:n,length:a.length,type:"objectStart"})[0]].concat(h,i("}",t,l,{showComma:c,length:a.length,type:"objectEnd"})[0])}const d=Object.entries({content:e,level:l,key:o,index:n,path:t,showComma:c,length:r,type:s}).reduce(((e,[t,l])=>void 0!==l?{...e,[t]:l}:e),{});return"object"===a(d)?[d]:d}var c=o({components:{Brackets:n,CheckController:s.exports},props:{node:{required:!0,type:Object},collapsed:Boolean,collapsedOnClickBrackets:Boolean,showDoubleQuotes:Boolean,showLength:Boolean,checked:Boolean,selectableType:{type:String,default:""},showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},selectOnClickNode:{type:Boolean,default:!0},pathSelectable:{type:Function,default:()=>!0},highlightSelectedNode:{type:Boolean,default:!0},customValueFormatter:{type:Function,default:null}},computed:{valueClass(){return"vjs-value vjs-value__"+this.dataType},dataType(){return a(this.node.content)},prettyKey(){return this.showDoubleQuotes?`"${this.node.key}"`:this.node.key},selectable(){return this.pathSelectable(this.node.path,this.node.content)&&(this.isMultiple||this.isSingle)},isMultiple(){return"multiple"===this.selectableType},isSingle(){return"single"===this.selectableType}},methods:{defaultFormatter(e){let t=e+"";return"string"===this.dataType&&(t=`"${t}"`),t},valueFormatter(e){const t=this.customValueFormatter?this.customValueFormatter(e,this.node.key,this.node.path,this.defaultFormatter(e)):this.defaultFormatter(e);return this.node.showComma?t+",":t},onBracketsClick(){this.$emit("brackets-click",!this.collapsed,this.node.path)},onCheckedChange(){this.$emit("selected-change",this.node)},onTreeNodeClick(){this.$emit("tree-node-click",this.node),this.selectable&&this.selectOnClickNode&&this.$emit("selected-change",this.node)}}},(function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{class:{"vjs-tree__node":!0,"has-selector":e.showSelectController,"is-highlight":e.highlightSelectedNode&&e.checked},on:{click:e.onTreeNodeClick}},[e.showSelectController&&e.selectable&&"objectEnd"!==e.node.type&&"arrayEnd"!==e.node.type?[l("check-controller",{attrs:{"is-multiple":e.isMultiple,checked:e.checked},on:{change:e.onCheckedChange}})]:e._e(),e._v(" "),e._l(e.node.level,(function(t,o){return l("div",{key:o,class:{"vjs-tree__indent":!0,"has-line":e.showLine}})})),e._v(" "),e.node.key?l("span",{staticClass:"vjs-key"},[e._v(e._s(e.prettyKey)+":")]):e._e(),e._v(" "),l("span",["content"!==e.node.type?l("brackets",{attrs:{data:e.node.content,"collapsed-on-click-brackets":e.collapsedOnClickBrackets},on:{click:e.onBracketsClick}}):l("span",{class:e.valueClass,domProps:{innerHTML:e._s(e.valueFormatter(e.node.content))}}),e._v(" "),e.showLength&&e.collapsed?l("span",{staticClass:"vjs-comment"},[e._v(" // "+e._s(e.node.length)+" items ")]):e._e()],1)],2)}),[],!1,null,null,null),r=o({name:"VueJsonPretty",components:{TreeNode:c.exports},props:{data:{type:[String,Number,Boolean,Array,Object],default:null},deep:{type:Number,default:1/0},deepCollapseChildren:{type:Boolean,default:!1},path:{type:String,default:"root"},virtual:{type:Boolean,default:!1},itemHeight:{type:Number,default:20},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},selectableType:{type:String,default:""},showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},selectOnClickNode:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>""},pathSelectable:{type:Function,default:()=>!0},highlightSelectedNode:{type:Boolean,default:!0},collapsedOnClickBrackets:{type:Boolean,default:!0},customValueFormatter:{type:Function,default:null},virtualLines:{type:Number,default:10}},data(){return{translateY:0,visibleData:null,hiddenPaths:i(this.data,this.path).reduce(((e,t)=>{const l=this.deepCollapseChildren?t.level>=this.deep:t.level===this.deep;return"objectStart"!==t.type&&"arrayStart"!==t.type||!l?e:{...e,[t.path]:1}}),{})}},computed:{flatData(){let e=null;return i(this.data,this.path).reduce(((t,l,o)=>{const n={...l,id:o},s=this.hiddenPaths[n.path];if(e&&e.path===n.path){const l="objectStart"===e.type,o={...e,...n,content:l?"{...}":"[...]",type:l?"objectCollapsed":"arrayCollapsed"};return e=null,t.concat(o)}return s&&!e?(e=n,t):e?t:t.concat(n)}),[])},selectedPaths:{get(){return this.value&&"single"===this.selectableType?[this.value]:this.value||[]},set(e){this.$emit("input",e)}},propsError(){return!this.selectableType||this.selectOnClickNode||this.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}},watch:{propsError:{handler(e){if(e)throw new Error("[VueJsonPretty] "+e)},immediate:!0},flatData:{handler(){this.onTreeScroll()},immediate:!0}},methods:{onTreeScroll(){if(this.virtual){const e=this.virtualLines,t=this.$refs.tree&&this.$refs.tree.scrollTop||0,l=Math.floor(t/this.itemHeight);let o=l<0?0:l+e>this.flatData.length?this.flatData.length-e:l;o<0&&(o=0);const n=o+e;this.translateY=o*this.itemHeight,this.visibleData=this.flatData.filter(((e,t)=>t>=o&&t<n))}else this.visibleData=this.flatData},onSelectedChange({path:e}){const t=this.selectableType;if("multiple"===t){const t=this.selectedPaths.findIndex((t=>t===e)),l=[...this.selectedPaths];-1!==t?this.selectedPaths.splice(t,1):this.selectedPaths.push(e),this.$emit("change",this.selectedPaths,l)}else if("single"===t&&this.selectedPaths!==e){const t=this.selectedPaths,l=e;this.selectedPaths=l,this.$emit("change",l,t)}},onTreeNodeClick({content:e,path:t}){this.$emit("click",t,e)},onBracketsClick(e,t){if(e)this.hiddenPaths={...this.hiddenPaths,[t]:1};else{const e={...this.hiddenPaths};delete e[t],this.hiddenPaths=e}}}},(function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{ref:"tree",class:{"vjs-tree":!0,"is-virtual":e.virtual},on:{scroll:e.onTreeScroll}},[l("div",{style:e.virtual&&{height:e.flatData.length*e.itemHeight+"px"}},[l("div",{style:e.virtual&&{transform:"translateY("+e.translateY+"px)"}},e._l(e.visibleData,(function(t){return l("tree-node",{key:t.id,attrs:{node:t,collapsed:!!e.hiddenPaths[t.path],"custom-value-formatter":e.customValueFormatter,"show-double-quotes":e.showDoubleQuotes,"show-length":e.showLength,"collapsed-on-click-brackets":e.collapsedOnClickBrackets,checked:e.selectedPaths.includes(t.path),"selectable-type":e.selectableType,"show-line":e.showLine,"show-select-controller":e.showSelectController,"select-on-click-node":e.selectOnClickNode,"path-selectable":e.pathSelectable,"highlight-selected-node":e.highlightSelectedNode},on:{"tree-node-click":e.onTreeNodeClick,"brackets-click":e.onBracketsClick,"selected-change":e.onSelectedChange}})})),1)])])}),[],!1,null,null,null).exports,h=Object.assign({},r,{version:"1.8.2"})}},t={};function l(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return e[o](n,n.exports,l),n.exports}return l.d=function(e,t){for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l(802)}()}));
{
"name": "vue-json-pretty",
"version": "1.8.1",
"version": "1.8.2",
"description": "A JSON tree view component that is easy to use and also supports data selection.",

@@ -5,0 +5,0 @@ "author": "leezng <im.leezng@gmail.com>",

@@ -109,2 +109,3 @@ <p align="center">

| deep | normal | Data depth, data larger than this depth will not be expanded | number | Infinity |
| deepCollapseChildren | normal | Whether children collapsed by `deep` prop should also be collapsed | boolean | false |
| showLength | normal | Whether to show the length when closed | boolean | false |

@@ -115,2 +116,3 @@ | showLine | normal | Whether to show the line | boolean | true |

| itemHeight | normal | The height of each item when using virtual scrolling | number | auto |
| virtualLines | normal | The number of lines to render when virtual scrolling is enabled | number | 10 |
| v-model | higher | Defines value when the tree can be selected | string, array | - |

@@ -117,0 +119,0 @@ | path | higher | Root data path | string | root |