imbric-theme 0.1.7 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -58,8 +58,8 @@ AlertModal.defaultProps = {
58
58
  getStyles: () => { },
59
59
  onConfirm: () => { },
60
60
  // onDismiss: () => {}, // Not default for use onConfirm if is undefined
61
- titleAlert: 'Felicidades!',
62
- subTitleAlert: 'Todo ha ido correctamente',
61
+ titleAlert: '',
62
+ subTitleAlert: '',
63
63
  txtBtnAlert: 'Ok',
64
64
  txtBtnAlertCancel: 'Cancelar',
65
65
  iconAlert: 'success',
@@ -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
 
@@ -104,7 +104,7 @@ export const ColumnTable = ({ getStyles, handleSorting, columnUppercase, onChang
104
104
  isInline
105
105
  // onChange={item => useStateDate([item.selection])}
106
106
  onChange={item => { onChangeSelect(item, props.idInput) }}
107
- optionsSelect={opSelect}
107
+ optionsSelect={opSelect || props.optionsSelect}
108
108
  placeholder={props.placeholder}
109
109
  maxMenuHeight={110}
110
110
  />
@@ -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)
@@ -1,9 +1,42 @@
1
+ // import React from 'react'
1
2
  import React from 'react'
2
- import Select from 'react-select'
3
+ // import Select from 'react-select'
3
4
  import PropTypes from 'prop-types'
4
5
  import styles from './DynamicSelect.module.css'
5
6
  import withStyles from '../../hocs/withStyles'
6
7
 
8
+ import Select, { components } from 'react-select'
9
+
10
+ import {
11
+ SortableContainer,
12
+ SortableElement,
13
+ sortableHandle
14
+ } from 'react-sortable-hoc'
15
+
16
+ const SortableMultiValue = SortableElement((props) => {
17
+ // this prevents the menu from being opened/closed when the user clicks
18
+ // on a value to begin dragging it. ideally, detecting a click (instead of
19
+ // a drag) would still focus the control and toggle the menu, but that
20
+ // requires some magic with refs that are out of scope for this example
21
+ const onMouseDown = (e) => {
22
+ e.preventDefault()
23
+ e.stopPropagation()
24
+ }
25
+
26
+ // const onMouseUp = (e) => {
27
+ // e.target.remove()
28
+ // }
29
+
30
+ const innerProps = { ...props.innerProps, onMouseDown };
31
+ return <components.MultiValue {...props} innerProps={innerProps} />
32
+ })
33
+
34
+ const SortableMultiValueLabel = sortableHandle((props) => (
35
+ <components.MultiValueLabel {...props} innerProps={props.innerProps} />
36
+ ))
37
+
38
+ const SortableSelect = SortableContainer(Select)
39
+
7
40
 
8
41
  export const DynamicSelect = ({
9
42
  getStyles,
@@ -24,6 +57,10 @@ export const DynamicSelect = ({
24
57
  closeMenuOnSelect,
25
58
  maxMenuHeight,
26
59
  instanceId,
60
+ sortableMultiSelect,
61
+ onSortEnd,
62
+ formatGroupLabel,
63
+ hideSelectedOptions,
27
64
  }) => {
28
65
 
29
66
 
@@ -94,6 +131,21 @@ export const DynamicSelect = ({
94
131
  minWidth: "100%",
95
132
  }),
96
133
 
134
+ multiValue: (base) => ({
135
+ ...base,
136
+ color: "hsl(0deg 100% 50%)",
137
+ zIndex: "40",
138
+ // width: "max-content",
139
+ // minWidth: "100%",
140
+ }),
141
+
142
+ MultiValueGeneric: (base) => ({
143
+ ...base,
144
+ color: "hsl(0deg 100% 50%)",
145
+ // width: "max-content",
146
+ // minWidth: "100%",
147
+ }),
148
+
97
149
  // menu: styles => ({ ...styles,
98
150
  // width: '500px'
99
151
  // })
@@ -105,43 +157,76 @@ export const DynamicSelect = ({
105
157
 
106
158
  }
107
159
 
108
- // const handleChange = (value) => {
109
- // console.group('Value Changed');
110
- // console.log(value);
111
- // // console.log(`action: ${actionMeta.action}`);
112
- // console.groupEnd();
113
- // };
114
160
 
115
161
  return (
116
162
 
117
163
  <div className={getStyles('dynamic-select', {
118
164
  'is-inline': isInline,
119
165
  })}>
120
- <Select
121
- name="basic"
122
- // className="basic-single"
123
- // classNamePrefix="select"
124
- placeholder={placeholder}
125
- styles={customStyles}
126
- options={optionsSelect}
127
- defaultValue={defaultValue}
128
- value={value}
129
- isMulti={isMulti}
130
- isClearable={isClearable}
131
- isDisabled={isDisabled}
132
- isLoading={isLoading}
133
- isRtl={isRtl}
134
- isSearchable={isSearchable}
135
- onChange={onChange}
136
- onFocus={onFocus}
137
- onBlur={onBlur}
138
- closeMenuOnSelect={closeMenuOnSelect}
139
- maxMenuHeight={maxMenuHeight}
140
- autosize={true}
141
- instanceId={instanceId}
142
- menuPlacement='auto'
143
- menuPosition='fixed'
144
- />
166
+
167
+
168
+ {sortableMultiSelect ?
169
+ <SortableSelect
170
+ useDragHandle
171
+ // react-sortable-hoc props:
172
+ axis="xy"
173
+ onSortEnd={onSortEnd}
174
+ distance={4}
175
+ // small fix for https://github.com/clauderic/react-sortable-hoc/pull/352:
176
+ getHelperDimensions={({ node }) => node.getBoundingClientRect()}
177
+ // react-select props:
178
+ styles={customStyles}
179
+ placeholder={placeholder}
180
+ isMulti={isMulti}
181
+ options={optionsSelect}
182
+ defaultValue={defaultValue}
183
+ value={value}
184
+ onChange={onChange}
185
+ components={{
186
+ MultiValue: SortableMultiValue,
187
+ MultiValueLabel: SortableMultiValueLabel
188
+ }}
189
+ isClearable={isClearable}
190
+ isDisabled={isDisabled}
191
+ isLoading={isLoading}
192
+ closeMenuOnSelect={false}
193
+ autosize={true}
194
+ instanceId={instanceId}
195
+ menuPlacement='auto'
196
+ menuPosition='fixed'
197
+ formatGroupLabel={formatGroupLabel}
198
+ hideSelectedOptions={hideSelectedOptions}
199
+ />
200
+ :
201
+ <Select
202
+ name="basic"
203
+ // className="basic-single"
204
+ // classNamePrefix="select"
205
+ placeholder={placeholder}
206
+ styles={customStyles}
207
+ options={optionsSelect}
208
+ defaultValue={defaultValue}
209
+ value={value}
210
+ isMulti={isMulti}
211
+ isClearable={isClearable}
212
+ isDisabled={isDisabled}
213
+ isLoading={isLoading}
214
+ isRtl={isRtl}
215
+ isSearchable={isSearchable}
216
+ onChange={onChange}
217
+ onFocus={onFocus}
218
+ onBlur={onBlur}
219
+ closeMenuOnSelect={closeMenuOnSelect}
220
+ maxMenuHeight={maxMenuHeight}
221
+ autosize={true}
222
+ instanceId={instanceId}
223
+ menuPlacement='auto'
224
+ menuPosition='fixed'
225
+ formatGroupLabel={formatGroupLabel}
226
+ hideSelectedOptions={hideSelectedOptions}
227
+ />}
228
+
229
+
145
230
  </div>
146
231
 
147
232
  )
@@ -165,6 +250,8 @@ DynamicSelect.propTypes = {
165
250
  closeMenuOnSelect: PropTypes.bool,
166
251
  maxMenuHeight: PropTypes.number,
167
252
  instanceId: PropTypes.string,
253
+ sortableMultiSelect: PropTypes.bool,
254
+ hideSelectedOptions: PropTypes.bool,
168
255
  }
169
256
 
170
257
  DynamicSelect.defaultProps = {
@@ -182,7 +269,9 @@ DynamicSelect.defaultProps = {
182
269
  onBlur: () => { },
183
270
  closeMenuOnSelect: true,
184
271
  maxMenuHeight: 300,
185
- instanceId: ''
272
+ instanceId: '',
273
+ sortableMultiSelect: false,
274
+ hideSelectedOptions: true,
186
275
  }
187
276
 
188
277
  export default withStyles(styles)(DynamicSelect)
@@ -21,6 +21,7 @@ export const RowTable = ({
21
21
  isClickRow,
22
22
  onClickRow,
23
23
  onClickActionUserView,
24
+ onClickActionFileDownload,
24
25
  onClickActionListInvoice,
25
26
  onClickActionListXLS,
26
27
  onClickActionListCSV,
@@ -32,6 +33,7 @@ export const RowTable = ({
32
33
  onClickActionClone,
33
34
  onClickActionCheckbox,
34
35
  txtTootipIconUserView,
36
+ txtTootipIconFileDownload,
35
37
  txtTootipIconListInvoice,
36
38
  txtTootipIconListListXLS,
37
39
  txtTootipIconListListCSV,
@@ -42,7 +44,6 @@ export const RowTable = ({
42
44
  txtTootipIconLink,
43
45
  txtTootipIconClone,
44
46
  txtTootipIconCheckbox,
45
- colorRow,
46
47
  }) => {
47
48
 
48
49
 
@@ -124,6 +125,7 @@ export const RowTable = ({
124
125
  (
125
126
  <td
126
127
  className={getStyles('td', 'tdacction')}
128
+ style={{ color: item.colorTxtRow }}
127
129
  key={[itemTd.accessor] + (indexTd + index)}
128
130
  >
129
131
 
@@ -139,6 +141,7 @@ export const RowTable = ({
139
141
  (
140
142
  <td
141
143
  className={getStyles('td', 'tdacction')}
144
+ style={{ color: item.colorTxtRow }}
142
145
  key={[itemTd.accessor] + (indexTd + index)}
143
146
  >
144
147
  </td>
@@ -159,6 +162,7 @@ export const RowTable = ({
159
162
  (
160
163
  <td
161
164
  className={getStyles('td', 'tdacction')}
165
+ style={{ color: item.colorTxtRow }}
162
166
  key={[itemTd.accessor] + (indexTd + index)}
163
167
  >
164
168
 
@@ -170,6 +174,7 @@ export const RowTable = ({
170
174
  (
171
175
  <td
172
176
  className={getStyles('td', 'tdacction')}
177
+ style={{ color: item.colorTxtRow }}
173
178
  key={[itemTd.accessor] + (indexTd + index)}
174
179
  >
175
180
  {/* {String(item[itemTd.accessor])} */}
@@ -186,6 +191,7 @@ export const RowTable = ({
186
191
  !loading ? (
187
192
  <td
188
193
  className={getStyles('td', 'tdacction')}
194
+ style={{ color: item.colorTxtRow }}
189
195
  key={[itemTd.accessor] + (indexTd + index)}
190
196
  >
191
197
 
@@ -209,7 +215,7 @@ export const RowTable = ({
209
215
 
210
216
  ?
211
217
 
212
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
218
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
213
219
 
214
220
  {console.log('TD: ' + [itemTd.accessor] + (indexTd + index))}
215
221
 
@@ -250,7 +256,10 @@ export const RowTable = ({
250
256
  itemTd.isPicture
251
257
 
252
258
  ?
253
- <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)}>
254
263
  <Picture
255
264
  src={item[itemTd.accessor]}
256
265
  width={50}
@@ -262,7 +271,7 @@ export const RowTable = ({
262
271
 
263
272
  ?
264
273
 
265
- <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)}>
266
275
 
267
276
 
268
277
  {itemTd.viewListInvoice ?
@@ -800,6 +809,72 @@ export const RowTable = ({
800
809
  : null}
801
810
 
802
811
 
812
+ {itemTd.viewFileDownload ?
813
+
814
+ item.viewFileDownload === undefined ?
815
+
816
+ <>
817
+ <span
818
+ data-tip
819
+ data-for='fileDownload'
820
+ onMouseEnter={handleMouseEnter}
821
+ onMouseLeave={handleMouseLeave}
822
+ >
823
+ <>
824
+ <Icon
825
+ id="fileDownload"
826
+ background="base"
827
+ name="fileDownload"
828
+ onClick={(e) => { onClickActionFileDownload(e, item) }}
829
+ />
830
+ <Horizontal size="xs" />
831
+ </>
832
+
833
+ </span>
834
+
835
+ {isToolTipMounted ? (
836
+ <ReactTooltip id='fileDownload' type='error'>
837
+ <span>{txtTootipIconFileDownload}</span>
838
+ </ReactTooltip>
839
+ ) : null}
840
+ </>
841
+
842
+ :
843
+
844
+ item.viewFileDownload ?
845
+
846
+ <>
847
+ <span
848
+ data-tip
849
+ data-for='fileDownload'
850
+ onMouseEnter={handleMouseEnter}
851
+ onMouseLeave={handleMouseLeave}
852
+ >
853
+ <>
854
+ <Icon
855
+ id="fileDownload"
856
+ background="base"
857
+ name="fileDownload"
858
+ onClick={(e) => { onClickActionFileDownload(e, item) }}
859
+ />
860
+ <Horizontal size="xs" />
861
+ </>
862
+
863
+ </span>
864
+
865
+ {isToolTipMounted ? (
866
+ <ReactTooltip id='fileDownload' type='error'>
867
+ <span>{txtTootipIconFileDownload}</span>
868
+ </ReactTooltip>
869
+ ) : null}
870
+ </>
871
+
872
+ : null
873
+
874
+ : null}
875
+
876
+
877
+
803
878
 
804
879
  {itemTd.viewCheckbox ?
805
880
 
@@ -883,7 +958,7 @@ export const RowTable = ({
883
958
 
884
959
  ?
885
960
 
886
- <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>
887
962
 
888
963
  :
889
964
 
@@ -893,7 +968,7 @@ export const RowTable = ({
893
968
 
894
969
  itemTd.typeFilterSub === 'date_only' ?
895
970
 
896
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
971
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
897
972
 
898
973
  {item[itemTd.accessor] ? (
899
974
 
@@ -907,7 +982,7 @@ export const RowTable = ({
907
982
 
908
983
  :
909
984
 
910
- <td className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
985
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>
911
986
  {/* <Moment format="DD/MM/YYYY hh:mm:ss"> */}
912
987
  {item[itemTd.accessor] ? (
913
988
 
@@ -928,7 +1003,7 @@ export const RowTable = ({
928
1003
 
929
1004
  item[itemTd.accessor] === itemSelect.value ?
930
1005
 
931
- <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}>
932
1007
  {itemSelect.label}
933
1008
  </td>
934
1009
 
@@ -949,20 +1024,20 @@ export const RowTable = ({
949
1024
 
950
1025
  itemTd.characterExtra === 'km'
951
1026
  ?
952
- <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>
953
1028
  :
954
- <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>
955
1030
  :
956
- <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>
957
1032
 
958
1033
  :
959
1034
 
960
1035
  itemTd.subTypeFilter
961
1036
 
962
1037
  ?
963
- <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>
964
1039
  :
965
- <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>
966
1041
 
967
1042
  // <>
968
1043
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imbric-theme",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Components library IMBRIC",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -60,7 +60,8 @@
60
60
  "react-moment": "1.1.2",
61
61
  "react-router": "6.3.0",
62
62
  "react-router-dom": "6.3.0",
63
- "react-select": "5.3.2",
63
+ "react-select": "5.8.0",
64
+ "react-sortable-hoc": "2.0.0",
64
65
  "react-spinners": "0.13.4",
65
66
  "react-tooltip": "4.4.0",
66
67
  "storybook-addon-theme-changer": "0.1.2",