-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor parse attribute value (#149)
* refactor: update attribute value parsing logic * fix: refactor toggle setter logic * fix: enhance basic setters * fix: move basic value setter to setting-form package * fix: add setter type * fix: update * feat: support toggle formObject to codeSetter * fix: update invalid setter notice * fix: update node2value * fix: trigger onChange for formObject * docs: update * chore: up * feat: improve code2value function and fix related issues * Revert "chore: up" This reverts commit a87d8fc. * chore: update npm dependencies to latest versions
- Loading branch information
Showing
52 changed files
with
2,189 additions
and
1,289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
"@music163/antd": "^0.2.4", | ||
"antd": "^4.24.2", | ||
"coral-system": "^1.0.5", | ||
"umi": "^4.0.89" | ||
"umi": "^4.2.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ const packageJson = { | |
name: 'demo', | ||
private: true, | ||
dependencies: { | ||
'@music163/antd': '0.2.2', | ||
'@music163/antd': '0.2.5', | ||
'@music163/tango-boot': '0.2.5', | ||
react: '17.0.2', | ||
'react-dom': '17.0.2', | ||
|
@@ -56,11 +56,12 @@ const tangoConfigJson = { | |
}, | ||
'@music163/antd': { | ||
description: '云音乐低代码中后台应用基础物料', | ||
version: '0.2.2', | ||
version: '0.2.5', | ||
library: 'TangoAntd', | ||
type: 'baseDependency', | ||
resources: [ | ||
'https://unpkg.com/@music163/antd@{{version}}/dist/index.js', | ||
// 'http://localhost:9002/designer.js', | ||
'https://unpkg.com/[email protected]/dist/antd.css', | ||
], | ||
designerResources: [ | ||
|
@@ -85,13 +86,19 @@ export function registerComponentPrototype(proto) { | |
|
||
const routesCode = ` | ||
import Index from "./pages/list"; | ||
import Detail from "./pages/detail"; | ||
const routes = [ | ||
{ | ||
path: '/', | ||
exact: true, | ||
component: Index | ||
}, | ||
{ | ||
path: '/detail', | ||
exact: true, | ||
component: Detail | ||
}, | ||
]; | ||
export default routes; | ||
|
@@ -150,16 +157,25 @@ import { | |
Input, | ||
FormilyForm, | ||
FormilyFormItem, | ||
Table, | ||
} from "@music163/antd"; | ||
import { Space } from "@music163/antd"; | ||
import { LocalButton } from "../components"; | ||
class App extends React.Component { | ||
render() { | ||
return ( | ||
<Page title={tango.stores.app.title}> | ||
<Page title={tango.stores.app.title} subTitle={111}> | ||
<Section tid="section1" title="Section Title"> | ||
your input: <Input tid="input1" defaultValue="hello" /> | ||
copy input: <Input value={tango.page.input1?.value} /> | ||
<Table | ||
columns={[ | ||
{ title: "姓名", dataIndex: "name", key: "name" }, | ||
{ title: "年龄", dataIndex: "age", key: "age" }, | ||
{ title: "住址", dataIndex: "address", key: "address" }, | ||
]} | ||
tid="table1" | ||
/> | ||
</Section> | ||
<Section tid="section2"> | ||
<Space tid="space1"> | ||
|
@@ -174,6 +190,9 @@ class App extends React.Component { | |
</FormilyForm> | ||
</Section> | ||
<Section title="原生 DOM" tid="section4"> | ||
<h1 style={{ ...{ color: "red" }, fontSize: 64 }}> | ||
hello world | ||
</h1> | ||
<div | ||
style={{ | ||
border: "1px solid #ccc", | ||
|
@@ -234,6 +253,23 @@ class App extends React.Component { | |
export default definePage(App); | ||
`; | ||
|
||
export const emptyPageCode = ` | ||
import React from "react"; | ||
import { definePage } from "@music163/tango-boot"; | ||
import { | ||
Page, | ||
Section, | ||
} from "@music163/antd"; | ||
function App() { | ||
return (<Page title="Detail Page"> | ||
<Section></Section> | ||
</Page>) | ||
} | ||
export default definePage(App); | ||
`; | ||
|
||
const componentsButtonCode = ` | ||
import React from 'react'; | ||
import { registerComponentPrototype } from '../utils'; | ||
|
@@ -373,6 +409,7 @@ export const sampleFiles = [ | |
{ filename: '/src/style.css', code: cssCode }, | ||
{ filename: '/src/index.js', code: entryCode }, | ||
{ filename: '/src/pages/list.js', code: viewHomeCode }, | ||
{ filename: '/src/pages/detail.js', code: emptyPageCode }, | ||
{ filename: '/src/components/button.js', code: componentsButtonCode }, | ||
{ filename: '/src/components/input.js', code: componentsInputCode }, | ||
{ filename: '/src/components/index.js', code: componentsEntryCode }, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import React, { StrictMode } from 'react'; | ||
import React from 'react'; | ||
import { Outlet } from 'umi'; | ||
import './index.less'; | ||
|
||
export default function Layout() { | ||
return ( | ||
<StrictMode> | ||
<Outlet /> | ||
</StrictMode> | ||
); | ||
return <Outlet />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.