@apia/api 4.0.37 → 4.0.41

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.d.ts CHANGED
@@ -300,6 +300,7 @@ type TFilter = {
300
300
  isSize?: boolean;
301
301
  addFilter?: () => void;
302
302
  removeFilter?: () => void;
303
+ icon?: string;
303
304
  };
304
305
 
305
306
  type TFilterTypesElementConditions = {
@@ -389,6 +390,7 @@ declare class TableController {
389
390
  markInitialFilters(): void;
390
391
  removeAddedFilters(): void;
391
392
  removeFilter(id: string): void;
393
+ clearFilter(id: string): void;
392
394
  }
393
395
 
394
396
  type QueryControllerStructure = {
package/dist/index.js CHANGED
@@ -3440,7 +3440,7 @@ async function getOptions(search) {
3440
3440
  return [];
3441
3441
  const res = await ApiaApi.get(
3442
3442
  makeApiaUrl({
3443
- ajaxUrl: "apia/AutoCompleteAction.run",
3443
+ ajaxUrl: "AutoCompleteAction.run",
3444
3444
  action: "search",
3445
3445
  object: "doc_free_metadata",
3446
3446
  filter: "doc_free_metadata_title",
@@ -3525,8 +3525,11 @@ const FreeLabelFilterRenderer = observer(
3525
3525
  sx: { height: "50px", width: "50px" },
3526
3526
  icon: "Trash",
3527
3527
  onClick: () => {
3528
- if (state?.removeFilter)
3528
+ if (state?.removeFilter) {
3529
+ controller.state.value = "";
3530
+ controller.state.showValue = "";
3529
3531
  state.removeFilter();
3532
+ }
3530
3533
  }
3531
3534
  }
3532
3535
  ) })
@@ -3812,6 +3815,12 @@ class TableController {
3812
3815
  this.state.filters.delete(id);
3813
3816
  this.state.filters = new Map(this.state.filters);
3814
3817
  }
3818
+ clearFilter(id) {
3819
+ if (this.state.filters.has(id)) {
3820
+ this.state.filters.get(id).filterState.value = "";
3821
+ this.state.filters.get(id).filterState.filterToValue = "";
3822
+ }
3823
+ }
3815
3824
  }
3816
3825
 
3817
3826
  var __defProp$3 = Object.defineProperty;
@@ -4749,6 +4758,7 @@ class MonDocQuery extends QueryController {
4749
4758
  filterToValue: "",
4750
4759
  avoidLabel: true,
4751
4760
  type: "double",
4761
+ icon: "Close",
4752
4762
  addFilter: () => {
4753
4763
  this.addFreeMetadataFilter();
4754
4764
  },
@@ -4804,6 +4814,9 @@ class MonDocQuery extends QueryController {
4804
4814
  type: "double",
4805
4815
  addFilter: () => {
4806
4816
  this.addFreeMetadataFilter();
4817
+ },
4818
+ removeFilter: () => {
4819
+ this.tableController.clearFilter(id);
4807
4820
  }
4808
4821
  };
4809
4822
  this.addFreeMetadataFilter(metadataFilter);