imbric-theme 1.1.5 → 1.1.6

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.
@@ -13,9 +13,6 @@ import { Horizontal, Vertical } from '../../layout/Spacer/components'
13
13
  import ReactTooltip from 'react-tooltip'
14
14
  import Checkbox from '../../atoms/Checkbox/Checkbox'
15
15
 
16
-
17
-
18
-
19
16
  export const DynamicTable = ({
20
17
  getStyles,
21
18
  optionsData,
@@ -78,13 +75,13 @@ export const DynamicTable = ({
78
75
  isMultiSelectFilter,
79
76
  dateRangeDefault,
80
77
  }) => {
81
-
82
78
  const [tableData, setTableData] = useState(optionsData)
83
79
  const [columnsData, setColumnsData] = useState(opColumns)
84
80
  const [addColumsData, setAddColumsData] = useState(opAddColumns)
85
81
  const [filterTableData, setFilterTableData] = useState(opFilterTable)
86
- const [filterSecondaryTableData, setFilterSecondaryTableData] = useState(opFilterSecondaryTable)
87
-
82
+ const [filterSecondaryTableData, setFilterSecondaryTableData] = useState(
83
+ opFilterSecondaryTable
84
+ )
88
85
 
89
86
  // STATE TOOLTIP
90
87
  const [isToolTipMounted, setIsToolTipMounted] = useState(false)
@@ -110,21 +107,20 @@ export const DynamicTable = ({
110
107
  const handleSorting = (sortField, sortOrder) => {
111
108
  if (sortField) {
112
109
  const sorted = [...tableData].sort((a, b) => {
113
- if (a[sortField] === null) return 1;
114
- if (b[sortField] === null) return -1;
115
- if (a[sortField] === null && b[sortField] === null) return 0;
110
+ if (a[sortField] === null) return 1
111
+ if (b[sortField] === null) return -1
112
+ if (a[sortField] === null && b[sortField] === null) return 0
116
113
  return (
117
- a[sortField].toString().localeCompare(b[sortField].toString(), "en", {
114
+ a[sortField].toString().localeCompare(b[sortField].toString(), 'en', {
118
115
  numeric: true,
119
- }) * (sortOrder === "asc" ? 1 : -1)
120
- );
121
- });
122
- setTableData(sorted);
116
+ }) * (sortOrder === 'asc' ? 1 : -1)
117
+ )
118
+ })
119
+ setTableData(sorted)
123
120
  }
124
121
  }
125
122
 
126
123
  const handleChangeCheckboxDateMy = (op) => {
127
-
128
124
  if (op.target.checked) {
129
125
  setCheckboxCheckboxDate(true)
130
126
  setDisabledDate(false)
@@ -132,74 +128,50 @@ export const DynamicTable = ({
132
128
  setCheckboxCheckboxDate(false)
133
129
  setDisabledDate(true)
134
130
  }
135
-
136
131
  }
137
132
 
138
133
  return (
139
-
140
-
141
134
  <div className={getStyles('opFunction')}>
142
-
143
-
144
135
  <div className={getStyles('opFunctionBoxTotal2')}>
145
-
146
136
  {isViewTitleTable ? (
147
-
148
137
  <>
149
-
150
138
  <div className={getStyles('opFunctionBox1')}>
151
-
152
- <Paragraph weight="semibold" size="md">{titleHeadingTable}</Paragraph>
153
-
139
+ <Paragraph weight="semibold" size="md">
140
+ {titleHeadingTable}
141
+ </Paragraph>
154
142
  </div>
155
143
 
156
144
  <Horizontal size="sm" />
157
-
158
145
  </>
159
-
160
146
  ) : null}
161
147
 
162
148
  {isViewTitleTableSecundary ? (
163
-
164
149
  <>
165
150
  <div className={getStyles('opFunctionBox1')}>
166
-
167
- <Paragraph weight="semibold" size="md">{titleHeadingTableSecundary}</Paragraph>
168
-
151
+ <Paragraph weight="semibold" size="md">
152
+ {titleHeadingTableSecundary}
153
+ </Paragraph>
169
154
  </div>
170
155
 
171
156
  <Horizontal size="sm" />
172
157
  </>
173
158
  ) : null}
174
159
 
175
-
176
160
  {isViewLeftBtn ? (
177
-
178
161
  <>
179
-
180
-
181
162
  <div className={getStyles('opFunctionBox3')}>
182
-
183
- <Button
184
- type={typeBtn}
185
- isInline={true}
186
- onClick={handleBtn}
187
- >
163
+ <Button type={typeBtn} isInline={true} onClick={handleBtn}>
188
164
  {titleBtn}
189
165
  </Button>
190
-
191
166
  </div>
192
167
 
193
168
  <Horizontal size="sm" />
194
-
195
169
  </>
196
170
  ) : null}
197
171
 
198
172
  {isViewLeftBtnSecondary ? (
199
-
200
173
  <>
201
174
  <div className={getStyles('opFunctionBox3')}>
202
-
203
175
  <Button
204
176
  type={typeBtnSecondary}
205
177
  isInline={true}
@@ -207,20 +179,15 @@ export const DynamicTable = ({
207
179
  >
208
180
  {titleBtnSecondary}
209
181
  </Button>
210
-
211
182
  </div>
212
183
 
213
184
  <Horizontal size="sm" />
214
-
215
185
  </>
216
186
  ) : null}
217
187
 
218
188
  {isViewLeftBtnTertiary ? (
219
-
220
189
  <>
221
-
222
190
  <div className={getStyles('opFunctionBox3')}>
223
-
224
191
  <Button
225
192
  type={typeBtnTertiary}
226
193
  isInline={true}
@@ -228,21 +195,15 @@ export const DynamicTable = ({
228
195
  >
229
196
  {titleBtnTertiary}
230
197
  </Button>
231
-
232
198
  </div>
233
199
 
234
200
  <Horizontal size="sm" />
235
-
236
201
  </>
237
202
  ) : null}
238
203
 
239
-
240
204
  {isViewLeftBtnExtra ? (
241
-
242
205
  <>
243
-
244
206
  <div className={getStyles('opFunctionBox3')}>
245
-
246
207
  <Button
247
208
  type={typeBtnExtra}
248
209
  isInline={true}
@@ -250,15 +211,12 @@ export const DynamicTable = ({
250
211
  >
251
212
  {titleBtnExtra}
252
213
  </Button>
253
-
254
214
  </div>
255
215
 
256
216
  <Horizontal size="sm" />
257
-
258
217
  </>
259
218
  ) : null}
260
219
 
261
-
262
220
  {isViewRange ? (
263
221
  <div className={getStyles('opFunctionBox1')}>
264
222
  <DatePicker
@@ -270,26 +228,21 @@ export const DynamicTable = ({
270
228
  />
271
229
  </div>
272
230
  ) : null}
273
-
274
231
  </div>
275
232
  <div className={getStyles('opFunctionBox2')}>
276
-
277
-
278
233
  {isViewRangeSecundary ? (
279
234
  <>
280
-
281
235
  <Checkbox
282
236
  id={'dateSecundary'}
283
237
  name={'dateSecundary'}
284
238
  label={'Fecha creación'}
285
- onChange={op => (
286
- handleChangeCheckboxDate(op),
287
- handleChangeCheckboxDateMy(op)
239
+ onChange={(op) => (
240
+ handleChangeCheckboxDate(op), handleChangeCheckboxDateMy(op)
288
241
  )}
289
242
  value={dataCheckboxCheckboxDate}
290
- // handleClick={handleClickCheck(values[name])}
291
- // onChange={formikLoginCompany.handleChange}
292
- // value={formikLoginCompany.values.terms1}
243
+ // handleClick={handleClickCheck(values[name])}
244
+ // onChange={formikLoginCompany.handleChange}
245
+ // value={formikLoginCompany.values.terms1}
293
246
  />
294
247
 
295
248
  <div className={getStyles('opFunctionBox1')}>
@@ -303,18 +256,15 @@ export const DynamicTable = ({
303
256
  </div>
304
257
 
305
258
  <Horizontal size="sm" />
306
-
307
259
  </>
308
260
  ) : null}
309
261
 
310
-
311
262
  {isViewFilterTable ? (
312
-
313
263
  <>
314
264
  <div className={getStyles('opFunctionBox3')}>
315
265
  <Label>{labelDinamicSelectFilter}</Label>
316
266
 
317
- {isLoadingDinamicSelectFilter ?
267
+ {isLoadingDinamicSelectFilter ? (
318
268
  <DynamicSelect
319
269
  isInline
320
270
  onChange={handleFilterTable}
@@ -325,25 +275,21 @@ export const DynamicTable = ({
325
275
  isClearable={false}
326
276
  instanceId={'idFilterTableAll'}
327
277
  isMulti={isMultiSelectFilter}
328
- // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
329
- /> : null
330
- }
331
-
278
+ // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
279
+ />
280
+ ) : null}
332
281
  </div>
333
282
 
334
283
  <Horizontal size="xs" />
335
-
336
284
  </>
337
285
  ) : null}
338
286
 
339
-
340
287
  {isViewFilterSecondaryTable ? (
341
-
342
288
  <>
343
289
  <div className={getStyles('opFunctionBox3')}>
344
290
  <Label>{labelDinamicSelectFilterSecondary}</Label>
345
291
 
346
- {isLoadingDinamicSelectFilterSecondary ?
292
+ {isLoadingDinamicSelectFilterSecondary ? (
347
293
  <DynamicSelect
348
294
  isInline
349
295
  onChange={handleFilterSecondaryTable}
@@ -353,26 +299,21 @@ export const DynamicTable = ({
353
299
  closeMenuOnSelect={false}
354
300
  isClearable={false}
355
301
  instanceId={'idFilterSecondaryTableAll'}
356
- // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
357
- /> : null
358
- }
359
-
302
+ // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
303
+ />
304
+ ) : null}
360
305
  </div>
361
306
 
362
307
  <Horizontal size="xs" />
363
-
364
308
  </>
365
309
  ) : null}
366
310
 
367
-
368
-
369
311
  {isViewAddColumn ? (
370
-
371
312
  <>
372
313
  <div className={getStyles('opFunctionBox3')}>
373
314
  <Label>{labelDinamicSelect}</Label>
374
315
 
375
- {isLoadingDinamicSelect ?
316
+ {isLoadingDinamicSelect ? (
376
317
  <DynamicSelect
377
318
  isMulti
378
319
  isInline
@@ -382,10 +323,9 @@ export const DynamicTable = ({
382
323
  defaultValue={handleDefaultValue}
383
324
  closeMenuOnSelect={false}
384
325
  instanceId={'idAddColumsTable'}
385
- // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
386
- /> : null
387
- }
388
-
326
+ // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
327
+ />
328
+ ) : null}
389
329
  </div>
390
330
 
391
331
  <Horizontal size="xs" />
@@ -393,33 +333,22 @@ export const DynamicTable = ({
393
333
  ) : null}
394
334
 
395
335
  {isViewBtn ? (
396
-
397
336
  <>
398
-
399
337
  <div className={getStyles('opFunctionBox3')}>
400
-
401
- <Button
402
- type={typeBtn}
403
- isInline={true}
404
- onClick={handleBtn}
405
- >
338
+ <Button type={typeBtn} isInline={true} onClick={handleBtn}>
406
339
  {titleBtn}
407
340
  </Button>
408
-
409
341
  </div>
410
342
 
411
343
  <Horizontal size="xs" />
412
-
413
344
  </>
414
345
  ) : null}
415
346
 
416
347
  {isViewDownloadDoc ? (
417
- <div id='boxFileDownload' className={getStyles('opFunctionBox3')}>
418
-
419
-
348
+ <div id="boxFileDownload" className={getStyles('opFunctionBox3')}>
420
349
  <span
421
350
  data-tip
422
- data-for='fileDownload'
351
+ data-for="fileDownload"
423
352
  onMouseEnter={handleMouseEnter}
424
353
  onMouseLeave={handleMouseLeave}
425
354
  >
@@ -429,21 +358,16 @@ export const DynamicTable = ({
429
358
  name="fileDownload"
430
359
  onClick={handleDownloadExcel}
431
360
  />
432
-
433
361
  </span>
434
362
 
435
363
  {isToolTipMounted ? (
436
- <ReactTooltip id='fileDownload' type='error'>
364
+ <ReactTooltip id="fileDownload" type="error">
437
365
  <span>{txtTootipFileDownload}</span>
438
366
  </ReactTooltip>
439
367
  ) : null}
440
-
441
-
442
368
  </div>
443
369
  ) : null}
444
-
445
370
  </div>
446
-
447
371
  </div>
448
372
 
449
373
  // <ColumnTable
@@ -456,9 +380,7 @@ export const DynamicTable = ({
456
380
 
457
381
  // <RowTable slice={slice} columnsData={columnsData}></RowTable>
458
382
 
459
- // <FooterTable range={range} slice={slice} setPage={setPage} page={page} />
460
-
461
-
383
+ // <FooterTable range={range} slice={slice} setPage={setPage} page={page} />
462
384
  )
463
385
  }
464
386
 
@@ -517,10 +439,10 @@ DynamicTable.propTypes = {
517
439
  }
518
440
 
519
441
  DynamicTable.defaultProps = {
520
- getStyles: () => { },
521
- handleAddColumn: () => { },
522
- handleFilterTable: () => { },
523
- handleFilterSecondaryTable: () => { },
442
+ getStyles: () => {},
443
+ handleAddColumn: () => {},
444
+ handleFilterTable: () => {},
445
+ handleFilterSecondaryTable: () => {},
524
446
  isViewRange: true,
525
447
  isViewRangeSecundary: false,
526
448
  isViewTitleTable: false,
@@ -532,9 +454,9 @@ DynamicTable.defaultProps = {
532
454
  isViewBtn: false,
533
455
  isViewLeftBtn: false,
534
456
  isLayoutDate: 'Calendar',
535
- handleSelectRange: () => { },
536
- handleSelectRangeSecundary: () => { },
537
- handleDownloadExcel: () => { },
457
+ handleSelectRange: () => {},
458
+ handleSelectRangeSecundary: () => {},
459
+ handleDownloadExcel: () => {},
538
460
  labelDinamicSelect: 'Mostrar u ocultar columnas',
539
461
  placeholderDinamicSelect: 'Seleccionar columnas',
540
462
  labelDinamicSelectFilter: '',
@@ -547,7 +469,7 @@ DynamicTable.defaultProps = {
547
469
  labelTillDateRangeSecundary: 'Hasta',
548
470
  typeBtn: 'primary',
549
471
  titleBtn: '',
550
- handleBtn: () => { },
472
+ handleBtn: () => {},
551
473
  isViewLeftBtnSecondary: false,
552
474
  isViewLeftBtnTertiary: false,
553
475
  isViewLeftBtnExtra: false,
@@ -557,9 +479,9 @@ DynamicTable.defaultProps = {
557
479
  titleBtnSecondary: '',
558
480
  titleBtnTertiary: '',
559
481
  titleBtnExtra: '',
560
- handleBtnSecondary: () => { },
561
- handleBtnTertiary: () => { },
562
- handleBtnExtra: () => { },
482
+ handleBtnSecondary: () => {},
483
+ handleBtnTertiary: () => {},
484
+ handleBtnExtra: () => {},
563
485
  txtTootipFileDownload: '',
564
486
  titleHeadingTable: 'Total: 200',
565
487
  titleHeadingTableSecundary: '',
@@ -1,12 +1,13 @@
1
1
  import React, { useState } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import ReactTooltip from 'react-tooltip'
4
- import { Horizontal, Vertical } from '../../layout/Spacer/components'
4
+ // import { Horizontal, Vertical } from '../../layout/Spacer/components'
5
5
  import Label from '../../atoms/Label'
6
6
  import Icon from '../../atoms/Icon'
7
+ import Button from '../../atoms/Button'
7
8
 
8
9
  import styles from './CardServiceDetail.module.css'
9
- import { options } from './constants'
10
+ // import { options } from './constants'
10
11
  import withStyles from '../../hocs/withStyles'
11
12
 
12
13
  export const handleClick = ({ onClick }) => (event) => {
@@ -20,8 +21,8 @@ export const CardServiceDetail = ({
20
21
  txtInfoLabel,
21
22
  txtUserService,
22
23
  statusService,
23
- txtZoneService,
24
- txtTimeTotalService,
24
+ // txtZoneService,
25
+ // txtTimeTotalService,
25
26
  txtDistanceService,
26
27
  txtServiceService,
27
28
  txtPayService,
@@ -34,8 +35,8 @@ export const CardServiceDetail = ({
34
35
  onClickCross,
35
36
  txtTootipCross,
36
37
  labelUserService,
37
- labelZoneService,
38
- labelTimeTotalService,
38
+ // labelZoneService,
39
+ // labelTimeTotalService,
39
40
  labelDistanceService,
40
41
  labelServiceService,
41
42
  labelPayService,
@@ -45,6 +46,12 @@ export const CardServiceDetail = ({
45
46
  labelCarNumberService,
46
47
  labelNumberDriverService,
47
48
  labelSmsDriverService,
49
+ labelPhoneNumberSupplierService,
50
+ txtPhoneNumberSupplierService,
51
+ labelPhoneNumberTaxiDriverService,
52
+ txtPhoneNumberTaxiDriverService,
53
+ canRequestCallFromDriver,
54
+ onClickBtnCanRequestCallFromDriver,
48
55
  }) => {
49
56
  // STATE TOOLTIP
50
57
  const [isToolTipMounted, setIsToolTipMounted] = useState(false)
@@ -108,6 +115,18 @@ export const CardServiceDetail = ({
108
115
  </div>
109
116
  </div>
110
117
 
118
+ {txtPhoneNumberSupplierService ? (
119
+ <div className={getStyles('card-content')}>
120
+ <div className={getStyles('card-subcontent-inLine')}>
121
+ <Label>{labelPhoneNumberSupplierService}</Label>
122
+
123
+ <p className={getStyles('card-content-p')}>
124
+ &nbsp; {txtPhoneNumberSupplierService}
125
+ </p>
126
+ </div>
127
+ </div>
128
+ ) : null}
129
+
111
130
  <div className={getStyles('card-content')}>
112
131
  <div className={getStyles('card-subcontent')}>
113
132
  <Label>
@@ -130,6 +149,31 @@ export const CardServiceDetail = ({
130
149
  </div>
131
150
  </div>
132
151
 
152
+ {txtPhoneNumberTaxiDriverService ? (
153
+ <div className={getStyles('card-content')}>
154
+ <div className={getStyles('card-subcontent-inLine')}>
155
+ <Label>{labelPhoneNumberTaxiDriverService}</Label>
156
+
157
+ <p className={getStyles('card-content-p')}>
158
+ &nbsp; {txtPhoneNumberTaxiDriverService}
159
+ </p>
160
+ </div>
161
+ </div>
162
+ ) : null}
163
+
164
+ {canRequestCallFromDriver ? (
165
+ <div className={getStyles('card-content-btn')}>
166
+ <div className={getStyles('card-subcontent-inLine')}>
167
+ <Button
168
+ type="primary"
169
+ onClick={onClickBtnCanRequestCallFromDriver}
170
+ >
171
+ Solicitar que el conductor me llame
172
+ </Button>
173
+ </div>
174
+ </div>
175
+ ) : null}
176
+
133
177
  <div className={getStyles('card-content')}>
134
178
  {/* <div className={getStyles('card-subcontent')}>
135
179
  <Label>
@@ -254,8 +298,8 @@ CardServiceDetail.propTypes = {
254
298
  txtInfoLabel: PropTypes.any,
255
299
  statusService: PropTypes.number,
256
300
  txtUserService: PropTypes.string,
257
- txtZoneService: PropTypes.string,
258
- txtTimeTotalService: PropTypes.string,
301
+ // txtZoneService: PropTypes.string,
302
+ // txtTimeTotalService: PropTypes.string,
259
303
  txtDistanceService: PropTypes.string,
260
304
  txtServiceService: PropTypes.string,
261
305
  txtPayService: PropTypes.string,
@@ -269,8 +313,8 @@ CardServiceDetail.propTypes = {
269
313
  txtTootipCross: PropTypes.string,
270
314
  selectCard: PropTypes.bool,
271
315
  labelUserService: PropTypes.string,
272
- labelZoneService: PropTypes.string,
273
- labelTimeTotalService: PropTypes.string,
316
+ // labelZoneService: PropTypes.string,
317
+ // labelTimeTotalService: PropTypes.string,
274
318
  labelDistanceService: PropTypes.string,
275
319
  labelServiceService: PropTypes.string,
276
320
  labelPayService: PropTypes.string,
@@ -280,6 +324,12 @@ CardServiceDetail.propTypes = {
280
324
  labelCarNumberService: PropTypes.string,
281
325
  labelNumberDriverService: PropTypes.string,
282
326
  labelSmsDriverService: PropTypes.string,
327
+ txtPhoneNumberSupplierService: PropTypes.string,
328
+ labelPhoneNumberSupplierService: PropTypes.string,
329
+ labelPhoneNumberTaxiDriverService: PropTypes.string,
330
+ txtPhoneNumberTaxiDriverService: PropTypes.string,
331
+ onClickBtnCanRequestCallFromDriver: PropTypes.func,
332
+ canRequestCallFromDriver: PropTypes.bool,
283
333
  }
284
334
 
285
335
  CardServiceDetail.defaultProps = {
@@ -287,8 +337,8 @@ CardServiceDetail.defaultProps = {
287
337
  txtInfoLabel: '',
288
338
  statusService: 10,
289
339
  txtUserService: '',
290
- txtZoneService: '',
291
- txtTimeTotalService: '',
340
+ // txtZoneService: '',
341
+ // txtTimeTotalService: '',
292
342
  txtDistanceService: '',
293
343
  txtServiceService: '',
294
344
  txtPayService: '',
@@ -302,8 +352,8 @@ CardServiceDetail.defaultProps = {
302
352
  txtTootipCross: 'Cerrar',
303
353
  selectCard: false,
304
354
  labelUserService: 'Creado por:',
305
- labelZoneService: 'Recogida',
306
- labelTimeTotalService: 'Tiempo estimado',
355
+ // labelZoneService: 'Recogida',
356
+ // labelTimeTotalService: 'Tiempo estimado',
307
357
  labelDistanceService: 'Distancia',
308
358
  labelServiceService: 'Servicio',
309
359
  labelPayService: 'Método de pago',
@@ -313,6 +363,12 @@ CardServiceDetail.defaultProps = {
313
363
  labelCarNumberService: ' Matrícula',
314
364
  labelNumberDriverService: ' Telefono conductor',
315
365
  labelSmsDriverService: 'Mensaje al conductor',
366
+ txtPhoneNumberSupplierService: '',
367
+ labelPhoneNumberSupplierService: 'Teléfono de la flota',
368
+ txtPhoneNumberTaxiDriverService: '',
369
+ labelPhoneNumberTaxiDriverService: 'Teléfono del conductor',
370
+ onClickBtnCanRequestCallFromDriver: () => {},
371
+ canRequestCallFromDriver: false,
316
372
  }
317
373
 
318
374
  export default withStyles(styles)(CardServiceDetail)