imbric-theme 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.dockerignore +14 -0
- package/.eslintignore +1 -0
- package/.prettierignore +1 -0
- package/.storybook/main.js +6 -2
- package/.storybook/preview.js +21 -0
- package/.vscode/settings.json +3 -0
- package/Dockerfile +17 -0
- package/README.md +2 -2
- package/atoms/AlertModal/AlertModal.js +69 -0
- package/atoms/AlertModal/AlertModal.module.css +3 -0
- package/atoms/AlertModal/AlertModal.stories.js +30 -0
- package/atoms/AlertModal/constants.js +4 -0
- package/atoms/AlertModal/index.js +3 -0
- package/atoms/Button/Button.js +17 -2
- package/atoms/Button/Button.module.css +25 -3
- package/atoms/Button/Button.stories.js +1 -1
- package/atoms/Button/__snapshots__/Button.stories.js.snap +8 -8
- package/atoms/Check/Check.js +6 -4
- package/atoms/Checkbox/Checkbox.js +77 -0
- package/atoms/Checkbox/Checkbox.module.css +60 -0
- package/atoms/Checkbox/Checkbox.stories.js +30 -0
- package/atoms/Checkbox/constants.js +1 -0
- package/atoms/Checkbox/index.js +3 -0
- package/atoms/Divider/Divider.js +5 -2
- package/atoms/Divider/Divider.module.css +20 -0
- package/atoms/Divider/Divider.stories.js +13 -2
- package/atoms/Divider/constants.js +3 -0
- package/atoms/Divider/index.js +1 -0
- package/atoms/Heading/Heading.js +1 -1
- package/atoms/Heading/Heading.module.css +4 -0
- package/atoms/Heading/Heading.stories.js +2 -2
- package/atoms/Heading/__snapshots__/Heading.stories.js.snap +16 -16
- package/atoms/Heading/constants.js +1 -1
- package/atoms/Icon/Icon.js +1 -1
- package/atoms/Icon/Icon.module.css +30 -0
- package/atoms/Icon/constants.js +750 -145
- package/atoms/Input/Input.js +195 -15
- package/atoms/Input/Input.module.css +62 -6
- package/atoms/Input/Input.stories.js +8 -2
- package/atoms/Input/__snapshots__/Input.stories.js.snap +5 -5
- package/atoms/Input/constants.js +1 -1
- package/atoms/Label/Label.js +31 -0
- package/atoms/Label/Label.module.css +42 -0
- package/atoms/Label/Label.stories.js +26 -0
- package/atoms/Label/constants.js +1 -0
- package/atoms/Label/index.js +3 -0
- package/atoms/LinkItem/LinkItem.js +38 -0
- package/atoms/{Link/Link.module.css → LinkItem/LinkItem.module.css} +6 -1
- package/atoms/{Link/Link.stories.js → LinkItem/LinkItem.stories.js} +5 -5
- package/atoms/LinkItem/index.js +3 -0
- package/atoms/Modal/Modal.js +27 -4
- package/atoms/Modal/Modal.module.css +63 -6
- package/atoms/Paragraph/Paragraph.module.css +4 -0
- package/atoms/Paragraph/Paragraph.stories.js +2 -2
- package/atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap +16 -16
- package/atoms/Picture/Picture.js +9 -2
- package/atoms/Tab/Tab.js +41 -0
- package/atoms/Tab/Tab.module.css +17 -0
- package/atoms/Tab/Tab.stories.js +27 -0
- package/atoms/Tab/constants.js +1 -0
- package/atoms/Tab/index.js +3 -0
- package/atoms/Textarea/Textarea.js +106 -15
- package/atoms/Textarea/Textarea.module.css +31 -2
- package/atoms/Toggle/Toggle.js +56 -0
- package/atoms/Toggle/Toggle.module.css +41 -0
- package/atoms/Toggle/Toggle.stories.js +21 -0
- package/atoms/Toggle/constants.js +1 -0
- package/atoms/Toggle/index.js +3 -0
- package/helpers/storybook.js +2 -2
- package/hook/useAddColumn.js +40 -0
- package/hook/useStateDate.js +25 -0
- package/hook/useTable.js +54 -0
- package/index.js +41 -1
- package/jest.config.js +1 -1
- package/layout/DynamicTable/DynamicTable.js +372 -0
- package/layout/DynamicTable/DynamicTable.module.css +62 -0
- package/layout/DynamicTable/DynamicTable.stories.js +79 -0
- package/layout/DynamicTable/constants.js +323 -0
- package/layout/DynamicTable/index.js +3 -0
- package/layout/FlexColumnContent/FlexColumnContent.js +26 -0
- package/layout/FlexColumnContent/FlexColumnContent.module.css +5 -0
- package/layout/FlexColumnContent/FlexColumnContent.stories.js +28 -0
- package/layout/FlexColumnContent/constants.js +1 -0
- package/layout/FlexColumnContent/index.js +3 -0
- package/layout/Navbar/Navbar.js +247 -0
- package/layout/Navbar/Navbar.module.css +35 -0
- package/layout/Navbar/Navbar.stories.js +20 -0
- package/layout/Navbar/constants.js +35 -0
- package/layout/Navbar/index.js +2 -0
- package/layout/Sidebar/Sidebar.js +115 -0
- package/layout/Sidebar/Sidebar.module.css +387 -0
- package/layout/Sidebar/Sidebar.stories.js +28 -0
- package/layout/Sidebar/constants.js +228 -0
- package/layout/Sidebar/index.js +3 -0
- package/molecules/Accordion/Accordion.js +11 -11
- package/molecules/CardDefault/CardDefault.js +65 -0
- package/molecules/CardDefault/CardDefault.module.css +19 -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 +89 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.module.css +118 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.stories.js +25 -0
- package/molecules/CardProductTypesBooking/constants.js +1 -0
- package/molecules/CardProductTypesBooking/index.js +3 -0
- package/molecules/CardServiceDetail/CardServiceDetail.js +400 -0
- package/molecules/CardServiceDetail/CardServiceDetail.module.css +222 -0
- package/molecules/CardServiceDetail/CardServiceDetail.stories.js +23 -0
- package/molecules/CardServiceDetail/constants.js +1 -0
- package/molecules/CardServiceDetail/index.js +3 -0
- package/molecules/CardServices/CardServices.js +461 -0
- package/molecules/CardServices/CardServices.module.css +213 -0
- package/molecules/CardServices/CardServices.stories.js +41 -0
- package/molecules/CardServices/constants.js +5 -0
- package/molecules/CardServices/index.js +3 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.js +381 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.module.css +213 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.stories.js +23 -0
- package/molecules/CardServicesFinalized/constants.js +1 -0
- package/molecules/CardServicesFinalized/index.js +3 -0
- package/molecules/CheckList/CheckList.js +135 -0
- package/molecules/CheckList/CheckList.module.css +94 -0
- package/molecules/CheckList/CheckList.stories.js +25 -0
- package/molecules/CheckList/constants.js +23 -0
- package/molecules/CheckList/index.js +3 -0
- package/molecules/ColumnTable/ColumnTable.js +155 -0
- package/molecules/ColumnTable/ColumnTable.module.css +51 -0
- package/molecules/ColumnTable/ColumnTable.stories.js +26 -0
- package/molecules/ColumnTable/constants.js +117 -0
- package/molecules/ColumnTable/index.js +3 -0
- package/molecules/DatePicker/DatePicker.js +242 -0
- package/molecules/DatePicker/DatePicker.module.css +38 -0
- package/molecules/DatePicker/DatePicker.stories.js +23 -0
- package/molecules/DatePicker/constants.js +3 -0
- package/molecules/DatePicker/index.js +3 -0
- package/molecules/DatePickerTime/DatePickerTime.js +133 -0
- package/molecules/DatePickerTime/DatePickerTime.module.css +3 -0
- package/molecules/DatePickerTime/DatePickerTime.stories.js +18 -0
- package/molecules/DatePickerTime/constants.js +1 -0
- package/molecules/DatePickerTime/index.js +3 -0
- package/molecules/Dropdown/Dropdown.js +26 -23
- package/molecules/Dropdown/Dropdown.module.css +21 -3
- package/molecules/DynamicSelect/DynamicSelect.js +186 -0
- package/molecules/DynamicSelect/DynamicSelect.module.css +10 -0
- package/molecules/DynamicSelect/DynamicSelect.stories.js +32 -0
- package/molecules/DynamicSelect/constants.js +7 -0
- package/molecules/DynamicSelect/index.js +3 -0
- package/molecules/Error/Error.js +2 -2
- package/molecules/Error/Error.module.css +3 -2
- package/molecules/FooterTable/FooterTable.js +166 -0
- package/molecules/FooterTable/FooterTable.module.css +63 -0
- package/molecules/FooterTable/FooterTable.stories.js +23 -0
- package/molecules/FooterTable/constants.js +9 -0
- package/molecules/FooterTable/index.js +3 -0
- package/molecules/InputAutocomplete/InputAutocomplete.js +221 -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/ItemMenu/ItemMenu.js +134 -0
- package/molecules/ItemMenu/ItemMenu.module.css +363 -0
- package/molecules/ItemMenu/ItemMenu.stories.js +42 -0
- package/molecules/ItemMenu/constants.js +36 -0
- package/molecules/ItemMenu/index.js +3 -0
- package/molecules/RowTable/RowTable.js +928 -0
- package/molecules/RowTable/RowTable.module.css +63 -0
- package/molecules/RowTable/RowTable.stories.js +26 -0
- package/molecules/RowTable/constants.js +798 -0
- package/molecules/RowTable/index.js +3 -0
- package/molecules/Tabs/Tabs.js +59 -0
- package/molecules/Tabs/Tabs.module.css +13 -0
- package/molecules/Tabs/Tabs.stories.js +34 -0
- package/molecules/Tabs/constants.js +34 -0
- package/molecules/Tabs/index.js +3 -0
- package/package.json +34 -17
- package/pages/Login/Login.js +102 -0
- package/pages/Login/Login.module.css +5 -0
- package/pages/Login/Login.stories.js +23 -0
- package/pages/Login/constants.js +1 -0
- package/pages/Login/index.js +3 -0
- package/pages/Login/validation/loginSchema.js +5 -0
- package/public/favicon.ico +0 -0
- package/public/static/google-maps.png +0 -0
- package/public/static/images/folders-folder.svg +26 -0
- package/public/static/images/permissions.svg +14 -0
- package/public/static/images/reports-results.svg +18 -0
- package/public/static/logo.svg +19 -0
- package/public/static/logologin.png +0 -0
- package/public/static/logologin.svg +16 -0
- package/public/static/logologintagos.svg +19 -0
- package/public/static/logotipo.svg +50 -0
- package/public/static/logotipoS.svg +26 -0
- package/public/static/taxisvalencia_logod.png +0 -0
- package/scripts/create-component.js +2 -1
- package/styles/GrupoMutua.css +391 -0
- package/styles/default.css +391 -0
- package/styles/globals.css +1514 -0
- package/styles/radiotaxiaragon.css +391 -0
- package/styles/spartan.css +391 -0
- package/styles/tagos.css +391 -0
- package/styles/taxisvalencia.css +391 -0
- package/styles/tokens.css +2 -1
- package/tokens/index.js +2 -1
- package/.eslintcache +0 -1
- package/atoms/Link/Link.js +0 -33
- package/atoms/Link/index.js +0 -3
- /package/atoms/{Link → LinkItem}/__snapshots__/Link.stories.js.snap +0 -0
- /package/atoms/{Link → LinkItem}/constants.js +0 -0
@@ -0,0 +1,928 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
import ReactTooltip from 'react-tooltip'
|
4
|
+
|
5
|
+
import styles from './RowTable.module.css'
|
6
|
+
import { options } from './constants'
|
7
|
+
import withStyles from '../../hocs/withStyles'
|
8
|
+
|
9
|
+
import Moment from 'react-moment'
|
10
|
+
import Icon from '../../atoms/Icon'
|
11
|
+
import Picture from '../../atoms/Picture'
|
12
|
+
import Toggle from '../../atoms/Toggle'
|
13
|
+
|
14
|
+
|
15
|
+
import { Horizontal, Vertical } from '../../layout/Spacer/components'
|
16
|
+
|
17
|
+
export const RowTable = ({
|
18
|
+
getStyles,
|
19
|
+
slice,
|
20
|
+
columnsData,
|
21
|
+
isClickRow,
|
22
|
+
onClickRow,
|
23
|
+
onClickActionUserView,
|
24
|
+
onClickActionListInvoice,
|
25
|
+
onClickActionListXLS,
|
26
|
+
onClickActionListCSV,
|
27
|
+
onClickActionListPDF,
|
28
|
+
onClickActionEdit,
|
29
|
+
onClickActionSendEmail,
|
30
|
+
onClickActionDelete,
|
31
|
+
onClickActionLink,
|
32
|
+
onClickActionClone,
|
33
|
+
txtTootipIconUserView,
|
34
|
+
txtTootipIconListInvoice,
|
35
|
+
txtTootipIconListListXLS,
|
36
|
+
txtTootipIconListListCSV,
|
37
|
+
txtTootipIconListListPDF,
|
38
|
+
txtTootipIconEdit,
|
39
|
+
txtTootipIconSendEmail,
|
40
|
+
txtTootipIconDelete,
|
41
|
+
txtTootipIconLink,
|
42
|
+
txtTootipIconClone,
|
43
|
+
colorRow,
|
44
|
+
}) => {
|
45
|
+
|
46
|
+
|
47
|
+
const [loading, setLoading] = useState(false)
|
48
|
+
|
49
|
+
// const handleEditStaff = (e, item) => {
|
50
|
+
// console.log(item)
|
51
|
+
// console.log(e)
|
52
|
+
// }
|
53
|
+
|
54
|
+
|
55
|
+
const handleClickCheckbox = (e, item) => {
|
56
|
+
|
57
|
+
|
58
|
+
for (const iterator of slice) {
|
59
|
+
|
60
|
+
if (iterator.id === item.id) {
|
61
|
+
item.isSelected ? iterator.isSelected = false : iterator.isSelected = true
|
62
|
+
|
63
|
+
iterator.isSelected = item.isSelected
|
64
|
+
}
|
65
|
+
|
66
|
+
}
|
67
|
+
|
68
|
+
setLoading(true)
|
69
|
+
|
70
|
+
hola()
|
71
|
+
|
72
|
+
// return slice
|
73
|
+
|
74
|
+
// console.log(e, item)
|
75
|
+
}
|
76
|
+
|
77
|
+
const hola = () => {
|
78
|
+
|
79
|
+
setTimeout(() => {
|
80
|
+
setLoading(false)
|
81
|
+
}, 100)
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
// STATE TOOLTIP
|
88
|
+
const [isToolTipMounted, setIsToolTipMounted] = useState(false)
|
89
|
+
|
90
|
+
// TOOLTIP
|
91
|
+
const handleMouseEnter = () => {
|
92
|
+
setIsToolTipMounted(true)
|
93
|
+
}
|
94
|
+
const handleMouseLeave = () => {
|
95
|
+
setIsToolTipMounted(false)
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
return (
|
101
|
+
// <div className={getStyles('tbl-content')}>
|
102
|
+
// <table className={getStyles('table')} cellPadding="0" cellSpacing="0" border="0">
|
103
|
+
|
104
|
+
|
105
|
+
<tbody>
|
106
|
+
{slice.map((item, index) => (
|
107
|
+
|
108
|
+
<tr style={{ background: item.colorRow }} className={getStyles({ 'tr-content': isClickRow }, 'tr')} onClick={(e) => { onClickRow(e, item) }} key={index}>
|
109
|
+
|
110
|
+
{columnsData.map((itemTd, indexTd) => (
|
111
|
+
itemTd.activeView ?
|
112
|
+
(
|
113
|
+
|
114
|
+
|
115
|
+
itemTd.isBoolean
|
116
|
+
|
117
|
+
?
|
118
|
+
!loading ? (
|
119
|
+
<td
|
120
|
+
className={getStyles('td', 'tdacction')}
|
121
|
+
key={[itemTd.accessor] + (indexTd + index)}
|
122
|
+
>
|
123
|
+
{String(item[itemTd.accessor])}
|
124
|
+
|
125
|
+
</td>
|
126
|
+
)
|
127
|
+
: null
|
128
|
+
:
|
129
|
+
|
130
|
+
|
131
|
+
itemTd.isCheckbox
|
132
|
+
|
133
|
+
?
|
134
|
+
!loading ? (
|
135
|
+
<td
|
136
|
+
className={getStyles('td', 'tdacction')}
|
137
|
+
key={[itemTd.accessor] + (indexTd + index)}
|
138
|
+
>
|
139
|
+
|
140
|
+
{/* <Check id={item[itemTd.accessor]} isChecked={item.isSelected} /> */}
|
141
|
+
|
142
|
+
<Toggle
|
143
|
+
id={'idToggle' + item.id}
|
144
|
+
checked={item.isSelected}
|
145
|
+
label=""
|
146
|
+
onChangeCheckbox={(e) => { handleClickCheckbox(e, item) }}
|
147
|
+
/>
|
148
|
+
|
149
|
+
</td>
|
150
|
+
)
|
151
|
+
: null
|
152
|
+
:
|
153
|
+
|
154
|
+
|
155
|
+
itemTd.isArrayObject
|
156
|
+
|
157
|
+
?
|
158
|
+
|
159
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
|
160
|
+
|
161
|
+
{console.log('TD: ' + [itemTd.accessor] + (indexTd + index))}
|
162
|
+
|
163
|
+
{item[itemTd.accessor].map((itemTdObj, indexAcc, array) => (
|
164
|
+
|
165
|
+
<>
|
166
|
+
|
167
|
+
<span className={getStyles('tdlabelAlt')} key={itemTdObj.id + 'label' + (indexAcc + index)}>
|
168
|
+
{console.log('A: ' + itemTdObj.id + 'label' + (indexAcc + index))}
|
169
|
+
|
170
|
+
{itemTdObj[itemTd.subAccessorAlt]}
|
171
|
+
|
172
|
+
{array.length - 1 !== indexAcc ?
|
173
|
+
<span>, </span> : null}
|
174
|
+
:
|
175
|
+
</span>
|
176
|
+
|
177
|
+
<span key={itemTdObj.id + 'Tdlabel' + (indexAcc + index)}>
|
178
|
+
|
179
|
+
{console.log('B: ' + itemTdObj.id + 'Tdlabel' + (indexAcc + index))}
|
180
|
+
|
181
|
+
{itemTdObj[itemTd.subAccessor]}
|
182
|
+
|
183
|
+
{array.length - 1 !== indexAcc ?
|
184
|
+
<span>, </span> : null}
|
185
|
+
|
186
|
+
</span>
|
187
|
+
|
188
|
+
</>
|
189
|
+
|
190
|
+
))}
|
191
|
+
|
192
|
+
</td>
|
193
|
+
|
194
|
+
:
|
195
|
+
|
196
|
+
|
197
|
+
itemTd.isPicture
|
198
|
+
|
199
|
+
?
|
200
|
+
<td className={getStyles('td', 'tdacction')} key={[itemTd.accessor] + (indexTd + index)}>
|
201
|
+
<Picture
|
202
|
+
src={item[itemTd.accessor]}
|
203
|
+
width={50}
|
204
|
+
/>
|
205
|
+
</td>
|
206
|
+
:
|
207
|
+
|
208
|
+
itemTd.subAccessor === 'action'
|
209
|
+
|
210
|
+
?
|
211
|
+
|
212
|
+
<td className={getStyles('td', 'tdacctionIcons')} key={[itemTd.accessor] + (indexTd + index)}>
|
213
|
+
|
214
|
+
{itemTd.viewUserView ?
|
215
|
+
|
216
|
+
item.viewUserView === undefined ?
|
217
|
+
|
218
|
+
<>
|
219
|
+
<span
|
220
|
+
data-tip
|
221
|
+
data-for='userView'
|
222
|
+
onMouseEnter={handleMouseEnter}
|
223
|
+
onMouseLeave={handleMouseLeave}
|
224
|
+
>
|
225
|
+
<>
|
226
|
+
<Icon
|
227
|
+
id="userView"
|
228
|
+
background="base"
|
229
|
+
name="userView"
|
230
|
+
onClick={(e) => { onClickActionUserView(e, item) }}
|
231
|
+
/>
|
232
|
+
<Horizontal size="xs" />
|
233
|
+
</>
|
234
|
+
|
235
|
+
</span>
|
236
|
+
|
237
|
+
{isToolTipMounted ? (
|
238
|
+
<ReactTooltip id='userView' type='error'>
|
239
|
+
<span>{txtTootipIconUserView}</span>
|
240
|
+
</ReactTooltip>
|
241
|
+
) : null}
|
242
|
+
</>
|
243
|
+
|
244
|
+
:
|
245
|
+
|
246
|
+
item.viewUserView ?
|
247
|
+
|
248
|
+
<>
|
249
|
+
<span
|
250
|
+
data-tip
|
251
|
+
data-for='userView'
|
252
|
+
onMouseEnter={handleMouseEnter}
|
253
|
+
onMouseLeave={handleMouseLeave}
|
254
|
+
>
|
255
|
+
<>
|
256
|
+
<Icon
|
257
|
+
id="userView"
|
258
|
+
background="base"
|
259
|
+
name="userView"
|
260
|
+
onClick={(e) => { onClickActionUserView(e, item) }}
|
261
|
+
/>
|
262
|
+
<Horizontal size="xs" />
|
263
|
+
</>
|
264
|
+
|
265
|
+
</span>
|
266
|
+
|
267
|
+
{isToolTipMounted ? (
|
268
|
+
<ReactTooltip id='userView' type='error'>
|
269
|
+
<span>{txtTootipIconUserView}</span>
|
270
|
+
</ReactTooltip>
|
271
|
+
) : null}
|
272
|
+
</>
|
273
|
+
|
274
|
+
: null
|
275
|
+
|
276
|
+
: null}
|
277
|
+
|
278
|
+
|
279
|
+
{itemTd.viewListInvoice ?
|
280
|
+
|
281
|
+
|
282
|
+
item.viewListInvoice === undefined ?
|
283
|
+
|
284
|
+
<>
|
285
|
+
<span
|
286
|
+
data-tip
|
287
|
+
data-for='listInvoice'
|
288
|
+
onMouseEnter={handleMouseEnter}
|
289
|
+
onMouseLeave={handleMouseLeave}
|
290
|
+
>
|
291
|
+
<>
|
292
|
+
<Icon
|
293
|
+
id={"listInvoice" + (indexTd + index)}
|
294
|
+
background="base"
|
295
|
+
name="listInvoice"
|
296
|
+
onClick={(e) => { onClickActionListInvoice(e, item) }}
|
297
|
+
/>
|
298
|
+
<Horizontal size="xs" />
|
299
|
+
</>
|
300
|
+
|
301
|
+
</span>
|
302
|
+
|
303
|
+
{isToolTipMounted ? (
|
304
|
+
<ReactTooltip id='listInvoice' type='error' place='left'>
|
305
|
+
<span>{txtTootipIconListInvoice}</span>
|
306
|
+
</ReactTooltip>
|
307
|
+
) : null}
|
308
|
+
</>
|
309
|
+
|
310
|
+
:
|
311
|
+
|
312
|
+
item.viewListInvoice ?
|
313
|
+
|
314
|
+
<>
|
315
|
+
<span
|
316
|
+
data-tip
|
317
|
+
data-for='listInvoice'
|
318
|
+
onMouseEnter={handleMouseEnter}
|
319
|
+
onMouseLeave={handleMouseLeave}
|
320
|
+
>
|
321
|
+
<>
|
322
|
+
<Icon
|
323
|
+
id={"listInvoice" + (indexTd + index)}
|
324
|
+
background="base"
|
325
|
+
name="listInvoice"
|
326
|
+
onClick={(e) => { onClickActionListInvoice(e, item) }}
|
327
|
+
/>
|
328
|
+
<Horizontal size="xs" />
|
329
|
+
</>
|
330
|
+
|
331
|
+
</span>
|
332
|
+
|
333
|
+
{isToolTipMounted ? (
|
334
|
+
<ReactTooltip id='listInvoice' type='error'>
|
335
|
+
<span>{txtTootipIconListInvoice}</span>
|
336
|
+
</ReactTooltip>
|
337
|
+
) : null}
|
338
|
+
</>
|
339
|
+
|
340
|
+
: null
|
341
|
+
|
342
|
+
: null}
|
343
|
+
|
344
|
+
{itemTd.viewListXLS && item.fileType === 'xls' ?
|
345
|
+
|
346
|
+
<>
|
347
|
+
<span
|
348
|
+
data-tip
|
349
|
+
data-for='listXLS'
|
350
|
+
onMouseEnter={handleMouseEnter}
|
351
|
+
onMouseLeave={handleMouseLeave}
|
352
|
+
>
|
353
|
+
<>
|
354
|
+
<Icon
|
355
|
+
id={"listXLS" + (indexTd + index)}
|
356
|
+
background="base"
|
357
|
+
name="listXLS"
|
358
|
+
onClick={(e) => { onClickActionListXLS(e, item) }}
|
359
|
+
/>
|
360
|
+
<Horizontal size="xs" />
|
361
|
+
</>
|
362
|
+
|
363
|
+
</span>
|
364
|
+
|
365
|
+
{isToolTipMounted ? (
|
366
|
+
<ReactTooltip id='listXLS' type='error'>
|
367
|
+
<span>{txtTootipIconListListXLS}</span>
|
368
|
+
</ReactTooltip>
|
369
|
+
) : null}
|
370
|
+
</>
|
371
|
+
|
372
|
+
: null}
|
373
|
+
|
374
|
+
{itemTd.viewListCSV && item.fileType === 'xml' ?
|
375
|
+
|
376
|
+
<>
|
377
|
+
<span
|
378
|
+
data-tip
|
379
|
+
data-for='listCSV'
|
380
|
+
onMouseEnter={handleMouseEnter}
|
381
|
+
onMouseLeave={handleMouseLeave}
|
382
|
+
>
|
383
|
+
<>
|
384
|
+
<Icon
|
385
|
+
id={"listCSV" + (indexTd + index)}
|
386
|
+
background="base"
|
387
|
+
name="listCSV"
|
388
|
+
onClick={(e) => { onClickActionListCSV(e, item) }}
|
389
|
+
/>
|
390
|
+
<Horizontal size="xs" />
|
391
|
+
</>
|
392
|
+
|
393
|
+
</span>
|
394
|
+
|
395
|
+
{isToolTipMounted ? (
|
396
|
+
<ReactTooltip id='listCSV' type='error'>
|
397
|
+
<span>{txtTootipIconListListCSV}</span>
|
398
|
+
</ReactTooltip>
|
399
|
+
) : null}
|
400
|
+
</>
|
401
|
+
|
402
|
+
: null}
|
403
|
+
|
404
|
+
{itemTd.viewListPDF && item.fileType === 'pdf' ?
|
405
|
+
|
406
|
+
<>
|
407
|
+
<span
|
408
|
+
data-tip
|
409
|
+
data-for='listPDF'
|
410
|
+
onMouseEnter={handleMouseEnter}
|
411
|
+
onMouseLeave={handleMouseLeave}
|
412
|
+
>
|
413
|
+
<>
|
414
|
+
<Icon
|
415
|
+
id={"listPDF" + (indexTd + index)}
|
416
|
+
background="base"
|
417
|
+
name="listPDF"
|
418
|
+
onClick={(e) => { onClickActionListPDF(e, item) }}
|
419
|
+
/>
|
420
|
+
<Horizontal size="xs" />
|
421
|
+
</>
|
422
|
+
|
423
|
+
</span>
|
424
|
+
|
425
|
+
{isToolTipMounted ? (
|
426
|
+
<ReactTooltip id='listPDF' type='error'>
|
427
|
+
<span>{txtTootipIconListListPDF}</span>
|
428
|
+
</ReactTooltip>
|
429
|
+
) : null}
|
430
|
+
</>
|
431
|
+
|
432
|
+
: null}
|
433
|
+
|
434
|
+
{itemTd.viewEdit ?
|
435
|
+
|
436
|
+
item.viewEdit === undefined ?
|
437
|
+
<>
|
438
|
+
<span
|
439
|
+
data-tip
|
440
|
+
data-for='edit'
|
441
|
+
onMouseEnter={handleMouseEnter}
|
442
|
+
onMouseLeave={handleMouseLeave}
|
443
|
+
>
|
444
|
+
<>
|
445
|
+
<Icon
|
446
|
+
id={"edit" + (indexTd + index)}
|
447
|
+
background="base"
|
448
|
+
name="edit"
|
449
|
+
onClick={(e) => { onClickActionEdit(e, item) }}
|
450
|
+
/>
|
451
|
+
<Horizontal size="xs" />
|
452
|
+
</>
|
453
|
+
|
454
|
+
</span>
|
455
|
+
|
456
|
+
{isToolTipMounted ? (
|
457
|
+
<ReactTooltip id='edit' type='error'>
|
458
|
+
<span>{txtTootipIconEdit}</span>
|
459
|
+
</ReactTooltip>
|
460
|
+
) : null}
|
461
|
+
</>
|
462
|
+
:
|
463
|
+
|
464
|
+
item.viewEdit ?
|
465
|
+
|
466
|
+
<>
|
467
|
+
<span
|
468
|
+
data-tip
|
469
|
+
data-for='edit'
|
470
|
+
onMouseEnter={handleMouseEnter}
|
471
|
+
onMouseLeave={handleMouseLeave}
|
472
|
+
>
|
473
|
+
<>
|
474
|
+
<Icon
|
475
|
+
id={"edit" + (indexTd + index)}
|
476
|
+
background="base"
|
477
|
+
name="edit"
|
478
|
+
onClick={(e) => { onClickActionEdit(e, item) }}
|
479
|
+
/>
|
480
|
+
<Horizontal size="xs" />
|
481
|
+
</>
|
482
|
+
|
483
|
+
</span>
|
484
|
+
|
485
|
+
{isToolTipMounted ? (
|
486
|
+
<ReactTooltip id='edit' type='error'>
|
487
|
+
<span>{txtTootipIconEdit}</span>
|
488
|
+
</ReactTooltip>
|
489
|
+
) : null}
|
490
|
+
</>
|
491
|
+
|
492
|
+
: null
|
493
|
+
|
494
|
+
: null}
|
495
|
+
|
496
|
+
{itemTd.viewEmailSend ?
|
497
|
+
|
498
|
+
item.viewEmailSend === undefined ?
|
499
|
+
|
500
|
+
<>
|
501
|
+
<span
|
502
|
+
data-tip
|
503
|
+
data-for='sendEmail'
|
504
|
+
onMouseEnter={handleMouseEnter}
|
505
|
+
onMouseLeave={handleMouseLeave}
|
506
|
+
>
|
507
|
+
<>
|
508
|
+
<Icon
|
509
|
+
background="base"
|
510
|
+
name="sendEmail"
|
511
|
+
onClick={e => { onClickActionSendEmail(e, item) }}
|
512
|
+
/>
|
513
|
+
<Horizontal size="xs" />
|
514
|
+
</>
|
515
|
+
|
516
|
+
</span>
|
517
|
+
|
518
|
+
{isToolTipMounted ? (
|
519
|
+
<ReactTooltip id='sendEmail' type='error'>
|
520
|
+
<span>{txtTootipIconSendEmail}</span>
|
521
|
+
</ReactTooltip>
|
522
|
+
) : null}
|
523
|
+
</>
|
524
|
+
|
525
|
+
:
|
526
|
+
|
527
|
+
item.viewEmailSend ?
|
528
|
+
|
529
|
+
<>
|
530
|
+
<span
|
531
|
+
data-tip
|
532
|
+
data-for='sendEmail'
|
533
|
+
onMouseEnter={handleMouseEnter}
|
534
|
+
onMouseLeave={handleMouseLeave}
|
535
|
+
>
|
536
|
+
<>
|
537
|
+
<Icon
|
538
|
+
background="base"
|
539
|
+
name="sendEmail"
|
540
|
+
onClick={e => { onClickActionSendEmail(e, item) }}
|
541
|
+
/>
|
542
|
+
<Horizontal size="xs" />
|
543
|
+
</>
|
544
|
+
|
545
|
+
</span>
|
546
|
+
|
547
|
+
{isToolTipMounted ? (
|
548
|
+
<ReactTooltip id='sendEmail' type='error'>
|
549
|
+
<span>{txtTootipIconSendEmail}</span>
|
550
|
+
</ReactTooltip>
|
551
|
+
) : null}
|
552
|
+
</>
|
553
|
+
|
554
|
+
: null
|
555
|
+
|
556
|
+
: null}
|
557
|
+
|
558
|
+
{itemTd.viewTrash ?
|
559
|
+
|
560
|
+
item.viewTrash === undefined ?
|
561
|
+
|
562
|
+
<>
|
563
|
+
<span
|
564
|
+
data-tip
|
565
|
+
data-for='trash'
|
566
|
+
onMouseEnter={handleMouseEnter}
|
567
|
+
onMouseLeave={handleMouseLeave}
|
568
|
+
>
|
569
|
+
<>
|
570
|
+
<Icon
|
571
|
+
background="base"
|
572
|
+
name="trash"
|
573
|
+
onClick={e => { onClickActionDelete(e, item) }}
|
574
|
+
/>
|
575
|
+
<Horizontal size="xs" />
|
576
|
+
</>
|
577
|
+
|
578
|
+
</span>
|
579
|
+
|
580
|
+
{isToolTipMounted ? (
|
581
|
+
<ReactTooltip id='trash' type='error'>
|
582
|
+
<span>{txtTootipIconDelete}</span>
|
583
|
+
</ReactTooltip>
|
584
|
+
) : null}
|
585
|
+
</>
|
586
|
+
|
587
|
+
:
|
588
|
+
|
589
|
+
item.viewTrash ?
|
590
|
+
|
591
|
+
<>
|
592
|
+
<span
|
593
|
+
data-tip
|
594
|
+
data-for='trash'
|
595
|
+
onMouseEnter={handleMouseEnter}
|
596
|
+
onMouseLeave={handleMouseLeave}
|
597
|
+
>
|
598
|
+
<>
|
599
|
+
<Icon
|
600
|
+
background="base"
|
601
|
+
name="trash"
|
602
|
+
onClick={e => { onClickActionDelete(e, item) }}
|
603
|
+
/>
|
604
|
+
<Horizontal size="xs" />
|
605
|
+
</>
|
606
|
+
|
607
|
+
</span>
|
608
|
+
|
609
|
+
{isToolTipMounted ? (
|
610
|
+
<ReactTooltip id='trash' type='error'>
|
611
|
+
<span>{txtTootipIconDelete}</span>
|
612
|
+
</ReactTooltip>
|
613
|
+
) : null}
|
614
|
+
</>
|
615
|
+
|
616
|
+
: null
|
617
|
+
|
618
|
+
: null}
|
619
|
+
|
620
|
+
|
621
|
+
{itemTd.viewLink ?
|
622
|
+
|
623
|
+
item.viewLink === undefined ?
|
624
|
+
|
625
|
+
<>
|
626
|
+
<span
|
627
|
+
data-tip
|
628
|
+
data-for='linkUser'
|
629
|
+
onMouseEnter={handleMouseEnter}
|
630
|
+
onMouseLeave={handleMouseLeave}
|
631
|
+
>
|
632
|
+
<>
|
633
|
+
<Icon
|
634
|
+
background="base"
|
635
|
+
name="linkUser"
|
636
|
+
// onClick={(e) => onClickEdit(e, item)}
|
637
|
+
onClick={e => { onClickActionLink(e, item) }}
|
638
|
+
/>
|
639
|
+
<Horizontal size="xs" />
|
640
|
+
</>
|
641
|
+
|
642
|
+
</span>
|
643
|
+
|
644
|
+
{isToolTipMounted ? (
|
645
|
+
<ReactTooltip id='linkUser' type='error'>
|
646
|
+
<span>{txtTootipIconLink}</span>
|
647
|
+
</ReactTooltip>
|
648
|
+
) : null}
|
649
|
+
</>
|
650
|
+
|
651
|
+
:
|
652
|
+
|
653
|
+
item.viewLink ?
|
654
|
+
|
655
|
+
<>
|
656
|
+
<span
|
657
|
+
data-tip
|
658
|
+
data-for='linkUser'
|
659
|
+
onMouseEnter={handleMouseEnter}
|
660
|
+
onMouseLeave={handleMouseLeave}
|
661
|
+
>
|
662
|
+
<>
|
663
|
+
<Icon
|
664
|
+
background="base"
|
665
|
+
name="linkUser"
|
666
|
+
// onClick={(e) => onClickEdit(e, item)}
|
667
|
+
onClick={e => { onClickActionLink(e, item) }}
|
668
|
+
/>
|
669
|
+
<Horizontal size="xs" />
|
670
|
+
</>
|
671
|
+
|
672
|
+
</span>
|
673
|
+
|
674
|
+
{isToolTipMounted ? (
|
675
|
+
<ReactTooltip id='linkUser' type='error'>
|
676
|
+
<span>{txtTootipIconLink}</span>
|
677
|
+
</ReactTooltip>
|
678
|
+
) : null}
|
679
|
+
</>
|
680
|
+
|
681
|
+
: null
|
682
|
+
|
683
|
+
: null}
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
{itemTd.viewClone ?
|
688
|
+
|
689
|
+
item.viewClone === undefined ?
|
690
|
+
|
691
|
+
<>
|
692
|
+
<span
|
693
|
+
data-tip
|
694
|
+
data-for='clone'
|
695
|
+
onMouseEnter={handleMouseEnter}
|
696
|
+
onMouseLeave={handleMouseLeave}
|
697
|
+
>
|
698
|
+
<>
|
699
|
+
<Icon
|
700
|
+
background="base"
|
701
|
+
name="cloneDefault"
|
702
|
+
onClick={e => { onClickActionClone(e, item) }}
|
703
|
+
/>
|
704
|
+
<Horizontal size="xs" />
|
705
|
+
</>
|
706
|
+
|
707
|
+
</span>
|
708
|
+
|
709
|
+
{isToolTipMounted ? (
|
710
|
+
<ReactTooltip id='clone' type='error'>
|
711
|
+
<span>{txtTootipIconClone}</span>
|
712
|
+
</ReactTooltip>
|
713
|
+
) : null}
|
714
|
+
</>
|
715
|
+
|
716
|
+
:
|
717
|
+
|
718
|
+
item.viewClone ?
|
719
|
+
|
720
|
+
<>
|
721
|
+
<span
|
722
|
+
data-tip
|
723
|
+
data-for='clone'
|
724
|
+
onMouseEnter={handleMouseEnter}
|
725
|
+
onMouseLeave={handleMouseLeave}
|
726
|
+
>
|
727
|
+
<>
|
728
|
+
<Icon
|
729
|
+
background="base"
|
730
|
+
name="clone"
|
731
|
+
onClick={e => { onClickActionClone(e, item) }}
|
732
|
+
/>
|
733
|
+
<Horizontal size="xs" />
|
734
|
+
</>
|
735
|
+
|
736
|
+
</span>
|
737
|
+
|
738
|
+
{isToolTipMounted ? (
|
739
|
+
<ReactTooltip id='clone' type='error'>
|
740
|
+
<span>{txtTootipIconClone}</span>
|
741
|
+
</ReactTooltip>
|
742
|
+
) : null}
|
743
|
+
</>
|
744
|
+
|
745
|
+
: null
|
746
|
+
|
747
|
+
: null}
|
748
|
+
|
749
|
+
|
750
|
+
|
751
|
+
</td>
|
752
|
+
|
753
|
+
:
|
754
|
+
|
755
|
+
itemTd.subAccessor !== ''
|
756
|
+
|
757
|
+
?
|
758
|
+
|
759
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor][itemTd.subAccessor]}</td>
|
760
|
+
|
761
|
+
:
|
762
|
+
|
763
|
+
itemTd.typeFilter === 'date'
|
764
|
+
|
765
|
+
?
|
766
|
+
|
767
|
+
itemTd.typeFilterSub === 'date_only' ?
|
768
|
+
|
769
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
|
770
|
+
<Moment format="DD/MM/YYYY">
|
771
|
+
{item[itemTd.accessor]}
|
772
|
+
</Moment>
|
773
|
+
</td>
|
774
|
+
|
775
|
+
:
|
776
|
+
|
777
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
|
778
|
+
{/* <Moment format="DD/MM/YYYY hh:mm:ss"> */}
|
779
|
+
<Moment format="DD/MM/YYYY HH:mm">
|
780
|
+
{item[itemTd.accessor]}
|
781
|
+
</Moment>
|
782
|
+
</td>
|
783
|
+
:
|
784
|
+
|
785
|
+
itemTd.typeFilter === 'select'
|
786
|
+
|
787
|
+
?
|
788
|
+
|
789
|
+
itemTd.optionsSelect.map((itemSelect, indexSelect) => (
|
790
|
+
|
791
|
+
|
792
|
+
item[itemTd.accessor] === itemSelect.value ?
|
793
|
+
|
794
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index) + indexSelect}>
|
795
|
+
{itemSelect.label}
|
796
|
+
</td>
|
797
|
+
|
798
|
+
:
|
799
|
+
|
800
|
+
null
|
801
|
+
))
|
802
|
+
|
803
|
+
:
|
804
|
+
|
805
|
+
itemTd.typeFilter === 'number'
|
806
|
+
|
807
|
+
?
|
808
|
+
|
809
|
+
itemTd.subTypeFilter
|
810
|
+
|
811
|
+
?
|
812
|
+
|
813
|
+
itemTd.characterExtra === 'km'
|
814
|
+
?
|
815
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{(item[itemTd.accessor] / 1000).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
|
816
|
+
:
|
817
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
|
818
|
+
:
|
819
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]}</td>
|
820
|
+
|
821
|
+
:
|
822
|
+
|
823
|
+
itemTd.subTypeFilter
|
824
|
+
|
825
|
+
?
|
826
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{Number(item[itemTd.accessor]).toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
|
827
|
+
:
|
828
|
+
<td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]}</td>
|
829
|
+
|
830
|
+
// <>
|
831
|
+
|
832
|
+
// <td
|
833
|
+
// data-tip
|
834
|
+
// data-for={'td' + [itemTd.accessor] + index}
|
835
|
+
// onMouseEnter={handleMouseEnter}
|
836
|
+
// onMouseLeave={handleMouseLeave}
|
837
|
+
// className={getStyles('td')}
|
838
|
+
// key={[itemTd.accessor] + (indexTd + index)}
|
839
|
+
// >
|
840
|
+
// {item[itemTd.accessor]}
|
841
|
+
|
842
|
+
// {/*
|
843
|
+
// {isToolTipMounted ? (
|
844
|
+
// <ReactTooltip id={'td' + [itemTd.accessor] + index} type='info'>
|
845
|
+
// <span>{item[itemTd.accessor]}</span>
|
846
|
+
// </ReactTooltip>
|
847
|
+
// ) : null} */}
|
848
|
+
|
849
|
+
// </td>
|
850
|
+
|
851
|
+
// </>
|
852
|
+
|
853
|
+
|
854
|
+
|
855
|
+
|
856
|
+
) : null
|
857
|
+
))}
|
858
|
+
</tr>
|
859
|
+
|
860
|
+
))}
|
861
|
+
</tbody>
|
862
|
+
// </table>
|
863
|
+
|
864
|
+
// </div>
|
865
|
+
)
|
866
|
+
}
|
867
|
+
|
868
|
+
RowTable.propTypes = {
|
869
|
+
getStyles: PropTypes.func.isRequired,
|
870
|
+
type: PropTypes.oneOf(options.types || []),
|
871
|
+
isClickRow: PropTypes.bool,
|
872
|
+
onClickRow: PropTypes.func,
|
873
|
+
onClickCheckbox: PropTypes.func,
|
874
|
+
onClickActionUserView: PropTypes.func,
|
875
|
+
onClickActionListInvoice: PropTypes.func,
|
876
|
+
onClickActionListXLS: PropTypes.func,
|
877
|
+
onClickActionListCSV: PropTypes.func,
|
878
|
+
onClickActionListPDF: PropTypes.func,
|
879
|
+
onClickActionEdit: PropTypes.func,
|
880
|
+
onClickActionSendEmail: PropTypes.func,
|
881
|
+
onClickActionDelete: PropTypes.func,
|
882
|
+
onClickActionLink: PropTypes.func,
|
883
|
+
onClickActionClone: PropTypes.func,
|
884
|
+
txtTootipIconUserView: PropTypes.string,
|
885
|
+
txtTootipIconListInvoice: PropTypes.string,
|
886
|
+
txtTootipIconListListXLS: PropTypes.string,
|
887
|
+
txtTootipIconListListCSV: PropTypes.string,
|
888
|
+
txtTootipIconListListPDF: PropTypes.string,
|
889
|
+
txtTootipIconEdit: PropTypes.string,
|
890
|
+
txtTootipIconSendEmail: PropTypes.string,
|
891
|
+
txtTootipIconDelete: PropTypes.string,
|
892
|
+
txtTootipIconLink: PropTypes.string,
|
893
|
+
txtTootipIconClone: PropTypes.string,
|
894
|
+
colorRow: PropTypes.string,
|
895
|
+
isCheckedCheckbox: PropTypes.bool
|
896
|
+
}
|
897
|
+
|
898
|
+
RowTable.defaultProps = {
|
899
|
+
getStyles: () => { },
|
900
|
+
isClickRow: false,
|
901
|
+
onClickRow: () => { },
|
902
|
+
onClickCheckbox: () => { },
|
903
|
+
onClickActionUserView: () => { },
|
904
|
+
onClickActionListInvoice: () => { },
|
905
|
+
onClickActionListXLS: () => { },
|
906
|
+
onClickActionListCSV: () => { },
|
907
|
+
onClickActionListPDF: () => { },
|
908
|
+
onClickActionEdit: () => { },
|
909
|
+
onClickActionSendEmail: () => { },
|
910
|
+
onClickActionDelete: () => { },
|
911
|
+
onClickActionLink: () => { },
|
912
|
+
onClickActionClone: () => { },
|
913
|
+
txtTootipIconUserView: '',
|
914
|
+
txtTootipIconListInvoice: '',
|
915
|
+
txtTootipIconListListXLS: '',
|
916
|
+
txtTootipIconListListCSV: '',
|
917
|
+
txtTootipIconListListPDF: '',
|
918
|
+
txtTootipIconEdit: '',
|
919
|
+
txtTootipIconSendEmail: '',
|
920
|
+
txtTootipIconDelete: '',
|
921
|
+
txtTootipIconLink: '',
|
922
|
+
txtTootipIconClone: '',
|
923
|
+
|
924
|
+
isCheckedCheckbox: false
|
925
|
+
|
926
|
+
}
|
927
|
+
|
928
|
+
export default withStyles(styles)(RowTable)
|