1.0.8 • Published 2 years ago

@react-libraries/virtual-window v1.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

@react-libraries/virtual-window

Description

VirtualWindow for React

Image

image

Example

const SampleComponent = () => (
    <VirtualWindow title="Title" width={200} height={100}>
        Contents
    </VirtualWindow>
);

Storybook

Storybook samples

\ parameters

NameTypeDefaultDescription
titleReactNode""Window title
overlappedbooleantrueWhether to set position to fixed
titleEnablebooleantrueWhether to display the title
titleSizenumber32Title bar size
titleButtons{}{max:true,min:true,close:true}Presence or absence of a button attached to the title
activebooleanfalseWhether to activate in the initial state
baseXstart | center | endstartPlacement criteria in the X direction
baseYstart | center | endstartPlacement criteria in the Y direction
xnumber0Initial X position
ynumber0Initial Y position
widthnumber640Initial width
heightnumber480Initial height
statenormal | max | min | closenormalWindow state
frameSizenumber1Frame size
resizebooleantrueWhether to allow resizing
resizeBoldnumber8Invisible frame size for resizing
clientStyleReact.CSSPropertiesundefinedClient style
clientClassstringundefinedClient class name
clientMovablebooleanfalseWhether the client can be dragged and dropped
dispatchRefundefinedDispatch for parameter setting
onUpdate(params: WindowParams) => voidundefinedState change event

WindowParams

NameTypeDescription
activebooleanWindow active
xnumberCurrent x
ynumberCurrent y
widthnumberCurrent width
heightnumberCurrent height
statenormal |max|min |closeWindow state
initbooleanInitial display

dispatch

dispatch({type:"state", payload:'normal'|'max'|'min'|'close'});
dispatch({type:"position", payload:{x:number,y:number}});
dispatch({type:"size", payload:{width:number,height:number}});