mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-23 22:50:11 +03:00
stash
This commit is contained in:
parent
f56da227ca
commit
1c68a52202
|
@ -20,6 +20,12 @@ Default.args = {
|
||||||
fullWidth: false,
|
fullWidth: false,
|
||||||
children: 'Hello Dialog!',
|
children: 'Hello Dialog!',
|
||||||
};
|
};
|
||||||
|
Default.argTypes = {
|
||||||
|
actions: { table: { disable: true } },
|
||||||
|
onDismiss: { table: { disable: true } },
|
||||||
|
onSubmit: { table: { disable: true } },
|
||||||
|
theme: { table: { disable: true } },
|
||||||
|
};
|
||||||
|
|
||||||
export const WithForm = Template.bind({});
|
export const WithForm = Template.bind({});
|
||||||
WithForm.args = {
|
WithForm.args = {
|
||||||
|
@ -32,35 +38,12 @@ WithForm.args = {
|
||||||
schema,
|
schema,
|
||||||
uiSchema,
|
uiSchema,
|
||||||
};
|
};
|
||||||
// storiesOf('Dialog', module)
|
WithForm.argTypes = {
|
||||||
// .addDecorator(withKnobs)
|
title: { table: { disable: true } },
|
||||||
// .add('default', () => (
|
children: { table: { disable: true } },
|
||||||
// <Dialog
|
actions: { table: { disable: true } },
|
||||||
// title={text('title', 'Dialog Title')}
|
modal: { table: { disable: true } },
|
||||||
// submitText={text('submitText', 'Submit!')}
|
onDismiss: { table: { disable: true } },
|
||||||
// open={boolean('open', true)}
|
onSubmit: { table: { disable: true } },
|
||||||
// noHeader={boolean('noHeader', false)}
|
theme: { table: { disable: true } },
|
||||||
// noFooter={boolean('noFooter', false)}
|
};
|
||||||
// modal={boolean('modal', false)}
|
|
||||||
// fullWidth={boolean('fullWidth', false)}
|
|
||||||
// onDismiss={action('dialog dismissed')}
|
|
||||||
// onSubmit={action('dialog submitted')}
|
|
||||||
// >
|
|
||||||
// {text('children', 'Hello Dialog!')}
|
|
||||||
// </Dialog>
|
|
||||||
// ))
|
|
||||||
// .add('with form', () => (
|
|
||||||
// <Dialog
|
|
||||||
// open={boolean('open', true)}
|
|
||||||
// noHeader={boolean('noHeader', false)}
|
|
||||||
// noFooter={boolean('noFooter', false)}
|
|
||||||
// fullWidth={boolean('fullWidth', false)}
|
|
||||||
// submitText={text('submitText', 'Submit!')}
|
|
||||||
// formData={object('formData', formData)}
|
|
||||||
// schema={object('schema', schema)}
|
|
||||||
// uiSchema={object('uiSchema', uiSchema)}
|
|
||||||
// onChange={action('form changed')}
|
|
||||||
// onSubmit={action('form submitted')}
|
|
||||||
// onDismiss={action('dialog dismissed')}
|
|
||||||
// />
|
|
||||||
// ));
|
|
||||||
|
|
56
packages/devui/src/Editor/Editor.stories.js
Normal file
56
packages/devui/src/Editor/Editor.stories.js
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
import React from 'react';
|
||||||
|
import Editor from './';
|
||||||
|
import { default as WithTabsComponent } from './WithTabs';
|
||||||
|
|
||||||
|
const value = `
|
||||||
|
var themes = [];
|
||||||
|
|
||||||
|
function getThemes() {
|
||||||
|
return themes;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'Editor',
|
||||||
|
component: Editor,
|
||||||
|
};
|
||||||
|
|
||||||
|
const Template = (args) => <Editor {...args} />;
|
||||||
|
|
||||||
|
export const Default = Template.bind({});
|
||||||
|
Default.args = {
|
||||||
|
value,
|
||||||
|
lineNumbers: true,
|
||||||
|
lineWrapping: false,
|
||||||
|
foldGutter: true,
|
||||||
|
readOnly: false,
|
||||||
|
autofocus: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
const WithTabsTemplate = (args) => <WithTabsComponent {...args} />;
|
||||||
|
|
||||||
|
export const WithTabs = WithTabsTemplate.bind({});
|
||||||
|
WithTabs.args = {
|
||||||
|
lineNumbers: true,
|
||||||
|
align: 'left',
|
||||||
|
};
|
||||||
|
// storiesOf('Editor', module)
|
||||||
|
// .addDecorator(withKnobs)
|
||||||
|
// .add(
|
||||||
|
// 'default',
|
||||||
|
// () => (
|
||||||
|
// <Editor
|
||||||
|
// value={text('value', value)}
|
||||||
|
// lineNumbers={boolean('lineNumbers', true)}
|
||||||
|
// lineWrapping={boolean('lineWrapping', false)}
|
||||||
|
// foldGutter={boolean('foldGutter', true)}
|
||||||
|
// readOnly={boolean('readOnly', false)}
|
||||||
|
// onChange={action('change')}
|
||||||
|
// autofocus
|
||||||
|
// />
|
||||||
|
// ),
|
||||||
|
// { info: 'Based on [CodeMirror](http://codemirror.net/).' }
|
||||||
|
// )
|
||||||
|
// .add('with tabs', () => (
|
||||||
|
// <WithTabs lineNumbers={boolean('lineNumbers', true)} />
|
||||||
|
// ));
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { select } from '@storybook/addon-knobs';
|
import Editor from './';
|
||||||
import Editor from '../';
|
import Tabs from '../Tabs';
|
||||||
import Tabs from '../../Tabs';
|
|
||||||
|
|
||||||
const value1 = `
|
const value1 = `
|
||||||
const func1 = () => {}
|
const func1 = () => {}
|
||||||
|
@ -18,7 +17,7 @@ export default class WithTabs extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { lineNumbers } = this.props;
|
const { align, lineNumbers } = this.props;
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<Tabs
|
||||||
tabs={[
|
tabs={[
|
||||||
|
@ -37,7 +36,7 @@ export default class WithTabs extends Component {
|
||||||
onClick={(selected) => {
|
onClick={(selected) => {
|
||||||
this.setState({ selected });
|
this.setState({ selected });
|
||||||
}}
|
}}
|
||||||
align={select('align', ['left', 'right', 'center'], 'left')}
|
align={align}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
|
@ -1,35 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { storiesOf } from '@storybook/react';
|
|
||||||
import { action } from '@storybook/addon-actions';
|
|
||||||
import { withKnobs, text, boolean } from '@storybook/addon-knobs';
|
|
||||||
import Editor from '../';
|
|
||||||
import WithTabs from './WithTabs';
|
|
||||||
|
|
||||||
const value = `
|
|
||||||
var themes = [];
|
|
||||||
|
|
||||||
function getThemes() {
|
|
||||||
return themes;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
storiesOf('Editor', module)
|
|
||||||
.addDecorator(withKnobs)
|
|
||||||
.add(
|
|
||||||
'default',
|
|
||||||
() => (
|
|
||||||
<Editor
|
|
||||||
value={text('value', value)}
|
|
||||||
lineNumbers={boolean('lineNumbers', true)}
|
|
||||||
lineWrapping={boolean('lineWrapping', false)}
|
|
||||||
foldGutter={boolean('foldGutter', true)}
|
|
||||||
readOnly={boolean('readOnly', false)}
|
|
||||||
onChange={action('change')}
|
|
||||||
autofocus
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
{ info: 'Based on [CodeMirror](http://codemirror.net/).' }
|
|
||||||
)
|
|
||||||
.add('with tabs', () => (
|
|
||||||
<WithTabs lineNumbers={boolean('lineNumbers', true)} />
|
|
||||||
));
|
|
Loading…
Reference in New Issue
Block a user