y9-interface-platform/y9vue-interfacePlatform/interface/assets/vue-json-pretty-1e6e4575.js

4 lines
16 KiB
JavaScript
Raw Normal View History

import"./vue-20eed888.js";import{k as ne,T as oe,e as re,d as ae,Z as le,r as ce,w as ie,l as ue}from"./@vue-e95c845e.js";var A={d:(e,t)=>{for(var n in t)A.o(t,n)&&!A.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},_={};function H(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);n<t;n++)l[n]=e[n];return l}function G(e,t){if(e){if(typeof e=="string")return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}function E(e){return function(t){if(Array.isArray(t))return H(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||G(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}A.d(_,{Z:()=>fe});const r=(R={computed:()=>ne,createTextVNode:()=>oe,createVNode:()=>re,defineComponent:()=>ae,reactive:()=>le,ref:()=>ce,watch:()=>ie,watchEffect:()=>ue},K={},A.d(K,R),K),de=(0,r.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var e=this.data,t=this.onClick;return(0,r.createVNode)("span",{class:"vjs-tree-brackets",onClick:t},[e])}}),se=(0,r.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(e,t){var n=t.emit;return{uiType:(0,r.computed)(function(){return e.isMultiple?"checkbox":"radio"}),model:(0,r.computed)({get:function(){return e.checked},set:function(l){return n("update:modelValue",l)}})}},render:function(){var e=this.uiType,t=this.model,n=this.$emit;return(0,r.createVNode)("label",{class:["vjs-check-controller",t?"is-checked":""],onClick:function(l){return l.stopPropagation()}},[(0,r.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(e)},null),(0,r.createVNode)("input",{checked:t,class:"vjs-check-controller-original is-".concat(e),type:e,onChange:function(){return n("change",t)}},null)])}}),pe=(0,r.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var e=this.nodeType,t=this.onClick,n=e==="objectStart"||e==="arrayStart";return n||e==="objectCollapsed"||e==="arrayCollapsed"?(0,r.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(n?"open":"close"),onClick:t},[(0,r.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,r.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var R,K;function M(e){return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function X(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function O(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3?arguments[3]:void 0,p=l||{},y=p.key,C=p.index,s=p.type,b=s===void 0?"content":s,f=p.showComma,N=f!==void 0&&f,w=p.length,S=w===void 0?1:w,V=X(e);if(V==="array"){var T=$(e.map(function(g,u,o){return O(g,"".concat(t,"[").concat(u,"]"),n+1,{index:u,showComma:u!==o.length-1,length:S,type:b})}));return[O("[",t,n,{showComma:!1,key:y,length:e.length,type:"arrayStart"})[0]].concat(T,O("]",t,n,{showComma:N,length:e.length,type:"arrayEnd"})[0])}if(V==="object"){var j=Object.keys(e),x=$(j.map(function(g,u,o){return O(e[g],/^[a-zA-Z_]\w*$/.test(g)?"".concat(t,".").concat(g):"".concat(t,'["').concat(g,'"]'),n+1,{key:g,showComma:u!==o.length-1,length:S,type:b})}));return[O("{",t,n,{showComma:!1,key:y,index:C,length:j.length,type:"objectStart"})[0]].concat(x,O("}",t,n,{showComma:N,length:j.length,type:"objectEnd"})[0])}return[{content:e,level:n,key:y,index:C,path:t,showComma:N,length:S,type:b}]}function $(e){if(typeof Array.prototype.flat=="function")return e.flat();for(var t=E(e),n=[];t.length;){var l=t.shift();Array.isArray(l)?t.unshift.apply(t,E(l)):n.push(l)}return n}function Q(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e==null)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(M(e)!=="object")return e;if(t.get(e))return t.get(e);if(Array.isArray(e)){var n=e.map(function(y){return Q(y,t)});return t.set(e,n),n}var l={};for(var p in e)l[p]=Q(e[p],t);return t.set(e,l),l}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],L=i;n("update:selectedValue",L),n("selectedChange",L,B)}},T=function(o){n("nodeClick",o)},j=function(o,a){if(o)s.hiddenPaths=v(v({},s.hiddenPaths),{},D({},a,1));else{var c=v({},s.hiddenPaths);delete c[a],s.hiddenPaths=c}},x=function(o,a){e.collapsedOnClickBrackets&&j(o,a.path),n("bracketsClick",o,a)},g=function(o,a){j(o,a.path),n("iconClick",o,a)},u=function(o,a){var c=Q(e.data),i=e.rootPath;new Function("data","val","data".concat(a.slice(i.length),"=val"))(c,o),n("update:data",c)};return(0,r.watchEffect)(function(){N.value&&function(o){throw new Error("[VueJSONPretty] ".concat(o))}(N.value)}),(0,r.watchEffect)(function(){b.value&&w()}),(0,r.watch)(function(){return e.deep},function(o){o&&(s.hiddenPaths=C(o,e.collapsedNodeLength))}),(0,r.watch)(function(){return e.collapsedNodeLength},function(o){o&&(s.hiddenPaths=C(e.deep,o))}),function(){var o,a,c=(o=e.renderNodeKey)!==null&&o!==void 0?o:l.renderNodeKey,i=(a=e.renderNodeValue)!==null&&a!==void 0?a:l.renderNodeValue,d=s.visibleData&&s.visibleData.map(function(h){return(0,r.createVNode)(he,{key:h.id,node:h,collapsed:!!s.hiddenPaths[h.path],theme:e.theme,showDoubleQuotes:e.showDoubleQuotes,showLength:e.showLength,checked:f.value.includes(h.path),selectableType:e.selectableType,showLine:e.showLine,showLineNumber:e.showLineNumber,showSelectController:e.showSelectController,selectOnClickNode:e.selectOnClickNode,nodeSelectable:e.nodeSelectable,highlightSelectedNode:e.highlightSelectedNode,editable:e.editable,editableTrigger:e.editableTrigger,showIcon:e.showIcon,showKeyValueSpace:e.showKeyValueSpace,renderNodeKey:c,renderNodeValue:i,onNodeClick:T,onBracketsClick:x,onIconClick:g,onSelectedChange:V,onValueChange:u,style:e.itemHeight&&e.itemHeight!==20?{lineHeight:"".concat(e.itemHeight,"px")}:{}},null)});return(0,r.createVNode)("div",{ref:p,class:{"vjs-tree":!0,"is-virtual":e.virtual,dark:e.theme==="dark"},onScroll:e.virtual?S:void 0,style:e.showLineNumber?v({paddingLeft:"".concat(12*Number(y.value.length.toString().length),"px")},e.style):e.style},[e.virtual?(0,r.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(e.height,"px")}},[(0,r.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(b.value.length*e.itemHeight,"px")}},[(0,r.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(s.translateY,"px)")}},[d])])]):d])}}});var ge=_.Z;export{ge as S};