Skip to content

Commit 32dc4ec

Browse files
committed
pull from origin
2 parents 7459f78 + 9b4dedd commit 32dc4ec

File tree

24 files changed

+452
-174
lines changed

24 files changed

+452
-174
lines changed

client/VERSION

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

client/packages/lowcoder-comps/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "2.4.9",
3+
"version": "2.4.10",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {
@@ -197,10 +197,10 @@
197197
}
198198
},
199199
"scripts": {
200-
"start": "NODE_OPTIONS=--max_old_space_size=6144 vite",
201-
"build": "yarn test && lowcoder-cli build",
202-
"build_only": "lowcoder-cli build",
203-
"build_publish": "lowcoder-cli build --publish",
200+
"start": "NODE_OPTIONS=--max_old_space_size=6442 vite",
201+
"build": "NODE_OPTIONS=--max_old_space_size=6442 yarn test && lowcoder-cli build",
202+
"build_only": "NODE_OPTIONS=--max_old_space_size=6442 lowcoder-cli build",
203+
"build_publish": "NODE_OPTIONS=--max_old_space_size=6442 lowcoder-cli build --publish",
204204
"test": "jest"
205205
},
206206
"devDependencies": {

client/packages/lowcoder-core/lib/index.js

Lines changed: 117 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,118 @@
11
import _ from 'lodash';
22
import { serialize, compile, middleware, prefixer, stringify } from 'stylis';
33

4-
/******************************************************************************
5-
Copyright (c) Microsoft Corporation.
6-
7-
Permission to use, copy, modify, and/or distribute this software for any
8-
purpose with or without fee is hereby granted.
9-
10-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16-
PERFORMANCE OF THIS SOFTWARE.
17-
***************************************************************************** */
18-
/* global Reflect, Promise, SuppressedError, Symbol */
19-
20-
var extendStatics = function(d, b) {
21-
extendStatics = Object.setPrototypeOf ||
22-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
24-
return extendStatics(d, b);
25-
};
26-
27-
function __extends(d, b) {
28-
if (typeof b !== "function" && b !== null)
29-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
30-
extendStatics(d, b);
31-
function __() { this.constructor = d; }
32-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
33-
}
34-
35-
var __assign = function() {
36-
__assign = Object.assign || function __assign(t) {
37-
for (var s, i = 1, n = arguments.length; i < n; i++) {
38-
s = arguments[i];
39-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
40-
}
41-
return t;
42-
};
43-
return __assign.apply(this, arguments);
44-
};
45-
46-
function __rest(s, e) {
47-
var t = {};
48-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49-
t[p] = s[p];
50-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
51-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53-
t[p[i]] = s[p[i]];
54-
}
55-
return t;
56-
}
57-
58-
function __decorate(decorators, target, key, desc) {
59-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
61-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
62-
return c > 3 && r && Object.defineProperty(target, key, r), r;
63-
}
64-
65-
function __awaiter(thisArg, _arguments, P, generator) {
66-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
67-
return new (P || (P = Promise))(function (resolve, reject) {
68-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
69-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
70-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
71-
step((generator = generator.apply(thisArg, _arguments || [])).next());
72-
});
73-
}
74-
75-
function __generator(thisArg, body) {
76-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
77-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
78-
function verb(n) { return function (v) { return step([n, v]); }; }
79-
function step(op) {
80-
if (f) throw new TypeError("Generator is already executing.");
81-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
82-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
83-
if (y = 0, t) op = [op[0] & 2, t.value];
84-
switch (op[0]) {
85-
case 0: case 1: t = op; break;
86-
case 4: _.label++; return { value: op[1], done: false };
87-
case 5: _.label++; y = op[1]; op = [0]; continue;
88-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
89-
default:
90-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
91-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
92-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
93-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
94-
if (t[2]) _.ops.pop();
95-
_.trys.pop(); continue;
96-
}
97-
op = body.call(thisArg, _);
98-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
99-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
100-
}
101-
}
102-
103-
function __spreadArray(to, from, pack) {
104-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
105-
if (ar || !(i in from)) {
106-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
107-
ar[i] = from[i];
108-
}
109-
}
110-
return to.concat(ar || Array.prototype.slice.call(from));
111-
}
112-
113-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
114-
var e = new Error(message);
115-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4+
/******************************************************************************
5+
Copyright (c) Microsoft Corporation.
6+
7+
Permission to use, copy, modify, and/or distribute this software for any
8+
purpose with or without fee is hereby granted.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
17+
***************************************************************************** */
18+
/* global Reflect, Promise, SuppressedError, Symbol */
19+
20+
var extendStatics = function(d, b) {
21+
extendStatics = Object.setPrototypeOf ||
22+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
24+
return extendStatics(d, b);
25+
};
26+
27+
function __extends(d, b) {
28+
if (typeof b !== "function" && b !== null)
29+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
30+
extendStatics(d, b);
31+
function __() { this.constructor = d; }
32+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
33+
}
34+
35+
var __assign = function() {
36+
__assign = Object.assign || function __assign(t) {
37+
for (var s, i = 1, n = arguments.length; i < n; i++) {
38+
s = arguments[i];
39+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
40+
}
41+
return t;
42+
};
43+
return __assign.apply(this, arguments);
44+
};
45+
46+
function __rest(s, e) {
47+
var t = {};
48+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49+
t[p] = s[p];
50+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
51+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53+
t[p[i]] = s[p[i]];
54+
}
55+
return t;
56+
}
57+
58+
function __decorate(decorators, target, key, desc) {
59+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
61+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
62+
return c > 3 && r && Object.defineProperty(target, key, r), r;
63+
}
64+
65+
function __awaiter(thisArg, _arguments, P, generator) {
66+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
67+
return new (P || (P = Promise))(function (resolve, reject) {
68+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
69+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
70+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
71+
step((generator = generator.apply(thisArg, _arguments || [])).next());
72+
});
73+
}
74+
75+
function __generator(thisArg, body) {
76+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
77+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
78+
function verb(n) { return function (v) { return step([n, v]); }; }
79+
function step(op) {
80+
if (f) throw new TypeError("Generator is already executing.");
81+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
82+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
83+
if (y = 0, t) op = [op[0] & 2, t.value];
84+
switch (op[0]) {
85+
case 0: case 1: t = op; break;
86+
case 4: _.label++; return { value: op[1], done: false };
87+
case 5: _.label++; y = op[1]; op = [0]; continue;
88+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
89+
default:
90+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
91+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
92+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
93+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
94+
if (t[2]) _.ops.pop();
95+
_.trys.pop(); continue;
96+
}
97+
op = body.call(thisArg, _);
98+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
99+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
100+
}
101+
}
102+
103+
function __spreadArray(to, from, pack) {
104+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
105+
if (ar || !(i in from)) {
106+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
107+
ar[i] = from[i];
108+
}
109+
}
110+
return to.concat(ar || Array.prototype.slice.call(from));
111+
}
112+
113+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
114+
var e = new Error(message);
115+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
116116
};
117117

