@memberjunction/codegen-lib 5.0.0 → 5.1.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.
@@ -1,85 +0,0 @@
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
@@ -1 +0,0 @@
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;QACxC,yGAAyG;QACzG,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;YAClE,CAAC,CAAC,sBAAsB,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI;YACnD,CAAC,CAAC,iBAAiB,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;QAEhD,oDAAoD;QACpD,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;YACnE,CAAC,CAAC,qCAAqC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,2BAA2B;YACzF,CAAC,CAAC,EAAE,CAAC;QAET,MAAM,QAAQ,GAAG;yDACgC,KAAK,CAAC,gBAAiB,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,gBAAiB,CAAC,sBAAsB,CAAC,IAAI,EAAE;0CACtH,KAAK,CAAC,gBAAiB,CAAC,aAAa,CAAC,IAAI,EAAE;mBACnE,cAAc;iCACA,eAAe,CAAC,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE;;qBAE7D,CAAA;QACb,OAAO;YACH,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,IAAI;SAClB,CAAA;IACL,CAAC;IAED;;;;;OAKG;IACH,IAAW,UAAU;QACjB,OAAO,IAAK,CAAC;IACjB,CAAC;CACJ,CAAA;AAzDY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,sBAAa,EAAC,sEAA0C,EAAE,cAAc,CAAC;GAC7D,kCAAkC,CAyD9C"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Unit tests for database-metadata-config.json parsing logic.
3
- *
4
- * Tests the three extraction methods on ManageMetadataBase:
5
- * - extractTablesFromConfig (soft PK/FK for regular tables)
6
- * - extractVirtualEntitiesFromConfig (virtual entity definitions)
7
- * - extractISARelationshipsFromConfig (IS-A parent-child declarations)
8
- *
9
- * Also tests deriveEntityNameFromView and the interaction between sections.
10
- */
11
- export {};
12
- //# sourceMappingURL=metadataConfig.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metadataConfig.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/metadataConfig.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}