@ssplib/react-components 0.0.237 → 0.0.238
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.
|
@@ -476,7 +476,7 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
|
|
|
476
476
|
return;
|
|
477
477
|
let currentData = JSON.parse(JSON.stringify(startData));
|
|
478
478
|
filterData
|
|
479
|
-
.filter((dt) => dt.value)
|
|
479
|
+
.filter((dt) => dt.value || (dt.operator === 'entre' && (dt.value || dt.value2)))
|
|
480
480
|
.forEach((dt) => {
|
|
481
481
|
let filteredData = [];
|
|
482
482
|
console.log(dt);
|
|
@@ -569,12 +569,10 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
|
|
|
569
569
|
});
|
|
570
570
|
break;
|
|
571
571
|
case 'entre':
|
|
572
|
+
const dateA = dt.value ? (0, dayjs_1.default)(dt.value, 'DD/MM/YYYY') : (0, dayjs_1.default)('01/01/2000', 'DD/MM/YYYY');
|
|
573
|
+
const dateB = dt.value2 ? (0, dayjs_1.default)(dt.value2, 'DD/MM/YYYY') : (0, dayjs_1.default)('31/12/2030', 'DD/MM/YYYY');
|
|
572
574
|
currentData.forEach((cd) => {
|
|
573
575
|
const value = (0, dayjs_1.default)((0, lodash_get_1.default)(cd, dt.keyName, ''), 'DD/MM/YYYY');
|
|
574
|
-
const dateA = (0, dayjs_1.default)(dt.value, 'DD/MM/YYYY');
|
|
575
|
-
const dateB = (0, dayjs_1.default)(dt.value2, 'DD/MM/YYYY');
|
|
576
|
-
if (!dateA.isValid() || !dateB.isValid())
|
|
577
|
-
return;
|
|
578
576
|
if ((value.isAfter(dateA) || value.isSame(dateA)) && (value.isBefore(dateB) || value.isSame(dateB))) {
|
|
579
577
|
filteredData.push(cd);
|
|
580
578
|
}
|
|
@@ -620,14 +618,12 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
|
|
|
620
618
|
});
|
|
621
619
|
break;
|
|
622
620
|
case 'entre':
|
|
621
|
+
const dateA = dt.value ? (0, dayjs_1.default)(dt.value, 'DD/MM/YYYY') : (0, dayjs_1.default)('01/01/2000', 'DD/MM/YYYY');
|
|
622
|
+
const dateB = dt.value2 ? (0, dayjs_1.default)(dt.value2, 'DD/MM/YYYY') : (0, dayjs_1.default)('31/12/2030', 'DD/MM/YYYY');
|
|
623
623
|
currentData.forEach((cd) => {
|
|
624
624
|
var _a;
|
|
625
625
|
const dates = (_a = filtersFuncData[dt.customFunc]((0, lodash_get_1.default)(cd, dt.keyName, ''))) !== null && _a !== void 0 ? _a : [];
|
|
626
|
-
const dateA = (0, dayjs_1.default)(dt.value, 'DD/MM/YYYY');
|
|
627
|
-
const dateB = (0, dayjs_1.default)(dt.value2, 'DD/MM/YYYY');
|
|
628
626
|
let isBetween = false;
|
|
629
|
-
if (!dateA.isValid() || !dateB.isValid())
|
|
630
|
-
return;
|
|
631
627
|
dates.forEach((dtStr) => {
|
|
632
628
|
if (isBetween)
|
|
633
629
|
return;
|
|
@@ -763,7 +759,7 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
|
|
|
763
759
|
" de ",
|
|
764
760
|
list.length)))),
|
|
765
761
|
localStorage.getItem(localTableName) && (react_1.default.createElement(material_1.Box, { display: 'inline-flex', flexWrap: 'wrap', padding: 0.5, borderRadius: 4, marginBottom: 1 }, JSON.parse((_a = localStorage.getItem(localTableName)) !== null && _a !== void 0 ? _a : '[]')
|
|
766
|
-
.filter((x) => x.value)
|
|
762
|
+
.filter((x) => x.value || (x.operator === 'entre' && (x.value || x.value2)))
|
|
767
763
|
.map((x) => (react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1, bgcolor: '#4e85c1', color: 'white', width: 'fit-content', paddingY: 0.5, borderRadius: 2, paddingX: 1, m: 0.5 },
|
|
768
764
|
react_1.default.createElement(Typography_1.default, { fontWeight: 700 }, x.label),
|
|
769
765
|
react_1.default.createElement(Typography_1.default, { fontStyle: 'italic' }, x.operator),
|
|
@@ -771,8 +767,8 @@ hideTitleCSV = false, csvExcludeUpper = [], multipleDataPath = '', expandTextMax
|
|
|
771
767
|
? x.value.map((x) => x.label).join(' - ')
|
|
772
768
|
: typeof x.value === 'object'
|
|
773
769
|
? x.value.label
|
|
774
|
-
: x.
|
|
775
|
-
? `${x.value} e ${x.value2}`
|
|
770
|
+
: x.operator === 'entre'
|
|
771
|
+
? `${x.value ? x.value : 'Antes'} e ${x.value2 ? x.value2 : 'Depois'}`
|
|
776
772
|
: x.value.toString()),
|
|
777
773
|
react_1.default.createElement(material_1.IconButton, { onClick: (e) => {
|
|
778
774
|
var _a;
|