118118
function isEqualArgs(args, cacheArgs, equals) {
@@ -1776,6 +1776,11 @@ var CodeNode = /** @class */ (function (_super) {
17761776
value.triggerType === "manual") {
17771777
return;
17781778
}
1779+
// wait for lazy loaded comps to load before executing query on page load
1780+
if (!Object.keys(value).length) {
1781+
isFetching_1 = true;
1782+
ready_1 = false;
1783+
}
17791784
if (_.has(value, IS_FETCHING_FIELD)) {
17801785
isFetching_1 = isFetching_1 || value.isFetching === true;
17811786
}

client/packages/lowcoder-core/src/eval/codeNode.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ export class CodeNode extends AbstractNode<ValueAndMsg<unknown>> {
172172
) {
173173
return;
174174
}
175-
175+
// wait for lazy loaded comps to load before executing query on page load
176+
if (!Object.keys(value).length) {
177+
isFetching = true;
178+
ready = false;
179+
}
176180
if (_.has(value, IS_FETCHING_FIELD)) {
177181
isFetching = isFetching || value.isFetching === true;
178182
}

client/packages/lowcoder-sdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-sdk",
3-
"version": "2.4.8",
3+
"version": "2.4.10",
44
"type": "module",
55
"files": [
66
"src",
@@ -28,8 +28,8 @@
2828
}
2929
},
3030
"scripts": {
31-
"build": "vite build",
32-
"start": "vite"
31+
"build": "NODE_OPTIONS=--max_old_space_size=6442 vite build",
32+
"start": "NODE_OPTIONS=--max_old_space_size=2048 vite"
3333
},
3434
"devDependencies": {
3535
"@rollup/plugin-commonjs": "^22.0.2",

client/packages/lowcoder/src/base/codeEditor/codeEditor.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { CodeEditorPanel } from "../../pages/editor/codeEditorPanel";
1414
import type { CodeEditorProps, StyleName } from "./codeEditorTypes";
1515
import { useClickCompNameEffect } from "./clickCompName";
1616
import { Layers } from "../../constants/Layers";
17+
import { debounce } from "lodash";
1718

1819
type StyleConfig = {
1920
minHeight: string;
@@ -219,12 +220,12 @@ function useCodeMirror(
219220
const showLineNum = props.showLineNum ?? getStyle(props.styleName).showLineNum;
220221

221222
const handleChange = useCallback(
222-
(state: EditorState) => {
223+
debounce((state: EditorState) => {
223224
window.clearTimeout(isTypingRef.current);
224225
isTypingRef.current = window.setTimeout(() => (isTypingRef.current = 0), 100);
225226
onChange?.(state);
226-
},
227-
[onChange]
227+
}, 100)
228+
, [onChange]
228229
);
229230

230231
const { extensions, reconfigure, isFocus } = useExtensions({

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { BottomResComp, BottomResCompResult, BottomResTypeEnum } from "types/bot
2121
import { setFieldsNoTypeCheck } from "util/objectUtils";
2222
import { QueryTutorials } from "util/tutorialUtils";
2323
import { SimpleNameComp } from "./simpleNameComp";
24+
import SupaDemoDisplay from "comps/utils/supademoDisplay";
2425

2526
const dataChangeEvent: EventConfigType = {
2627
label: "onDataChange",
@@ -71,7 +72,15 @@ const DataResponderItemCompBase = new MultiCompBuilder(
7172
</QuerySectionWrapper>
7273
</QueryPropertyViewWrapper><><TacoMarkDown>{trans("dataResponder.documentationText")}</TacoMarkDown><DocLink style={{ marginTop: 8 }} href={QueryTutorials.dataResponder} title={trans("dataResponder.documentationText")}>
7374
{trans("dataResponder.docLink")}
74-
</DocLink></></>
75+
</DocLink><br/><br/>
76+
77+
<SupaDemoDisplay
78+
url={trans("supademos.dataresponder")}
79+
modalWidth="80%"
80+
modalTop="20px"
81+
/>
82+
83+
</></>
7584

7685
),
7786
},

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ export const dateRangeControl = (function () {
286286
const childrenMap = {
287287
start: stringExposingStateControl("start"),
288288
end: stringExposingStateControl("end"),
289+
...formDataChildren,
289290
...commonChildren,
290291
};
291292

@@ -367,6 +368,8 @@ export const dateRangeControl = (function () {
367368
tooltip: trans("date.formatTip"),
368369
})}
369370
</Section>
371+
372+
<FormDataPropertyView {...children} />
370373

371374
{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
372375
<><Section name={sectionNames.validation}>
@@ -572,4 +575,21 @@ DateRangeComp = withMethodExposing(DateRangeComp, [
572575
comp.children.end.getView().reset();
573576
},
574577
},
578+
{
579+
method: {
580+
name: "setRange",
581+
params: [],
582+
},
583+
execute: (comp, values) => {
584+
if (values.length !== 1) {
585+
return Promise.reject(trans("formComp.valuesLengthError"));
586+
}
587+
const data = values[0] as { start: string, end: string };
588+
if (typeof data !== "object" || data === null || Array.isArray(data) || !data.hasOwnProperty('start') || !data.hasOwnProperty('end')) {
589+
return Promise.reject(trans("formComp.valueTypeError"));
590+
}
591+
comp.children.start.getView().onChange(data.start);
592+
comp.children.end.getView().onChange(data.end);
593+
},
594+
},
575595
]);

0 commit comments

Comments
 (0)