Skip to content

Commit

Permalink
refactor(desingbale-antd): improve dir name
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Jun 12, 2021
1 parent 5b568fc commit ceb8a8d
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 42 deletions.
6 changes: 3 additions & 3 deletions designable/antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"start": "webpack-dev-server --config playground/webpack.dev.ts"
},
"devDependencies": {
"@designable/react-settings-form": "^0.1.32",
"@designable/react-settings-form": "^0.1.33",
"file-loader": "^5.0.2",
"fs-extra": "^8.1.0",
"html-webpack-plugin": "^3.2.0",
Expand All @@ -53,8 +53,8 @@
"react-is": ">=16.8.0 || >=17.0.0"
},
"dependencies": {
"@designable/core": "^0.1.32",
"@designable/react": "^0.1.32",
"@designable/core": "^0.1.33",
"@designable/react": "^0.1.33",
"@formily/shared": "2.0.0-beta.64",
"@formily/antd": "2.0.0-beta.64",
"@formily/core": "2.0.0-beta.64",
Expand Down
2 changes: 1 addition & 1 deletion designable/antd/playground/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const App = () => {
>
<DragSourceWidget title="输入组件" name="inputs" />
<DragSourceWidget title="布局组件" name="layouts" />
<DragSourceWidget title="数组组件" name="arrays" />
<DragSourceWidget title="自增列表" name="arrays" />
</CompositePanel.Item>
<CompositePanel.Item
title="大纲树"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import './styles.less'
import { Droppable } from '../Droppable'

export const createFormContainer = (
export const createDesignableContainer = (
Target: React.JSXElementConstructor<any>
) => {
return (props: any) => {
Expand Down
18 changes: 9 additions & 9 deletions designable/antd/src/components/DesignableField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ import {
import { clone } from '@formily/shared'
import * as defaultSchema from '../../schemas'
import { Card, Slider, Rate } from 'antd'
import { createFormContainer } from '../FormContainer'
import { createDesignableContainer } from '../DesignableContainer'
import { FormItemSwitcher } from '../FormItemSwitcher'
import { FormTab as DesignableFormTab } from '../FormTab'
import { FormCollapse as DesignableFormCollapse } from '../FormCollapse'
import { EmptyObject as DesignableEmptyObject } from '../EmptyObject'
import { DesignableFormTab } from '../DesignableFormTab'
import { DesignableFormCollapse } from '../DesignableFormCollapse'
import { DesignableObject } from '../DesignableObject'

Schema.silent()

Expand Down Expand Up @@ -99,9 +99,9 @@ export const createDesignableField = (options: IDesignableFieldProps = {}) => {
},
components: {
...options.components,
Space: createFormContainer(Space),
FormGrid: createFormContainer(FormGrid),
FormLayout: createFormContainer(FormLayout),
Space: createDesignableContainer(Space),
FormGrid: createDesignableContainer(FormGrid),
FormLayout: createDesignableContainer(FormLayout),
FormTab: DesignableFormTab,
FormCollapse: DesignableFormCollapse,
FormItem,
Expand Down Expand Up @@ -162,11 +162,11 @@ export const createDesignableField = (options: IDesignableFieldProps = {}) => {
const fieldProps = getFieldProps()
if (props.type === 'object') {
return (
<DesignableEmptyObject>
<DesignableObject>
<ObjectField {...fieldProps} name={node.id}>
{props.children}
</ObjectField>
</DesignableEmptyObject>
</DesignableObject>
)
} else if (props.type === 'array') {
return <ArrayField {...fieldProps} name={node.id} />
Expand Down
9 changes: 9 additions & 0 deletions designable/antd/src/components/DesignableForm/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
.@{ant-prefix}-picker-input,
.@{ant-prefix}-picker,
.@{ant-prefix}-cascader-picker-label,
.@{ant-prefix}-slider,
.@{ant-prefix}-checkbox,
.@{ant-prefix}-radio,
.@{ant-prefix}-radio-wrapper,
.@{ant-prefix}-checkbox-group,
.@{ant-prefix}-checkbox-wrapper,
.@{ant-prefix}-radio-group,
.@{ant-prefix}-upload,
.@{ant-prefix}-transfer,
.@{ant-prefix}-select,
.@{ant-prefix}-select-selector {
pointer-events: none !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const getCorrectActiveKey = (
return tabs[tabs.length - 1].id
}

export const FormCollapse: React.FC<CollapseProps> & {
export const DesignableFormCollapse: React.FC<CollapseProps> & {
CollapsePanel?: React.FC<CollapsePanelProps>
} = observer((props) => {
const [activeKey, setActiveKey] = useState<string | string[]>([])
Expand Down Expand Up @@ -134,6 +134,6 @@ export const FormCollapse: React.FC<CollapseProps> & {
)
})

FormCollapse.CollapsePanel = (props) => {
DesignableFormCollapse.CollapsePanel = (props) => {
return <Fragment>{props.children}</Fragment>
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getCorrectActiveKey = (activeKey: string, tabs: TreeNode[]) => {
return tabs[tabs.length - 1].id
}

export const FormTab: React.FC<TabsProps> & {
export const DesignableFormTab: React.FC<TabsProps> & {
TabPane?: React.FC<TabPaneProps>
} = observer((props) => {
const [activeKey, setActiveKey] = useState<string>()
Expand Down Expand Up @@ -121,6 +121,6 @@ export const FormTab: React.FC<TabsProps> & {
)
})

FormTab.TabPane = (props) => {
DesignableFormTab.TabPane = (props) => {
return <Fragment>{props.children}</Fragment>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { useNodeIdProps, useTreeNode } from '@designable/react'
import { Droppable } from '../Droppable'

export const EmptyObject: React.FC = (props) => {
export const DesignableObject: React.FC = (props) => {
const node = useTreeNode()
const nodeId = useNodeIdProps()
if (node.children.length === 0) return <Droppable {...nodeId} />
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
},
"workspaces": [
"packages/*",
"designable/*"
"designable/*",
"devtools/*"
],
"scripts": {
"bootstrap": "lerna bootstrap",
Expand Down
44 changes: 22 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1155,12 +1155,12 @@
resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz#c3c5ae543c897caa9c2a68630bed355be5f9990f"
integrity sha512-JZButFdZ1+/xAfpguQHoabIXkcqRRKpMrWKBkpEZZyxfY9C1DpADFB8PEqGSTeFr135SaTRfKqGKx5xSCLI7ZQ==

"@designable/core@0.1.32", "@designable/core@^0.1.32":
version "0.1.32"
resolved "https://registry.yarnpkg.com/@designable/core/-/core-0.1.32.tgz#ef12a0e23d42d3052912376c468a217de3ca451a"
integrity sha512-FwWyRAH3iUCs5b31ceb1+NlBtbJ9vHGCB+EtoZAhOa+U1HXsSJENsiwrosD9gP4L2ZqoEivfmeqQFkwkekMV+g==
"@designable/core@0.1.33", "@designable/core@^0.1.33":
version "0.1.33"
resolved "https://registry.yarnpkg.com/@designable/core/-/core-0.1.33.tgz#689f123b0417c739433436e5f65ab3944fc98d22"
integrity sha512-GSkqGLLEgzQcJeEVdyRYxqUYEgovn16Nj89WMNGc0H4wKOZYeCs26Cq32NBaFaRz5oy2LB/91fbHQrQ0tJxnjQ==
dependencies:
"@designable/shared" "0.1.32"
"@designable/shared" "0.1.33"
"@formily/json-schema" "^2.0.0-beta.50"
"@formily/path" "^2.0.0-beta.50"
"@formily/reactive" "^2.0.0-beta.50"
Expand All @@ -1176,28 +1176,28 @@
"@formily/reactive" "^2.0.0-beta.50"
"@juggle/resize-observer" "^3.3.1"

"@designable/react-settings-form@^0.1.32":
version "0.1.32"
resolved "https://registry.yarnpkg.com/@designable/react-settings-form/-/react-settings-form-0.1.32.tgz#dd67c5e1ed3cf92f374b4bbf1d11bc527c205257"
integrity sha512-cPZyhNJB9pHTuJY4olJ1gOnUUyzYezGMQRjU3Lu7WmY7fEGf22Q/Jiutrf7RiuNSUpg212P37I+KUSINoeN4xw==
"@designable/react-settings-form@^0.1.33":
version "0.1.33"
resolved "https://registry.yarnpkg.com/@designable/react-settings-form/-/react-settings-form-0.1.33.tgz#de102a3ec7ede4d5f0d24623171ec00805f477d4"
integrity sha512-bIoONlLLvYOb9rJIkRwYFhdDcu7p6aJ1sXyjuFNct139870QA3HSG0nCjwjB0MDxqtHItJLyNPnZ0QcKy4DUBQ==
dependencies:
"@designable/core" "0.1.32"
"@designable/react" "0.1.32"
"@designable/shared" "0.1.32"
"@designable/core" "0.1.33"
"@designable/react" "0.1.33"
"@designable/shared" "0.1.33"
"@formily/antd" "^2.0.0-beta.50"
"@formily/core" "^2.0.0-beta.50"
"@formily/react" "^2.0.0-beta.50"
"@formily/reactive" "^2.0.0-beta.50"
"@formily/reactive-react" "^2.0.0-beta.50"
react-color "^2.19.3"

"@designable/react@0.1.32", "@designable/react@^0.1.32":
version "0.1.32"
resolved "https://registry.yarnpkg.com/@designable/react/-/react-0.1.32.tgz#e30b7e71b1deb13e0c59716c5f63e78527d42fba"
integrity sha512-IXlJdOpSv8zxnkrottz7P7E55coEbuV1swRB15yI5/J2S3W3Tap6AEVHZyJRbRPv4chxdNbllkasT9IeK/GDGQ==
"@designable/react@0.1.33", "@designable/react@^0.1.33":
version "0.1.33"
resolved "https://registry.yarnpkg.com/@designable/react/-/react-0.1.33.tgz#ee22be6a2bd2fc4ba0a000b59917b9d83acafdae"
integrity sha512-0u8tQqzD0jC7jGI/cmLKhrinB0Ms9Pi86mcHMptnqwmtPd+R/wqqIw4n4FRLk3g0ARYOHHovY2Nnwo+Kp4L5qQ==
dependencies:
"@designable/core" "0.1.32"
"@designable/shared" "0.1.32"
"@designable/core" "0.1.33"
"@designable/shared" "0.1.33"
"@formily/reactive" "^2.0.0-beta.50"
"@formily/reactive-react" "^2.0.0-beta.50"
"@juggle/resize-observer" "^3.3.1"
Expand All @@ -1209,10 +1209,10 @@
dependencies:
requestidlecallback "^0.3.0"

"@designable/shared@0.1.32":
version "0.1.32"
resolved "https://registry.yarnpkg.com/@designable/shared/-/shared-0.1.32.tgz#105fd2650ddbd2c9f3665ca91c6ec5055152803b"
integrity sha512-dRR95iNt8UWNsGy72ym2SS2Kr8RVpItfDfTJ90+bzIJRVw8sGcJ060+Rm4XWZNFktGyMKpH+LunUtJmfZJysNg==
"@designable/shared@0.1.33":
version "0.1.33"
resolved "https://registry.yarnpkg.com/@designable/shared/-/shared-0.1.33.tgz#69a373e5a6bbcf3171f751ed28b8ca15fe19ab6d"
integrity sha512-LCOlLuqDAkvr34bPFoxfAVuQYfv3OqiW10aHOSvJU6CsaKrVgdYYVIwN5iV78B2TuIIYK2h7jYv5WhTsa384ng==
dependencies:
requestidlecallback "^0.3.0"

Expand Down

0 comments on commit ceb8a8d

Please sign in to comment.