aefis-core-ui 2.2.1-rc2 → 2.2.1-rc3
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.
- package/dist/index.modern.js +56 -34
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -8095,30 +8095,35 @@ const FilterChips = ({
|
|
|
8095
8095
|
if (_filters.length === 0 && _sort.length === 0) return /*#__PURE__*/jsx("div", {
|
|
8096
8096
|
children: "No filters or sorting criteria selected"
|
|
8097
8097
|
});
|
|
8098
|
-
const Filters = useMemo(() =>
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
displayOptions: {
|
|
8110
|
-
hasIcon: filter.type !== "keyword"
|
|
8098
|
+
const Filters = useMemo(() => {
|
|
8099
|
+
return /*#__PURE__*/jsx(Box$1, {
|
|
8100
|
+
sx: {
|
|
8101
|
+
display: "flex"
|
|
8102
|
+
},
|
|
8103
|
+
children: _filters.map(filter => /*#__PURE__*/jsx(Grow, {
|
|
8104
|
+
in: true,
|
|
8105
|
+
children: /*#__PURE__*/jsx("div", {
|
|
8106
|
+
style: {
|
|
8107
|
+
margin: 2,
|
|
8108
|
+
display: "inline-flex"
|
|
8111
8109
|
},
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8110
|
+
children: /*#__PURE__*/jsx(BusinessObject, {
|
|
8111
|
+
variant: "chip",
|
|
8112
|
+
size: "small",
|
|
8113
|
+
displayOptions: {
|
|
8114
|
+
hasIcon: filter.type !== "keyword"
|
|
8115
|
+
},
|
|
8116
|
+
type: "businessObject",
|
|
8117
|
+
template: filter.template,
|
|
8118
|
+
data: filter.data,
|
|
8119
|
+
onDelete: () => {
|
|
8120
|
+
onFilterDelete(filter);
|
|
8121
|
+
}
|
|
8122
|
+
}, filter.data.id)
|
|
8123
|
+
})
|
|
8124
|
+
}, `filterPanelFilter-${filter.index}-${filter.id}`))
|
|
8125
|
+
});
|
|
8126
|
+
}, [_filters]);
|
|
8122
8127
|
const SortItems = useMemo(() => /*#__PURE__*/jsx(Fragment, {
|
|
8123
8128
|
children: _sort.map(sortItem => /*#__PURE__*/jsx(Grow, {
|
|
8124
8129
|
in: true,
|
|
@@ -8205,7 +8210,7 @@ const FilterSelection = ({
|
|
|
8205
8210
|
children: "Apply All Filters"
|
|
8206
8211
|
}), /*#__PURE__*/jsx(Button, {
|
|
8207
8212
|
name: "reset all filters",
|
|
8208
|
-
disabled: !(filters.length > 0),
|
|
8213
|
+
disabled: !(filters.length > 0 || sort.length > 0),
|
|
8209
8214
|
variant: "contained",
|
|
8210
8215
|
color: "grey",
|
|
8211
8216
|
onClick: onResetFilters,
|
|
@@ -8387,6 +8392,7 @@ const FilterPanel = props => {
|
|
|
8387
8392
|
const [menuPosition, setMenuPosition] = useState(null);
|
|
8388
8393
|
const [filters, setFilters] = useState([]);
|
|
8389
8394
|
const [sort, setSort] = useState(sortProp || []);
|
|
8395
|
+
const [panelSearch, setPanelSearch] = useState([]);
|
|
8390
8396
|
const [pickerFilters, setPickerFilters] = useState([]);
|
|
8391
8397
|
useEffect(() => {
|
|
8392
8398
|
const formattedFilters = formatFilters(filtersProp, configuration);
|
|
@@ -8418,6 +8424,7 @@ const FilterPanel = props => {
|
|
|
8418
8424
|
}
|
|
8419
8425
|
}, [filters, sort]);
|
|
8420
8426
|
const removeFilter = filter => {
|
|
8427
|
+
console.log("remove filter ", filter);
|
|
8421
8428
|
const newFilterArray = filters == null ? void 0 : filters.filter(i => i.index !== filter.index || filter.id !== i.id);
|
|
8422
8429
|
setFilters(newFilterArray);
|
|
8423
8430
|
if (!onApplyFilters) {
|
|
@@ -8538,6 +8545,8 @@ const FilterPanel = props => {
|
|
|
8538
8545
|
const handleResetFilters = () => {
|
|
8539
8546
|
setPickerFilters([]);
|
|
8540
8547
|
setFilters([]);
|
|
8548
|
+
setSort([]);
|
|
8549
|
+
setPanelSearch([]);
|
|
8541
8550
|
if (!onChange && onApplyFilters) {
|
|
8542
8551
|
onApplyFilters({}, []);
|
|
8543
8552
|
}
|
|
@@ -8546,6 +8555,8 @@ const FilterPanel = props => {
|
|
|
8546
8555
|
}
|
|
8547
8556
|
};
|
|
8548
8557
|
const handleSearchChange = keyword => {
|
|
8558
|
+
if (panelSearch.includes(keyword)) return;
|
|
8559
|
+
setPanelSearch([...panelSearch, keyword]);
|
|
8549
8560
|
addFilter({
|
|
8550
8561
|
index: -1,
|
|
8551
8562
|
type: "keyword",
|
|
@@ -10479,6 +10490,15 @@ const useIsError = status => {
|
|
|
10479
10490
|
}, [status]);
|
|
10480
10491
|
return isError;
|
|
10481
10492
|
};
|
|
10493
|
+
const initialFilterState = {
|
|
10494
|
+
filter: {},
|
|
10495
|
+
searchText: "",
|
|
10496
|
+
filterArray: [],
|
|
10497
|
+
filterCount: 0,
|
|
10498
|
+
sort: [],
|
|
10499
|
+
sortCount: 0,
|
|
10500
|
+
sortQueryParams: null
|
|
10501
|
+
};
|
|
10482
10502
|
const RichDataTable = /*#__PURE__*/forwardRef(function RichDatatable(props, ref) {
|
|
10483
10503
|
var _props$filterPanelCon, _props$rowActions, _props$dataTableProps, _props$dataTableProps2;
|
|
10484
10504
|
const didMount = useDidMount();
|
|
@@ -10504,15 +10524,8 @@ const RichDataTable = /*#__PURE__*/forwardRef(function RichDatatable(props, ref)
|
|
|
10504
10524
|
const [formatDrawerContent, setFormatDrawerContent] = useState(false);
|
|
10505
10525
|
const [enableTableRowAction, setEnableTableRowAction] = useState(false);
|
|
10506
10526
|
const [selectedRowCount, setSelectedRowCount] = useState(0);
|
|
10507
|
-
const [filterPanelState, setFilterPanelState] = useState(
|
|
10508
|
-
|
|
10509
|
-
searchText: "",
|
|
10510
|
-
filterArray: [],
|
|
10511
|
-
filterCount: 0,
|
|
10512
|
-
sort: [],
|
|
10513
|
-
sortCount: 0,
|
|
10514
|
-
sortQueryParams: null
|
|
10515
|
-
});
|
|
10527
|
+
const [filterPanelState, setFilterPanelState] = useState(initialFilterState);
|
|
10528
|
+
console.log("filterPanelState ", filterPanelState);
|
|
10516
10529
|
const {
|
|
10517
10530
|
info,
|
|
10518
10531
|
error
|
|
@@ -10635,6 +10648,15 @@ const RichDataTable = /*#__PURE__*/forwardRef(function RichDatatable(props, ref)
|
|
|
10635
10648
|
};
|
|
10636
10649
|
const handleFilterChange = (filters, newFilterArray) => {
|
|
10637
10650
|
props == null ? void 0 : props.onFilterChange == null ? void 0 : props.onFilterChange(filters);
|
|
10651
|
+
|
|
10652
|
+
// TODO: apply better approach by gathering handling of all search and
|
|
10653
|
+
// filter changes with onChange; also send operation type to onChange
|
|
10654
|
+
// events
|
|
10655
|
+
const isReset = newFilterArray.length === 0;
|
|
10656
|
+
if (isReset) {
|
|
10657
|
+
setFilterPanelState(() => _extends({}, initialFilterState));
|
|
10658
|
+
return;
|
|
10659
|
+
}
|
|
10638
10660
|
setFilterPanelState(prev => _extends({}, prev, {
|
|
10639
10661
|
filterCount: Object.keys(filters).length,
|
|
10640
10662
|
filter: filters,
|
|
@@ -10729,7 +10751,7 @@ const RichDataTable = /*#__PURE__*/forwardRef(function RichDatatable(props, ref)
|
|
|
10729
10751
|
exportOptions: props.exportOptions,
|
|
10730
10752
|
actions: props.actions && props.actions.length > 0 || props.addAction ? updateActions(props.actions, handleDrawerOpen, enableTableRowAction, selectedRowCount, Add) : undefined,
|
|
10731
10753
|
onFilterClick: isFilterPanelEnabled ? handleFilterClick : undefined,
|
|
10732
|
-
hasFilters: filterPanelState.filterCount > 0 || filterPanelState.sortCount > 0,
|
|
10754
|
+
hasFilters: filterPanelState.filterCount > 0 || filterPanelState.sortCount > 0 || filterPanelState.searchText,
|
|
10733
10755
|
disableFilterButton: isFetching
|
|
10734
10756
|
}, props.titleAndActionHeaderProps)), /*#__PURE__*/jsx(DataTable, _extends({}, props, {
|
|
10735
10757
|
tableRef: DataTableRef,
|