@erxes/ui 3.2.25-5 → 3.2.25-next.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.
- package/dist/modules/record-table/components/RecordTableProvider.d.ts +1 -2
- package/dist/modules/record-table/index.d.ts +71 -0
- package/dist/types/UIConfig.d.ts +10 -0
- package/package.json +1 -1
- package/src/modules/layout/components/AppLayout.tsx +17 -12
- package/src/modules/record-table/components/RecordTableProvider.tsx +1 -1
- package/src/types/UIConfig.ts +10 -0
|
@@ -2,7 +2,7 @@ import { HTMLAttributes, type ReactNode } from 'react';
|
|
|
2
2
|
import { ColumnDef, type TableOptions } from '@tanstack/react-table';
|
|
3
3
|
import { IRecordTableContext } from 'erxes-ui/modules/record-table/types/recordTableTypes';
|
|
4
4
|
export declare function useRecordTable(): IRecordTableContext;
|
|
5
|
-
interface RecordTableProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
export interface RecordTableProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
columns: ColumnDef<any>[];
|
|
8
8
|
data: any[];
|
|
@@ -11,4 +11,3 @@ interface RecordTableProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
tableId?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const RecordTableProvider: import("react").ForwardRefExoticComponent<RecordTableProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
-
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useRecordTable } from './components/RecordTableProvider';
|
|
2
|
+
import { RecordTableRow } from './components/RecordTableRow';
|
|
3
|
+
export declare const RecordTable: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableElement> & import("react").RefAttributes<HTMLTableElement>> & {
|
|
4
|
+
Provider: import("react").ForwardRefExoticComponent<import("./components/RecordTableProvider").RecordTableProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Header: ({ showColumnSelector, }: {
|
|
6
|
+
showColumnSelector?: boolean;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Head: ({ header, children, className, ...props }: React.ComponentProps<"th"> & {
|
|
9
|
+
header: import("@tanstack/table-core").Header<any, unknown>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
InlineHead: (props: {
|
|
12
|
+
icon?: import("@tabler/icons-react").Icon;
|
|
13
|
+
label: string;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
RowList: ({ handleRowViewChange, Row, }: {
|
|
16
|
+
handleRowViewChange?: (id: string, inView: boolean) => void;
|
|
17
|
+
Row?: React.ComponentType<React.ComponentProps<typeof RecordTableRow>>;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element[];
|
|
19
|
+
Body: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableSectionElement> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
20
|
+
Cell: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableCellElement> & {
|
|
21
|
+
cell: import("@tanstack/table-core").Cell<any, unknown>;
|
|
22
|
+
} & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
23
|
+
useRecordTable: typeof useRecordTable;
|
|
24
|
+
RowSkeleton: ({ rows, handleInView, backward, root, }: {
|
|
25
|
+
rows?: number;
|
|
26
|
+
handleInView?: () => void;
|
|
27
|
+
backward?: boolean;
|
|
28
|
+
root?: Element | null;
|
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
MoreButton: import("react").ForwardRefExoticComponent<import("erxes-ui/components").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
checkboxColumn: import("@tanstack/table-core").ColumnDef<any>;
|
|
32
|
+
Scroll: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-scroll-area").ScrollAreaProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
33
|
+
scrollBarClassName?: string;
|
|
34
|
+
viewportClassName?: string;
|
|
35
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
CursorProvider: ({ children, hasPreviousPage, loading, dataLength, hasNextPage, sessionKey, offset, }: {
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
hasPreviousPage?: boolean;
|
|
39
|
+
hasNextPage?: boolean;
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
dataLength?: number;
|
|
42
|
+
sessionKey?: string;
|
|
43
|
+
offset?: number;
|
|
44
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
CursorBackwardSkeleton: ({ handleFetchMore, }: {
|
|
46
|
+
handleFetchMore: (params: {
|
|
47
|
+
direction: import(".").EnumCursorDirection;
|
|
48
|
+
}) => void;
|
|
49
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
CursorForwardSkeleton: ({ handleFetchMore, }: {
|
|
51
|
+
handleFetchMore: (params: {
|
|
52
|
+
direction: import(".").EnumCursorDirection;
|
|
53
|
+
}) => void;
|
|
54
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
Row: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableRowElement> & {
|
|
56
|
+
handleRowViewChange?: (inView: boolean) => void;
|
|
57
|
+
original?: import("@tanstack/table-core").Row<any>["original"];
|
|
58
|
+
} & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
59
|
+
ColumnSelector: ({ children, align, }: {
|
|
60
|
+
children?: React.ReactElement;
|
|
61
|
+
align?: "start" | "center" | "end";
|
|
62
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
};
|
|
64
|
+
export * from './types/RecordTableCursorTypes';
|
|
65
|
+
export * from './hooks/useRecordTableCursor';
|
|
66
|
+
export * from './utils/cursorUtils';
|
|
67
|
+
export * from './components/RecordTableCellInline';
|
|
68
|
+
export * from './components/RecordTableTree';
|
|
69
|
+
export * from './contexts/RecordTableHotkeyContext';
|
|
70
|
+
export * from './components/RecordTableHotkeyCell';
|
|
71
|
+
export * from './states/RecordTableCursorState';
|
package/dist/types/UIConfig.d.ts
CHANGED
|
@@ -112,6 +112,16 @@ export type IUIConfig = {
|
|
|
112
112
|
name: string;
|
|
113
113
|
defaultPath?: string;
|
|
114
114
|
icon: React.ElementType;
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated Ignored by core-ui since 3.2.25: a plugin draws its own
|
|
117
|
+
* sidebar by wrapping its routed entry in `AppLayout`. Kept so existing
|
|
118
|
+
* configs still type-check; it will be removed in a later minor release.
|
|
119
|
+
*/
|
|
120
|
+
content?: () => React.ReactNode;
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated Ignored by core-ui since 3.2.25; see `content`.
|
|
123
|
+
*/
|
|
124
|
+
subGroup?: () => React.ReactNode;
|
|
115
125
|
};
|
|
116
126
|
widgets?: {
|
|
117
127
|
relationWidgets?: {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
IconLayoutSidebarLeftExpand,
|
|
6
6
|
IconMenu2,
|
|
7
7
|
} from '@tabler/icons-react';
|
|
8
|
-
import {
|
|
8
|
+
import { useAtom } from 'jotai';
|
|
9
9
|
|
|
10
10
|
import { Button } from 'erxes-ui/components/button';
|
|
11
11
|
import { Separator } from 'erxes-ui/components/separator';
|
|
@@ -19,9 +19,21 @@ const APP_LAYOUT_MIN_WIDTH = 180;
|
|
|
19
19
|
const APP_LAYOUT_MAX_WIDTH = 480;
|
|
20
20
|
const APP_LAYOUT_KEYBOARD_STEP = 16;
|
|
21
21
|
|
|
22
|
+
const createOpenAtom = (id: string) =>
|
|
23
|
+
atomWithStorage<boolean>(`app-layout:${id}:open`, true, undefined, {
|
|
24
|
+
getOnInit: true,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const createWidthAtom = (id: string) =>
|
|
28
|
+
atomWithStorage<number | null>(`app-layout:${id}:width`, null, undefined, {
|
|
29
|
+
getOnInit: true,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Derived from the factories so the type matches under every tsconfig
|
|
33
|
+
// (the declaration build is non-strict, which widens atomWithStorage).
|
|
22
34
|
type TAppLayoutAtoms = {
|
|
23
|
-
open:
|
|
24
|
-
width:
|
|
35
|
+
open: ReturnType<typeof createOpenAtom>;
|
|
36
|
+
width: ReturnType<typeof createWidthAtom>;
|
|
25
37
|
};
|
|
26
38
|
|
|
27
39
|
const appLayoutAtoms = new Map<string, TAppLayoutAtoms>();
|
|
@@ -34,15 +46,8 @@ const getAppLayoutAtoms = (id: string) => {
|
|
|
34
46
|
}
|
|
35
47
|
|
|
36
48
|
const atoms: TAppLayoutAtoms = {
|
|
37
|
-
open:
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
width: atomWithStorage<number | null>(
|
|
41
|
-
`app-layout:${id}:width`,
|
|
42
|
-
null,
|
|
43
|
-
undefined,
|
|
44
|
-
{ getOnInit: true },
|
|
45
|
-
),
|
|
49
|
+
open: createOpenAtom(id),
|
|
50
|
+
width: createWidthAtom(id),
|
|
46
51
|
};
|
|
47
52
|
|
|
48
53
|
appLayoutAtoms.set(id, atoms);
|
|
@@ -42,7 +42,7 @@ export function useRecordTable() {
|
|
|
42
42
|
return context;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
interface RecordTableProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
45
|
+
export interface RecordTableProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
46
46
|
children: ReactNode;
|
|
47
47
|
columns: ColumnDef<any>[];
|
|
48
48
|
data: any[];
|
package/src/types/UIConfig.ts
CHANGED
|
@@ -137,6 +137,16 @@ export type IUIConfig = {
|
|
|
137
137
|
name: string;
|
|
138
138
|
defaultPath?: string;
|
|
139
139
|
icon: React.ElementType;
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated Ignored by core-ui since 3.2.25: a plugin draws its own
|
|
142
|
+
* sidebar by wrapping its routed entry in `AppLayout`. Kept so existing
|
|
143
|
+
* configs still type-check; it will be removed in a later minor release.
|
|
144
|
+
*/
|
|
145
|
+
content?: () => React.ReactNode;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Ignored by core-ui since 3.2.25; see `content`.
|
|
148
|
+
*/
|
|
149
|
+
subGroup?: () => React.ReactNode;
|
|
140
150
|
};
|
|
141
151
|
|
|
142
152
|
widgets?: {
|