@memberjunction/codegen-lib 3.4.0 → 4.0.0
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/README.md +11 -0
- package/dist/Angular/angular-codegen.d.ts +1 -1
- package/dist/Angular/angular-codegen.d.ts.map +1 -1
- package/dist/Angular/angular-codegen.js +80 -137
- package/dist/Angular/angular-codegen.js.map +1 -1
- package/dist/Angular/entity-data-grid-related-entity-component.d.ts +1 -1
- package/dist/Angular/entity-data-grid-related-entity-component.js +6 -9
- package/dist/Angular/entity-data-grid-related-entity-component.js.map +1 -1
- package/dist/Angular/join-grid-related-entity-component.d.ts +1 -1
- package/dist/Angular/join-grid-related-entity-component.js +8 -36
- package/dist/Angular/join-grid-related-entity-component.js.map +1 -1
- package/dist/Angular/related-entity-components.js +13 -79
- package/dist/Angular/related-entity-components.js.map +1 -1
- package/dist/Angular/timeline-related-entity-component.d.ts +1 -1
- package/dist/Angular/timeline-related-entity-component.js +14 -38
- package/dist/Angular/timeline-related-entity-component.js.map +1 -1
- package/dist/Angular/user-view-grid-related-entity-component.d.ts +43 -0
- package/dist/Angular/user-view-grid-related-entity-component.d.ts.map +1 -0
- package/dist/Angular/user-view-grid-related-entity-component.js +85 -0
- package/dist/Angular/user-view-grid-related-entity-component.js.map +1 -0
- package/dist/Config/config.js +161 -177
- package/dist/Config/config.js.map +1 -1
- package/dist/Config/db-connection.d.ts +1 -1
- package/dist/Config/db-connection.d.ts.map +1 -1
- package/dist/Config/db-connection.js +6 -33
- package/dist/Config/db-connection.js.map +1 -1
- package/dist/Database/dbSchema.js +28 -35
- package/dist/Database/dbSchema.js.map +1 -1
- package/dist/Database/manage-metadata.d.ts +3 -3
- package/dist/Database/manage-metadata.d.ts.map +1 -1
- package/dist/Database/manage-metadata.js +291 -319
- package/dist/Database/manage-metadata.js.map +1 -1
- package/dist/Database/reorder-columns.d.ts +1 -1
- package/dist/Database/reorder-columns.d.ts.map +1 -1
- package/dist/Database/reorder-columns.js +1 -5
- package/dist/Database/reorder-columns.js.map +1 -1
- package/dist/Database/sql.d.ts +1 -1
- package/dist/Database/sql.d.ts.map +1 -1
- package/dist/Database/sql.js +67 -98
- package/dist/Database/sql.js.map +1 -1
- package/dist/Database/sql_codegen.d.ts +2 -2
- package/dist/Database/sql_codegen.d.ts.map +1 -1
- package/dist/Database/sql_codegen.js +209 -237
- package/dist/Database/sql_codegen.js.map +1 -1
- package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts +11 -0
- package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts.map +1 -1
- package/dist/Manifest/GenerateClassRegistrationsManifest.js +43 -41
- package/dist/Manifest/GenerateClassRegistrationsManifest.js.map +1 -1
- package/dist/Misc/action_subclasses_codegen.d.ts.map +1 -1
- package/dist/Misc/action_subclasses_codegen.js +15 -26
- package/dist/Misc/action_subclasses_codegen.js.map +1 -1
- package/dist/Misc/advanced_generation.d.ts +1 -1
- package/dist/Misc/advanced_generation.js +34 -40
- package/dist/Misc/advanced_generation.js.map +1 -1
- package/dist/Misc/createNewUser.d.ts +1 -1
- package/dist/Misc/createNewUser.js +22 -26
- package/dist/Misc/createNewUser.js.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.d.ts +2 -2
- package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.js +33 -40
- package/dist/Misc/entity_subclasses_codegen.js.map +1 -1
- package/dist/Misc/graphql_server_codegen.js +36 -41
- package/dist/Misc/graphql_server_codegen.js.map +1 -1
- package/dist/Misc/runCommand.d.ts +1 -1
- package/dist/Misc/runCommand.js +13 -20
- package/dist/Misc/runCommand.js.map +1 -1
- package/dist/Misc/sql_logging.d.ts +1 -1
- package/dist/Misc/sql_logging.d.ts.map +1 -1
- package/dist/Misc/sql_logging.js +21 -51
- package/dist/Misc/sql_logging.js.map +1 -1
- package/dist/Misc/status_logging.js +45 -60
- package/dist/Misc/status_logging.js.map +1 -1
- package/dist/Misc/system_integrity.d.ts +1 -1
- package/dist/Misc/system_integrity.d.ts.map +1 -1
- package/dist/Misc/system_integrity.js +12 -16
- package/dist/Misc/system_integrity.js.map +1 -1
- package/dist/Misc/temp_batch_file.js +15 -22
- package/dist/Misc/temp_batch_file.js.map +1 -1
- package/dist/Misc/util.d.ts.map +1 -1
- package/dist/Misc/util.js +17 -28
- package/dist/Misc/util.js.map +1 -1
- package/dist/index.d.ts +21 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -41
- package/dist/index.js.map +1 -1
- package/dist/runCodeGen.d.ts +1 -0
- package/dist/runCodeGen.d.ts.map +1 -1
- package/dist/runCodeGen.js +150 -178
- package/dist/runCodeGen.js.map +1 -1
- package/package.json +24 -22
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const global_1 = require("@memberjunction/global");
|
|
11
|
-
const related_entity_components_1 = require("./related-entity-components");
|
|
7
|
+
import { RegisterClass } from "@memberjunction/global";
|
|
8
|
+
import { RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components.js";
|
|
12
9
|
/**
|
|
13
10
|
* Default generator class for creating EntityDataGrid components that display related entity data
|
|
14
11
|
* in a standard data grid format. This is the most commonly used related entity display component,
|
|
@@ -25,7 +22,7 @@ const related_entity_components_1 = require("./related-entity-components");
|
|
|
25
22
|
* - Automatic relationship parameter binding
|
|
26
23
|
* - Rich Before/After cancelable event system
|
|
27
24
|
*/
|
|
28
|
-
let EntityDataGridRelatedEntityGenerator = class EntityDataGridRelatedEntityGenerator extends
|
|
25
|
+
let EntityDataGridRelatedEntityGenerator = class EntityDataGridRelatedEntityGenerator extends RelatedEntityDisplayComponentGeneratorBase {
|
|
29
26
|
/**
|
|
30
27
|
* Returns the NPM package path for importing the EntityDataGrid Angular component
|
|
31
28
|
* @returns The import path for the ng-entity-viewer module
|
|
@@ -80,8 +77,8 @@ let EntityDataGridRelatedEntityGenerator = class EntityDataGridRelatedEntityGene
|
|
|
80
77
|
return null;
|
|
81
78
|
}
|
|
82
79
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(0, global_1.RegisterClass)(related_entity_components_1.RelatedEntityDisplayComponentGeneratorBase, "EntityDataGrid")
|
|
80
|
+
EntityDataGridRelatedEntityGenerator = __decorate([
|
|
81
|
+
RegisterClass(RelatedEntityDisplayComponentGeneratorBase, "EntityDataGrid")
|
|
86
82
|
], EntityDataGridRelatedEntityGenerator);
|
|
83
|
+
export { EntityDataGridRelatedEntityGenerator };
|
|
87
84
|
//# sourceMappingURL=entity-data-grid-related-entity-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-data-grid-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/entity-data-grid-related-entity-component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity-data-grid-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/entity-data-grid-related-entity-component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAgF,0CAA0C,EAAE,MAAM,6BAA6B,CAAC;AAEvK;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,0CAA0C;IAChG;;;OAGG;IACH,IAAW,UAAU;QACjB,OAAO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|
|
|
1
|
-
import { AngularComponentInfo, ComponentConfigBase, GenerationInput, GenerationResult, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components";
|
|
1
|
+
import { AngularComponentInfo, ComponentConfigBase, GenerationInput, GenerationResult, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components.js";
|
|
2
2
|
/**
|
|
3
3
|
* Configuration settings for each instance's use of the JoinGrid via the related entity.
|
|
4
4
|
* Defines the shape of the JSON that should be used to configure the JoinGrid component.
|
|
@@ -1,45 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const global_1 = require("@memberjunction/global");
|
|
11
|
-
const related_entity_components_1 = require("./related-entity-components");
|
|
7
|
+
import { RegisterClass, SafeJSONParse } from "@memberjunction/global";
|
|
8
|
+
import { ComponentConfigBase, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components.js";
|
|
12
9
|
/**
|
|
13
10
|
* Configuration settings for each instance's use of the JoinGrid via the related entity.
|
|
14
11
|
* Defines the shape of the JSON that should be used to configure the JoinGrid component.
|
|
15
12
|
* This component enables many-to-many relationships by displaying a grid that shows
|
|
16
13
|
* available rows and allows joining/unjoining entities.
|
|
17
14
|
*/
|
|
18
|
-
class JoinGridConfigInfo extends
|
|
19
|
-
/**
|
|
20
|
-
* The name of the entity that provides the rows in the grid (the "many" side of the relationship)
|
|
21
|
-
*/
|
|
22
|
-
RowsEntityName;
|
|
23
|
-
/**
|
|
24
|
-
* Optional additional filter to apply to the rows entity query
|
|
25
|
-
*/
|
|
26
|
-
RowsExtraFilter;
|
|
27
|
-
/**
|
|
28
|
-
* The field name from the rows entity to display as the primary identifier
|
|
29
|
-
*/
|
|
30
|
-
RowsEntityDisplayField;
|
|
31
|
-
/**
|
|
32
|
-
* Optional display name for the rows entity (if different from RowsEntityDisplayField)
|
|
33
|
-
*/
|
|
34
|
-
RowsEntityDisplayName;
|
|
35
|
-
/**
|
|
36
|
-
* Optional ORDER BY clause for sorting the rows
|
|
37
|
-
*/
|
|
38
|
-
RowsOrderBy;
|
|
39
|
-
/**
|
|
40
|
-
* Optional array of column names to display from the join entity
|
|
41
|
-
*/
|
|
42
|
-
JoinEntityDisplayColumns;
|
|
15
|
+
export class JoinGridConfigInfo extends ComponentConfigBase {
|
|
43
16
|
/**
|
|
44
17
|
* Constructs a new JoinGridConfigInfo with default values
|
|
45
18
|
*/
|
|
@@ -49,7 +22,6 @@ class JoinGridConfigInfo extends related_entity_components_1.ComponentConfigBase
|
|
|
49
22
|
this.RowsEntityDisplayField = "";
|
|
50
23
|
}
|
|
51
24
|
}
|
|
52
|
-
exports.JoinGridConfigInfo = JoinGridConfigInfo;
|
|
53
25
|
/**
|
|
54
26
|
* Generator class for creating JoinGrid components that handle many-to-many relationships.
|
|
55
27
|
* This component generates Angular templates that use the MemberJunction JoinGrid component
|
|
@@ -61,7 +33,7 @@ exports.JoinGridConfigInfo = JoinGridConfigInfo;
|
|
|
61
33
|
* - Remove existing join relationships
|
|
62
34
|
* - Display additional columns from the join entity
|
|
63
35
|
*/
|
|
64
|
-
let JoinGridRelatedEntityGenerator = class JoinGridRelatedEntityGenerator extends
|
|
36
|
+
let JoinGridRelatedEntityGenerator = class JoinGridRelatedEntityGenerator extends RelatedEntityDisplayComponentGeneratorBase {
|
|
65
37
|
/**
|
|
66
38
|
* Returns the configuration type class used for this generator
|
|
67
39
|
* @returns The JoinGridConfigInfo class type
|
|
@@ -96,7 +68,7 @@ let JoinGridRelatedEntityGenerator = class JoinGridRelatedEntityGenerator extend
|
|
|
96
68
|
* @throws Error if the DisplayComponentConfiguration is invalid JSON
|
|
97
69
|
*/
|
|
98
70
|
async Generate(input) {
|
|
99
|
-
const config =
|
|
71
|
+
const config = SafeJSONParse(input.RelationshipInfo.DisplayComponentConfiguration);
|
|
100
72
|
if (!config)
|
|
101
73
|
throw new Error("Invalid configuration for JoinGrid component for relationship " + input.RelationshipInfo.ID);
|
|
102
74
|
const template = `<mj-join-grid
|
|
@@ -126,8 +98,8 @@ let JoinGridRelatedEntityGenerator = class JoinGridRelatedEntityGenerator extend
|
|
|
126
98
|
};
|
|
127
99
|
}
|
|
128
100
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
(0, global_1.RegisterClass)(related_entity_components_1.RelatedEntityDisplayComponentGeneratorBase, "JoinGrid")
|
|
101
|
+
JoinGridRelatedEntityGenerator = __decorate([
|
|
102
|
+
RegisterClass(RelatedEntityDisplayComponentGeneratorBase, "JoinGrid")
|
|
132
103
|
], JoinGridRelatedEntityGenerator);
|
|
104
|
+
export { JoinGridRelatedEntityGenerator };
|
|
133
105
|
//# sourceMappingURL=join-grid-related-entity-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"join-grid-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/join-grid-related-entity-component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"join-grid-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/join-grid-related-entity-component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAwB,mBAAmB,EAAqC,0CAA0C,EAAE,MAAM,6BAA6B,CAAC;AAIvK;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,mBAAmB;IA+BvD;;OAEG;IACH;QAC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,CAAC,cAAc,CAAC;gCACnF,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,gBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,MAAO,CAAC,IAAI,CAAC,eAAe,KAAK,CAAC,MAAO,CAAC,eAAe,CAAC,IAAI;kCAChI,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;iCAC7G,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,gBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,MAAO,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,MAAO,CAAC,eAAe,CAAC,IAAI;;;CAG/J,CAAA;QACO,OAAO;YACH,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,IAAI;SAClB,CAAA;IACL,CAAC;CACJ,CAAA;AAnEY,8BAA8B;IAD1C,aAAa,CAAC,0CAA0C,EAAE,UAAU,CAAC;GACzD,8BAA8B,CAmE1C"}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const core_1 = require("@memberjunction/core");
|
|
5
|
-
const core_entities_1 = require("@memberjunction/core-entities");
|
|
6
|
-
const global_1 = require("@memberjunction/global");
|
|
1
|
+
import { Metadata } from "@memberjunction/core";
|
|
2
|
+
import { TypeTablesCache } from "@memberjunction/core-entities";
|
|
3
|
+
import { MJGlobal } from "@memberjunction/global";
|
|
7
4
|
/**
|
|
8
5
|
* Represents metadata about an Angular component that is used in the generated code.
|
|
9
6
|
* This includes all the necessary information for importing and using the component
|
|
10
7
|
* in generated Angular modules and templates.
|
|
11
8
|
*/
|
|
12
|
-
class AngularComponentInfo {
|
|
13
|
-
/**
|
|
14
|
-
* The TypeScript class name for the component
|
|
15
|
-
*/
|
|
16
|
-
ClassName;
|
|
17
|
-
/**
|
|
18
|
-
* The name of the Angular module that exports this component,
|
|
19
|
-
* used for proper import statements in the generated module
|
|
20
|
-
*/
|
|
21
|
-
ModuleName;
|
|
22
|
-
/**
|
|
23
|
-
* The Angular selector name for the component (e.g., 'mj-user-grid')
|
|
24
|
-
*/
|
|
25
|
-
AngularSelectorName;
|
|
9
|
+
export class AngularComponentInfo {
|
|
26
10
|
/**
|
|
27
11
|
* Constructs a new AngularComponentInfo with empty default values
|
|
28
12
|
*/
|
|
@@ -32,37 +16,12 @@ class AngularComponentInfo {
|
|
|
32
16
|
this.AngularSelectorName = "";
|
|
33
17
|
}
|
|
34
18
|
}
|
|
35
|
-
exports.AngularComponentInfo = AngularComponentInfo;
|
|
36
19
|
/**
|
|
37
20
|
* Result object returned by Angular code generation classes.
|
|
38
21
|
* Contains the generated template, optional TypeScript code, and metadata
|
|
39
22
|
* about the generation process.
|
|
40
23
|
*/
|
|
41
|
-
class GenerationResult {
|
|
42
|
-
/**
|
|
43
|
-
* Indicates whether the generation process completed successfully
|
|
44
|
-
*/
|
|
45
|
-
Success;
|
|
46
|
-
/**
|
|
47
|
-
* If generation failed, contains the error message describing what went wrong
|
|
48
|
-
*/
|
|
49
|
-
ErrorMessage;
|
|
50
|
-
/**
|
|
51
|
-
* The generated HTML/Angular template code that will be embedded
|
|
52
|
-
* in the final Angular component template
|
|
53
|
-
*/
|
|
54
|
-
TemplateOutput;
|
|
55
|
-
/**
|
|
56
|
-
* Optional TypeScript code that will be injected into the class definition
|
|
57
|
-
* of the Angular component. Useful for adding additional methods, properties,
|
|
58
|
-
* or lifecycle hooks to the component.
|
|
59
|
-
*/
|
|
60
|
-
CodeOutput;
|
|
61
|
-
/**
|
|
62
|
-
* Reference to the generator component that produced this output.
|
|
63
|
-
* Used for accessing component properties later for imports and module configuration.
|
|
64
|
-
*/
|
|
65
|
-
Component;
|
|
24
|
+
export class GenerationResult {
|
|
66
25
|
/**
|
|
67
26
|
* Constructs a new GenerationResult with default failure state
|
|
68
27
|
*/
|
|
@@ -72,34 +31,12 @@ class GenerationResult {
|
|
|
72
31
|
this.Component = null;
|
|
73
32
|
}
|
|
74
33
|
}
|
|
75
|
-
exports.GenerationResult = GenerationResult;
|
|
76
34
|
/**
|
|
77
35
|
* Input parameters required for the Generate() method of component generators.
|
|
78
36
|
* Contains all the context needed to generate appropriate Angular templates
|
|
79
37
|
* for related entity components.
|
|
80
38
|
*/
|
|
81
|
-
class GenerationInput {
|
|
82
|
-
/**
|
|
83
|
-
* The primary entity that owns the relationship
|
|
84
|
-
*/
|
|
85
|
-
Entity;
|
|
86
|
-
/**
|
|
87
|
-
* Metadata about the relationship between the primary entity and related entity,
|
|
88
|
-
* including display configuration and join information
|
|
89
|
-
*/
|
|
90
|
-
RelationshipInfo;
|
|
91
|
-
/**
|
|
92
|
-
* The name of the tab in a multi-tabbed interface. Optional but useful
|
|
93
|
-
* for deferred loading using the IsCurrentTab() method from BaseFormComponent.
|
|
94
|
-
* Allows components to optimize rendering by only loading data when the tab is active.
|
|
95
|
-
*/
|
|
96
|
-
TabName;
|
|
97
|
-
/**
|
|
98
|
-
* The unique camelCase key for the section in collapsible section-based forms.
|
|
99
|
-
* Used for deferred loading using the IsSectionExpanded() method from BaseFormComponent.
|
|
100
|
-
* Allows components to optimize rendering by only loading data when the section is expanded.
|
|
101
|
-
*/
|
|
102
|
-
SectionKey;
|
|
39
|
+
export class GenerationInput {
|
|
103
40
|
/**
|
|
104
41
|
* Constructs a new GenerationInput with null/empty default values
|
|
105
42
|
*/
|
|
@@ -110,16 +47,14 @@ class GenerationInput {
|
|
|
110
47
|
this.SectionKey = "";
|
|
111
48
|
}
|
|
112
49
|
}
|
|
113
|
-
exports.GenerationInput = GenerationInput;
|
|
114
50
|
/**
|
|
115
51
|
* Base class for all component configuration classes. Subclasses extend this
|
|
116
52
|
* to define the shape and properties of their specific configuration objects.
|
|
117
53
|
* These configurations are typically stored as JSON in the database and
|
|
118
54
|
* deserialized into strongly-typed objects.
|
|
119
55
|
*/
|
|
120
|
-
class ComponentConfigBase {
|
|
56
|
+
export class ComponentConfigBase {
|
|
121
57
|
}
|
|
122
|
-
exports.ComponentConfigBase = ComponentConfigBase;
|
|
123
58
|
/**
|
|
124
59
|
* Abstract base class responsible for generating Angular template code for related entity display components.
|
|
125
60
|
* Each subclass handles a specific type of related entity display (e.g., UserViewGrid, JoinGrid, Timeline).
|
|
@@ -143,7 +78,7 @@ exports.ComponentConfigBase = ComponentConfigBase;
|
|
|
143
78
|
*
|
|
144
79
|
* @see BaseFormComponent
|
|
145
80
|
*/
|
|
146
|
-
class RelatedEntityDisplayComponentGeneratorBase {
|
|
81
|
+
export class RelatedEntityDisplayComponentGeneratorBase {
|
|
147
82
|
/**
|
|
148
83
|
* Helper method that returns the name of the foreign key field in the specified entity
|
|
149
84
|
* that links to the related entity. Useful for building relationship queries and joins.
|
|
@@ -166,7 +101,7 @@ class RelatedEntityDisplayComponentGeneratorBase {
|
|
|
166
101
|
*/
|
|
167
102
|
GetForeignKey(entityName, relatedEntityName) {
|
|
168
103
|
// find a foreign key field that links the entity to the related entity
|
|
169
|
-
const md = new
|
|
104
|
+
const md = new Metadata();
|
|
170
105
|
const e = md.EntityByName(entityName);
|
|
171
106
|
if (!e)
|
|
172
107
|
throw new Error("Could not find entity " + entityName);
|
|
@@ -190,8 +125,8 @@ class RelatedEntityDisplayComponentGeneratorBase {
|
|
|
190
125
|
let key = "EntityDataGrid"; // default key/name of component
|
|
191
126
|
if (relationshipInfo.DisplayComponentID && relationshipInfo.DisplayComponentID.length > 0) {
|
|
192
127
|
// get the component from the component info provided
|
|
193
|
-
await
|
|
194
|
-
const component =
|
|
128
|
+
await TypeTablesCache.Instance.Config(false, contextUser);
|
|
129
|
+
const component = TypeTablesCache.Instance.EntityRelationshipDisplayComponents.find(x => x.ID === relationshipInfo.DisplayComponentID);
|
|
195
130
|
if (component) {
|
|
196
131
|
key = component.Name;
|
|
197
132
|
}
|
|
@@ -205,7 +140,7 @@ class RelatedEntityDisplayComponentGeneratorBase {
|
|
|
205
140
|
}
|
|
206
141
|
else {
|
|
207
142
|
// if we get here that means we have the key we need to use so get the component built
|
|
208
|
-
const component =
|
|
143
|
+
const component = MJGlobal.Instance.ClassFactory.CreateInstance(RelatedEntityDisplayComponentGeneratorBase, key, params);
|
|
209
144
|
if (component) {
|
|
210
145
|
RelatedEntityDisplayComponentGeneratorBase._componentInstanceMap.set(key, component);
|
|
211
146
|
return component;
|
|
@@ -219,7 +154,6 @@ class RelatedEntityDisplayComponentGeneratorBase {
|
|
|
219
154
|
* Internal cache map storing component instances by their key/name to avoid
|
|
220
155
|
* recreating the same component multiple times during code generation
|
|
221
156
|
*/
|
|
222
|
-
static _componentInstanceMap = new Map();
|
|
157
|
+
static { this._componentInstanceMap = new Map(); }
|
|
223
158
|
}
|
|
224
|
-
exports.RelatedEntityDisplayComponentGeneratorBase = RelatedEntityDisplayComponentGeneratorBase;
|
|
225
159
|
//# sourceMappingURL=related-entity-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-entity-components.js","sourceRoot":"","sources":["../../src/Angular/related-entity-components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"related-entity-components.js","sourceRoot":"","sources":["../../src/Angular/related-entity-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC/G,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IAiB7B;;OAEG;IACH;QACI,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;IAClC,CAA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AAC;YACrB,CAAC;iBACG,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,2CAA2C,GAAG,EAAE,CAAC,CAAC;YACtE,CAAC;QACL,CAAC;IACL,CAAC;IAED;;;OAGG;aACY,0BAAqB,GAA4D,IAAI,GAAG,EAAsD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AngularComponentInfo, ComponentConfigBase, GenerationInput, GenerationResult, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components";
|
|
1
|
+
import { AngularComponentInfo, ComponentConfigBase, GenerationInput, GenerationResult, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components.js";
|
|
2
2
|
/**
|
|
3
3
|
* Configuration settings for timeline component instances. Defines how related entity data
|
|
4
4
|
* should be displayed in a chronological timeline format, including which fields to use
|
|
@@ -1,56 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const global_1 = require("@memberjunction/global");
|
|
11
|
-
const related_entity_components_1 = require("./related-entity-components");
|
|
7
|
+
import { RegisterClass, SafeJSONParse } from "@memberjunction/global";
|
|
8
|
+
import { ComponentConfigBase, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components.js";
|
|
12
9
|
/**
|
|
13
10
|
* Configuration settings for timeline component instances. Defines how related entity data
|
|
14
11
|
* should be displayed in a chronological timeline format, including which fields to use
|
|
15
12
|
* for dates, titles, and descriptions.
|
|
16
13
|
*/
|
|
17
|
-
class TimelineConfigInfo extends
|
|
18
|
-
/**
|
|
19
|
-
* The name of the field in the related entity that contains the date/timestamp
|
|
20
|
-
* for positioning items on the timeline (e.g., 'CreatedAt', 'EventDate')
|
|
21
|
-
*/
|
|
22
|
-
DateField;
|
|
23
|
-
/**
|
|
24
|
-
* The name of the field in the related entity that contains the main title
|
|
25
|
-
* text to display for each timeline item (e.g., 'Title', 'Name', 'Subject')
|
|
26
|
-
*/
|
|
27
|
-
TitleField;
|
|
28
|
-
/**
|
|
29
|
-
* Optional field name for subtitle text displayed below the main title.
|
|
30
|
-
* Useful for additional context or secondary information.
|
|
31
|
-
*/
|
|
32
|
-
SubTitleField;
|
|
33
|
-
/**
|
|
34
|
-
* Optional field name for longer description text displayed in the timeline item.
|
|
35
|
-
* Typically contains detailed information about the timeline event.
|
|
36
|
-
*/
|
|
37
|
-
DescriptionField;
|
|
38
|
-
/**
|
|
39
|
-
* Controls the visual layout of the timeline. Vertical timelines stack items
|
|
40
|
-
* top-to-bottom, while horizontal timelines arrange items left-to-right.
|
|
41
|
-
* @default 'vertical'
|
|
42
|
-
*/
|
|
43
|
-
DisplayOrientation = 'vertical';
|
|
14
|
+
export class TimelineConfigInfo extends ComponentConfigBase {
|
|
44
15
|
/**
|
|
45
16
|
* Constructs a new TimelineConfigInfo with required fields initialized to empty strings
|
|
46
17
|
*/
|
|
47
18
|
constructor() {
|
|
48
19
|
super();
|
|
20
|
+
/**
|
|
21
|
+
* Controls the visual layout of the timeline. Vertical timelines stack items
|
|
22
|
+
* top-to-bottom, while horizontal timelines arrange items left-to-right.
|
|
23
|
+
* @default 'vertical'
|
|
24
|
+
*/
|
|
25
|
+
this.DisplayOrientation = 'vertical';
|
|
49
26
|
this.DateField = "";
|
|
50
27
|
this.TitleField = "";
|
|
51
28
|
}
|
|
52
29
|
}
|
|
53
|
-
exports.TimelineConfigInfo = TimelineConfigInfo;
|
|
54
30
|
/**
|
|
55
31
|
* Generator class for creating timeline components that display related entity data
|
|
56
32
|
* in chronological order. This component is ideal for showing time-based relationships
|
|
@@ -62,7 +38,7 @@ exports.TimelineConfigInfo = TimelineConfigInfo;
|
|
|
62
38
|
* - Flexible field mapping for dates, titles, and descriptions
|
|
63
39
|
* - Automatic filtering based on parent entity relationships
|
|
64
40
|
*/
|
|
65
|
-
let TimelineRelatedEntityGenerator = class TimelineRelatedEntityGenerator extends
|
|
41
|
+
let TimelineRelatedEntityGenerator = class TimelineRelatedEntityGenerator extends RelatedEntityDisplayComponentGeneratorBase {
|
|
66
42
|
/**
|
|
67
43
|
* Returns the configuration type class used for this timeline generator
|
|
68
44
|
* @returns The TimelineConfigInfo class type
|
|
@@ -99,7 +75,7 @@ let TimelineRelatedEntityGenerator = class TimelineRelatedEntityGenerator extend
|
|
|
99
75
|
* @throws Error if the DisplayComponentConfiguration is invalid JSON
|
|
100
76
|
*/
|
|
101
77
|
async Generate(input) {
|
|
102
|
-
const config =
|
|
78
|
+
const config = SafeJSONParse(input.RelationshipInfo.DisplayComponentConfiguration);
|
|
103
79
|
if (!config)
|
|
104
80
|
throw new Error("Invalid configuration for component for relationship " + input.RelationshipInfo.ID);
|
|
105
81
|
// Get the foreign key field that links the related entity back to the parent entity
|
|
@@ -119,8 +95,8 @@ let TimelineRelatedEntityGenerator = class TimelineRelatedEntityGenerator extend
|
|
|
119
95
|
};
|
|
120
96
|
}
|
|
121
97
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
(0, global_1.RegisterClass)(related_entity_components_1.RelatedEntityDisplayComponentGeneratorBase, "Timeline")
|
|
98
|
+
TimelineRelatedEntityGenerator = __decorate([
|
|
99
|
+
RegisterClass(RelatedEntityDisplayComponentGeneratorBase, "Timeline")
|
|
125
100
|
], TimelineRelatedEntityGenerator);
|
|
101
|
+
export { TimelineRelatedEntityGenerator };
|
|
126
102
|
//# sourceMappingURL=timeline-related-entity-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/timeline-related-entity-component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeline-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/timeline-related-entity-component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAwB,mBAAmB,EAAqC,0CAA0C,EAAE,MAAM,6BAA6B,CAAC;AAGvK;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,mBAAmB;IAgCvD;;OAEG;IACH;QACI,KAAK,EAAE,CAAC;QAXZ;;;;WAIG;QACH,uBAAkB,GAAgC,UAAU,CAAC;QAOzD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACzB,CAAC;CACJ;AAED;;;;;;;;;;GAUG;AAEI,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,0CAA0C;IAC1F;;;OAGG;IACH,IAAW,UAAU;QACjB,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IACD;;;OAGG;IACH,IAAW,UAAU;QACjB,OAAO,6BAA6B,CAAC;IACzC,CAAC;IACD;;;OAGG;IACH,IAAW,WAAW;QAClB,OAAO;YACH;gBACI,SAAS,EAAE,mBAAmB;gBAC9B,mBAAmB,EAAE,aAAa;gBAClC,UAAU,EAAE,gBAAgB;aAC/B;SACJ,CAAC;IACN,CAAC;IAGD;;;;;;;OAOG;IACI,KAAK,CAAC,QAAQ,CAAC,KAAsB;QACxC,MAAM,MAAM,GAAG,aAAa,CAAqB,KAAK,CAAC,gBAAiB,CAAC,6BAA6B,CAAC,CAAC;QACxG,IAAI,CAAC,MAAM;YACP,MAAM,IAAI,KAAK,CAAC,uDAAuD,GAAG,KAAK,CAAC,gBAAiB,CAAC,EAAE,CAAC,CAAC;QAE1G,oFAAoF;QACpF,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,gBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,MAAO,CAAC,IAAI,CAAC,CAAC;QACzF,wFAAwF;QACxF,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,IAAI,eAAe,KAAK,CAAC,MAAO,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QAE9E,4DAA4D;QAC5D,MAAM,QAAQ,GAAG;0BACC,MAAM,CAAC,kBAAkB;+BACpB,KAAK,CAAC,gBAAiB,CAAC,aAAa,wCAAwC,MAAM,sBAAsB,MAAM,CAAC,UAAU,sBAAsB,MAAM,CAAC,SAAS;eAChL,CAAA;QAEP,OAAO;YACH,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,IAAI;SAClB,CAAA;IACL,CAAC;CACJ,CAAA;AA7DY,8BAA8B;IAD1C,aAAa,CAAC,0CAA0C,EAAE,UAAU,CAAC;GACzD,8BAA8B,CA6D1C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AngularComponentInfo, ComponentConfigBase, GenerationInput, GenerationResult, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default generator class for creating UserViewGrid components that display related entity data
|
|
4
|
+
* in a standard data grid format. This is the most commonly used related entity display component,
|
|
5
|
+
* providing full CRUD capabilities, filtering, sorting, and pagination.
|
|
6
|
+
*
|
|
7
|
+
* The UserViewGrid component provides:
|
|
8
|
+
* - Tabular display of related entity records
|
|
9
|
+
* - In-line editing capabilities
|
|
10
|
+
* - Advanced filtering and search
|
|
11
|
+
* - Column sorting and customization
|
|
12
|
+
* - Pagination for large datasets
|
|
13
|
+
* - Integration with MemberJunction user views
|
|
14
|
+
* - Automatic relationship parameter binding
|
|
15
|
+
*/
|
|
16
|
+
export declare class UserViewGridRelatedEntityGenerator extends RelatedEntityDisplayComponentGeneratorBase {
|
|
17
|
+
/**
|
|
18
|
+
* Returns the NPM package path for importing the UserViewGrid Angular component
|
|
19
|
+
* @returns The import path for the ng-user-view-grid module
|
|
20
|
+
*/
|
|
21
|
+
get ImportPath(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the Angular component information needed for imports and module declarations
|
|
24
|
+
* @returns Empty array since UserViewGrid uses module-level imports, not component imports
|
|
25
|
+
*/
|
|
26
|
+
get ImportItems(): AngularComponentInfo[];
|
|
27
|
+
/**
|
|
28
|
+
* Generates the Angular template for a UserViewGrid component that displays related entity data.
|
|
29
|
+
* The generated template includes proper parameter binding for relationships, deferred loading,
|
|
30
|
+
* and integration with the parent form's edit mode and styling.
|
|
31
|
+
* @param input The generation input containing entity and relationship information
|
|
32
|
+
* @returns Promise resolving to the generation result with the Angular grid template
|
|
33
|
+
*/
|
|
34
|
+
Generate(input: GenerationInput): Promise<GenerationResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the configuration type for this component. UserViewGrid uses the base
|
|
37
|
+
* ComponentConfigBase since it doesn't require additional configuration beyond
|
|
38
|
+
* the standard relationship metadata.
|
|
39
|
+
* @returns null since no additional configuration is required
|
|
40
|
+
*/
|
|
41
|
+
get ConfigType(): typeof ComponentConfigBase;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=user-view-grid-related-entity-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-view-grid-related-entity-component.d.ts","sourceRoot":"","sources":["../../src/Angular/user-view-grid-related-entity-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,0CAA0C,EAAE,MAAM,6BAA6B,CAAC;AAEvK;;;;;;;;;;;;;GAaG;AACH,qBACa,kCAAmC,SAAQ,0CAA0C;IAC9F;;;OAGG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD;;;OAGG;IACH,IAAW,WAAW,IAAI,oBAAoB,EAAE,CAE/C;IACD;;;;;;OAMG;IACU,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0BxE;;;;;OAKG;IACH,IAAW,UAAU,IAAI,OAAO,mBAAmB,CAElD;CACJ"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.UserViewGridRelatedEntityGenerator = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const related_entity_components_1 = require("./related-entity-components.js");
|
|
12
|
+
/**
|
|
13
|
+
* Default generator class for creating UserViewGrid components that display related entity data
|
|
14
|
+
* in a standard data grid format. This is the most commonly used related entity display component,
|
|
15
|
+
* providing full CRUD capabilities, filtering, sorting, and pagination.
|
|
16
|
+
*
|
|
17
|
+
* The UserViewGrid component provides:
|
|
18
|
+
* - Tabular display of related entity records
|
|
19
|
+
* - In-line editing capabilities
|
|
20
|
+
* - Advanced filtering and search
|
|
21
|
+
* - Column sorting and customization
|
|
22
|
+
* - Pagination for large datasets
|
|
23
|
+
* - Integration with MemberJunction user views
|
|
24
|
+
* - Automatic relationship parameter binding
|
|
25
|
+
*/
|
|
26
|
+
let UserViewGridRelatedEntityGenerator = class UserViewGridRelatedEntityGenerator extends related_entity_components_1.RelatedEntityDisplayComponentGeneratorBase {
|
|
27
|
+
/**
|
|
28
|
+
* Returns the NPM package path for importing the UserViewGrid Angular component
|
|
29
|
+
* @returns The import path for the ng-user-view-grid module
|
|
30
|
+
*/
|
|
31
|
+
get ImportPath() {
|
|
32
|
+
return "@memberjunction/ng-user-view-grid";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns the Angular component information needed for imports and module declarations
|
|
36
|
+
* @returns Empty array since UserViewGrid uses module-level imports, not component imports
|
|
37
|
+
*/
|
|
38
|
+
get ImportItems() {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generates the Angular template for a UserViewGrid component that displays related entity data.
|
|
43
|
+
* The generated template includes proper parameter binding for relationships, deferred loading,
|
|
44
|
+
* and integration with the parent form's edit mode and styling.
|
|
45
|
+
* @param input The generation input containing entity and relationship information
|
|
46
|
+
* @returns Promise resolving to the generation result with the Angular grid template
|
|
47
|
+
*/
|
|
48
|
+
async Generate(input) {
|
|
49
|
+
// Use IsSectionExpanded for new collapsible section-based forms, IsCurrentTab for legacy tab-based forms
|
|
50
|
+
const allowLoadCheck = input.SectionKey && input.SectionKey.length > 0
|
|
51
|
+
? `IsSectionExpanded('${input.SectionKey.trim()}')`
|
|
52
|
+
: `IsCurrentTab('${input.TabName.trim()}')`;
|
|
53
|
+
// Add dataLoaded event binding to capture row count
|
|
54
|
+
const dataLoadedEvent = input.SectionKey && input.SectionKey.length > 0
|
|
55
|
+
? `(dataLoaded)="SetSectionRowCount('${input.SectionKey.trim()}', $event.totalRowCount)"`
|
|
56
|
+
: '';
|
|
57
|
+
const template = `<mj-user-view-grid
|
|
58
|
+
[Params]="BuildRelationshipViewParamsByEntityName('${input.RelationshipInfo.RelatedEntity.trim()}','${input.RelationshipInfo.RelatedEntityJoinField.trim()}')"
|
|
59
|
+
[NewRecordValues]="NewRecordValues('${input.RelationshipInfo.RelatedEntity.trim()}')"
|
|
60
|
+
[AllowLoad]="${allowLoadCheck}"
|
|
61
|
+
[EditMode]="GridEditMode()"${dataLoadedEvent ? `\n ${dataLoadedEvent}` : ''}
|
|
62
|
+
>
|
|
63
|
+
</mj-user-view-grid>`;
|
|
64
|
+
return {
|
|
65
|
+
Success: true,
|
|
66
|
+
TemplateOutput: template,
|
|
67
|
+
CodeOutput: "",
|
|
68
|
+
Component: this
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns the configuration type for this component. UserViewGrid uses the base
|
|
73
|
+
* ComponentConfigBase since it doesn't require additional configuration beyond
|
|
74
|
+
* the standard relationship metadata.
|
|
75
|
+
* @returns null since no additional configuration is required
|
|
76
|
+
*/
|
|
77
|
+
get ConfigType() {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
exports.UserViewGridRelatedEntityGenerator = UserViewGridRelatedEntityGenerator;
|
|
82
|
+
exports.UserViewGridRelatedEntityGenerator = UserViewGridRelatedEntityGenerator = __decorate([
|
|
83
|
+
(0, global_1.RegisterClass)(related_entity_components_1.RelatedEntityDisplayComponentGeneratorBase, "UserViewGrid")
|
|
84
|
+
], UserViewGridRelatedEntityGenerator);
|
|
85
|
+
//# sourceMappingURL=user-view-grid-related-entity-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-view-grid-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/user-view-grid-related-entity-component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuD;AACvD,2EAAuK;AAEvK;;;;;;;;;;;;;GAaG;AAEI,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,sEAA0C;IAC9F;;;OAGG;IACH,IAAW,UAAU;QACjB,OAAO,mCAAmC,CAAC;IAC/C,CAAC;IACD;;;OAGG;IACH,IAAW,WAAW;QAClB,OAAO,EAAE,CAAC;IACd,CAAC;IACD;;;;;;OAMG;IACI,KAAK,CAAC,QAAQ,CAAC,KAAsB;QAC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