1
- import { Section , sectionNames } from 'lowcoder-design' ;
2
- import { UICompBuilder , withDefault } from '../../generators' ;
3
- import {
4
- NameConfigHidden ,
5
- NameConfig ,
6
- withExposingConfigs ,
7
- } from '../../generators/withExposing' ;
8
- import ReactJson , { type ThemeKeys } from 'react-json-view' ;
9
- import { defaultData } from './jsonConstants' ;
10
- import styled from 'styled-components' ;
11
- import { BoolControl } from 'comps/controls/boolControl' ;
12
- import { dropdownControl } from 'comps/controls/dropdownControl' ;
13
- import {
14
- ArrayOrJSONObjectControl ,
15
- NumberControl ,
16
- } from 'comps/controls/codeControl' ;
17
- import { hiddenPropertyView } from 'comps/utils/propertyUtils' ;
18
- import { trans } from 'i18n' ;
19
- import { EditorContext } from 'comps/editorState' ;
20
- import { useContext } from 'react' ;
21
- import {
22
- AnimationStyle ,
23
- AnimationStyleType ,
24
- styleControl ,
25
- } from '@lowcoder-ee/index.sdk' ;
1
+ import { Section , sectionNames } from "lowcoder-design" ;
2
+ import { UICompBuilder , withDefault } from "../../generators" ;
3
+ import { NameConfigHidden , NameConfig , withExposingConfigs } from "../../generators/withExposing" ;
4
+ import ReactJson , { type ThemeKeys } from "react-json-view" ;
5
+ import { defaultData } from "./jsonConstants" ;
6
+ import styled from "styled-components" ;
7
+ import { BoolControl } from "comps/controls/boolControl" ;
8
+ import { dropdownControl } from "comps/controls/dropdownControl" ;
9
+ import { ArrayOrJSONObjectControl , NumberControl } from "comps/controls/codeControl" ;
10
+ import { hiddenPropertyView } from "comps/utils/propertyUtils" ;
11
+ import { trans } from "i18n" ;
12
+ import { EditorContext } from "comps/editorState" ;
13
+ import { useContext } from "react" ;
14
+ import { AnimationStyle , AnimationStyleType , styleControl } from "@lowcoder-ee/index.sdk" ;
26
15
27
16
/**
28
17
* JsonExplorer Comp
29
18
*/
30
19
31
20
const themeOptions = [
32
- { label : trans ( ' jsonExplorer.default' ) , value : ' shapeshifter:inverted' } ,
33
- { label : trans ( ' jsonExplorer.defaultDark' ) , value : ' shapeshifter' } ,
34
- { label : trans ( ' jsonExplorer.neutralLight' ) , value : ' grayscale:inverted' } ,
35
- { label : trans ( ' jsonExplorer.neutralDark' ) , value : ' grayscale' } ,
36
- { label : trans ( ' jsonExplorer.azure' ) , value : ' apathy:inverted' } ,
37
- { label : trans ( ' jsonExplorer.darkBlue' ) , value : ' flat' } ,
21
+ { label : trans ( " jsonExplorer.default" ) , value : " shapeshifter:inverted" } ,
22
+ { label : trans ( " jsonExplorer.defaultDark" ) , value : " shapeshifter" } ,
23
+ { label : trans ( " jsonExplorer.neutralLight" ) , value : " grayscale:inverted" } ,
24
+ { label : trans ( " jsonExplorer.neutralDark" ) , value : " grayscale" } ,
25
+ { label : trans ( " jsonExplorer.azure" ) , value : " apathy:inverted" } ,
26
+ { label : trans ( " jsonExplorer.darkBlue" ) , value : " flat" } ,
38
27
] ;
39
28
40
29
const bgColorMap = {
41
- ' shapeshifter:inverted' : ' #ffffff' ,
42
- shapeshifter : ' #000000' ,
43
- ' grayscale:inverted' : ' #ffffff' ,
44
- grayscale : ' #000000' ,
45
- ' apathy:inverted' : ' #efffff' ,
46
- flat : ' #2c3e50' ,
30
+ " shapeshifter:inverted" : " #ffffff" ,
31
+ shapeshifter : " #000000" ,
32
+ " grayscale:inverted" : " #ffffff" ,
33
+ grayscale : " #000000" ,
34
+ " apathy:inverted" : " #efffff" ,
35
+ flat : " #2c3e50" ,
47
36
} ;
48
37
49
38
const JsonExplorerContainer = styled . div < {
@@ -68,7 +57,7 @@ let JsonExplorerTmpComp = (function () {
68
57
indent : withDefault ( NumberControl , 4 ) ,
69
58
expandToggle : BoolControl . DEFAULT_TRUE ,
70
59
theme : dropdownControl ( themeOptions , 'shapeshifter:inverted' ) ,
71
- animationStyle : styleControl ( AnimationStyle ) ,
60
+ animationStyle :styleControl ( AnimationStyle ) ,
72
61
} ;
73
62
return new UICompBuilder ( childrenMap , ( props ) => (
74
63
< JsonExplorerContainer
@@ -139,6 +128,6 @@ JsonExplorerTmpComp = class extends JsonExplorerTmpComp {
139
128
} ;
140
129
141
130
export const JsonExplorerComp = withExposingConfigs ( JsonExplorerTmpComp , [
142
- new NameConfig ( ' value' , trans ( ' jsonExplorer.valueDesc' ) ) ,
131
+ new NameConfig ( " value" , trans ( " jsonExplorer.valueDesc" ) ) ,
143
132
NameConfigHidden ,
144
133
] ) ;
0 commit comments