ods-component-lib 1.17.7 → 1.17.9

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.
@@ -1209,9 +1209,10 @@ var customizeBooleanColumnRender = function customizeBooleanColumnRender(e) {
1209
1209
  return e.value;
1210
1210
  };
1211
1211
  function OdsDataGrid(props) {
1212
- return grid(props);
1212
+ var dataGridRef = useRef(null);
1213
+ return grid(props, dataGridRef);
1213
1214
  }
1214
- function grid(props) {
1215
+ function grid(props, dataGridRef) {
1215
1216
  var _ref;
1216
1217
  var headerCellRender = function headerCellRender(colProperties) {
1217
1218
  return React.createElement("th", {
@@ -1252,6 +1253,11 @@ function grid(props) {
1252
1253
  });
1253
1254
  }
1254
1255
  };
1256
+ var clearAllFilters = function clearAllFilters() {
1257
+ if (dataGridRef.current) {
1258
+ dataGridRef.current.instance.clearFilter();
1259
+ }
1260
+ };
1255
1261
  return React.createElement(React.Fragment, null, React.createElement("div", {
1256
1262
  className: "odsDatagrid",
1257
1263
  style: {
@@ -1274,9 +1280,7 @@ function grid(props) {
1274
1280
  onEditCanceling: props.onEditCanceling,
1275
1281
  onExporting: onExporting,
1276
1282
  height: (_ref = props.height !== undefined) != null ? _ref : props.height,
1277
- style: {
1278
- maxWidth: "100%"
1279
- }
1283
+ ref: dataGridRef
1280
1284
  }, React.createElement(Paging, {
1281
1285
  enabled: true,
1282
1286
  defaultPageSize: props.pageSize
@@ -1396,6 +1400,11 @@ function grid(props) {
1396
1400
  type: "primary",
1397
1401
  onClick: props.onAddButton
1398
1402
  }, "Add New")), React.createElement(Item$1, {
1403
+ location: "after"
1404
+ }, React.createElement(OdsButton, {
1405
+ type: "default",
1406
+ onClick: clearAllFilters
1407
+ }, "Clear Filters")), React.createElement(Item$1, {
1399
1408
  name: "searchPanel"
1400
1409
  }), React.createElement(Item$1, {
1401
1410
  name: "columnChooserButton"