import React, { createRef, useState } from 'react';
import { Resizable } from '../../index';
import { Toast, Button, Tag } from '@douyinfe/semi-ui'
export default {
title: 'Resizable'
}
import { ResizeItem, ResizeHandler, ResizeGroup } from '../../index'
export const Group_layout = () => {
const [text, setText] = useState('test')
const opts_1 = {
content: 'resize start',
duration: 1,
stack: true,
};
const opts = {
content: 'resize end',
duration: 1,
stack: true,
};
return (
{ setText('resizing') }}
// onResizeStart={() => {{Toast.info(opts_1)}}}
// onResizeEnd={() => { Toast.info(opts); setText('test') }}
>
{'header'}
{ setText('resizing') }}
>
{ setText('resizing') }}
// onResizeStart={() => {Toast.info(opts_1)}}
// onResizeEnd={() => { Toast.info(opts); setText('test') }}
>
{'tab'}
{ setText('resizing') }}
>
{text}
{ setText('resizing') }}
>
{text}
);
}
export const Group_nested = () => {
const [text, setText] = useState('test')
const opts_1 = {
content: 'resize start',
duration: 1,
stack: true,
};
const opts = {
content: 'resize end',
duration: 1,
stack: true,
};
return (
{ setText('resizing') }}
onResizeStart={() => {{Toast.info(opts_1)}}}
onResizeEnd={() => { Toast.info(opts); setText('test') }}
>
{text}
{'hahaha, man'}
{ setText('resizing') }}
>
{ setText('resizing') }}
onResizeStart={() => {Toast.info(opts_1)}}
onResizeEnd={() => { Toast.info(opts); setText('test') }}
>
{text}
{ setText('resizing') }}
>
{text}
{ setText('resizing') }}
>
{text}
{ setText('resizing') }}
>
{text}
);
}
export const Group_vertical = () => {
const [text, setText] = useState('test')
const opts_1 = {
content: 'resize start',
duration: 1,
stack: true,
};
const opts = {
content: 'resize end',
duration: 1,
stack: true,
};
return (
{ setText('resizing') }}
onResizeStart={() => {Toast.info(opts_1)}}
onResizeEnd={() => { Toast.info(opts); setText('test') }}
>
{text + " min:10% max:30%"}
{ setText('resizing') }}
>
{text}
{ setText('resizing') }}
>
{text}
{ setText('resizing') }}
>
{text}
);
}
export const Group_horizontal = () => {
const [text, setText] = useState('test')
return (
{ setText('resizing') }}
onResizeEnd={() => { setText('test') }}
>
{text + " min:10%"}
{ setText('resizing') }}
>
{text + " min:10% max:30%"}
{ setText('resizing') }}
>
{text}
{ setText('resizing') }}
>
{text}
);
}
export const Single_defaultSize = () => {
const [text, setText] = useState('test')
const opts_1 = {
content: 'resize start',
duration: 1,
stack: true,
};
const opts = {
content: 'resize end',
duration: 1,
stack: true,
};
return (
{ setText('resizing'); }}
onResizeStart={() => {Toast.info(opts_1)}}
onResizeEnd={() => { Toast.info(opts); setText('test') }}
>
{text}
);
}
export const Single_Enabel = () => {
const [b, setB] = useState(false)
return (
test
);
}
export const Single_ratio = () => {
return (
);
}
export const Single_lock_aspect = () => {
const aspectRatio = 16 / 9
return (
);
}
export const singleMaxMin = () => {
return (
width在50到500之间,height在50到600之间
)
}
export const Single_change = () => {
const [size, setSize] = useState({ width: 200, height: 300 });
const ref = createRef()
const onChange = (() => {
let realSize = { width: size.width + 10, height: size.height + 10 };
setSize(realSize);
})
return (
{ setSize(s); }}
size={size}
>
受控
);
}
export const Single_scale = () => {
return (
);
}
export const Single_bound = () => {
return (
);
}
export const Single_handler = () => {
return (
hi
}}
handleStyle={{
bottomRight: {
width: '100px',
height: '100px',
backgroundColor: 'red'
}
}}
>
bottomRight
);
}
export const Single_grid = () => {
return (
);
}