imbric-theme 0.4.5 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/.dockerignore +14 -0
  2. package/.eslintignore +1 -0
  3. package/.prettierignore +1 -0
  4. package/Dockerfile +18 -0
  5. package/atoms/Button/Button.js +8 -0
  6. package/atoms/Button/Button.module.css +8 -0
  7. package/atoms/Checkbox/Checkbox.js +1 -1
  8. package/atoms/Icon/constants.js +84 -2
  9. package/atoms/Input/Input.js +5 -5
  10. package/atoms/Input/Input.stories.js +1 -1
  11. package/atoms/Input/constants.js +1 -1
  12. package/atoms/Toggle/Toggle.js +56 -0
  13. package/atoms/Toggle/Toggle.module.css +41 -0
  14. package/atoms/Toggle/Toggle.stories.js +21 -0
  15. package/atoms/Toggle/constants.js +1 -0
  16. package/atoms/Toggle/index.js +3 -0
  17. package/index.js +5 -0
  18. package/molecules/Accordion/Accordion.js +2 -0
  19. package/molecules/CardDefault/CardDefault.module.css +1 -0
  20. package/molecules/CardProductTypesBooking/CardProductTypesBooking.js +5 -3
  21. package/molecules/CardProductTypesBooking/CardProductTypesBooking.module.css +5 -1
  22. package/molecules/CardServiceDetail/CardServiceDetail.js +367 -0
  23. package/molecules/CardServiceDetail/CardServiceDetail.module.css +222 -0
  24. package/molecules/CardServiceDetail/CardServiceDetail.stories.js +23 -0
  25. package/molecules/CardServiceDetail/constants.js +1 -0
  26. package/molecules/CardServiceDetail/index.js +3 -0
  27. package/molecules/CardServices/CardServices.js +176 -46
  28. package/molecules/CardServices/CardServices.module.css +124 -4
  29. package/molecules/CardServicesFinalized/CardServicesFinalized.js +363 -0
  30. package/molecules/CardServicesFinalized/CardServicesFinalized.module.css +213 -0
  31. package/molecules/CardServicesFinalized/CardServicesFinalized.stories.js +23 -0
  32. package/molecules/CardServicesFinalized/constants.js +1 -0
  33. package/molecules/CardServicesFinalized/index.js +3 -0
  34. package/molecules/ColumnTable/ColumnTable.js +5 -3
  35. package/molecules/ColumnTable/ColumnTable.module.css +12 -0
  36. package/molecules/Dropdown/Dropdown.js +1 -1
  37. package/molecules/RowTable/RowTable.js +213 -154
  38. package/molecules/RowTable/RowTable.module.css +4 -0
  39. package/molecules/RowTable/constants.js +388 -2
  40. package/package.json +2 -1
  41. package/public/static/images/bank-cash-dollar-finance-money-payment-2-svgrepo-com.svg +13 -0
  42. package/public/static/images/buy-ecommerce-label-money-price-sale-svgrepo-com.svg +13 -0
  43. package/public/static/images/distance-svgrepo-com.svg +21 -0
  44. package/public/static/images/message-svgrepo-com.svg +15 -0
  45. package/public/static/images/pin-distance-svgrepo-com.svg +13 -0
  46. package/public/static/images/second-page-svgrepo-com copia.svg +18 -0
  47. package/public/static/images/second-page-svgrepo-com.svg +17 -0
  48. package/.eslintcache +0 -1
  49. package/storybook-static/0.263f852f.iframe.bundle.js +0 -1
  50. package/storybook-static/0.91dbd3f3aa2099d25061.manager.bundle.js +0 -1
  51. package/storybook-static/1.17e9ac7e.iframe.bundle.js +0 -3
  52. package/storybook-static/1.17e9ac7e.iframe.bundle.js.LICENSE.txt +0 -8
  53. package/storybook-static/1.17e9ac7e.iframe.bundle.js.map +0 -1
  54. package/storybook-static/2.cc4000c2.iframe.bundle.js +0 -1
  55. package/storybook-static/3.e9f95d01.iframe.bundle.js +0 -1
  56. package/storybook-static/4.be0a752c9f5176d6eec1.manager.bundle.js +0 -2
  57. package/storybook-static/4.be0a752c9f5176d6eec1.manager.bundle.js.LICENSE.txt +0 -8
  58. package/storybook-static/5.8efdde123acaf8fbb100.manager.bundle.js +0 -1
  59. package/storybook-static/6.2f82294ae0b087aecb24.manager.bundle.js +0 -2
  60. package/storybook-static/6.2f82294ae0b087aecb24.manager.bundle.js.LICENSE.txt +0 -12
  61. package/storybook-static/7.97068037.iframe.bundle.js +0 -1
  62. package/storybook-static/7.fa9452d2609e8a00f314.manager.bundle.js +0 -1
  63. package/storybook-static/8.66f5ef1c66fc4628f127.manager.bundle.js +0 -1
  64. package/storybook-static/8.b545d602.iframe.bundle.js +0 -3
  65. package/storybook-static/8.b545d602.iframe.bundle.js.LICENSE.txt +0 -12
  66. package/storybook-static/8.b545d602.iframe.bundle.js.map +0 -1
  67. package/storybook-static/9.269ed917.iframe.bundle.js +0 -1
  68. package/storybook-static/favicon.ico +0 -0
  69. package/storybook-static/iframe.html +0 -348
  70. package/storybook-static/index.html +0 -59
  71. package/storybook-static/main.157061c9.iframe.bundle.js +0 -1
  72. package/storybook-static/main.5a07347846ccf2d7e5dc.manager.bundle.js +0 -1
  73. package/storybook-static/runtime~main.a14e6e62.iframe.bundle.js +0 -1
  74. package/storybook-static/runtime~main.f78c3fae275fc212c109.manager.bundle.js +0 -1
  75. package/storybook-static/static/logo.svg +0 -19
  76. package/storybook-static/static/logologin.svg +0 -16
  77. package/storybook-static/static/logotipo.svg +0 -50
  78. package/storybook-static/static/logotipoS.svg +0 -26
  79. package/storybook-static/vendors~main.720e76f4.iframe.bundle.js +0 -3
  80. package/storybook-static/vendors~main.720e76f4.iframe.bundle.js.LICENSE.txt +0 -110
  81. package/storybook-static/vendors~main.720e76f4.iframe.bundle.js.map +0 -1
  82. package/storybook-static/vendors~main.fcd0b2a3431ddf75f5f7.manager.bundle.js +0 -2
  83. package/storybook-static/vendors~main.fcd0b2a3431ddf75f5f7.manager.bundle.js.LICENSE.txt +0 -101
