imbric-theme 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atoms/Modal/Modal.js +9 -1
- package/atoms/Modal/Modal.module.css +6 -6
- package/layout/DynamicTable/DynamicTable.js +1 -1
- package/molecules/ColumnTable/ColumnTable.js +17 -15
- package/molecules/RowTable/RowTable.js +38 -18
- package/molecules/RowTable/constants.js +13 -0
- package/package.json +1 -1
package/atoms/Modal/Modal.js
CHANGED
@@ -8,7 +8,9 @@ import Icon from '../Icon'
|
|
8
8
|
import Container from '../../layout/Container'
|
9
9
|
import isEmpty from '../../utils/isEmpty'
|
10
10
|
|
11
|
+
|
11
12
|
import useMedia from '../../hook/useMedia'
|
13
|
+
import Heading from '../Heading'
|
12
14
|
|
13
15
|
// Sync with ./Modal.module.css#L13-L17
|
14
16
|
const FADE_OUT_ANIMATION_TIME = 400
|
@@ -33,6 +35,7 @@ export const Modal = ({
|
|
33
35
|
getStyles,
|
34
36
|
type,
|
35
37
|
isPlayground,
|
38
|
+
titleModal,
|
36
39
|
}) => {
|
37
40
|
const isDesktop = useMedia(['(min-width: 992px)'], [true])
|
38
41
|
const [onFadeOut, setOnFadeOut] = useState(false)
|
@@ -54,7 +57,7 @@ export const Modal = ({
|
|
54
57
|
<div className={getStyles('heading')}>
|
55
58
|
{!!onClose && (
|
56
59
|
<Icon
|
57
|
-
color={isDesktop && type === 'secondary' ? 'primary' : '
|
60
|
+
color={isDesktop && type === 'secondary' ? 'primary' : 'primary'}
|
58
61
|
name={isDesktop ? 'cross' : 'angleLeft'}
|
59
62
|
background={isDesktop ? 'transparent' : 'muted'}
|
60
63
|
onClick={handleClose}
|
@@ -71,6 +74,9 @@ export const Modal = ({
|
|
71
74
|
})}
|
72
75
|
/>
|
73
76
|
)}
|
77
|
+
<Heading color='black' size='lg' weight='light'>
|
78
|
+
{titleModal}
|
79
|
+
</Heading>
|
74
80
|
</div>
|
75
81
|
<Container>{children}</Container>
|
76
82
|
</div>
|
@@ -88,11 +94,13 @@ Modal.propTypes = {
|
|
88
94
|
}),
|
89
95
|
type: PropTypes.oneOf(options.types),
|
90
96
|
isPlayground: PropTypes.bool,
|
97
|
+
titleModal: PropTypes.string,
|
91
98
|
}
|
92
99
|
|
93
100
|
Modal.defaultProps = {
|
94
101
|
getStyles: () => {},
|
95
102
|
type: 'primary',
|
103
|
+
titleModal: 'Ejemplo titulo'
|
96
104
|
}
|
97
105
|
|
98
106
|
export default withStyles(styles)(Modal)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
display: flex;
|
5
5
|
align-items: center;
|
6
6
|
justify-content: center;
|
7
|
-
background:
|
7
|
+
background: rgb(0 0 0 / 50%);
|
8
8
|
inset: 0;
|
9
9
|
}
|
10
10
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
padding: 16px 32px;
|
25
25
|
}
|
26
26
|
|
27
|
-
:not(.is-playground)
|
27
|
+
:not(.is-playground)>.modal {
|
28
28
|
animation: fadeInModal 0.4s ease-in forwards;
|
29
29
|
opacity: 0;
|
30
30
|
}
|
@@ -45,7 +45,7 @@
|
|
45
45
|
}
|
46
46
|
|
47
47
|
.type-primary {
|
48
|
-
background-color: var(--color-primary);
|
48
|
+
background-color: var(--color-primary-inverted);
|
49
49
|
}
|
50
50
|
|
51
51
|
.type-secondary {
|
@@ -54,8 +54,8 @@
|
|
54
54
|
|
55
55
|
@media (min-width: 992px) {
|
56
56
|
.modal {
|
57
|
-
max-width:
|
58
|
-
height:
|
57
|
+
max-width: 465px;
|
58
|
+
height: auto;
|
59
59
|
border-radius: var(--border-radius-sm);
|
60
60
|
}
|
61
61
|
|
@@ -82,4 +82,4 @@
|
|
82
82
|
to {
|
83
83
|
opacity: 0;
|
84
84
|
}
|
85
|
-
}
|
85
|
+
}
|
@@ -61,24 +61,26 @@ export const ColumnTable = ({ getStyles, handleSorting, columnUppercase, onChang
|
|
61
61
|
|
62
62
|
<Horizontal size="xs" />
|
63
63
|
|
64
|
-
{
|
65
|
-
<Icon
|
66
|
-
name="angleUpDown"
|
67
|
-
size="xs"
|
68
|
-
/>
|
69
|
-
: cl === "" ? null
|
70
|
-
|
71
|
-
: cl === "angleDown"
|
72
|
-
? <Icon
|
73
|
-
name="angleDown"
|
74
|
-
size="xs"
|
75
|
-
/>
|
64
|
+
{item.sortable ?
|
76
65
|
|
77
|
-
|
78
|
-
|
66
|
+
cl === "default" ?
|
67
|
+
<Icon
|
68
|
+
name="angleUpDown"
|
79
69
|
size="xs"
|
80
70
|
/>
|
81
|
-
|
71
|
+
: cl === "" ? null
|
72
|
+
|
73
|
+
: cl === "angleDown"
|
74
|
+
? <Icon
|
75
|
+
name="angleDown"
|
76
|
+
size="xs"
|
77
|
+
/>
|
78
|
+
|
79
|
+
: <Icon
|
80
|
+
name="angleUp"
|
81
|
+
size="xs"
|
82
|
+
/>
|
83
|
+
: null
|
82
84
|
}
|
83
85
|
</span>
|
84
86
|
|
@@ -6,6 +6,8 @@ import { options } from './constants'
|
|
6
6
|
import withStyles from '../../hocs/withStyles'
|
7
7
|
|
8
8
|
import Moment from 'react-moment'
|
9
|
+
import Icon from '../../atoms/Icon'
|
10
|
+
import { Horizontal, Vertical } from '../../layout/Spacer/components'
|
9
11
|
|
10
12
|
export const RowTable = ({ getStyles, slice, columnsData }) => {
|
11
13
|
return (
|
@@ -17,33 +19,51 @@ export const RowTable = ({ getStyles, slice, columnsData }) => {
|
|
17
19
|
<tr key={index}>
|
18
20
|
{columnsData.map((itemTd) => (
|
19
21
|
itemTd.activeView ?
|
20
|
-
|
21
22
|
(
|
22
|
-
itemTd.subAccessor !== '' ?
|
23
23
|
|
24
|
-
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor][itemTd.subAccessor]}</td> :
|
25
24
|
|
26
|
-
|
25
|
+
itemTd.subAccessor === 'action' ?
|
26
|
+
|
27
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>
|
28
|
+
|
29
|
+
<Icon
|
30
|
+
background="base"
|
31
|
+
name="settings"
|
32
|
+
onClick={function noRefCheck() { }}
|
33
|
+
/>
|
34
|
+
<Horizontal size="xs" />
|
35
|
+
<Icon
|
36
|
+
background="base"
|
37
|
+
name="trash"
|
38
|
+
onClick={function noRefCheck() { }}
|
39
|
+
/>
|
40
|
+
</td> :
|
41
|
+
|
42
|
+
itemTd.subAccessor !== '' ?
|
43
|
+
|
44
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor][itemTd.subAccessor]}</td> :
|
45
|
+
|
46
|
+
itemTd.typeFilter === 'date' ?
|
27
47
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
48
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>
|
49
|
+
<Moment format="DD/MM/YYYY hh:mm:ss">
|
50
|
+
{item[itemTd.accessor]}
|
51
|
+
</Moment>
|
52
|
+
</td>
|
33
53
|
|
34
|
-
|
54
|
+
: itemTd.typeFilter === 'number' ?
|
35
55
|
|
36
|
-
|
56
|
+
itemTd.subTypeFilter ?
|
37
57
|
|
38
|
-
|
39
|
-
|
40
|
-
|
58
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} €</td>
|
59
|
+
:
|
60
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
|
41
61
|
|
42
|
-
|
62
|
+
: itemTd.subTypeFilter ?
|
43
63
|
|
44
|
-
|
45
|
-
|
46
|
-
|
64
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor].toString().replace(/\./g, ',').slice(0, 5)} €</td>
|
65
|
+
:
|
66
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
|
47
67
|
|
48
68
|
) : null
|
49
69
|
))}
|
@@ -300,6 +300,19 @@ export const options = {
|
|
300
300
|
nameInput: 'ID Proveedor',
|
301
301
|
placeholder: 'ID Proveedor'
|
302
302
|
},
|
303
|
+
{
|
304
|
+
accessor: 'action',
|
305
|
+
subAccessor: 'action',
|
306
|
+
activeView: true,
|
307
|
+
idInput: 'action',
|
308
|
+
nameInput: 'Acciones',
|
309
|
+
placeholder: 'Acciones',
|
310
|
+
sortable: false,
|
311
|
+
subTypeFilter: false,
|
312
|
+
title: '',
|
313
|
+
typeFilter: 'text',
|
314
|
+
viewIsFilter: false,
|
315
|
+
},
|
303
316
|
],
|
304
317
|
|
305
318
|
}
|