@evenicanpm/portal-table-ui 1.4.0 → 1.5.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.
Files changed (66) hide show
  1. package/dist/auth/auth-context.d.ts +36 -0
  2. package/dist/features/settings/index.d.ts +2 -0
  3. package/dist/features/table/components/dashboard/table/actions.d.ts +14 -0
  4. package/dist/features/table/components/dashboard/table/data-mask-map.d.ts +2 -0
  5. package/dist/features/table/components/dashboard/table/details/details.d.ts +27 -0
  6. package/dist/features/table/components/dashboard/table/details/label.d.ts +5 -0
  7. package/dist/features/table/components/dashboard/table/details/rows/downloads.d.ts +6 -0
  8. package/dist/features/table/components/dashboard/table/details/rows/primitive.d.ts +6 -0
  9. package/dist/features/table/components/dashboard/table/details/rows/table.d.ts +17 -0
  10. package/{src/features/table/components/dashboard/table/details/styles.ts → dist/features/table/components/dashboard/table/details/styles.d.ts} +2 -10
  11. package/dist/features/table/components/dashboard/table/filter-render-map.d.ts +2 -0
  12. package/dist/features/table/components/dashboard/table/filters/date-filter.d.ts +2 -0
  13. package/dist/features/table/components/dashboard/table/filters/status-filter.d.ts +2 -0
  14. package/dist/features/table/components/dashboard/table/no-results.d.ts +2 -0
  15. package/dist/features/table/components/dashboard/table/status-pill.d.ts +8 -0
  16. package/dist/features/table/components/dashboard/table/table-header.d.ts +16 -0
  17. package/dist/features/table/components/dashboard/table/table-input.d.ts +11 -0
  18. package/dist/features/table/components/dashboard/table/table-row/action-button.d.ts +8 -0
  19. package/dist/features/table/components/dashboard/table/table-row/table-row.d.ts +32 -0
  20. package/dist/features/table/components/dashboard/table/table-row-skeleton.d.ts +6 -0
  21. package/dist/features/table/components/dashboard/table/table.d.ts +18 -0
  22. package/dist/features/table/components/dashboard/table-dashboard.d.ts +22 -0
  23. package/{src/features/table/index.ts → dist/features/table/index.d.ts} +1 -7
  24. package/dist/features/table/logic/resolvers.d.ts +21 -0
  25. package/dist/features/table/logic/transformers.d.ts +35 -0
  26. package/dist/features/table/logic/types.d.ts +8 -0
  27. package/{src/features/table/types/handlers.ts → dist/features/table/types/handlers.d.ts} +12 -30
  28. package/{src/features/table/types/index.ts → dist/features/table/types/index.d.ts} +0 -1
  29. package/{src/features/table/types/queries.ts → dist/features/table/types/queries.d.ts} +3 -10
  30. package/dist/features/table/types/schemas.d.ts +31 -0
  31. package/{src/index.ts → dist/index.d.ts} +0 -2
  32. package/dist/portal.d.ts +38 -0
  33. package/dist/tsconfig.tsbuildinfo +1 -0
  34. package/package.json +6 -3
  35. package/src/auth/auth-context.tsx +0 -86
  36. package/src/features/table/components/dashboard/table/actions.ts +0 -59
  37. package/src/features/table/components/dashboard/table/data-mask-map.ts +0 -26
  38. package/src/features/table/components/dashboard/table/details/details.tsx +0 -164
  39. package/src/features/table/components/dashboard/table/details/label.tsx +0 -26
  40. package/src/features/table/components/dashboard/table/details/rows/downloads.tsx +0 -26
  41. package/src/features/table/components/dashboard/table/details/rows/primitive.tsx +0 -26
  42. package/src/features/table/components/dashboard/table/details/rows/table.tsx +0 -74
  43. package/src/features/table/components/dashboard/table/filter-render-map.tsx +0 -9
  44. package/src/features/table/components/dashboard/table/filters/date-filter.tsx +0 -31
  45. package/src/features/table/components/dashboard/table/filters/status-filter.tsx +0 -36
  46. package/src/features/table/components/dashboard/table/no-results.tsx +0 -26
  47. package/src/features/table/components/dashboard/table/status-pill.tsx +0 -18
  48. package/src/features/table/components/dashboard/table/table-header.tsx +0 -62
  49. package/src/features/table/components/dashboard/table/table-input.tsx +0 -94
  50. package/src/features/table/components/dashboard/table/table-row/action-button.tsx +0 -39
  51. package/src/features/table/components/dashboard/table/table-row/table-row.tsx +0 -96
  52. package/src/features/table/components/dashboard/table/table-row-skeleton.tsx +0 -36
  53. package/src/features/table/components/dashboard/table/table.tsx +0 -250
  54. package/src/features/table/components/dashboard/table-dashboard.tsx +0 -71
  55. package/src/features/table/logic/resolvers.ts +0 -68
  56. package/src/features/table/logic/transformers.ts +0 -56
  57. package/src/features/table/logic/types.ts +0 -8
  58. package/src/features/table/types/schemas.ts +0 -50
  59. package/src/portal.tsx +0 -68
  60. package/tsconfig.json +0 -28
  61. package/typedoc.json +0 -10
  62. /package/{src/features/table/components/dashboard/index.tsx → dist/features/table/components/dashboard/index.d.ts} +0 -0
  63. /package/{src/features/table/components/dashboard/table/details/index.ts → dist/features/table/components/dashboard/table/details/index.d.ts} +0 -0
  64. /package/{src/features/table/components/dashboard/table/details/rows/index.ts → dist/features/table/components/dashboard/table/details/rows/index.d.ts} +0 -0
  65. /package/{src/features/table/components/dashboard/table/index.ts → dist/features/table/components/dashboard/table/index.d.ts} +0 -0
  66. /package/{src/features/table/logic/index.ts → dist/features/table/logic/index.d.ts} +0 -0
