proje-react-panel 1.4.0 → 1.5.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.
- package/.vscode/launch.json +9 -0
- package/dist/components/list/CellField.d.ts +2 -2
- package/dist/components/list/cells/LinkCell.d.ts +8 -0
- package/dist/decorators/details/Details.d.ts +1 -1
- package/dist/decorators/list/Cell.d.ts +1 -1
- package/dist/decorators/list/List.d.ts +5 -1
- package/dist/decorators/list/cells/LinkCell.d.ts +13 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +1 -1
- package/dist/services/DataService.d.ts +1 -0
- package/dist/store/store.d.ts +2 -0
- package/package.json +1 -1
- package/src/assets/icons/svg/down-arrow-backup-2.svg +3 -0
- package/src/components/DetailsPage.tsx +5 -1
- package/src/components/list/CellField.tsx +8 -2
- package/src/components/list/Datagrid.tsx +62 -41
- package/src/components/list/ListPage.tsx +3 -0
- package/src/components/list/cells/ImageCell.tsx +1 -0
- package/src/components/list/cells/LinkCell.tsx +30 -0
- package/src/decorators/details/Details.ts +1 -1
- package/src/decorators/list/Cell.ts +1 -1
- package/src/decorators/list/List.ts +8 -2
- package/src/decorators/list/cells/LinkCell.ts +22 -0
- package/src/index.ts +3 -1
- package/src/services/DataService.ts +25 -5
- package/src/store/store.ts +7 -0
- package/src/styles/list.scss +56 -0
package/.vscode/launch.json
CHANGED
@@ -22,6 +22,15 @@
|
|
22
22
|
"cwd": "${workspaceFolder}/examples",
|
23
23
|
"console": "integratedTerminal",
|
24
24
|
"internalConsoleOptions": "neverOpen"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"type": "node",
|
28
|
+
"request": "launch",
|
29
|
+
"name": "Start Server",
|
30
|
+
"runtimeExecutable": "yarn",
|
31
|
+
"runtimeArgs": ["start"],
|
32
|
+
"cwd": "/Users/hasbisefademir/WebstormProjects/proje/nestjs-react-panel-server",
|
33
|
+
"console": "integratedTerminal"
|
25
34
|
}
|
26
35
|
]
|
27
36
|
}
|
@@ -3,7 +3,7 @@ import { AnyClass } from '../../types/AnyClass';
|
|
3
3
|
import { CellConfiguration } from '../../decorators/list/Cell';
|
4
4
|
interface CellFieldProps<T extends AnyClass> {
|
5
5
|
configuration: CellConfiguration;
|
6
|
-
|
6
|
+
item: T;
|
7
7
|
}
|
8
|
-
export declare function CellField<T extends AnyClass>({ configuration,
|
8
|
+
export declare function CellField<T extends AnyClass>({ configuration, item, }: CellFieldProps<T>): React.ReactElement;
|
9
9
|
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CellConfiguration } from '../../../decorators/list/Cell';
|
3
|
+
interface LinkCellProps<T> {
|
4
|
+
item: T;
|
5
|
+
configuration: CellConfiguration;
|
6
|
+
}
|
7
|
+
export declare function LinkCell<T>({ item, configuration }: LinkCellProps<T>): React.JSX.Element;
|
8
|
+
export {};
|
@@ -4,7 +4,7 @@ export type GetDetailsDataFN<T> = (param: Record<string, string>) => Promise<T>;
|
|
4
4
|
interface DetailsOptions<T extends AnyClass> {
|
5
5
|
getDetailsData: GetDetailsDataFN<T>;
|
6
6
|
key?: string;
|
7
|
-
primaryId
|
7
|
+
primaryId?: keyof T;
|
8
8
|
}
|
9
9
|
export type DetailsConfiguration<T extends AnyClass> = DetailsOptions<T> & {
|
10
10
|
key: string;
|
@@ -13,7 +13,7 @@ export interface StaticSelectFilter extends Filter {
|
|
13
13
|
}[];
|
14
14
|
}
|
15
15
|
export type CellTypes = 'string' | 'date' | 'number' | 'boolean' | 'uuid';
|
16
|
-
export type ExtendedCellTypes = CellTypes | 'image' | 'download';
|
16
|
+
export type ExtendedCellTypes = CellTypes | 'image' | 'download' | 'link';
|
17
17
|
export interface CellOptions {
|
18
18
|
name?: string;
|
19
19
|
title?: string;
|
@@ -37,7 +37,11 @@ export interface ListOptions<T> {
|
|
37
37
|
getData: GetDataForList<T>;
|
38
38
|
headers?: ListHeaderOptions;
|
39
39
|
cells?: ((item: T) => ListCellOptions<T>) | ListCellOptions<T>;
|
40
|
+
primaryId?: string;
|
41
|
+
key?: string;
|
40
42
|
}
|
41
|
-
export type ListConfiguration<T> = ListOptions<T
|
43
|
+
export type ListConfiguration<T> = ListOptions<T> & {
|
44
|
+
key: string;
|
45
|
+
};
|
42
46
|
export declare function List<T>(options?: ListOptions<T> | ((item: T) => ListOptions<T>)): ClassDecorator;
|
43
47
|
export declare function getListConfiguration<T extends AnyClass>(entityClass: AnyClassConstructor<T>): ListConfiguration<T>;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { CellConfiguration, CellOptions } from '../Cell';
|
2
|
+
export interface LinkCellOptions<T> extends Omit<CellOptions, 'type'> {
|
3
|
+
url?: string;
|
4
|
+
path?: string;
|
5
|
+
onClick?: (data: T) => void;
|
6
|
+
}
|
7
|
+
export interface LinkCellConfiguration<T> extends CellConfiguration {
|
8
|
+
type: 'link';
|
9
|
+
url?: string;
|
10
|
+
path?: string;
|
11
|
+
onClick?: (data: T) => void;
|
12
|
+
}
|
13
|
+
export declare function LinkCell<T>(options?: LinkCellOptions<T>): PropertyDecorator;
|