@erxes/ui 3.2.25-5 → 3.2.25-next.2
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/navigation-menu/components/NavigationMenu.d.ts +5 -0
- 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 +16 -2
- package/package.json +1 -1
- package/src/modules/layout/components/AppLayout.tsx +17 -12
- package/src/modules/navigation-menu/components/NavigationMenu.tsx +5 -0
- package/src/modules/record-table/components/RecordTableProvider.tsx +1 -1
- package/src/types/UIConfig.ts +16 -2
|
@@ -16,6 +16,11 @@ export declare const NavigationMenuLinkItem: import("react").ForwardRefExoticCom
|
|
|
16
16
|
action?: React.ReactNode;
|
|
17
17
|
itemClassName?: string;
|
|
18
18
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Links to `/settings/<pathPrefix>/…`, which now only redirects:
|
|
21
|
+
* plugin settings live in the plugin's own app. Use `NavigationMenuLinkItem`
|
|
22
|
+
* with `pathPrefix="<plugin>/settings"`.
|
|
23
|
+
*/
|
|
19
24
|
export declare const SettingsNavigationMenuLinkItem: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
20
25
|
asChild?: boolean;
|
|
21
26
|
isActive?: boolean;
|
|
@@ -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
|
@@ -106,12 +106,26 @@ export type IUIConfig = {
|
|
|
106
106
|
i18n?: boolean;
|
|
107
107
|
i18nNamespace?: string;
|
|
108
108
|
hasFloatingWidget?: boolean;
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
/**
|
|
110
|
+
* erxes platform versions this plugin is built for, as a semver range
|
|
111
|
+
* (e.g. `'~3.2'`, `'>=3.2.25 <3.4'`). Core warns — and still loads the
|
|
112
|
+
* plugin — when the running platform is outside the range.
|
|
113
|
+
*/
|
|
114
|
+
platform?: string;
|
|
111
115
|
navigationGroup?: {
|
|
112
116
|
name: string;
|
|
113
117
|
defaultPath?: string;
|
|
114
118
|
icon: React.ElementType;
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated Ignored by core-ui since 3.2.25: a plugin draws its own
|
|
121
|
+
* sidebar by wrapping its routed entry in `AppLayout`. Kept so existing
|
|
122
|
+
* configs still type-check; it will be removed in a later minor release.
|
|
123
|
+
*/
|
|
124
|
+
content?: () => React.ReactNode;
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated Ignored by core-ui since 3.2.25; see `content`.
|
|
127
|
+
*/
|
|
128
|
+
subGroup?: () => React.ReactNode;
|
|
115
129
|
};
|
|
116
130
|
widgets?: {
|
|
117
131
|
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);
|
|
@@ -83,6 +83,11 @@ export const NavigationMenuLinkItem = forwardRef<
|
|
|
83
83
|
|
|
84
84
|
NavigationMenuLinkItem.displayName = 'NavigationMenuLinkItem';
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Links to `/settings/<pathPrefix>/…`, which now only redirects:
|
|
88
|
+
* plugin settings live in the plugin's own app. Use `NavigationMenuLinkItem`
|
|
89
|
+
* with `pathPrefix="<plugin>/settings"`.
|
|
90
|
+
*/
|
|
86
91
|
export const SettingsNavigationMenuLinkItem = forwardRef<
|
|
87
92
|
React.ElementRef<typeof Sidebar.MenuButton>,
|
|
88
93
|
React.ComponentProps<typeof NavigationMenuLinkItem>
|
|
@@ -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
|
@@ -131,12 +131,26 @@ export type IUIConfig = {
|
|
|
131
131
|
i18n?: boolean;
|
|
132
132
|
i18nNamespace?: string;
|
|
133
133
|
hasFloatingWidget?: boolean;
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
/**
|
|
135
|
+
* erxes platform versions this plugin is built for, as a semver range
|
|
136
|
+
* (e.g. `'~3.2'`, `'>=3.2.25 <3.4'`). Core warns — and still loads the
|
|
137
|
+
* plugin — when the running platform is outside the range.
|
|
138
|
+
*/
|
|
139
|
+
platform?: string;
|
|
136
140
|
navigationGroup?: {
|
|
137
141
|
name: string;
|
|
138
142
|
defaultPath?: string;
|
|
139
143
|
icon: React.ElementType;
|
|
144
|
+
/**
|
|
145
|
+
* @deprecated Ignored by core-ui since 3.2.25: a plugin draws its own
|
|
146
|
+
* sidebar by wrapping its routed entry in `AppLayout`. Kept so existing
|
|
147
|
+
* configs still type-check; it will be removed in a later minor release.
|
|
148
|
+
*/
|
|
149
|
+
content?: () => React.ReactNode;
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated Ignored by core-ui since 3.2.25; see `content`.
|
|
152
|
+
*/
|
|
153
|
+
subGroup?: () => React.ReactNode;
|
|
140
154
|
};
|
|
141
155
|
|
|
142
156
|
widgets?: {
|