fix: toggle display filter drawer of financial statements.

This commit is contained in:
a.bouhuolia
2021-02-22 15:38:17 +02:00
parent 1e3b8df702
commit 2750d64fac
49 changed files with 716 additions and 1075 deletions

View File

@@ -25,11 +25,7 @@ const InputEditableCell = ({
return (
<FormGroup
intent={error ? Intent.DANGER : null}
className={classNames(
'form-group--select-list',
'form-group--account',
Classes.FILL,
)}
className={classNames(Classes.FILL)}
>
<InputGroup
value={value}

View File

@@ -0,0 +1,43 @@
import React, { useState, useEffect } from 'react';
import { FormGroup, NumericInput, Intent } from '@blueprintjs/core';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
/**
* Numeric input table cell.
*/
export default function NumericInputCell({
row: { index },
column: { id },
cell: { value: initialValue },
payload,
}) {
const [value, setValue] = useState(initialValue);
const handleValueChange = (newValue) => {
setValue(newValue);
};
const onBlur = () => {
payload.updateData(index, id, value);
};
useEffect(() => {
setValue(initialValue);
}, [initialValue]);
const error = payload.errors?.[index]?.[id];
return (
<FormGroup
intent={error ? Intent.DANGER : null}
className={classNames(CLASSES.FILL)}
>
<NumericInput
value={value}
onValueChange={handleValueChange}
onBlur={onBlur}
fill={true}
buttonPosition={"none"}
/>
</FormGroup>
);
}

View File

@@ -5,6 +5,7 @@ import ContactsListFieldCell from './ContactsListFieldCell';
import ItemsListCell from './ItemsListCell';
import PercentFieldCell from './PercentFieldCell';
import { DivFieldCell, EmptyDiv } from './DivFieldCell';
import NumericInputCell from './NumericInputCell';
export {
AccountsListFieldCell,
@@ -15,4 +16,5 @@ export {
PercentFieldCell,
DivFieldCell,
EmptyDiv,
NumericInputCell
};