@messaia/cdk 18.2.2 → 18.2.3-rc02

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.
Files changed (33) hide show
  1. package/esm2022/lib/base/components/generic-form-base.component.mjs +8 -3
  2. package/esm2022/lib/base/components/generic-list.component.mjs +3 -3
  3. package/esm2022/lib/common/common.module.mjs +2 -1
  4. package/esm2022/lib/common/models/app-event.mjs +13 -1
  5. package/esm2022/lib/common/models/audit-entity.mjs +21 -8
  6. package/esm2022/lib/common/models/audit-user.mjs +13 -4
  7. package/esm2022/lib/common/models/base-entity.mjs +12 -5
  8. package/esm2022/lib/common/models/common-error.mjs +16 -6
  9. package/esm2022/lib/common/models/common-handler-context.mjs +20 -11
  10. package/esm2022/lib/common/models/displayname-number-projection.mjs +27 -6
  11. package/esm2022/lib/common/models/displayname-projection.mjs +17 -4
  12. package/esm2022/lib/common/models/entity.mjs +1 -1
  13. package/esm2022/lib/common/models/enum-item.mjs +1 -1
  14. package/esm2022/lib/common/models/enum-metadata.mjs +20 -9
  15. package/esm2022/lib/common/models/modifiable-entity.mjs +22 -0
  16. package/esm2022/lib/forms/components/generic-form/generic-form.component.mjs +1 -6
  17. package/fesm2022/messaia-cdk.mjs +181 -55
  18. package/fesm2022/messaia-cdk.mjs.map +1 -1
  19. package/lib/common/common.module.d.ts +1 -0
  20. package/lib/common/models/app-event.d.ts +12 -0
  21. package/lib/common/models/audit-entity.d.ts +18 -6
  22. package/lib/common/models/audit-user.d.ts +12 -3
  23. package/lib/common/models/base-entity.d.ts +11 -4
  24. package/lib/common/models/common-error.d.ts +15 -5
  25. package/lib/common/models/common-handler-context.d.ts +19 -10
  26. package/lib/common/models/displayname-number-projection.d.ts +15 -3
  27. package/lib/common/models/displayname-projection.d.ts +11 -2
  28. package/lib/common/models/entity.d.ts +6 -1
  29. package/lib/common/models/enum-item.d.ts +16 -5
  30. package/lib/common/models/enum-metadata.d.ts +19 -8
  31. package/lib/common/models/modifiable-entity.d.ts +21 -0
  32. package/lib/forms/components/generic-form/generic-form.component.d.ts +0 -2
  33. package/package.json +1 -1
@@ -51,6 +51,7 @@ export { Filter } from './models/filter';
51
51
  export { FilterField } from './models/filter-field';
52
52
  export { Icon } from './models/icon';
53
53
  export { KeyValue } from './models/key-value';
54
+ export { ModifiableEntity } from './models/modifiable-entity';
54
55
  export { SaveAction } from './models/save-action';
55
56
  export { SuffixButton } from './models/suffix-button';
56
57
  export { DataSourcePipe } from './pipes/data-source.pipe';
@@ -1,6 +1,18 @@
1
1
  import { AppEventType } from "../enums/app-event-type";
2
+ /**
3
+ * Represents an application event with a specified type and associated payload.
4
+ * Used for event-driven communication within the application.
5
+ *
6
+ * @template T The type of the payload associated with the event.
7
+ */
2
8
  export declare class AppEvent<T> {
3
9
  type: AppEventType;
4
10
  payload: T;
11
+ /**
12
+ * Constructor to initialize the event type and payload.
13
+ *
14
+ * @param type The type of the event, represented by the `AppEventType` enum.
15
+ * @param payload The data or payload associated with the event.
16
+ */
5
17
  constructor(type: AppEventType, payload: T);
6
18
  }
@@ -1,24 +1,36 @@
1
1
  import { BaseEntity } from "./base-entity";
2
+ /**
3
+ * Abstract class extending the base entity with audit-related properties.
4
+ * Includes information about entity creation and updates.
5
+ */
2
6
  export declare abstract class AuditEntity extends BaseEntity {
3
7
  /**
4
- * @property
8
+ * @property Created By
9
+ * @description Specifies the username or identifier of the user who created the entity.
10
+ * @type {string}
5
11
  */
6
12
  createdBy?: string;
7
13
  /**
8
- * @property
14
+ * @property Created Date
15
+ * @description Specifies the date and time when the entity was created.
16
+ * @type {Date}
9
17
  */
10
18
  createdDate?: Date;
11
19
  /**
12
- * @property
20
+ * @property Updated By
21
+ * @description Specifies the username or identifier of the user who last updated the entity.
22
+ * @type {string}
13
23
  */
14
24
  updatedBy?: string;
15
25
  /**
16
- * @property
26
+ * @property Updated Date
27
+ * @description Specifies the date and time when the entity was last updated.
28
+ * @type {Date}
17
29
  */
18
30
  updatedDate?: Date;
19
31
  /**
20
- * constructor
21
- * @param init
32
+ * Constructor to initialize properties of the audit entity.
33
+ * @param init Partial object containing initial property values.
22
34
  */
23
35
  constructor(init?: Partial<AuditEntity>);
24
36
  }
