1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
![]() |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0e339b0a"],{"0b22":function(e,t,n){},"349e":function(e,t,n){!function(t,o){e.exports=o(n("a026"),n("b311"))}(0,(function(e,t){return i={},n.m=o=[function(e,t,n){"use strict";function o(e,t,n,o,i,r,a,s){var u,l,c="function"==typeof e?e.options:e;return t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(u=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__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=u):i&&(u=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),u&&(c.functional?(c._injectStyles=u,l=c.render,c.render=function(e,t){return u.call(t),l(e,t)}):(s=c.beforeCreate,c.beforeCreate=s?[].concat(s,u):[u])),{exports:e,options:c}}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.r(t);var o,i=n(2),r=n.n(i);for(o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t.default=r.a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),a(n(29));var o=a(n(21)),i=a(n(41)),r=n(42);function a(e){return e&&e.__esModule?e:{default:e}}t.default={name:"JsonViewer",components:{JsonBox:o.default},props:{value:{type:[Object,Array,String,Number,Boolean,Function],required:!0},expanded:{type:Boolean,default:!1},expandDepth:{type:Number,default:1},copyable:{type:[Boolean,Object],default:!1},sort:{type:Boolean,default:!1},boxed:{type:Boolean,default:!1},theme:{type:String,default:"jv-light"},timeformat:{type:Function,default:function(e){return e.toLocaleString()}},previewMode:{type:Boolean,default:!1},showArrayIndex:{type:Boolean,default:!0},showDoubleQuotes:{type:Boolean,default:!1}},provide:function(){return{expandDepth:this.expandDepth,timeformat:this.timeformat,onKeyclick:this.onKeyclick}},data:function(){return{copied:!1,expandableCode:!1,expandCode:this.expanded}},computed:{jvClass:function(){return"jv-container "+this.theme+(this.boxed?" boxed":"")},copyText:function(){var e=this.copyable;return{copyText:e.copyText||"copy",copiedText:e.copiedText||"copied!",timeout:e.timeout||2e3,align:e.align}}},watch:{value:function(){this.onResized()}},mounted:function(){var e=this;this.debounceResized=(0,r.debounce)(this.debResized.bind(this),200),this.boxed&&this.$refs.jsonBox&&(this.onResized(),this.$refs.jsonBox.$el.addEventListener("resized",this.onResized,!0)),this.copyable&&new i.default(this.$refs.clip,{container:this.$refs.viewer,text:function(){return JSON.stringify(e.value,null,2)}}).on("success",(function(t){e.onCopied(t)}))},methods:{onResized:function(){this.debounceResized()},debResized:function(){var e=this;this.$nextTick((function(){e.$refs.jsonBox&&(250<=e.$refs.jsonBox.$el.clientHeight?e.expandableCode=!0:e.expandableCode=!1)}))},onCopied:function(e){var t=this;this.copied||(this.copied=!0,setTimeout((function(){t.copied=!1}),this.copyText.timeout),this.$emit("copied",e))},toggleExpandCode:function(){this.expandCode=!this.expandCode},onKeyclick:function(e){this.$emit("keyclick",e)}}}},function(e,t,n){"use strict";n.r(t);var o,i=n(4),r=n.n(i);for(o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t.default=r.a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=f(n(30)),r=f(n(31)),a=f(n(32)),s=f(n(33)),u=f(n(34)),l=f(n(35)),c=f(n(36)),d=f(n(37));function f(e){return e&&e.__esModule?e:{default:e}}t.default={name:"JsonBox",inject:["expandDepth","onKeyclick"],props:{value:{type:[Object,Array,String,Number,Boolean,Function,Date],default:null},keyName:{type:String,default:""},sort:Boolean,depth:{type:Number,default:0},previewMode:Boolean,forceExpand:Boolean,showArrayIndex:Boolean,showDoubleQuotes
|