imbric-theme 0.7.1 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- package/atoms/Modal/Modal.js +18 -9
- package/atoms/Modal/Modal.module.css +21 -0
- package/layout/DynamicTable/DynamicTable.js +16 -11
- package/layout/DynamicTable/DynamicTable.module.css +4 -0
- package/layout/Navbar/Navbar.module.css +1 -1
- package/molecules/ColumnTable/ColumnTable.js +1 -0
- package/molecules/ColumnTable/ColumnTable.module.css +3 -0
- package/molecules/DynamicSelect/DynamicSelect.js +58 -4
- package/molecules/RowTable/RowTable.js +15 -5
- package/package.json +1 -1
package/atoms/Modal/Modal.js
CHANGED
@@ -37,6 +37,7 @@ export const Modal = ({
|
|
37
37
|
isPlayground,
|
38
38
|
titleModal,
|
39
39
|
isFullWidth,
|
40
|
+
isFullWidthSoft,
|
40
41
|
}) => {
|
41
42
|
const isDesktop = useMedia(['(min-width: 992px)'], [true])
|
42
43
|
const [onFadeOut, setOnFadeOut] = useState(false)
|
@@ -52,13 +53,13 @@ export const Modal = ({
|
|
52
53
|
onClick={handleClose}
|
53
54
|
>
|
54
55
|
<div
|
55
|
-
className={getStyles(isFullWidth ? 'modal-full' : 'modal', ['type'])}
|
56
|
+
className={getStyles(isFullWidth ? 'modal-full' : isFullWidthSoft ? 'modal-full-soft' : 'modal', ['type'])}
|
56
57
|
onClick={createHandlerClick()}
|
57
58
|
>
|
58
59
|
<div className={getStyles('heading')}>
|
59
60
|
{!!onClose && (
|
60
61
|
<Icon
|
61
|
-
|
62
|
+
id='btnColsedModal'
|
62
63
|
color={isDesktop && type === 'secondary' ? 'primary' : 'primary'}
|
63
64
|
name={isDesktop ? 'cross' : 'angleLeft'}
|
64
65
|
background={isDesktop ? 'transparent' : 'muted'}
|
@@ -76,13 +77,19 @@ export const Modal = ({
|
|
76
77
|
})}
|
77
78
|
/>
|
78
79
|
)}
|
79
|
-
|
80
|
-
|
81
|
-
|
80
|
+
<Heading color='black' size='lg' weight='light'>
|
81
|
+
{titleModal}
|
82
|
+
</Heading>
|
82
83
|
</div>
|
83
84
|
|
84
|
-
{isFullWidth ?
|
85
|
-
|
85
|
+
{isFullWidth ?
|
86
|
+
<div className={getStyles('container-full')}>{children}</div>
|
87
|
+
:
|
88
|
+
isFullWidthSoft ? <div className={getStyles('container-full-soft')}>{children}</div>
|
89
|
+
:
|
90
|
+
<Container><div className={getStyles('container')}>{children}</div></Container>
|
91
|
+
}
|
92
|
+
|
86
93
|
</div>
|
87
94
|
</div>
|
88
95
|
)
|
@@ -99,14 +106,16 @@ Modal.propTypes = {
|
|
99
106
|
type: PropTypes.oneOf(options.types),
|
100
107
|
isPlayground: PropTypes.bool,
|
101
108
|
isFullWidth: PropTypes.bool,
|
109
|
+
isFullWidthSoft: PropTypes.bool,
|
102
110
|
titleModal: PropTypes.string,
|
103
111
|
}
|
104
112
|
|
105
113
|
Modal.defaultProps = {
|
106
|
-
getStyles: () => {},
|
114
|
+
getStyles: () => { },
|
107
115
|
type: 'primary',
|
108
116
|
titleModal: 'Ejemplo titulo',
|
109
|
-
isFullWidth: false
|
117
|
+
isFullWidth: false,
|
118
|
+
isFullWidthSoft: false
|
110
119
|
}
|
111
120
|
|
112
121
|
export default withStyles(styles)(Modal)
|
@@ -32,6 +32,14 @@
|
|
32
32
|
padding: 16px 32px;
|
33
33
|
}
|
34
34
|
|
35
|
+
.modal-full-soft {
|
36
|
+
display: flex;
|
37
|
+
width: 100%;
|
38
|
+
height: 100%;
|
39
|
+
flex-direction: column;
|
40
|
+
padding: 16px 32px;
|
41
|
+
}
|
42
|
+
|
35
43
|
:not(.is-playground)>.modal {
|
36
44
|
animation: fadeInModal 0.4s ease-in forwards;
|
37
45
|
opacity: 0;
|
@@ -84,6 +92,12 @@
|
|
84
92
|
padding: 16px 32px;
|
85
93
|
}
|
86
94
|
|
95
|
+
.modal-full-soft {
|
96
|
+
width: 90%;
|
97
|
+
height: auto;
|
98
|
+
border-radius: var(--border-radius-sm);
|
99
|
+
}
|
100
|
+
|
87
101
|
.heading {
|
88
102
|
flex-direction: row-reverse;
|
89
103
|
}
|
@@ -98,6 +112,13 @@
|
|
98
112
|
overflow: auto;
|
99
113
|
min-width: 100%;
|
100
114
|
}
|
115
|
+
|
116
|
+
.container-full-soft {
|
117
|
+
max-height: 600px;
|
118
|
+
overflow: auto;
|
119
|
+
min-width: 100%;
|
120
|
+
}
|
121
|
+
|
101
122
|
}
|
102
123
|
|
103
124
|
@keyframes fadeInModal {
|
@@ -101,6 +101,7 @@ export const DynamicTable = ({
|
|
101
101
|
optionsSelect={addColumsData}
|
102
102
|
placeholder={placeholderDinamicSelect}
|
103
103
|
defaultValue={handleDefaultValue}
|
104
|
+
closeMenuOnSelect={false}
|
104
105
|
// defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
|
105
106
|
/> : null
|
106
107
|
}
|
@@ -108,22 +109,26 @@ export const DynamicTable = ({
|
|
108
109
|
</div>
|
109
110
|
) : null}
|
110
111
|
|
111
|
-
|
112
|
+
|
112
113
|
|
113
114
|
{isViewBtn ? (
|
114
|
-
<div className={getStyles('opFunctionBox3')}>
|
115
115
|
|
116
|
-
|
117
|
-
type={typeBtn}
|
118
|
-
isInline={true}
|
119
|
-
onClick={handleBtn}
|
120
|
-
>
|
121
|
-
{titleBtn}
|
122
|
-
</Button>
|
116
|
+
<>
|
123
117
|
|
124
|
-
<
|
118
|
+
<div className={getStyles('opFunctionBox3')}>
|
125
119
|
|
126
|
-
|
120
|
+
<Button
|
121
|
+
type={typeBtn}
|
122
|
+
isInline={true}
|
123
|
+
onClick={handleBtn}
|
124
|
+
>
|
125
|
+
{titleBtn}
|
126
|
+
</Button>
|
127
|
+
|
128
|
+
<Horizontal size="md" />
|
129
|
+
|
130
|
+
</div>
|
131
|
+
</>
|
127
132
|
) : null}
|
128
133
|
|
129
134
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
/* .is-playground {
|
3
2
|
border: var(--border-width-thick) dashed var(--color-primary);
|
4
3
|
} */
|
@@ -13,6 +12,7 @@
|
|
13
12
|
box-shadow: 0px 1px 4px rgb(100 116 139 / 12%);
|
14
13
|
width: calc(100%);
|
15
14
|
padding-left: 18px;
|
15
|
+
padding-right: 14px;
|
16
16
|
min-height: 51px;
|
17
17
|
background-color: #f2fcfc;
|
18
18
|
}
|
@@ -5,7 +5,25 @@ import styles from './DynamicSelect.module.css'
|
|
5
5
|
import withStyles from '../../hocs/withStyles'
|
6
6
|
|
7
7
|
|
8
|
-
export const DynamicSelect = ({
|
8
|
+
export const DynamicSelect = ({
|
9
|
+
getStyles,
|
10
|
+
optionsSelect,
|
11
|
+
value,
|
12
|
+
defaultValue,
|
13
|
+
placeholder,
|
14
|
+
isMulti,
|
15
|
+
isClearable,
|
16
|
+
isDisabled,
|
17
|
+
isLoading,
|
18
|
+
isRtl,
|
19
|
+
isSearchable,
|
20
|
+
isInline,
|
21
|
+
onChange,
|
22
|
+
onFocus,
|
23
|
+
onBlur,
|
24
|
+
closeMenuOnSelect,
|
25
|
+
maxMenuHeight
|
26
|
+
}) => {
|
9
27
|
|
10
28
|
|
11
29
|
const customStyles = {
|
@@ -13,7 +31,9 @@ export const DynamicSelect = ({ getStyles, optionsSelect, value, defaultValue, p
|
|
13
31
|
option: (base, state) => ({
|
14
32
|
...base,
|
15
33
|
cursor: 'pointer',
|
16
|
-
|
34
|
+
width: "max-content",
|
35
|
+
minWidth: "100%",
|
36
|
+
position: 'relative',
|
17
37
|
backgroundColor: state.isSelected ? 'var(--color-primary)' : 'transparent',
|
18
38
|
"&:hover": {
|
19
39
|
backgroundColor: "var(--color-primary-highlight)",
|
@@ -52,6 +72,36 @@ export const DynamicSelect = ({ getStyles, optionsSelect, value, defaultValue, p
|
|
52
72
|
textOverflow: 'ellipsis',
|
53
73
|
}),
|
54
74
|
|
75
|
+
valueContainer: (base, state) => ({
|
76
|
+
...base,
|
77
|
+
textOverflow: "ellipsis",
|
78
|
+
whiteSpace: "nowrap",
|
79
|
+
overflow: "hidden",
|
80
|
+
// display: "inline-grid"
|
81
|
+
maxHeight: "38px",
|
82
|
+
}),
|
83
|
+
|
84
|
+
container: (base) => ({
|
85
|
+
...base,
|
86
|
+
width: "max-content",
|
87
|
+
minWidth: "100%",
|
88
|
+
}),
|
89
|
+
|
90
|
+
menu: (base) => ({
|
91
|
+
...base,
|
92
|
+
width: "max-content",
|
93
|
+
minWidth: "100%",
|
94
|
+
}),
|
95
|
+
|
96
|
+
// menu: styles => ({ ...styles,
|
97
|
+
// width: '500px'
|
98
|
+
// })
|
99
|
+
|
100
|
+
// indicatorsContainer: (provided, state) => ({
|
101
|
+
// ...provided,
|
102
|
+
// height: '50px',
|
103
|
+
// }),
|
104
|
+
|
55
105
|
}
|
56
106
|
|
57
107
|
// const handleChange = (value) => {
|
@@ -85,6 +135,8 @@ export const DynamicSelect = ({ getStyles, optionsSelect, value, defaultValue, p
|
|
85
135
|
onFocus={onFocus}
|
86
136
|
onBlur={onBlur}
|
87
137
|
closeMenuOnSelect={closeMenuOnSelect}
|
138
|
+
maxMenuHeight={maxMenuHeight}
|
139
|
+
autosize={true}
|
88
140
|
/>
|
89
141
|
</div>
|
90
142
|
|
@@ -106,7 +158,8 @@ DynamicSelect.propTypes = {
|
|
106
158
|
onChange: PropTypes.func,
|
107
159
|
onFocus: PropTypes.func,
|
108
160
|
onBlur: PropTypes.func,
|
109
|
-
closeMenuOnSelect: PropTypes.bool
|
161
|
+
closeMenuOnSelect: PropTypes.bool,
|
162
|
+
maxMenuHeight: PropTypes.number
|
110
163
|
}
|
111
164
|
|
112
165
|
DynamicSelect.defaultProps = {
|
@@ -122,7 +175,8 @@ DynamicSelect.defaultProps = {
|
|
122
175
|
onChange: () => { },
|
123
176
|
onFocus: () => { },
|
124
177
|
onBlur: () => { },
|
125
|
-
closeMenuOnSelect: true
|
178
|
+
closeMenuOnSelect: true,
|
179
|
+
maxMenuHeight: 300
|
126
180
|
}
|
127
181
|
|
128
182
|
export default withStyles(styles)(DynamicSelect)
|
@@ -679,12 +679,22 @@ export const RowTable = ({
|
|
679
679
|
|
680
680
|
?
|
681
681
|
|
682
|
-
|
683
|
-
<Moment format="DD/MM/YYYY hh:mm:ss">
|
684
|
-
{item[itemTd.accessor]}
|
685
|
-
</Moment>
|
686
|
-
</td>
|
682
|
+
itemTd.typeFilterSub === 'date_only' ?
|
687
683
|
|
684
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
|
685
|
+
<Moment format="DD/MM/YYYY">
|
686
|
+
{item[itemTd.accessor]}
|
687
|
+
</Moment>
|
688
|
+
</td>
|
689
|
+
|
690
|
+
:
|
691
|
+
|
692
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
|
693
|
+
{/* <Moment format="DD/MM/YYYY hh:mm:ss"> */}
|
694
|
+
<Moment format="DD/MM/YYYY HH:mm">
|
695
|
+
{item[itemTd.accessor]}
|
696
|
+
</Moment>
|
697
|
+
</td>
|
688
698
|
:
|
689
699
|
|
690
700
|
itemTd.typeFilter === 'select'
|