@@ -0,0 +1,36 @@
1
+ import { type PropsWithChildren } from "react";
2
+ /**
3
+ * Powers the auth provider that portal is wrapped in
4
+ * Aggregates user and session related data that is needed
5
+ * within the portal
6
+ */
7
+ interface AuthProviderProps {
8
+ /** The user details returned from auth framework eg. next-auth **/
9
+ session: Session;
10
+ /** how to handle logout **/
11
+ logout: () => void;
12
+ }
13
+ /**
14
+ * The context value
15
+ */
16
+ interface AuthContext {
17
+ session: Session | null;
18
+ /** how to handle logout **/
19
+ logout: (() => void) | null;
20
+ isAuthenticated: boolean | null;
21
+ }
22
+ interface Session {
23
+ email: string | null | undefined;
24
+ name: string | null | undefined;
25
+ token: string | null | undefined;
26
+ }
27
+ declare const AuthContext: import("react").Context<AuthContext>;
28
+ /**
29
+ * Used to access auth details and callback handlers within the portal auth context
30
+ */
31
+ declare const useAuth: () => AuthContext;
32
+ /**
33
+ *
34
+ */
35
+ declare const PortalAuthProvider: ({ session, logout, children, }: PropsWithChildren<AuthProviderProps>) => import("react").JSX.Element;
36
+ export { PortalAuthProvider, useAuth, type AuthProviderProps, AuthContext, type Session, };
@@ -0,0 +1,2 @@
1
+ declare const PortalSettings: () => import("react").JSX.Element;
2
+ export { PortalSettings };
@@ -0,0 +1,14 @@
1
+ import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
2
+ import { UseMutationOptions } from "@tanstack/react-query";
3
+ /**
4
+ *
5
+ * Map of action types -> MUI Icons
6
+ *
7
+ */
8
+ export declare const actionIconMap: Record<string, typeof FileDownloadOutlinedIcon>;
9
+ type MutationFactory = (resourceName: string, docId: string) => UseMutationOptions<any, any, any, any>;
10
+ /**
11
+ *
12
+ */
13
+ export declare const actionMutationMap: Record<string, MutationFactory>;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ import * as Table from "../../../types/";
2
+ export declare const dataMaskMap: Table.Handlers.DataMaskMap;
@@ -0,0 +1,27 @@
1
+ import type { Column } from "@evenicanpm/portal-types-schemas";
2
+ import type * as Types from "../../../../types";
3
+ import type { StatusColorMap, StatusTextMap } from "../../../../types/schemas";
4
+ interface DetailsProps {
5
+ /** What do we do when use clicks back button? */
6
+ handleBack: () => void;
7
+ /** What is the id field name */
8
+ id: string | number;
9
+ /** The actual pojo of data from the API */
10
+ documentData: Types.Queries.Row;
11
+ documentTypeLabel: string;
12
+ /** Special instructions for how to render certain properties */
13
+ detailsRenderMap?: Types.Handlers.DetailsRenderMap;
14
+ /** Data mask map */
15
+ dataMaskMap: Types.Handlers.DataMaskMap;
16
+ /** Table columns **/
17
+ columns: Column[];
18
+ /** */
19
+ statusColorMap: StatusColorMap;
20
+ /** */
21
+ statusTextMap: StatusTextMap;
22
+ }
23
+ /**
24
+ * The Details Page
25
+ */
26
+ declare const Details: ({ id, documentTypeLabel, documentData, handleBack, columns, dataMaskMap, statusColorMap, statusTextMap, }: DetailsProps) => import("react").JSX.Element;
27
+ export { Details };
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ label: string;
3
+ }
4
+ declare const DetailsRowLabel: (props: Props) => import("react").JSX.Element;
5
+ export { DetailsRowLabel };
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ label: string;
3
+ value: string[];
4
+ }
5
+ declare const DetailsDownloads: ({ value }: Props) => import("react").JSX.Element;
6
+ export { DetailsDownloads };
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ label: string;
3
+ value: string | number;
4
+ }
5
+ declare const DetailsPrimitive: (props: Props) => import("react").JSX.Element;
6
+ export { DetailsPrimitive };
@@ -0,0 +1,17 @@
1
+ import type { Column } from "@evenicanpm/portal-types-schemas";
2
+ import type { DataMaskMap } from "../../../../../types/handlers";
3
+ interface Props {
4
+ column: Column;
5
+ value: Record<string, string>[];
6
+ label: string;
7
+ dataMaskMap: DataMaskMap;
8
+ }
9
+ /**
10
+ * Simple table that takes an array of records,
11
+ * builds array of columns from first index and then loops
12
+ * builds table values from rest of the indexes.
13
+ * @param props
14
+ * @returns
15
+ */
16
+ declare const DetailsTable: (props: Props) => import("react").JSX.Element;
17
+ export { DetailsTable };
@@ -1,18 +1,10 @@
1
1
  import type { StyledComponent } from "@emotion/styled";
