@vuu-ui/vuu-filters 3.5.0-beta.4 → 3.5.1

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.
Files changed (85) hide show
  1. package/package.json +12 -12
  2. package/src/column-filter/ColumnFilter.js +2 -1
  3. package/src/filter-container/FilterContainer.js +1 -1
  4. package/src/filter-context-menu/useFilterContextMenu.js +1 -1
  5. package/src/filter-provider/FilterContext.js +1 -1
  6. package/src/filter-provider/FilterProvider.js +4 -3
  7. package/src/toggle-filter/ToggleFilter.js +4 -3
  8. package/types/column-filter/ColumnFilter.d.ts +1 -1
  9. package/types/filter-container/FilterContainer.d.ts +2 -1
  10. package/types/filter-provider/FilterContext.d.ts +12 -5
  11. package/types/filter-provider/FilterProvider.d.ts +9 -1
  12. package/types/index.d.ts +2 -2
  13. package/types/src/FilterAggregator.d.ts +28 -0
  14. package/types/src/FilterModel.d.ts +44 -0
  15. package/types/src/column-filter/ColumnFilter.d.ts +6 -0
  16. package/types/src/column-filter/useColumnFilter.d.ts +43 -0
  17. package/types/src/column-filter/utils.d.ts +4 -0
  18. package/types/src/custom-filters/CustomFilters.d.ts +7 -0
  19. package/types/src/custom-filters/filterBarFocusManagement.d.ts +1 -0
  20. package/types/src/custom-filters/index.d.ts +1 -0
  21. package/types/src/custom-filters/useCustomFilters.d.ts +33 -0
  22. package/types/src/custom-filters/useFilterState.d.ts +17 -0
  23. package/types/src/filter-bar/FilterBar.d.ts +33 -0
  24. package/types/src/filter-bar/FilterBarMenu.d.ts +1 -0
  25. package/types/src/filter-bar/index.d.ts +2 -0
  26. package/types/src/filter-bar/useFilterBar.d.ts +7 -0
  27. package/types/src/filter-clause/ExpandoCombobox.d.ts +10 -0
  28. package/types/src/filter-clause/FilterClause.d.ts +16 -0
  29. package/types/src/filter-clause/column-picker/ColumnPicker.d.ts +13 -0
  30. package/types/src/filter-clause/column-picker/useColumnPicker.d.ts +11 -0
  31. package/types/src/filter-clause/filterClauseFocusManagement.d.ts +15 -0
  32. package/types/src/filter-clause/filterClauseTypes.d.ts +12 -0
  33. package/types/src/filter-clause/index.d.ts +5 -0
  34. package/types/src/filter-clause/operator-picker/OperatorPicker.d.ts +14 -0
  35. package/types/src/filter-clause/operator-picker/operator-utils.d.ts +5 -0
  36. package/types/src/filter-clause/operator-picker/useOperatorPicker.d.ts +12 -0
  37. package/types/src/filter-clause/useFilterClause.d.ts +26 -0
  38. package/types/src/filter-clause/value-editors/FilterClauseValueEditor.d.ts +26 -0
  39. package/types/src/filter-clause/value-editors/FilterClauseValueEditorDate.d.ts +9 -0
  40. package/types/src/filter-clause/value-editors/FilterClauseValueEditorNumber.d.ts +9 -0
  41. package/types/src/filter-clause/value-editors/FilterClauseValueEditorText.d.ts +9 -0
  42. package/types/src/filter-clause/value-editors/FilterClauseValueEditorTime.d.ts +9 -0
  43. package/types/src/filter-container/ExtendedSingleValueFilterClause.d.ts +21 -0
  44. package/types/src/filter-container/FilterContainer.d.ts +23 -0
  45. package/types/src/filter-container/useFilterContainer.d.ts +22 -0
  46. package/types/src/filter-context-menu/useFilterContextMenu.d.ts +6 -0
  47. package/types/src/filter-display/FilterDisplay.d.ts +10 -0
  48. package/types/src/filter-editor/FilterClauseCombinator.d.ts +9 -0
  49. package/types/src/filter-editor/FilterEditor.d.ts +14 -0
  50. package/types/src/filter-editor/index.d.ts +1 -0
  51. package/types/src/filter-editor/useFilterEditor.d.ts +32 -0
  52. package/types/src/filter-panel/FilterPanel.d.ts +9 -0
  53. package/types/src/filter-panel/useFilterPanel.d.ts +14 -0
  54. package/types/src/filter-pill/FilterMenu.d.ts +24 -0
  55. package/types/src/filter-pill/FilterPill.d.ts +16 -0
  56. package/types/src/filter-pill/FilterPillNext.d.ts +15 -0
  57. package/types/src/filter-pill/filterAsReactNode.d.ts +3 -0
  58. package/types/src/filter-pill/getFilterLabel.d.ts +2 -0
  59. package/types/src/filter-pill/getFilterTooltipText.d.ts +2 -0
  60. package/types/src/filter-pill/index.d.ts +1 -0
  61. package/types/src/filter-pill/useFilterPillNext.d.ts +25 -0
  62. package/types/src/filter-pill-menu/FilterPillMenu.d.ts +17 -0
  63. package/types/src/filter-pill-menu/FilterPillMenuOptions.d.ts +12 -0
  64. package/types/src/filter-pill-menu/index.d.ts +1 -0
  65. package/types/src/filter-provider/FilterContext.d.ts +39 -0
  66. package/types/src/filter-provider/FilterProvider.d.ts +10 -0
  67. package/types/src/filter-provider/filter-descriptor-utils.d.ts +7 -0
  68. package/types/src/filter-toggle-button/FilterToggleButton.d.ts +9 -0
  69. package/types/src/filter-utils.d.ts +60 -0
  70. package/types/src/index.d.ts +24 -0
  71. package/types/src/inline-filter/InlineFilter.d.ts +12 -0
  72. package/types/src/inline-filter/index.d.ts +1 -0
  73. package/types/src/inline-filter/useInlineFilter.d.ts +5 -0
  74. package/types/src/quick-filters/QuickFilters.d.ts +17 -0
  75. package/types/src/quick-filters/index.d.ts +1 -0
  76. package/types/src/quick-filters/useQuickFilters.d.ts +12 -0
  77. package/types/src/saved-filters/DeleteFilterPrompt.d.ts +9 -0
  78. package/types/src/saved-filters/FilterNamePrompt.d.ts +6 -0
  79. package/types/src/saved-filters/SavedFilterPanel.d.ts +14 -0
  80. package/types/src/saved-filters/useFilterNamePrompt.d.ts +28 -0
  81. package/types/src/saved-filters/useSavedFilterPanel.d.ts +13 -0
  82. package/types/src/tabbed-filter-container/TabbedFilterContainer.d.ts +10 -0
  83. package/types/src/toggle-filter/ToggleFilter.d.ts +17 -0
  84. package/types/src/toggle-filter/useToggleFilter.d.ts +11 -0
  85. package/types/toggle-filter/ToggleFilter.d.ts +5 -0