@@ -1,14 +1,23 @@
1
+ /**
2
+ * Represents a user entity with audit-related information such as display name, email, and letter.
3
+ */
1
4
  export declare class AuditUser {
2
5
  /**
3
- * @property
6
+ * @property Display Name
7
+ * @description The full name or preferred display name of the user.
8
+ * @type {string}
4
9
  */
5
10
  displayName?: string;
6
11
  /**
7
- * @property
12
+ * @property Email
13
+ * @description The email address of the user.
14
+ * @type {string}
8
15
  */
9
16
  email?: string;
10
17
  /**
11
- * @property
18
+ * @property Letter
19
+ * @description The first letter or an abbreviation associated with the user.
20
+ * @type {string}
12
21
  */
13
22
  letter?: string;
14
23
  }
@@ -1,16 +1,23 @@
1
1
  import { IEntity } from "./entity";
2
+ /**
3
+ * Abstract class representing a base entity with common properties and functionality.
4
+ */
2
5
  export declare abstract class BaseEntity implements IEntity {
3
6
  /**
4
- * @property
7
+ * @property ID
8
+ * @description Represents the unique identifier of the entity.
9
+ * @type {number}
5
10
  */
6
11
  id?: number;
7
12
  /**
8
- * @property
13
+ * @property Version
14
+ * @description Represents the version number of the entity for concurrency control.
15
+ * @type {number}
9
16
  */
10
17
  version?: number;
11
18
  /**
12
- * constructor
13
- * @param init
19
+ * Constructor to initialize properties of the base entity.
20
+ * @param init Partial object containing initial property values.
14
21
  */
15
22
  constructor(init?: Partial<BaseEntity>);
16
23
  }
@@ -1,15 +1,25 @@
1
1
  /**
2
2
  * Represents a common error with a code and description.
3
+ * Typically used to encapsulate error details for consistent error handling.
3
4
  */
4
5
  export declare class CommonError {
5
- /** Error code */
6
+ /**
7
+ * @property Code
8
+ * @description The unique code identifying the type of error.
9
+ * @type {string}
10
+ */
6
11
  code: string;
7
- /** Error description */
12
+ /**
13
+ * @property Description
14
+ * @description A human-readable message providing details about the error.
15
+ * @type {string}
16
+ */
8
17
  description: string;
9
18
  /**
10
- * Constructs a new instance of CommonError.
11
- * @param code The error code.
12
- * @param description The error description.
19
+ * Constructs a new instance of the `CommonError` class.
20
+ *
21
+ * @param code The unique error code.
22
+ * @param description A descriptive message explaining the error.
13
23
  */
14
24
  constructor(code: string, description: string);
15
25
  }
@@ -1,31 +1,40 @@
1
1
  import { CommonError } from "./common-error";
2
2
  import { ICommonHandlerContext } from "./icommon-handler-context";
3
3
  /**
4
- * Represents the context of a handler operation, including results and errors.
5
- * @typeparam TResult The type of the result.
4
+ * Represents the context of a handler operation, including the operation result, success status, and associated errors.
5
+ *
6
+ * @typeparam TResult The type of the result encapsulated by the context.
6
7
  */
7
8
  export declare class CommonHandlerContext<TResult> implements ICommonHandlerContext<TResult> {
8
9
  /**
9
- * A list of errors that occurred during the operation.
10
+ * @property Errors
11
+ * @description A collection of errors that occurred during the operation. Empty if the operation succeeded.
12
+ * @type {CommonError[]}
10
13
  */
11
14
  errors: CommonError[];
12
15
  /**
13
- * The result of the operation.
16
+ * @property Result
17
+ * @description The result of the operation. Its value depends on the success or failure of the operation.
18
+ * @type {TResult}
14
19
  */
15
20
  result: TResult;
16
21
  /**
17
- * Indicates if the operation was successful.
22
+ * @property Has Succeeded
23
+ * @description Indicates whether the operation was successful. Defaults to `true`.
24
+ * @type {boolean}
18
25
  */
19
26
  hasSucceeded: boolean;
20
27
  /**
21
- * Constructs a new instance of CommonHandlerContext.
22
- * @param result The result of the operation.
28
+ * Constructs a new instance of the `CommonHandlerContext` class.
29
+ *
30
+ * @param result The initial result of the operation.
23
31
  */
24
32
  constructor(result: TResult);
25
33
  /**
26
- * Marks the operation as failed and sets the provided errors.
27
- * @param errors An optional array of CommonError instances indicating why the operation failed.
28
- * @returns The current instance of CommonHandlerContext with errors set.
34
+ * Marks the operation as failed and appends the provided errors to the `errors` property.
35
+ *
36
+ * @param errors An optional array of `CommonError` instances that provide details about why the operation failed.
37
+ * @returns The current instance of `CommonHandlerContext` with the failure status and errors updated.
29
38
  */
30
39
  fail(...errors: CommonError[]): this;
31
40
  }
