imbric-theme 0.9.0 → 1.0.1

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.
@@ -7,10 +7,13 @@ import DynamicSelect from '../../molecules/DynamicSelect'
7
7
  import DatePicker from '../../molecules/DatePicker'
8
8
  import Label from '../../atoms/Label'
9
9
  import Icon from '../../atoms/Icon'
10
+ import Paragraph from '../../atoms/Paragraph'
10
11
  import Button from '../../atoms/Button'
11
12
  import { Horizontal, Vertical } from '../../layout/Spacer/components'
12
13
  import ReactTooltip from 'react-tooltip'
13
- import Heading from '../../atoms/Heading/Heading'
14
+ import Checkbox from '../../atoms/Checkbox/Checkbox'
15
+
16
+
14
17
 
15
18
 
16
19
  export const DynamicTable = ({
@@ -21,7 +24,9 @@ export const DynamicTable = ({
21
24
  opFilterTable,
22
25
  isLayoutDate,
23
26
  isViewRange,
27
+ isViewRangeSecundary,
24
28
  isViewTitleTable,
29
+ isViewTitleTableSecundary,
25
30
  isViewAddColumn,
26
31
  isViewFilterTable,
27
32
  isViewBtn,
@@ -41,6 +46,7 @@ export const DynamicTable = ({
41
46
  handleAddColumn,
42
47
  handleFilterTable,
43
48
  handleSelectRange,
49
+ handleSelectRangeSecundary,
44
50
  handleDownloadExcel,
45
51
  handleDefaultValue,
46
52
  handleDefaultValueFilter,
@@ -52,8 +58,12 @@ export const DynamicTable = ({
52
58
  isLoadingDinamicSelectFilter,
53
59
  labelSinceDateRange,
54
60
  labelTillDateRange,
61
+ labelSinceDateRangeSecundary,
62
+ labelTillDateRangeSecundary,
55
63
  txtTootipFileDownload,
56
64
  titleHeadingTable,
65
+ titleHeadingTableSecundary,
66
+ handleChangeCheckboxDate,
57
67
  }) => {
58
68
 
59
69
  const [tableData, setTableData] = useState(optionsData);
@@ -65,6 +75,9 @@ export const DynamicTable = ({
65
75
  // STATE TOOLTIP
66
76
  const [isToolTipMounted, setIsToolTipMounted] = useState(false)
67
77
 
78
+ const [dataCheckboxCheckboxDate, setCheckboxCheckboxDate] = useState(false)
79
+ const [dataDisabledDate, setDisabledDate] = useState(true)
80
+
68
81
  // TOOLTIP
69
82
  const handleMouseEnter = () => {
70
83
  setIsToolTipMounted(true)
@@ -91,7 +104,19 @@ export const DynamicTable = ({
91
104
  });
92
105
  setTableData(sorted);
93
106
  }
94
- };
107
+ }
108
+
109
+ const handleChangeCheckboxDateMy = (op) => {
110
+
111
+ if (op.target.checked) {
112
+ setCheckboxCheckboxDate(true)
113
+ setDisabledDate(false)
114
+ } else {
115
+ setCheckboxCheckboxDate(false)
116
+ setDisabledDate(true)
117
+ }
118
+
119
+ }
95
120
 
96
121
  return (
97
122
 
@@ -102,19 +127,35 @@ export const DynamicTable = ({
102
127
  <div className={getStyles('opFunctionBoxTotal2')}>
103
128
 
104
129
  {isViewTitleTable ? (
130
+
131
+ <>
132
+
133
+ <div className={getStyles('opFunctionBox1')}>
134
+
135
+ <Paragraph weight="semibold" size="md">{titleHeadingTable}</Paragraph>
136
+
137
+ </div>
138
+
139
+ <Horizontal size="sm" />
140
+
141
+ </>
142
+
143
+ ) : null}
144
+
145
+ {isViewTitleTableSecundary ? (
105
146
  <div className={getStyles('opFunctionBox1')}>
106
- <Heading
107
- size="sm"
108
- >
109
- {titleHeadingTable}
110
- </Heading>
147
+
148
+ <Paragraph weight="semibold" size="md">{titleHeadingTableSecundary}</Paragraph>
149
+
111
150
  </div>
112
151
  ) : null}
113
152
 
153
+
114
154
  {isViewLeftBtn ? (
115
155
 
116
156
  <>
117
157
 
158
+ <Horizontal size="sm" />
118
159
  <div className={getStyles('opFunctionBox3')}>
119
160
 
120
161
  <Button
@@ -126,10 +167,11 @@ export const DynamicTable = ({
126
167
  </Button>
127
168
 
128
169
  </div>
129
- </>
130
- ) : null}
131
170
 
171
+ <Horizontal size="sm" />
132
172
 
173
+ </>
174
+ ) : null}
133
175
 
134
176
  {isViewLeftBtnSecondary ? (
135
177
 
@@ -167,8 +209,6 @@ export const DynamicTable = ({
167
209
  </>
168
210
  ) : null}
169
211
 
170
-
171
-
172
212
  {isViewRange ? (
173
213
  <div className={getStyles('opFunctionBox1')}>
174
214
  <DatePicker
@@ -179,54 +219,96 @@ export const DynamicTable = ({
179
219
  />
180
220
  </div>
181
221
  ) : null}
222
+
182
223
  </div>
183
224
  <div className={getStyles('opFunctionBox2')}>
184
225
 
185
226
 
186
- {isViewFilterTable ? (
187
- <div className={getStyles('opFunctionBox3')}>
188
- <Label>{labelDinamicSelectFilter}</Label>
189
-
190
- {isLoadingDinamicSelectFilter ?
191
- <DynamicSelect
192
- isInline
193
- onChange={handleFilterTable}
194
- optionsSelect={filterTableData}
195
- placeholder={placeholderDinamicSelectFilter}
196
- defaultValue={handleDefaultValueFilter}
197
- closeMenuOnSelect={false}
198
- isClearable={false}
199
- instanceId={'idFilterTableAll'}
200
- // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
201
- /> : null
202
- }
227
+ {isViewRangeSecundary ? (
228
+ <>
203
229
 
204
- </div>
230
+ <Checkbox
231
+ id={'dateSecundary'}
232
+ name={'dateSecundary'}
233
+ label={'Fecha creación'}
234
+ onChange={op => (
235
+ handleChangeCheckboxDate(op),
236
+ handleChangeCheckboxDateMy(op)
237
+ )}
238
+ value={dataCheckboxCheckboxDate}
239
+ // handleClick={handleClickCheck(values[name])}
240
+ // onChange={formikLoginCompany.handleChange}
241
+ // value={formikLoginCompany.values.terms1}
242
+ />
243
+
244
+ <div className={getStyles('opFunctionBox1')}>
245
+ <DatePicker
246
+ isLayoutDate={isLayoutDate}
247
+ onChangeRange={handleSelectRangeSecundary}
248
+ sinceDateRange={labelSinceDateRangeSecundary}
249
+ tillDateRange={labelTillDateRangeSecundary}
250
+ disabledInputRange={dataDisabledDate}
251
+ />
252
+ </div>
253
+
254
+ <Horizontal size="sm" />
255
+
256
+ </>
205
257
  ) : null}
206
258
 
207
259
 
260
+ {isViewFilterTable ? (
208
261
 
209
- {isViewAddColumn ? (
210
- <div className={getStyles('opFunctionBox3')}>
211
- <Label>{labelDinamicSelect}</Label>
212
-
213
- {isLoadingDinamicSelect ?
214
- <DynamicSelect
215
- isMulti
216
- isInline
217
- onChange={handleAddColumn}
218
- optionsSelect={addColumsData}
219
- placeholder={placeholderDinamicSelect}
220
- defaultValue={handleDefaultValue}
221
- closeMenuOnSelect={false}
222
- instanceId={'idAddColumsTable'}
223
- // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
224
- /> : null
225
- }
262
+ <>
263
+ <div className={getStyles('opFunctionBox3')}>
264
+ <Label>{labelDinamicSelectFilter}</Label>
265
+
266
+ {isLoadingDinamicSelectFilter ?
267
+ <DynamicSelect
268
+ isInline
269
+ onChange={handleFilterTable}
270
+ optionsSelect={filterTableData}
271
+ placeholder={placeholderDinamicSelectFilter}
272
+ defaultValue={handleDefaultValueFilter}
273
+ closeMenuOnSelect={false}
274
+ isClearable={false}
275
+ instanceId={'idFilterTableAll'}
276
+ // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
277
+ /> : null
278
+ }
226
279
 
227
- </div>
280
+ </div>
281
+
282
+ <Horizontal size="xs" />
283
+
284
+ </>
228
285
  ) : null}
229
286
 
287
+ {isViewAddColumn ? (
288
+
289
+ <>
290
+ <div className={getStyles('opFunctionBox3')}>
291
+ <Label>{labelDinamicSelect}</Label>
292
+
293
+ {isLoadingDinamicSelect ?
294
+ <DynamicSelect
295
+ isMulti
296
+ isInline
297
+ onChange={handleAddColumn}
298
+ optionsSelect={addColumsData}
299
+ placeholder={placeholderDinamicSelect}
300
+ defaultValue={handleDefaultValue}
301
+ closeMenuOnSelect={false}
302
+ instanceId={'idAddColumsTable'}
303
+ // defaultValue= { [{value: 'id', label: 'ID'}, {value: 'idService', label: 'ID Reserva'}] }
304
+ /> : null
305
+ }
306
+
307
+ </div>
308
+
309
+ <Horizontal size="xs" />
310
+ </>
311
+ ) : null}
230
312
 
231
313
  {isViewBtn ? (
232
314
 
@@ -243,10 +325,12 @@ export const DynamicTable = ({
243
325
  </Button>
244
326
 
245
327
  </div>
328
+
329
+ <Horizontal size="xs" />
330
+
246
331
  </>
247
332
  ) : null}
248
333
 
249
-
250
334
  {isViewDownloadDoc ? (
251
335
  <div id='boxFileDownload' className={getStyles('opFunctionBox3')}>
252
336
 
@@ -300,7 +384,9 @@ DynamicTable.propTypes = {
300
384
  // children: PropTypes.node.isRequired,
301
385
  getStyles: PropTypes.func.isRequired,
302
386
  isViewRange: PropTypes.bool,
387
+ isViewRangeSecundary: PropTypes.bool,
303
388
  isViewTitleTable: PropTypes.bool,
389
+ isViewTitleTableSecundary: PropTypes.bool,
304
390
  isViewAddColumn: PropTypes.bool,
305
391
  isViewFilterTable: PropTypes.bool,
306
392
  isViewDownloadDoc: PropTypes.bool,
@@ -312,6 +398,7 @@ DynamicTable.propTypes = {
312
398
  isError: PropTypes.string,
313
399
  isLayoutDate: PropTypes.string,
314
400
  handleSelectRange: PropTypes.func,
401
+ handleSelectRangeSecundary: PropTypes.func,
315
402
  handleDownloadExcel: PropTypes.func,
316
403
  labelDinamicSelect: PropTypes.string,
317
404
  placeholderDinamicSelect: PropTypes.string,
@@ -319,6 +406,8 @@ DynamicTable.propTypes = {
319
406
  placeholderDinamicSelectFilter: PropTypes.string,
320
407
  labelSinceDateRange: PropTypes.string,
321
408
  labelTillDateRange: PropTypes.string,
409
+ labelSinceDateRangeSecundary: PropTypes.string,
410
+ labelTillDateRangeSecundary: PropTypes.string,
322
411
  typeBtn: PropTypes.string,
323
412
  titleBtn: PropTypes.string,
324
413
  handleBtn: PropTypes.func,
@@ -332,6 +421,7 @@ DynamicTable.propTypes = {
332
421
  handleBtnTertiary: PropTypes.func,
333
422
  txtTootipFileDownload: PropTypes.string,
334
423
  titleHeadingTable: PropTypes.string,
424
+ titleHeadingTableSecundary: PropTypes.string,
335
425
  }
336
426
 
337
427
  DynamicTable.defaultProps = {
@@ -339,7 +429,9 @@ DynamicTable.defaultProps = {
339
429
  handleAddColumn: () => { },
340
430
  handleFilterTable: () => { },
341
431
  isViewRange: true,
432
+ isViewRangeSecundary: false,
342
433
  isViewTitleTable: false,
434
+ isViewTitleTableSecundary: false,
343
435
  isViewAddColumn: true,
344
436
  isViewFilterTable: false,
345
437
  isViewDownloadDoc: true,
@@ -347,6 +439,7 @@ DynamicTable.defaultProps = {
347
439
  isViewLeftBtn: false,
348
440
  isLayoutDate: 'Calendar',
349
441
  handleSelectRange: () => { },
442
+ handleSelectRangeSecundary: () => { },
350
443
  handleDownloadExcel: () => { },
351
444
  labelDinamicSelect: 'Mostrar u ocultar columnas',
352
445
  placeholderDinamicSelect: 'Seleccionar columnas',
@@ -354,6 +447,8 @@ DynamicTable.defaultProps = {
354
447
  placeholderDinamicSelectFilter: '',
355
448
  labelSinceDateRange: 'Desde',
356
449
  labelTillDateRange: 'Hasta',
450
+ labelSinceDateRangeSecundary: 'Desde',
451
+ labelTillDateRangeSecundary: 'Hasta',
357
452
  typeBtn: 'primary',
358
453
  titleBtn: '',
359
454
  handleBtn: () => { },
@@ -367,6 +462,7 @@ DynamicTable.defaultProps = {
367
462
  handleBtnTertiary: () => { },
368
463
  txtTootipFileDownload: '',
369
464
  titleHeadingTable: 'Total: 200',
465
+ titleHeadingTableSecundary: '',
370
466
  }
371
467
 
372
468
  export default withStyles(styles)(DynamicTable)
@@ -6,7 +6,7 @@
6
6
  }
7
7
 
8
8
  .opFunctionBox3 {
9
- margin-left: 16px;
9
+ margin-left: 0px;
10
10
  }
11
11
 
12
12
  /* .opFunctionBox1 {
@@ -15,15 +15,16 @@
15
15
 
16
16
  .opFunctionBoxTotal2 {
17
17
  display: inline-flex;
18
- align-items: center;
18
+ align-items: flex-end;
19
19
  width: 100%;
20
20
  justify-content: flex-start;
21
21
  }
22
22
 
23
23
  .opFunctionBox2 {
24
+ margin-left: 24px;
24
25
  display: inline-flex;
25
26
  align-items: flex-end;
26
- width: 100%;
27
+ width: 70%;
27
28
  justify-content: flex-end;
28
29
  }
29
30
 
@@ -59,18 +60,4 @@
59
60
  font-size: 12px;
60
61
  color: var(--color-font-base);
61
62
  border-bottom: solid 1px rgba(0, 0, 0, 0.1);
62
- }
63
-
64
- /* for custom scrollbar for webkit browser*/
65
-
66
- /* ::-webkit-scrollbar {
67
- width: 6px;
68
- }
69
-
70
- ::-webkit-scrollbar-track {
71
- -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
72
- }
73
-
74
- ::-webkit-scrollbar-thumb {
75
- -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
76
- } */
63
+ }
@@ -76,11 +76,11 @@ CardProductTypesBooking.propTypes = {
76
76
  CardProductTypesBooking.defaultProps = {
77
77
  getStyles: () => { },
78
78
  onClick: () => { },
79
- textNotification: 'Reserve 2 h antes de la salida de su vuelo si es nacional, 3 h antes si es internacional.',
80
- textProductTypes: 'ECO (Tarifa máxima)',
81
- textEtaProductTypesSub: '4 - 8 min.',
82
- textDescription: 'Envío urgente de sobres y paquetes pequeños con taxi.',
83
- priceProductTypes: '30€ - 30€',
79
+ textNotification: '---',
80
+ textProductTypes: '---',
81
+ textEtaProductTypesSub: '---',
82
+ textDescription: '---',
83
+ priceProductTypes: '---',
84
84
  priceProductTypesSub: 'Máx.',
85
85
  selectCard: 'false',
86
86
  availableCard: 'false'
@@ -29,7 +29,7 @@ export const ColumnTable = ({ getStyles, handleSorting, columnUppercase, onChang
29
29
  setSortField(accessor)
30
30
  setOrder(sortOrder)
31
31
  handleSorting(accessor, sortOrder)
32
- };
32
+ }
33
33
 
34
34
 
35
35
  return (
@@ -102,8 +102,9 @@ export const ColumnTable = ({ getStyles, handleSorting, columnUppercase, onChang
102
102
  props.typeFilter === 'select' ?
103
103
  <DynamicSelect
104
104
  isInline
105
- onChange={onChangeSelect}
106
- optionsSelect={opSelect}
105
+ // onChange={item => useStateDate([item.selection])}
106
+ onChange={item => { onChangeSelect(item, props.idInput) }}
107
+ optionsSelect={opSelect || props.optionsSelect}
107
108
  placeholder={props.placeholder}
108
109
  maxMenuHeight={110}
109
110
  />
@@ -48,4 +48,5 @@
48
48
  max-width: 80px;
49
49
  min-width: 80px;
50
50
  width: 80px;
51
+ display: inline-table;
51
52
  }
@@ -33,7 +33,7 @@ import {
33
33
 
34
34
 
35
35
 
36
- export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange, sinceDateRange, tillDateRange }) => {
36
+ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange, sinceDateRange, tillDateRange, disabledInputRange }) => {
37
37
 
38
38
  const [isShowCalendar, setShowCalendar] = useState(false);
39
39
 
@@ -51,7 +51,7 @@ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange, sinceDateRa
51
51
  // ]);
52
52
 
53
53
  moment.locale('es')
54
- const format = "DD/MMMM/YYYY";
54
+ const format = "DD/MM/YYYY";
55
55
 
56
56
 
57
57
  const handleSelectRange = (item) => {
@@ -100,22 +100,26 @@ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange, sinceDateRa
100
100
  <Label>{sinceDateRange}</Label>
101
101
  <Input
102
102
  isInline
103
+ isDate
103
104
  id="startDate"
104
105
  onClick={handleClickOpenCalendar}
105
106
  placeholder="Et harum quidem"
106
107
  value={moment(state[0].startDate).format(format).toString()}
108
+ disabled={disabledInputRange}
107
109
  />
108
- <Vertical size="xs" />
110
+ {/* <Vertical size="xs" /> */}
109
111
  </div>
110
-
112
+ <Horizontal size="xs" />
111
113
  <div>
112
114
  <Label>{tillDateRange}</Label>
113
115
  <Input
114
116
  isInline
117
+ isDate
115
118
  id="endDate"
116
119
  onClick={handleClickOpenCalendar}
117
120
  placeholder="Et harum quidem"
118
121
  value={moment(state[0].endDate).format(format).toString()}
122
+ disabled={disabledInputRange}
119
123
  />
120
124
  </div>
121
125
  </div>
@@ -229,6 +233,7 @@ DatePicker.propTypes = {
229
233
  onChangeRange: PropTypes.func,
230
234
  sinceDateRange: PropTypes.string,
231
235
  tillDateRange: PropTypes.string,
236
+ disabledInputRange: PropTypes.bool,
232
237
  }
233
238
 
234
239
  DatePicker.defaultProps = {
@@ -237,6 +242,7 @@ DatePicker.defaultProps = {
237
242
  onChangeRange: () => { },
238
243
  sinceDateRange: 'Desde',
239
244
  tillDateRange: 'Hasta',
245
+ disabledInputRange: false
240
246
  }
241
247
 
242
248
  export default withStyles(styles)(DatePicker)