Skip to content

Commit 6456622

Browse files
committed
Changed viewMode of components
1 parent 1e7cb91 commit 6456622

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+75
-75
lines changed

client/packages/lowcoder/src/comps/comps/autoCompleteComp/autoCompleteComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ let AutoCompleteCompBase = (function () {
281281
...validateState,
282282
});
283283
})
284-
if (viewMode() === "edit") {
284+
if (viewMode() === "admin") {
285285
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
286286
}
287287
return builder

client/packages/lowcoder/src/comps/comps/avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const AvatarView = (props: RecordConstructorToView<typeof childrenMap>) => {
198198
let AvatarBasicComp = (function () {
199199
let builder = new UICompBuilder(childrenMap, (props) => {
200200
return(<AvatarView {...props} />)})
201-
if (viewMode() === "edit") {
201+
if (viewMode() === "admin") {
202202
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
203203
}
204204
return builder

client/packages/lowcoder/src/comps/comps/avatarGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let DropdownOption = new MultiCompBuilder(
5959
},
6060
(props) => props
6161
)
62-
if (viewMode() === "edit") {
62+
if (viewMode() === "admin") {
6363
DropdownOption.setPropertyViewFn((children) => <PropertyViewAvatarGroup1 {...children}></PropertyViewAvatarGroup1>);
6464
}
6565
const DropdownOptionBuilder = DropdownOption.build();
@@ -132,7 +132,7 @@ let AvatarGroupBasicComp = (function () {
132132
let builder = new UICompBuilder(childrenMap, (props, dispatch) => {
133133
return( <AvatarGroupView {...props} dispatch={dispatch} />
134134
)})
135-
if (viewMode() === "edit") {
135+
if (viewMode() === "admin") {
136136
builder.setPropertyViewFn((children) => <PropertyViewAvatarGroup2 {...children}></PropertyViewAvatarGroup2>);
137137
}
138138
return builder

client/packages/lowcoder/src/comps/comps/buttonComp/buttonComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const ButtonTmpComp = (function () {
160160
)
161161
})
162162

163-
if (viewMode() === "edit") {
163+
if (viewMode() === "admin") {
164164
builder.setPropertyViewFn((children) => <PropertyViewButtonComp {...children}></PropertyViewButtonComp>);
165165
}
166166

client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const DropdownTmpComp = (function () {
150150
</ButtonCompWrapper>
151151
);
152152
})
153-
if (viewMode() === "edit") {
153+
if (viewMode() === "admin") {
154154
builder.setPropertyViewFn((children) => <PropertyViewDropDownComp {...children}></PropertyViewDropDownComp>);
155155
}
156156
return builder

client/packages/lowcoder/src/comps/comps/buttonComp/floatButtonComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ let FloatButtonBasicComp = (function () {
135135
return(
136136
<FloatButtonView {...props} />
137137
)})
138-
if (viewMode() === "edit") {
138+
if (viewMode() === "admin") {
139139
builder.setPropertyViewFn((children) => <PropertyViewFloatButton {...children}></PropertyViewFloatButton>);
140140
}
141141
return builder

client/packages/lowcoder/src/comps/comps/buttonComp/linkComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const LinkTmpComp = (function () {
111111
</ButtonCompWrapper>
112112
);
113113
})
114-
if (viewMode() === "edit") {
114+
if (viewMode() === "admin") {
115115
builder.setPropertyViewFn((children) => <PropertyViewLinkComp {...children}></PropertyViewLinkComp>);
116116
}
117117
return builder

client/packages/lowcoder/src/comps/comps/buttonComp/scannerComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const ScannerTmpComp = (function () {
211211
</ButtonCompWrapper>
212212
);
213213
})
214-
if (viewMode() === "edit") {
214+
if (viewMode() === "admin") {
215215
builder.setPropertyViewFn((children) => <PropertyViewScannerComp {...children}></PropertyViewScannerComp>);
216216
}
217217
return builder

client/packages/lowcoder/src/comps/comps/buttonComp/toggleButtonComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const ToggleTmpComp = (function () {
8989
</ButtonCompWrapperStyled>
9090
);
9191
})
92-
if (viewMode() === "edit") {
92+
if (viewMode() === "admin") {
9393
builder.setPropertyViewFn((children) => <PropertyViewToggleButton {...children}></PropertyViewToggleButton>);
9494
}
9595
return builder

client/packages/lowcoder/src/comps/comps/carouselComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ let CarouselBasicComp = (function () {
7777
</Container>
7878
);
7979
})
80-
if (viewMode() === "edit") {
80+
if (viewMode() === "admin") {
8181
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
8282
}
8383
return builder

client/packages/lowcoder/src/comps/comps/columnLayout/columnLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const ResponsiveLayoutBaseComp = (function () {
191191
<ColumnLayout {...props} dispatch={dispatch} />
192192
);
193193
})
194-
if (viewMode() === "edit") {
194+
if (viewMode() === "admin") {
195195
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
196196
}
197197
return builder

client/packages/lowcoder/src/comps/comps/commentComp/commentComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ let CommentBasicComp = (function () {
358358
return (
359359
<CommentCompBase {...props} dispatch={dispatch} />
360360
)})
361-
if (viewMode() === "edit") {
361+
if (viewMode() === "admin") {
362362
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
363363
}
364364
return builder

client/packages/lowcoder/src/comps/comps/containerComp/cardComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { dropdownControl } from "comps/controls/dropdownControl";
2020
import { styleControl } from "comps/controls/styleControl";
2121
import { getBackgroundStyle } from "@lowcoder-ee/util/styleUtils";
2222

23-
import {viewMode} from "@lowcoder-ee/util/editor";
23+
import {viewMode, viewModeTriple} from "@lowcoder-ee/util/editor";
2424
const PropertyViewCardComp = React.lazy( async () => await import("./propertyView").then(module => ({default: module.PropertyViewCardComp})))
2525
const { Meta } = Card;
2626

@@ -263,7 +263,7 @@ export const ContainerBaseComp = (function () {
263263
</ReactResizeDetector>
264264
);
265265
})
266-
if (!(viewMode() === "admin")) {
266+
if ((viewModeTriple() !== "admin")) {
267267
builder.setPropertyViewFn((children) => <PropertyViewCardComp {...children}></PropertyViewCardComp>);
268268
}
269269
return builder

client/packages/lowcoder/src/comps/comps/containerComp/containerComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { DisabledContext } from "comps/generators/uiCompBuilder";
1515
import React from "react";
1616
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
1717
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
18-
import {viewMode} from "@lowcoder-ee/util/editor";
18+
import {viewMode, viewModeTriple} from "@lowcoder-ee/util/editor";
1919
const PropertyViewContainerComp = React.lazy( async () => await import("./propertyView").then(module => ({default: module.PropertyViewContainerComp})))
2020

2121
export const ContainerBaseComp = (function () {
@@ -31,7 +31,7 @@ export const ContainerBaseComp = (function () {
3131
);
3232
})
3333

34-
if (!(viewMode() === "admin")) {
34+
if ((viewModeTriple() !== "admin")) {
3535
builder.setPropertyViewFn((children) => <PropertyViewContainerComp {...children}></PropertyViewContainerComp>);
3636
}
3737
return builder

client/packages/lowcoder/src/comps/comps/containerComp/pageLayoutComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
import { PageLayout } from "../pageLayoutComp/pageLayout";
1818
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
1919
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
20-
import {viewMode} from "@lowcoder-ee/util/editor";
20+
import {viewMode, viewModeTriple} from "@lowcoder-ee/util/editor";
2121
const PropertyViewPageLayout = React.lazy( async () => await import("./propertyView").then(module => ({default: module.PropertyViewPageLayout})))
2222

2323
export const ContainerBaseComp = (function () {
@@ -36,7 +36,7 @@ export const ContainerBaseComp = (function () {
3636
</DisabledContext.Provider>
3737
);
3838
})
39-
if (!(viewMode() === "admin")) {
39+
if ((viewModeTriple() !== "admin")) {
4040
builder.setPropertyViewFn((children) => <PropertyViewPageLayout {...children}></PropertyViewPageLayout>);
4141
}
4242
return builder

client/packages/lowcoder/src/comps/comps/containerComp/textContainerComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { styleControl } from "comps/controls/styleControl";
2121
import { AnimationStyle, TextContainerStyle } from "comps/controls/styleControlConstants";
2222
import React from "react";
2323
import { alignWithJustifyControl } from "comps/controls/alignControl";
24-
import {viewMode} from "@lowcoder-ee/util/editor";
24+
import {viewMode, viewModeTriple} from "@lowcoder-ee/util/editor";
2525

2626
const PropertyViewTextContainer = React.lazy( async () => await import("./propertyView").then(module => ({default: module.PropertyViewTextContainer})))
2727
const typeOptions = [
@@ -67,7 +67,7 @@ export const ContainerBaseComp = (function () {
6767
let builder = new ContainerCompBuilder(childrenMap, (props, dispatch) => {
6868
return <TriContainer {...props} />;
6969
})
70-
if (!(viewMode() === "admin")) {
70+
if ((viewModeTriple() !== "admin")) {
7171
builder.setPropertyViewFn((children) => <PropertyViewTextContainer {...children}></PropertyViewTextContainer>);
7272
}
7373
return builder

client/packages/lowcoder/src/comps/comps/customComp/customComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ let CustomCompBaseBuilder = new UICompBuilder(childrenMap, (props, dispatch) =>
235235
);
236236
})
237237

238-
if (viewMode() === "edit") {
238+
if (viewMode() === "admin") {
239239
CustomCompBaseBuilder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
240240
}
241241

client/packages/lowcoder/src/comps/comps/dateComp/dateComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export let datePickerControl = new UICompBuilder(childrenMap, (props) => {
193193
});
194194
})
195195

196-
if (viewMode() === "edit") {
196+
if (viewMode() === "admin") {
197197
datePickerControl.setPropertyViewFn((children) => <PropertyViewDateComp1 {...children}></PropertyViewDateComp1>);
198198
}
199199
const datePickerControlBuilder = datePickerControl
@@ -291,7 +291,7 @@ export const dateRangeControl = (function () {
291291
});
292292
})
293293

294-
if (viewMode() === "edit") {
294+
if (viewMode() === "admin") {
295295
builder.setPropertyViewFn((children) => <PropertyViewDateComp2 {...children}></PropertyViewDateComp2>);
296296
}
297297
return builder

client/packages/lowcoder/src/comps/comps/dateComp/timeComp.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export let timePickerControl = new UICompBuilder(childrenMap, (props) => {
187187
...validate(props),
188188
});
189189
})
190-
if (viewMode() === "edit") {
190+
if (viewMode() === "admin") {
191191
timePickerControl.setPropertyViewFn((children) => <PropertyViewTimeComp1 {...children}></PropertyViewTimeComp1>);
192192
}
193193
const timePickerControlBuilder = timePickerControl
@@ -275,7 +275,7 @@ export let timeRangeControl = (function () {
275275
: startResult),
276276
});
277277
})
278-
if (viewMode() === "edit") {
278+
if (viewMode() === "admin") {
279279
builder.setPropertyViewFn((children) => <PropertyViewTimeComp2 {...children}></PropertyViewTimeComp2>);
280280
}
281281
return builder
@@ -448,4 +448,4 @@ TimeRangeComp = withMethodExposing(TimeRangeComp, [
448448
comp.children.end.getView().onChange(data.end);
449449
},
450450
},
451-
]);
451+
]);

client/packages/lowcoder/src/comps/comps/dividerComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const DividerTempComp = migrateOldData(
120120
})
121121
.setPropertyViewFn((children) => {
122122
return (
123-
viewMode() === "edit" ? <PropertyView {...children}></PropertyView> : <></>
123+
viewMode() === "admin" ? <PropertyView {...children}></PropertyView> : <></>
124124
);
125125
})
126126
.setExposeStateConfigs([

client/packages/lowcoder/src/comps/comps/fileComp/fileComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ let FileTmpComp = new UICompBuilder(childrenMap, (props, dispatch) => {
613613
)})
614614

615615

616-
if (viewMode() === "edit") {
616+
if (viewMode() === "admin") {
617617
FileTmpComp.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
618618
}
619619
const FileTmpCompBuilder = FileTmpComp

client/packages/lowcoder/src/comps/comps/fileViewerComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ let FileViewerBasicComp = (function () {
9595
showVerticalScrollbar={props.showVerticalScrollbar}
9696
/>;
9797
})
98-
if (viewMode() === "edit") {
98+
if (viewMode() === "admin") {
9999
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
100100
}
101101
return builder

client/packages/lowcoder/src/comps/comps/formComp/formComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import { messageInstance } from "lowcoder-design/src/components/GlobalInstances"
5454
import { styled } from "styled-components";
5555
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
5656
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
57-
import {viewMode} from "@lowcoder-ee/util/editor";
57+
import {viewMode, viewModeTriple} from "@lowcoder-ee/util/editor";
5858
const PropertyView = React.lazy( async () => await import("./propertyView"));
5959

6060
const FormWrapper = styled.div`
@@ -197,7 +197,7 @@ const FormBaseComp = (function () {
197197
</DisabledContext.Provider>
198198
);
199199
})
200-
if (!(viewMode() === "admin")) {
200+
if ((viewModeTriple() !== "admin")) {
201201
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
202202
}
203203
return builder

client/packages/lowcoder/src/comps/comps/iconComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const IconView = (props: RecordConstructorToView<typeof childrenMap>) => {
110110
let IconBasicComp = (function () {
111111
let builder = new UICompBuilder(childrenMap, (props) => {
112112
return(<IconView {...props} />)})
113-
if (viewMode() === "edit") {
113+
if (viewMode() === "admin") {
114114
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
115115
}
116116
return builder

client/packages/lowcoder/src/comps/comps/iframeComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let IFrameCompBase = new UICompBuilder(
6565
}
6666
)
6767

68-
if (viewMode() === "edit") {
68+
if (viewMode() === "admin") {
6969
IFrameCompBase.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
7070
}
7171

client/packages/lowcoder/src/comps/comps/imageComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const childrenMap = {
175175
let ImageBasicComp = new UICompBuilder(childrenMap, (props) => {
176176
return <ContainerImg {...props} />;
177177
})
178-
if (viewMode() === "edit") {
178+
if (viewMode() === "admin") {
179179
ImageBasicComp.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
180180
}
181181
const ImageBasicCompBuilder = ImageBasicComp.build();

client/packages/lowcoder/src/comps/comps/jsonComp/jsonEditorComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ let JsonEditorTmpComp = (function () {
141141
),
142142
});
143143
})
144-
if (viewMode() === "edit") {
144+
if (viewMode() === "admin") {
145145
builder.setPropertyViewFn((children) => <PropertyViewJsonEditor {...children}></PropertyViewJsonEditor>);
146146
}
147147
return builder

client/packages/lowcoder/src/comps/comps/jsonComp/jsonExplorerComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ let JsonExplorerTmpComp = (function () {
7878
</JsonExplorerContainer>
7979
);
8080
})
81-
if (viewMode() === "edit") {
81+
if (viewMode() === "admin") {
8282
builder.setPropertyViewFn((children) => <PropertyViewJsonExplorer {...children}></PropertyViewJsonExplorer>);
8383
}
8484
return builder

client/packages/lowcoder/src/comps/comps/jsonComp/jsonLottieComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ let JsonLottieTmpComp = (function () {
139139
</div>
140140
);
141141
})
142-
if (viewMode() === "edit") {
142+
if (viewMode() === "admin") {
143143
builder.setPropertyViewFn((children) => <PropertyViewJsonLottie {...children}></PropertyViewJsonLottie>);
144144
}
145145
return builder

client/packages/lowcoder/src/comps/comps/jsonSchemaFormComp/jsonSchemaFormComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ let FormBasicComp = (function () {
282282
</Container>
283283
);
284284
})
285-
if (viewMode() === "edit") {
285+
if (viewMode() === "admin") {
286286
builder.setPropertyViewFn((children) => <PropertyView {...children}></PropertyView>);
287287
}
288288
return builder

client/packages/lowcoder/src/comps/comps/layout/mobileTabLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ let MobileTabLayoutTmp = (function () {
321321
let builder = new MultiCompBuilder(childrenMap, (props, dispatch) => {
322322
return null;
323323
})
324-
if (viewMode() === "edit") {
324+
if (viewMode() === "admin") {
325325
builder.setPropertyViewFn((children) => <PropertyViewMobileTabLayout {...children}></PropertyViewMobileTabLayout>);
326326
}
327327
return builder

client/packages/lowcoder/src/comps/comps/layout/navLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ let NavTmpLayout = (function () {
205205
let builder = new MultiCompBuilder(childrenMap, (props) => {
206206
return null;
207207
})
208-
if (viewMode() === "edit") {
208+
if (viewMode() === "admin") {
209209
builder.setPropertyViewFn((children) => <PropertyViewNavLayout {...children}></PropertyViewNavLayout>);
210210
}
211211
return builder

client/packages/lowcoder/src/comps/comps/mediaComp/audioComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ let AudioBasicComp = (function () {
7676
let builder = new UICompBuilder(childrenMap, (props) => {
7777
return <ContainerAudio {...props} />;
7878
})
79-
if (viewMode() === "edit") {
79+
if (viewMode() === "admin") {
8080
builder.setPropertyViewFn((children) => <PropertyViewAudioComp {...children}></PropertyViewAudioComp>);
8181
}
8282
return builder

client/packages/lowcoder/src/comps/comps/mediaComp/colorPickerComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ let ColorPickerComps = new UICompBuilder(childrenMap, (props) => {
9595
});
9696
})
9797

98-
if (viewMode() === "edit") {
98+
if (viewMode() === "admin") {
9999
ColorPickerComps.setPropertyViewFn((children) => <PropertyViewColorPicker {...children}></PropertyViewColorPicker>);
100100
}
101101

client/packages/lowcoder/src/comps/comps/mediaComp/videoComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ let VideoBasicComp = (function () {
130130
let builder = new UICompBuilder(childrenMap, (props) => {
131131
return <ContainerVideo {...props} />;
132132
})
133-
if (viewMode() === "edit") {
133+
if (viewMode() === "admin") {
134134
builder.setPropertyViewFn((children) => <PropertyViewVideoComp {...children}></PropertyViewVideoComp>);
135135
}
136136
return builder

0 commit comments

Comments
 (0)