Merged PR 227: Refactor Properties in ContainerProperties

Commit 927934a5: Refactor Style inputs to replace React.CSSProperties by IStyle
This commit is contained in:
Eric Nguyen 2022-11-08 09:09:17 +00:00
parent 6ee4eb2986
commit 1116185b9f
11 changed files with 122 additions and 61 deletions

View file

@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
import React from 'react';
import { AddMethod } from '../Enums/AddMethod';
import { PositionReference } from '../Enums/PositionReference';
import { IAction } from './IAction';
@ -7,6 +6,7 @@ import { IMargin } from './IMargin';
import { Orientation } from '../Enums/Orientation';
import { Position } from '../Enums/Position';
import { IKeyValue } from './IKeyValue';
import { IStyle } from './IStyle';
/** Model of available container used in application configuration */
export interface IAvailableContainer {
@ -22,14 +22,12 @@ export interface IAvailableContainer {
/** orientation */
Orientation?: Orientation
// TODO: Refactor x, y in IPoint interface
/** horizontal offset */
X?: number
/** vertical offset */
Y?: number
// TODO: Refactor width, height, minWidth... in ISize interface
/** width */
Width?: number
@ -59,7 +57,6 @@ export interface IAvailableContainer {
/** margin */
Margin?: IMargin
// TODO: Refactor isAnchor, isFlex in IBehaviors interface
/** true if anchor, false otherwise */
IsAnchor?: boolean
@ -113,7 +110,6 @@ export interface IAvailableContainer {
*/
Pattern?: string
// TODO: Refactor showSelf., showChildren., markPosition, showDimensionWithMarks in IDimensionOptions interface
/** Hide the children in the treeview */
HideChildrenInTreeview?: boolean
@ -155,7 +151,7 @@ export interface IAvailableContainer {
* (optional)
* Style of the <rect>
*/
Style?: React.CSSProperties
Style?: IStyle
/**
* List of possible actions shown on right-click

View file

@ -1,9 +1,9 @@
import * as React from 'react';
import { PositionReference } from '../Enums/PositionReference';
import { IMargin } from './IMargin';
import { Orientation } from '../Enums/Orientation';
import { Position } from '../Enums/Position';
import { IKeyValue } from './IKeyValue';
import { IStyle } from './IStyle';
/**
* Properties of a container
@ -122,7 +122,7 @@ export interface IContainerProperties {
* (optional)
* Style of the <rect>
*/
style?: React.CSSProperties
style?: IStyle
/**
* (optional)

11
src/Interfaces/IStyle.ts Normal file
View file

@ -0,0 +1,11 @@
export interface IStyle {
stroke?: string
strokeOpacity?: number
strokeWidth?: number
fill?: string
fillOpacity?: number
}