@bcgov-sso/common-react-components 1.30.3 → 1.31.1

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,3 +1,4 @@
1
+ import React from 'react';
1
2
  export declare const TABLE_BACKGROUND_COLOR = "#ededed";
2
3
  export declare const TABLE_ROW_ACTIVE_COLOR = "#4950FA";
3
4
  export declare const TABLE_ROW_HOVER_COLOR = "#fdb913";
@@ -5,8 +6,35 @@ export declare const TABLE_ROW_HEIGHT = 40;
5
6
  export declare const TABLE_ROW_HEIGHT_MINI = 40;
6
7
  export declare const TABLE_ROW_SPACING = 5;
7
8
  export declare const TABLE_ROW_BORDER_RADIUS = 6;
8
- declare const Table: import("styled-components").StyledComponent<"table", any, {
9
- variant?: string | undefined;
10
- readOnly?: boolean | undefined;
11
- }, never>;
9
+ export interface Option {
10
+ value: string | string[];
11
+ label: string;
12
+ }
13
+ export interface TableFilter {
14
+ key?: string;
15
+ value?: string | Option[];
16
+ multiselect?: boolean;
17
+ onChange?: Function;
18
+ options: Option[];
19
+ label?: string;
20
+ }
21
+ export interface Column {
22
+ header: string;
23
+ accessorKey: string;
24
+ }
25
+ export interface TableProps {
26
+ variant?: string;
27
+ readOnly?: boolean;
28
+ columns: Column[];
29
+ data: unknown[];
30
+ onRowSelect?: Function;
31
+ defaultPageSize?: number;
32
+ enableGlobalSearch?: boolean;
33
+ globalSearchPlaceholder?: string;
34
+ globalSearchStyle?: React.CSSProperties;
35
+ enablePagination?: boolean;
36
+ pageSizeOptions?: number[];
37
+ noDataFoundText?: string;
38
+ }
39
+ declare const Table: ({ variant, columns, data, readOnly, onRowSelect, defaultPageSize, enableGlobalSearch, globalSearchPlaceholder, globalSearchStyle, enablePagination, pageSizeOptions, noDataFoundText, }: TableProps) => JSX.Element;
12
40
  export default Table;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import * as _button_inc_component_library_Button from '@button-inc/component-library/Button';
3
+ import React from 'react';
3
4
  import * as styled_components from 'styled-components';
4
5
  import * as rc_tabs_lib_Tabs from 'rc-tabs/lib/Tabs';
5
6
  import { TabPane } from 'rc-tabs';
6
- import React from 'react';
7
7
 
8
8
  declare function AccordionPanel({ title, hash, allOpen, setAllOpen, children }: any): JSX.Element;
9
9
  interface Props$6 {
@@ -37,10 +37,25 @@ interface Props$4 {
37
37
  }
38
38
  declare const Alert: (props: Props$4) => JSX.Element;
39
39
 
40
- declare const Table: styled_components.StyledComponent<"table", any, {
41
- variant?: string | undefined;
42
- readOnly?: boolean | undefined;
43
- }, never>;
40
+ interface Column {
41
+ header: string;
42
+ accessorKey: string;
43
+ }
44
+ interface TableProps {
45
+ variant?: string;
46
+ readOnly?: boolean;
47
+ columns: Column[];
48
+ data: unknown[];
49
+ onRowSelect?: Function;
50
+ defaultPageSize?: number;
51
+ enableGlobalSearch?: boolean;
52
+ globalSearchPlaceholder?: string;
53
+ globalSearchStyle?: React.CSSProperties;
54
+ enablePagination?: boolean;
55
+ pageSizeOptions?: number[];
56
+ noDataFoundText?: string;
57
+ }
58
+ declare const Table: ({ variant, columns, data, readOnly, onRowSelect, defaultPageSize, enableGlobalSearch, globalSearchPlaceholder, globalSearchStyle, enablePagination, pageSizeOptions, noDataFoundText, }: TableProps) => JSX.Element;
44
59
 
45
60
  declare const StyledTabs: styled_components.StyledComponent<rc_tabs_lib_Tabs.ForwardTabsType, any, {}, never>;
46
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcgov-sso/common-react-components",
3
- "version": "1.30.3",
3
+ "version": "1.31.1",
4
4
  "description": "common react components",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -25,6 +25,7 @@
25
25
  "@fortawesome/fontawesome-svg-core": "^6.1.1",
26
26
  "@fortawesome/free-solid-svg-icons": "^6.1.1",
27
27
  "@fortawesome/react-fontawesome": "^0.1.18",
28
+ "@tanstack/react-table": "^8.20.1",
28
29
  "@types/lodash.kebabcase": "^4.1.7",
29
30
  "@types/styled-components": "^5.1.25",
30
31
  "history": "^5.3.0",
@@ -33,6 +34,7 @@
33
34
  "pre-commit": "^1.2.2",
34
35
  "rc-tabs": "^11.16.0",
35
36
  "react-loader-spinner": "^6.0.0-0",
37
+ "react-select": "^5.8.0",
36
38
  "styled-components": "^5.3.5"
37
39
  },
38
40
  "peerDependencies": {
@@ -73,6 +75,7 @@
73
75
  "@vanilla-extract/vite-plugin": "^3.8.0",
74
76
  "@vitejs/plugin-react": "^3.1.0",
75
77
  "babel-preset-react": "^6.24.1",
78
+ "loader-utils": "^2.0.4",
76
79
  "prettier": "^2.7.1",
77
80
  "react": "18.2.0",
78
81
  "react-dom": "18.2.0",
@@ -81,7 +84,6 @@
81
84
  "storybook-addon-designs": "^6.3.1",
82
85
  "typescript": "^4.7.4",
83
86
  "vite": "^4.2.1",
84
- "vite-tsconfig-paths": "^4.0.7",
85
- "loader-utils": "^2.0.4"
87
+ "vite-tsconfig-paths": "^4.0.7"
86
88
  }
87
89
  }