simple-table-core 0.8.32 → 0.8.34

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 (29) hide show
  1. package/dist/components/dropdown/Dropdown.d.ts +2 -1
  2. package/dist/components/filters/BooleanFilter.d.ts +11 -0
  3. package/dist/components/filters/DateFilter.d.ts +11 -0
  4. package/dist/components/filters/EnumFilter.d.ts +11 -0
  5. package/dist/components/filters/FilterBar.d.ts +2 -0
  6. package/dist/components/filters/FilterDropdown.d.ts +11 -0
  7. package/dist/components/filters/NumberFilter.d.ts +11 -0
  8. package/dist/components/filters/StringFilter.d.ts +11 -0
  9. package/dist/components/filters/shared/CustomSelect.d.ts +15 -0
  10. package/dist/components/filters/shared/FilterActions.d.ts +9 -0
  11. package/dist/components/filters/shared/FilterContainer.d.ts +6 -0
  12. package/dist/components/filters/shared/FilterInput.d.ts +11 -0
  13. package/dist/components/filters/shared/FilterSection.d.ts +7 -0
  14. package/dist/components/filters/shared/FilterSelect.d.ts +12 -0
  15. package/dist/components/filters/shared/OperatorSelector.d.ts +8 -0
  16. package/dist/components/filters/shared/index.d.ts +8 -0
  17. package/dist/components/simple-table/editable-cells/EditableCell.d.ts +2 -1
  18. package/dist/components/simple-table/editable-cells/EnumDropdownEdit.d.ts +2 -1
  19. package/dist/context/TableContext.d.ts +7 -0
  20. package/dist/icons/CheckIcon.d.ts +6 -0
  21. package/dist/icons/FilterIcon.d.ts +6 -0
  22. package/dist/icons/SelectIcon.d.ts +2 -0
  23. package/dist/index.es.js +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/styles.css +1 -1
  26. package/dist/types/EnumOption.d.ts +5 -0
  27. package/dist/types/FilterTypes.d.ts +20 -0
  28. package/dist/types/HeaderObject.d.ts +5 -1
  29. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  import React, { ReactNode } from "react";
2
2
  export interface DropdownProps {
3
3
  children: ReactNode;
4
+ containerRef?: React.RefObject<HTMLElement>;
4
5
  onClose: () => void;
5
6
  open?: boolean;
7
+ overflow?: "auto" | "visible";
6
8
  setOpen: (open: boolean) => void;
7
9
  width?: number;
8
- containerRef?: React.RefObject<HTMLElement>;
9
10
  }
10
11
  declare const Dropdown: React.FC<DropdownProps>;
11
12
  export default Dropdown;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import HeaderObject from "../../types/HeaderObject";
