proje-react-panel 1.1.2 → 1.1.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/dist/components/ErrorComponent.d.ts +3 -2
- package/dist/components/LoadingScreen.d.ts +3 -1
- package/dist/components/list/CellField.d.ts +3 -2
- package/dist/components/list/cells/BooleanCell.d.ts +6 -0
- package/dist/components/list/cells/DateCell.d.ts +6 -0
- package/dist/components/list/cells/DefaultCell.d.ts +8 -0
- package/dist/components/list/cells/DownloadCell.d.ts +8 -0
- package/dist/components/list/cells/ImageCell.d.ts +8 -0
- package/dist/components/list/cells/UUIDCell.d.ts +6 -0
- package/dist/decorators/form/Form.d.ts +5 -1
- package/dist/decorators/list/Cell.d.ts +4 -6
- package/dist/decorators/list/ExtendedCell.d.ts +10 -0
- package/dist/decorators/list/cells/DownloadCell.d.ts +9 -0
- package/dist/decorators/list/cells/ImageCell.d.ts +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/utils/decerators.d.ts +7 -0
- package/package.json +2 -1
- package/src/components/DetailsPage.tsx +4 -3
- package/src/components/ErrorComponent.tsx +36 -33
- package/src/components/LoadingScreen.tsx +4 -3
- package/src/components/Panel.tsx +7 -3
- package/src/components/form/InnerForm.tsx +13 -1
- package/src/components/list/CellField.tsx +26 -42
- package/src/components/list/Datagrid.tsx +16 -9
- package/src/components/list/ListPage.tsx +4 -3
- package/src/components/list/cells/BooleanCell.tsx +15 -0
- package/src/components/list/cells/DateCell.tsx +21 -0
- package/src/components/list/cells/DefaultCell.tsx +11 -0
- package/src/components/list/cells/DownloadCell.tsx +28 -0
- package/src/components/list/cells/ImageCell.tsx +22 -0
- package/src/components/list/cells/UUIDCell.tsx +11 -0
- package/src/decorators/form/Form.ts +5 -1
- package/src/decorators/list/Cell.ts +15 -33
- package/src/decorators/list/ExtendedCell.ts +32 -0
- package/src/decorators/list/cells/DownloadCell.ts +18 -0
- package/src/decorators/list/cells/ImageCell.ts +6 -5
- package/src/index.ts +1 -0
- package/src/styles/list.scss +1 -1
- package/src/utils/decerators.ts +24 -0
@@ -1,9 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { AnyClass } from '../../types/AnyClass';
|
3
|
+
import { CellConfiguration } from '../../decorators/list/Cell';
|
3
4
|
interface CellFieldProps<T extends AnyClass> {
|
4
|
-
|
5
|
+
configuration: CellConfiguration;
|
5
6
|
item: T;
|
6
7
|
value: any;
|
7
8
|
}
|
8
|
-
export declare function CellField<T extends AnyClass>({
|
9
|
+
export declare function CellField<T extends AnyClass>({ configuration, item, value, }: CellFieldProps<T>): React.ReactElement;
|
9
10
|
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CellConfiguration } from '../../../decorators/list/Cell';
|
3
|
+
interface DefaultCellProps {
|
4
|
+
value: any;
|
5
|
+
configuration: CellConfiguration;
|
6
|
+
}
|
7
|
+
export declare function DefaultCell({ value, configuration }: DefaultCellProps): React.ReactElement;
|
8
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CellConfiguration } from '../../../decorators/list/Cell';
|
3
|
+
interface DownloadCellProps {
|
4
|
+
value: string;
|
5
|
+
configuration: CellConfiguration;
|
6
|
+
}
|
7
|
+
export declare function DownloadCell({ value, configuration }: DownloadCellProps): React.ReactElement;
|
8
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CellConfiguration } from '../../../decorators/list/Cell';
|
3
|
+
interface ImageCellProps {
|
4
|
+
value: string;
|
5
|
+
configuration: CellConfiguration;
|
6
|
+
}
|
7
|
+
export declare function ImageCell({ value, configuration }: ImageCellProps): React.JSX.Element;
|
8
|
+
export {};
|
@@ -1,16 +1,20 @@
|
|
1
1
|
import 'reflect-metadata';
|
2
2
|
import { AnyClass, AnyClassConstructor } from '../../types/AnyClass';
|
3
3
|
import { GetDetailsDataFN } from '../details/Details';
|
4
|
-
export type OnSubmitFN<T> = (data: T | FormData) => Promise<T
|
4
|
+
export type OnSubmitFN<T> = (data: T | FormData) => Promise<T>;
|
5
5
|
interface FormOptions<T extends AnyClass> {
|
6
6
|
onSubmit: OnSubmitFN<T>;
|
7
7
|
getDetailsData?: GetDetailsDataFN<T>;
|
8
|
+
/** @deprecated */
|
8
9
|
redirectBackOnSuccess?: boolean;
|
9
10
|
type?: 'json' | 'formData';
|
11
|
+
redirectSuccessUrl?: string;
|
10
12
|
}
|
11
13
|
export interface FormConfiguration<T extends AnyClass> extends FormOptions<T> {
|
14
|
+
/** @deprecated */
|
12
15
|
redirectBackOnSuccess: boolean;
|
13
16
|
type: 'json' | 'formData';
|
17
|
+
redirectSuccessUrl?: string;
|
14
18
|
}
|
15
19
|
export declare function Form<T extends AnyClass>(options?: FormOptions<T>): ClassDecorator;
|
16
20
|
export declare function getFormConfiguration<T extends AnyClass, K extends AnyClassConstructor<T>>(entityClass: K): FormConfiguration<T>;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import 'reflect-metadata';
|
2
2
|
import { AnyClass } from '../../types/AnyClass';
|
3
|
-
|
3
|
+
import { DecoratorMap } from '../../utils/decerators';
|
4
|
+
export declare const CELL_KEY: Symbol;
|
4
5
|
interface Filter {
|
5
6
|
type: 'string' | 'number' | 'date' | 'static-select';
|
6
7
|
}
|
@@ -12,7 +13,7 @@ export interface StaticSelectFilter extends Filter {
|
|
12
13
|
}[];
|
13
14
|
}
|
14
15
|
export type CellTypes = 'string' | 'date' | 'number' | 'boolean' | 'uuid';
|
15
|
-
export type ExtendedCellTypes = CellTypes | 'image';
|
16
|
+
export type ExtendedCellTypes = CellTypes | 'image' | 'download';
|
16
17
|
export interface CellOptions {
|
17
18
|
name?: string;
|
18
19
|
title?: string;
|
@@ -20,14 +21,11 @@ export interface CellOptions {
|
|
20
21
|
placeHolder?: string;
|
21
22
|
filter?: Filter | StaticSelectFilter;
|
22
23
|
}
|
23
|
-
export interface ExtendedCellOptions extends Omit<CellOptions, 'type'> {
|
24
|
-
type?: ExtendedCellTypes;
|
25
|
-
}
|
26
24
|
export interface CellConfiguration extends Omit<CellOptions, 'type'> {
|
27
25
|
name: string;
|
28
26
|
type: ExtendedCellTypes;
|
29
27
|
}
|
28
|
+
export declare const cellMap: DecoratorMap<CellOptions, CellConfiguration>;
|
30
29
|
export declare function Cell(options?: CellOptions): PropertyDecorator;
|
31
|
-
export declare function ExtendedCell(options?: ExtendedCellOptions): PropertyDecorator;
|
32
30
|
export declare function getCellFields<T extends AnyClass>(entityClass: T): CellConfiguration[];
|
33
31
|
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { CellConfiguration, CellOptions, ExtendedCellTypes } from './Cell';
|
2
|
+
import { DecoratorMap } from '../../utils/decerators';
|
3
|
+
export interface ExtendedCellOptions extends Omit<CellOptions, 'type'> {
|
4
|
+
type?: ExtendedCellTypes;
|
5
|
+
}
|
6
|
+
interface ExtendedCellConfiguration extends Omit<CellConfiguration, 'name'> {
|
7
|
+
name?: string;
|
8
|
+
}
|
9
|
+
export declare function ExtendedCell<T extends ExtendedCellOptions, K extends ExtendedCellConfiguration>(options?: T, map?: DecoratorMap<T, K>): PropertyDecorator;
|
10
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { CellConfiguration, CellOptions } from '../Cell';
|
2
|
+
export interface DownloadCellOptions extends Omit<CellOptions, 'type'> {
|
3
|
+
baseUrl: string;
|
4
|
+
}
|
5
|
+
export interface DownloadCellConfiguration extends CellConfiguration {
|
6
|
+
type: 'download';
|
7
|
+
baseUrl: string;
|
8
|
+
}
|
9
|
+
export declare function DownloadCell(options?: DownloadCellOptions): PropertyDecorator;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import 'reflect-metadata';
|
2
1
|
import { CellConfiguration, CellOptions } from '../Cell';
|
3
|
-
export interface ImageCellOptions extends CellOptions {
|
2
|
+
export interface ImageCellOptions extends Omit<CellOptions, 'type'> {
|
4
3
|
baseUrl: string;
|
5
4
|
}
|
6
5
|
export interface ImageCellConfiguration extends CellConfiguration {
|
7
6
|
type: 'image';
|
7
|
+
baseUrl: string;
|
8
8
|
}
|
9
9
|
export declare function ImageCell(options?: ImageCellOptions): PropertyDecorator;
|