imbric-theme 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,6 +21,7 @@ export const Input = ({
21
21
  isInlineCode,
22
22
  isInputFilter,
23
23
  isInputSecondary,
24
+ isDate,
24
25
  onChange,
25
26
  onFocus,
26
27
  onBlur,
@@ -69,6 +70,7 @@ export const Input = ({
69
70
  'is-inline-code': isInlineCode,
70
71
  'is-input-filter': isInputFilter,
71
72
  'is-input-secondary': isInputSecondary,
73
+ 'is-date': isDate,
72
74
  })}
73
75
  readOnly={readonly}
74
76
  type={type}
@@ -102,6 +104,7 @@ export const Input = ({
102
104
  'is-inline-code': isInlineCode,
103
105
  'is-input-filter': isInputFilter,
104
106
  'is-input-secondary': isInputSecondary,
107
+ 'is-date': isDate,
105
108
  })}
106
109
  readOnly={readonly}
107
110
  type={type}
@@ -142,6 +145,7 @@ export const Input = ({
142
145
  'is-inline-code': isInlineCode,
143
146
  'is-input-filter': isInputFilter,
144
147
  'is-input-secondary': isInputSecondary,
148
+ 'is-date': isDate,
145
149
  })}
146
150
  readOnly={readonly}
147
151
  type={type}
