proje-react-panel 1.1.4 → 1.1.6
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/.cursor/rules.md +21 -95
- package/.vscode/settings.json +6 -1
- package/PTD.md +124 -24
- package/dist/components/DetailsPage.d.ts +2 -2
- package/dist/components/Login.d.ts +2 -2
- package/dist/components/Panel.d.ts +2 -2
- package/dist/components/form/FormField.d.ts +1 -5
- package/dist/components/form/FormHeader.d.ts +10 -0
- package/dist/components/form/FormPage.d.ts +12 -1
- package/dist/components/form/Select.d.ts +1 -1
- package/dist/components/form/SelectStyles.d.ts +3 -3
- package/dist/components/list/CellField.d.ts +2 -3
- package/dist/components/list/EmptyList.d.ts +1 -1
- package/dist/decorators/details/Details.d.ts +1 -2
- package/dist/decorators/form/Form.d.ts +3 -5
- package/dist/decorators/form/Input.d.ts +10 -2
- package/dist/decorators/form/inputs/SelectInput.d.ts +8 -7
- package/dist/decorators/list/Cell.d.ts +3 -3
- package/dist/decorators/list/List.d.ts +3 -4
- package/dist/decorators/list/getListPageMeta.d.ts +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/store/store.d.ts +1 -0
- package/dist/utils/decerators.d.ts +3 -3
- package/eslint.config.mjs +60 -0
- package/package.json +6 -3
- package/src/api/CrudApi.ts +59 -53
- package/src/components/DetailsPage.tsx +8 -6
- package/src/components/Login.tsx +11 -4
- package/src/components/Panel.tsx +3 -3
- package/src/components/form/Checkbox.tsx +1 -1
- package/src/components/form/FormField.tsx +13 -9
- package/src/components/form/FormHeader.tsx +18 -0
- package/src/components/form/FormPage.tsx +146 -5
- package/src/components/form/InnerForm.tsx +13 -8
- package/src/components/form/Select.tsx +14 -15
- package/src/components/form/SelectStyles.ts +4 -4
- package/src/components/layout/Layout.tsx +1 -7
- package/src/components/layout/SideBar.tsx +1 -2
- package/src/components/list/CellField.tsx +2 -5
- package/src/components/list/Datagrid.tsx +0 -1
- package/src/components/list/EmptyList.tsx +2 -2
- package/src/components/list/FilterPopup.tsx +4 -2
- package/src/components/list/ListPage.tsx +7 -5
- package/src/components/list/cells/DefaultCell.tsx +2 -0
- package/src/decorators/details/Details.ts +2 -2
- package/src/decorators/details/DetailsItem.ts +2 -0
- package/src/decorators/form/Form.ts +10 -11
- package/src/decorators/form/Input.ts +19 -10
- package/src/decorators/form/inputs/SelectInput.ts +8 -7
- package/src/decorators/list/Cell.ts +6 -4
- package/src/decorators/list/ExtendedCell.ts +1 -9
- package/src/decorators/list/List.ts +8 -4
- package/src/decorators/list/cells/ImageCell.ts +1 -1
- package/src/decorators/list/getListPageMeta.ts +4 -3
- package/src/store/store.ts +3 -1
- package/src/styles/components/form-header.scss +75 -0
- package/src/styles/index.scss +1 -0
- package/src/types/AnyClass.ts +3 -0
- package/src/utils/decerators.ts +3 -2
- package/.eslintrc.js +0 -23
- package/.eslintrc.json +0 -26
- package/src/initPanel.ts +0 -3
- package/src/types/initPanelOptions.ts +0 -1
@@ -1,23 +1,24 @@
|
|
1
1
|
import { InputConfiguration, InputOptions } from '../Input';
|
2
|
-
export interface SelectInputOptions extends InputOptions {
|
2
|
+
export interface SelectInputOptions<T> extends InputOptions {
|
3
3
|
onSelectPreloader?: () => Promise<{
|
4
4
|
label: string;
|
5
|
-
value:
|
5
|
+
value: T;
|
6
6
|
}[]>;
|
7
7
|
defaultOptions?: {
|
8
|
-
value:
|
8
|
+
value: T;
|
9
9
|
label: string;
|
10
10
|
}[];
|
11
|
+
csvExport?: never;
|
11
12
|
}
|
12
|
-
export interface SelectInputConfiguration extends InputConfiguration {
|
13
|
+
export interface SelectInputConfiguration<T> extends InputConfiguration {
|
13
14
|
type: 'select';
|
14
15
|
onSelectPreloader?: () => Promise<{
|
15
16
|
label: string;
|
16
|
-
value:
|
17
|
+
value: T;
|
17
18
|
}[]>;
|
18
19
|
defaultOptions?: {
|
19
|
-
value:
|
20
|
+
value: T;
|
20
21
|
label: string;
|
21
22
|
}[];
|
22
23
|
}
|
23
|
-
export declare function SelectInput(options?: SelectInputOptions): PropertyDecorator;
|
24
|
+
export declare function SelectInput<K>(options?: SelectInputOptions<K>): PropertyDecorator;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import 'reflect-metadata';
|
2
|
-
import { AnyClass } from '../../types/AnyClass';
|
2
|
+
import { AnyClass, AnyClassConstructor } from '../../types/AnyClass';
|
3
3
|
import { DecoratorMap } from '../../utils/decerators';
|
4
|
-
export declare const CELL_KEY:
|
4
|
+
export declare const CELL_KEY: unique symbol;
|
5
5
|
interface Filter {
|
6
6
|
type: 'string' | 'number' | 'date' | 'static-select';
|
7
7
|
}
|
@@ -27,5 +27,5 @@ export interface CellConfiguration extends Omit<CellOptions, 'type'> {
|
|
27
27
|
}
|
28
28
|
export declare const cellMap: DecoratorMap<CellOptions, CellConfiguration>;
|
29
29
|
export declare function Cell(options?: CellOptions): PropertyDecorator;
|
30
|
-
export declare function getCellFields<T extends AnyClass>(entityClass: T): CellConfiguration[];
|
30
|
+
export declare function getCellFields<T extends AnyClass>(entityClass: AnyClassConstructor<T>): CellConfiguration[];
|
31
31
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import 'reflect-metadata';
|
2
|
-
import { AnyClass } from '../../types/AnyClass';
|
2
|
+
import { AnyClass, AnyClassConstructor } from '../../types/AnyClass';
|
3
3
|
export interface GetDataParams {
|
4
4
|
page?: number;
|
5
5
|
limit?: number;
|
@@ -38,7 +38,6 @@ export interface ListOptions<T> {
|
|
38
38
|
headers?: ListHeaderOptions;
|
39
39
|
cells?: ((item: T) => ListCellOptions<T>) | ListCellOptions<T>;
|
40
40
|
}
|
41
|
-
export
|
42
|
-
}
|
41
|
+
export type ListConfiguration<T> = ListOptions<T>;
|
43
42
|
export declare function List<T>(options?: ListOptions<T> | ((item: T) => ListOptions<T>)): ClassDecorator;
|
44
|
-
export declare function getListConfiguration<T extends AnyClass>(entityClass: T): ListConfiguration<T>;
|
43
|
+
export declare function getListConfiguration<T extends AnyClass>(entityClass: AnyClassConstructor<T>): ListConfiguration<T>;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { AnyClass } from '../../types/AnyClass';
|
1
|
+
import { AnyClass, AnyClassConstructor } from '../../types/AnyClass';
|
2
2
|
import { CellConfiguration } from './Cell';
|
3
3
|
import { ListConfiguration } from './List';
|
4
4
|
export interface ListPageMeta<T extends AnyClass> {
|
5
5
|
class: ListConfiguration<T>;
|
6
6
|
cells: CellConfiguration[];
|
7
7
|
}
|
8
|
-
export declare function getListPageMeta<T extends AnyClass>(entityClass: T): ListPageMeta<T>;
|
8
|
+
export declare function getListPageMeta<T extends AnyClass>(entityClass: AnyClassConstructor<T>): ListPageMeta<T>;
|