@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.
- package/dist/cjs/index.js +388 -262
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/StellaIcon/types.d.ts +1 -1
- package/dist/cjs/types/components/Table/Table.d.ts +1 -1
- package/dist/cjs/types/components/Table/TableComponents/CheckboxDropdownMenu.d.ts +26 -0
- package/dist/cjs/types/components/Table/styles.d.ts +3 -1
- package/dist/cjs/types/components/Table/types.d.ts +9 -3
- package/dist/cjs/types/components/Table/useTableState.d.ts +9 -0
- package/dist/esm/index.esm.js +388 -262
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/types/components/StellaIcon/types.d.ts +1 -1
- package/dist/esm/types/components/Table/Table.d.ts +1 -1
- package/dist/esm/types/components/Table/TableComponents/CheckboxDropdownMenu.d.ts +26 -0
- package/dist/esm/types/components/Table/styles.d.ts +3 -1
- package/dist/esm/types/components/Table/types.d.ts +9 -3
- package/dist/esm/types/components/Table/useTableState.d.ts +9 -0
- package/dist/index.d.ts +10 -4
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
|
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 {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React$1, { HTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { TooltipProps as TooltipProps$1 } from 'antd';
|
|
3
|
-
import { ColumnDef, ColumnFiltersState, Row } from '@tanstack/react-table';
|
|
3
|
+
import { ColumnDef, ColumnFiltersState, Row, Table as Table$1 } from '@tanstack/react-table';
|
|
4
4
|
|
|
5
5
|
interface LabelProps {
|
|
6
6
|
id: string;
|
|
@@ -98,7 +98,7 @@ interface TooltipProps {
|
|
|
98
98
|
|
|
99
99
|
declare const Tooltip: ({ title, placement, type, ariaLabel, iconSize, htmlProps, className, id, }: TooltipProps) => React$1.JSX.Element;
|
|
100
100
|
|
|
101
|
-
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";
|
|
101
|
+
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";
|
|
102
102
|
interface StellaIconProps {
|
|
103
103
|
iconName: StellaIconDefinition;
|
|
104
104
|
size?: number;
|
|
@@ -260,7 +260,7 @@ interface TableProps<T> {
|
|
|
260
260
|
}[];
|
|
261
261
|
dataTestId?: string;
|
|
262
262
|
dataAuto?: string;
|
|
263
|
-
id
|
|
263
|
+
id: string;
|
|
264
264
|
className?: string;
|
|
265
265
|
htmlProps?: HTMLAttributes<HTMLTableElement>;
|
|
266
266
|
paginationDetails?: PaginationDetails;
|
|
@@ -280,6 +280,11 @@ interface TableProps<T> {
|
|
|
280
280
|
id: string;
|
|
281
281
|
value: unknown;
|
|
282
282
|
}[];
|
|
283
|
+
enableShowHide?: boolean;
|
|
284
|
+
globalActions?: {
|
|
285
|
+
element: ReactElement;
|
|
286
|
+
onChange?: (table?: Table$1<T>) => void;
|
|
287
|
+
}[];
|
|
283
288
|
}
|
|
284
289
|
interface CustomColumnMeta {
|
|
285
290
|
headerAlign?: "left" | "right";
|
|
@@ -291,10 +296,11 @@ interface CustomColumnMeta {
|
|
|
291
296
|
value?: string;
|
|
292
297
|
}[];
|
|
293
298
|
filterMode?: "singleSelect" | "multiSelect" | "search";
|
|
299
|
+
defaultHidden?: boolean;
|
|
294
300
|
}
|
|
295
301
|
type RowStatus = "action-pending" | "completed";
|
|
296
302
|
|
|
297
|
-
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$1.JSX.Element;
|
|
303
|
+
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$1.JSX.Element;
|
|
298
304
|
|
|
299
305
|
interface PaginationProps {
|
|
300
306
|
id?: string;
|