@@ -9,6 +9,9 @@ import Moment from 'react-moment'
9
9
  import Icon from '../../atoms/Icon'
10
10
  import Picture from '../../atoms/Picture'
11
11
  import Check from '../../atoms/Check'
12
+ import Toggle from '../../atoms/Toggle'
13
+
14
+
12
15
  import { Horizontal, Vertical } from '../../layout/Spacer/components'
13
16
 
14
17
  export const RowTable = ({
@@ -31,7 +34,7 @@ export const RowTable = ({
31
34
  }) => {
32
35
 
33
36
 
34
-
37
+ const [loading, setLoading] = useState(false)
35
38
 
36
39
  // const handleEditStaff = (e, item) => {
37
40
  // console.log(item)
@@ -39,17 +42,45 @@ export const RowTable = ({
39
42
  // }
40
43
 
41
44
 
42
- // const handleClick = () => () => {
43
- // // onClick()
45
+ const handleClickCheckbox = (e, item) => {
44
46
 
45
- // isChecked ? setIsChecked(false) : setIsChecked(true)
46
47
 
47
- // }
48
+ for (const iterator of slice) {
49
+
50
+ if (iterator.id === item.id) {
51
+ item.isSelected ? iterator.isSelected = false : iterator.isSelected = true
52
+
53
+ iterator.isSelected = item.isSelected
54
+ }
55
+
56
+ }
57
+
58
+ setLoading(true)
59
+
60
+ hola()
61
+
62
+ // return slice
63
+
64
+ // console.log(e, item)
65
+ }
66
+
67
+ const hola = () => {
68
+
69
+ setTimeout(() => {
70
+ setLoading(false)
71
+ }, 100)
72
+
73
+
74
+
75
+ }
76
+
48
77
 
49
78
 
50
79
  return (
51
80
  <div className={getStyles('tbl-content')}>
52
81
  <table className={getStyles('table')} cellPadding="0" cellSpacing="0" border="0">
82
+
83
+
53
84
  <tbody>
54
85
  {slice.map((item, index) => (
55
86
 
@@ -59,203 +90,230 @@ export const RowTable = ({
59
90
  itemTd.activeView ?
60
91
  (
61
92
 
62
-
63
93
  itemTd.isCheckbox
64
94
 
65
95
  ?
66
- <td
67
- className={getStyles('td', 'tdacction')}
68
- key={[itemTd.accessor]}
69
- onClick={(e) => {
70
- onClickCheckbox(e, item)
71
- // isChecked ? setIsChecked(false) : setIsChecked(true)
72
- }}>
73
-
74
- <Check id={item[itemTd.accessor]} isChecked={isCheckedCheckbox}
75
-
76
- />
77
- </td>
96
+ !loading ? (
97
+ <td
98
+ className={getStyles('td', 'tdacction')}
99
+ key={[itemTd.accessor]}
100
+ >
101
+
102
+ {/* <Check id={item[itemTd.accessor]} isChecked={item.isSelected} /> */}
103
+
104
+ <Toggle
105
+ id={item[itemTd.accessor]}
106
+ checked={item.isSelected}
107
+ label=""
108
+ onChangeCheckbox={(e) => { handleClickCheckbox(e, item) }}
109
+ />
110
+
111
+ </td>
112
+ )
113
+ : null
78
114
  :
79
115
 
80
116
 
81
- itemTd.isPicture
117
+ itemTd.isArrayObject
82
118
 
83
119
  ?
84
- <td className={getStyles('td', 'tdacction')} key={[itemTd.accessor]}>
85
- <Picture
86
- src={item[itemTd.accessor]}
87
- width={50}
88
- />
120
+
121
+ <td className={getStyles('td')} key={[itemTd.accessor]}>
122
+
123
+ {item[itemTd.accessor].map((itemTdObj, index, array) => (
124
+
125
+ <span key={itemTdObj.id}>{itemTdObj[itemTd.subAccessor]}
126
+
127
+ {array.length - 1 !== index ?
128
+ <span>, </span> : null }
129
+
130
+ </span>
131
+
132
+ ))}
133
+
89
134
  </td>
90
- :
91
135
 
92
- itemTd.subAccessor === 'action'
136
+ :
93
137
 
94
- ?
95
138
 
96
- <td className={getStyles('td')} key={[itemTd.accessor]}>
97
-
98
- {itemTd.viewUserView ?
99
- <>
100
- <Icon
101
- background="base"
102
- name="userView"
103
- onClick={(e) => { onClickActionUserView(e, item) }}
104
- />
105
- <Horizontal size="xs" />
106
- </>
107
- : null}
108
-
109
-
110
- {itemTd.viewListInvoice ?
111
- <>
112
- <Icon
113
- background="base"
114
- name="listInvoice"
115
- onClick={(e) => { onClickActionListInvoice(e, item) }}
116
- />
117
- <Horizontal size="xs" />
118
- </>
119
- : null}
120
-
121
- {itemTd.viewListXLS ?
122
- <>
123
- <Icon
124
- background="base"
125
- name="listXLS"
126
- onClick={(e) => { onClickActionListXLS(e, item) }}
127
- />
128
- <Horizontal size="xs" />
129
- </>
130
- : null}
131
-
132
- {itemTd.viewListCSV ?
133
- <>
134
- <Icon
135
- background="base"
136
- name="listCSV"
137
- onClick={(e) => { onClickActionListCSV(e, item) }}
138
- />
139
- <Horizontal size="xs" />
140
- </>
141
- : null}
142
-
143
- {itemTd.viewListPDF ?
144
- <>
145
- <Icon
146
- background="base"
147
- name="listPDF"
148
- onClick={(e) => { onClickActionListPDF(e, item) }}
149
- />
150
- <Horizontal size="xs" />
151
- </>
152
- : null}
153
-
154
-
155
-
156
- {itemTd.viewEdit ?
157
- <>
158
- <Icon
159
- background="base"
160
- name="edit"
161
- onClick={(e) => { onClickActionEdit(e, item) }}
162
- />
163
- <Horizontal size="xs" />
164
- </>
165
- : null}
166
-
167
- {itemTd.viewEmailSend ?
168
- <>
169
- <Icon
170
- background="base"
171
- name="sendEmail"
172
- // onClick={(e) => onClickEdit(e, item)}
173
- onClick={e => { onClickActionSendEmail(e, item) }}
174
- />
175
- <Horizontal size="xs" />
176
- </>
177
- : null}
178
-
179
- {itemTd.viewTrash ?
180
- <>
181
- <Icon
182
- background="base"
183
- name="trash"
184
- // onClick={(e) => onClickEdit(e, item)}
185
- onClick={e => { onClickActionDelete(e, item) }}
186
- />
187
- <Horizontal size="xs" />
188
- </>
189
- : null}
139
+ itemTd.isPicture
190
140
 
141
+ ?
142
+ <td className={getStyles('td', 'tdacction')} key={[itemTd.accessor]}>
143
+ <Picture
144
+ src={item[itemTd.accessor]}
145
+ width={50}
146
+ />
191
147
  </td>
192
-
193
148
  :
194
149
 
195
- itemTd.subAccessor !== ''
150
+ itemTd.subAccessor === 'action'
196
151
 
197
152
  ?
198
153
 
199
- <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor][itemTd.subAccessor]}</td>
154
+ <td className={getStyles('td', 'tdacctionIcons')} key={[itemTd.accessor]}>
155
+
156
+ {itemTd.viewUserView ?
157
+ <>
158
+ <Icon
159
+ background="base"
160
+ name="userView"
161
+ onClick={(e) => { onClickActionUserView(e, item) }}
162
+ />
163
+ <Horizontal size="xs" />
164
+ </>
165
+ : null}
166
+
167
+
168
+ {itemTd.viewListInvoice ?
169
+ <>
170
+ <Icon
171
+ background="base"
172
+ name="listInvoice"
173
+ onClick={(e) => { onClickActionListInvoice(e, item) }}
174
+ />
175
+ <Horizontal size="xs" />
176
+ </>
177
+ : null}
178
+
179
+ {itemTd.viewListXLS && item.fileType === 'xls' ?
180
+ <>
181
+ <Icon
182
+ background="base"
183
+ name="listXLS"
184
+ onClick={(e) => { onClickActionListXLS(e, item) }}
185
+ />
186
+ <Horizontal size="xs" />
187
+ </>
188
+ : null}
189
+
190
+ {itemTd.viewListCSV && item.fileType === 'xml' ?
191
+ <>
192
+ <Icon
193
+ background="base"
194
+ name="listCSV"
195
+ onClick={(e) => { onClickActionListCSV(e, item) }}
196
+ />
197
+ <Horizontal size="xs" />
198
+ </>
199
+ : null}
200
+
201
+ {itemTd.viewListPDF && item.fileType === 'pdf' ?
202
+ <>
203
+ <Icon
204
+ background="base"
205
+ name="listPDF"
206
+ onClick={(e) => { onClickActionListPDF(e, item) }}
207
+ />
208
+ <Horizontal size="xs" />
209
+ </>
210
+ : null}
211
+
212
+
213
+
214
+ {itemTd.viewEdit ?
215
+ <>
216
+ <Icon
217
+ background="base"
218
+ name="edit"
219
+ onClick={(e) => { onClickActionEdit(e, item) }}
220
+ />
221
+ <Horizontal size="xs" />
222
+ </>
223
+ : null}
224
+
225
+ {itemTd.viewEmailSend ?
226
+ <>
227
+ <Icon
228
+ background="base"
229
+ name="sendEmail"
230
+ // onClick={(e) => onClickEdit(e, item)}
231
+ onClick={e => { onClickActionSendEmail(e, item) }}
232
+ />
233
+ <Horizontal size="xs" />
234
+ </>
235
+ : null}
236
+
237
+ {itemTd.viewTrash ?
238
+ <>
239
+ <Icon
240
+ background="base"
241
+ name="trash"
242
+ // onClick={(e) => onClickEdit(e, item)}
243
+ onClick={e => { onClickActionDelete(e, item) }}
244
+ />
245
+ <Horizontal size="xs" />
246
+ </>
247
+ : null}
248
+
249
+ </td>
200
250
 
201
251
  :
202
252
 
203
- itemTd.typeFilter === 'date'
253
+ itemTd.subAccessor !== ''
204
254
 
205
255
  ?
206
256
 
207
- <td className={getStyles('td')} key={[itemTd.accessor]}>
208
- <Moment format="DD/MM/YYYY hh:mm:ss">
209
- {item[itemTd.accessor]}
210
- </Moment>
211
- </td>
257
+ <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor][itemTd.subAccessor]}</td>
212
258
 
213
259
  :
214
260
 
215
- itemTd.typeFilter === 'select'
261
+ itemTd.typeFilter === 'date'
216
262
 
217
263
  ?
218
264
 
219
- itemTd.optionsSelect.map((itemSelect) => (
265
+ <td className={getStyles('td')} key={[itemTd.accessor]}>
266
+ <Moment format="DD/MM/YYYY hh:mm:ss">
267
+ {item[itemTd.accessor]}
268
+ </Moment>
269
+ </td>
220
270
 
271
+ :
221
272
 
222
- item[itemTd.accessor] === itemSelect.value ?
273
+ itemTd.typeFilter === 'select'
223
274
 
224
- <td className={getStyles('td')} key={[itemTd.accessor]}>
225
- {itemSelect.label}
226
- </td>
275
+ ?
227
276
 
228
- :
277
+ itemTd.optionsSelect.map((itemSelect) => (
229
278
 
230
- null
231
- ))
232
279
 
233
- :
280
+ item[itemTd.accessor] === itemSelect.value ?
234
281
 
235
- itemTd.typeFilter === 'number'
282
+ <td className={getStyles('td')} key={[itemTd.accessor]}>
283
+ {itemSelect.label}
284
+ </td>
236
285
 
237
- ?
286
+ :
238
287
 
239
- itemTd.subTypeFilter
288
+ null
289
+ ))
290
+
291
+ :
292
+
293
+ itemTd.typeFilter === 'number'
240
294
 
241
295
  ?
242
296
 
243
- itemTd.characterExtra === 'km'
297
+ itemTd.subTypeFilter
298
+
244
299
  ?
245
- <td className={getStyles('td')} key={[itemTd.accessor]}>{(item[itemTd.accessor] / 1000).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
300
+
301
+ itemTd.characterExtra === 'km'
302
+ ?
303
+ <td className={getStyles('td')} key={[itemTd.accessor]}>{(item[itemTd.accessor] / 1000).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
304
+ :
305
+ <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
246
306
  :
247
- <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
248
- :
249
- <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
307
+ <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
250
308
 
251
- :
309
+ :
252
310
 
253
- itemTd.subTypeFilter
311
+ itemTd.subTypeFilter
254
312
 
255
- ?
256
- <td className={getStyles('td')} key={[itemTd.accessor]}>{Number(item[itemTd.accessor]).toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
257
- :
258
- <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
313
+ ?
314
+ <td className={getStyles('td')} key={[itemTd.accessor]}>{Number(item[itemTd.accessor]).toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
315
+ :
316
+ <td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
259
317
 
260
318
  ) : null
261
319
  ))}
@@ -264,6 +322,7 @@ export const RowTable = ({
264
322
  ))}
265
323
  </tbody>
266
324
  </table>
325
+
267
326
  </div>
268
327
  )
269
328
  }
@@ -27,6 +27,10 @@
27
27
  width: 80px;
28
28
  }
29
29
 
30
+ .tdacctionIcons {
31
+ text-align: right;
32
+ }
33
+
30
34
  .tr-content:hover {
31
35
  background-color: #edf1fe;
32
36
  cursor: pointer;