@@ -1,14 +1,26 @@
1
+ /**
2
+ * Represents a projection of an entity with display name, number, and ID properties.
3
+ * This class is typically used to define how these properties are displayed and filtered in a table/grid.
4
+ */
1
5
  export declare class DisplayNameNumberProjection {
2
6
  /**
3
- * @property
7
+ * @property Display Name
8
+ * @description The name to display in the grid or UI. It is optional and localized using `@Display`.
9
+ * @type {string}
4
10
  */
5
11
  displayName?: string;
6
12
  /**
7
- * @property
13
+ * @property Number
14
+ * @description A numeric value associated with the entity, displayed in the grid.
15
+ * Includes filtering options and a medium grid display configuration.
16
+ * @type {number}
8
17
  */
9
18
  number?: number;
10
19
  /**
11
- * @property
20
+ * @property ID
21
+ * @description The unique identifier for the entity. Configured for filtering and sorting.
22
+ * The arrowBefore property ensures proper column sorting behavior in grids.
23
+ * @type {number}
12
24
  */
13
25
  id?: number;
14
26
  }
@@ -1,10 +1,19 @@
1
+ /**
2
+ * Represents a projection for displaying an entity's name and ID properties.
3
+ * This class is typically used in grid or table views to manage how these properties are displayed and filtered.
4
+ */
1
5
  export declare class DisplayNameProjection {
2
6
  /**
3
- * @property
7
+ * @property Display Name
8
+ * @description The name to display in the grid or UI. This property is localized using `@Display`.
9
+ * @type {string}
4
10
  */
5
11
  displayName?: string;
6
12
  /**
7
- * @property
13
+ * @property ID
14
+ * @description The unique identifier for the entity. Configured for filtering and sorting.
15
+ * The `arrowBefore` property ensures proper sorting behavior in grids.
16
+ * @type {number}
8
17
  */
9
18
  id?: number;
10
19
  }
@@ -1,6 +1,11 @@
1
+ /**
2
+ * Represents a generic entity with a unique identifier.
3
+ */
1
4
  export interface IEntity {
2
5
  /**
3
- * @property
6
+ * @property id
7
+ * @description Optional unique identifier for the entity.
8
+ * @type {number}
4
9
  */
5
10
  id?: number;
6
11
  }
@@ -1,22 +1,33 @@
1
1
  import { Icon } from "./icon";
2
2
  /**
3
- * Interface representing an item in an enum, providing ID and name properties.
3
+ * Interface representing an item in an enum, including its ID, name, and optional properties such as an associated icon and text color.
4
+ * This interface can be used to provide detailed metadata for enum items, especially when displayed in a UI context.
5
+ *
6
+ * @typeparam E The enum type that the item belongs to.
4
7
  */
5
8
  export interface EnumItem<E> {
6
9
  /**
7
- * The ID of the enum item, which is typically its value.
10
+ * @property ID
11
+ * @description The ID of the enum item, which is typically its value. This serves as a unique identifier for the item.
12
+ * @type {E}
8
13
  */
9
14
  id: E;
10
15
  /**
11
- * The name of the enum item, which is typically one of its keys.
16
+ * @property Name
17
+ * @description The name of the enum item, which is typically one of its keys. This is used for display or labeling purposes.
18
+ * @type {keyof E}
12
19
  */
13
20
  name: keyof E;
14
21
  /**
15
- * Optional icon associated with the enum value.
22
+ * @property Icon
23
+ * @description An optional icon associated with the enum item. Useful for providing visual representation.
24
+ * @type {Icon<any, any>}
16
25
  */
17
26
  icon?: Icon<any, any>;
18
27
  /**
19
- * Optional text color associated with the enum value.
28
+ * @property Text Color
29
+ * @description An optional text color associated with the enum item. This allows customization of the item's appearance.
30
+ * @type {string}
20
31
  */
21
32
  textColor?: string;
22
33
  }
@@ -1,31 +1,42 @@
1
1
  import { Icon } from "./icon";
2
2
  /**
3
- * Metadata class for enum values, containing display information and ordering.
3
+ * Metadata class for enum values, containing display information, ordering, and other optional properties.
4
+ * This class provides additional metadata for enum items, useful for customizing their presentation and behavior in the UI.
4
5
  */
