@guiexpert/table 1.1.38 → 1.1.40
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/css/main.css +72 -0
- package/css/table-classes.css +72 -0
- package/index.cjs +98 -62
- package/index.d.ts +2 -0
- package/index.js +808 -613
- package/lib/table/crud/crud-object-edit.d.ts +11 -0
- package/lib/table/crud/crud-object-view.d.ts +9 -0
- package/lib/table/crud/crud-options.d.ts +4 -1
- package/lib/table/crud/crud-options.if.d.ts +3 -1
- package/lib/table/crud/crud-table-model-factory.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class CrudObjectEdit<T extends Record<string, any>> {
|
|
2
|
+
private idKey;
|
|
3
|
+
dialogTitle: string;
|
|
4
|
+
private object;
|
|
5
|
+
constructor(idKey: keyof T, obj: T, dialogTitle?: string);
|
|
6
|
+
openDialog(onSave: (updatedObject: T) => void): void;
|
|
7
|
+
private generateForm;
|
|
8
|
+
private setNestedValue;
|
|
9
|
+
private getCombinedKey;
|
|
10
|
+
private getLabel;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class CrudObjectView<T extends Record<string, any>> {
|
|
2
|
+
private object;
|
|
3
|
+
constructor(obj: T);
|
|
4
|
+
openDialog(): void;
|
|
5
|
+
getCombinedKey(parentKey: string, property: string): string;
|
|
6
|
+
getLabel(combinedKey: string): string;
|
|
7
|
+
private generateHtmlTable;
|
|
8
|
+
private generateTableRows;
|
|
9
|
+
}
|
|
@@ -10,9 +10,12 @@ export declare class CrudOptions implements CrudOptionsIf {
|
|
|
10
10
|
columnWidths: ColumnWidthsIf;
|
|
11
11
|
calcFixedRightColumnCount: (columnCount: number) => number;
|
|
12
12
|
getHeadersInit: (() => HeadersInit);
|
|
13
|
+
getIdKey: () => string;
|
|
13
14
|
getIdByObject: <T extends Record<string, unknown>>(o: T) => any;
|
|
14
15
|
fetchList: <T>(crudOptions: CrudOptionsIf) => Promise<T[]>;
|
|
15
16
|
fetchItem: <T>(crudOptions: CrudOptionsIf, id: any) => Promise<T>;
|
|
17
|
+
updateItem: (crudOptions: CrudOptionsIf, id: any, item: any) => Promise<any>;
|
|
18
|
+
createItem: (crudOptions: CrudOptionsIf, item: any) => Promise<any>;
|
|
16
19
|
deleteItem: (crudOptions: CrudOptionsIf, id: any) => Promise<any>;
|
|
17
|
-
|
|
20
|
+
getEmptyItem: () => any;
|
|
18
21
|
}
|
|
@@ -7,11 +7,13 @@ export interface CrudOptionsIf {
|
|
|
7
7
|
tableActions: CrudAction[];
|
|
8
8
|
fetchList: <T>(crudOptions: CrudOptionsIf) => Promise<T[]>;
|
|
9
9
|
fetchItem: <T>(crudOptions: CrudOptionsIf, id: any) => Promise<T>;
|
|
10
|
+
updateItem: (crudOptions: CrudOptionsIf, id: any, item: any) => Promise<any>;
|
|
10
11
|
deleteItem: (crudOptions: CrudOptionsIf, id: any) => Promise<any>;
|
|
12
|
+
getIdKey: () => string;
|
|
11
13
|
getIdByObject: <T extends Record<string, unknown>>(o: T) => any;
|
|
14
|
+
getEmptyItem: () => any;
|
|
12
15
|
calcFixedRightColumnCount: (columnCount: number) => number;
|
|
13
16
|
autoAddActionColumn?: boolean;
|
|
14
17
|
isActionDeleteVisible?: boolean;
|
|
15
18
|
isActionDeleteEnabled?: boolean;
|
|
16
|
-
getId: <T>(item: T) => any;
|
|
17
19
|
}
|
|
@@ -13,6 +13,7 @@ export declare class CrudTableModelFactory implements ActionEventListenerIf {
|
|
|
13
13
|
crudOptions: CrudOptions;
|
|
14
14
|
listenActionEvent: (actionEvent: ActionEventIf) => void;
|
|
15
15
|
createTableModel<T>(crudOptions: CrudOptions, p: Partial<CreateTableModelPara>, callback?: (tableModelAndOptions: TableModelAndOptionsIf) => void, listenActionEvent?: (actionEvent: ActionEventIf) => void): void;
|
|
16
|
+
openDialogForCreate(): void;
|
|
16
17
|
onActionEvent(actionEvent: ActionEventIf): void;
|
|
17
18
|
private calcAutoColumnWidths;
|
|
18
19
|
private getValueByT;
|