elseware-ui 2.23.2 → 2.25.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 (31) hide show
  1. package/build/components/data-display/data-view/com/DataViewContent.d.ts +7 -0
  2. package/build/components/data-display/data-view/com/DataViewFooter.d.ts +6 -0
  3. package/build/components/data-display/data-view/com/DataViewHeader.d.ts +6 -0
  4. package/build/components/data-display/data-view/com/DataViewSidebar.d.ts +6 -0
  5. package/build/components/data-display/data-view/controls/DataViewFilterGroup.d.ts +12 -0
  6. package/build/components/data-display/data-view/controls/DataViewPageSize.d.ts +7 -0
  7. package/build/components/data-display/data-view/controls/DataViewPagination.d.ts +6 -0
  8. package/build/components/data-display/data-view/controls/DataViewSearch.d.ts +7 -0
  9. package/build/components/data-display/data-view/controls/DataViewSort.d.ts +11 -0
  10. package/build/components/data-display/data-view/core/DataViewContext.d.ts +3 -0
  11. package/build/components/data-display/data-view/core/DataViewProvider.d.ts +10 -0
  12. package/build/components/data-display/data-view/core/types.d.ts +22 -0
  13. package/build/components/data-display/data-view/hooks/useDataView.d.ts +2 -0
  14. package/build/components/data-display/data-view/index.d.ts +21 -0
  15. package/build/components/data-display/data-view/utils/filterData.d.ts +1 -0
  16. package/build/components/data-display/data-view/utils/searchData.d.ts +1 -0
  17. package/build/components/data-display/data-view/utils/sortData.d.ts +2 -0
  18. package/build/components/data-display/index.d.ts +1 -1
  19. package/build/components/data-display/table/Table.d.ts +10 -8
  20. package/build/compositions/data-display/data-view-table/DataViewTable.d.ts +21 -0
  21. package/build/compositions/data-display/data-view-table/index.d.ts +2 -0
  22. package/build/compositions/data-display/index.d.ts +2 -0
  23. package/build/compositions/data-display/world-map-country-table/WorldMapCountryTable.d.ts +7 -0
  24. package/build/compositions/index.d.ts +1 -0
  25. package/build/index.d.ts +1 -1
  26. package/build/index.es.js +7045 -6877
  27. package/build/index.js +7023 -6855
  28. package/package.json +1 -1
  29. package/build/components/data-display/table/TableContent.d.ts +0 -18
  30. package/build/components/data-display/world-map-country-table/WorldMapCountryTable.d.ts +0 -8
  31. /package/build/{components → compositions}/data-display/world-map-country-table/index.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ import { JSX } from "react";
