sccoreui 5.9.74 → 5.9.76
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/components/ag-grid/context-provider.js +11 -1
- package/dist/components/ag-grid/parent-for-grid.js +2 -1
- package/dist/components/sc-multi-select/scMultiSelect.js +1 -1
- package/dist/types/components/ag-grid/Types.d.ts +1 -0
- package/dist/types/components/ag-grid/context-provider.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const helper_1 = require("./helper");
|
|
7
7
|
exports.FeatureContext = (0, react_1.createContext)(null);
|
|
8
8
|
function MyProvider({ children, value }) {
|
|
9
|
-
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sortOptions, filterConditions } = value;
|
|
9
|
+
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sortOptions, filterConditions, clearFilters } = value;
|
|
10
10
|
// States for sort
|
|
11
11
|
const [columnData] = (0, react_1.useState)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
|
|
12
12
|
const [sortValue, setSortValue] = (0, react_1.useState)({});
|
|
@@ -46,6 +46,16 @@ function MyProvider({ children, value }) {
|
|
|
46
46
|
setGlobalFilters(filtersToAdd);
|
|
47
47
|
}
|
|
48
48
|
}, [defaultFilters]);
|
|
49
|
+
// Empty filters and call the grid
|
|
50
|
+
(0, react_1.useEffect)(() => {
|
|
51
|
+
if (clearFilters) {
|
|
52
|
+
let currentFeature = featureDetails;
|
|
53
|
+
currentFeature.filterQueries = [];
|
|
54
|
+
setFeatureDetails(currentFeature);
|
|
55
|
+
setGlobalFilters([]);
|
|
56
|
+
callGrid(currentFeature);
|
|
57
|
+
}
|
|
58
|
+
}, [clearFilters]);
|
|
49
59
|
return ((0, jsx_runtime_1.jsx)(exports.FeatureContext.Provider, Object.assign({ value: {
|
|
50
60
|
sortValue,
|
|
51
61
|
setSortValue,
|
|
@@ -272,7 +272,8 @@ function ParentForGrid(props) {
|
|
|
272
272
|
sortModelText: (_c = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _c === void 0 ? void 0 : _c.sortModelText,
|
|
273
273
|
recordDetailModelText: (_d = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _d === void 0 ? void 0 : _d.recordDetailModelText,
|
|
274
274
|
sortOptions: (props === null || props === void 0 ? void 0 : props.sortOptions) ? props.sortOptions : constants_1.COLUMN_SORT_OPTIONS,
|
|
275
|
-
filterConditions: props === null || props === void 0 ? void 0 : props.filterConditions
|
|
275
|
+
filterConditions: props === null || props === void 0 ? void 0 : props.filterConditions,
|
|
276
|
+
clearFilters: props === null || props === void 0 ? void 0 : props.clearFilters
|
|
276
277
|
} }, { children: (0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props }) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady, gridRef: gridRef })] }) })) }) }));
|
|
277
278
|
}
|
|
278
279
|
exports.default = ParentForGrid;
|
|
@@ -16,7 +16,7 @@ const ScMultiSelect = (props) => {
|
|
|
16
16
|
let totalWidth = 0;
|
|
17
17
|
for (let i = 0; i < selectedItems.length; i++) {
|
|
18
18
|
totalWidth += selectedItems[i].offsetWidth; // Approximation, adjust as necessary
|
|
19
|
-
if (totalWidth > containerWidth -
|
|
19
|
+
if (totalWidth > containerWidth - 82) { // 20px buffer for ellipsis
|
|
20
20
|
setShowCount(selectedItems.length - i);
|
|
21
21
|
i = selectedItems.length;
|
|
22
22
|
}
|
|
@@ -17,6 +17,7 @@ interface MyProviderProps {
|
|
|
17
17
|
recordDetailModelText: RecordDetailModelText;
|
|
18
18
|
sortOptions: any[];
|
|
19
19
|
filterConditions: FilterCondition[];
|
|
20
|
+
clearFilters: Boolean;
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
declare function MyProvider({ children, value }: MyProviderProps): import("react/jsx-runtime").JSX.Element;
|