Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 781cbba

Browse files
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into dev
2 parents 0ccbd38 + 48e6991 commit 781cbba

File tree

562 files changed

+20039
-300
lines changed

Some content is hidden

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

562 files changed

+20039
-300
lines changed

‎.gitignore

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

‎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.6",
3+
"version": "2.4.7",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {

‎client/packages/lowcoder-design/src/components/control.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ export const ControlPropertyViewWrapper = (
164164
</LabelWrapper>
165165
)}
166166
{preInputNode}
167-
<ChildrenWrapper style={childrenWrapperStyle} $layout={layout}>
167+
{/* margin and padding are calculated differently so they're made equal */}
168+
<ChildrenWrapper style={{...childrenWrapperStyle,marginLeft:label==='Margin'||label==='Padding'?'6px':'0px'}} $layout={layout}>
168169
{children}
169170
{extraChildren}
170171
</ChildrenWrapper>

‎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.3",
3+
"version": "2.4.4",
44
"type": "module",
55
"files": [
66
"src",

‎client/packages/lowcoder/src/api/apiUtils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,13 @@ export const apiFailureResponseInterceptor = (error: any) => {
121121
// Need authorization
122122
if (!notAuthRequiredPath(error.config?.url)) {
123123
if (error.response.status === API_STATUS_CODES.REQUEST_NOT_AUTHORISED) {
124+
// get x-org-id from failed request
125+
const organizationId = error.response.headers['x-org-id'] || undefined;
124126
// Redirect to login and set a redirect url.
125127
StoreRegistry.getStore().dispatch(
126128
logoutAction({
127129
notAuthorised: true,
130+
organizationId,
128131
})
129132
);
130133
return Promise.reject({

‎client/packages/lowcoder/src/appView/AppViewInstance.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { saveAuthSearchParams } from "pages/userAuth/authUtils";
1414
import { Suspense, lazy } from "react";
1515
import Flex from "antd/es/flex";
1616
import { TacoButton } from "components/button";
17+
import { DatasourceApi } from "@lowcoder-ee/api/datasourceApi";
18+
import { registryDataSourcePlugin } from "@lowcoder-ee/constants/queryConstants";
1719

1820
const AppView = lazy(
1921
() => import('./AppView')
@@ -101,6 +103,12 @@ export class AppViewInstance<I = any, O = any> {
101103
};
102104
}
103105
});
106+
107+
await DatasourceApi.fetchJsDatasourceByApp(this.appId).then((res) => {
108+
res.data.data.forEach((i) => {
109+
registryDataSourcePlugin(i.type, i.id, i.pluginDefinition);
110+
});
111+
});
104112

105113
setGlobalSettings({
106114
orgCommonSettings: data.data.orgCommonSettings,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const Link = styled(Button)<{
3737
font-style:${props.$style.fontStyle};
3838
font-family:${props.$style.fontFamily};
3939
font-weight:${props.$style.textWeight};
40-
border: ${props.$style.borderWidth} solid ${props.$style.border};
40+
border: ${props.$style.borderWidth} ${props.$style.borderStyle} ${props.$style.border};
4141
border-radius:${props.$style.radius ? props.$style.radius:'0px'};
4242
text-transform:${props.$style.textTransform ? props.$style.textTransform:''};
4343
text-decoration:${props.$style.textDecoration ? props.$style.textDecoration:''} !important;

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

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,20 @@ import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUt
4242
import { DisabledContext } from "comps/generators/uiCompBuilder";
4343

4444
const ContainWrapper = styled.div<{
45-
$style: ContainerStyleType | undefined;
45+
$style: ContainerStyleType & {
46+
display: string,
47+
gridTemplateColumns: string,
48+
columnGap: string,
49+
gridTemplateRows: string,
50+
rowGap: string,
51+
} | undefined;
4652
}>`
53+
display: ${(props) => props.$style?.display};
54+
grid-template-columns: ${(props) => props.$style?.gridTemplateColumns};
55+
grid-template-rows: ${(props) => props.$style?.gridTemplateRows};
56+
column-gap: ${(props) => props.$style?.columnGap};
57+
row-gap: ${(props) => props.$style?.rowGap};
58+
4759
background-color: ${(props) => props.$style?.background} !important;
4860
border-radius: ${(props) => props.$style?.radius};
4961
border-width: ${(props) => props.$style?.borderWidth};
@@ -59,7 +71,7 @@ const ColWrapper = styled(Col)<{
5971
$matchColumnsHeight: boolean,
6072
}>`
6173
> div {
62-
height: ${(props) => props.$matchColumnsHeight ? '100%' : 'auto'};
74+
height: ${(props) => props.$matchColumnsHeight ? `calc(100% - ${props.$style?.padding||0} - ${props.$style?.padding||0})` : 'auto'};
6375
background-color: ${(props) => props.$style?.background} !important;
6476
border-radius: ${(props) => props.$style?.radius};
6577
border-width: ${(props) => props.$style?.borderWidth};
@@ -121,17 +133,24 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
121133
} = props;
122134

123135
return (
124-
<BackgroundColorContext.Provider value={"none"}>
136+
<BackgroundColorContext.Provider value={props.style.background}>
125137
<DisabledContext.Provider value={props.disabled}>
126-
<ContainWrapper $style={props.style}>
127-
<div style={{display: "grid", gridTemplateColumns: templateColumns, columnGap, gridTemplateRows: templateRows, rowGap}}>
128-
{columns.map(column => {
129-
const id = String(column.id);
130-
const childDispatch = wrapDispatch(wrapDispatch(dispatch, "containers"), id);
131-
if(!containers[id]) return null
132-
const containerProps = containers[id].children;
133-
const noOfColumns = columns.length;
134-
return (
138+
<ContainWrapper $style={{
139+
...props.style,
140+
display: "grid",
141+
gridTemplateColumns: templateColumns,
142+
columnGap,
143+
gridTemplateRows: templateRows,
144+
rowGap,
145+
}}>
146+
{columns.map(column => {
147+
const id = String(column.id);
148+
const childDispatch = wrapDispatch(wrapDispatch(dispatch, "containers"), id);
149+
if(!containers[id]) return null
150+
const containerProps = containers[id].children;
151+
const noOfColumns = columns.length;
152+
return (
153+
<BackgroundColorContext.Provider value={props.columnStyle.background}>
135154
<ColWrapper
136155
key={id}
137156
$style={props.columnStyle}
@@ -147,12 +166,12 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
147166
style={columnStyle}
148167
/>
149168
</ColWrapper>
150-
)
151-
})
152-
}
153-
</div>
169+
</BackgroundColorContext.Provider>
170+
)
171+
})
172+
}
154173
</ContainWrapper>
155-
</DisabledContext.Provider>
174+
</DisabledContext.Provider>
156175
</BackgroundColorContext.Provider>
157176
);
158177
};

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const Wrapper = styled.div<{
4949
margin: ${props => props.$headerStyle?.margin};
5050
padding: ${props => props.$headerStyle?.padding};
5151
}
52+
.ant-card-head-title{
53+
font-size: ${props => props.$headerStyle?.textSize};
54+
font-family: ${props => props.$headerStyle?.fontFamily};
55+
}
5256
.ant-card .ant-card-actions {
5357
border-top: 1px solid ${props => props.$style?.border};
5458
}
@@ -72,6 +76,8 @@ const Wrapper = styled.div<{
7276
display: flex;
7377
flex-direction: column;
7478
justify-content: space-between;
79+
margin: ${props => props.$style?.margin};
80+
padding: ${props => props.$style?.padding};
7581
background-color: ${props => props.$style?.background};
7682
border: ${props => props.$style?.border};
7783
rotate: ${props => props.$style?.rotation};

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

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const commonChildren = {
7676
hourStep: RangeControl.closed(1, 24, 1),
7777
minuteStep: RangeControl.closed(1, 60, 1),
7878
secondStep: RangeControl.closed(1, 60, 1),
79-
style: styleControl(InputFieldStyle),
79+
style: withDefault(styleControl(InputFieldStyle),{background:'transparent'}),
8080
animationStyle: styleControl(AnimationStyle),
8181
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
8282
suffixIcon: withDefault(IconControl, "/icon:regular/calendar"),
@@ -166,7 +166,7 @@ export type DateCompViewProps = Pick<
166166
};
167167

168168
export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
169-
let time = dayjs(null);
169+
let time = null;
170170
if (props.value.value !== '') {
171171
time = dayjs(props.value.value, DateParser);
172172
}
@@ -187,7 +187,7 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
187187
minDate={props.minDate}
188188
maxDate={props.maxDate}
189189
placeholder={props.placeholder}
190-
value={time.isValid() ? time : null}
190+
value={time?.isValid() ? time : null}
191191
onChange={(time) => {
192192
handleDateChange(
193193
time && time.isValid()
@@ -285,11 +285,12 @@ export const dateRangeControl = (function () {
285285
};
286286

287287
return new UICompBuilder(childrenMap, (props) => {
288-
let start = dayjs(null);
289-
let end = dayjs(null);
288+
let start = null;
289+
let end = null;
290290
if (props.start.value !== '') {
291291
start = dayjs(props.start.value, DateParser);
292292
}
293+
293294
if (props.end.value !== '') {
294295
end = dayjs(props.end.value, DateParser);
295296
}
@@ -300,8 +301,8 @@ export const dateRangeControl = (function () {
300301
$style={props.inputFieldStyle}
301302
disabled={props.disabled}
302303
{...datePickerProps(props)}
303-
start={start.isValid() ? start : null}
304-
end={end.isValid() ? end : null}
304+
start={start?.isValid() ? start : null}
305+
end={end?.isValid() ? end : null}
305306
minDate={props.minDate}
306307
maxDate={props.maxDate}
307308
placeholder={[props.placeholder, props.placeholder]}
@@ -418,26 +419,26 @@ export const DatePickerComp = withExposingConfigs(datePickerControl, [
418419
desc: trans("export.datePickerValueDesc"),
419420
depKeys: ["value", "showTime"],
420421
func: (input) => {
421-
const mom = dayjs(input.value, DateParser);
422-
return mom.isValid() ? mom.format(input.showTime ? DATE_TIME_FORMAT : DATE_FORMAT) : "";
422+
const mom = Boolean(input.value) ? dayjs(input.value, DateParser) : null;
423+
return mom?.isValid() ? mom.format(input.showTime ? DATE_TIME_FORMAT : DATE_FORMAT) : null;
423424
},
424425
}),
425426
depsConfig({
426427
name: "formattedValue",
427428
desc: trans("export.datePickerFormattedValueDesc"),
428429
depKeys: ["value", "format"],
429430
func: (input) => {
430-
const mom = dayjs(input.value, DateParser);
431-
return mom.isValid() ? mom.format(input.format) : "";
431+
const mom = Boolean(input.value) ? dayjs(input.value, DateParser) : null;
432+
return mom?.isValid() ? mom.format(input.format) : "";
432433
},
433434
}),
434435
depsConfig({
435436
name: "timestamp",
436437
desc: trans("export.datePickerTimestampDesc"),
437438
depKeys: ["value"],
438439
func: (input) => {
439-
const mom = dayjs(input.value, DateParser);
440-
return mom.isValid() ? mom.unix() : "";
440+
const mom = Boolean(input.value) ? dayjs(input.value, DateParser) : null;
441+
return mom?.isValid() ? mom.unix() : "";
441442
},
442443
}),
443444
depsConfig({
@@ -459,47 +460,47 @@ export let DateRangeComp = withExposingConfigs(dateRangeControl, [
459460
desc: trans("export.dateRangeStartDesc"),
460461
depKeys: ["start", "showTime"],
461462
func: (input) => {
462-
const mom = dayjs(input.start, DateParser);
463-
return mom.isValid() ? mom.format(input.showTime ? DATE_TIME_FORMAT : DATE_FORMAT) : "";
463+
const mom = Boolean(input.start) ? dayjs(input.start, DateParser): null;
464+
return mom?.isValid() ? mom.format(input.showTime ? DATE_TIME_FORMAT : DATE_FORMAT) : null;
464465
},
465466
}),
466467
depsConfig({
467468
name: "end",
468469
desc: trans("export.dateRangeEndDesc"),
469470
depKeys: ["end", "showTime"],
470471
func: (input) => {
471-
const mom = dayjs(input.end, DateParser);
472-
return mom.isValid() ? mom.format(input.showTime ? DATE_TIME_FORMAT : DATE_FORMAT) : "";
472+
const mom = Boolean(input.end) ? dayjs(input.end, DateParser): null;
473+
return mom?.isValid() ? mom.format(input.showTime ? DATE_TIME_FORMAT : DATE_FORMAT) : null;
473474
},
474475
}),
475476
depsConfig({
476477
name: "startTimestamp",
477478
desc: trans("export.dateRangeStartTimestampDesc"),
478479
depKeys: ["start"],
479480
func: (input) => {
480-
const mom = dayjs(input.start, DateParser);
481-
return mom.isValid() ? mom.unix() : "";
481+
const mom = Boolean(input.start) ? dayjs(input.start, DateParser) : null;
482+
return mom?.isValid() ? mom.unix() : "";
482483
},
483484
}),
484485
depsConfig({
485486
name: "endTimestamp",
486487
desc: trans("export.dateRangeEndTimestampDesc"),
487488
depKeys: ["end"],
488489
func: (input) => {
489-
const mom = dayjs(input.end, DateParser);
490-
return mom.isValid() ? mom.unix() : "";
490+
const mom = Boolean(input.end) ? dayjs(input.end, DateParser) : null;
491+
return mom?.isValid() ? mom.unix() : "";
491492
},
492493
}),
493494
depsConfig({
494495
name: "formattedValue",
495496
desc: trans("export.dateRangeFormattedValueDesc"),
496497
depKeys: ["start", "end", "format"],
497498
func: (input) => {
498-
const start = dayjs(input.start, DateParser);
499-
const end = dayjs(input.end, DateParser);
499+
const start = Boolean(input.start) ? dayjs(input.start, DateParser): null;
500+
const end = Boolean(input.end) ? dayjs(input.end, DateParser): null;
500501
return [
501-
start.isValid() && start.format(input.format),
502-
end.isValid() && end.format(input.format),
502+
start?.isValid() && start.format(input.format),
503+
end?.isValid() && end.format(input.format),
503504
]
504505
.filter((item) => item)
505506
.join(" - ");
@@ -510,17 +511,17 @@ export let DateRangeComp = withExposingConfigs(dateRangeControl, [
510511
desc: trans("export.dateRangeFormattedStartValueDesc"),
511512
depKeys: ["start", "format"],
512513
func: (input) => {
513-
const start = dayjs(input.start, DateParser);
514-
return start.isValid() && start.format(input.format);
514+
const start = Boolean(input.start) ? dayjs(input.start, DateParser): null;
515+
return start?.isValid() && start.format(input.format);
515516
},
516517
}),
517518
depsConfig({
518519
name: "formattedEndValue",
519520
desc: trans("export.dateRangeFormattedEndValueDesc"),
520521
depKeys: ["end", "format"],
521522
func: (input) => {
522-
const end = dayjs(input.end, DateParser);
523-
return end.isValid() && end.format(input.format);
523+
const end = Boolean(input.end) ? dayjs(input.end, DateParser): null;
524+
return end?.isValid() && end.format(input.format);
524525
},
525526
}),
526527
depsConfig({

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /