ngx-material-entity 1.0.5 → 1.0.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/classes/entity.utilities.d.ts +31 -2
- package/components/input/input.component.d.ts +4 -4
- package/components/input/input.module.d.ts +2 -1
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +2 -2
- package/components/table/create-dialog/create-entity-dialog.module.d.ts +2 -1
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +2 -2
- package/components/table/edit-dialog/edit-entity-dialog.module.d.ts +3 -2
- package/decorators/base/property-decorator-internal.data.d.ts +2 -0
- package/decorators/base/property-decorator.data.d.ts +15 -0
- package/esm2020/classes/entity.utilities.mjs +62 -14
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +2 -2
- package/esm2020/components/input/input.component.mjs +23 -22
- package/esm2020/components/input/input.module.mjs +8 -4
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +9 -8
- package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +8 -4
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +8 -7
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.module.mjs +5 -1
- package/esm2020/decorators/base/property-decorator-internal.data.mjs +6 -1
- package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
- package/fesm2015/ngx-material-entity.mjs +125 -61
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +123 -59
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -150,13 +150,25 @@ export declare abstract class EntityUtilities {
|
|
|
150
150
|
* Gets the rows that are used to display the given entity.
|
|
151
151
|
*
|
|
152
152
|
* @param entity - The entity to get the rows from.
|
|
153
|
+
* @param tab - The tab number for which the rows should be returned.
|
|
153
154
|
* @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
|
|
154
155
|
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
155
156
|
* @returns The sorted Rows containing the row number and the keys to display in that row.
|
|
156
157
|
*/
|
|
157
|
-
static getEntityRows
|
|
158
|
+
private static getEntityRows;
|
|
159
|
+
/**
|
|
160
|
+
* Gets the tabs that are used to display the given entity.
|
|
161
|
+
*
|
|
162
|
+
* @param entity - The entity to get the rows from.
|
|
163
|
+
* @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
|
|
164
|
+
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
165
|
+
* @returns The sorted Tabs containing the rows and the keys to display in that row.
|
|
166
|
+
*/
|
|
167
|
+
static getEntityTabs<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean): EntityTab<EntityType>[];
|
|
158
168
|
private static getKeysForRow;
|
|
159
169
|
private static getNumberOfRows;
|
|
170
|
+
private static getNumberOfTabs;
|
|
171
|
+
private static getTabName;
|
|
160
172
|
/**
|
|
161
173
|
* Gets the keys of the provided entity correctly typed.
|
|
162
174
|
*
|
|
@@ -168,7 +180,7 @@ export declare abstract class EntityUtilities {
|
|
|
168
180
|
static keysOf<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean): (keyof EntityType)[];
|
|
169
181
|
}
|
|
170
182
|
/**
|
|
171
|
-
* A row that contains
|
|
183
|
+
* A row that contains information about how to display an entity.
|
|
172
184
|
*/
|
|
173
185
|
export interface EntityRow<EntityType extends BaseEntityType<EntityType>> {
|
|
174
186
|
/**
|
|
@@ -180,3 +192,20 @@ export interface EntityRow<EntityType extends BaseEntityType<EntityType>> {
|
|
|
180
192
|
*/
|
|
181
193
|
keys: (keyof EntityType)[];
|
|
182
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* A tab that contains all the information about how to display an entity.
|
|
197
|
+
*/
|
|
198
|
+
export interface EntityTab<EntityType extends BaseEntityType<EntityType>> {
|
|
199
|
+
/**
|
|
200
|
+
* The tab in which the rows should be displayed.
|
|
201
|
+
*/
|
|
202
|
+
tab: number;
|
|
203
|
+
/**
|
|
204
|
+
* The name to display inside the tab.
|
|
205
|
+
*/
|
|
206
|
+
tabName: string;
|
|
207
|
+
/**
|
|
208
|
+
* The rows that should be displayed inside this tab,.
|
|
209
|
+
*/
|
|
210
|
+
rows: EntityRow<EntityType>[];
|
|
211
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
2
2
|
import { NgModel } from '@angular/forms';
|
|
3
|
-
import {
|
|
3
|
+
import { EntityTab, EntityUtilities } from '../../classes/entity.utilities';
|
|
4
4
|
import { DecoratorTypes } from '../../decorators/base/decorator-types.enum';
|
|
5
5
|
import { EntityArrayDecoratorConfigInternal } from '../../decorators/array/array-decorator-internal.data';
|
|
6
6
|
import { DefaultObjectDecoratorConfigInternal } from '../../decorators/object/object-decorator-internal.data';
|
|
@@ -68,19 +68,19 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
68
68
|
metadata: PropertyDecoratorConfigInternal;
|
|
69
69
|
metadataDefaultObject: DefaultObjectDecoratorConfigInternal<EntityType>;
|
|
70
70
|
objectProperty: EntityType;
|
|
71
|
-
|
|
71
|
+
objectPropertyTabs: EntityTab<EntityType>[];
|
|
72
72
|
metadataEntityArray: EntityArrayDecoratorConfigInternal<EntityType>;
|
|
73
73
|
entityArrayValues: EntityType[];
|
|
74
74
|
arrayItem: EntityType;
|
|
75
75
|
private arrayItemPriorChanges;
|
|
76
|
-
|
|
76
|
+
arrayItemInlineTabs: EntityTab<EntityType>[];
|
|
77
77
|
dataSource: MatTableDataSource<EntityType>;
|
|
78
78
|
selection: SelectionModel<EntityType>;
|
|
79
79
|
displayedColumns: string[];
|
|
80
80
|
isArrayItemValid: boolean;
|
|
81
81
|
dialogInputData: AddArrayItemDialogData<EntityType>;
|
|
82
82
|
dialogData: AddArrayItemDialogDataInternal<EntityType>;
|
|
83
|
-
|
|
83
|
+
arrayItemDialogTabs: EntityTab<EntityType>[];
|
|
84
84
|
isDialogArrayItemValid: boolean;
|
|
85
85
|
readonly DecoratorTypes: typeof DecoratorTypes;
|
|
86
86
|
EntityUtilities: typeof EntityUtilities;
|
|
@@ -39,8 +39,9 @@ import * as i37 from "@angular/material/dialog";
|
|
|
39
39
|
import * as i38 from "@angular/material/button";
|
|
40
40
|
import * as i39 from "@angular/material/datepicker";
|
|
41
41
|
import * as i40 from "@angular/material/slider";
|
|
42
|
+
import * as i41 from "@angular/material/tabs";
|
|
42
43
|
export declare class NgxMatEntityInputModule {
|
|
43
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputModule, never>;
|
|
44
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.StringInputComponent, typeof i2.StringTextboxInputComponent, typeof i3.StringAutocompleteInputComponent, typeof i4.StringDropdownInputComponent, typeof i5.StringPasswordInputComponent, typeof i6.BooleanCheckboxInputComponent, typeof i7.BooleanToggleInputComponent, typeof i8.BooleanDropdownInputComponent, typeof i9.NumberInputComponent, typeof i10.NumberDropdownInputComponent, typeof i11.NumberSliderInputComponent, typeof i12.ArrayStringChipsInputComponent, typeof i13.ArrayStringAutocompleteChipsComponent, typeof i14.DateInputComponent, typeof i15.DateRangeInputComponent, typeof i16.DateTimeInputComponent, typeof i17.ArrayDateInputComponent, typeof i18.ArrayDateTimeInputComponent, typeof i19.ArrayDateRangeInputComponent, typeof i20.FileInputComponent, typeof i21.FileImageInputComponent, typeof i22.FileDefaultInputComponent, typeof i23.DragDropDirective, typeof i24.CustomInputComponent, typeof i25.NgxMatEntityInputComponent], [typeof i26.CommonModule, typeof i27.MatInputModule, typeof i28.FormsModule, typeof i29.MatFormFieldModule, typeof i30.MatSelectModule, typeof i31.MatAutocompleteModule, typeof i32.MatCheckboxModule, typeof i33.MatSlideToggleModule, typeof i34.MatChipsModule, typeof i35.MatIconModule, typeof i36.MatTableModule, typeof i37.MatDialogModule, typeof i38.MatButtonModule, typeof i39.MatDatepickerModule, typeof i40.MatSliderModule], [typeof i25.NgxMatEntityInputComponent]>;
|
|
45
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.StringInputComponent, typeof i2.StringTextboxInputComponent, typeof i3.StringAutocompleteInputComponent, typeof i4.StringDropdownInputComponent, typeof i5.StringPasswordInputComponent, typeof i6.BooleanCheckboxInputComponent, typeof i7.BooleanToggleInputComponent, typeof i8.BooleanDropdownInputComponent, typeof i9.NumberInputComponent, typeof i10.NumberDropdownInputComponent, typeof i11.NumberSliderInputComponent, typeof i12.ArrayStringChipsInputComponent, typeof i13.ArrayStringAutocompleteChipsComponent, typeof i14.DateInputComponent, typeof i15.DateRangeInputComponent, typeof i16.DateTimeInputComponent, typeof i17.ArrayDateInputComponent, typeof i18.ArrayDateTimeInputComponent, typeof i19.ArrayDateRangeInputComponent, typeof i20.FileInputComponent, typeof i21.FileImageInputComponent, typeof i22.FileDefaultInputComponent, typeof i23.DragDropDirective, typeof i24.CustomInputComponent, typeof i25.NgxMatEntityInputComponent], [typeof i26.CommonModule, typeof i27.MatInputModule, typeof i28.FormsModule, typeof i29.MatFormFieldModule, typeof i30.MatSelectModule, typeof i31.MatAutocompleteModule, typeof i32.MatCheckboxModule, typeof i33.MatSlideToggleModule, typeof i34.MatChipsModule, typeof i35.MatIconModule, typeof i36.MatTableModule, typeof i37.MatDialogModule, typeof i38.MatButtonModule, typeof i39.MatDatepickerModule, typeof i40.MatSliderModule, typeof i41.MatTabsModule], [typeof i25.NgxMatEntityInputComponent]>;
|
|
45
46
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityInputModule>;
|
|
46
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
3
|
import { EntityService } from '../../../classes/entity.service';
|
|
4
|
-
import {
|
|
4
|
+
import { EntityTab, EntityUtilities } from '../../../classes/entity.utilities';
|
|
5
5
|
import { CreateEntityDialogDataInternal } from './create-entity-dialog-data.builder';
|
|
6
6
|
import { CreateEntityDialogData } from './create-entity-dialog-data';
|
|
7
7
|
import { BaseEntityType } from '../../../classes/entity.model';
|
|
@@ -18,7 +18,7 @@ export declare class NgxMatEntityCreateDialogComponent<EntityType extends BaseEn
|
|
|
18
18
|
private readonly injector;
|
|
19
19
|
private readonly dialog;
|
|
20
20
|
EntityUtilities: typeof EntityUtilities;
|
|
21
|
-
|
|
21
|
+
entityTabs: EntityTab<EntityType>[];
|
|
22
22
|
entityService: EntityService<EntityType>;
|
|
23
23
|
data: CreateEntityDialogDataInternal<EntityType>;
|
|
24
24
|
isEntityValid: boolean;
|
|
@@ -5,8 +5,9 @@ import * as i3 from "../../input/input.module";
|
|
|
5
5
|
import * as i4 from "@angular/material/dialog";
|
|
6
6
|
import * as i5 from "@angular/forms";
|
|
7
7
|
import * as i6 from "@angular/material/button";
|
|
8
|
+
import * as i7 from "@angular/material/tabs";
|
|
8
9
|
export declare class NgxMatEntityCreateDialogModule {
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityCreateDialogModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityCreateDialogModule, [typeof i1.NgxMatEntityCreateDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule], [typeof i1.NgxMatEntityCreateDialogComponent]>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityCreateDialogModule, [typeof i1.NgxMatEntityCreateDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.MatTabsModule], [typeof i1.NgxMatEntityCreateDialogComponent]>;
|
|
11
12
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityCreateDialogModule>;
|
|
12
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
3
|
import { EntityService } from '../../../classes/entity.service';
|
|
4
|
-
import {
|
|
4
|
+
import { EntityTab, EntityUtilities } from '../../../classes/entity.utilities';
|
|
5
5
|
import { EditEntityDialogData } from './edit-entity-dialog-data';
|
|
6
6
|
import { EditEntityDialogDataInternal } from './edit-entity-dialog.builder';
|
|
7
7
|
import { BaseEntityType } from '../../../classes/entity.model';
|
|
@@ -18,7 +18,7 @@ export declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEnti
|
|
|
18
18
|
private readonly injector;
|
|
19
19
|
private readonly dialog;
|
|
20
20
|
EntityUtilities: typeof EntityUtilities;
|
|
21
|
-
|
|
21
|
+
entityTabs: EntityTab<EntityType>[];
|
|
22
22
|
entityService: EntityService<EntityType>;
|
|
23
23
|
entityPriorChanges: EntityType;
|
|
24
24
|
data: EditEntityDialogDataInternal<EntityType>;
|
|
@@ -5,9 +5,10 @@ import * as i3 from "../../input/input.module";
|
|
|
5
5
|
import * as i4 from "@angular/material/dialog";
|
|
6
6
|
import * as i5 from "@angular/forms";
|
|
7
7
|
import * as i6 from "@angular/material/button";
|
|
8
|
-
import * as i7 from "
|
|
8
|
+
import * as i7 from "@angular/material/tabs";
|
|
9
|
+
import * as i8 from "../../confirm-dialog/confirm-dialog.module";
|
|
9
10
|
export declare class NgxMatEntityEditDialogModule {
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityEditDialogModule, never>;
|
|
11
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityEditDialogModule, [typeof i1.NgxMatEntityEditDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.NgxMatEntityConfirmDialogModule], [typeof i1.NgxMatEntityEditDialogComponent]>;
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityEditDialogModule, [typeof i1.NgxMatEntityEditDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.MatTabsModule, typeof i8.NgxMatEntityConfirmDialogModule], [typeof i1.NgxMatEntityEditDialogComponent]>;
|
|
12
13
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityEditDialogModule>;
|
|
13
14
|
}
|
|
@@ -53,6 +53,21 @@ export declare abstract class PropertyDecoratorConfig {
|
|
|
53
53
|
* The options for positioning a property when using default create/edit dialogs.
|
|
54
54
|
*/
|
|
55
55
|
export interface Position {
|
|
56
|
+
/**
|
|
57
|
+
* Specifies a tab in which this property is displayed.
|
|
58
|
+
* If no property has the tab metadata specified no tabs are displayed.
|
|
59
|
+
* Ordering is ascending.
|
|
60
|
+
*
|
|
61
|
+
* @default -1 (sets this property in the first tab)
|
|
62
|
+
*/
|
|
63
|
+
tab?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the name of the tab. Can only be set by one property in each tab.
|
|
66
|
+
* Requires "tab" to be set.
|
|
67
|
+
*
|
|
68
|
+
* @default `Tab ${numberOfTheTab}`
|
|
69
|
+
*/
|
|
70
|
+
tabName?: string;
|
|
56
71
|
/**
|
|
57
72
|
* Specifies the (bootstrap)-row in which this property is displayed.
|
|
58
73
|
* Ordering is ascending.
|