Skip to content

Commit 06d448a

Browse files
committed
Rlease v1.1.7
feat(table): table supports expansion control feat: MariaDB feat: query library datasource meta hint feat: mobile tabbar layout feat: table edit add date, rate, progress, boolean feat: table Support data tree refactor(table): add originalIndex for sortNode() and filterNode()
1 parent 0512332 commit 06d448a

File tree

144 files changed

+4346
-1364
lines changed

Some content is hidden

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

144 files changed

+4346
-1364
lines changed

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.6
1+
1.1.7

client/packages/openblocks-comps/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@types/react": "17",
88
"@types/react-dom": "17",
99
"big.js": "^6.2.1",
10+
"mermaid": "^10.0.2",
1011
"openblocks-cli": "workspace:^",
1112
"openblocks-sdk": "workspace:^",
1213
"react": "17",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import {
2+
UICompBuilder,
3+
Section,
4+
withExposingConfigs,
5+
stringExposingStateControl,
6+
NameConfig,
7+
eventHandlerControl,
8+
withMethodExposing,
9+
} from "openblocks-sdk";
10+
11+
import Mermaid from "./mermaid";
12+
13+
const childrenMap = {
14+
code: stringExposingStateControl(
15+
"code",
16+
`graph LR
17+
Start --> Stop`
18+
),
19+
onEvent: eventHandlerControl([
20+
{
21+
label: "onChange",
22+
value: "change",
23+
description: "",
24+
},
25+
]),
26+
};
27+
28+
const CompBase = new UICompBuilder(childrenMap, (props: any) => {
29+
const code = props.code.value;
30+
return <Mermaid code={code} />;
31+
})
32+
.setPropertyViewFn((children: any) => {
33+
return (
34+
<>
35+
<Section name="Basic">{children.code.propertyView({ label: "code" })}</Section>
36+
<Section name="Interaction">{children.onEvent.propertyView()}</Section>
37+
</>
38+
);
39+
})
40+
.build();
41+
42+
const AppViewCompTemp = withMethodExposing(CompBase, []);
43+
44+
export const MermaidComp = withExposingConfigs(AppViewCompTemp, [new NameConfig("code", "")]);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { useEffect, useState } from "react";
2+
import mermaid from "mermaid";
3+
4+
function escape(str: string): string {
5+
const entries: { [index: string]: any } = { lt: "<", gt: ">", nbsp: " ", amp: "&", quot: '"' };
6+
return str
7+
.replace(/&(lt|gt|nbsp|amp|quot);/gi, function (_, t) {
8+
return entries[t];
9+
})
10+
.trim();
11+
}
12+
13+
export default ({ id = "graphDiv", code = "" }) => {
14+
const [svg, setSvg] = useState("");
15+
16+
useEffect(() => {
17+
mermaid.initialize({ startOnLoad: false });
18+
}, []);
19+
20+
useEffect(() => {
21+
if (!code) return;
22+
23+
mermaid.mermaidAPI.render(id, escape(code)).then((res) => {
24+
setSvg(res.svg);
25+
});
26+
}, [code, setSvg]);
27+
28+
return <pre className="mermaid" dangerouslySetInnerHTML={{ __html: svg }}></pre>;
29+
};

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const ModalHeaderWrapper = styled.div<{ $draggable?: boolean }>`
3535
cursor: ${(props) => (props.$draggable ? "move" : "auto")};
3636
display: flex;
3737
align-items: center;
38-
padding: 16px;
38+
line-height: 26px;
39+
padding: 11px 16px;
3940
`;
4041

4142
const ModalHeaderTitle = styled.div`
@@ -44,6 +45,7 @@ const ModalHeaderTitle = styled.div`
4445
color: #222222;
4546
flex-grow: 1;
4647
min-width: 0;
48+
height: 16px;
4749
display: flex;
4850
align-items: center;
4951
@@ -58,6 +60,7 @@ const ModalCloseIcon = styled.div`
5860
margin-left: 16px;
5961
width: 16px;
6062
height: 16px;
63+
display: flex;
6164
cursor: pointer;
6265
color: ${GreyTextColor};
6366
@@ -101,8 +104,8 @@ export const ModalFooterWrapper = styled.div`
101104
height: 28px;
102105
margin-top: 12px;
103106
margin-left: 8px;
104-
padding-left: 12px;
105-
padding-right: 12px;
107+
padding-left: 11px;
108+
padding-right: 11px;
106109
}
107110
`;
108111

@@ -268,6 +271,7 @@ CustomModal.confirm = (props: {
268271
bodyStyle?: React.CSSProperties;
269272
footer?: ReactNode;
270273
type?: "info" | "warn" | "error" | "success";
274+
width?: number | string;
271275
}): any => {
272276
const defaultConfirmProps: ModalFuncProps = {
273277
...DEFAULT_PROPS,
@@ -317,6 +321,7 @@ CustomModal.confirm = (props: {
317321
okText={props.okText}
318322
bodyStyle={{ ...defaultConfirmProps.bodyStyle, ...props.bodyStyle }}
319323
footer={props.footer}
324+
width={props.width}
320325
/>
321326
),
322327
});

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ const StyledAntdMenu = styled(AntdMenu)`
7777
.ant-menu-item:focus-visible {
7878
box-shadow: unset;
7979
}
80+
81+
.ant-menu-item-disabled span {
82+
color: #B8B9BF;
83+
}
8084
`;
8185

8286
const MenuItemContentWrapper = styled.div`
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)