Skip to content

Commit

Permalink
feat: add adaptors for design components
Browse files Browse the repository at this point in the history
  • Loading branch information
miadwang committed Aug 15, 2019
1 parent dbe7e0e commit 1526f4a
Show file tree
Hide file tree
Showing 5 changed files with 514 additions and 0 deletions.
50 changes: 50 additions & 0 deletions adaptor/colAdaptor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { adaptor, getPropsForLayoutComps } from '../utils';

export default {
name: 'Col',
editor: () => {
return {
props: [{
name: 'children',
type: 'node-list',
}]
};
},
adaptor,
demos: [
{
node: {
adaptor: 'Col',
props: {
...getPropsForLayoutComps('col'),
style: { border: 'dashed 1px grey' },
children: [
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'col'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'col'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'col'),
style: { backgroundColor: 'pink' },
},
},
],
},
},
backgroundColor: '#000', // 背景色
// height: 200, // 高度 默认 auto
},
],
};
99 changes: 99 additions & 0 deletions adaptor/flowAdaptor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { adaptor, getPropsForLayoutComps } from '../utils';

export default {
name: 'Flow',
editor: () => {
return {
props: [{
name: 'children',
type: 'node-list',
}]
};
},
adaptor,
demos: [
{
node: {
adaptor: 'Flow',
props: {
...getPropsForLayoutComps('flow'),
style: { border: 'dashed 1px grey' },
children: [
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'flow'),
style: { backgroundColor: 'pink' },
},
},
],
},
},
backgroundColor: '#000', // 背景色
// height: 200, // 高度 默认 auto
},
],
};
71 changes: 71 additions & 0 deletions adaptor/gridAdaptor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { adaptor, getPropsForLayoutComps } from '../utils';

export default {
name: 'Grid',
editor: () => {
return {
props: [{
name: 'children',
type: 'node-list',
}]
};
},
adaptor,
demos: [
{
node: {
adaptor: 'Grid',
props: {
...getPropsForLayoutComps('grid'),
style: { border: 'dashed 1px grey' },
children: [
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'grid'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'grid'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'grid'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'grid'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'grid'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'grid'),
style: { backgroundColor: 'pink' },
},
},
],
},
},
backgroundColor: '#000', // 背景色
// height: 200, // 高度 默认 auto
},
],
};
50 changes: 50 additions & 0 deletions adaptor/rowAdaptor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { adaptor, getPropsForLayoutComps } from '../utils';

export default {
name: 'Row',
editor: () => {
return {
props: [{
name: 'children',
type: 'node-list',
}]
};
},
adaptor,
demos: [
{
node: {
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row'),
style: { border: 'dashed 1px grey' },
children: [
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'row'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'row'),
style: { backgroundColor: 'pink' },
},
},
{
adaptor: 'Row',
props: {
...getPropsForLayoutComps('row', 'row'),
style: { backgroundColor: 'pink' },
},
},
],
},
},
backgroundColor: '#000', // 背景色
// height: 200, // 高度 默认 auto
},
],
};
Loading

0 comments on commit 1526f4a

Please sign in to comment.