Skip to content

Commit 4f4885f

Browse files
committed
multiChanges: feat: mssql support gui mode
- feat: download action support base64 - feat: dynamic query config - feat: dynamic datasource extra params - feat: download action support base64 - feat: refactor withType - feat: restApi add icon - feat(table) support edit column width - feat(grid): develop Grid Comp based on ListView - bug fixes
1 parent 3bffd39 commit 4f4885f

File tree

116 files changed

+2305
-484
lines changed

Some content is hidden

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

116 files changed

+2305
-484
lines changed

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.4
1+
1.1.5

client/packages/openblocks-cli/client.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ declare var REACT_APP_LOG_LEVEL: string;
3636
declare var REACT_APP_IMPORT_MAP: string;
3737
declare var REACT_APP_SERVER_IPS: string;
3838
declare var REACT_APP_BUNDLE_TYPE: "sdk" | "app";
39+
declare var REACT_APP_DISABLE_JS_SANDBOX: string;
40+
declare var REACT_APP_BUNDLE_BUILTIN_PLUGIN: string;

client/packages/openblocks-comps/package.json

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

client/packages/openblocks-comps/src/comps/chartComp/chartComp.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { AxisFormatterComp, EchartsAxisType } from "./chartConfigs/cartesianAxis
99
import { chartChildrenMap, ChartSize, getDataKeys } from "./chartConstants";
1010
import { chartPropertyView } from "./chartPropertyView";
1111
import _ from "lodash";
12-
import { useEffect, useMemo, useRef, useState } from "react";
12+
import { useContext, useEffect, useMemo, useRef, useState } from "react";
1313
import ReactResizeDetector from "react-resize-detector";
1414
import ReactECharts from "./reactEcharts";
1515
import {
@@ -24,6 +24,8 @@ import {
2424
withDefault,
2525
withExposingConfigs,
2626
withViewFn,
27+
ThemeContext,
28+
chartColorPalette,
2729
} from "openblocks-sdk";
2830
import { getEchartsLocale, trans } from "i18n/comps";
2931
import { ItemColorComp } from "comps/chartComp/chartConfigs/lineChartConfig";
@@ -32,6 +34,7 @@ import {
3234
getEchartsConfig,
3335
getSelectedPoints,
3436
} from "comps/chartComp/chartUtils";
37+
import log from "loglevel";
3538

3639
let ChartTmpComp = (function () {
3740
return new UICompBuilder(chartChildrenMap, () => null)
@@ -43,6 +46,17 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
4346
const echartsCompRef = useRef<ReactECharts | null>();
4447
const [chartSize, setChartSize] = useState<ChartSize>();
4548
const firstResize = useRef(true);
49+
const theme = useContext(ThemeContext);
50+
const defaultChartTheme = {
51+
color: chartColorPalette,
52+
backgroundColor: "#fff",
53+
};
54+
let themeConfig = defaultChartTheme;
55+
try {
56+
themeConfig = theme?.theme.chart ? JSON.parse(theme?.theme.chart) : defaultChartTheme;
57+
} catch (error) {
58+
log.error('theme chart error: ', error);
59+
}
4660
const onEvent = comp.children.onEvent.getView();
4761
useEffect(() => {
4862
// bind events
@@ -94,6 +108,7 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
94108
lazyUpdate
95109
opts={{ locale: getEchartsLocale() }}
96110
option={option}
111+
theme={themeConfig}
97112
/>
98113
</ReactResizeDetector>
99114
);

client/packages/openblocks-comps/src/comps/chartComp/chartUtils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
135135
bottom: 35,
136136
};
137137
let config: EChartsOption = {
138-
color: chartColorPalette,
139138
title: { text: props.title, left: "center" },
140-
backgroundColor: "#fff",
141139
tooltip: {
142140
confine: true,
143141
trigger: axisChart ? "axis" : "item",

client/packages/openblocks-core/lib/index.cjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ var CodeNode = /** @class */ (function (_super) {
16911691
});
16921692
var dependingNodeMap = this.filterNodes(exposingNodes);
16931693
dependingNodeMap.forEach(function (paths, depend) {
1694-
var fi = depend.fetchInfo(exposingNodes);
1694+
var fi = depend.fetchInfo(exposingNodes, options);
16951695
isFetching_1 = isFetching_1 || fi.isFetching;
16961696
ready_1 = ready_1 && fi.ready;
16971697
});
@@ -3329,6 +3329,7 @@ var MultiBaseComp = /** @class */ (function (_super) {
33293329
__extends(MultiBaseComp, _super);
33303330
function MultiBaseComp(params) {
33313331
var _this = _super.call(this, params) || this;
3332+
_this.IGNORABLE_DEFAULT_VALUE = {};
33323333
_this.children = _this.parseChildrenFromValue(params);
33333334
return _this;
33343335
}
@@ -3472,16 +3473,24 @@ var MultiBaseComp = /** @class */ (function (_super) {
34723473
});
34733474
return _super.prototype.changeDispatch.call(this, dispatch).setChildren(newChildren, { keepCacheKeys: ["node"] });
34743475
};
3476+
MultiBaseComp.prototype.ignoreChildDefaultValue = function () {
3477+
return false;
3478+
};
34753479
MultiBaseComp.prototype.toJsonValue = function () {
34763480
var _this = this;
34773481
var result = {};
3482+
var ignore = this.ignoreChildDefaultValue();
34783483
Object.keys(this.children).forEach(function (key) {
34793484
var comp = _this.children[key];
34803485
// FIXME: this implementation is a little tricky, better choose a encapsulated implementation
34813486
if (comp.hasOwnProperty("NO_PERSISTENCE")) {
34823487
return;
34833488
}
3484-
result[key] = comp.toJsonValue();
3489+
var value = comp.toJsonValue();
3490+
if (ignore && ___default["default"].isEqual(value, comp["IGNORABLE_DEFAULT_VALUE"])) {
3491+
return;
3492+
}
3493+
result[key] = value;
34853494
});
34863495
return result;
34873496
};

client/packages/openblocks-core/lib/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,8 @@ declare abstract class MultiBaseComp<
687687
};
688688
nodeWithoutCache(): NodeType;
689689
changeDispatch(dispatch: DispatchType): this;
690+
protected ignoreChildDefaultValue(): boolean;
691+
readonly IGNORABLE_DEFAULT_VALUE: {};
690692
toJsonValue(): DataType;
691693
autoHeight(): boolean;
692694
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ var CodeNode = /** @class */ (function (_super) {
16831683
});
16841684
var dependingNodeMap = this.filterNodes(exposingNodes);
16851685
dependingNodeMap.forEach(function (paths, depend) {
1686-
var fi = depend.fetchInfo(exposingNodes);
1686+
var fi = depend.fetchInfo(exposingNodes, options);
16871687
isFetching_1 = isFetching_1 || fi.isFetching;
16881688
ready_1 = ready_1 && fi.ready;
16891689
});
@@ -3321,6 +3321,7 @@ var MultiBaseComp = /** @class */ (function (_super) {
33213321
__extends(MultiBaseComp, _super);
33223322
function MultiBaseComp(params) {
33233323
var _this = _super.call(this, params) || this;
3324+
_this.IGNORABLE_DEFAULT_VALUE = {};
33243325
_this.children = _this.parseChildrenFromValue(params);
33253326
return _this;
33263327
}
@@ -3464,16 +3465,24 @@ var MultiBaseComp = /** @class */ (function (_super) {
34643465
});
34653466
return _super.prototype.changeDispatch.call(this, dispatch).setChildren(newChildren, { keepCacheKeys: ["node"] });
34663467
};
3468+
MultiBaseComp.prototype.ignoreChildDefaultValue = function () {
3469+
return false;
3470+
};
34673471
MultiBaseComp.prototype.toJsonValue = function () {
34683472
var _this = this;
34693473
var result = {};
3474+
var ignore = this.ignoreChildDefaultValue();
34703475
Object.keys(this.children).forEach(function (key) {
34713476
var comp = _this.children[key];
34723477
// FIXME: this implementation is a little tricky, better choose a encapsulated implementation
34733478
if (comp.hasOwnProperty("NO_PERSISTENCE")) {
34743479
return;
34753480
}
3476-
result[key] = comp.toJsonValue();
3481+
var value = comp.toJsonValue();
3482+
if (ignore && _.isEqual(value, comp["IGNORABLE_DEFAULT_VALUE"])) {
3483+
return;
3484+
}
3485+
result[key] = value;
34773486
});
34783487
return result;
34793488
};

client/packages/openblocks-core/src/baseComps/multiBaseComp.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,25 @@ export abstract class MultiBaseComp<
230230
return super.changeDispatch(dispatch).setChildren(newChildren, { keepCacheKeys: ["node"] });
231231
}
232232

233+
protected ignoreChildDefaultValue() {
234+
return false;
235+
}
236+
237+
readonly IGNORABLE_DEFAULT_VALUE = {};
233238
override toJsonValue(): DataType {
234239
const result: Record<string, any> = {};
240+
const ignore = this.ignoreChildDefaultValue();
235241
Object.keys(this.children).forEach((key) => {
236242
const comp = this.children[key];
237243
// FIXME: this implementation is a little tricky, better choose a encapsulated implementation
238244
if (comp.hasOwnProperty("NO_PERSISTENCE")) {
239245
return;
240246
}
241-
result[key] = comp.toJsonValue();
247+
const value = comp.toJsonValue();
248+
if (ignore && _.isEqual(value, (comp as any)["IGNORABLE_DEFAULT_VALUE"])) {
249+
return;
250+
}
251+
result[key] = value;
242252
});
243253
return result as DataType;
244254
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class CodeNode extends AbstractNode<ValueAndMsg<unknown>> {
182182

183183
const dependingNodeMap = this.filterNodes(exposingNodes);
184184
dependingNodeMap.forEach((paths, depend) => {
185-
const fi = depend.fetchInfo(exposingNodes);
185+
const fi = depend.fetchInfo(exposingNodes, options);
186186
isFetching = isFetching || fi.isFetching;
187187
ready = ready && fi.ready;
188188
});

0 commit comments

Comments
 (0)