Skip to content

Commit 1ca3b02

Browse files
authored
Merge branch 'versions-for-datasources' into feature/spec_version
2 parents 03688bf + b1f1ede commit 1ca3b02

File tree

28 files changed

+3782
-4548
lines changed

28 files changed

+3782
-4548
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ application-lowcoder.yml
1414
application-debug.yaml
1515
application-dev-localhost.yaml
1616
.vscode/settings.json
17-
.vscode/launch.json
17+
.vscode/launch.json
18+
server/api-service/lowcoder-server/src/main/resources/application-local-dev.yaml

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.4
1+
2.4.5

client/packages/lowcoder-comps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "2.4.10",
3+
"version": "2.4.13",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {

client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ let childrenMap: any = {
7979
resourcesEvents: jsonValueExposingStateControl("resourcesEvents", resourcesEventsDefaultData),
8080
resources: jsonValueExposingStateControl("resources", resourcesDefaultData),
8181
resourceName: withDefault(StringControl, trans("calendar.resourcesDefault")),
82-
onEvent: CalendarEventHandlerControl,
82+
onEvent: CalendarEventHandlerControl ? CalendarEventHandlerControl : ChangeEventHandlerControl,
8383
// onDropEvent: safeDragEventHandlerControl,
8484
editable: withDefault(BoolControl, true),
8585
showEventTime: withDefault(BoolControl, true),
@@ -124,10 +124,10 @@ let CalendarBasicComp = (function () {
124124
currentPremiumView?: string;
125125
}, dispatch: any) => {
126126

127-
const comp = useContext(EditorContext).getUICompByName(
128-
useContext(CompNameContext)
127+
const comp = useContext(EditorContext).getUICompByName(
128+
useContext(CompNameContext)
129129
);
130-
const onEventVal = comp?.toJsonValue().comp.onEvent;
130+
const onEventVal = comp?.toJsonValue()?.comp?.onEvent;
131131

132132

133133
const theme = useContext(ThemeContext);

client/packages/lowcoder-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-sdk",
3-
"version": "2.4.10",
3+
"version": "2.4.11",
44
"type": "module",
55
"files": [
66
"src",

client/packages/lowcoder/src/api/subscriptionApi.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export type ResponseType = {
2525
response: any;
2626
};
2727

28-
const apiUrl = "https://flow.lowcoder.cloud/webhook/secure";
28+
const apiUrl = "http://localhost:8080/api/flow";
2929
const authHeader = "96a99c7b-3758-4c48-b4b1-a8cbf59e7d6c";
3030

3131
const currentPage = 1;
@@ -41,7 +41,7 @@ const getAxiosInstance = (clientSecret?: string) => {
4141

4242
const headers: Record<string, string> = {
4343
"Content-Type": "application/json",
44-
"Lowcoder-Token": authHeader,
44+
// "Lowcoder-Token": authHeader,
4545
}
4646

4747
const apiRequestConfig: AxiosRequestConfig = {
@@ -55,13 +55,12 @@ const getAxiosInstance = (clientSecret?: string) => {
5555

5656
class SubscriptionApi extends Api {
5757

58-
static async createCustomer(body: Customer): Promise<any> {
58+
static async createCustomer(body: any): Promise<any> {
5959
console.log("createCustomerCall", body);
6060

6161
let response;
6262
try {
6363
response = await getAxiosInstance().request({
64-
url: '/create-customer',
6564
method: "POST",
6665
withCredentials: true,
6766
data: body,

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

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Section, sectionNames } from "lowcoder-design";
1+
import { ScrollBar, Section, sectionNames } from "lowcoder-design";
22
import { UICompBuilder } from "../../generators";
33
import { NameConfigHidden, NameConfig, withExposingConfigs } from "../../generators/withExposing";
44
import { defaultData } from "./jsonConstants";
@@ -21,17 +21,18 @@ import {
2121
import { useExtensions } from "base/codeEditor/extensions";
2222
import { EditorContext } from "comps/editorState";
2323
import { useMergeCompStyles } from "@lowcoder-ee/util/hooks";
24+
import { AutoHeightControl, BoolControl } from "@lowcoder-ee/index.sdk";
2425

2526
/**
2627
* JsonEditor Comp
2728
*/
2829

29-
const Wrapper = styled.div`
30+
const Wrapper = styled.div<{$height: boolean; $showVerticalScrollbar: boolean}>`
3031
background-color: #fff;
3132
border: 1px solid #d7d9e0;
3233
border-radius: 4px;
33-
overflow: auto;
3434
height: 100%;
35+
overflow-y: ${props => (props.$showVerticalScrollbar ? 'scroll' : 'auto')};
3536
`;
3637

3738
/**
@@ -63,11 +64,13 @@ function fixOldDataSecond(oldData: any) {
6364
}
6465

6566
const childrenMap = {
66-
value: jsonValueExposingStateControl("value", defaultData),
67+
value: jsonValueExposingStateControl('value', defaultData),
6768
onEvent: ChangeEventHandlerControl,
68-
label: withDefault(LabelControl, { position: "column" }),
69+
autoHeight: withDefault(AutoHeightControl,'auto'),
70+
showVerticalScrollbar:BoolControl,
71+
label: withDefault(LabelControl, {position: 'column'}),
6972
style: styleControl(JsonEditorStyle, 'style'),
70-
animationStyle: styleControl(AnimationStyle , 'animationStyle'),
73+
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
7174
...formDataChildren,
7275
};
7376

@@ -77,6 +80,8 @@ let JsonEditorTmpComp = (function () {
7780

7881
const wrapperRef = useRef<HTMLDivElement>(null);
7982
const view = useRef<EditorViewType | null>(null);
83+
const initialized = useRef(false);
84+
const state = useRef<EditorState | null>(null);
8085
const editContent = useRef<string>();
8186
const { extensions } = useExtensions({
8287
codeType: "PureJSON",
@@ -99,15 +104,21 @@ let JsonEditorTmpComp = (function () {
99104
});
100105

101106
useEffect(() => {
102-
if (wrapperRef.current && !view.current) {
103-
const state = EditorState.create({
107+
if (!initialized.current && wrapperRef.current) {
108+
state.current = EditorState.create({
104109
doc: JSON.stringify(props.value.value, null, 2),
105110
extensions,
106111
});
107-
view.current = new EditorView({ state, parent: wrapperRef.current });
108112
}
109113
}, [wrapperRef.current]);
110114

115+
useEffect(() => {
116+
if (state.current&&wrapperRef.current) {
117+
view.current = new EditorView({ state: state.current, parent: wrapperRef.current });
118+
initialized.current = true;
119+
}
120+
}, [props.showVerticalScrollbar])
121+
111122
if (wrapperRef.current && view.current && !editContent.current) {
112123
const state = EditorState.create({
113124
doc: JSON.stringify(props.value.value, null, 2),
@@ -121,7 +132,16 @@ let JsonEditorTmpComp = (function () {
121132
return props.label({
122133
style: props.style,
123134
animationStyle: props.animationStyle,
124-
children: <Wrapper ref={wrapperRef} onFocus={() => (editContent.current = "focus")} />,
135+
children: (
136+
<ScrollBar hideScrollbar={!props.showVerticalScrollbar}>
137+
<Wrapper
138+
ref={wrapperRef}
139+
onFocus={() => (editContent.current = 'focus')}
140+
$height={props.autoHeight}
141+
$showVerticalScrollbar={props.showVerticalScrollbar}
142+
/>
143+
</ScrollBar>
144+
),
125145
});
126146
})
127147
.setPropertyViewFn((children) => {
@@ -139,7 +159,13 @@ let JsonEditorTmpComp = (function () {
139159
{hiddenPropertyView(children)}
140160
</Section>
141161
)}
142-
162+
<Section name={trans('prop.height')}>
163+
{children.autoHeight.propertyView({ label: trans('prop.height') })}
164+
</Section>
165+
{!children.autoHeight.getView()&&<Section name={sectionNames.layout}>
166+
{children.showVerticalScrollbar.propertyView({label: trans('prop.showVerticalScrollbar')})}
167+
168+
</Section>}
143169
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && ( children.label.getPropertyView() )}
144170
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
145171
<>
@@ -160,7 +186,7 @@ JsonEditorTmpComp = migrateOldData(JsonEditorTmpComp, fixOldDataSecond);
160186

161187
JsonEditorTmpComp = class extends JsonEditorTmpComp {
162188
override autoHeight(): boolean {
163-
return false;
189+
return this.children.autoHeight.getView();
164190
}
165191
};
166192

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

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Section, sectionNames } from "lowcoder-design";
1+
import { ScrollBar, Section, sectionNames } from "lowcoder-design";
22
import { UICompBuilder, withDefault } from "../../generators";
33
import { NameConfigHidden, NameConfig, withExposingConfigs } from "../../generators/withExposing";
44
import ReactJson, { type ThemeKeys } from "react-json-view";
@@ -14,6 +14,7 @@ import { useContext, useEffect } from "react";
1414
import { AnimationStyle, AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants";
1515
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
1616
import { useMergeCompStyles } from "@lowcoder-ee/util/hooks";
17+
import { AutoHeightControl } from "@lowcoder-ee/index.sdk";
1718

1819
/**
1920
* JsonExplorer Comp
@@ -44,7 +45,7 @@ const JsonExplorerContainer = styled.div<{
4445
${(props) => props.$animationStyle}
4546
height: 100%;
4647
overflow-y: scroll;
47-
background-color: ${(props) => bgColorMap[props.$theme] || "#ffffff"};
48+
background-color: ${(props) => bgColorMap[props.$theme] || '#ffffff'};
4849
border: 1px solid #d7d9e0;
4950
border-radius: 4px;
5051
padding: 10px;
@@ -53,6 +54,8 @@ const JsonExplorerContainer = styled.div<{
5354
let JsonExplorerTmpComp = (function () {
5455
const childrenMap = {
5556
value: withDefault(ArrayOrJSONObjectControl, JSON.stringify(defaultData, null, 2)),
57+
autoHeight: withDefault(AutoHeightControl, 'auto'),
58+
showVerticalScrollbar:BoolControl,
5659
indent: withDefault(NumberControl, 4),
5760
expandToggle: BoolControl.DEFAULT_TRUE,
5861
theme: dropdownControl(themeOptions, 'shapeshifter:inverted'),
@@ -66,22 +69,24 @@ let JsonExplorerTmpComp = (function () {
6669
$theme={props.theme as keyof typeof bgColorMap}
6770
$animationStyle={props.animationStyle}
6871
>
69-
<ReactJson
70-
name={false}
71-
src={props.value}
72-
theme={props.theme as ThemeKeys}
73-
collapsed={!props.expandToggle}
74-
displayDataTypes={false}
75-
indentWidth={props.indent}
76-
/>
72+
<ScrollBar hideScrollbar={!props.showVerticalScrollbar}>
73+
<ReactJson
74+
name={false}
75+
src={props.value}
76+
theme={props.theme as ThemeKeys}
77+
collapsed={!props.expandToggle}
78+
displayDataTypes={false}
79+
indentWidth={props.indent}
80+
/>
81+
</ScrollBar>
7782
</JsonExplorerContainer>
78-
)
83+
);
7984
})
8085
.setPropertyViewFn((children) => {
8186
return (
8287
<>
8388
<Section name={sectionNames.basic}>
84-
{children.value.propertyView({ label: trans("export.jsonEditorDesc") })}
89+
{children.value.propertyView({ label: trans("export.jsonEditorDesc") })}
8590
</Section>
8691

8792
{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
@@ -96,7 +101,14 @@ let JsonExplorerTmpComp = (function () {
96101
{children.indent.propertyView({ label: trans("jsonExplorer.indent") })}
97102
</Section>
98103
)}
99-
104+
<Section name={trans('prop.height')}>
105+
{children.autoHeight.propertyView({label: trans('prop.height')})}
106+
</Section>
107+
{!children.autoHeight.getView()&&<Section name={sectionNames.layout}>
108+
{children.showVerticalScrollbar.propertyView({
109+
label: trans('prop.showVerticalScrollbar'),
110+
})}
111+
</Section>}
100112
{(useContext(EditorContext).editorModeStatus === 'layout' ||
101113
useContext(EditorContext).editorModeStatus === 'both') && (
102114
<>
@@ -118,7 +130,7 @@ let JsonExplorerTmpComp = (function () {
118130

119131
JsonExplorerTmpComp = class extends JsonExplorerTmpComp {
120132
override autoHeight(): boolean {
121-
return false;
133+
return this.children.autoHeight.getView();
122134
}
123135
};
124136

client/packages/lowcoder/src/comps/comps/tableComp/tableCompView.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const BackgroundWrapper = styled.div<{
144144
$tableAutoHeight: boolean;
145145
$showHorizontalScrollbar: boolean;
146146
$showVerticalScrollbar: boolean;
147+
$fixedToolbar: boolean;
147148
}>`
148149
display: flex;
149150
flex-direction: column;
@@ -158,8 +159,15 @@ const BackgroundWrapper = styled.div<{
158159
overflow: hidden;
159160
160161
> div.table-scrollbar-wrapper {
161-
height: auto;
162162
overflow: auto;
163+
${(props) => props.$fixedToolbar && `height: auto`};
164+
165+
${(props) => (props.$showHorizontalScrollbar || props.$showVerticalScrollbar) && `
166+
.simplebar-content-wrapper {
167+
overflow: auto !important;
168+
}
169+
`}
170+
163171
${(props) => !props.$showHorizontalScrollbar && `
164172
div.simplebar-horizontal {
165173
visibility: hidden !important;
@@ -847,6 +855,7 @@ export function TableCompView(props: {
847855
return <EmptyContent text={trans("table.emptyColumns")} />;
848856
}
849857

858+
const hideScrollbar = !showHorizontalScrollbar && !showVerticalScrollbar;
850859
return (
851860
<BackgroundColorContext.Provider value={style.background} >
852861
<BackgroundWrapper
@@ -855,14 +864,15 @@ export function TableCompView(props: {
855864
$tableAutoHeight={tableAutoHeight}
856865
$showHorizontalScrollbar={showHorizontalScrollbar}
857866
$showVerticalScrollbar={showVerticalScrollbar}
867+
$fixedToolbar={toolbar.fixedToolbar}
858868
>
859-
{toolbar.position === "above" && toolbar.fixedToolbar && toolbarView}
869+
{toolbar.position === "above" && (toolbar.fixedToolbar || (tableAutoHeight && showHorizontalScrollbar)) && toolbarView}
860870
<ScrollBar
861871
className="table-scrollbar-wrapper"
862872
style={{ height: "100%", margin: "0px", padding: "0px" }}
863-
hideScrollbar={!showHorizontalScrollbar && !showVerticalScrollbar}
864-
prefixNode={toolbar.position === "above" && !toolbar.fixedToolbar && toolbarView}
865-
suffixNode={toolbar.position === "below" && !toolbar.fixedToolbar && toolbarView}
873+
hideScrollbar={hideScrollbar}
874+
prefixNode={toolbar.position === "above" && !toolbar.fixedToolbar && !(tableAutoHeight && showHorizontalScrollbar) && toolbarView}
875+
suffixNode={toolbar.position === "below" && !toolbar.fixedToolbar && !(tableAutoHeight && showHorizontalScrollbar) && toolbarView}
866876
>
867877
<TableWrapper
868878
$style={style}
@@ -926,7 +936,7 @@ export function TableCompView(props: {
926936
</SlotConfigContext.Provider>
927937
</TableWrapper>
928938
</ScrollBar>
929-
{toolbar.position === "below" && toolbar.fixedToolbar && toolbarView}
939+
{toolbar.position === "below" && (toolbar.fixedToolbar || (tableAutoHeight && showHorizontalScrollbar)) && toolbarView}
930940
</BackgroundWrapper>
931941

932942
</BackgroundColorContext.Provider>

client/packages/lowcoder/src/comps/hooks/localStorageComp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import isEqual from "fast-deep-equal";
88
import { trans } from "i18n";
99
import log from "loglevel";
1010

11-
const APP_STORE_NAMESPACE = "TACO_APP_LOCAL_STORE";
11+
const APP_STORE_NAMESPACE = "lowcoder_app_local_storage";
1212

1313
const LocalStorageCompBase = withViewFn(
1414
simpleMultiComp({ values: stateComp<JSONObject>({}) }),

client/packages/lowcoder/src/constants/themeConstants.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ const checkbox = {
164164
}
165165
}
166166

167+
const tree = {
168+
...input.inputFieldStyle,
169+
labelStyle: {
170+
borderWidth: '0px',
171+
},
172+
style: { background: theme.primarySurface }
173+
174+
}
175+
167176

168177
export const defaultTheme: ThemeDetail = {
169178
...theme,
@@ -197,5 +206,6 @@ export const defaultTheme: ThemeDetail = {
197206
select: select,
198207
multiSelect: select,
199208
treeSelect: select,
209+
tree:tree
200210
},
201211
};

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const en = {
198198
"toggleClose": "Enable Close Button",
199199
"showMask": "Show Mask",
200200
"textOverflow": "Text Overflow",
201-
"scrollbar" : "Show Scrollbars",
201+
"scrollbar": "Show Scrollbars",
202202
"siderScrollbar" : "Show Scrollbars in Sider",
203203
"siderRight" : "Show sider on the Right",
204204
"siderWidth" : "Sider Width",

0 commit comments

Comments
 (0)