3
+ type DataViewContentProps<T = any> = {
4
+ children: ReactNode | ((data: T[]) => ReactNode);
5
+ };
6
+ declare function DataViewContent<T = any>({ children, }: DataViewContentProps<T>): JSX.Element;
7
+ export default DataViewContent;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ type DataViewFooterProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare function DataViewFooter({ children }: DataViewFooterProps): import("react/jsx-runtime").JSX.Element;
6
+ export default DataViewFooter;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ type DataViewHeaderProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare function DataViewHeader({ children }: DataViewHeaderProps): import("react/jsx-runtime").JSX.Element;
6
+ export default DataViewHeader;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ type DataViewSidebarProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare function DataViewSidebar({ children }: DataViewSidebarProps): import("react/jsx-runtime").JSX.Element;
6
+ export default DataViewSidebar;
@@ -0,0 +1,12 @@
1
+ type FilterOption = {
2
+ value: string;
3
+ label: string;
4
+ dotClass?: string;
5
+ };
6
+ type DataViewFilterGroupProps<T = any> = {
7
+ filterKey: keyof T;
8
+ options: FilterOption[];
9
+ title?: string;
10
+ };
11
+ declare function DataViewFilterGroup<T extends Record<string, any>>({ filterKey, options, title, }: DataViewFilterGroupProps<T>): import("react/jsx-runtime").JSX.Element;
12
+ export default DataViewFilterGroup;
@@ -0,0 +1,7 @@
1
+ import { Shape } from "../../../../types";
2
+ type Props = {
3
+ pageSizeOptions?: (number | "All")[];
4
+ shape?: Shape;
5
+ };
6
+ declare function DataViewPageSize({ pageSizeOptions, shape, }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export default DataViewPageSize;
@@ -0,0 +1,6 @@
1
+ import { Shape } from "../../../../types";
2
+ type Props = {
3
+ shape?: Shape;
4
+ };
5
+ declare function DataViewPagination({ shape }: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ export default DataViewPagination;
@@ -0,0 +1,7 @@
1
+ import { Shape } from "../../../../types";
2
+ type DataViewSearchProps = {
3
+ placeholder?: string;
4
+ shape?: Shape;
5
+ };
6
+ declare function DataViewSearch({ placeholder, shape, }: DataViewSearchProps): import("react/jsx-runtime").JSX.Element;
7
+ export default DataViewSearch;
@@ -0,0 +1,11 @@
1
+ import { Shape } from "../../../../types";
2
+ type SortOption = {
3
+ value: string;
4
+ label: string;
5
+ };
6
+ type DataViewSortProps = {
7
+ options: SortOption[];
8
+ shape?: Shape;
9
+ };
10
+ declare function DataViewSort({ options, shape }: DataViewSortProps): import("react/jsx-runtime").JSX.Element;
11
+ export default DataViewSort;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { DataViewContextType } from "./types";
3
+ export declare const DataViewContext: import("react").Context<DataViewContextType<any> | null>;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ import { SortConfig } from "./types";
3
+ interface Props<T> {
4
+ data: T[];
5
+ children: ReactNode;
6
+ defaultPageSize?: number;
7
+ sortConfig?: Record<string, SortConfig<T>>;
8
+ }
9
+ declare function DataViewProvider<T extends Record<string, any>>({ data, children, defaultPageSize, sortConfig, }: Props<T>): import("react/jsx-runtime").JSX.Element;
10
+ export default DataViewProvider;
@@ -0,0 +1,22 @@
1
+ import { Dispatch, SetStateAction } from "react";
2
+ export type SortDirection = "asc" | "desc";
3
+ export type SortConfig<T, K extends keyof T = keyof T> = {
4
+ key: K;
5
+ direction?: "asc" | "desc";
6
+ transform?: (value: T[K]) => number | string;
7
+ };
8
+ export interface DataViewContextType<T = any> {
9
+ rawData: T[];
10
+ data: T[];
11
+ search: string;
12
+ setSearch: (v: string) => void;
13
+ filters: Record<string, any>;
14
+ setFilters: Dispatch<SetStateAction<Record<string, any>>>;
15
+ sort: string;
16
+ setSort: (v: string) => void;
17
+ page: number;
18
+ setPage: (v: number) => void;
19
+ pageSize: number | "All";
20
+ setPageSize: (v: number | "All") => void;
21
+ totalPages: number;
22
+ }
@@ -0,0 +1,2 @@
1
+ import { DataViewContextType } from "../core/types";
2
+ export declare function useDataView<T = any>(): DataViewContextType<T>;
@@ -0,0 +1,21 @@
1
+ import DataViewProvider from "./core/DataViewProvider";
2
+ import DataViewHeader from "./com/DataViewHeader";
3
+ import DataViewSidebar from "./com/DataViewSidebar";
4
+ import DataViewContent from "./com/DataViewContent";
5
+ import DataViewFooter from "./com/DataViewFooter";
6
+ import DataViewSearch from "./controls/DataViewSearch";
7
+ import DataViewSort from "./controls/DataViewSort";
8
+ import DataViewFilterGroup from "./controls/DataViewFilterGroup";
9
+ import DataViewPageSize from "./controls/DataViewPageSize";
10
+ import DataViewPagination from "./controls/DataViewPagination";
11
+ export declare const DataView: typeof DataViewProvider & {
12
+ Header: typeof DataViewHeader;
13
+ Sidebar: typeof DataViewSidebar;
14
+ Content: typeof DataViewContent;
15
+ Footer: typeof DataViewFooter;
16
+ Pagination: typeof DataViewPagination;
17
+ Search: typeof DataViewSearch;
18
+ Sort: typeof DataViewSort;
19
+ FilterGroup: typeof DataViewFilterGroup;
20
+ PageSize: typeof DataViewPageSize;
21
+ };
@@ -0,0 +1 @@
1
+ export declare function filterData<T extends Record<string, any>>(data: T[], filters: Record<string, any>): T[];
@@ -0,0 +1 @@
1
+ export declare function searchData<T extends Record<string, any>>(data: T[], search: string): T[];
@@ -0,0 +1,2 @@
1
+ import { SortConfig } from "../core/types";
2
+ export declare function sortData<T>(data: T[], sort: string, sortConfig: Record<string, SortConfig<T>>): T[];
@@ -4,6 +4,7 @@ export * from "./banners";
4
4
  export * from "./brand";
5
5
  export * from "./charts";
6
6
  export * from "./chip";
7
+ export * from "./data-view";
7
8
  export * from "./flag";
8
9
  export * from "./graphs";
9
10
  export * from "./image";
@@ -20,4 +21,3 @@ export * from "./typography";
20
21
  export * from "./value-badge";
21
22
  export * from "./video";
22
23
  export * from "./world-map";
23
- export * from "./world-map-country-table";
@@ -1,14 +1,16 @@
1
- import { TableColumnConfig } from "./TableContent";
1
+ import { ReactNode } from "react";
2
+ import { Shape } from "../../../types";
3
+ export interface TableColumnConfig<T> {
4
+ key: keyof T | string;
5
+ header: string;
6
+ sortable?: boolean;
7
+ render?: (value: any, row: T) => ReactNode;
8
+ }
2
9
  export interface TableProps<T> {
3
10
  title?: string;
4
11
  columns: TableColumnConfig<T>[];
5
12
  data: T[];
6
- defaultPageSize?: number;
7
- pageSizeOptions?: (number | "All")[];
8
- isLoading?: boolean;
9
- isSuccess?: boolean;
10
- isError?: boolean;
11
- error?: unknown;
13
+ shape?: Shape;
12
14
  }
13
- declare function Table<T extends Record<string, any>>({ title, columns, data, defaultPageSize, pageSizeOptions, isLoading, isSuccess, isError, error, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
15
+ declare function Table<T extends Record<string, any>>({ title, columns, data, shape, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
14
16
  export default Table;
@@ -0,0 +1,21 @@
1
+ import { TableColumnConfig } from "../../../components/data-display/table/Table";
2
+ import { SortConfig } from "../../../components/data-display/data-view/core/types";
3
+ type SortOption = {
4
+ value: string;
5
+ label: string;
6
+ };
7
+ export interface DataViewTableProps<T> {
8
+ title?: string;
9
+ columns: TableColumnConfig<T>[];
10
+ data: T[];
11
+ sortOptions?: SortOption[];
12
+ sortConfig?: Record<string, SortConfig<T>>;
13
+ searchPlaceholder?: string;
14
+ defaultPageSize?: number;
15
+ isLoading?: boolean;
16
+ isSuccess?: boolean;
17
+ isError?: boolean;
18
+ error?: unknown;
19
+ }
20
+ declare function DataViewTable<T extends Record<string, any>>({ title, columns, data, sortOptions, sortConfig, searchPlaceholder, defaultPageSize, isLoading, isSuccess, isError, error, }: DataViewTableProps<T>): import("react/jsx-runtime").JSX.Element;
21
+ export default DataViewTable;
@@ -0,0 +1,2 @@
1
+ import DataViewTable from "./DataViewTable";
2
+ export { DataViewTable };
@@ -0,0 +1,2 @@
1
+ export * from "./data-view-table";
2
+ export * from "./world-map-country-table";
@@ -0,0 +1,7 @@
1
+ import { WorldMapPoint } from "../../../components/data-display/world-map/WorldMap";
2
+ interface WorldMapCountryTableProps {
3
+ title?: string;
4
+ data: WorldMapPoint[];
5
+ }
6
+ export default function WorldMapCountryTable({ title, data, }: WorldMapCountryTableProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -1 +1,2 @@
1
+ export * from "./data-display";
1
2
  export * from "./navigation";
package/build/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./styles/gradients.css";
2
2
  import "./styles/index.css";
3
3
  export * from "./components";
4
- export * from "./compositions";
4
+ export * from "./compositions/data-display";
5
5
  export * from "./hooks";
6
6
  export * from "./layouts";
7
7
  export * from "./utils";