diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs index dd1c4f4..0c23afe 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs @@ -1,20 +1,23 @@ -using System.Runtime.Serialization; - -namespace SVGLDLibs.Models -{ - [DataContract] - public class CSSStyle - { - [DataMember(EmitDefaultValue = false)] - public double? strokeWidth; - - [DataMember(EmitDefaultValue = false)] - public double? fillOpacity; - - [DataMember(EmitDefaultValue = false)] - public string stroke; - - [DataMember(EmitDefaultValue = false)] - public string fill; - } +using System.Runtime.Serialization; + +namespace SVGLDLibs.Models +{ + [DataContract] + public class CSSStyle + { + [DataMember(EmitDefaultValue = false)] + public string stroke; + + [DataMember(EmitDefaultValue = false)] + public double? strokeOpacity; + + [DataMember(EmitDefaultValue = false)] + public double? strokeWidth; + + [DataMember(EmitDefaultValue = false)] + public string fill; + + [DataMember(EmitDefaultValue = false)] + public double? fillOpacity; + } } \ No newline at end of file diff --git a/docs/#Project/Home.md b/docs/#Project/Home.md index f10a985..4831a30 100644 --- a/docs/#Project/Home.md +++ b/docs/#Project/Home.md @@ -15,6 +15,8 @@ Liens : - [Système de comportement](Pages/Behaviors.md) - [Cycle de vie de l'application](Pages/Application.md) - [Implémentation du menu contextuel](Pages/ContextMenu.md) -- [Web workers](Pages/WebWorkers.md) +- [Implémentation du système de cote](Pages/SVGLD_Cotes.pdf) +- [Web workers](Pages/WebWorkers.md) (pdf) +- [Traductions](Pages/Translations.drawio) (nécessite diagrams.net) - [Système de CI/CD](Pages/Behaviors.md) - [Mise en place du SmartComponent sur Modeler](Pages/SmartComponent.md) diff --git a/docs/#Project/Pages/Translations.drawio b/docs/#Project/Pages/Translations.drawio index 78684ae..ce4c171 100644 --- a/docs/#Project/Pages/Translations.drawio +++ b/docs/#Project/Pages/Translations.drawio @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7fbcd3b23f0c23bb52a72a634a84f7f0b71c707293f0d81991bebc4d93099ca2 -size 306765 +oid sha256:2780f57a5082686ada87ac826848acf9268a7c0af03d1048121b32e1033e0116 +size 344587 diff --git a/src/Components/CheckboxGroupButtons/CheckboxGroupButtons.tsx b/src/Components/CheckboxGroupButtons/CheckboxGroupButtons.tsx index 2b512d1..4933961 100644 --- a/src/Components/CheckboxGroupButtons/CheckboxGroupButtons.tsx +++ b/src/Components/CheckboxGroupButtons/CheckboxGroupButtons.tsx @@ -63,9 +63,7 @@ export function CheckboxGroupButtons(props: ICheckboxGroupButtonsProps): JSX.Ele -
+
{inputGroups}
diff --git a/src/Components/ContainerProperties/ContainerForm.tsx b/src/Components/ContainerProperties/ContainerForm.tsx index 28c893f..28c5df8 100644 --- a/src/Components/ContainerProperties/ContainerForm.tsx +++ b/src/Components/ContainerProperties/ContainerForm.tsx @@ -21,24 +21,6 @@ interface IContainerFormProps { onChange: (key: string, value: string | number | boolean | number[], type?: PropertyType) => void } -function GetCSSInputs(properties: IContainerProperties, - onChange: (key: string, value: string | number | boolean, type: PropertyType) => void): JSX.Element[] { - const groupInput: JSX.Element[] = []; - for (const key in properties.style) { - groupInput.push( onChange(key, value, PropertyType.Style)} />); - } - return groupInput; -} - export function ContainerForm(props: IContainerFormProps): JSX.Element { const categoryHeight = 'h-11'; return ( @@ -400,16 +382,73 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
- -
- {GetCSSInputs(props.properties, props.onChange)} -
-
+ { props.properties.style !== undefined && + +
+ props.onChange('stroke', value, PropertyType.Style)} + /> + props.onChange('strokeOpacity', Number(event.target.value), PropertyType.Style)} + /> + props.onChange('strokeWidth', Number(value), PropertyType.Style)} + /> + props.onChange('fill', value, PropertyType.Style)} + /> + props.onChange('fillOpacity', Number(event.target.value), PropertyType.Style)} + /> +
+
+ } ); } diff --git a/src/Components/InputGroup/InputGroup.tsx b/src/Components/InputGroup/InputGroup.tsx index d446276..92731d0 100644 --- a/src/Components/InputGroup/InputGroup.tsx +++ b/src/Components/InputGroup/InputGroup.tsx @@ -13,6 +13,7 @@ interface IInputGroupProps { defaultChecked?: boolean min?: number max?: number + step?: number isDisabled?: boolean onChange?: (event: React.ChangeEvent) => void } @@ -39,6 +40,7 @@ export function InputGroup(props: IInputGroupProps): JSX.Element { onChange={props.onChange} min={props.min} max={props.max} + step={props.step} disabled={props.isDisabled} /> ; } diff --git a/src/Interfaces/IAvailableContainer.ts b/src/Interfaces/IAvailableContainer.ts index 4b2e8c4..90b2b7f 100644 --- a/src/Interfaces/IAvailableContainer.ts +++ b/src/Interfaces/IAvailableContainer.ts @@ -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 */ - Style?: React.CSSProperties + Style?: IStyle /** * List of possible actions shown on right-click diff --git a/src/Interfaces/IContainerProperties.ts b/src/Interfaces/IContainerProperties.ts index 6d7d7ba..f83c496 100644 --- a/src/Interfaces/IContainerProperties.ts +++ b/src/Interfaces/IContainerProperties.ts @@ -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 */ - style?: React.CSSProperties + style?: IStyle /** * (optional) diff --git a/src/Interfaces/IStyle.ts b/src/Interfaces/IStyle.ts new file mode 100644 index 0000000..7b6cda9 --- /dev/null +++ b/src/Interfaces/IStyle.ts @@ -0,0 +1,11 @@ +export interface IStyle { + stroke?: string + + strokeOpacity?: number + + strokeWidth?: number + + fill?: string + + fillOpacity?: number +} diff --git a/src/Translations/translation.en.json b/src/Translations/translation.en.json index d2547aa..f742ab2 100644 --- a/src/Translations/translation.en.json +++ b/src/Translations/translation.en.json @@ -62,6 +62,11 @@ "@ContainerMarkPosition": "Mark the position for the parents", "@ContainerShowDimensionWithMarks": "Show dimension with marked children", "@ContainerStyle": "Style", + "@StyleStroke": "Stroke", + "@StyleStrokeOpacity": "Stroke Opacity", + "@StyleStrokeWidth": "Stroke Width", + "@StyleFill": "Fill", + "@StyleFillOpacity": "Fill Opacity", "@SymbolName": "Name", "@SymbolX": "x", diff --git a/src/Translations/translation.fr.json b/src/Translations/translation.fr.json index 4dcb04c..35ed703 100644 --- a/src/Translations/translation.fr.json +++ b/src/Translations/translation.fr.json @@ -62,6 +62,11 @@ "@ContainerMarkPosition": "Marquer la position pour les parents", "@ContainerShowDimensionWithMarks": "Afficher les cotations avec les enfants marqués", "@ContainerStyle": "Style", + "@StyleStroke": "Tracé", + "@StyleStrokeOpacity": "Opacité du tracé", + "@StyleStrokeWidth": "Epaisseur du tracé", + "@StyleFill": "Remplissage", + "@StyleFillOpacity": "Opacité du remplissage", "@SymbolName": "Nom", "@SymbolX": "x",