Skip to content

Commit eb14d0d

Browse files
authored
Merge pull request #476 from lowcoder-org/dev
Dev -> Main to prepare V2.1.4
2 parents 1f34215 + c11ba71 commit eb14d0d

File tree

14 files changed

+465
-175
lines changed

14 files changed

+465
-175
lines changed

client/README.md

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,89 @@ docker run -d --name lowcoder-dev -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks"
3131

3232
### Start develop
3333

34-
1. Check out the source code.
35-
2. Change to client dir in the repository root via cd client.
34+
35+
1. Check out source code.
36+
2. Change to **/client** dir in the source dir.
3637

3738
```bash
3839
cd client
3940
```
40-
41-
4. Run yarn to install dependencies: .
41+
3. Run yarn to install dependencies.
4242

4343
```bash
4444
yarn install
4545
```
4646

47-
5. Start dev server: `LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start`.
48-
6. After the dev server starts successfully, it will be automatically opened in the default browser.
47+
4. Start dev server:
48+
49+
```bash
50+
LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start
51+
```
52+
53+
5. After dev server starts successfully, it will be automatically opened in the default browser.
4954

5055
### Before submitting a pull request
5156

5257
In addition, before submitting a pull request, please make sure the following is done:
5358

5459
1. If you’ve fixed a bug or added code that should be tested and add unit test suite.
55-
2. Run `yarn test` and ensure all test suites pass.
56-
3. If you add new dependency, use yarn workspace lowcoder some-package to make sure yarn.lock is also updated.
60+
2. Run test and ensure all test suites pass.
61+
62+
```bash
63+
yarn test
64+
```
65+
66+
3. If you add new dependency, use the yarn worspace tool to make sure yarn.lock is also updated.
67+
68+
```bash
69+
yarn workspace lowcoder <package name>
70+
```
71+
72+
### Developing and publishung UI components for Lowcoder
73+
74+
1. Initialization
75+
76+
Project initiation
77+
78+
```bash
79+
yarn create Lowcoder-plugin <your plugin name>
80+
```
81+
82+
Go to the project root
83+
84+
```bash
85+
cd my-plugin
86+
```
87+
88+
Start the development environment
89+
90+
```bash
91+
yarn start
92+
```
93+
94+
After executing yarn start, the browser is automatically opened and you enter the component development environment.
95+
Please find more information in our [docs](https://docs.lowcoder.cloud/lowcoder-documentation/lowcoder-extension/develop-ui-components-for-apps)
96+
97+
2. Export components
98+
99+
To export all the components, use src/index.ts, for example:
100+
101+
```bash
102+
import HelloWorldComp from "./HelloWorldComp";
103+
104+
export default {
105+
hello_world: HelloWorldComp,
106+
};
107+
```
108+
109+
import HelloWorldComp from "./HelloWorldComp";
110+
111+
3. Publish plugins
112+
113+
When you finish developing and testing the plugin, you can publish it into the npm registry. Login in to the npm registry locally, and then execute the following command:
114+
115+
```bash
116+
yarn build --publish
117+
```
118+
119+
You can check a code demo here: [Code Demo on Github](https://github.com/lowcoder-org/lowcoder/tree/main/client/packages/lowcoder-plugin-demo)

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0
1+
2.1.4

client/packages/lowcoder-comps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@fullcalendar/core": "^6.1.6",
88
"@fullcalendar/daygrid": "^6.1.6",
99
"@fullcalendar/interaction": "^6.1.6",
10-
"@fullcalendar/list": "^6.1.6",
10+
"@fullcalendar/list": "^6.1.9",
1111
"@fullcalendar/moment": "^6.1.6",
1212
"@fullcalendar/react": "^6.1.6",
1313
"@fullcalendar/timegrid": "^6.1.6",

client/packages/lowcoder/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@
9595

9696
<div id="root"></div>
9797
<script type="module" src="/src/index.ts"></script>
98-
<%- browserCheckScript %>
98+
<!-- <%- browserCheckScript %> -->
9999
</body>
100100
</html>

client/packages/lowcoder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
},
117117
"devDependencies": {
118118
"@types/core-js": "^2.5.5",
119-
"@types/intl": "^1.2.0",
119+
"@types/intl": "^1.2.1",
120120
"@types/papaparse": "^5.3.5",
121121
"@types/regenerator-runtime": "^0.13.1",
122122
"@types/uuid": "^8.3.4",

client/packages/lowcoder/src/comps/comps/layout/mobileTabLayout.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ function TabBarView(props: TabBarProps) {
8686
activeKey={props.selectedKey}
8787
>
8888
{props.tabs.map((tab) => {
89-
return <TabBarItem key={tab.key} icon={tab.icon} title={tab.title} />;
89+
return (
90+
<TabBarItem key={tab.key} icon={tab.icon} title={tab.title} />
91+
);
9092
})}
9193
</TabBar>
9294
</TabBarWrapper>
@@ -126,9 +128,18 @@ let MobileTabLayoutTmp = (function () {
126128
const childrenMap = {
127129
tabs: manualOptionsControl(TabOptionComp, {
128130
initOptions: [
129-
{ label: trans("optionsControl.optionI", { i: 1 }), icon: "/icon:solid/1" },
130-
{ label: trans("optionsControl.optionI", { i: 2 }), icon: "/icon:solid/2" },
131-
{ label: trans("optionsControl.optionI", { i: 3 }), icon: "/icon:solid/3" },
131+
{
132+
label: trans("optionsControl.optionI", { i: 1 }),
133+
icon: "/icon:solid/1",
134+
},
135+
{
136+
label: trans("optionsControl.optionI", { i: 2 }),
137+
icon: "/icon:solid/2",
138+
},
139+
{
140+
label: trans("optionsControl.optionI", { i: 3 }),
141+
icon: "/icon:solid/3",
142+
},
132143
],
133144
}),
134145
};
@@ -138,7 +149,9 @@ let MobileTabLayoutTmp = (function () {
138149
.setPropertyViewFn((children) => {
139150
return (
140151
<>
141-
<Section name={trans("aggregation.tabBar")}>{children.tabs.propertyView({})}</Section>
152+
<Section name={trans("aggregation.tabBar")}>
153+
{children.tabs.propertyView({})}
154+
</Section>
142155
</>
143156
);
144157
})
@@ -168,7 +181,9 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
168181
tabs={tabViews.map((tab, index) => ({
169182
key: index,
170183
title: tab.children.label.getView(),
171-
icon: tab.children.icon.toJsonValue() ? tab.children.icon.getView() : undefined,
184+
icon: tab.children.icon.toJsonValue()
185+
? tab.children.icon.getView()
186+
: undefined,
172187
}))}
173188
selectedKey={tabIndex + ""}
174189
onChange={(key) => setTabIndex(Number(key))}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { CheckBox, controlItem, Switch, SwitchWrapper } from "lowcoder-design";
2+
import { ReactNode } from "react";
3+
import { ControlParams, SimpleComp } from "@lowcoder-ee/index.sdk";
4+
5+
export class BoolShareVideoControl extends SimpleComp<boolean> {
6+
readonly IGNORABLE_DEFAULT_VALUE = false;
7+
protected getDefaultValue(): boolean {
8+
return false;
9+
}
10+
11+
getPropertyView(): ReactNode {
12+
return (
13+
<Switch
14+
value={this.value}
15+
onChange={(x) => this.dispatchChangeValueAction(x)}
16+
/>
17+
);
18+
}
19+
20+
propertyView(params: ControlParams & { type?: "switch" | "checkbox" }) {
21+
return controlItem(
22+
{ filterText: params.label },
23+
<SwitchWrapper {...params}>
24+
{params.type === "checkbox" ? (
25+
<CheckBox
26+
style={{ marginRight: "8px" }}
27+
checked={this.value}
28+
onChange={(x) => this.dispatchChangeValueAction(x.target.checked)}
29+
/>
30+
) : (
31+
this.getPropertyView()
32+
)}
33+
</SwitchWrapper>
34+
);
35+
}
36+
}

0 commit comments

Comments
 (0)