Skip to content

Commit d80b7b9

Browse files
committed
updates: fix calender comp initial date issue .etc
1 parent 696e817 commit d80b7b9

File tree

20 files changed

+217
-62
lines changed

20 files changed

+217
-62
lines changed

client/packages/openblocks-cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "openblocks-cli",
33
"description": "CLI tool used to start build publish openblocks components",
44
"version": "0.0.24",
5+
"license": "MIT",
56
"bin": "./index.js",
67
"type": "module",
78
"exports": {

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@ let CalendarBasicComp = (function () {
279279
});
280280
};
281281

282+
let initialDate = defaultDate;
283+
try {
284+
initialDate = new Date(defaultDate).toISOString();
285+
} catch (error) {
286+
initialDate = undefined;
287+
}
288+
282289
return (
283290
<Wrapper
284291
ref={ref}
@@ -287,6 +294,7 @@ let CalendarBasicComp = (function () {
287294
theme={theme?.theme}
288295
onDoubleClick={handleDbClick}
289296
left={left}
297+
key={initialDate ? defaultView + initialDate : defaultView}
290298
>
291299
<FullCalendar
292300
slotEventOverlap={false}
@@ -323,7 +331,7 @@ let CalendarBasicComp = (function () {
323331
slotLabelFormat={slotLabelFormat}
324332
viewClassNames={viewClassNames}
325333
moreLinkText={trans("calendar.more")}
326-
initialDate={defaultDate}
334+
initialDate={initialDate}
327335
initialView={defaultView}
328336
editable={editable}
329337
selectable={editable}

client/packages/openblocks-comps/src/i18n/comps/locales/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export const en = {
123123
friday: "Friday",
124124
saturday: "Saturday",
125125
sunday: "Sunday",
126-
startWeek: "Start week on",
126+
startWeek: "Start from",
127127
creatEvent: "Create event",
128128
editEvent: "Edit event",
129129
eventName: "Event name",

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ var FunctionNode = /** @class */ (function (_super) {
315315
__decorate([
316316
memoized()
317317
], FunctionNode.prototype, "filterNodes", null);
318+
__decorate([
319+
memoized()
320+
], FunctionNode.prototype, "fetchInfo", null);
318321
return FunctionNode;
319322
}(AbstractNode));
320323
function withFunction(child, func) {
@@ -395,6 +398,9 @@ var RecordNode = /** @class */ (function (_super) {
395398
__decorate([
396399
memoized()
397400
], RecordNode.prototype, "filterNodes", null);
401+
__decorate([
402+
memoized()
403+
], RecordNode.prototype, "fetchInfo", null);
398404
return RecordNode;
399405
}(AbstractNode));
400406
function fromRecord(record) {
@@ -1717,6 +1723,9 @@ var CodeNode = /** @class */ (function (_super) {
17171723
__decorate([
17181724
memoized()
17191725
], CodeNode.prototype, "filterDirectDepends", null);
1726+
__decorate([
1727+
memoized()
1728+
], CodeNode.prototype, "fetchInfo", null);
17201729
return CodeNode;
17211730
}(AbstractNode));
17221731
/**
@@ -1765,6 +1774,9 @@ var FetchCheckNode = /** @class */ (function (_super) {
17651774
__decorate([
17661775
memoized()
17671776
], FetchCheckNode.prototype, "filterNodes", null);
1777+
__decorate([
1778+
memoized()
1779+
], FetchCheckNode.prototype, "fetchInfo", null);
17681780
return FetchCheckNode;
17691781
}(AbstractNode));
17701782
function isFetching(node) {
@@ -2893,6 +2905,9 @@ var WrapNode = /** @class */ (function (_super) {
28932905
__decorate([
28942906
memoized()
28952907
], WrapNode.prototype, "filterNodes", null);
2908+
__decorate([
2909+
memoized()
2910+
], WrapNode.prototype, "fetchInfo", null);
28962911
return WrapNode;
28972912
}(AbstractNode));
28982913

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ var FunctionNode = /** @class */ (function (_super) {
307307
__decorate([
308308
memoized()
309309
], FunctionNode.prototype, "filterNodes", null);
310+
__decorate([
311+
memoized()
312+
], FunctionNode.prototype, "fetchInfo", null);
310313
return FunctionNode;
311314
}(AbstractNode));
312315
function withFunction(child, func) {
@@ -387,6 +390,9 @@ var RecordNode = /** @class */ (function (_super) {
387390
__decorate([
388391
memoized()
389392
], RecordNode.prototype, "filterNodes", null);
393+
__decorate([
394+
memoized()
395+
], RecordNode.prototype, "fetchInfo", null);
390396
return RecordNode;
391397
}(AbstractNode));
392398
function fromRecord(record) {
@@ -1709,6 +1715,9 @@ var CodeNode = /** @class */ (function (_super) {
17091715
__decorate([
17101716
memoized()
17111717
], CodeNode.prototype, "filterDirectDepends", null);
1718+
__decorate([
1719+
memoized()
1720+
], CodeNode.prototype, "fetchInfo", null);
17121721
return CodeNode;
17131722
}(AbstractNode));
17141723
/**
@@ -1757,6 +1766,9 @@ var FetchCheckNode = /** @class */ (function (_super) {
17571766
__decorate([
17581767
memoized()
17591768
], FetchCheckNode.prototype, "filterNodes", null);
1769+
__decorate([
1770+
memoized()
1771+
], FetchCheckNode.prototype, "fetchInfo", null);
17601772
return FetchCheckNode;
17611773
}(AbstractNode));
17621774
function isFetching(node) {
@@ -2885,6 +2897,9 @@ var WrapNode = /** @class */ (function (_super) {
28852897
__decorate([
28862898
memoized()
28872899
], WrapNode.prototype, "filterNodes", null);
2900+
__decorate([
2901+
memoized()
2902+
], WrapNode.prototype, "fetchInfo", null);
28882903
return WrapNode;
28892904
}(AbstractNode));
28902905

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export class CodeNode extends AbstractNode<ValueAndMsg<unknown>> {
145145
return ret;
146146
}
147147

148+
@memoized()
148149
override fetchInfo(
149150
exposingNodes: Record<string, Node<unknown>>,
150151
options?: FetchInfoOptions

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class FetchCheckNode extends AbstractNode<FetchInfo> {
2828
return this.child.dependValues();
2929
}
3030

31+
@memoized()
3132
override fetchInfo(exposingNodes: Record<string, Node<unknown>>) {
3233
return this.child.fetchInfo(exposingNodes, this.options);
3334
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export class FunctionNode<T, OutputType> extends AbstractNode<OutputType> {
3535
return this.child.dependValues();
3636
}
3737

38+
@memoized()
3839
override fetchInfo(exposingNodes: Record<string, Node<unknown>>, options?: FetchInfoOptions) {
3940
return this.child.fetchInfo(exposingNodes, options);
4041
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class RecordNode<T extends Record<string, Node<unknown>>> extends Abstrac
5757
return ret;
5858
}
5959

60+
@memoized()
6061
override fetchInfo(exposingNodes: Record<string, Node<unknown>>, options?: FetchInfoOptions) {
6162
let isFetching = false;
6263
let ready = true;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type EvalMethods = Record<string, Record<string, Function>>;
22

3-
export type CodeType = undefined | "JSON" | "Function";
3+
export type CodeType = undefined | "JSON" | "Function" | "PureJSON";
44

55
export type CodeFunction = (args?: Record<string, unknown>, runInHost?: boolean) => any;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export class WrapNode<T> extends AbstractNode<T> {
4747
return this.delegate.evaluate(this.wrap(exposingNodes, methods), this.moduleExposingMethods);
4848
}
4949

50+
@memoized()
5051
override fetchInfo(exposingNodes: Record<string, Node<unknown>>) {
5152
return this.delegate.fetchInfo(this.wrap(exposingNodes, {}));
5253
}

client/packages/openblocks-design/src/components/Section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const BaseSection = (props: ISectionConfig<ReactNode>) => {
118118
<SectionLabelDiv onClick={handleToggle} className={"section-header"}>
119119
<SectionLabel>{props.name}</SectionLabel>
120120
<div style={{ display: "flex" }}>
121-
{props.additionalButton}
121+
{open && props.additionalButton}
122122
<PackupIcon deg={open ? "rotate(0deg)" : "rotate(180deg)"} />
123123
</div>
124124
</SectionLabelDiv>

client/packages/openblocks-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@
5454
},
5555
"keywords": [
5656
"openblocks"
57-
]
57+
],
58+
"license": "MIT"
5859
}

0 commit comments

Comments
 (0)