@bcrumbs.net/bc-ui 0.0.2 → 0.0.4
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/index.esm.js +313 -1146
- package/package.json +3 -2
- package/src/index.d.ts +2 -0
- package/src/lib/avatar/index.d.ts +3 -1
- package/src/lib/hooks/useDebounce/index.d.ts +1 -1
- package/src/lib/hooks/usePolling/index.d.ts +2 -0
- package/src/lib/hooks/useToggle/index.d.ts +1 -0
- package/src/lib/lazyScrollbar/index.d.ts +10 -0
- package/src/lib/searchbox/bcsearchbox.d.ts +2 -1
- package/src/lib/table/bctable.d.ts +16 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcrumbs.net/bc-ui",
|
|
3
3
|
"description": "The UI components of Bread Crumbs portals",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"keyword": [
|
|
6
6
|
"bcrumbs",
|
|
7
7
|
"bc-ui"
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"react-custom-scrollbars": "^4.2.1",
|
|
21
21
|
"react-toastify": "^8.2.0",
|
|
22
22
|
"@tippyjs/react": "^4.1.0",
|
|
23
|
-
"recharts": "2.1.12"
|
|
23
|
+
"recharts": "2.1.12",
|
|
24
|
+
"date-fns": "^2.28.0"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@types/react-date-range": "^1.4.9"
|
package/src/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './lib/iconButton';
|
|
|
13
13
|
export * from './lib/overlay';
|
|
14
14
|
export * from './lib/popup';
|
|
15
15
|
export * from './lib/scrollArea';
|
|
16
|
+
export * from './lib/lazyScrollbar';
|
|
16
17
|
export * from './lib/addButton/bcadd-button';
|
|
17
18
|
export * from './lib/progress';
|
|
18
19
|
export * from './lib/dropZone';
|
|
@@ -46,4 +47,5 @@ export * from './lib/hooks/usePolling';
|
|
|
46
47
|
export * from './lib/hooks/useDebounce';
|
|
47
48
|
export * from './lib/hooks/useWindowSize';
|
|
48
49
|
export * from './lib/hooks/useInterval';
|
|
50
|
+
export * from './lib/hooks/useToggle';
|
|
49
51
|
export * from './lib/constants';
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* @param delay - The debounce delay in milliseconds.
|
|
7
7
|
* @returns A function to update the debounced value.
|
|
8
8
|
*/
|
|
9
|
-
export declare function useDebounce<T>(callback: (value: T) => void, delay: number): import("react").Dispatch<import("react").SetStateAction<T>>;
|
|
9
|
+
export declare function useDebounce<T>(callback: (value: T) => void, delay: number): import("react").Dispatch<import("react").SetStateAction<T | undefined>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useToggle(initial?: boolean, reducer?: (state: boolean) => boolean): readonly [boolean, () => void];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Scrollbars } from 'react-custom-scrollbars';
|
|
3
|
+
export type LazyLoadBCScrollbarProps = {
|
|
4
|
+
loadMoreItems: () => void;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
hasMore?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
rtl?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const BCLazyLoadScrollbar: React.ForwardRefExoticComponent<LazyLoadBCScrollbarProps & React.RefAttributes<Scrollbars>>;
|
|
@@ -6,6 +6,7 @@ export interface BCSearchboxProps {
|
|
|
6
6
|
name?: string;
|
|
7
7
|
icon?: string | ReactElement;
|
|
8
8
|
placeholder?: string;
|
|
9
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
9
10
|
}
|
|
10
|
-
export declare const BCSearchbox: ({ className, onChange, value, name, placeholder, icon, }: BCSearchboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const BCSearchbox: ({ className, onChange, value, name, placeholder, icon, onKeyDown, }: BCSearchboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
12
|
export default BCSearchbox;
|
|
@@ -35,17 +35,28 @@ export type Row = {
|
|
|
35
35
|
} & {
|
|
36
36
|
id: any;
|
|
37
37
|
};
|
|
38
|
-
export type
|
|
38
|
+
export type SharedBCTableProps = {
|
|
39
|
+
textboxChanged?: (row: Row) => void;
|
|
40
|
+
actionClicked?: (key: string, row: Row, index: number) => void;
|
|
41
|
+
dropListChanged?: (row: Row, choosedKey?: string) => void;
|
|
42
|
+
};
|
|
43
|
+
export type BCCellProps = SharedBCTableProps & {
|
|
44
|
+
column: Column;
|
|
45
|
+
row: Row;
|
|
46
|
+
index: number;
|
|
47
|
+
forceUpdate: () => void;
|
|
48
|
+
actionClicked?: (key: string, row: Row, index: number) => void;
|
|
49
|
+
};
|
|
50
|
+
export type BCTableProps = SharedBCTableProps & {
|
|
39
51
|
className?: string;
|
|
40
52
|
rows: Row[];
|
|
41
53
|
columns: Column[];
|
|
42
|
-
dropListChanged?: (row: Row, choosedKey?: string) => void;
|
|
43
|
-
textboxChanged?: (row: Row) => void;
|
|
44
|
-
actionClicked?: (key: string, row: Row, index: number) => void;
|
|
45
54
|
builtInSearch?: boolean;
|
|
46
55
|
searchPattern?: string;
|
|
47
56
|
noItemsMessage?: string;
|
|
48
57
|
rtl?: boolean;
|
|
58
|
+
loading?: boolean;
|
|
49
59
|
};
|
|
50
|
-
export declare const
|
|
60
|
+
export declare const BCCell: ({ column, row, index, forceUpdate, textboxChanged, dropListChanged, actionClicked }: BCCellProps) => JSX.Element | null;
|
|
61
|
+
export declare const BCTable: ({ className, rows: inputRows, columns, dropListChanged, textboxChanged, actionClicked, builtInSearch, searchPattern, noItemsMessage, rtl, loading, }: BCTableProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
62
|
export default BCTable;
|