1- import { ResizeType } from 'src/Resizable' ;
1+ import * as PropTypes from "prop-types" ;
2+
3+ export enum ResizeType {
4+ Left = "resize-left" ,
5+ Right = "resize-right" ,
6+ Top = "resize-top" ,
7+ Bottom = "resize-bottom"
8+ }
29
310export enum AnchorType {
411 Left = "anchor-left" ,
@@ -22,9 +29,9 @@ export const AnchorToResizeTypeMap = {
2229}
2330
2431export enum CenterType {
25- None ,
26- Vertical ,
27- HorizontalVertical
32+ None = "none" ,
33+ Vertical = "vertical" ,
34+ HorizontalVertical = "horizontalVertical"
2835}
2936
3037export interface IPublicProps {
@@ -44,25 +51,60 @@ export interface IPublicProps {
4451 onMouseLeave ?: ( event : React . MouseEvent < HTMLElement , MouseEvent > ) => void
4552}
4653
54+ export const publicProps = {
55+ id : PropTypes . string ,
56+ className : PropTypes . string ,
57+ style : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . array ] ) ,
58+ scrollable : PropTypes . bool ,
59+ trackSize : PropTypes . bool ,
60+ centerContent : PropTypes . oneOf ( [ CenterType . None , CenterType . Vertical , CenterType . HorizontalVertical ] ) ,
61+ as : PropTypes . string ,
62+ debug : PropTypes . bool ,
63+ zIndex : PropTypes . number ,
64+ onClick : PropTypes . func ,
65+ onMouseDown : PropTypes . func ,
66+ onMouseEnter : PropTypes . func ,
67+ onMouseLeave : PropTypes . func
68+ }
69+
4770export interface IPrivateProps {
4871 anchorSize ?: string | number ,
4972 anchor ?: AnchorType ,
5073 resizable ?: boolean ,
5174 order ?: number
5275}
5376
77+ export const privateProps = {
78+ anchorSize : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
79+ anchor : PropTypes . oneOf ( [ AnchorType . Bottom , AnchorType . Left , AnchorType . Right , AnchorType . Top ] ) ,
80+ resizable : PropTypes . bool ,
81+ order : PropTypes . number
82+ }
83+
5484export interface IAnchoredProps {
5585 size : number | string ,
5686 order ?: number
5787}
5888
89+ export const anchoredProps = {
90+ size : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) . isRequired ,
91+ order : PropTypes . number
92+ }
93+
5994export interface IResizableProps {
6095 handleSize ?: number ,
6196 overlayHandle ?: boolean ,
6297 minimumSize ?: number ,
6398 maximumSize ?: number
6499}
65100
101+ export const resizableProps = {
102+ handleSize : PropTypes . number ,
103+ overlayHandle : PropTypes . bool ,
104+ minimumSize : PropTypes . number ,
105+ maximumSize : PropTypes . number
106+ }
107+
66108export interface IPositionedProps {
67109 left ?: string | number ,
68110 top ?: string | number ,
@@ -73,8 +115,20 @@ export interface IPositionedProps {
73115 resizable ?: boolean
74116}
75117
118+ export const positionedProps = {
119+ left : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
120+ top : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
121+ right : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
122+ bottom : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
123+ width : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
124+ height : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
125+ resizable : PropTypes . bool
126+ }
127+
76128export type AllProps = IPublicProps & IPrivateProps & IResizableProps & IPositionedProps ;
77129
130+ export const allProps = { ...publicProps , ...privateProps , ...resizableProps , ...positionedProps } ;
131+
78132export interface IState {
79133 id : string ,
80134 currentWidth : number ,
0 commit comments