@@ -185,6 +189,7 @@ Input.propTypes = {
185
189
  isInlineCode: PropTypes.bool,
186
190
  isInputFilter: PropTypes.bool,
187
191
  isInputSecondary: PropTypes.bool,
192
+ isDate: PropTypes.bool,
188
193
  isViewIcon: PropTypes.bool,
189
194
  idIcon: PropTypes.string,
190
195
  nameIcon: PropTypes.string,
@@ -210,6 +215,7 @@ Input.defaultProps = {
210
215
  isInlineCode: false,
211
216
  isInputFilter: false,
212
217
  isInputSecondary: false,
218
+ isDate: false,
213
219
  onChange: () => { },
214
220
  onFocus: () => { },
215
221
  onBlur: () => { },
@@ -80,4 +80,9 @@
80
80
  .box-icon-input {
81
81
  display: flex;
82
82
  align-items: center;
83
+ }
84
+
85
+ .is-date {
86
+ width: 85px;
87
+ padding: 10px 6px;
83
88
  }
@@ -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 = ({
@@ -22,6 +25,7 @@ export const DynamicTable = ({
22
25
  isLayoutDate,
23
26
  isViewRange,
24
27
  isViewTitleTable,
28
+ isViewTitleTableSecundary,
25
29
  isViewAddColumn,
26
30
  isViewFilterTable,
27
31
  isViewBtn,
@@ -41,6 +45,7 @@ export const DynamicTable = ({
41
45
  handleAddColumn,
42
46
  handleFilterTable,
43
47
  handleSelectRange,
48
+ handleSelectRangeSecundary,
44
49
  handleDownloadExcel,
45
50
  handleDefaultValue,
46
51
  handleDefaultValueFilter,
@@ -52,8 +57,12 @@ export const DynamicTable = ({
52
57
  isLoadingDinamicSelectFilter,
53
58
  labelSinceDateRange,
54
59
  labelTillDateRange,
60
+ labelSinceDateRangeSecundary,
61
+ labelTillDateRangeSecundary,
55
62
  txtTootipFileDownload,
56
63
  titleHeadingTable,
64
+ titleHeadingTableSecundary,
65
+ handleChangeCheckboxDate,
57
66
  }) => {
58
67
 
59
68
  const [tableData, setTableData] = useState(optionsData);
@@ -65,6 +74,9 @@ export const DynamicTable = ({
65
74
  // STATE TOOLTIP
66
75
  const [isToolTipMounted, setIsToolTipMounted] = useState(false)
67
76
 
77
+ const [dataCheckboxCheckboxDate, setCheckboxCheckboxDate] = useState(false)
78
+ const [dataDisabledDate, setDisabledDate] = useState(true)
79
+
68
80
  // TOOLTIP
69
81
  const handleMouseEnter = () => {
70
82
  setIsToolTipMounted(true)
@@ -91,7 +103,19 @@ export const DynamicTable = ({
91
103
  });
92
104
  setTableData(sorted);
93
105
  }
94
- };
106
+ }
107
+
108
+ const handleChangeCheckboxDateMy = (op) => {
109
+
110
+ if (op.target.checked) {
111
+ setCheckboxCheckboxDate(true)
112
+ setDisabledDate(false)
113
+ } else {
114
+ setCheckboxCheckboxDate(false)
115
+ setDisabledDate(true)
116
+ }
117
+
118
+ }
95
119
 
96
120
  return (
97
121
 
@@ -102,19 +126,35 @@ export const DynamicTable = ({
102
126
  <div className={getStyles('opFunctionBoxTotal2')}>
103
127
 
104
128
  {isViewTitleTable ? (
129
+
130
+ <>
131
+
132
+ <div className={getStyles('opFunctionBox1')}>
133
+
134
+ <Paragraph weight="semibold" size="md">{titleHeadingTable}</Paragraph>
135
+
136
+ </div>
137
+
138
+ <Horizontal size="sm" />
139
+
140
+ </>
141
+
142
+ ) : null}
143
+
144
+ {isViewTitleTableSecundary ? (
105
145
  <div className={getStyles('opFunctionBox1')}>
106
- <Heading
107
- size="sm"
108
- >
109
- {titleHeadingTable}
110
- </Heading>
146
+
147
+ <Paragraph weight="semibold" size="md">{titleHeadingTableSecundary}</Paragraph>
148
+
111
149
  </div>
112
150
  ) : null}
113
151
 
152
+
114
153
  {isViewLeftBtn ? (
115
154
 
116
155
  <>
117
156
 
157
+ <Horizontal size="sm" />
118
158
  <div className={getStyles('opFunctionBox3')}>
119
159
 
120
160
  <Button
@@ -126,10 +166,11 @@ export const DynamicTable = ({
126
166
  </Button>
127
167
 
128
168
  </div>
129
- </>
130
- ) : null}
131
169
 
170
+ <Horizontal size="sm" />
132
171
 
172
+ </>
173
+ ) : null}
133
174
 
134
175
  {isViewLeftBtnSecondary ? (
135
176
 
@@ -167,8 +208,6 @@ export const DynamicTable = ({
167
208
  </>
168
209
  ) : null}
169
210
 
170
-
171
-
172
211
  {isViewRange ? (
173
212
  <div className={getStyles('opFunctionBox1')}>
174
213
  <DatePicker
@@ -179,10 +218,44 @@ export const DynamicTable = ({
179
218
  />
180
219
  </div>
181
220
  ) : null}
221
+
182
222
  </div>
183
223
  <div className={getStyles('opFunctionBox2')}>
184
224
 
185
225
 
226
+ {isViewRange ? (
227
+ <>
228
+
229
+ <Checkbox
230
+ id={'dateSecundary'}
231
+ name={'dateSecundary'}
232
+ label={'Fecha creación'}
233
+ onChange={op => (
234
+ handleChangeCheckboxDate(op),
235
+ handleChangeCheckboxDateMy(op)
236
+ )}
237
+ value={dataCheckboxCheckboxDate}
238
+ // handleClick={handleClickCheck(values[name])}
239
+ // onChange={formikLoginCompany.handleChange}
240
+ // value={formikLoginCompany.values.terms1}
241
+ />
242
+
243
+ <div className={getStyles('opFunctionBox1')}>
244
+ <DatePicker
245
+ isLayoutDate={isLayoutDate}
246
+ onChangeRange={handleSelectRangeSecundary}
247
+ sinceDateRange={labelSinceDateRangeSecundary}
248
+ tillDateRange={labelTillDateRangeSecundary}
249
+ disabledInputRange={dataDisabledDate}
250
+ />
251
+ </div>
252
+
253
+ <Horizontal size="sm" />
254
+
255
+ </>
256
+ ) : null}
257
+
258
+
186
259
  {isViewFilterTable ? (
187
260
  <div className={getStyles('opFunctionBox3')}>
188
261
  <Label>{labelDinamicSelectFilter}</Label>
@@ -204,8 +277,6 @@ export const DynamicTable = ({
204
277
  </div>
205
278
  ) : null}
206
279
 
207
-
208
-
209
280
  {isViewAddColumn ? (
210
281
  <div className={getStyles('opFunctionBox3')}>
211
282
  <Label>{labelDinamicSelect}</Label>
@@ -227,7 +298,6 @@ export const DynamicTable = ({
227
298
  </div>
228
299
  ) : null}
229
300
 
230
-
231
301
  {isViewBtn ? (
232
302
 
233
303
  <>
@@ -246,7 +316,6 @@ export const DynamicTable = ({
246
316
  </>
247
317
  ) : null}
248
318
 
249
-
250
319
  {isViewDownloadDoc ? (
251
320
  <div id='boxFileDownload' className={getStyles('opFunctionBox3')}>
252
321
 
@@ -301,6 +370,7 @@ DynamicTable.propTypes = {
301
370
  getStyles: PropTypes.func.isRequired,
302
371
  isViewRange: PropTypes.bool,
303
372
  isViewTitleTable: PropTypes.bool,
373
+ isViewTitleTableSecundary: PropTypes.bool,
304
374
  isViewAddColumn: PropTypes.bool,
305
375
  isViewFilterTable: PropTypes.bool,
306
376
  isViewDownloadDoc: PropTypes.bool,
@@ -312,6 +382,7 @@ DynamicTable.propTypes = {
312
382
  isError: PropTypes.string,
313
383
  isLayoutDate: PropTypes.string,
314
384
  handleSelectRange: PropTypes.func,
385
+ handleSelectRangeSecundary: PropTypes.func,
315
386
  handleDownloadExcel: PropTypes.func,
316
387
  labelDinamicSelect: PropTypes.string,
317
388
  placeholderDinamicSelect: PropTypes.string,
@@ -319,6 +390,8 @@ DynamicTable.propTypes = {
319
390
  placeholderDinamicSelectFilter: PropTypes.string,
320
391
  labelSinceDateRange: PropTypes.string,
321
392
  labelTillDateRange: PropTypes.string,
393
+ labelSinceDateRangeSecundary: PropTypes.string,
394
+ labelTillDateRangeSecundary: PropTypes.string,
322
395
  typeBtn: PropTypes.string,
323
396
  titleBtn: PropTypes.string,
324
397
  handleBtn: PropTypes.func,
@@ -332,6 +405,7 @@ DynamicTable.propTypes = {
332
405
  handleBtnTertiary: PropTypes.func,
333
406
  txtTootipFileDownload: PropTypes.string,
334
407
  titleHeadingTable: PropTypes.string,
408
+ titleHeadingTableSecundary: PropTypes.string,
335
409
  }
336
410
 
337
411
  DynamicTable.defaultProps = {
@@ -340,6 +414,7 @@ DynamicTable.defaultProps = {
340
414
  handleFilterTable: () => { },
341
415
  isViewRange: true,
342
416
  isViewTitleTable: false,
417
+ isViewTitleTableSecundary: false,
343
418
  isViewAddColumn: true,
344
419
  isViewFilterTable: false,
345
420
  isViewDownloadDoc: true,
@@ -347,6 +422,7 @@ DynamicTable.defaultProps = {
347
422
  isViewLeftBtn: false,
348
423
  isLayoutDate: 'Calendar',
349
424
  handleSelectRange: () => { },
425
+ handleSelectRangeSecundary: () => { },
350
426
  handleDownloadExcel: () => { },
351
427
  labelDinamicSelect: 'Mostrar u ocultar columnas',
352
428
  placeholderDinamicSelect: 'Seleccionar columnas',
@@ -354,6 +430,8 @@ DynamicTable.defaultProps = {
354
430
  placeholderDinamicSelectFilter: '',
355
431
  labelSinceDateRange: 'Desde',
356
432
  labelTillDateRange: 'Hasta',
433
+ labelSinceDateRangeSecundary: 'Desde',
434
+ labelTillDateRangeSecundary: 'Hasta',
357
435
  typeBtn: 'primary',
358
436
  titleBtn: '',
359
437
  handleBtn: () => { },
@@ -367,6 +445,7 @@ DynamicTable.defaultProps = {
367
445
  handleBtnTertiary: () => { },
368
446
  txtTootipFileDownload: '',
369
447
  titleHeadingTable: 'Total: 200',
448
+ titleHeadingTableSecundary: '',
370
449
  }
371
450
 
372
451
  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
 
@@ -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)
@@ -44,7 +44,6 @@ export const RowTable = ({
44
44
  txtTootipIconLink,
45
45
  txtTootipIconClone,
46
46
  txtTootipIconCheckbox,
47
- colorRow,
48
47
  }) => {
49
48
 
50
49
 
@@ -126,6 +125,7 @@ export const RowTable = ({
126
125
  (
127
126
  <td
128
127
  className={getStyles('td', 'tdacction')}
128
+ style={{ color: item.colorTxtRow }}
129
129
  key={[itemTd.accessor] + (indexTd + index)}
130
130
  >
131
131
 
@@ -141,6 +141,7 @@ export const RowTable = ({
141
141
  (
142
142
  <td
143
143
  className={getStyles('td', 'tdacction')}
144
+ style={{ color: item.colorTxtRow }}
144
145
  key={[itemTd.accessor] + (indexTd + index)}
145
146
  >
146
147
  </td>
@@ -161,6 +162,7 @@ export const RowTable = ({
161
162
  (
162
163
  <td
163
164
  className={getStyles('td', 'tdacction')}
165
+ style={{ color: item.colorTxtRow }}
164
166
  key={[itemTd.accessor] + (indexTd + index)}
165
167
  >
166
168
 
@@ -172,6 +174,7 @@ export const RowTable = ({
172
174
  (
173
175
  <td
174
176
  className={getStyles('td', 'tdacction')}
177
+ style={{ color: item.colorTxtRow }}
175
178
  key={[itemTd.accessor] + (indexTd + index)}
176
179
  >
177
180
  {/* {String(item[itemTd.accessor])} */}
@@ -188,6 +191,7 @@ export const RowTable = ({
188
191
  !loading ? (
189
192
  <td
190
193
  className={getStyles('td', 'tdacction')}
194
+ style={{ color: item.colorTxtRow }}
191
195
  key={[itemTd.accessor] + (indexTd + index)}
192
196
  >
193
197
 
@@ -211,7 +215,7 @@ export const RowTable = ({
211
215
 
212
216
  ?
213
217
 
214
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
218
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
215
219
 
216
220
  {console.log('TD: ' + [itemTd.accessor] + (indexTd + index))}
217
221
 
@@ -252,7 +256,10 @@ export const RowTable = ({
252
256
  itemTd.isPicture
253
257
 
254
258
  ?
255
- <td className={getStyles('td', 'tdacction')} key={[itemTd.accessor] + (indexTd + index)}>
259
+ <td
260
+ className={getStyles('td', 'tdacction')}
261
+ style={{ color: item.colorTxtRow }}
262
+ key={[itemTd.accessor] + (indexTd + index)}>
256
263
  <Picture
257
264
  src={item[itemTd.accessor]}
258
265
  width={50}
@@ -264,7 +271,7 @@ export const RowTable = ({
264
271
 
265
272
  ?
266
273
 
267
- <td className={getStyles('td', 'tdacctionIcons')} key={[itemTd.accessor] + (indexTd + index)}>
274
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td', 'tdacctionIcons')} key={[itemTd.accessor] + (indexTd + index)}>
268
275
 
269
276
 
270
277
  {itemTd.viewListInvoice ?
@@ -951,7 +958,7 @@ export const RowTable = ({
951
958
 
952
959
  ?
953
960
 
954
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor][itemTd.subAccessor]}</td>
961
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor][itemTd.subAccessor]}</td>
955
962
 
956
963
  :
957
964
 
@@ -961,7 +968,7 @@ export const RowTable = ({
961
968
 
962
969
  itemTd.typeFilterSub === 'date_only' ?
963
970
 
964
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
971
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
965
972
 
966
973
  {item[itemTd.accessor] ? (
967
974
 
@@ -975,7 +982,7 @@ export const RowTable = ({
975
982
 
976
983
  :
977
984
 
978
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
985
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
979
986
  {/* <Moment format="DD/MM/YYYY hh:mm:ss"> */}
980
987
  {item[itemTd.accessor] ? (
981
988
 
@@ -996,7 +1003,7 @@ export const RowTable = ({
996
1003
 
997
1004
  item[itemTd.accessor] === itemSelect.value ?
998
1005
 
999
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index) + indexSelect}>
1006
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index) + indexSelect}>
1000
1007
  {itemSelect.label}
1001
1008
  </td>
1002
1009
 
@@ -1017,20 +1024,20 @@ export const RowTable = ({
1017
1024
 
1018
1025
  itemTd.characterExtra === 'km'
1019
1026
  ?
1020
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{(item[itemTd.accessor] / 1000).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1027
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{(item[itemTd.accessor] / 1000).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1021
1028
  :
1022
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1029
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1023
1030
  :
1024
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]}</td>
1031
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]}</td>
1025
1032
 
1026
1033
  :
1027
1034
 
1028
1035
  itemTd.subTypeFilter
1029
1036
 
1030
1037
  ?
1031
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{Number(item[itemTd.accessor]).toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1038
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{Number(item[itemTd.accessor]).toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1032
1039
  :
1033
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]}</td>
1040
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]}</td>
1034
1041
 
1035
1042
  // <>
1036
1043
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imbric-theme",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Components library IMBRIC",
5
5
  "private": false,
6
6
  "main": "index.js",