5
6
  export declare class EnumMetadata {
6
7
  /**
7
- * Optional display string associated with the enum value.
8
+ * @property Display
9
+ * @description An optional display string associated with the enum value. This string can be used for user-friendly display in the UI.
10
+ * @type {string}
8
11
  */
9
12
  display?: string;
10
13
  /**
11
- * Optional icon associated with the enum value.
14
+ * @property Icon
15
+ * @description An optional icon associated with the enum value. This can be used to visually represent the enum value in the UI.
16
+ * @type {Icon<any, any>}
12
17
  */
13
18
  icon?: Icon<any, any>;
14
19
  /**
15
- * Optional text color associated with the enum value.
20
+ * @property Text Color
21
+ * @description An optional text color associated with the enum value. This allows customization of the appearance of the value in the UI.
22
+ * @type {string}
16
23
  */
17
24
  textColor?: string;
18
25
  /**
19
- * Optional order number used for sorting enum values.
26
+ * @property Order
27
+ * @description An optional order number used for sorting enum values. This helps in controlling the order in which enum items are displayed.
28
+ * @type {number}
20
29
  */
21
30
  order?: number;
22
31
  /**
23
- * Flag indicating whether the enum value should be hidden from the UI.
32
+ * @property Hidden
33
+ * @description A flag indicating whether the enum value should be hidden from the UI. This can be useful for conditionally hiding enum items.
34
+ * @type {boolean}
24
35
  */
25
36
  hidden?: boolean;
26
37
  /**
27
- * Constructor to initialize the EnumMetadata class.
28
- * @param init
38
+ * Constructor to initialize the EnumMetadata class with optional values.
39
+ * @param init An optional partial object to initialize the properties of EnumMetadata.
29
40
  */
30
41
  constructor(init?: Partial<EnumMetadata>);
31
42
  }
@@ -0,0 +1,21 @@
1
+ import { AuditEntity } from "./audit-entity";
2
+ /**
3
+ * Represents an entity that can be modified, extending from the AuditEntity class.
4
+ * This class adds additional properties to manage whether the entity is deletable or editable.
5
+ */
6
+ export declare class ModifiableEntity extends AuditEntity {
7
+ /**
8
+ * @property isDeletable
9
+ * @description A flag indicating whether the entity can be deleted.
10
+ * This property helps determine if the entity is deletable in the UI or business logic.
11
+ * @type {boolean}
12
+ */
13
+ isDeletable?: boolean;
14
+ /**
15
+ * @property isEditable
16
+ * @description A flag indicating whether the entity can be edited.
17
+ * This property helps determine if the entity is editable in the UI or business logic.
18
+ * @type {boolean}
19
+ */
20
+ isEditable?: boolean;
21
+ }
@@ -4,7 +4,6 @@ import { FormGroup } from '@angular/forms';
4
4
  import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
5
5
  import { MatChipInputEvent } from '@angular/material/chips';
6
6
  import { MatCalendar, MatDatepicker } from '@angular/material/datepicker';
7
- import { Icon } from '../../../common/models/icon';
8
7
  import { VdGenericFormCustomFieldDirective } from '../../directives/vd-generic-form-custom-field.directive';
9
8
  import { FormFieldType } from '../../enums/form-field-type';
10
9
  import { FormDefinition } from '../../models/form-definition';
@@ -204,7 +203,6 @@ export declare class VdGenericFormComponent implements OnInit {
204
203
  * @param optionalParams
205
204
  */
206
205
  log(message: any, ...optionalParams: any[]): void;
207
- myFunction(func: Function, option: any): Icon<any, any>;
208
206
  static ɵfac: i0.ɵɵFactoryDeclaration<VdGenericFormComponent, never>;
209
207
  static ɵcmp: i0.ɵɵComponentDeclaration<VdGenericFormComponent, "vd-generic-form", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "classType": { "alias": "classType"; "required": false; }; "formDefinition": { "alias": "formDefinition"; "required": false; }; "fieldGroups": { "alias": "fieldGroups"; "required": false; }; "groupName": { "alias": "groupName"; "required": false; }; "fieldSets": { "alias": "fieldSets"; "required": false; }; "context": { "alias": "context"; "required": false; }; "debugValue": { "alias": "debugValue"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "separatorKeysCodes": { "alias": "separatorKeysCodes"; "required": false; }; }, {}, ["editorTemplate", "codeTemplate", "fileTemplate", "customTemplate", "bottom", "customFields", "customFieldsTemplates"], never, false, never>;
210
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messaia/cdk",
3
- "version": "18.2.2",
3
+ "version": "18.2.3-rc02",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.7",
6
6
  "@angular/core": "^18.2.7"