3
+ import { FilterCondition } from "../../types/FilterTypes";
4
+ interface BooleanFilterProps {
5
+ header: HeaderObject;
6
+ currentFilter?: FilterCondition;
7
+ onApplyFilter: (filter: FilterCondition) => void;
8
+ onClearFilter: () => void;
9
+ }
10
+ declare const BooleanFilter: React.FC<BooleanFilterProps>;
11
+ export default BooleanFilter;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import HeaderObject from "../../types/HeaderObject";
3
+ import { FilterCondition } from "../../types/FilterTypes";
4
+ interface DateFilterProps {
5
+ header: HeaderObject;
6
+ currentFilter?: FilterCondition;
7
+ onApplyFilter: (filter: FilterCondition) => void;
8
+ onClearFilter: () => void;
9
+ }
10
+ declare const DateFilter: React.FC<DateFilterProps>;
11
+ export default DateFilter;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import HeaderObject from "../../types/HeaderObject";
3
+ import { FilterCondition } from "../../types/FilterTypes";
4
+ interface EnumFilterProps {
5
+ header: HeaderObject;
6
+ currentFilter?: FilterCondition;
7
+ onApplyFilter: (filter: FilterCondition) => void;
8
+ onClearFilter: () => void;
9
+ }
10
+ declare const EnumFilter: React.FC<EnumFilterProps>;
11
+ export default EnumFilter;
@@ -0,0 +1,2 @@
1
+ declare const FilterBar: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default FilterBar;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import HeaderObject from "../../types/HeaderObject";
3
+ import { FilterCondition } from "../../types/FilterTypes";
4
+ interface FilterDropdownProps {
5
+ header: HeaderObject;
6
+ currentFilter?: FilterCondition;
7
+ onApplyFilter: (filter: FilterCondition) => void;
8
+ onClearFilter: () => void;
9
+ }
10
+ declare const FilterDropdown: React.FC<FilterDropdownProps>;
11
+ export default FilterDropdown;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import HeaderObject from "../../types/HeaderObject";
3
+ import { FilterCondition } from "../../types/FilterTypes";
4
+ interface NumberFilterProps {
5
+ header: HeaderObject;
6
+ currentFilter?: FilterCondition;
7
+ onApplyFilter: (filter: FilterCondition) => void;
8
+ onClearFilter: () => void;
9
+ }
10
+ declare const NumberFilter: React.FC<NumberFilterProps>;
11
+ export default NumberFilter;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import HeaderObject from "../../types/HeaderObject";
3
+ import { FilterCondition } from "../../types/FilterTypes";
4
+ interface StringFilterProps {
5
+ header: HeaderObject;
6
+ currentFilter?: FilterCondition;
7
+ onApplyFilter: (filter: FilterCondition) => void;
8
+ onClearFilter: () => void;
9
+ }
10
+ declare const StringFilter: React.FC<StringFilterProps>;
11
+ export default StringFilter;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ export interface CustomSelectOption {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ interface CustomSelectProps {
7
+ value: string;
8
+ onChange: (value: string) => void;
9
+ options: CustomSelectOption[];
10
+ placeholder?: string;
11
+ className?: string;
12
+ disabled?: boolean;
13
+ }
14
+ declare const CustomSelect: React.FC<CustomSelectProps>;
15
+ export default CustomSelect;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ interface FilterActionsProps {
3
+ onApply: () => void;
4
+ onClear?: () => void;
5
+ canApply: boolean;
6
+ showClear: boolean;
7
+ }
8
+ declare const FilterActions: React.FC<FilterActionsProps>;
9
+ export default FilterActions;
@@ -0,0 +1,6 @@
1
+ import React, { ReactNode } from "react";
2
+ interface FilterContainerProps {
3
+ children: ReactNode;
4
+ }
5
+ declare const FilterContainer: React.FC<FilterContainerProps>;
6
+ export default FilterContainer;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ interface FilterInputProps {
3
+ type?: "text" | "number" | "date";
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ placeholder?: string;
7
+ autoFocus?: boolean;
8
+ className?: string;
9
+ }
10
+ declare const FilterInput: React.FC<FilterInputProps>;
11
+ export default FilterInput;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from "react";
2
+ interface FilterSectionProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ }
6
+ declare const FilterSection: React.FC<FilterSectionProps>;
7
+ export default FilterSection;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { CustomSelectOption } from "./CustomSelect";
3
+ interface FilterSelectProps {
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ options: CustomSelectOption[];
7
+ autoFocus?: boolean;
8
+ className?: string;
9
+ placeholder?: string;
10
+ }
11
+ declare const FilterSelect: React.FC<FilterSelectProps>;
12
+ export default FilterSelect;
@@ -0,0 +1,8 @@
1
+ import { FilterOperator } from "../../../types/FilterTypes";
2
+ interface OperatorSelectorProps<T extends FilterOperator> {
3
+ value: T;
4
+ onChange: (operator: T) => void;
5
+ operators: readonly T[];
6
+ }
7
+ declare const OperatorSelector: <T extends FilterOperator>({ value, onChange, operators, }: OperatorSelectorProps<T>) => import("react/jsx-runtime").JSX.Element;
8
+ export default OperatorSelector;
@@ -0,0 +1,8 @@
1
+ export { default as FilterContainer } from "./FilterContainer";
2
+ export { default as OperatorSelector } from "./OperatorSelector";
3
+ export { default as FilterInput } from "./FilterInput";
4
+ export { default as FilterSelect } from "./FilterSelect";
5
+ export { default as FilterSection } from "./FilterSection";
6
+ export { default as FilterActions } from "./FilterActions";
7
+ export { default as CustomSelect } from "./CustomSelect";
8
+ export type { CustomSelectOption } from "./CustomSelect";
@@ -1,6 +1,7 @@
1
1
  import CellValue from "../../../types/CellValue";
