@@ -8,13 +8,13 @@ import { trans } from "i18n";
8
8
import _ from "lodash" ;
9
9
import { DocLink } from "lowcoder-design" ;
10
10
import { BottomTabs } from "pages/editor/bottom/BottomTabs" ;
11
- import { ReactNode } from "react" ;
11
+ import { ReactNode , useState } from "react" ;
12
12
import { BottomResComp , BottomResCompResult , BottomResTypeEnum } from "types/bottomRes" ;
13
13
import { JSONObject } from "util/jsonTypes" ;
14
14
import { QueryTutorials } from "util/tutorialUtils" ;
15
15
import { SimpleNameComp } from "./simpleNameComp" ;
16
16
import { markdownCompCss , TacoMarkDown } from "lowcoder-design" ;
17
- import { evalAndReduce } from ".. /utils" ;
17
+ import SupaDemoDisplay from "comps /utils/supademoDisplay " ;
18
18
19
19
const TemporaryStateItemCompBase = new MultiCompBuilder (
20
20
{
@@ -24,29 +24,51 @@ const TemporaryStateItemCompBase = new MultiCompBuilder(
24
24
( ) => null
25
25
)
26
26
. setPropertyViewFn ( ( children ) => {
27
- return (
28
- < BottomTabs
29
- type = { BottomResTypeEnum . TempState }
30
- tabsConfig = { [
31
- {
32
- key : "general" ,
33
- title : trans ( "query.generalTab" ) ,
34
- children : children . value . propertyView ( {
35
- label : trans ( "temporaryState.value" ) ,
36
- tooltip : trans ( "temporaryState.valueTooltip" ) ,
37
- placement : "bottom" ,
38
- extraChildren : QueryTutorials . tempState && (
39
- < > < br /> < TacoMarkDown > { trans ( "temporaryState.documentationText" ) } </ TacoMarkDown > < br /> < DocLink style = { { marginTop : 8 } } href = { QueryTutorials . tempState } title = { trans ( "temporaryState.documentationText" ) } >
40
- { trans ( "temporaryState.docLink" ) }
41
- </ DocLink > </ >
42
- ) ,
43
- } ) ,
44
- } ,
45
- ] }
46
- tabTitle = { children . name . getView ( ) }
47
- status = ""
48
- />
49
- ) ;
27
+ const PropertyViewWithModal = ( ) => {
28
+ const [ isOpen , setIsOpen ] = useState ( false ) ;
29
+
30
+ const handleOpen = ( ) => {
31
+ setIsOpen ( true ) ;
32
+ } ;
33
+
34
+ const handleClose = ( ) => {
35
+ setIsOpen ( false ) ;
36
+ } ;
37
+
38
+ return (
39
+ < BottomTabs
40
+ type = { BottomResTypeEnum . TempState }
41
+ tabsConfig = { [
42
+ {
43
+ key : "general" ,
44
+ title : trans ( "query.generalTab" ) ,
45
+ children : children . value . propertyView ( {
46
+ label : trans ( "temporaryState.value" ) ,
47
+ tooltip : trans ( "temporaryState.valueTooltip" ) ,
48
+ placement : "bottom" ,
49
+ extraChildren : QueryTutorials . tempState && (
50
+ < > < br /> < TacoMarkDown > { trans ( "temporaryState.documentationText" ) } </ TacoMarkDown > < br /> < DocLink style = { { marginTop : 8 } } href = { QueryTutorials . tempState } title = { trans ( "temporaryState.documentationText" ) } >
51
+ { trans ( "temporaryState.docLink" ) }
52
+ </ DocLink > < br /> < br />
53
+
54
+ < SupaDemoDisplay
55
+ url = { trans ( "supademos.temporarystate" ) }
56
+ modalWidth = "80%"
57
+ modalTop = "20px"
58
+ />
59
+
60
+ </ >
61
+ ) ,
62
+ } ) ,
63
+ } ,
64
+ ] }
65
+ tabTitle = { children . name . getView ( ) }
66
+ status = ""
67
+ />
68
+ ) ;
69
+ } ;
70
+
71
+ return < PropertyViewWithModal /> ;
50
72
} )
51
73
. build ( ) ;
52
74
0 commit comments