@stella-source/stellasource-dsl 3.6.0 → 4.0.0

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.
@@ -1,4 +1,4 @@
1
- export type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash" | "sync" | "chevron-left" | "check-square" | "money" | "currency-dollar" | "x-circle" | "empty" | "hourglass-simple-low" | "broadcast" | "list-checks" | "note-pencil" | "truck";
1
+ export type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash" | "sync" | "chevron-left" | "check-square" | "money" | "currency-dollar" | "x-circle" | "empty" | "hourglass-simple-low" | "broadcast" | "list-checks" | "note-pencil" | "truck" | "table";
2
2
  export interface StellaIconProps {
3
3
  iconName: StellaIconDefinition;
4
4
  size?: number;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { TableProps } from "./types";
3
- declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, onRowClick, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, }: TableProps<T>): React.JSX.Element;
3
+ declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, onRowClick, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, enableShowHide, globalActions, }: TableProps<T>): React.JSX.Element;
4
4
  export default Table;
@@ -0,0 +1,26 @@
1
+ import React, { RefObject } from "react";
2
+ export interface CheckboxDropdownOption {
3
+ key: string;
4
+ value: string;
5
+ }
6
+ interface CheckboxDropdownMenuProps {
7
+ options: CheckboxDropdownOption[];
8
+ selected: (string | number)[];
9
+ mode?: "search" | "singleSelect" | "multiSelect";
10
+ coords: {
11
+ top: number;
12
+ left: number;
13
+ };
14
+ menuRef: RefObject<HTMLDivElement | null>;
15
+ onApply: (selected: (string | number)[]) => void;
16
+ onClear: () => void;
17
+ showSelectAll?: boolean;
18
+ showClear?: boolean;
19
+ searchInputId?: string;
20
+ searchInputLabel?: string;
21
+ onSearch?: (value: string) => void;
22
+ onSearchBlur?: () => void;
23
+ serverSide?: boolean;
24
+ }
25
+ declare const CheckboxDropdownMenu: ({ options, selected, mode, coords, menuRef, onApply, onClear, showSelectAll, showClear, searchInputId, searchInputLabel, onSearch, onSearchBlur, serverSide, }: CheckboxDropdownMenuProps) => React.ReactPortal;
26
+ export default CheckboxDropdownMenu;
@@ -80,4 +80,6 @@ declare const EmptyTableSection: import("styled-components/dist/types").IStyledC
80
80
  declare const EmptyTableHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>>> & string;
81
81
  declare const EmptyTableSubHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>>> & string;
82
82
  declare const ClearFilterButtonRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
83
- export { HeaderCell, TableWrapper, TableWrapperScroll, StyledTable, CustomIconButton, SortButton, HeaderRow, FilterMenu, Checkbox, BodyCell, HeaderCellPosition, MenuButton, MenuItem, FilterBoxLabel, LoadingShimmer, FilterLabelTransparent, CustomPagination, CellRow, MenuItemGroup, KebabAlign, MenuItemOption, EmptyTableCell, EmptyTableSection, EmptyTableHeader, EmptyTableSubHeader, ClearFilterButtonRow, };
83
+ declare const ActionBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
84
+ declare const GlobalActionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
85
+ export { HeaderCell, TableWrapper, TableWrapperScroll, StyledTable, CustomIconButton, SortButton, HeaderRow, FilterMenu, Checkbox, BodyCell, HeaderCellPosition, MenuButton, MenuItem, FilterBoxLabel, LoadingShimmer, FilterLabelTransparent, CustomPagination, CellRow, MenuItemGroup, KebabAlign, MenuItemOption, EmptyTableCell, EmptyTableSection, EmptyTableHeader, EmptyTableSubHeader, ClearFilterButtonRow, ActionBar, GlobalActionWrapper, };
@@ -1,5 +1,5 @@
1
- import { ColumnDef, ColumnFiltersState, Row } from "@tanstack/react-table";
2
- import { HTMLAttributes } from "react";
1
+ import { ColumnDef, ColumnFiltersState, Row, Table } from "@tanstack/react-table";
2
+ import { HTMLAttributes, ReactElement } from "react";
3
3
  declare enum TableVariant {
4
4
  PRIMARY = "Primary",
5
5
  SECONDARY = "Secondary"
@@ -33,7 +33,7 @@ export interface TableProps<T> {
33
33
  }[];
34
34
  dataTestId?: string;
35
35
  dataAuto?: string;
36
- id?: string;
36
+ id: string;
37
37
  className?: string;
38
38
  htmlProps?: HTMLAttributes<HTMLTableElement>;
39
39
  paginationDetails?: PaginationDetails;
@@ -53,6 +53,11 @@ export interface TableProps<T> {
53
53
  id: string;
54
54
  value: unknown;
55
55
  }[];
56
+ enableShowHide?: boolean;
57
+ globalActions?: {
58
+ element: ReactElement;
59
+ onChange?: (table?: Table<T>) => void;
60
+ }[];
56
61
  }
57
62
  export interface CustomColumnMeta {
58
63
  headerAlign?: "left" | "right";
@@ -64,6 +69,7 @@ export interface CustomColumnMeta {
64
69
  value?: string;
65
70
  }[];
66
71
  filterMode?: "singleSelect" | "multiSelect" | "search";
72
+ defaultHidden?: boolean;
67
73
  }
68
74
  export type RowStatus = "action-pending" | "completed";
69
75
  export {};
@@ -0,0 +1,9 @@
1
+ import { ColumnSizingState, SortingState, VisibilityState } from "@tanstack/react-table";
2
+ type PersistedTableState = {
3
+ columnVisibility: VisibilityState;
4
+ columnSizing: ColumnSizingState;
5
+ sorting: SortingState;
6
+ };
7
+ export declare function loadTableState(tableId: string): Partial<PersistedTableState>;
8
+ export declare function usePersistTableState(tableId: string, state: Partial<PersistedTableState>, sizingDebounceMs?: number): void;
9
+ export {};