Skip to content

Commit 4896e48

Browse files
authored
Merge pull request #1611 from lowcoder-org/dev
Dev -> Main 2.6.5
2 parents 9fa16f3 + cda8b6d commit 4896e48

File tree

19 files changed

+257
-172
lines changed

19 files changed

+257
-172
lines changed

Diff for: client/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.4
1+
2.6.5

Diff for: client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-frontend",
3-
"version": "2.6.4",
3+
"version": "2.6.5",
44
"type": "module",
55
"private": true,
66
"workspaces": [

Diff for: client/packages/lowcoder-comps/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "2.6.5",
3+
"version": "2.6.6",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {

Diff for: client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

+83-94
Large diffs are not rendered by default.

Diff for: client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx

+37-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ import {
1515
lightenColor,
1616
toHex,
1717
UnderlineCss,
18-
EventModalStyleType
18+
EventModalStyleType,
19+
DateParser,
20+
isValidColor,
21+
Theme,
1922
} from "lowcoder-sdk";
2023
import styled from "styled-components";
2124
import dayjs from "dayjs";
@@ -27,6 +30,10 @@ import {
2730
} from "@fullcalendar/core";
2831
import { default as Form } from "antd/es/form";
2932

33+
type Theme = typeof Theme;
34+
type EventModalStyleType = typeof EventModalStyleType;
35+
type CalendarStyleType = typeof CalendarStyleType;
36+
3037
export const Wrapper = styled.div<{
3138
$editable?: boolean;
3239
$style?: CalendarStyleType;
@@ -1135,3 +1142,32 @@ export const viewClassNames = (info: ViewContentArg) => {
11351142
return className;
11361143
};
11371144

1145+
export const formattedEvents = (events: EventType[], theme?: Theme) => {
1146+
return events.map((item: EventType) => {
1147+
return {
1148+
title: item.label,
1149+
label: item.label,
1150+
id: item.id,
1151+
start: dayjs(item.start, DateParser).format(),
1152+
end: dayjs(item.end, DateParser).format(),
1153+
allDay: item.allDay,
1154+
...(item.resourceId ? { resourceId: item.resourceId } : {}),
1155+
...(item.groupId ? { groupId: item.groupId } : {}),
1156+
backgroundColor: item.backgroundColor,
1157+
extendedProps: { // Ensure color is in extendedProps
1158+
color: isValidColor(item.color || "") ? item.color : theme?.theme?.primary,
1159+
detail: item.detail,
1160+
titleColor: item.titleColor,
1161+
detailColor: item.detailColor,
1162+
titleFontWeight: item.titleFontWeight,
1163+
titleFontStyle: item.titleFontStyle,
1164+
detailFontWeight: item.detailFontWeight,
1165+
detailFontStyle: item.detailFontStyle,
1166+
animation: item?.animation,
1167+
animationDelay: item?.animationDelay,
1168+
animationDuration: item?.animationDuration,
1169+
animationIterationCount: item?.animationIterationCount
1170+
}
1171+
}
1172+
})
1173+
}

Diff for: client/packages/lowcoder-design/src/components/keyValueList.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export const KeyValueList = (props: {
9696
onDelete: (item: ReactNode, index: number) => void;
9797
isStatic?: boolean;
9898
indicatorForAll?: boolean;
99+
allowDeletingAll?: boolean;
99100
}) => {
100101
return (
101102
<>
@@ -105,8 +106,8 @@ export const KeyValueList = (props: {
105106
{item}
106107
{!props.isStatic &&
107108
<DelIcon
108-
onClick={() => props.list.length > 1 && props.onDelete(item, index)}
109-
$forbidden={props.list.length === 1}
109+
onClick={() => (props.allowDeletingAll || (!props.allowDeletingAll && props.list.length > 1)) && props.onDelete(item, index)}
110+
$forbidden={!props.allowDeletingAll && props.list.length === 1}
110111
/>
111112
}
112113
</KeyValueListItem>

Diff for: client/packages/lowcoder/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder",
3-
"version": "2.6.4",
3+
"version": "2.6.5",
44
"private": true,
55
"type": "module",
66
"main": "src/index.sdk.ts",

Diff for: client/packages/lowcoder/src/appView/bootstrapAt.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { loadComps } from "comps";
22
import type { AppViewInstanceOptions } from "./AppViewInstance";
33
import { createRoot } from "react-dom/client";
44

5-
loadComps();
6-
75
export async function bootstrapAppAt<I>(
86
appId: string,
97
node: Element | null,
@@ -14,6 +12,8 @@ export async function bootstrapAppAt<I>(
1412
return;
1513
}
1614

15+
loadComps();
16+
1717
const { AppViewInstance } = await import("./AppViewInstance");
1818
return new AppViewInstance(appId, node, createRoot(node), options);
1919
}

Diff for: client/packages/lowcoder/src/comps/comps/customComp/customComp.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ function InnerCustomComponent(props: IProps) {
191191
iframe.addEventListener("load", handleIFrameLoad);
192192

193193
// in dev, load from sdk bundle and on prod load from build package
194-
const src = import.meta.env.DEV
194+
const src = (REACT_APP_BUNDLE_TYPE && REACT_APP_BUNDLE_TYPE === 'sdk')
195+
|| (import.meta.env && import.meta.env.DEV)
195196
? trans('customComponent.entryUrl')
196197
: `${window.location.origin}/custom_component/custom_component.html`;
197198

Diff for: client/packages/lowcoder/src/comps/comps/tableComp/tableCompView.tsx

+31-4
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ const TableWrapper = styled.div<{
243243
position: -webkit-sticky;
244244
// top: ${props.$fixedToolbar ? '47px' : '0'};
245245
top: 0;
246-
z-index: 99;
246+
z-index: 2;
247247
`
248248
}
249249
> tr {
@@ -256,7 +256,14 @@ const TableWrapper = styled.div<{
256256
color: ${(props) => props.$headerStyle.headerText};
257257
// border-inline-end: ${(props) => `${props.$headerStyle.borderWidth} solid ${props.$headerStyle.border}`} !important;
258258
259-
259+
/* Proper styling for fixed header cells */
260+
&.ant-table-cell-fix-left, &.ant-table-cell-fix-right {
261+
z-index: 1;
262+
background: ${(props) => props.$headerStyle.headerBackground};
263+
}
264+
265+
266+
260267
> div {
261268
margin: ${(props) => props.$headerStyle.margin};
262269
@@ -295,7 +302,27 @@ const TableWrapper = styled.div<{
295302
296303
td {
297304
padding: 0px 0px;
298-
// ${(props) => props.$showHRowGridBorder ?'border-bottom: 1px solid #D7D9E0 !important;': `border-bottom: 0px;`}
305+
// ${(props) => props.$showHRowGridBorder ? 'border-bottom: 1px solid #D7D9E0 !important;': `border-bottom: 0px;`}
306+
307+
/* Proper styling for Fixed columns in the table body */
308+
&.ant-table-cell-fix-left, &.ant-table-cell-fix-right {
309+
z-index: 1;
310+
background: inherit;
311+
background-color: ${(props) => props.$style.background};
312+
transition: background-color 0.3s;
313+
}
314+
315+
}
316+
317+
/* Fix for selected and hovered rows */
318+
tr.ant-table-row-selected td.ant-table-cell-fix-left,
319+
tr.ant-table-row-selected td.ant-table-cell-fix-right {
320+
background-color: ${(props) => props.$rowStyle?.selectedRowBackground || '#e6f7ff'} !important;
321+
}
322+
323+
tr.ant-table-row:hover td.ant-table-cell-fix-left,
324+
tr.ant-table-row:hover td.ant-table-cell-fix-right {
325+
background-color: ${(props) => props.$rowStyle?.hoverRowBackground || '#f5f5f5'} !important;
299326
}
300327
301328
thead > tr:first-child {
@@ -428,7 +455,7 @@ const TableTd = styled.td<{
428455
}
429456
430457
&:active {
431-
color: ${(props) => props.$linkStyle?.activeText}};
458+
color: ${(props) => props.$linkStyle?.activeText};
432459
}
433460
}
434461
}

Diff for: client/packages/lowcoder/src/comps/controls/actionSelector/actionSelectorControl.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ function actionSelectorControl(needContext: boolean) {
251251
const ignorePromise = Promise.resolve();
252252
const realNeedContext = needContext || getReduceContext().inEventContext;
253253
const actionPromise = () => {
254-
return realNeedContext ? action.value.func() : this.children.comp.getView()();
254+
// return realNeedContext ? action.value.func() : this.children.comp.getView()();
255+
// commenting because it's using old context for event handlers inside list/grid
256+
return this.children.comp.getView()();
255257
};
256258
handlePromiseAfterResult(action, ignored ? ignorePromise : actionPromise());
257259
return this;

Diff for: client/packages/lowcoder/src/comps/controls/actionSelector/executeQueryAction.tsx

+29-19
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getPromiseAfterDispatch } from "util/promiseUtils";
99
import { trans } from "i18n";
1010
import { withDefault } from "comps/generators";
1111
import { keyValueListControl} from "comps/controls/keyValueListControl";
12-
import { useCallback } from "react";
12+
import { useCallback, useEffect } from "react";
1313

1414
const ExecuteQueryPropertyView = ({
1515
comp,
@@ -19,16 +19,25 @@ const ExecuteQueryPropertyView = ({
1919
placement?: "query" | "table"
2020
}) => {
2121
const getQueryOptions = useCallback((editorState?: EditorState) => {
22-
const options: { label: string; value: string; variables?: Record<string, string> }[] =
23-
editorState
24-
?.queryCompInfoList()
25-
.map((info) => {
22+
if (!editorState) return [];
23+
const options: {
24+
label: string;
25+
value: string;
26+
variables?: Record<string, string>
27+
}[] = editorState.getQueriesComp()
28+
.getView()
29+
.map((item) => {
30+
const name = item.children.name.getView();
31+
const qVariables: Record<string, string> = {};
32+
item.children.variables.toJsonValue().forEach(v => {
33+
qVariables[v.key!] = '';
34+
});
2635
return {
27-
label: info.name,
28-
value: info.name,
29-
variables: info.data.variables,
36+
label: name,
37+
value: name,
38+
variables: qVariables,
3039
}
31-
})
40+
})
3241
.filter(
3342
// Filter out the current query under query
3443
(option) => {
@@ -67,7 +76,7 @@ const ExecuteQueryPropertyView = ({
6776
indicatorForAll: true,
6877
});
6978
}, [comp.children.queryVariables.getView()])
70-
79+
7180
return (
7281
<>
7382
<BranchDiv $type={"inline"}>
@@ -114,26 +123,27 @@ const ExecuteQueryTmpAction = (function () {
114123
export class ExecuteQueryAction extends ExecuteQueryTmpAction {
115124
override getView() {
116125
const queryName = this.children.queryName.getView();
117-
// const queryParams = keyValueListToSearchStr(Array.isArray(this?.children?.query) ? (this.children.query as unknown as any[]).map((i: any) => i.getView() as KeyValue) : []);
118-
const result = this.children.queryVariables.toJsonValue()
119-
.filter(item => item.key !== "" && item.value !== "")
120-
.map(item => ({[item.key as string]: item.value}))
121-
.reduce((acc, curr) => Object.assign(acc, curr), {});
122-
123-
result.$queryName = queryName;
124126
if (!queryName) {
125127
return () => Promise.resolve();
126128
}
127129

128-
return () =>
129-
getPromiseAfterDispatch(
130+
let result = Object.values(this.children.queryVariables.getView())
131+
.filter((item) => item.children.key.getView() !== "" && item.children.value.getView() !== "")
132+
.map((item) => ({[item.children.key.getView() as string]: {value: item.children.value.getView()}}))
133+
.reduce((acc, curr) => Object.assign(acc, curr), {});
134+
135+
result.$queryName = {value: this.children.queryName.getView()};
136+
137+
return () => {
138+
return getPromiseAfterDispatch(
130139
this.dispatch,
131140
routeByNameAction(
132141
queryName,
133142
executeQueryAction({args: result})
134143
),
135144
{ notHandledError: trans("eventHandler.notHandledError") }
136145
);
146+
}
137147
}
138148

139149
displayName() {

Diff for: client/packages/lowcoder/src/comps/generators/withSelectedMultiContext.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
8686
action.editDSL
8787
|| isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
8888
|| isCustomAction<ModuleReadyAction>(action, "moduleReady")
89-
) && action.path[1] === SELECTED_KEY) {
89+
) && (
90+
action.path[1] === SELECTED_KEY
91+
|| ( // special check added for modules inside list view
92+
isCustomAction<ModuleReadyAction>(action, "moduleReady")
93+
&& action.path[1] === this.selection)
94+
)) {
9095
// broadcast
9196
const newAction = {
9297
...action,

Diff for: client/packages/lowcoder/src/comps/queries/queryComp.tsx

+9-17
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import {
3737
FetchCheckNode,
3838
FetchInfo,
3939
fromRecord,
40-
fromValue,
4140
isCustomAction,
4241
MultiBaseComp,
4342
multiChangeAction,
@@ -369,7 +368,7 @@ QueryCompTmp = class extends QueryCompTmp {
369368
}
370369
if (action.type === CompActionTypes.EXECUTE_QUERY) {
371370
if (getReduceContext().disableUpdateState) return this;
372-
if(!action.args) action.args = this.children.variables.toJsonValue().filter(kv => kv.key).reduce((acc, curr) => Object.assign(acc, {[curr.key as string]:curr.value}), {});
371+
action.args = action.args || {};
373372
action.args.$queryName = this.children.name.getView();
374373

375374
return this.executeQuery(action);
@@ -711,25 +710,18 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
711710
}
712711

713712
nameAndExposingInfo(): NameAndExposingInfo {
714-
const result: NameAndExposingInfo = {};
713+
let result: NameAndExposingInfo = {};
715714
Object.values(this.children).forEach((comp) => {
716715
result[comp.children.name.getView()] = comp.exposingInfo();
717716

718-
const variables = comp.children.variables.toJsonValue();
719-
variables.forEach((variable: Record<string, any>) => {
720-
result[variable.key] = {
721-
property: fromRecord({
722-
value: fromValue(variable.value),
723-
}),
724-
propertyValue: {
725-
value: variable.value,
726-
},
727-
propertyDesc: {},
728-
methods: {},
729-
};
730-
})
717+
const variables = comp.children.variables.nameAndExposingInfo();
718+
if (variables) {
719+
result = {
720+
...result,
721+
...variables,
722+
}
723+
}
731724
});
732-
733725
return result;
734726
}
735727

0 commit comments

Comments
 (0)