2
- import { Box, type BoxProps } from "@mui/material";
3
- import { styled } from "@mui/material/styles";
4
-
2
+ import { type BoxProps } from "@mui/material";
5
3
  /**
6
4
  * Explicit type annotation is required here to prevent TS2742.
7
5
  * Without it, TypeScript tries to infer complex internal types from nested
8
6
  * node_modules (@mui/system), which leads to non-portable type definitions
9
7
  * in monorepo or library builds.
10
8
  */
11
- const DetailsRowBox: StyledComponent<BoxProps> = styled(Box)({
12
- mb: 2,
13
- display: "flex",
14
- alignItems: "flex-start",
15
- gap: 2,
16
- });
17
-
9
+ declare const DetailsRowBox: StyledComponent<BoxProps>;
18
10
  export { DetailsRowBox };
@@ -0,0 +1,2 @@
1
+ import * as Table from "../../../types/";
2
+ export declare const filterRenderMapFallback: Table.Handlers.FilterRenderMap;
@@ -0,0 +1,2 @@
1
+ import * as Table from "../../../../types";
2
+ export declare const DateFilter: (props: Table.Handlers.FilterProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import * as Table from "../../../../types/";
2
+ export declare const StatusFilter: (props: Table.Handlers.FilterProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import * as Table from "../../../types/";
2
+ export declare const NoResultsComponent: Table.Handlers.NoResultsComponent;
@@ -0,0 +1,8 @@
1
+ import type { StatusColorMap, StatusTextMap } from "../../../types/schemas";
2
+ interface Props {
3
+ status: number | string | string[];
4
+ statusTextMap: StatusTextMap;
5
+ statusColorMap: StatusColorMap;
6
+ }
7
+ declare const StatusPill: (props: Props) => import("react").JSX.Element | null;
8
+ export { StatusPill };
@@ -0,0 +1,16 @@
1
+ import type React from "react";
2
+ import { Column } from "@evenicanpm/portal-types-schemas";
3
+ interface TableHeaderProps {
4
+ hasActions: boolean;
5
+ columns: (Column & {
6
+ ColumnOrder: number;
7
+ })[] | undefined;
8
+ loading: boolean;
9
+ }
10
+ /**
11
+ *
12
+ * Table handles display and caches it's own data.
13
+ *
14
+ */
15
+ export default function TableHeader({ hasActions, columns, loading, }: Readonly<TableHeaderProps>): React.JSX.Element;
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { Column } from "@evenicanpm/portal-types-schemas";
2
+ import React from "react";
3
+ interface SearchProps {
4
+ searchTerm: string;
5
+ setSearchTerm: React.Dispatch<React.SetStateAction<string>>;
6
+ setColumn: React.Dispatch<React.SetStateAction<string>>;
7
+ selectedColumn: string;
8
+ searchCols: Column[];
9
+ }
10
+ declare const SearchField: React.MemoExoticComponent<({ searchTerm, setSearchTerm, searchCols, selectedColumn, setColumn, }: SearchProps) => React.JSX.Element>;
11
+ export { SearchField };
@@ -0,0 +1,8 @@
1
+ import { Action } from "@evenicanpm/portal-types-schemas";
2
+ interface ActionButtonProps {
3
+ docId: string;
4
+ action: Action;
5
+ resourceName: string;
6
+ }
7
+ export declare function ActionButton({ action, resourceName, docId, }: Readonly<ActionButtonProps>): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,32 @@
1
+ import type React from "react";
2
+ import type * as Types from "../../../../types";
3
+ import { Action } from "@evenicanpm/portal-types-schemas";
4
+ /**
5
+ * This is what we transorm the column data into for convenient rendering.
6
+ */
7
+ type ColumnLogic = {
8
+ id: string;
9
+ mask: string | undefined;
10
+ maskFn: any;
11
+ cellFn: ((value: string | number | string[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | ((value: string | number) => string | number);
12
+ }[] | undefined;
13
+ export type DocumentTableProps = {
14
+ /** The row to render */
15
+ row: Types.Queries.Row;
16
+ /** The render logic for each column ie data mask functions, cell maps*/
17
+ columnLogic: ColumnLogic;
18
+ /** */
19
+ handleClick: React.Dispatch<React.SetStateAction<string | number | null>>;
20
+ /** Actions renderer */
21
+ actions: Action[];
22
+ /** Does this view config have actions? */
23
+ /** The id field for the document (used for knowing what to set selected id to) */
24
+ idField: string;
25
+ };
26
+ /**
27
+ * A single row (document) in the table. Takes the pre-constructed column logic
28
+ * and executes all of the cell renders and data map functions. Also handles
29
+ * rendering the action icons.
30
+ */
31
+ export default function DataTableRow({ row, columnLogic, handleClick: handleSelectDocument, actions, idField, }: Readonly<DocumentTableProps>): React.JSX.Element;
32
+ export {};
@@ -0,0 +1,6 @@
1
+ import type React from "react";
2
+ export type TableRowSkeletonProps = {
3
+ pageSize: number;
4
+ colSpan: number;
5
+ };
6
+ export default function TableRowSkeleton({ pageSize, colSpan, }: Readonly<TableRowSkeletonProps>): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { type QueryKey } from "@tanstack/react-query";
2
+ import type React from "react";
3
+ import type * as Types from "../../../types";
4
+ export type DocumentTableProps = {
5
+ resource: Types.Schemas.Resource;
6
+ pageSize: number;
7
+ setPageSize: React.Dispatch<React.SetStateAction<number>>;
8
+ viewConfigQuery: (resourceName: string) => {
9
+ queryKey: QueryKey;
10
+ queryFn: () => Promise<Types.Queries.TableConfig>;
11
+ };
12
+ };
13
+ /**
14
+ *
15
+ * Table handles display and caches it's own data.
16
+ *
17
+ */
18
+ export default function DocumentTable({ resource, pageSize, setPageSize, viewConfigQuery, }: Readonly<DocumentTableProps>): React.JSX.Element;
@@ -0,0 +1,22 @@
1
+ import type * as Types from "../../types";
2
+ import { QueryKey } from "@tanstack/react-query";
3
+ /**
4
+ * The main props for top-level table entry-point
5
+ *
6
+ *
7
+ */
8
+ export interface TableProps {
9
+ viewConfigQuery: (resourceName: string) => {
10
+ queryKey: QueryKey;
11
+ queryFn: () => Promise<Types.Queries.TableConfig>;
12
+ };
13
+ resources: Types.Schemas.Resource[];
14
+ }
15
+ /**
16
+ *
17
+ * The TableDashboard is the main view component for the table feature.
18
+ * Holds state for the tabs and global pagination for all tables.
19
+ *
20
+ * @params props
21
+ */
22
+ export declare const TableDashboard: ({ resources, viewConfigQuery }: TableProps) => import("react").JSX.Element;
@@ -3,12 +3,6 @@
3
3
 
4
4
  * @packageDocumentation
5
5
  */
6
-
7
6
  export type { DocumentTableProps } from "./components/dashboard/table/table";
8
- export {
9
- TableDashboard,
10
- type TableProps,
11
- } from "./components/dashboard/table-dashboard";
12
-
13
- // SCHEMAS
7
+ export { TableDashboard, type TableProps, } from "./components/dashboard/table-dashboard";
14
8
  export * as Table from "./types";
@@ -0,0 +1,21 @@
1
+ import type { Column } from "@evenicanpm/portal-types-schemas";
2
+ import type * as Types from "../types";
3
+ /** MULTIMETHOD FOR FILTERS
4
+ * Allows multiple implementations
5
+ * based on multiple column properties.
6
+ * Priotizes column name, but also can
7
+ * use data type
8
+ * @internal
9
+ */
10
+ export declare const resolveFilterUI: import("@arrows/multimethod/internal/types").Multimethod;
11
+ /**
12
+ * Dispatch identifies which properties are
13
+ * in handler, then provides corresponding method
14
+ * @internal
15
+ */
16
+ export declare const resolveDataMask: import("@arrows/multimethod/internal/types").Multimethod;
17
+ /**
18
+ * Simpler, doesn't need multimethod cause only dispatches on column name
19
+ * @internal
20
+ */
21
+ export declare const resolveCellUI: (col: Column, handlers: Types.Handlers.CellRenderMap) => ((value: string | number | string[]) => React.ReactElement) | ((value: string | number) => string | number);
@@ -0,0 +1,35 @@
1
+ import type { Column } from "@evenicanpm/portal-types-schemas";
2
+ /**
3
+ * These are pure static functions that include business rules
4
+ * and data manipulation to get the data into the correct
5
+ * form for rendering.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ /**
10
+ * Gets filters and returns an array of the
11
+ * active filters and corresponding options
12
+ * in FilterRequest
13
+ */
14
+ export declare const getActiveFilters: (columns: Column[] | undefined) => ({
15
+ filterName: string;
16
+ filterOptions: {
17
+ value: string | number;
18
+ label: string;
19
+ }[];
20
+ filterType: string;
21
+ } | undefined)[] | undefined;
22
+ /**
23
+ * Filters and sorts visible cols
24
+ */
25
+ export declare const getVisibleColumns: (columns: Column[] | undefined) => (Column & {
26
+ ColumnOrder: number;
27
+ })[] | undefined;
28
+ /**
29
+ *
30
+ */
31
+ export declare const getVisibleDetails: (columns: Column[] | undefined) => Column[] | undefined;
32
+ /**
33
+ * Filters and sorts visible cols
34
+ */
35
+ export declare const getSearchableColumns: (columns: Column[] | undefined) => Column[] | undefined;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * FILTER REQUEST to RESOLVER
3
+ */
4
+ export interface FilterRequest {
5
+ filterName: string;
6
+ filterOptions: string[];
7
+ filterType: string;
8
+ }
@@ -1,15 +1,10 @@
1
1
  import type { FilterOption } from "@evenicanpm/portal-types-schemas";
2
-
3
2
  /**
4
3
  *
5
4
  * @group View Handlers
6
5
  */
7
6
  export type DataMaskMap = Record<string, MaskingFunction>;
8
- export type MaskingFunction = (
9
- value: string | number,
10
- dataMask: string,
11
- ) => string;
12
-
7
+ export type MaskingFunction = (value: string | number, dataMask: string) => string;
13
8
  /**
14
9
  * Uses column names as keys and maps out
15
10
  * value with specific JSX for specific column names.
@@ -20,19 +15,15 @@ export type MaskingFunction = (
20
15
  * @group View Handlers
21
16
  */
22
17
  export interface CellRenderMap {
23
- [ColumnName: string]: (
24
- value: string | number | string[],
25
- ) => React.ReactElement;
18
+ [ColumnName: string]: (value: string | number | string[]) => React.ReactElement;
26
19
  }
27
-
28
20
  export interface FilterProps {
29
- filterName: string;
30
- filterOptions: FilterOption[];
31
- value: Record<string, string>;
32
- setValue: React.Dispatch<React.SetStateAction<Record<string, string>>>;
33
- resetPagination: () => void;
21
+ filterName: string;
22
+ filterOptions: FilterOption[];
23
+ value: Record<string, string>;
24
+ setValue: React.Dispatch<React.SetStateAction<Record<string, string>>>;
25
+ resetPagination: () => void;
34
26
  }
35
-
36
27
  /**
37
28
  *
38
29
  * Provides render methods for particular filter
@@ -45,27 +36,18 @@ export interface FilterProps {
45
36
  * @group View Handlers
46
37
  */
47
38
  export interface FilterRenderMap {
48
- [ColumnName: string]: (props: FilterProps) => React.ReactElement;
39
+ [ColumnName: string]: (props: FilterProps) => React.ReactElement;
49
40
  }
50
-
51
41
  /**
52
42
  *
53
43
  * @group View Handlers
54
44
  */
55
45
  export interface EmptyStateProps {
56
- label: string;
46
+ label: string;
57
47
  }
58
-
59
48
  export type NoResultsComponent = (props: EmptyStateProps) => React.ReactElement;
60
-
61
49
  export interface DetailsRenderMap {
62
- [columnName: string]: (props: {
63
- [columnName: string]:
64
- | string
65
- | number
66
- | object
67
- | string[]
68
- | number[]
69
- | object[];
70
- }) => React.ReactNode;
50
+ [columnName: string]: (props: {
51
+ [columnName: string]: string | number | object | string[] | number[] | object[];
52
+ }) => React.ReactNode;
71
53
  }
@@ -64,7 +64,6 @@
64
64
  *
65
65
  * @packageDocumentation
66
66
  */
67
-
68
67
  export * as Handlers from "./handlers";
69
68
  export * as Queries from "./queries";
70
69
  export * as Schemas from "./schemas";
@@ -1,31 +1,24 @@
1
1
  import type { ViewConfig } from "@evenicanpm/portal-types-schemas";
2
-
3
2
  /**
4
3
  *
5
4
  * These are data types returned from API Backend
6
5
  *
7
6
  */
8
-
9
7
  /**
10
8
  *
11
9
  * A single row in the data table response object.
12
10
  *
13
11
  */
14
- export type Row = Record<
15
- string,
16
- string | number | string[] | Record<string, string>[] | unknown
17
- >;
18
-
12
+ export type Row = Record<string, string | number | string[] | Record<string, string>[] | unknown>;
19
13
  /**
20
14
  *
21
15
  * The response type defined in TDD for row data.
22
16
  *
23
17
  */
24
18
  export interface TableRows {
25
- items: number;
26
- data: Row[];
19
+ items: number;
20
+ data: Row[];
27
21
  }
28
-
29
22
  /**
30
23
  *
31
24
  * Response type of data from table config
@@ -0,0 +1,31 @@
1
+ import type { TableViewParams } from "@evenicanpm/portal-types-schemas";
2
+ import type { CellRenderMap, DataMaskMap, DetailsRenderMap, FilterRenderMap, NoResultsComponent } from "./handlers";
3
+ import type { TableRows } from "./queries";
4
+ /**
5
+ * These are primary domain models and the source of truth for table system.
6
+ */
7
+ /**
8
+ * Status maps
9
+ */
10
+ export type StatusTextMap = Record<number | string, string>;
11
+ export type StatusColor = "success" | "primary" | "warning" | "error";
12
+ export type StatusColorMap = Record<number | string, StatusColor>;
13
+ /**
14
+ * Resource Definition
15
+ */
16
+ export interface Resource {
17
+ name: string;
18
+ label: string;
19
+ idField: string;
20
+ rowsQueryFn: (displaySettings: TableViewParams) => {
21
+ queryKey: readonly unknown[];
22
+ queryFn: () => Promise<TableRows>;
23
+ };
24
+ cellRenderMap?: CellRenderMap;
25
+ dataMaskMap?: DataMaskMap;
26
+ filterRenderMap?: FilterRenderMap;
27
+ noResultsComponent?: NoResultsComponent;
28
+ detailsRenderMap?: DetailsRenderMap;
29
+ statusTextMap: StatusTextMap;
30
+ statusColorMap: StatusColorMap;
31
+ }
@@ -58,8 +58,6 @@
58
58
  * ```
59
59
  * @module e4 Portal
60
60
  */
61
-
62
61
  export type { Session } from "./auth/auth-context";
63
62
  export { Portal, type PortalProps } from "./portal";
64
-
65
63
  export { Table } from "./features/table";
@@ -0,0 +1,38 @@
1
+ import type { PropsWithChildren } from "react";
2
+ import { type AuthProviderProps } from "./auth/auth-context";
3
+ /**
4
+ * Main Entry point properties into portal package
5
+ *
6
+ *
7
+ */
8
+ interface PortalProps extends AuthProviderProps {
9
+ }
10
+ /**
11
+ * The main **e4Portal** entry point.
12
+ * * This is a React Functional Component that provides the core context
13
+ * and layout for the application. It is required to wrap all components
14
+ * that use the library's hooks or sub-components.
15
+ *
16
+ *
17
+ * @param props - The properties passed to the Portal component.
18
+ * @returns A React Element rendering the main application structure.
19
+ */
20
+ declare const Portal: {
21
+ ({ session, logout, children, }: PropsWithChildren<PortalProps>): import("react").JSX.Element;
22
+ /**
23
+ *
24
+ * # Feature: Table
25
+ * This is the table feature component.
26
+ * @params props
27
+ *
28
+ */
29
+ Table: ({ resources, viewConfigQuery }: import("./features/table/components/dashboard/table-dashboard").TableProps) => import("react").JSX.Element;
30
+ };
31
+ /**
32
+ *
33
+ * # Feature: Settings
34
+ * This is the table feature component.
35
+ * @params props
36
+ *
37
+ */
38
+ export { Portal, type PortalProps };