Unrefactor Properties form to allow more freedom on the input types and form (#32)
All checks were successful
continuous-integration/drone/push Build is passing

- The css style is now in IProperties.Style again.
- Forms are divided in DynamicForm and StaticForm
- Faster because less logic
- Add RadioGroupButton
- Add InputGroup
- Fix Children Dimensions not using x for their origin

Co-authored-by: Eric NGUYEN <enguyen@techform.fr>
Reviewed-on: https://git.siklos-chaneru.duckdns.org/Siklos/svg-layout-designer-react/pulls/32
This commit is contained in:
Siklos 2022-08-16 08:57:54 -04:00
parent 3d7baafc17
commit 5f8e011bc6
19 changed files with 529 additions and 134 deletions

View file

@ -1,4 +1,4 @@
import React, { Dispatch, SetStateAction } from 'react';
import { Dispatch, SetStateAction } from 'react';
import { IHistoryState } from '../../Interfaces/IHistoryState';
import { IConfiguration } from '../../Interfaces/IConfiguration';
import { ContainerModel, IContainerModel } from '../../Interfaces/IContainerModel';
@ -8,6 +8,7 @@ import IProperties from '../../Interfaces/IProperties';
import { AddMethod } from '../../Enums/AddMethod';
import { IAvailableContainer } from '../../Interfaces/IAvailableContainer';
import { transformPosition } from '../SVG/Elements/Container';
import { XPositionReference } from '../../Enums/XPositionReference';
/**
* Select a container
@ -209,7 +210,6 @@ export function AddContainer(
x = ApplyAddMethod(index, containerConfig, parentClone, x);
const defaultProperties: IProperties = {
...containerConfig.Style,
id: `${type}-${count}`,
parentId: parentClone.properties.id,
x,
@ -218,7 +218,8 @@ export function AddContainer(
height,
isRigidBody: false,
isAnchor: false,
XPositionReference: containerConfig.XPositionReference
XPositionReference: containerConfig.XPositionReference ?? XPositionReference.Left,
style: containerConfig.Style
};
// Create the container