imbric-theme 0.9.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/atoms/AlertModal/AlertModal.js +2 -2
- package/atoms/Checkbox/Checkbox.js +7 -1
- package/atoms/Input/Input.js +196 -79
- package/atoms/Input/Input.module.css +5 -0
- package/atoms/Picture/Picture.js +10 -4
- package/layout/DynamicTable/DynamicTable.js +144 -48
- package/layout/DynamicTable/DynamicTable.module.css +5 -18
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.js +5 -5
- package/molecules/ColumnTable/ColumnTable.js +4 -3
- package/molecules/ColumnTable/ColumnTable.module.css +1 -0
- package/molecules/DatePicker/DatePicker.js +10 -4
- package/molecules/DynamicSelect/DynamicSelect.js +126 -32
- package/molecules/DynamicSelect/DynamicSelect.module.css +1 -1
- package/molecules/RowTable/RowTable.js +613 -396
- package/package.json +3 -2
@@ -58,8 +58,8 @@ AlertModal.defaultProps = {
|
|
58
58
|
getStyles: () => { },
|
59
59
|
onConfirm: () => { },
|
60
60
|
// onDismiss: () => {}, // Not default for use onConfirm if is undefined
|
61
|
-
titleAlert: '
|
62
|
-
subTitleAlert: '
|
61
|
+
titleAlert: '',
|
62
|
+
subTitleAlert: '',
|
63
63
|
txtBtnAlert: 'Ok',
|
64
64
|
txtBtnAlertCancel: 'Cancelar',
|
65
65
|
iconAlert: 'success',
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { useState } from 'react'
|
1
|
+
import { useState, useEffect } from 'react'
|
2
2
|
import PropTypes from 'prop-types'
|
3
3
|
|
4
4
|
import styles from './Checkbox.module.css'
|
@@ -18,6 +18,12 @@ export const Checkbox = ({
|
|
18
18
|
}) => {
|
19
19
|
const [checked, setChecked] = useState(value)
|
20
20
|
|
21
|
+
useEffect(() => {
|
22
|
+
setChecked(value)
|
23
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
24
|
+
}, [value])
|
25
|
+
|
26
|
+
|
21
27
|
return (
|
22
28
|
<div className={getStyles('checkbox')}>
|
23
29
|
<input
|
package/atoms/Input/Input.js
CHANGED
@@ -21,6 +21,7 @@ export const Input = ({
|
|
21
21
|
isInlineCode,
|
22
22
|
isInputFilter,
|
23
23
|
isInputSecondary,
|
24
|
+
isDate,
|
24
25
|
onChange,
|
25
26
|
onFocus,
|
26
27
|
onBlur,
|
@@ -43,54 +44,51 @@ export const Input = ({
|
|
43
44
|
viewPass,
|
44
45
|
min,
|
45
46
|
autoFocus,
|
46
|
-
|
47
|
+
readonly,
|
48
|
+
accept,
|
49
|
+
isOpenModal,
|
50
|
+
onClickModal,
|
51
|
+
formikForm,
|
52
|
+
inputExtra,
|
53
|
+
}) => {
|
47
54
|
|
48
|
-
|
55
|
+
const onClickDeleteInput = (results, id) => {
|
56
|
+
console.log('hola')
|
57
|
+
console.log(id)
|
58
|
+
formikForm.values[id] = ''
|
59
|
+
formikForm.handleChange(id, '')
|
60
|
+
formikForm.setFieldValue(id, '')
|
49
61
|
|
50
|
-
{
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
<Icon
|
55
|
-
id={idIcon}
|
56
|
-
name={nameIcon}
|
57
|
-
size={sizeIcon}
|
58
|
-
color={colorIcon}
|
59
|
-
background={backgroundIcon}
|
60
|
-
/>
|
62
|
+
if (inputExtra) {
|
63
|
+
inputExtra([])
|
64
|
+
}
|
61
65
|
|
62
|
-
|
66
|
+
}
|
63
67
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
type={type}
|
72
|
-
id={id}
|
73
|
-
value={value}
|
74
|
-
placeholder={placeholder}
|
75
|
-
onChange={onChange}
|
76
|
-
onFocus={onFocus}
|
77
|
-
onBlur={onBlur}
|
78
|
-
onClick={onClick}
|
79
|
-
onKeyDown={onKeyDown}
|
80
|
-
onKeyUp={onKeyUp}
|
81
|
-
onInput={onInput}
|
82
|
-
autoComplete={autoComplete}
|
83
|
-
disabled={disabled}
|
84
|
-
min={min}
|
85
|
-
></input>
|
68
|
+
const pulsar = (e, id) => {
|
69
|
+
console.log('hola2')
|
70
|
+
if (e.keyCode === 13 && !e.shiftKey) {
|
71
|
+
e.preventDefault()
|
72
|
+
onClickModal(e, id)
|
73
|
+
}
|
74
|
+
}
|
86
75
|
|
87
|
-
|
76
|
+
return (
|
77
|
+
<>
|
88
78
|
|
89
|
-
|
79
|
+
{isViewIcon ?
|
90
80
|
|
81
|
+
<div className={getStyles('box-icon-input')}>
|
91
82
|
|
83
|
+
<Icon
|
84
|
+
id={idIcon}
|
85
|
+
name={nameIcon}
|
86
|
+
size={sizeIcon}
|
87
|
+
color={colorIcon}
|
88
|
+
background={backgroundIcon}
|
89
|
+
/>
|
92
90
|
|
93
|
-
|
91
|
+
<Horizontal size="xs" />
|
94
92
|
|
95
93
|
<input
|
96
94
|
className={getStyles('input', {
|
@@ -98,7 +96,9 @@ export const Input = ({
|
|
98
96
|
'is-inline-code': isInlineCode,
|
99
97
|
'is-input-filter': isInputFilter,
|
100
98
|
'is-input-secondary': isInputSecondary,
|
99
|
+
'is-date': isDate,
|
101
100
|
})}
|
101
|
+
readOnly={readonly}
|
102
102
|
type={type}
|
103
103
|
id={id}
|
104
104
|
value={value}
|
@@ -108,62 +108,169 @@ export const Input = ({
|
|
108
108
|
onBlur={onBlur}
|
109
109
|
onClick={onClick}
|
110
110
|
onKeyDown={onKeyDown}
|
111
|
+
onKeyUp={onKeyUp}
|
112
|
+
onInput={onInput}
|
111
113
|
autoComplete={autoComplete}
|
112
114
|
disabled={disabled}
|
113
115
|
min={min}
|
114
|
-
|
116
|
+
accept={accept}
|
115
117
|
></input>
|
116
118
|
|
117
|
-
|
119
|
+
</div> :
|
118
120
|
|
119
|
-
|
120
|
-
background={!viewPass ? "inverted" : "success"}
|
121
|
-
color={!viewPass ? "base" : "inverted"}
|
122
|
-
isClickable
|
123
|
-
name="userView"
|
124
|
-
onClick={onClickViewPass}
|
125
|
-
size="sm"
|
126
|
-
/>
|
121
|
+
type === 'password' ?
|
127
122
|
|
123
|
+
<div className={getStyles('box-icon-input')}>
|
128
124
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
autoFocus={autoFocus}
|
154
|
-
onInput={onInput}
|
155
|
-
></input>
|
125
|
+
<input
|
126
|
+
className={getStyles('input', {
|
127
|
+
'is-inline': isInline,
|
128
|
+
'is-inline-code': isInlineCode,
|
129
|
+
'is-input-filter': isInputFilter,
|
130
|
+
'is-input-secondary': isInputSecondary,
|
131
|
+
'is-date': isDate,
|
132
|
+
})}
|
133
|
+
readOnly={readonly}
|
134
|
+
type={type}
|
135
|
+
id={id}
|
136
|
+
value={value}
|
137
|
+
placeholder={placeholder}
|
138
|
+
onChange={onChange}
|
139
|
+
onFocus={onFocus}
|
140
|
+
onBlur={onBlur}
|
141
|
+
onClick={onClick}
|
142
|
+
onKeyDown={onKeyDown}
|
143
|
+
autoComplete={autoComplete}
|
144
|
+
disabled={disabled}
|
145
|
+
min={min}
|
146
|
+
onInput={onInput}
|
147
|
+
accept={accept}
|
148
|
+
></input>
|
156
149
|
|
157
|
-
|
150
|
+
<Horizontal size="xs" />
|
151
|
+
|
152
|
+
<Icon
|
153
|
+
background={!viewPass ? "inverted" : "success"}
|
154
|
+
color={!viewPass ? "base" : "inverted"}
|
155
|
+
isClickable
|
156
|
+
name="userView"
|
157
|
+
onClick={onClickViewPass}
|
158
|
+
size="sm"
|
159
|
+
/>
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
158
163
|
|
159
|
-
|
160
|
-
|
164
|
+
: isOpenModal
|
165
|
+
|
166
|
+
?
|
167
|
+
<div class="DynamicSelect_dynamic-select__oduOS">
|
168
|
+
<div class="css-1mfvq3n-container">
|
169
|
+
<div style={{ zIndex: 1 }} class="css-mlo5or-control">
|
170
|
+
<div onClick={(op) => onClickModal(op, id)} style={{ height: '36px' }} class="css-1huup54-ValueContainer">
|
171
|
+
<div class=" css-qc6sy-singleValue">{value}</div>
|
172
|
+
</div>
|
173
|
+
<div class=" css-1hb7zxy-IndicatorsContainer">
|
174
|
+
|
175
|
+
|
176
|
+
{value !== '' ? <div onClick={(op) => onClickDeleteInput(op, id)} class=" css-tlfecz-indicatorContainer" aria-hidden="true">
|
177
|
+
<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-tj5bde-Svg">
|
178
|
+
<path d="M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"></path>
|
179
|
+
</svg>
|
180
|
+
</div> : null}
|
181
|
+
<span class=" css-1okebmr-indicatorSeparator">
|
182
|
+
</span>
|
183
|
+
<div onClick={(op) => onClickModal(op, id)} class="css-tlfecz-indicatorContainer" aria-hidden="true">
|
184
|
+
<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-tj5bde-Svg">
|
185
|
+
<path
|
186
|
+
fillRule="evenodd"
|
187
|
+
clipRule="evenodd"
|
188
|
+
d="M10 20C4.48612 20 0 15.5139 0 10C0 4.48612 4.48612 0 10 0C15.5139 0 20 4.48612 20 10C20 15.5139 15.5139 20 10 20ZM10 1.09864C5.09155 1.09864 1.09864 5.09155 1.09864 10C1.09864 14.9084 5.09155 18.9014 10 18.9014C14.9084 18.9014 18.9014 14.9084 18.9014 10C18.9014 5.09155 14.9084 1.09864 10 1.09864Z"
|
189
|
+
/>
|
190
|
+
<path
|
191
|
+
fillRule="evenodd"
|
192
|
+
clipRule="evenodd"
|
193
|
+
d="M4.68396 9.4093H15.316V10.5906H4.68396V9.4093Z"
|
194
|
+
/>
|
195
|
+
<path
|
196
|
+
fillRule="evenodd"
|
197
|
+
clipRule="evenodd"
|
198
|
+
d="M9.40942 4.68396H10.5908V15.316H9.40942V4.68396Z"
|
199
|
+
/>
|
200
|
+
</svg>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
<input
|
205
|
+
inputmode="none"
|
206
|
+
style={{ top: '0px', position: 'absolute', zIndex: 0 }}
|
207
|
+
className={getStyles('input', {
|
208
|
+
'is-inline': isInline,
|
209
|
+
'is-inline-code': isInlineCode,
|
210
|
+
'is-input-filter': isInputFilter,
|
211
|
+
'is-input-secondary': isInputSecondary,
|
212
|
+
'is-date': isDate,
|
213
|
+
})}
|
214
|
+
readOnly={'true'}
|
215
|
+
// type={'hidden'}
|
216
|
+
id={id}
|
217
|
+
value={value}
|
218
|
+
placeholder={placeholder}
|
219
|
+
onChange={onChange}
|
220
|
+
onFocus={onFocus}
|
221
|
+
onBlur={onBlur}
|
222
|
+
onClick={onClick}
|
223
|
+
// onKeyDown={onKeyDown}
|
224
|
+
maxLength={maxLength}
|
225
|
+
autoComplete={autoComplete}
|
226
|
+
disabled={disabled}
|
227
|
+
min={min}
|
228
|
+
autoFocus={autoFocus}
|
229
|
+
onInput={onInput}
|
230
|
+
accept={accept}
|
231
|
+
onKeyDown={(op) => pulsar(op, id)}
|
232
|
+
></input>
|
233
|
+
</div>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
: <input
|
237
|
+
className={getStyles('input', {
|
238
|
+
'is-inline': isInline,
|
239
|
+
'is-inline-code': isInlineCode,
|
240
|
+
'is-input-filter': isInputFilter,
|
241
|
+
'is-input-secondary': isInputSecondary,
|
242
|
+
'is-date': isDate,
|
243
|
+
})}
|
244
|
+
readOnly={readonly}
|
245
|
+
type={type}
|
246
|
+
id={id}
|
247
|
+
value={value}
|
248
|
+
placeholder={placeholder}
|
249
|
+
onChange={onChange}
|
250
|
+
onFocus={onFocus}
|
251
|
+
onBlur={onBlur}
|
252
|
+
onClick={onClick}
|
253
|
+
onKeyDown={onKeyDown}
|
254
|
+
maxLength={maxLength}
|
255
|
+
autoComplete={autoComplete}
|
256
|
+
disabled={disabled}
|
257
|
+
min={min}
|
258
|
+
autoFocus={autoFocus}
|
259
|
+
onInput={onInput}
|
260
|
+
accept={accept}
|
261
|
+
></input>
|
262
|
+
}
|
263
|
+
|
264
|
+
</>
|
265
|
+
)
|
266
|
+
}
|
161
267
|
|
162
268
|
Input.propTypes = {
|
163
269
|
onChange: PropTypes.func.isRequired,
|
164
270
|
onFocus: PropTypes.func,
|
165
271
|
onBlur: PropTypes.func,
|
166
272
|
onClick: PropTypes.func,
|
273
|
+
onClickModal: PropTypes.func,
|
167
274
|
onKeyDown: PropTypes.func,
|
168
275
|
onKeyUp: PropTypes.func,
|
169
276
|
onInput: PropTypes.func,
|
@@ -177,6 +284,7 @@ Input.propTypes = {
|
|
177
284
|
isInlineCode: PropTypes.bool,
|
178
285
|
isInputFilter: PropTypes.bool,
|
179
286
|
isInputSecondary: PropTypes.bool,
|
287
|
+
isDate: PropTypes.bool,
|
180
288
|
isViewIcon: PropTypes.bool,
|
181
289
|
idIcon: PropTypes.string,
|
182
290
|
nameIcon: PropTypes.string,
|
@@ -185,10 +293,14 @@ Input.propTypes = {
|
|
185
293
|
backgroundIcon: PropTypes.string,
|
186
294
|
autoComplete: PropTypes.string,
|
187
295
|
disabled: PropTypes.bool,
|
296
|
+
readonly: PropTypes.bool,
|
188
297
|
min: PropTypes.any,
|
189
298
|
autoFocus: PropTypes.any,
|
190
299
|
onClickViewPass: PropTypes.func,
|
191
300
|
viewPass: PropTypes.bool,
|
301
|
+
accept: PropTypes.string,
|
302
|
+
isOpenModal: PropTypes.bool,
|
303
|
+
formikForm: PropTypes.any,
|
192
304
|
}
|
193
305
|
|
194
306
|
Input.defaultProps = {
|
@@ -200,10 +312,12 @@ Input.defaultProps = {
|
|
200
312
|
isInlineCode: false,
|
201
313
|
isInputFilter: false,
|
202
314
|
isInputSecondary: false,
|
315
|
+
isDate: false,
|
203
316
|
onChange: () => { },
|
204
317
|
onFocus: () => { },
|
205
318
|
onBlur: () => { },
|
206
319
|
onClick: () => { },
|
320
|
+
onClickModal: () => { },
|
207
321
|
onKeyDown: () => { },
|
208
322
|
onKeyUp: () => { },
|
209
323
|
onInput: () => { },
|
@@ -216,8 +330,11 @@ Input.defaultProps = {
|
|
216
330
|
backgroundIcon: 'base',
|
217
331
|
autoComplete: 'on',
|
218
332
|
disabled: false,
|
333
|
+
readonly: false,
|
219
334
|
onClickViewPass: () => { },
|
220
335
|
viewPass: false,
|
336
|
+
accept: '',
|
337
|
+
isOpenModal: false,
|
221
338
|
}
|
222
339
|
|
223
340
|
export default withStyles(styles)(Input)
|
package/atoms/Picture/Picture.js
CHANGED
@@ -13,6 +13,7 @@ export const Picture = ({
|
|
13
13
|
isRounded,
|
14
14
|
withBorder,
|
15
15
|
isHref,
|
16
|
+
targetLink,
|
16
17
|
}) => (
|
17
18
|
<picture
|
18
19
|
className={getStyles('picture', {
|
@@ -20,8 +21,11 @@ export const Picture = ({
|
|
20
21
|
'with-border': withBorder,
|
21
22
|
})}
|
22
23
|
>
|
23
|
-
<Link href={isHref} passHref>
|
24
|
-
<
|
24
|
+
<Link href={isHref} passHref >
|
25
|
+
<a target={targetLink}>
|
26
|
+
<img src={src} style={{ height, maxWidth: width }} />
|
27
|
+
</a>
|
28
|
+
|
25
29
|
</Link>
|
26
30
|
|
27
31
|
</picture>
|
@@ -34,14 +38,16 @@ Picture.propTypes = {
|
|
34
38
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
35
39
|
isRounded: PropTypes.bool,
|
36
40
|
withBorder: PropTypes.bool,
|
37
|
-
isHref: PropTypes.any
|
41
|
+
isHref: PropTypes.any,
|
42
|
+
targetLink: PropTypes.string
|
38
43
|
}
|
39
44
|
|
40
45
|
Picture.defaultProps = {
|
41
46
|
height: 'auto',
|
42
47
|
withBorder: false,
|
43
48
|
getStyles: () => { },
|
44
|
-
isHref: ''
|
49
|
+
isHref: '',
|
50
|
+
targetLink: ''
|
45
51
|
}
|
46
52
|
|
47
53
|
export default withStyles(styles)(Picture)
|