2
+ import EnumOption from "../../../types/EnumOption";
2
3
  interface EditableCellProps {
3
- enumOptions?: string[];
4
+ enumOptions?: EnumOption[];
4
5
  onChange: (newValue: CellValue) => void;
5
6
  setIsEditing: (isEditing: boolean) => void;
6
7
  type?: "string" | "number" | "boolean" | "date" | "enum";
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
+ import EnumOption from "../../../types/EnumOption";
2
3
  interface EnumDropdownEditProps {
3
4
  onBlur: () => void;
4
5
  onChange: (value: string) => void;
5
6
  open: boolean;
6
- options: string[];
7
+ options: EnumOption[];
7
8
  setOpen: (open: boolean) => void;
8
9
  value: string;
9
10
  }
@@ -3,6 +3,8 @@ import HeaderObject from "../types/HeaderObject";
3
3
  import OnSortProps from "../types/OnSortProps";
4
4
  import Cell from "../types/Cell";
5
5
  import CellValue from "../types/CellValue";
6
+ import { Theme } from "..";
7
+ import { TableFilterState, FilterCondition } from "../types/FilterTypes";
6
8
  export interface CellRegistryEntry {
7
9
  updateContent: (newValue: CellValue) => void;
8
10
  }
@@ -16,8 +18,12 @@ interface TableContextType {
16
18
  draggedHeaderRef: RefObject<HeaderObject | null>;
17
19
  editColumns?: boolean;
18
20
  expandIcon?: ReactNode;
21
+ filters: TableFilterState;
19
22
  forceUpdate: () => void;
20
23
  getBorderClass: (cell: Cell) => string;
24
+ handleApplyFilter: (filter: FilterCondition) => void;
25
+ handleClearFilter: (accessor: string) => void;
26
+ handleClearAllFilters: () => void;
21
27
  handleMouseDown: (cell: Cell) => void;
22
28
  handleMouseOver: (cell: Cell) => void;
23
29
  headersRef: RefObject<HeaderObject[]>;
@@ -49,6 +55,7 @@ interface TableContextType {
49
55
  sortDownIcon?: ReactNode;
50
56
  sortUpIcon?: ReactNode;
51
57
  tableBodyContainerRef: RefObject<HTMLDivElement | null>;
58
+ theme: Theme;
52
59
  useHoverRowBackground?: boolean;
53
60
  useOddColumnBackground?: boolean;
54
61
  useOddEvenRowBackground?: boolean;
@@ -0,0 +1,6 @@
1
+ import { CSSProperties } from "react";
2
+ declare const CheckIcon: ({ className, style }: {
3
+ className?: string | undefined;
4
+ style?: CSSProperties | undefined;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export default CheckIcon;
@@ -0,0 +1,6 @@
1
+ import { CSSProperties } from "react";
2
+ declare const FilterIcon: ({ className, style }: {
3
+ className?: string | undefined;
4
+ style?: CSSProperties | undefined;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export default FilterIcon;
@@ -0,0 +1,2 @@
1
+ declare const SelectIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SelectIcon;