imbric-theme 1.0.7 → 1.0.9
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/.nvmrc +1 -1
- package/atoms/Icon/Icon.js +49 -16
- package/atoms/Icon/Icon.module.css +5 -0
- package/atoms/Icon/constants.js +11 -0
- package/atoms/Icon/save-file-svgrepo-com.svg +9 -0
- package/atoms/Input/Input.js +7 -4
- package/atoms/Toggle/Toggle.module.css +13 -4
- package/index.js +1 -1
- package/layout/DynamicTable/DynamicTable.js +8 -1
- package/molecules/ColumnTable/ColumnTable.js +24 -8
- package/molecules/DynamicSelect/DynamicSelect.js +39 -33
- package/package.json +1 -1
package/.nvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
16.13.2
|
package/atoms/Icon/Icon.js
CHANGED
@@ -18,28 +18,59 @@ export const Icon = ({
|
|
18
18
|
size,
|
19
19
|
isClickable,
|
20
20
|
getStyles,
|
21
|
+
disabled,
|
21
22
|
}) => {
|
22
23
|
const icon = iconsMap[name]
|
23
24
|
const mappedSize = mapSize(size)
|
24
25
|
|
25
26
|
return (
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
27
|
+
|
28
|
+
!disabled ?
|
29
|
+
<div
|
30
|
+
id={id}
|
31
|
+
className={getStyles(className, 'icon', ['color', 'size', 'background'], {
|
32
|
+
'is-clickable': isClickable || !!onClick,
|
33
|
+
})}
|
34
|
+
style={{ width: mappedSize, height: mappedSize }
|
35
|
+
}
|
36
|
+
onClick={onClick && handleClick({ onClick })}
|
37
|
+
>
|
38
|
+
<svg
|
39
|
+
viewBox={icon.viewBox}
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
41
|
+
width={mappedSize}
|
42
|
+
height={mappedSize}
|
43
|
+
>
|
44
|
+
{icon.svg}
|
45
|
+
</svg>
|
46
|
+
</div >
|
47
|
+
|
48
|
+
:
|
49
|
+
|
50
|
+
<div
|
51
|
+
id={id}
|
52
|
+
className={getStyles(className, 'icon', ['color', 'size', 'background'], {
|
53
|
+
'is-clickable': isClickable || !!onClick,
|
54
|
+
'is-disabled': disabled,
|
55
|
+
})}
|
56
|
+
style={{ width: mappedSize, height: mappedSize }
|
57
|
+
}
|
39
58
|
>
|
40
|
-
|
41
|
-
|
42
|
-
|
59
|
+
<svg
|
60
|
+
viewBox={icon.viewBox}
|
61
|
+
xmlns="http://www.w3.org/2000/svg"
|
62
|
+
width={mappedSize}
|
63
|
+
height={mappedSize}
|
64
|
+
className={getStyles({
|
65
|
+
'is-disabled': disabled,
|
66
|
+
})}
|
67
|
+
>
|
68
|
+
{icon.svg}
|
69
|
+
</svg>
|
70
|
+
</div >
|
71
|
+
|
72
|
+
|
73
|
+
|
43
74
|
)
|
44
75
|
}
|
45
76
|
|
@@ -53,6 +84,7 @@ Icon.propTypes = {
|
|
53
84
|
id: PropTypes.string,
|
54
85
|
className: PropTypes.string,
|
55
86
|
isClickable: PropTypes.bool,
|
87
|
+
disabled: PropTypes.bool,
|
56
88
|
}
|
57
89
|
|
58
90
|
Icon.defaultProps = {
|
@@ -60,6 +92,7 @@ Icon.defaultProps = {
|
|
60
92
|
color: 'base',
|
61
93
|
background: 'transparent',
|
62
94
|
isClickable: false,
|
95
|
+
disabled: false,
|
63
96
|
getStyles: () => { },
|
64
97
|
}
|
65
98
|
|
package/atoms/Icon/constants.js
CHANGED
@@ -1071,6 +1071,17 @@ export const iconsMap = {
|
|
1071
1071
|
</>
|
1072
1072
|
),
|
1073
1073
|
},
|
1074
|
+
iconSave: {
|
1075
|
+
viewBox: '0 0 24 24',
|
1076
|
+
svg: (
|
1077
|
+
<>
|
1078
|
+
<path d="M21.7,23.8H0.2V2.3c0-1.1,0.9-2,2-2h17.2l4.3,3.7v17.8C23.8,22.8,22.8,23.8,21.7,23.8z M1.8,22.3h20c0.3,0,0.5-0.2,0.5-0.5
|
1079
|
+
V4.6l-3.3-2.9H2.3C2,1.7,1.8,2,1.8,2.3V22.3z"/>
|
1080
|
+
<path d="M18.1,9.7H5.9V0.2h12.3V9.7z M7.4,8.2h9.3V1.7H7.4V8.2z" />
|
1081
|
+
<path d="M20,23.8H4V13.5h16V23.8z M5.5,22.3h13V15h-13V22.3z" />
|
1082
|
+
</>
|
1083
|
+
),
|
1084
|
+
},
|
1074
1085
|
}
|
1075
1086
|
|
1076
1087
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!-- Generator: Adobe Illustrator 25.4.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4
|
+
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
5
|
+
<path d="M21.7,23.8H0.2V2.3c0-1.1,0.9-2,2-2h17.2l4.3,3.7v17.8C23.8,22.8,22.8,23.8,21.7,23.8z M1.8,22.3h20c0.3,0,0.5-0.2,0.5-0.5
|
6
|
+
V4.6l-3.3-2.9H2.3C2,1.7,1.8,2,1.8,2.3V22.3z"/>
|
7
|
+
<path d="M18.1,9.7H5.9V0.2h12.3V9.7z M7.4,8.2h9.3V1.7H7.4V8.2z"/>
|
8
|
+
<path d="M20,23.8H4V13.5h16V23.8z M5.5,22.3h13V15h-13V22.3z"/>
|
9
|
+
</svg>
|
package/atoms/Input/Input.js
CHANGED
@@ -50,6 +50,7 @@ export const Input = ({
|
|
50
50
|
onClickModal,
|
51
51
|
formikForm,
|
52
52
|
inputExtra,
|
53
|
+
cleanSelected,
|
53
54
|
}) => {
|
54
55
|
|
55
56
|
const onClickDeleteInput = (results, id) => {
|
@@ -63,6 +64,10 @@ export const Input = ({
|
|
63
64
|
inputExtra([])
|
64
65
|
}
|
65
66
|
|
67
|
+
if (cleanSelected) {
|
68
|
+
cleanSelected()
|
69
|
+
}
|
70
|
+
|
66
71
|
}
|
67
72
|
|
68
73
|
const pulsar = (e, id) => {
|
@@ -164,15 +169,13 @@ export const Input = ({
|
|
164
169
|
: isOpenModal
|
165
170
|
|
166
171
|
?
|
167
|
-
<div className={getStyles('DynamicSelect_dynamic-select__oduOS')}>
|
172
|
+
<div style={{ pointerEvents: disabled ? 'none' : 'all' }} id="onClickModalDynamicSelect_dynamic" className={getStyles('DynamicSelect_dynamic-select__oduOS')}>
|
168
173
|
<div className={getStyles('css-1mfv3n-container')}>
|
169
|
-
<div style={{ zIndex: 1 }} className={getStyles('css-mlo5or-control')}>
|
174
|
+
<div style={{ zIndex: 1, background: disabled ? '#eeeeee' : 'hsl(0, 0%, 100%)' }} className={getStyles('css-mlo5or-control')}>
|
170
175
|
<div onClick={(op) => onClickModal(op, id)} style={{ height: '36px' }} className={getStyles('css-1huup54-ValueContainer')}>
|
171
176
|
<div className={getStyles('css-qc6sy-singleValue')}>{value}</div>
|
172
177
|
</div>
|
173
178
|
<div className={getStyles('css-1hb7zxy-IndicatorsContainer')}>
|
174
|
-
|
175
|
-
|
176
179
|
{value !== '' ? <div onClick={(op) => onClickDeleteInput(op, id)} className={getStyles('css-tlfecz-indicatorContainer')} aria-hidden="true">
|
177
180
|
<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" className={getStyles('css-tj5bde-Svg')} >
|
178
181
|
<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>
|
@@ -10,7 +10,8 @@
|
|
10
10
|
z-index: 1;
|
11
11
|
cursor: pointer;
|
12
12
|
}
|
13
|
-
|
13
|
+
|
14
|
+
.toggle-item+.checkbox-custom-label {
|
14
15
|
display: flex;
|
15
16
|
width: 4em;
|
16
17
|
height: 2em;
|
@@ -21,7 +22,8 @@
|
|
21
22
|
cursor: pointer;
|
22
23
|
box-shadow: inset 0 0 5px #222;
|
23
24
|
}
|
24
|
-
|
25
|
+
|
26
|
+
.toggle-item+.checkbox-custom-label:after {
|
25
27
|
content: '';
|
26
28
|
position: absolute;
|
27
29
|
width: 1.5em;
|
@@ -32,10 +34,17 @@
|
|
32
34
|
left: .25em;
|
33
35
|
transition: all .2s ease;
|
34
36
|
}
|
35
|
-
|
37
|
+
|
38
|
+
.toggle-item:checked+.checkbox-custom-label {
|
36
39
|
background: var(--color-tertiary);
|
37
40
|
box-shadow: inset 0 0 5px rgb(95, 95, 95);
|
38
41
|
}
|
39
|
-
|
42
|
+
|
43
|
+
.toggle-item:checked+.checkbox-custom-label:after {
|
40
44
|
left: 2.3em;
|
45
|
+
}
|
46
|
+
|
47
|
+
.toggle-item:disabled+.checkbox-custom-label {
|
48
|
+
background: #dedede;
|
49
|
+
cursor: no-drop;
|
41
50
|
}
|
package/index.js
CHANGED
@@ -56,7 +56,7 @@ export { default as ColumnTable } from './molecules/ColumnTable'
|
|
56
56
|
export { default as RowTable } from './molecules/RowTable'
|
57
57
|
export { default as FooterTable } from './molecules/FooterTable'
|
58
58
|
export { default as DynamicSelect } from './molecules/DynamicSelect'
|
59
|
-
export { default as DatePicker } from './molecules/
|
59
|
+
export { default as DatePicker } from './molecules/DatePicker'
|
60
60
|
export { default as CardDefault } from './molecules/CardDefault'
|
61
61
|
export { default as Tabs } from './molecules/Tabs'
|
62
62
|
export { default as DatePickerTime } from './molecules/DatePickerTime'
|
@@ -71,6 +71,7 @@ export const DynamicTable = ({
|
|
71
71
|
titleHeadingTable,
|
72
72
|
titleHeadingTableSecundary,
|
73
73
|
handleChangeCheckboxDate,
|
74
|
+
isMultiSelectFilter,
|
74
75
|
}) => {
|
75
76
|
|
76
77
|
const [tableData, setTableData] = useState(optionsData)
|
@@ -95,7 +96,10 @@ export const DynamicTable = ({
|
|
95
96
|
}
|
96
97
|
|
97
98
|
useEffect(() => {
|
98
|
-
setColumnsData(opColumns)
|
99
|
+
setColumnsData(opColumns)
|
100
|
+
setFilterTableData(opFilterTable)
|
101
|
+
setAddColumsData(opAddColumns)
|
102
|
+
setFilterSecondaryTableData(opFilterSecondaryTable)
|
99
103
|
})
|
100
104
|
|
101
105
|
const handleSorting = (sortField, sortOrder) => {
|
@@ -290,6 +294,7 @@ export const DynamicTable = ({
|
|
290
294
|
closeMenuOnSelect={false}
|
291
295
|
isClearable={false}
|
292
296
|
instanceId={'idFilterTableAll'}
|
297
|
+
isMulti={isMultiSelectFilter}
|
293
298
|
// defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
|
294
299
|
/> : null
|
295
300
|
}
|
@@ -473,6 +478,7 @@ DynamicTable.propTypes = {
|
|
473
478
|
txtTootipFileDownload: PropTypes.string,
|
474
479
|
titleHeadingTable: PropTypes.string,
|
475
480
|
titleHeadingTableSecundary: PropTypes.string,
|
481
|
+
isMultiSelectFilter: PropTypes.bool,
|
476
482
|
}
|
477
483
|
|
478
484
|
DynamicTable.defaultProps = {
|
@@ -518,6 +524,7 @@ DynamicTable.defaultProps = {
|
|
518
524
|
txtTootipFileDownload: '',
|
519
525
|
titleHeadingTable: 'Total: 200',
|
520
526
|
titleHeadingTableSecundary: '',
|
527
|
+
isMultiSelectFilter: false,
|
521
528
|
}
|
522
529
|
|
523
530
|
export default withStyles(styles)(DynamicTable)
|
@@ -100,14 +100,30 @@ export const ColumnTable = ({ getStyles, handleSorting, columnUppercase, onChang
|
|
100
100
|
{props.viewIsFilter ? (
|
101
101
|
|
102
102
|
props.typeFilter === 'select' ?
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
103
|
+
|
104
|
+
|
105
|
+
props.opSelectSecundary ?
|
106
|
+
|
107
|
+
<DynamicSelect
|
108
|
+
isInline
|
109
|
+
// onChange={item => useStateDate([item.selection])}
|
110
|
+
onChange={item => { onChangeSelect(item, props.idInput) }}
|
111
|
+
optionsSelect={props.optionsSelect}
|
112
|
+
placeholder={props.placeholder}
|
113
|
+
maxMenuHeight={110}
|
114
|
+
/>
|
115
|
+
|
116
|
+
:
|
117
|
+
|
118
|
+
<DynamicSelect
|
119
|
+
isInline
|
120
|
+
// onChange={item => useStateDate([item.selection])}
|
121
|
+
onChange={item => { onChangeSelect(item, props.idInput) }}
|
122
|
+
optionsSelect={opSelect || props.optionsSelect}
|
123
|
+
placeholder={props.placeholder}
|
124
|
+
maxMenuHeight={110}
|
125
|
+
/>
|
126
|
+
|
111
127
|
:
|
112
128
|
<Input
|
113
129
|
isInputFilter
|
@@ -63,21 +63,24 @@ export const DynamicSelect = ({
|
|
63
63
|
hideSelectedOptions,
|
64
64
|
menuPlacement,
|
65
65
|
getOptionValue,
|
66
|
-
getOptionLabel
|
66
|
+
getOptionLabel,
|
67
|
+
isMaxContent,
|
68
|
+
id,
|
67
69
|
}) => {
|
68
70
|
|
69
71
|
|
70
72
|
const customStyles = {
|
71
|
-
|
72
73
|
option: (base, state) => ({
|
73
74
|
...base,
|
74
75
|
cursor: 'pointer',
|
75
|
-
width:
|
76
|
-
minWidth:
|
76
|
+
width: 'max-content',
|
77
|
+
minWidth: '100%',
|
77
78
|
position: 'relative',
|
78
|
-
backgroundColor: state.isSelected
|
79
|
-
|
80
|
-
|
79
|
+
backgroundColor: state.isSelected
|
80
|
+
? 'var(--color-primary)'
|
81
|
+
: 'transparent',
|
82
|
+
'&:hover': {
|
83
|
+
backgroundColor: 'var(--color-primary-highlight)',
|
81
84
|
color: 'var(--color-primary)',
|
82
85
|
},
|
83
86
|
// "&:active": {
|
@@ -87,13 +90,16 @@ export const DynamicSelect = ({
|
|
87
90
|
control: (base, state) => ({
|
88
91
|
...base,
|
89
92
|
cursor: 'pointer',
|
90
|
-
width: '100%',
|
93
|
+
width: isMaxContent ? 'max-content' : '100%',
|
94
|
+
flexWrap: 'nowrap',
|
91
95
|
borderRadius: 0,
|
92
96
|
border: 'var(--border-width-thin) solid var(--color-brand-white-lilac)',
|
93
97
|
// border: state.isFocused ? "var(--border-width-thin) solid var(--color-brand-white-lilac)" : "var(--border-width-thin) solid var(--color-brand-white-lilac)",
|
94
|
-
boxShadow: state.isFocused
|
95
|
-
|
96
|
-
|
98
|
+
boxShadow: state.isFocused
|
99
|
+
? '0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary)'
|
100
|
+
: 'none',
|
101
|
+
'&:hover': {
|
102
|
+
borderColor: 'var(--color-primary)',
|
97
103
|
},
|
98
104
|
}),
|
99
105
|
input: (base) => ({
|
@@ -113,51 +119,47 @@ export const DynamicSelect = ({
|
|
113
119
|
textOverflow: 'ellipsis',
|
114
120
|
}),
|
115
121
|
|
116
|
-
valueContainer: (base
|
122
|
+
valueContainer: (base) => ({
|
117
123
|
...base,
|
118
|
-
textOverflow:
|
119
|
-
whiteSpace:
|
120
|
-
overflow:
|
124
|
+
textOverflow: 'ellipsis',
|
125
|
+
whiteSpace: 'nowrap',
|
126
|
+
overflow: 'hidden',
|
121
127
|
// display: "inline-grid"
|
122
128
|
// maxHeight: "38px",
|
123
129
|
}),
|
124
130
|
|
125
|
-
|
131
|
+
singleValue: (base) => ({
|
126
132
|
...base,
|
127
|
-
|
128
|
-
minWidth: "100%",
|
133
|
+
overflow: 'visible',
|
129
134
|
}),
|
130
135
|
|
131
|
-
|
136
|
+
container: (base) => ({
|
132
137
|
...base,
|
133
|
-
width: "max-content",
|
134
|
-
minWidth:
|
138
|
+
// width: "max-content",
|
139
|
+
minWidth: '100%',
|
140
|
+
width: 'fit-content',
|
135
141
|
}),
|
136
142
|
|
137
|
-
|
143
|
+
menu: (base) => ({
|
138
144
|
...base,
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
// minWidth: "100%",
|
145
|
+
width: 'fit-content',
|
146
|
+
minWidth: '100%',
|
147
|
+
zIndex: 10000000000,
|
143
148
|
}),
|
144
149
|
|
145
|
-
|
150
|
+
menuPortal: (base) => ({
|
146
151
|
...base,
|
147
|
-
|
148
|
-
// width: "max-content",
|
149
|
-
// minWidth: "100%",
|
152
|
+
zIndex: 999999999999,
|
150
153
|
}),
|
151
154
|
|
152
|
-
// menu: styles => ({ ...styles,
|
155
|
+
// menu: styles => ({ ...styles,
|
153
156
|
// width: '500px'
|
154
|
-
// })
|
157
|
+
// })
|
155
158
|
|
156
159
|
// indicatorsContainer: (provided, state) => ({
|
157
160
|
// ...provided,
|
158
161
|
// height: '50px',
|
159
162
|
// }),
|
160
|
-
|
161
163
|
}
|
162
164
|
|
163
165
|
|
@@ -170,6 +172,7 @@ export const DynamicSelect = ({
|
|
170
172
|
|
171
173
|
{sortableMultiSelect ?
|
172
174
|
<SortableSelect
|
175
|
+
id={id}
|
173
176
|
useDragHandle
|
174
177
|
// react-sortable-hoc props:
|
175
178
|
axis="xy"
|
@@ -185,6 +188,7 @@ export const DynamicSelect = ({
|
|
185
188
|
defaultValue={defaultValue}
|
186
189
|
value={value}
|
187
190
|
onChange={onChange}
|
191
|
+
onBlur={onBlur}
|
188
192
|
components={{
|
189
193
|
MultiValue: SortableMultiValue,
|
190
194
|
MultiValueLabel: SortableMultiValueLabel
|
@@ -204,6 +208,7 @@ export const DynamicSelect = ({
|
|
204
208
|
/>
|
205
209
|
:
|
206
210
|
<Select
|
211
|
+
id={id}
|
207
212
|
name="basic"
|
208
213
|
// className="basic-single"
|
209
214
|
// classNamePrefix="select"
|
@@ -283,6 +288,7 @@ DynamicSelect.defaultProps = {
|
|
283
288
|
sortableMultiSelect: false,
|
284
289
|
hideSelectedOptions: true,
|
285
290
|
menuPlacement: 'auto',
|
291
|
+
isMaxContent: false,
|
286
292
|
// getOptionValue: () => { option => option.value },
|
287
293
|
// getOptionLabel: () => { option => option.label },
|
288
294
|
}
|