imbric-theme 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/atoms/Icon/Icon.module.css +30 -0
- package/atoms/Icon/constants.js +93 -14
- package/atoms/Input/Input.js +104 -16
- package/atoms/Input/Input.module.css +18 -0
- package/atoms/Modal/Modal.js +8 -3
- package/atoms/Modal/Modal.module.css +28 -0
- package/index.js +1 -0
- package/molecules/CardDefault/CardDefault.js +64 -0
- package/molecules/CardDefault/CardDefault.module.css +18 -0
- package/molecules/CardDefault/CardDefault.stories.js +23 -0
- package/molecules/CardDefault/constants.js +1 -0
- package/molecules/CardDefault/index.js +3 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.js +39 -12
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.module.css +59 -21
- package/molecules/CardServices/CardServices.js +4 -1
- package/molecules/DynamicSelect/DynamicSelect.js +8 -2
- package/molecules/InputAutocomplete/InputAutocomplete.js +265 -0
- package/molecules/InputAutocomplete/InputAutocomplete.module.css +55 -0
- package/molecules/InputAutocomplete/InputAutocomplete.stories.js +23 -0
- package/molecules/InputAutocomplete/constants.js +1 -0
- package/molecules/InputAutocomplete/index.js +3 -0
- package/molecules/RowTable/RowTable.js +207 -64
- package/molecules/RowTable/RowTable.module.css +11 -0
- package/molecules/RowTable/constants.js +39 -0
- package/package.json +3 -1
- package/public/static/images/csv-svgrepo-com (1).svg +16 -0
- package/public/static/images/csv-svgrepo-com.svg +45 -0
- package/public/static/images/list-svgrepo-com.svg +19 -0
- package/public/static/images/pdf-svgrepo-com.svg +17 -0
- package/public/static/images/xls-svgrepo-com (1).svg +17 -0
- package/public/static/images/xls-svgrepo-com.svg +24 -0
- package/public/static/images/user-svgrepo-com (1).svg +0 -27
- package/public/static/images/user-svgrepo-com (2).svg +0 -24
- package/public/static/images/user-svgrepo-com (3).svg +0 -24
- package/public/static/images/user-svgrepo-com.svg +0 -31
@@ -7,19 +7,30 @@ import withStyles from '../../hocs/withStyles'
|
|
7
7
|
import Picture from '../../atoms/Picture'
|
8
8
|
import { Horizontal, Vertical } from '../../layout/Spacer/components'
|
9
9
|
|
10
|
-
export const CardProductTypesBooking = ({
|
11
|
-
|
10
|
+
export const CardProductTypesBooking = ({
|
11
|
+
srcImg,
|
12
|
+
onClick,
|
13
|
+
textNotification,
|
14
|
+
textProductTypes,
|
15
|
+
textEtaProductTypesSub,
|
16
|
+
textDescription,
|
17
|
+
priceProductTypes,
|
18
|
+
priceProductTypesSub,
|
19
|
+
selectCard,
|
20
|
+
getStyles
|
21
|
+
}) => {
|
22
|
+
return <div className={getStyles('card-product-types-booking', {'selectCard': selectCard})} onClick={onClick}>
|
12
23
|
|
13
24
|
<div className={getStyles('labelNotification')}>
|
14
|
-
|
25
|
+
{textNotification}
|
15
26
|
</div>
|
16
27
|
|
17
28
|
<div className={getStyles('card-product-content')}>
|
18
29
|
|
19
|
-
<div>
|
30
|
+
<div className={getStyles('card-product-img')}>
|
20
31
|
<Picture
|
21
32
|
src={srcImg}
|
22
|
-
width={
|
33
|
+
width={70}
|
23
34
|
// height={100}
|
24
35
|
/>
|
25
36
|
</div>
|
@@ -27,16 +38,16 @@ export const CardProductTypesBooking = ({ srcImg, getStyles }) => {
|
|
27
38
|
<Horizontal size="sm" />
|
28
39
|
|
29
40
|
<div>
|
30
|
-
<div className={getStyles('titleCardProductTypes')}>
|
31
|
-
<div className={getStyles('etaCardProductTypesSub')}>
|
32
|
-
<div className={getStyles('titleCardProductTypesSub')}>
|
41
|
+
<div className={getStyles('titleCardProductTypes')}>{textProductTypes}</div>
|
42
|
+
<div className={getStyles('etaCardProductTypesSub')}>{textEtaProductTypesSub}</div>
|
43
|
+
<div className={getStyles('titleCardProductTypesSub')}>{textDescription}</div>
|
33
44
|
</div>
|
34
45
|
|
35
46
|
<Horizontal size="sm" />
|
36
47
|
|
37
48
|
<div class={getStyles('contentPrice')}>
|
38
|
-
<div class={getStyles('priceCardProductTypes')}>
|
39
|
-
<div class={getStyles('priceCardProductTypesSub')}>
|
49
|
+
<div class={getStyles('priceCardProductTypes')}>{priceProductTypes}</div>
|
50
|
+
<div class={getStyles('priceCardProductTypesSub')}>{priceProductTypesSub}</div>
|
40
51
|
</div>
|
41
52
|
|
42
53
|
</div>
|
@@ -45,13 +56,29 @@ export const CardProductTypesBooking = ({ srcImg, getStyles }) => {
|
|
45
56
|
}
|
46
57
|
|
47
58
|
CardProductTypesBooking.propTypes = {
|
48
|
-
|
59
|
+
onClick: PropTypes.func,
|
60
|
+
srcImg: PropTypes.string,
|
61
|
+
textNotification: PropTypes.string,
|
62
|
+
textProductTypes: PropTypes.string,
|
63
|
+
textEtaProductTypesSub: PropTypes.string,
|
64
|
+
textDescription: PropTypes.string,
|
65
|
+
priceProductTypes: PropTypes.string,
|
66
|
+
priceProductTypesSub: PropTypes.string,
|
67
|
+
selectCard: PropTypes.bool,
|
49
68
|
getStyles: PropTypes.func.isRequired,
|
50
|
-
|
69
|
+
|
51
70
|
}
|
52
71
|
|
53
72
|
CardProductTypesBooking.defaultProps = {
|
54
73
|
getStyles: () => { },
|
74
|
+
onClick: () => { },
|
75
|
+
textNotification: 'Reserve 2 h antes de la salida de su vuelo si es nacional, 3 h antes si es internacional.',
|
76
|
+
textProductTypes: 'ECO (Tarifa máxima)',
|
77
|
+
textEtaProductTypesSub: '4 - 8 min.',
|
78
|
+
textDescription: 'Envío urgente de sobres y paquetes pequeños con taxi.',
|
79
|
+
priceProductTypes: '30€ - 30€',
|
80
|
+
priceProductTypesSub: 'Máx.',
|
81
|
+
selectCard: 'false'
|
55
82
|
}
|
56
83
|
|
57
84
|
export default withStyles(styles)(CardProductTypesBooking)
|
@@ -9,35 +9,40 @@
|
|
9
9
|
transition: box-shadow .28s cubic-bezier(.4, 0, .2, 1);
|
10
10
|
background-color: #fff;
|
11
11
|
margin: 0;
|
12
|
-
cursor:
|
13
|
-
max-width:
|
14
|
-
min-width:
|
15
|
-
margin-
|
12
|
+
cursor: pointer;
|
13
|
+
max-width: 100%;
|
14
|
+
min-width: 100%;
|
15
|
+
margin-bottom: 10px;
|
16
16
|
}
|
17
17
|
|
18
18
|
.labelNotification {
|
19
19
|
font-size: 12px;
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
color: #fff;
|
21
|
+
top: 0;
|
22
|
+
left: 0;
|
23
|
+
padding: 8px 8px 4px;
|
24
|
+
line-height: 13px;
|
25
|
+
border-radius: 10px;
|
26
|
+
margin-bottom: 6px;
|
27
|
+
background-color: rgb(245, 166, 35);
|
28
28
|
}
|
29
29
|
|
30
30
|
.card-product-content {
|
31
31
|
flex-direction: row;
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
box-sizing: border-box;
|
33
|
+
display: flex;
|
34
|
+
place-content: center start;
|
35
|
+
align-items: center;
|
36
|
+
}
|
37
|
+
|
38
|
+
.card-product-img {
|
39
|
+
max-width: 70px;
|
40
|
+
min-width: 70px;
|
36
41
|
}
|
37
42
|
|
38
43
|
.titleCardProductTypes {
|
39
|
-
color: rgba(0,0,0
|
40
|
-
font-size:
|
44
|
+
color: rgba(0, 0, 0, .87);
|
45
|
+
font-size: 16px;
|
41
46
|
}
|
42
47
|
|
43
48
|
.etaCardProductTypesSub {
|
@@ -58,9 +63,9 @@
|
|
58
63
|
|
59
64
|
.priceCardProductTypes {
|
60
65
|
color: #00205b;
|
61
|
-
font-size:
|
66
|
+
font-size: 18px;
|
62
67
|
text-align: right;
|
63
|
-
line-height: .
|
68
|
+
line-height: 1.1rem;
|
64
69
|
}
|
65
70
|
|
66
71
|
.priceCardProductTypesSub {
|
@@ -68,4 +73,37 @@
|
|
68
73
|
font-size: 11px;
|
69
74
|
text-align: right;
|
70
75
|
line-height: .9rem;
|
71
|
-
}
|
76
|
+
}
|
77
|
+
|
78
|
+
.selectCard {
|
79
|
+
border-top: 4px solid #39b54a;
|
80
|
+
border-bottom: 4px solid #00a3ff;
|
81
|
+
border-left: 1px solid #39b54a;
|
82
|
+
border-right: 1px solid #00a3ff;
|
83
|
+
-webkit-box-sizing: border-box;
|
84
|
+
-moz-box-sizing: border-box;
|
85
|
+
box-sizing: border-box;
|
86
|
+
background-position: 0 0, 100% 0;
|
87
|
+
background-repeat: no-repeat;
|
88
|
+
-webkit-background-size: 4px 100%;
|
89
|
+
-moz-background-size: 4px 100%;
|
90
|
+
background-size: 4px 100%;
|
91
|
+
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMSAxIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj48bGluZWFyR3JhZGllbnQgaWQ9Imxlc3NoYXQtZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMzYWNmZDUiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzNhNGVkNSIgc3RvcC1vcGFjaXR5PSIxIi8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2xlc3NoYXQtZ2VuZXJhdGVkKSIgLz48L3N2Zz4=),url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMSAxIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj48bGluZWFyR3JhZGllbnQgaWQ9Imxlc3NoYXQtZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMzYWNmZDUiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzNhNGVkNSIgc3RvcC1vcGFjaXR5PSIxIi8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2xlc3NoYXQtZ2VuZXJhdGVkKSIgLz48L3N2Zz4=);
|
92
|
+
background-image: -webkit-linear-gradient(top, #39b54a 0%, #00a3ff 100%), -webkit-linear-gradient(top, #39b54a 0%, #00a3ff 100%);
|
93
|
+
background-image: -moz-linear-gradient(top, #39b54a 0%, #00a3ff 100%), -moz-linear-gradient(top, #39b54a 0%, #00a3ff 100%);
|
94
|
+
background-image: -o-linear-gradient(top, #39b54a 0%, #00a3ff 100%), -o-linear-gradient(top, #39b54a 0%, #00a3ff 100%);
|
95
|
+
background-image: linear-gradient(to bottom, #39b54a 0%, #00a3ff 100%), linear-gradient(to bottom, #39b54a 0%, #00a3ff 100%);
|
96
|
+
}
|
97
|
+
|
98
|
+
/* .selectCard:before {
|
99
|
+
content: '';
|
100
|
+
position: absolute;
|
101
|
+
top: 0;
|
102
|
+
right: 0;
|
103
|
+
bottom: 0;
|
104
|
+
left: 0;
|
105
|
+
z-index: -1;
|
106
|
+
margin: 4px;
|
107
|
+
border-radius: inherit;
|
108
|
+
background: linear-gradient(to left, #39b54a, #00a3ff);
|
109
|
+
} */
|
@@ -24,6 +24,7 @@ export const CardServices = ({
|
|
24
24
|
txtUserService,
|
25
25
|
txtRefService,
|
26
26
|
txtUserNumberService,
|
27
|
+
onClickReturnOrder,
|
27
28
|
|
28
29
|
}) => {
|
29
30
|
return (
|
@@ -197,7 +198,7 @@ export const CardServices = ({
|
|
197
198
|
|
198
199
|
<Icon
|
199
200
|
name="returnOrder"
|
200
|
-
onClick={
|
201
|
+
onClick={onClickReturnOrder}
|
201
202
|
size="sm"
|
202
203
|
/>
|
203
204
|
|
@@ -271,6 +272,7 @@ CardServices.propTypes = {
|
|
271
272
|
txtUserService: PropTypes.string,
|
272
273
|
txtRefService: PropTypes.string,
|
273
274
|
txtUserNumberService: PropTypes.string,
|
275
|
+
onClickReturnOrder: PropTypes.func,
|
274
276
|
}
|
275
277
|
|
276
278
|
CardServices.defaultProps = {
|
@@ -282,6 +284,7 @@ CardServices.defaultProps = {
|
|
282
284
|
txtUserService: 'Alberto Alvarez',
|
283
285
|
txtRefService: '1946980768',
|
284
286
|
txtUserNumberService: 'WF3941',
|
287
|
+
onClickReturnOrder: () => { },
|
285
288
|
}
|
286
289
|
|
287
290
|
export default withStyles(styles)(CardServices)
|
@@ -5,7 +5,7 @@ import styles from './DynamicSelect.module.css'
|
|
5
5
|
import withStyles from '../../hocs/withStyles'
|
6
6
|
|
7
7
|
|
8
|
-
export const DynamicSelect = ({ getStyles, optionsSelect, defaultValue, placeholder, isMulti, isClearable, isDisabled, isLoading, isRtl, isSearchable, isInline, onChange }) => {
|
8
|
+
export const DynamicSelect = ({ getStyles, optionsSelect, defaultValue, placeholder, isMulti, isClearable, isDisabled, isLoading, isRtl, isSearchable, isInline, onChange, onFocus, onBlur }) => {
|
9
9
|
|
10
10
|
|
11
11
|
const customStyles = {
|
@@ -81,6 +81,8 @@ export const DynamicSelect = ({ getStyles, optionsSelect, defaultValue, placehol
|
|
81
81
|
isRtl={isRtl}
|
82
82
|
isSearchable={isSearchable}
|
83
83
|
onChange={onChange}
|
84
|
+
onFocus={onFocus}
|
85
|
+
onBlur={onBlur}
|
84
86
|
/>
|
85
87
|
</div>
|
86
88
|
|
@@ -98,7 +100,9 @@ DynamicSelect.propTypes = {
|
|
98
100
|
isRtl: PropTypes.bool,
|
99
101
|
isSearchable: PropTypes.bool,
|
100
102
|
isInline: PropTypes.bool,
|
101
|
-
onChange: PropTypes.func
|
103
|
+
onChange: PropTypes.func,
|
104
|
+
onFocus: PropTypes.func,
|
105
|
+
onBlur: PropTypes.func
|
102
106
|
}
|
103
107
|
|
104
108
|
DynamicSelect.defaultProps = {
|
@@ -112,6 +116,8 @@ DynamicSelect.defaultProps = {
|
|
112
116
|
isSearchable: false,
|
113
117
|
isInline: false,
|
114
118
|
onChange: () => { },
|
119
|
+
onFocus: () => { },
|
120
|
+
onBlur: () => { },
|
115
121
|
}
|
116
122
|
|
117
123
|
export default withStyles(styles)(DynamicSelect)
|
@@ -0,0 +1,265 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { useState } from "react";
|
3
|
+
import PropTypes from 'prop-types'
|
4
|
+
|
5
|
+
import styles from './InputAutocomplete.module.css'
|
6
|
+
import { options } from './constants'
|
7
|
+
import withStyles from '../../hocs/withStyles'
|
8
|
+
|
9
|
+
import { BarLoader, ClipLoader } from 'react-spinners'
|
10
|
+
import Input from '../../atoms/Input'
|
11
|
+
import Picture from '../../atoms/Picture'
|
12
|
+
import Icon from '../../atoms/Icon'
|
13
|
+
import { Horizontal } from '../../layout/Spacer/components';
|
14
|
+
|
15
|
+
|
16
|
+
// import { ReactSearchAutocomplete } from 'react-search-autocomplete'
|
17
|
+
// import Select, { components } from "react-select";
|
18
|
+
// import AsyncSelect from 'react-select/async';
|
19
|
+
|
20
|
+
|
21
|
+
export const InputAutocomplete = ({
|
22
|
+
placeholderOnInput,
|
23
|
+
idOnInput,
|
24
|
+
suggestedAddresses,
|
25
|
+
handleOnInputChange,
|
26
|
+
handleOnFocus,
|
27
|
+
handleOnBlur,
|
28
|
+
handleOnSelect,
|
29
|
+
viewAutocomplete,
|
30
|
+
viewBarLoader,
|
31
|
+
viewIconList,
|
32
|
+
viewInputSecondary,
|
33
|
+
styleWidthInput,
|
34
|
+
value,
|
35
|
+
isViewIcon,
|
36
|
+
idIcon,
|
37
|
+
nameIcon,
|
38
|
+
sizeIcon,
|
39
|
+
colorIcon,
|
40
|
+
backgroundIcon,
|
41
|
+
getStyles
|
42
|
+
}) => {
|
43
|
+
|
44
|
+
// let [loading, setLoading] = useState(false);
|
45
|
+
// let [color, setColor] = useState("#ffffff");
|
46
|
+
|
47
|
+
const override = {
|
48
|
+
display: "block",
|
49
|
+
margin: "0 auto",
|
50
|
+
borderColor: "red",
|
51
|
+
width: "94%",
|
52
|
+
};
|
53
|
+
|
54
|
+
// const options = [
|
55
|
+
// { label: "Option 1", value: 1 },
|
56
|
+
// { label: "Option 2", value: 2 },
|
57
|
+
// { label: "Option 3", value: 3 }
|
58
|
+
// ];
|
59
|
+
|
60
|
+
// const Input = (props) => {
|
61
|
+
// const { autoComplete = props.autoComplete } = props.selectProps;
|
62
|
+
// return <components.Input {...props} autoComplete={autoComplete} />;
|
63
|
+
// };
|
64
|
+
|
65
|
+
|
66
|
+
// const handleOnInputChange = (string, results) => {
|
67
|
+
// console.log(string, results)
|
68
|
+
|
69
|
+
// }
|
70
|
+
|
71
|
+
// const loadOptions = (string, results) => {
|
72
|
+
// // inputValue: string,
|
73
|
+
// // callback: (options: ColourOption[]) => void
|
74
|
+
// }
|
75
|
+
|
76
|
+
// const handleOnInputChange = (string, results) => {
|
77
|
+
// console.log(string, results)
|
78
|
+
|
79
|
+
// }
|
80
|
+
|
81
|
+
|
82
|
+
return <div className={getStyles('input-autocomplete')}>
|
83
|
+
|
84
|
+
{isViewIcon ?
|
85
|
+
|
86
|
+
<div className={getStyles('box-icon-input')}>
|
87
|
+
{/* <ReactSearchAutocomplete
|
88
|
+
inputDebounce={1000}
|
89
|
+
showIcon={false}
|
90
|
+
showItemsOnFocus={true}
|
91
|
+
items={itemsAutocomplete}
|
92
|
+
onSearch={handleOnSearch}
|
93
|
+
onHover={handleOnHover}
|
94
|
+
onSelect={handleOnSelect}
|
95
|
+
resultStringKeyName
|
96
|
+
onFocus={handleOnFocus}
|
97
|
+
autoFocus
|
98
|
+
formatResult={formatResult}
|
99
|
+
placeholder='hola'
|
100
|
+
// maxResults={2}
|
101
|
+
styling={{
|
102
|
+
position: 'fixed',
|
103
|
+
width: '100%',
|
104
|
+
height: "26px",
|
105
|
+
padding: '7px 9px',
|
106
|
+
border: 'var(--border-width-thin) solid var(--color-brand-white-lilac)',
|
107
|
+
background: 'var(--input-background)',
|
108
|
+
borderRadius: 'var(--border-radius-sm)',
|
109
|
+
color: 'var(--color-font-highlight)',
|
110
|
+
fontFamily: "var(--font-family-sans)",
|
111
|
+
fontSize: '14px',
|
112
|
+
fontWeight: 100,
|
113
|
+
// lineHeight: 'var(--line-height-relaxed)',
|
114
|
+
// transition: 'box-shadow 0.2s ease',
|
115
|
+
placeholderColor: 'var(--background-color-primary)',
|
116
|
+
clearIconMargin: '3px 8px 0 0',
|
117
|
+
zIndex: 0,
|
118
|
+
searchIconMargin: '0 0 0 10px',
|
119
|
+
}}
|
120
|
+
/> */}
|
121
|
+
|
122
|
+
{/*
|
123
|
+
<AsyncSelect
|
124
|
+
// components={{ Input }}
|
125
|
+
// autoComplete="new-password"
|
126
|
+
loadOptions={loadOptions}
|
127
|
+
// onChange={handleOnSearch}
|
128
|
+
// onInputChange={handleOnInputChange}
|
129
|
+
cacheOptions
|
130
|
+
defaultOptions={false}
|
131
|
+
/> */}
|
132
|
+
|
133
|
+
<Icon
|
134
|
+
id={idIcon}
|
135
|
+
name={nameIcon}
|
136
|
+
size={sizeIcon}
|
137
|
+
color={colorIcon}
|
138
|
+
background={backgroundIcon}
|
139
|
+
/>
|
140
|
+
|
141
|
+
<Horizontal size="xs" />
|
142
|
+
|
143
|
+
<Input
|
144
|
+
autocomplete={'off'}
|
145
|
+
id={idOnInput}
|
146
|
+
type='text'
|
147
|
+
name={idOnInput}
|
148
|
+
onChange={handleOnInputChange}
|
149
|
+
onFocus={handleOnFocus}
|
150
|
+
onBlur={handleOnBlur}
|
151
|
+
placeholder={placeholderOnInput}
|
152
|
+
isInputSecondary={viewInputSecondary}
|
153
|
+
value={value}
|
154
|
+
/>
|
155
|
+
|
156
|
+
</div>
|
157
|
+
|
158
|
+
:
|
159
|
+
|
160
|
+
<Input
|
161
|
+
autocomplete={'off'}
|
162
|
+
id={idOnInput}
|
163
|
+
type='text'
|
164
|
+
name={idOnInput}
|
165
|
+
onChange={handleOnInputChange}
|
166
|
+
onFocus={handleOnFocus}
|
167
|
+
onBlur={handleOnBlur}
|
168
|
+
placeholder={placeholderOnInput}
|
169
|
+
isInputSecondary={viewInputSecondary}
|
170
|
+
value={value}
|
171
|
+
/>}
|
172
|
+
|
173
|
+
{!viewBarLoader && suggestedAddresses.length !== 0 && viewAutocomplete ? (
|
174
|
+
<div className={getStyles('input-autocomplete-box-results')}>
|
175
|
+
<ul className={getStyles('input-autocomplete-ul')}>
|
176
|
+
{suggestedAddresses.map((itemAddresses, index) => (
|
177
|
+
<li key={index} className={getStyles('input-autocomplete-li')} onClick={handleOnSelect}>
|
178
|
+
{viewIconList ?
|
179
|
+
<div className={getStyles('input-autocomplete-li-icon')}>
|
180
|
+
|
181
|
+
<Picture
|
182
|
+
src={itemAddresses.iconURL}
|
183
|
+
width={15}
|
184
|
+
height={15}
|
185
|
+
/>
|
186
|
+
</div> : null}
|
187
|
+
{itemAddresses.name}
|
188
|
+
</li>
|
189
|
+
))}
|
190
|
+
</ul>
|
191
|
+
</div>
|
192
|
+
)
|
193
|
+
:
|
194
|
+
viewAutocomplete ? (
|
195
|
+
<div className={getStyles('input-autocomplete-box-results')}>
|
196
|
+
<ul className={getStyles('input-autocomplete-ul')}>
|
197
|
+
|
198
|
+
<li className={getStyles('input-autocomplete-li')} onClick={handleOnSelect}>
|
199
|
+
<div className={getStyles('input-autocomplete-li-icon')}>
|
200
|
+
<Icon
|
201
|
+
name="clock"
|
202
|
+
size="xs"
|
203
|
+
/>
|
204
|
+
</div>
|
205
|
+
No hay resultados
|
206
|
+
</li>
|
207
|
+
|
208
|
+
</ul>
|
209
|
+
</div>
|
210
|
+
)
|
211
|
+
: null
|
212
|
+
}
|
213
|
+
|
214
|
+
|
215
|
+
<BarLoader color="#36d7b7" loading={viewBarLoader} cssOverride={override} size={150} />
|
216
|
+
|
217
|
+
|
218
|
+
</div>
|
219
|
+
}
|
220
|
+
|
221
|
+
InputAutocomplete.propTypes = {
|
222
|
+
getStyles: PropTypes.func.isRequired,
|
223
|
+
placeholderOnInput: PropTypes.string,
|
224
|
+
idOnInput: PropTypes.string,
|
225
|
+
suggestedAddresses: PropTypes.object,
|
226
|
+
handleOnInputChange: PropTypes.func,
|
227
|
+
handleOnFocus: PropTypes.func,
|
228
|
+
handleOnBlur: PropTypes.func,
|
229
|
+
handleOnSelect: PropTypes.func,
|
230
|
+
viewAutocomplete: PropTypes.bool,
|
231
|
+
viewBarLoader: PropTypes.bool,
|
232
|
+
viewIconList: PropTypes.bool,
|
233
|
+
viewInputSecondary: PropTypes.bool,
|
234
|
+
styleWidthInput: PropTypes.string,
|
235
|
+
isViewIcon: PropTypes.bool,
|
236
|
+
idIcon: PropTypes.string,
|
237
|
+
nameIcon: PropTypes.string,
|
238
|
+
sizeIcon: PropTypes.string,
|
239
|
+
colorIcon: PropTypes.string,
|
240
|
+
backgroundIcon: PropTypes.string,
|
241
|
+
}
|
242
|
+
|
243
|
+
InputAutocomplete.defaultProps = {
|
244
|
+
getStyles: () => { },
|
245
|
+
placeholderOnInput: '',
|
246
|
+
idOnInput: '',
|
247
|
+
suggestedAddresses: [],
|
248
|
+
handleOnInputChange: () => { },
|
249
|
+
handleOnFocus: () => { },
|
250
|
+
handleOnBlur: () => { },
|
251
|
+
handleOnSelect: () => { },
|
252
|
+
viewAutocomplete: false,
|
253
|
+
viewBarLoader: false,
|
254
|
+
viewIconList: true,
|
255
|
+
viewInputSecondary: false,
|
256
|
+
styleWidthInput: '260',
|
257
|
+
isViewIcon: false,
|
258
|
+
idIcon: 'Ejemplo',
|
259
|
+
nameIcon: 'user',
|
260
|
+
sizeIcon: 'md',
|
261
|
+
colorIcon: 'highlight',
|
262
|
+
backgroundIcon: 'base',
|
263
|
+
}
|
264
|
+
|
265
|
+
export default withStyles(styles)(InputAutocomplete)
|
@@ -0,0 +1,55 @@
|
|
1
|
+
.input-autocomplete {
|
2
|
+
width: 100%;
|
3
|
+
}
|
4
|
+
|
5
|
+
.input-autocomplete-box-results {
|
6
|
+
padding: 7px 0px;
|
7
|
+
border-radius: var(--border-radius-xs);
|
8
|
+
border: var(--border-width-thin) solid var(--color-brand-white-lilac);
|
9
|
+
background-color: var(--color-base-white);
|
10
|
+
max-height: 230px;
|
11
|
+
overflow-y: auto;
|
12
|
+
box-shadow: 0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary);
|
13
|
+
outline: none;
|
14
|
+
position: absolute;
|
15
|
+
z-index: 11111;
|
16
|
+
margin-top: 2px;
|
17
|
+
max-width: 520px;
|
18
|
+
min-width: 260px;
|
19
|
+
}
|
20
|
+
|
21
|
+
.input-autocomplete-ul {
|
22
|
+
display: block;
|
23
|
+
list-style-type: none;
|
24
|
+
margin-block-start: 0em;
|
25
|
+
margin-block-end: 0em;
|
26
|
+
margin-inline-start: 0px;
|
27
|
+
margin-inline-end: 0px;
|
28
|
+
padding-inline-start: 0px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.input-autocomplete-li {
|
32
|
+
color: var(--color-font-base);
|
33
|
+
padding: 7px 9px;
|
34
|
+
font-size: var(--font-size-mini);
|
35
|
+
font-weight: var(--font-weight-light);
|
36
|
+
text-align: left;
|
37
|
+
border-bottom: var(--border-width-thin) solid var(--color-brand-white-lilac);
|
38
|
+
display: flex;
|
39
|
+
}
|
40
|
+
|
41
|
+
.input-autocomplete-li:hover {
|
42
|
+
background: rgba(0, 0, 0, 0.04);
|
43
|
+
cursor: pointer;
|
44
|
+
}
|
45
|
+
|
46
|
+
.input-autocomplete-li-icon {
|
47
|
+
width: 15px;
|
48
|
+
min-width: 15px;
|
49
|
+
max-width: 15px;
|
50
|
+
margin-right: 6px;
|
51
|
+
}
|
52
|
+
|
53
|
+
.box-icon-input {
|
54
|
+
display: flex;
|
55
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { InputAutocomplete, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(InputAutocomplete, styles)
|
10
|
+
const ListTemplate = getListTemplate(InputAutocomplete, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Molecules/InputAutocomplete',
|
14
|
+
component: InputAutocomplete,
|
15
|
+
args: {},
|
16
|
+
argTypes: {
|
17
|
+
// types: getOptionsArgTypes(options.types),
|
18
|
+
},
|
19
|
+
}
|
20
|
+
|
21
|
+
export const Default = Template.bind({})
|
22
|
+
// export const List = ListTemplate.bind({})
|
23
|
+
// List.args = { items: options.types.map((type) => ({ type })) }
|
@@ -0,0 +1 @@
|
|
1
|
+
export const options = { types: [] }
|