Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/atoms/Forms/Duplicate/duplicate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
}
}

.add-button {
.add-button, .delete-button {
width: auto;
background-color: white;
}
}
2 changes: 1 addition & 1 deletion src/atoms/Forms/Duplicate/duplicateNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default (props: Props) => {
{React.createElement(props.element as any, elementProperties)}
</div>
{props.removeDisplayed && props.isRemovable && (
<Button onClick={onDelete} className="buttonContainer">
<Button onClick={onDelete} className="buttonContainer delete-button">
{props.deleteButtonContent || '-'}
</Button>
)}
Expand Down
4 changes: 1 addition & 3 deletions src/atoms/Forms/form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@
white-space: nowrap;
}

.input-component {
width: 300px;
}


.table-cell {
.input-component {
Expand Down
2 changes: 2 additions & 0 deletions src/atoms/Forms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ export default class GenericForm<
throw new Error(
'GenericForm has no render method. You need to extend from GenericForm to create a form.',
);

return <div />;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Une raison pour rajouter un return par défaut ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si on ne le met pas il y a une erreur

}
}

Expand Down
19 changes: 12 additions & 7 deletions src/atoms/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Event } from 'tools/types';

import './input.scss';

const KEY_ENTER = 13;

export interface IInputProps {
autoComplete?: string; // HTML5 Property
autoCompleteList?: boolean;
Expand Down Expand Up @@ -137,6 +139,10 @@ export default class Input extends Component<IInputProps, State> {
private onKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
const key = e.keyCode || e.charCode;

if (key === KEY_ENTER) {
e.preventDefault();
}

if (this.props.onKeyDown) {
this.props.onKeyDown({
name: this.props.name,
Expand Down Expand Up @@ -211,12 +217,11 @@ export default class Input extends Component<IInputProps, State> {

public componentDidUpdate(prevProps, prevState) {
const { value } = this.props;
if (
(value || value === 0) &&
prevProps.value !== value &&
(typeof value === 'number' || value.length > 0)
) {
this.setState({ value, isEmpty: false });
if (value !== undefined && value !== null && prevProps.value !== value) {
this.setState({
isEmpty: this.props.type !== 'number' && (value as string).length < 1,
value,
});
}
}

Expand Down Expand Up @@ -319,4 +324,4 @@ export default class Input extends Component<IInputProps, State> {
</div>
);
}
}
}
3 changes: 2 additions & 1 deletion src/atoms/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Event } from 'tools/types';
import './select.scss';

interface ISelectProps<T> {
className?: string;
disabled?: boolean;
isMandatory?: boolean;
label?: string;
Expand Down Expand Up @@ -88,7 +89,7 @@ export default class Select<T extends string | number> extends React.Component<

public render() {
return (
<div className="select">
<div className={`select ${this.props.className || ''}`}>
{this.props.label && (
<label>{`${this.props.label}${this.props.isMandatory ? ' *' : ''}`}</label>
)}
Expand Down
118 changes: 63 additions & 55 deletions src/atoms/Select/select.scss
Original file line number Diff line number Diff line change
@@ -1,67 +1,75 @@
.select {
position: relative;
user-select: none;
position: relative;
user-select: none;

&-clickable-view {
cursor: pointer;
padding: 7px 12px;
padding-right: 40px;
border: 1px solid var(--input-border-color);
border-radius: 2px;
box-sizing: border-box;
position: relative;
svg {
.internal-path {
fill: white;
}
}

&.with-dropdown {
border-radius: 2px 2px 0 0;
}
&-clickable-view {
cursor: pointer;
padding: 7px 12px;
padding-right: 40px;
border: 2px solid #f0f0f0;
border-top: 0px;
border-left: 0px;
border-right: 0px;
box-sizing: border-box;
position: relative;

&:focus {
outline-color: var(--main-color);
}
&.with-dropdown {
border-radius: 2px 2px 0 0;
}

.svg-icon {
position: absolute;
right: 8px;
margin: 0;
width: 16px;
height: 16px;
top: 6px;
}
}
&:focus {
outline-color: var(--main-color);
}

@keyframes selectDropdownAppear {
0% {
opacity: 0;
}
.svg-icon {
position: absolute;
right: 8px;
margin: 0;
width: 16px;
height: 16px;
top: 6px;
}
}

100% {
opacity: 1;
}
}
@keyframes selectDropdownAppear {
0% {
opacity: 0;
}

.select-dropdown {
position: absolute;
width: 100%;
border-radius: 0 0 2px 2px;
z-index: 10;
max-height: 0;
animation: selectDropdownAppear 0.25s ease-in-out forwards;
100% {
opacity: 1;
}
}

.option {
padding: 8px;
width: 100%;
box-sizing: border-box;
background-color: var(--select-option-background-color);
cursor: pointer;
transition: var(--t-fastest-ease-in-out);
.select-dropdown {
position: absolute;
width: 100%;
border-radius: 0 0 2px 2px;
z-index: 10;
max-height: 0;
animation: selectDropdownAppear 0.25s ease-in-out forwards;

&:hover {
background-color: var(--select-option-hover-background-color);
}
.option {
padding: 8px;
width: 100%;
box-sizing: border-box;
background-color: #2f2429;
cursor: pointer;
transition: all 1s ease;

&:last-child {
border-radius: 0 0 2px 2px;
}
}
}
&:hover {
background-color: #2f2429;
}

&:last-child {
border-radius: 0 0 2px 2px;
}
}
}
}
48 changes: 36 additions & 12 deletions src/atoms/TextArea/index.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
'use strict';

import React, { CSSProperties, Component } from 'react';
import React, { CSSProperties, Component, useRef } from 'react';

import { Event } from 'tools/types';

import './textarea.scss';

export interface ITextAreaProps {
className?: string;
label?: string;
focus?: boolean;
name: string;
placeholder?: string;
readOnly?: boolean;
rows?: number;
style?: CSSProperties;
value?: string;

textAreaRef?(e: HTMLTextAreaElement): void;
onChange?(e: Event): void;
onSelect?(e: Event<{ start: number; end: number }>): void;
}

export default (props: ITextAreaProps) => {
const { className, value, onChange, onSelect, textAreaRef, ...attributes } = props;
const {className, label, value, onChange, onSelect, ...attributes } = props;
let nameDiv;

const textAreaRef = useRef(null);

const onLabelClick = () => {
const textArea: any = textAreaRef.current;

if (textArea) {
textArea.focus();
}
};

if (label) {
nameDiv = (
<label onClick={onLabelClick} htmlFor={props.name}>
{`${label}`}
</label>
);
}

const internalOnChange = (e: React.SyntheticEvent<HTMLTextAreaElement>) => {
if (props.onChange) {
Expand All @@ -42,13 +62,17 @@ export default (props: ITextAreaProps) => {
};

return (
<textarea
ref={props.textAreaRef}
value={value || ''}
className={`textarea ${className}`}
onChange={internalOnChange}
onSelect={internalOnSelect}
{...attributes}
/>
<div
className={`input-component ${className || ''}`}>
{label && nameDiv}
<textarea
ref={textAreaRef}
value={value || ''}
className={`textarea ${className}`}
onChange={internalOnChange}
onSelect={internalOnSelect}
{...attributes}
/>
</div>
);
};
};
7 changes: 4 additions & 3 deletions src/atoms/TextArea/textarea.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.textarea {
border-radius: 8px;
border: none;
background-color: var(--input-background-color);
border: 1px solid var(--input-border-color);
color: var(--input-font-color);
color: white;
border-radius: 2px;
font-family: 'Roboto';
padding: 7px 12px;
box-sizing: border-box;
border: solid 2px #f0f0f0;
background-color: rgba(0, 0, 0, 0.5);

}
10 changes: 8 additions & 2 deletions src/components/LeftBar/LeftBar.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.left-bar-container {
display:flex;
.left-bar {
width: 399px;
height: 1945px;
width: 400px;
border-radius: 2px;
background-color: rgba(0, 0, 0, 0.15);
z-index: 3;
Expand Down Expand Up @@ -176,3 +176,9 @@
background-color: white;
}
}

@media (max-width:1025px) {
.left-bar-container {
display: none;
}
}
Loading