@@ -0,0 +1,12 @@
1
+ import { MultiSelectionHandler } from "@vuu-ui/vuu-ui-controls";
2
+ import { CommitHandler } from "@vuu-ui/vuu-utils";
3
+ import { ChangeEventHandler, RefCallback } from "react";
4
+ import { QuickFilterProps } from "./QuickFilters";
5
+ export type QuickFilterHookProps = Pick<QuickFilterProps, "availableColumns" | "onApplyFilter" | "onClearFilter" | "onChangeQuickFilterColumns" | "quickFilterColumns">;
6
+ export declare const useQuickFilters: ({ availableColumns, onApplyFilter, onClearFilter, onChangeQuickFilterColumns, }: QuickFilterProps) => {
7
+ availableColumnNames: string[];
8
+ onChange: ChangeEventHandler<HTMLInputElement>;
9
+ onColumnsSelectionChange: MultiSelectionHandler;
10
+ onCommit: CommitHandler<HTMLElement>;
11
+ rootRef: RefCallback<HTMLDivElement>;
12
+ };
@@ -0,0 +1,9 @@
1
+ import { FilterContainerFilterDescriptor } from "@vuu-ui/vuu-filter-types";
2
+ import { PromptProps } from "@vuu-ui/vuu-ui-controls";
3
+ import { HTMLAttributes } from "react";
4
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
5
+ export interface DeleteFilterPromptProps extends Pick<PromptProps, "onConfirm" | "onClose" | "open">, HTMLAttributes<HTMLDivElement> {
6
+ columns?: ColumnDescriptor[];
7
+ filterDescriptor: FilterContainerFilterDescriptor;
8
+ }
9
+ export declare const DeleteFilterPrompt: ({ children, className, columns, filterDescriptor, onClose, onConfirm, open, ...htmlAttributes }: DeleteFilterPromptProps) => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { PromptProps } from "@vuu-ui/vuu-ui-controls";
2
+ import { HTMLAttributes } from "react";
3
+ import { FilterNamePromptHookProps } from "./useFilterNamePrompt";
4
+ export interface FilterNamePromptProps extends FilterNamePromptHookProps, Pick<PromptProps, "onClose" | "open" | "title">, Omit<HTMLAttributes<HTMLDivElement>, "title"> {
5
+ }
6
+ export declare const FilterNamePrompt: ({ className, filterName, onClose, onConfirm: onConfirmProp, open, title, filterNameMaxLength, ...htmlAttributes }: FilterNamePromptProps) => import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
+ import { HTMLAttributes } from "react";
3
+ import { FilterPermissions } from "../filter-pill/FilterMenu";
4
+ import { FilterContainerProps } from "../filter-container/FilterContainer";
5
+ export interface SavedFilterPanelProps extends HTMLAttributes<HTMLDivElement>, Pick<FilterContainerProps, "filterProviderKey"> {
6
+ /**
7
+ * ColumnDescriptors are not required but is passed will be
8
+ * used to provide labels and correct value formatting for
9
+ * displayed filters, e.g in tooltips
10
+ */
11
+ availableColumns?: ColumnDescriptor[];
12
+ filterPillPermissions?: FilterPermissions;
13
+ }
14
+ export declare const SavedFilterPanel: ({ availableColumns, className, filterPillPermissions, filterProviderKey, ...htmlAttributes }: SavedFilterPanelProps) => import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { ChangeEventHandler } from "react";
2
+ import { CommitHandler, ValueOf } from "@vuu-ui/vuu-utils";
3
+ export interface FilterNamePromptHookProps {
4
+ filterName?: string;
5
+ onConfirm: (filterName: string) => void;
6
+ filterNameMaxLength?: number;
7
+ }
8
+ export declare const Status: {
9
+ readonly Empty: "empty";
10
+ readonly Valid: "valid";
11
+ readonly Invalid: "invalid";
12
+ readonly DuplicateName: "duplicate-name";
13
+ };
14
+ type Status = ValueOf<typeof Status>;
15
+ export declare const useFilterNamePrompt: ({ filterName, onConfirm, }: FilterNamePromptHookProps) => {
16
+ confirmButtonProps: {
17
+ disabled: boolean;
18
+ label: string;
19
+ ref: import("react").RefObject<HTMLButtonElement | null>;
20
+ };
21
+ nameOfDuplicateFilter: string | undefined;
22
+ onChange: ChangeEventHandler<HTMLInputElement>;
23
+ onCommit: CommitHandler;
24
+ onConfirm: () => void;
25
+ status: Status;
26
+ value: string;
27
+ };
28
+ export {};
@@ -0,0 +1,13 @@
1
+ import { SyntheticEvent } from "react";
2
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
3
+ export type FilterClickHandler = (filterId: string) => void;
4
+ interface SavedFilterPanelProps {
5
+ availableColumns?: ColumnDescriptor[];
6
+ filterProviderKey?: string;
7
+ }
8
+ export declare const useSavedFilterPanel: (props?: SavedFilterPanelProps) => {
9
+ onClickFilter: (e: SyntheticEvent) => void;
10
+ onFilterMenuAction: (filterId: string, filterAction: import("../filter-pill/FilterMenu").FilterAction) => void;
11
+ savedFilters: import("@vuu-ui/vuu-filter-types").FilterContainerFilterDescriptorWithFilter[];
12
+ };
13
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ import { FilterContainerProps } from "../filter-container/FilterContainer";
3
+ import { SavedFilterPanelProps } from "../saved-filters/SavedFilterPanel";
4
+ export interface TabbedFilterContainerProps extends HTMLAttributes<HTMLDivElement>, Pick<FilterContainerProps, "filter" | "filterProviderKey" | "onFilterApplied" | "onFilterCleared"> {
5
+ SavedFilterPanelProps?: Pick<SavedFilterPanelProps, "availableColumns" | "filterPillPermissions">;
6
+ children: ReactNode;
7
+ filterTabLabel?: string;
8
+ savedFilterLabel?: string;
9
+ }
10
+ export declare const TabbedFilterContainer: ({ SavedFilterPanelProps, children, className, filter, filterProviderKey, filterTabLabel, onFilterApplied, onFilterCleared, savedFilterLabel, ...htmlAttributes }: TabbedFilterContainerProps) => import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ToggleButtonGroupProps } from "@salt-ds/core";
2
+ import { CommitHandler } from "@vuu-ui/vuu-utils";
3
+ import { type ToggleFilterHookProps } from "./useToggleFilter";
4
+ /**
5
+ * ToggleFilter is designed to work with a FilterProvider and
6
+ * DataSourceProvider. With a DataSourceProvider, values will
7
+ * be validated against available values from datasource.
8
+ * With both FilterProvider and a DataSourceProvider, changes to
9
+ * the currentFilter will also trigger re-evaluation of available
10
+ * values from dataSource.
11
+ * With neither of these Providers available, the ToggleFilter is
12
+ * behaving like a regular ToggleButtonGroup.
13
+ */
14
+ export interface ToggleFilterProps extends ToggleButtonGroupProps, ToggleFilterHookProps {
15
+ onCommit: CommitHandler<HTMLElement>;
16
+ }
17
+ export declare const ToggleFilter: import("react").ForwardRefExoticComponent<ToggleFilterProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,11 @@
1
+ import type { TableSchemaTable } from "@vuu-ui/vuu-data-types";
2
+ export interface ToggleFilterHookProps {
3
+ column: string;
4
+ /**
5
+ * table must be provided to enable validation
6
+ * of values using server data.
7
+ */
8
+ table?: TableSchemaTable;
9
+ values: string[];
10
+ }
11
+ export declare const useToggleFilter: ({ column, table, values, }: ToggleFilterHookProps) => string | undefined;
@@ -12,6 +12,11 @@ import { type ToggleFilterHookProps } from "./useToggleFilter";
12
12
  * behaving like a regular ToggleButtonGroup.
13
13
  */
14
14
  export interface ToggleFilterProps extends ToggleButtonGroupProps, ToggleFilterHookProps {
15
+ /**
16
+ * Optional labels for the toggle buttons. If provided, must contain
17
+ * the same number of items as values. Defaults to values.
18
+ */
19
+ labels?: string[];
15
20
  onCommit: CommitHandler<HTMLElement>;
16
21
  }
17
22
  export declare const ToggleFilter: import("react").ForwardRefExoticComponent<ToggleFilterProps & import("react").RefAttributes<HTMLDivElement>>;