@@ -3,17 +3,7 @@ import { globalAttrs, globalProps } from './install'
33import { debounce } from 'lodash-es'
44import { JSONEditor } from 'vanilla-jsoneditor'
55import type { Content , JSONContent , TextContent } from 'vanilla-jsoneditor'
6- import {
7- defineComponent ,
8- getCurrentInstance ,
9- h ,
10- isVue3 ,
11- onMounted ,
12- onUnmounted ,
13- ref ,
14- unref ,
15- watch ,
16- } from 'vue-demi'
6+ import { defineComponent , getCurrentInstance , h , isVue3 , onMounted , onUnmounted , ref , unref , watch } from 'vue-demi'
177import type { PropType } from 'vue-demi'
188import { conclude } from 'vue-global-config'
199
@@ -74,15 +64,11 @@ export default defineComponent({
7464 const initialMode = conclude ( [ props . mode , globalProps . mode ] , {
7565 type : String as PropType < Mode > ,
7666 } )
77- const initialValue = conclude ( [
78- props [ modelValueProp ] ,
79- globalProps [ modelValueProp ] ,
80- ] )
67+ const initialValue = conclude ( [ props [ modelValueProp ] , globalProps [ modelValueProp ] ] )
8168 const initialBoolAttrs = Object . fromEntries (
82- Array . from ( boolAttrs , ( boolAttr ) => [
83- boolAttr ,
84- conclude ( [ props [ boolAttr ] , globalProps [ boolAttr ] ] ) ,
85- ] ) . filter ( ( [ , v ] ) => v !== undefined ) ,
69+ Array . from ( boolAttrs , ( boolAttr ) => [ boolAttr , conclude ( [ props [ boolAttr ] , globalProps [ boolAttr ] ] ) ] ) . filter (
70+ ( [ , v ] ) => v !== undefined ,
71+ ) ,
8672 )
8773
8874 const onChange = debounce ( ( updatedContent : Content ) => {
@@ -103,11 +89,10 @@ export default defineComponent({
10389 emit ( 'update:mode' , mode )
10490 }
10591
106- const mergeFunction =
107- ( previousValue : Function , currentValue : Function ) => ( ...args : any ) => {
108- previousValue ( ...args )
109- currentValue ( ...args )
110- }
92+ const mergeFunction = ( previousValue : Function , currentValue : Function ) => ( ...args : any ) => {
93+ previousValue ( ...args )
94+ currentValue ( ...args )
95+ }
11196
11297 const initialAttrs = conclude (
11398 [
@@ -168,11 +153,7 @@ export default defineComponent({
168153 ( ) => Array . from ( boolAttrs , ( boolAttr ) => props [ boolAttr ] ) ,
169154 ( values ) => {
170155 jsonEditor . value . updateProps (
171- Object . fromEntries (
172- Array . from ( values , ( v , i ) => [ boolAttrs [ i ] , v ] ) . filter (
173- ( [ , v ] ) => v !== undefined ,
174- ) ,
175- ) ,
156+ Object . fromEntries ( Array . from ( values , ( v , i ) => [ boolAttrs [ i ] , v ] ) . filter ( ( [ , v ] ) => v !== undefined ) ) ,
176157 )
177158 } ,
178159 )
0 commit comments