|
1 |
| -# @jswl/vindow |
| 1 | +# @react-libraries/virtual-window |
2 | 2 |
|
3 | 3 | ## Description
|
4 | 4 |
|
5 | 5 | VirtualWindow for React
|
6 | 6 |
|
| 7 | +## Image |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Example |
| 12 | + |
| 13 | +```tsx |
| 14 | +const SampleComponent = () => ( |
| 15 | + <VirtualWindow title="Title" width={200} height={100}> |
| 16 | + Contents |
| 17 | + </VirtualWindow> |
| 18 | +); |
| 19 | +``` |
| 20 | + |
7 | 21 | ## Storybook
|
8 | 22 |
|
9 |
| -[Storybook](https://reactlibraries.github.io/virtual-window/captures/master/stories/?path=/docs/components-virtualwindow--primary) |
| 23 | +[Storybook samples](https://reactlibraries.github.io/virtual-window/captures/master/stories/?path=/docs/components-virtualwindow--primary) |
| 24 | + |
| 25 | +## \<VirtualWindow> parameters |
| 26 | + |
| 27 | +| Name | Type | Default | Description | |
| 28 | +| ------------- | ------------------------------ | ------------------------------ | ----------------------------------------------------- | |
| 29 | +| title | ReactNode | "" | Window title | |
| 30 | +| overlapped | boolean | true | Whether to set position to fixed | |
| 31 | +| titleEnable | boolean | true | Whether to display the title | |
| 32 | +| titleSize | number | 32 | Title bar size | |
| 33 | +| titleButtons | {} | {max:true,min:true,close:true} | Presence or absence of a button attached to the title | |
| 34 | +| active | boolean | false | Whether to activate in the initial state | |
| 35 | +| baseX | start \| center \| end | start | Placement criteria in the X direction | |
| 36 | +| baseY | start \| center \| end | start | Placement criteria in the Y direction | |
| 37 | +| x | number | 0 | Initial X position | |
| 38 | +| y | number | 0 | Initial Y position | |
| 39 | +| width | number | 640 | Initial width | |
| 40 | +| height | number | 480 | Initial height | |
| 41 | +| state | normal \| max \| min \| close | normal | Window state | |
| 42 | +| frameSize | number | 1 | Frame size | |
| 43 | +| resize | boolean | true | Whether to allow resizing | |
| 44 | +| resizeBold | number | 8 | Invisible frame size for resizing | |
| 45 | +| clientStyle | React.CSSProperties | undefined | Client style | |
| 46 | +| clientClass | string | undefined | Client class name | |
| 47 | +| clientMovable | boolean | false | Whether the client can be dragged and dropped | |
| 48 | +| dispatch | Ref | undefined | Dispatch for parameter setting | |
| 49 | +| onUpdate | (params: WindowParams) => void | undefined | State change event | |
| 50 | + |
| 51 | +## WindowParams |
| 52 | + |
| 53 | +| Name | Type | Description | |
| 54 | +| ------ | ------------------------- | --------------- | |
| 55 | +| active | boolean | Window active | |
| 56 | +| x | number | Current x | |
| 57 | +| y | number | Current y | |
| 58 | +| width | number | Current width | |
| 59 | +| height | number | Current height | |
| 60 | +| state | normal \|max\|min \|close | Window state | |
| 61 | +| init | boolean | Initial display | |
| 62 | + |
| 63 | +## dispatch |
| 64 | + |
| 65 | +`dispatch({type:"state", payload:'normal'|'max'|'min'|'close'});` |
| 66 | +`dispatch({type:"position", payload:{x:number,y:number}});` |
| 67 | +`dispatch({type:"size", payload:{width:number,height:number}});` |
0 commit comments