@memberjunction/ng-base-forms 4.4.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.
- package/dist/lib/__tests__/base-forms.test.js +52 -52
- package/dist/lib/__tests__/base-forms.test.js.map +1 -1
- package/dist/lib/base-form-component.d.ts +2 -2
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +1 -1
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +2 -0
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +57 -29
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-hierarchy-utils.d.ts +62 -0
- package/dist/lib/isa-related-panel/isa-hierarchy-utils.d.ts.map +1 -0
- package/dist/lib/isa-related-panel/isa-hierarchy-utils.js +135 -0
- package/dist/lib/isa-related-panel/isa-hierarchy-utils.js.map +1 -0
- package/dist/lib/isa-related-panel/isa-related-card.component.d.ts +69 -0
- package/dist/lib/isa-related-panel/isa-related-card.component.d.ts.map +1 -0
- package/dist/lib/isa-related-panel/isa-related-card.component.js +347 -0
- package/dist/lib/isa-related-panel/isa-related-card.component.js.map +1 -0
- package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts +70 -0
- package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts.map +1 -0
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +190 -0
- package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -0
- package/dist/lib/toolbar/form-toolbar.component.d.ts +38 -0
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +249 -100
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/module.d.ts +8 -6
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +14 -4
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ChangeDetectorRef, inject, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { Metadata } from '@memberjunction/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
const _forTrack0 = ($index, $item) => $item.Label;
|
|
5
|
+
const _forTrack1 = ($index, $item) => $item.EntityName;
|
|
6
|
+
function MjIsaRelatedCardComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
7
|
+
i0.ɵɵelementStart(0, "span", 5);
|
|
8
|
+
i0.ɵɵtext(1);
|
|
9
|
+
i0.ɵɵelementEnd();
|
|
10
|
+
} if (rf & 2) {
|
|
11
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
12
|
+
i0.ɵɵadvance();
|
|
13
|
+
i0.ɵɵtextInterpolate(ctx_r0.RecordName);
|
|
14
|
+
} }
|
|
15
|
+
function MjIsaRelatedCardComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵelementStart(0, "div", 7);
|
|
17
|
+
i0.ɵɵelement(1, "div", 10)(2, "div", 11);
|
|
18
|
+
i0.ɵɵelementEnd();
|
|
19
|
+
} }
|
|
20
|
+
function MjIsaRelatedCardComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
21
|
+
i0.ɵɵelementStart(0, "div", 8)(1, "span", 12);
|
|
22
|
+
i0.ɵɵtext(2, "Unable to load record");
|
|
23
|
+
i0.ɵɵelementEnd()();
|
|
24
|
+
} }
|
|
25
|
+
function MjIsaRelatedCardComponent_Conditional_11_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
26
|
+
i0.ɵɵelementStart(0, "div", 14)(1, "span", 15);
|
|
27
|
+
i0.ɵɵtext(2);
|
|
28
|
+
i0.ɵɵelementEnd();
|
|
29
|
+
i0.ɵɵelementStart(3, "span", 16);
|
|
30
|
+
i0.ɵɵtext(4);
|
|
31
|
+
i0.ɵɵelementEnd()();
|
|
32
|
+
} if (rf & 2) {
|
|
33
|
+
const field_r2 = ctx.$implicit;
|
|
34
|
+
i0.ɵɵadvance(2);
|
|
35
|
+
i0.ɵɵtextInterpolate(field_r2.Label);
|
|
36
|
+
i0.ɵɵadvance();
|
|
37
|
+
i0.ɵɵclassProp("mj-isa-card__field-value--bool-yes", field_r2.IsBooleanTrue)("mj-isa-card__field-value--bool-no", field_r2.IsBooleanFalse);
|
|
38
|
+
i0.ɵɵadvance();
|
|
39
|
+
i0.ɵɵtextInterpolate1(" ", field_r2.Value, " ");
|
|
40
|
+
} }
|
|
41
|
+
function MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
42
|
+
i0.ɵɵtext(0);
|
|
43
|
+
i0.ɵɵelement(1, "i", 20);
|
|
44
|
+
} if (rf & 2) {
|
|
45
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
46
|
+
i0.ɵɵtextInterpolate2(" Show ", ctx_r0.ExtraFields.length, " more field", ctx_r0.ExtraFields.length > 1 ? "s" : "", " ");
|
|
47
|
+
} }
|
|
48
|
+
function MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
49
|
+
i0.ɵɵtext(0, " Show fewer fields ");
|
|
50
|
+
i0.ɵɵelement(1, "i", 21);
|
|
51
|
+
} }
|
|
52
|
+
function MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_4_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
53
|
+
i0.ɵɵelementStart(0, "div", 14)(1, "span", 15);
|
|
54
|
+
i0.ɵɵtext(2);
|
|
55
|
+
i0.ɵɵelementEnd();
|
|
56
|
+
i0.ɵɵelementStart(3, "span", 16);
|
|
57
|
+
i0.ɵɵtext(4);
|
|
58
|
+
i0.ɵɵelementEnd()();
|
|
59
|
+
} if (rf & 2) {
|
|
60
|
+
const field_r4 = ctx.$implicit;
|
|
61
|
+
i0.ɵɵadvance(2);
|
|
62
|
+
i0.ɵɵtextInterpolate(field_r4.Label);
|
|
63
|
+
i0.ɵɵadvance();
|
|
64
|
+
i0.ɵɵclassProp("mj-isa-card__field-value--bool-yes", field_r4.IsBooleanTrue)("mj-isa-card__field-value--bool-no", field_r4.IsBooleanFalse);
|
|
65
|
+
i0.ɵɵadvance();
|
|
66
|
+
i0.ɵɵtextInterpolate1(" ", field_r4.Value, " ");
|
|
67
|
+
} }
|
|
68
|
+
function MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
69
|
+
i0.ɵɵelementStart(0, "div", 19);
|
|
70
|
+
i0.ɵɵrepeaterCreate(1, MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_4_For_2_Template, 5, 6, "div", 14, _forTrack0);
|
|
71
|
+
i0.ɵɵelementEnd();
|
|
72
|
+
} if (rf & 2) {
|
|
73
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
74
|
+
i0.ɵɵadvance();
|
|
75
|
+
i0.ɵɵrepeater(ctx_r0.ExtraFields);
|
|
76
|
+
} }
|
|
77
|
+
function MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
78
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
79
|
+
i0.ɵɵelementStart(0, "div", 17)(1, "button", 18);
|
|
80
|
+
i0.ɵɵlistener("click", function MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.ToggleExpand()); });
|
|
81
|
+
i0.ɵɵconditionalCreate(2, MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_2_Template, 2, 2)(3, MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_3_Template, 2, 0);
|
|
82
|
+
i0.ɵɵelementEnd()();
|
|
83
|
+
i0.ɵɵconditionalCreate(4, MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Conditional_4_Template, 3, 0, "div", 19);
|
|
84
|
+
} if (rf & 2) {
|
|
85
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
86
|
+
i0.ɵɵadvance(2);
|
|
87
|
+
i0.ɵɵconditional(!ctx_r0.Expanded ? 2 : 3);
|
|
88
|
+
i0.ɵɵadvance(2);
|
|
89
|
+
i0.ɵɵconditional(ctx_r0.Expanded ? 4 : -1);
|
|
90
|
+
} }
|
|
91
|
+
function MjIsaRelatedCardComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
92
|
+
i0.ɵɵelementStart(0, "div", 13);
|
|
93
|
+
i0.ɵɵrepeaterCreate(1, MjIsaRelatedCardComponent_Conditional_11_For_2_Template, 5, 6, "div", 14, _forTrack0);
|
|
94
|
+
i0.ɵɵelementEnd();
|
|
95
|
+
i0.ɵɵconditionalCreate(3, MjIsaRelatedCardComponent_Conditional_11_Conditional_3_Template, 5, 2);
|
|
96
|
+
} if (rf & 2) {
|
|
97
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
98
|
+
i0.ɵɵadvance();
|
|
99
|
+
i0.ɵɵrepeater(ctx_r0.DefaultFields);
|
|
100
|
+
i0.ɵɵadvance(2);
|
|
101
|
+
i0.ɵɵconditional(ctx_r0.ExtraFields.length > 0 ? 3 : -1);
|
|
102
|
+
} }
|
|
103
|
+
function MjIsaRelatedCardComponent_Conditional_12_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
104
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
105
|
+
i0.ɵɵelementStart(0, "mj-isa-related-card", 23);
|
|
106
|
+
i0.ɵɵlistener("Navigate", function MjIsaRelatedCardComponent_Conditional_12_For_2_Template_mj_isa_related_card_Navigate_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.Navigate.emit($event)); });
|
|
107
|
+
i0.ɵɵelementEnd();
|
|
108
|
+
} if (rf & 2) {
|
|
109
|
+
const child_r6 = ctx.$implicit;
|
|
110
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
111
|
+
i0.ɵɵproperty("EntityName", child_r6.EntityName)("PrimaryKey", ctx_r0.PrimaryKey)("CurrentRecordName", ctx_r0.CurrentRecordName)("Relationship", "child")("Depth", ctx_r0.Depth + 1)("Children", child_r6.Children);
|
|
112
|
+
} }
|
|
113
|
+
function MjIsaRelatedCardComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
114
|
+
i0.ɵɵelementStart(0, "div", 9);
|
|
115
|
+
i0.ɵɵrepeaterCreate(1, MjIsaRelatedCardComponent_Conditional_12_For_2_Template, 1, 6, "mj-isa-related-card", 22, _forTrack1);
|
|
116
|
+
i0.ɵɵelementEnd();
|
|
117
|
+
} if (rf & 2) {
|
|
118
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
119
|
+
i0.ɵɵadvance();
|
|
120
|
+
i0.ɵɵrepeater(ctx_r0.Children);
|
|
121
|
+
} }
|
|
122
|
+
/**
|
|
123
|
+
* Compact card showing summary fields for one IS-A related entity record
|
|
124
|
+
* (sibling or child). Displays DefaultInView fields by default with
|
|
125
|
+
* expand/collapse for remaining fields.
|
|
126
|
+
*
|
|
127
|
+
* Used inside `<mj-isa-related-panel>` to show related IS-A records
|
|
128
|
+
* alongside the main form.
|
|
129
|
+
*/
|
|
130
|
+
export class MjIsaRelatedCardComponent {
|
|
131
|
+
cdr = inject(ChangeDetectorRef);
|
|
132
|
+
/** The entity name for the related record (e.g., "Members", "Speakers") */
|
|
133
|
+
EntityName = '';
|
|
134
|
+
/** The primary key shared with the parent record */
|
|
135
|
+
PrimaryKey = null;
|
|
136
|
+
/** The record name of the current form's entity (to suppress if same) */
|
|
137
|
+
CurrentRecordName = '';
|
|
138
|
+
/** The relationship type label */
|
|
139
|
+
Relationship = 'sibling';
|
|
140
|
+
/** Depth in the IS-A hierarchy (0 = direct child/sibling, 1 = grandchild, etc.) */
|
|
141
|
+
Depth = 0;
|
|
142
|
+
/** Child items nested under this entity (rendered as sub-cards within this card) */
|
|
143
|
+
Children = [];
|
|
144
|
+
/** Emitted when user clicks "Open" to navigate to this related record */
|
|
145
|
+
Navigate = new EventEmitter();
|
|
146
|
+
// Internal state
|
|
147
|
+
EntityInfoRef = null;
|
|
148
|
+
RelatedRecord = null;
|
|
149
|
+
IsLoading = true;
|
|
150
|
+
LoadError = false;
|
|
151
|
+
Expanded = false;
|
|
152
|
+
DefaultFields = [];
|
|
153
|
+
ExtraFields = [];
|
|
154
|
+
/** Display name for the entity */
|
|
155
|
+
get DisplayName() {
|
|
156
|
+
return this.EntityInfoRef?.DisplayNameOrName ?? this.EntityName;
|
|
157
|
+
}
|
|
158
|
+
/** Icon class from entity metadata */
|
|
159
|
+
get IconClass() {
|
|
160
|
+
return this.EntityInfoRef?.Icon ?? 'fa-solid fa-link';
|
|
161
|
+
}
|
|
162
|
+
/** Record name of the related record (suppressed if same as current) */
|
|
163
|
+
get RecordName() {
|
|
164
|
+
if (!this.RelatedRecord)
|
|
165
|
+
return '';
|
|
166
|
+
const name = this.RelatedRecord.GetRecordName();
|
|
167
|
+
if (!name)
|
|
168
|
+
return '';
|
|
169
|
+
const nameStr = String(name);
|
|
170
|
+
// Suppress if same as the current form's record name
|
|
171
|
+
if (nameStr === this.CurrentRecordName)
|
|
172
|
+
return '';
|
|
173
|
+
return nameStr;
|
|
174
|
+
}
|
|
175
|
+
ngOnInit() {
|
|
176
|
+
this.LoadRelatedRecord();
|
|
177
|
+
}
|
|
178
|
+
ngOnChanges(changes) {
|
|
179
|
+
if ((changes['EntityName'] || changes['PrimaryKey']) && !changes['EntityName']?.firstChange) {
|
|
180
|
+
this.LoadRelatedRecord();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** Load the related entity record and extract field data */
|
|
184
|
+
async LoadRelatedRecord() {
|
|
185
|
+
if (!this.EntityName || !this.PrimaryKey)
|
|
186
|
+
return;
|
|
187
|
+
this.IsLoading = true;
|
|
188
|
+
this.LoadError = false;
|
|
189
|
+
this.cdr.markForCheck();
|
|
190
|
+
try {
|
|
191
|
+
const md = new Metadata();
|
|
192
|
+
this.EntityInfoRef = md.EntityByName(this.EntityName);
|
|
193
|
+
if (!this.EntityInfoRef) {
|
|
194
|
+
this.LoadError = true;
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const entity = await md.GetEntityObject(this.EntityName);
|
|
198
|
+
const loaded = await entity.InnerLoad(this.PrimaryKey);
|
|
199
|
+
if (!loaded) {
|
|
200
|
+
this.LoadError = true;
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.RelatedRecord = entity;
|
|
204
|
+
this.BuildFieldDisplayLists();
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
this.LoadError = true;
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
this.IsLoading = false;
|
|
211
|
+
this.cdr.markForCheck();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/** Split fields into DefaultInView (shown by default) and extra (hidden) */
|
|
215
|
+
BuildFieldDisplayLists() {
|
|
216
|
+
if (!this.RelatedRecord || !this.EntityInfoRef)
|
|
217
|
+
return;
|
|
218
|
+
const parentFieldNames = this.EntityInfoRef.ParentEntityFieldNames;
|
|
219
|
+
const ownFields = this.EntityInfoRef.Fields.filter(f => !f.IsPrimaryKey &&
|
|
220
|
+
!f.IsVirtual &&
|
|
221
|
+
!parentFieldNames.has(f.Name) &&
|
|
222
|
+
f.Name !== '__mj_CreatedAt' &&
|
|
223
|
+
f.Name !== '__mj_UpdatedAt' &&
|
|
224
|
+
f.IncludeInGeneratedForm);
|
|
225
|
+
const defaultFields = [];
|
|
226
|
+
const extraFields = [];
|
|
227
|
+
for (const field of ownFields) {
|
|
228
|
+
const display = this.BuildFieldDisplay(field);
|
|
229
|
+
if (field.DefaultInView) {
|
|
230
|
+
defaultFields.push(display);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
extraFields.push(display);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
this.DefaultFields = defaultFields;
|
|
237
|
+
this.ExtraFields = extraFields;
|
|
238
|
+
}
|
|
239
|
+
/** Create a display representation of a single field value */
|
|
240
|
+
BuildFieldDisplay(field) {
|
|
241
|
+
const rawValue = this.RelatedRecord.Get(field.Name);
|
|
242
|
+
const label = field.DisplayNameOrName;
|
|
243
|
+
// Handle boolean fields
|
|
244
|
+
if (field.TSType === 'boolean') {
|
|
245
|
+
return {
|
|
246
|
+
Label: label,
|
|
247
|
+
Value: rawValue ? 'Yes' : 'No',
|
|
248
|
+
IsBooleanTrue: !!rawValue,
|
|
249
|
+
IsBooleanFalse: !rawValue
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
// Format the value for display
|
|
253
|
+
return {
|
|
254
|
+
Label: label,
|
|
255
|
+
Value: this.FormatFieldValue(rawValue, field)
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/** Format a field value for compact display */
|
|
259
|
+
FormatFieldValue(value, field) {
|
|
260
|
+
if (value == null)
|
|
261
|
+
return '';
|
|
262
|
+
// Date formatting
|
|
263
|
+
if (value instanceof Date) {
|
|
264
|
+
return value.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
|
|
265
|
+
}
|
|
266
|
+
// Number formatting
|
|
267
|
+
if (typeof value === 'number') {
|
|
268
|
+
if (field.ExtendedType === 'money' || field.Type?.toLowerCase().includes('money')) {
|
|
269
|
+
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(value);
|
|
270
|
+
}
|
|
271
|
+
return value.toLocaleString();
|
|
272
|
+
}
|
|
273
|
+
return String(value);
|
|
274
|
+
}
|
|
275
|
+
/** Toggle expanded state to show/hide extra fields */
|
|
276
|
+
ToggleExpand() {
|
|
277
|
+
this.Expanded = !this.Expanded;
|
|
278
|
+
this.cdr.markForCheck();
|
|
279
|
+
}
|
|
280
|
+
/** Handle "Open" link click — emit navigation event */
|
|
281
|
+
OnOpenClick(event) {
|
|
282
|
+
event.preventDefault();
|
|
283
|
+
if (!this.PrimaryKey)
|
|
284
|
+
return;
|
|
285
|
+
this.Navigate.emit({
|
|
286
|
+
Kind: 'entity-hierarchy',
|
|
287
|
+
EntityName: this.EntityName,
|
|
288
|
+
PrimaryKey: this.PrimaryKey,
|
|
289
|
+
Direction: this.Relationship === 'sibling' ? 'child' : 'child'
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
static ɵfac = function MjIsaRelatedCardComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MjIsaRelatedCardComponent)(); };
|
|
293
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MjIsaRelatedCardComponent, selectors: [["mj-isa-related-card"]], inputs: { EntityName: "EntityName", PrimaryKey: "PrimaryKey", CurrentRecordName: "CurrentRecordName", Relationship: "Relationship", Depth: "Depth", Children: "Children" }, outputs: { Navigate: "Navigate" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature], decls: 13, vars: 14, consts: [[1, "mj-isa-card"], [1, "mj-isa-card__header"], [1, "mj-isa-card__header-left"], [1, "mj-isa-card__icon"], [1, "mj-isa-card__entity-name"], [1, "mj-isa-card__record-name"], ["href", "#", 1, "mj-isa-card__open-link", 3, "click"], [1, "mj-isa-card__body", "mj-isa-card__body--loading"], [1, "mj-isa-card__body", "mj-isa-card__body--error"], [1, "mj-isa-card__children"], [1, "mj-isa-card__loading-bar"], [1, "mj-isa-card__loading-bar", "mj-isa-card__loading-bar--short"], [1, "mj-isa-card__error-text"], [1, "mj-isa-card__body"], [1, "mj-isa-card__field"], [1, "mj-isa-card__field-label"], [1, "mj-isa-card__field-value"], [1, "mj-isa-card__expand-row"], [1, "mj-isa-card__expand-btn", 3, "click"], [1, "mj-isa-card__extra-fields"], [1, "fa-solid", "fa-chevron-down", "mj-isa-card__expand-chevron"], [1, "fa-solid", "fa-chevron-up", "mj-isa-card__expand-chevron"], [3, "EntityName", "PrimaryKey", "CurrentRecordName", "Relationship", "Depth", "Children"], [3, "Navigate", "EntityName", "PrimaryKey", "CurrentRecordName", "Relationship", "Depth", "Children"]], template: function MjIsaRelatedCardComponent_Template(rf, ctx) { if (rf & 1) {
|
|
294
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
|
|
295
|
+
i0.ɵɵelement(3, "i", 3);
|
|
296
|
+
i0.ɵɵelementStart(4, "span", 4);
|
|
297
|
+
i0.ɵɵtext(5);
|
|
298
|
+
i0.ɵɵelementEnd();
|
|
299
|
+
i0.ɵɵconditionalCreate(6, MjIsaRelatedCardComponent_Conditional_6_Template, 2, 1, "span", 5);
|
|
300
|
+
i0.ɵɵelementEnd();
|
|
301
|
+
i0.ɵɵelementStart(7, "a", 6);
|
|
302
|
+
i0.ɵɵlistener("click", function MjIsaRelatedCardComponent_Template_a_click_7_listener($event) { return ctx.OnOpenClick($event); });
|
|
303
|
+
i0.ɵɵtext(8, "Open \u2192");
|
|
304
|
+
i0.ɵɵelementEnd()();
|
|
305
|
+
i0.ɵɵconditionalCreate(9, MjIsaRelatedCardComponent_Conditional_9_Template, 3, 0, "div", 7);
|
|
306
|
+
i0.ɵɵconditionalCreate(10, MjIsaRelatedCardComponent_Conditional_10_Template, 3, 0, "div", 8);
|
|
307
|
+
i0.ɵɵconditionalCreate(11, MjIsaRelatedCardComponent_Conditional_11_Template, 4, 1);
|
|
308
|
+
i0.ɵɵconditionalCreate(12, MjIsaRelatedCardComponent_Conditional_12_Template, 3, 0, "div", 9);
|
|
309
|
+
i0.ɵɵelementEnd();
|
|
310
|
+
} if (rf & 2) {
|
|
311
|
+
i0.ɵɵclassProp("mj-isa-card--loading", ctx.IsLoading)("mj-isa-card--error", ctx.LoadError)("mj-isa-card--nested", ctx.Depth > 0);
|
|
312
|
+
i0.ɵɵadvance(3);
|
|
313
|
+
i0.ɵɵclassMap(ctx.IconClass);
|
|
314
|
+
i0.ɵɵadvance(2);
|
|
315
|
+
i0.ɵɵtextInterpolate(ctx.DisplayName);
|
|
316
|
+
i0.ɵɵadvance();
|
|
317
|
+
i0.ɵɵconditional(ctx.RecordName ? 6 : -1);
|
|
318
|
+
i0.ɵɵadvance(3);
|
|
319
|
+
i0.ɵɵconditional(ctx.IsLoading ? 9 : -1);
|
|
320
|
+
i0.ɵɵadvance();
|
|
321
|
+
i0.ɵɵconditional(ctx.LoadError && !ctx.IsLoading ? 10 : -1);
|
|
322
|
+
i0.ɵɵadvance();
|
|
323
|
+
i0.ɵɵconditional(!ctx.IsLoading && !ctx.LoadError && ctx.RelatedRecord ? 11 : -1);
|
|
324
|
+
i0.ɵɵadvance();
|
|
325
|
+
i0.ɵɵconditional(ctx.Children.length > 0 && !ctx.IsLoading ? 12 : -1);
|
|
326
|
+
} }, dependencies: [MjIsaRelatedCardComponent], styles: ["/* ============================================\n ISA RELATED CARD\n Compact summary card for one sibling/child entity\n ============================================ */\n\n.mj-isa-card {\n background: #fff;\n border-radius: 10px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-left: 3px solid #667eea;\n}\n\n/* ---- Header ---- */\n.mj-isa-card__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: #f0f1f5;\n border-bottom: 1px solid #e4e6eb;\n}\n\n.mj-isa-card__header-left {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n}\n\n.mj-isa-card__icon {\n font-size: 14px;\n color: #667eea;\n flex-shrink: 0;\n}\n\n.mj-isa-card__entity-name {\n font-size: 13px;\n font-weight: 700;\n color: #333;\n white-space: nowrap;\n}\n\n.mj-isa-card__record-name {\n font-size: 11px;\n color: #888;\n font-weight: 400;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-isa-card__open-link {\n font-size: 11px;\n color: #667eea;\n text-decoration: none;\n font-weight: 600;\n white-space: nowrap;\n flex-shrink: 0;\n}\n\n.mj-isa-card__open-link:hover {\n text-decoration: underline;\n}\n\n/* ---- Body / Fields ---- */\n.mj-isa-card__body {\n padding: 8px 14px 10px;\n}\n\n.mj-isa-card__field {\n display: flex;\n align-items: baseline;\n padding: 3px 0;\n gap: 8px;\n}\n\n.mj-isa-card__field-label {\n font-size: 11px;\n color: #999;\n width: 110px;\n flex-shrink: 0;\n}\n\n.mj-isa-card__field-value {\n font-size: 12px;\n color: #333;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.mj-isa-card__field-value--bool-yes {\n color: #2e7d32;\n}\n\n.mj-isa-card__field-value--bool-no {\n color: #c62828;\n}\n\n/* ---- Expand/Collapse ---- */\n.mj-isa-card__expand-row {\n padding: 0 14px 8px;\n}\n\n.mj-isa-card__expand-btn {\n font-size: 11px;\n color: #667eea;\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 600;\n padding: 0;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-isa-card__expand-btn:hover {\n text-decoration: underline;\n}\n\n.mj-isa-card__expand-chevron {\n font-size: 9px;\n}\n\n.mj-isa-card__extra-fields {\n padding: 0 14px 10px;\n border-top: 1px dashed #eee;\n margin-top: 4px;\n padding-top: 8px;\n}\n\n/* ---- Loading State ---- */\n.mj-isa-card__body--loading {\n padding: 12px 14px;\n}\n\n.mj-isa-card__loading-bar {\n height: 10px;\n background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);\n background-size: 200% 100%;\n animation: mj-isa-shimmer 1.5s infinite;\n border-radius: 4px;\n margin-bottom: 8px;\n width: 80%;\n}\n\n.mj-isa-card__loading-bar--short {\n width: 50%;\n}\n\n@keyframes mj-isa-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n}\n\n/* ---- Nested Sub-Cards (grandchild+ rendered inside parent card) ---- */\n.mj-isa-card__children {\n padding: 6px 10px 8px;\n border-top: 1px solid #eee;\n}\n\n.mj-isa-card--nested {\n box-shadow: none;\n border: 1px solid #e0e2e8;\n border-left: 2px solid #8b9cf0;\n border-radius: 8px;\n}\n\n.mj-isa-card--nested .mj-isa-card__header {\n padding: 6px 10px;\n background: #f5f6fa;\n border-bottom-color: #ebedf2;\n}\n\n.mj-isa-card--nested .mj-isa-card__entity-name {\n font-size: 12px;\n}\n\n.mj-isa-card--nested .mj-isa-card__icon {\n font-size: 12px;\n}\n\n.mj-isa-card--nested .mj-isa-card__body {\n padding: 6px 10px 8px;\n}\n\n.mj-isa-card--nested .mj-isa-card__field-label {\n width: 95px;\n font-size: 10px;\n}\n\n.mj-isa-card--nested .mj-isa-card__field-value {\n font-size: 11px;\n}\n\n/* ---- Error State ---- */\n.mj-isa-card__body--error {\n padding: 10px 14px;\n}\n\n.mj-isa-card__error-text {\n font-size: 11px;\n color: #999;\n font-style: italic;\n}\n"], encapsulation: 2, changeDetection: 0 });
|
|
327
|
+
}
|
|
328
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MjIsaRelatedCardComponent, [{
|
|
329
|
+
type: Component,
|
|
330
|
+
args: [{ standalone: false, selector: 'mj-isa-related-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<!-- ISA Related Card: compact summary of one sibling/child entity record -->\n<div class=\"mj-isa-card\"\n [class.mj-isa-card--loading]=\"IsLoading\"\n [class.mj-isa-card--error]=\"LoadError\"\n [class.mj-isa-card--nested]=\"Depth > 0\">\n\n <!-- Card Header -->\n <div class=\"mj-isa-card__header\">\n <div class=\"mj-isa-card__header-left\">\n <i [class]=\"IconClass\" class=\"mj-isa-card__icon\"></i>\n <span class=\"mj-isa-card__entity-name\">{{ DisplayName }}</span>\n @if (RecordName) {\n <span class=\"mj-isa-card__record-name\">{{ RecordName }}</span>\n }\n </div>\n <a href=\"#\" class=\"mj-isa-card__open-link\" (click)=\"OnOpenClick($event)\">Open →</a>\n </div>\n\n <!-- Loading State -->\n @if (IsLoading) {\n <div class=\"mj-isa-card__body mj-isa-card__body--loading\">\n <div class=\"mj-isa-card__loading-bar\"></div>\n <div class=\"mj-isa-card__loading-bar mj-isa-card__loading-bar--short\"></div>\n </div>\n }\n\n <!-- Error State -->\n @if (LoadError && !IsLoading) {\n <div class=\"mj-isa-card__body mj-isa-card__body--error\">\n <span class=\"mj-isa-card__error-text\">Unable to load record</span>\n </div>\n }\n\n <!-- Field Values -->\n @if (!IsLoading && !LoadError && RelatedRecord) {\n <div class=\"mj-isa-card__body\">\n @for (field of DefaultFields; track field.Label) {\n <div class=\"mj-isa-card__field\">\n <span class=\"mj-isa-card__field-label\">{{ field.Label }}</span>\n <span class=\"mj-isa-card__field-value\"\n [class.mj-isa-card__field-value--bool-yes]=\"field.IsBooleanTrue\"\n [class.mj-isa-card__field-value--bool-no]=\"field.IsBooleanFalse\">\n {{ field.Value }}\n </span>\n </div>\n }\n </div>\n\n <!-- Expand/Collapse for extra fields -->\n @if (ExtraFields.length > 0) {\n <div class=\"mj-isa-card__expand-row\">\n <button class=\"mj-isa-card__expand-btn\" (click)=\"ToggleExpand()\">\n @if (!Expanded) {\n Show {{ ExtraFields.length }} more field{{ ExtraFields.length > 1 ? 's' : '' }}\n <i class=\"fa-solid fa-chevron-down mj-isa-card__expand-chevron\"></i>\n } @else {\n Show fewer fields\n <i class=\"fa-solid fa-chevron-up mj-isa-card__expand-chevron\"></i>\n }\n </button>\n </div>\n\n @if (Expanded) {\n <div class=\"mj-isa-card__extra-fields\">\n @for (field of ExtraFields; track field.Label) {\n <div class=\"mj-isa-card__field\">\n <span class=\"mj-isa-card__field-label\">{{ field.Label }}</span>\n <span class=\"mj-isa-card__field-value\"\n [class.mj-isa-card__field-value--bool-yes]=\"field.IsBooleanTrue\"\n [class.mj-isa-card__field-value--bool-no]=\"field.IsBooleanFalse\">\n {{ field.Value }}\n </span>\n </div>\n }\n </div>\n }\n }\n }\n\n <!-- Nested sub-cards for IS-A children (e.g., Gold Members inside Members) -->\n @if (Children.length > 0 && !IsLoading) {\n <div class=\"mj-isa-card__children\">\n @for (child of Children; track child.EntityName) {\n <mj-isa-related-card\n [EntityName]=\"child.EntityName\"\n [PrimaryKey]=\"PrimaryKey\"\n [CurrentRecordName]=\"CurrentRecordName\"\n [Relationship]=\"'child'\"\n [Depth]=\"Depth + 1\"\n [Children]=\"child.Children\"\n (Navigate)=\"Navigate.emit($event)\">\n </mj-isa-related-card>\n }\n </div>\n }\n</div>\n", styles: ["/* ============================================\n ISA RELATED CARD\n Compact summary card for one sibling/child entity\n ============================================ */\n\n.mj-isa-card {\n background: #fff;\n border-radius: 10px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-left: 3px solid #667eea;\n}\n\n/* ---- Header ---- */\n.mj-isa-card__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: #f0f1f5;\n border-bottom: 1px solid #e4e6eb;\n}\n\n.mj-isa-card__header-left {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n}\n\n.mj-isa-card__icon {\n font-size: 14px;\n color: #667eea;\n flex-shrink: 0;\n}\n\n.mj-isa-card__entity-name {\n font-size: 13px;\n font-weight: 700;\n color: #333;\n white-space: nowrap;\n}\n\n.mj-isa-card__record-name {\n font-size: 11px;\n color: #888;\n font-weight: 400;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-isa-card__open-link {\n font-size: 11px;\n color: #667eea;\n text-decoration: none;\n font-weight: 600;\n white-space: nowrap;\n flex-shrink: 0;\n}\n\n.mj-isa-card__open-link:hover {\n text-decoration: underline;\n}\n\n/* ---- Body / Fields ---- */\n.mj-isa-card__body {\n padding: 8px 14px 10px;\n}\n\n.mj-isa-card__field {\n display: flex;\n align-items: baseline;\n padding: 3px 0;\n gap: 8px;\n}\n\n.mj-isa-card__field-label {\n font-size: 11px;\n color: #999;\n width: 110px;\n flex-shrink: 0;\n}\n\n.mj-isa-card__field-value {\n font-size: 12px;\n color: #333;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.mj-isa-card__field-value--bool-yes {\n color: #2e7d32;\n}\n\n.mj-isa-card__field-value--bool-no {\n color: #c62828;\n}\n\n/* ---- Expand/Collapse ---- */\n.mj-isa-card__expand-row {\n padding: 0 14px 8px;\n}\n\n.mj-isa-card__expand-btn {\n font-size: 11px;\n color: #667eea;\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 600;\n padding: 0;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-isa-card__expand-btn:hover {\n text-decoration: underline;\n}\n\n.mj-isa-card__expand-chevron {\n font-size: 9px;\n}\n\n.mj-isa-card__extra-fields {\n padding: 0 14px 10px;\n border-top: 1px dashed #eee;\n margin-top: 4px;\n padding-top: 8px;\n}\n\n/* ---- Loading State ---- */\n.mj-isa-card__body--loading {\n padding: 12px 14px;\n}\n\n.mj-isa-card__loading-bar {\n height: 10px;\n background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);\n background-size: 200% 100%;\n animation: mj-isa-shimmer 1.5s infinite;\n border-radius: 4px;\n margin-bottom: 8px;\n width: 80%;\n}\n\n.mj-isa-card__loading-bar--short {\n width: 50%;\n}\n\n@keyframes mj-isa-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n}\n\n/* ---- Nested Sub-Cards (grandchild+ rendered inside parent card) ---- */\n.mj-isa-card__children {\n padding: 6px 10px 8px;\n border-top: 1px solid #eee;\n}\n\n.mj-isa-card--nested {\n box-shadow: none;\n border: 1px solid #e0e2e8;\n border-left: 2px solid #8b9cf0;\n border-radius: 8px;\n}\n\n.mj-isa-card--nested .mj-isa-card__header {\n padding: 6px 10px;\n background: #f5f6fa;\n border-bottom-color: #ebedf2;\n}\n\n.mj-isa-card--nested .mj-isa-card__entity-name {\n font-size: 12px;\n}\n\n.mj-isa-card--nested .mj-isa-card__icon {\n font-size: 12px;\n}\n\n.mj-isa-card--nested .mj-isa-card__body {\n padding: 6px 10px 8px;\n}\n\n.mj-isa-card--nested .mj-isa-card__field-label {\n width: 95px;\n font-size: 10px;\n}\n\n.mj-isa-card--nested .mj-isa-card__field-value {\n font-size: 11px;\n}\n\n/* ---- Error State ---- */\n.mj-isa-card__body--error {\n padding: 10px 14px;\n}\n\n.mj-isa-card__error-text {\n font-size: 11px;\n color: #999;\n font-style: italic;\n}\n"] }]
|
|
331
|
+
}], null, { EntityName: [{
|
|
332
|
+
type: Input
|
|
333
|
+
}], PrimaryKey: [{
|
|
334
|
+
type: Input
|
|
335
|
+
}], CurrentRecordName: [{
|
|
336
|
+
type: Input
|
|
337
|
+
}], Relationship: [{
|
|
338
|
+
type: Input
|
|
339
|
+
}], Depth: [{
|
|
340
|
+
type: Input
|
|
341
|
+
}], Children: [{
|
|
342
|
+
type: Input
|
|
343
|
+
}], Navigate: [{
|
|
344
|
+
type: Output
|
|
345
|
+
}] }); })();
|
|
346
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MjIsaRelatedCardComponent, { className: "MjIsaRelatedCardComponent", filePath: "src/lib/isa-related-panel/isa-related-card.component.ts", lineNumber: 38 }); })();
|
|
347
|
+
//# sourceMappingURL=isa-related-card.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isa-related-card.component.js","sourceRoot":"","sources":["../../../src/lib/isa-related-panel/isa-related-card.component.ts","../../../src/lib/isa-related-panel/isa-related-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EACtC,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,EAChB,iBAAiB,EACpD,MAAM,eAAe,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cC;4BDzDU,yBAAyB;;iFAAzB,yBAAyB;cARrC,SAAS;6BACI,KAAK,YACP,qBAAqB,mBACd,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI;;kBAQpC,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,MAAM;;kFAtBI,yBAAyB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { BaseEntity, CompositeKey } from '@memberjunction/core';
|
|
3
|
+
import { FormNavigationEvent, EntityHierarchyNavigationEvent } from '../types/navigation-events';
|
|
4
|
+
import { IsaRelatedItem } from './isa-hierarchy-utils';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Container panel that discovers and displays IS-A related entity records
|
|
8
|
+
* (siblings and children) for the current form's record.
|
|
9
|
+
*
|
|
10
|
+
* **Placement**: Sits to the right of the main form panels inside
|
|
11
|
+
* `<mj-record-form-container>`. Hidden when in edit mode or when
|
|
12
|
+
* no related IS-A records exist.
|
|
13
|
+
*
|
|
14
|
+
* **Data flow**:
|
|
15
|
+
* - Receives the current `Record` (BaseEntity) as input
|
|
16
|
+
* - Inspects `EntityInfo.ParentEntityInfo` and `ISAChildren` to discover related records
|
|
17
|
+
* - Builds a tree structure for nested sub-card rendering
|
|
18
|
+
* - Renders an `<mj-isa-related-card>` for each root-level related entity
|
|
19
|
+
* (grandchildren render as nested sub-cards inside their parent card)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <mj-isa-related-panel
|
|
24
|
+
* [Record]="record"
|
|
25
|
+
* (Navigate)="OnNavigate($event)">
|
|
26
|
+
* </mj-isa-related-panel>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class MjIsaRelatedPanelComponent implements OnChanges {
|
|
30
|
+
private cdr;
|
|
31
|
+
/** The entity record currently displayed in the form */
|
|
32
|
+
Record: BaseEntity | null;
|
|
33
|
+
/** Whether the form is in edit mode (panel hides during edit) */
|
|
34
|
+
EditMode: boolean;
|
|
35
|
+
/** Whether the panel is collapsed (icon-only strip in full-width mode) */
|
|
36
|
+
Collapsed: boolean;
|
|
37
|
+
/** Emitted for navigation to a related record */
|
|
38
|
+
Navigate: EventEmitter<FormNavigationEvent>;
|
|
39
|
+
/** Root-level related IS-A entities to display cards for (children nested inside) */
|
|
40
|
+
RelatedItems: IsaRelatedItem[];
|
|
41
|
+
/** Whether there are any related IS-A items to show */
|
|
42
|
+
get HasItems(): boolean;
|
|
43
|
+
/** The current record's display name (to suppress in child cards when identical) */
|
|
44
|
+
get CurrentRecordName(): string;
|
|
45
|
+
/** The shared primary key for all IS-A related records */
|
|
46
|
+
get SharedPrimaryKey(): CompositeKey | null;
|
|
47
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
48
|
+
/**
|
|
49
|
+
* Discover IS-A related entities by examining the current record's
|
|
50
|
+
* entity hierarchy. Finds siblings (other children of the same parent)
|
|
51
|
+
* and all descendants (children, grandchildren, etc.) as a tree.
|
|
52
|
+
*/
|
|
53
|
+
private DiscoverRelatedItems;
|
|
54
|
+
/**
|
|
55
|
+
* When viewing a child entity (e.g., Member), find sibling entities
|
|
56
|
+
* (e.g., Speaker) that also have records with the same parent PK.
|
|
57
|
+
* Uses the parent's ISAChildren if the parent uses overlapping subtypes.
|
|
58
|
+
*/
|
|
59
|
+
private DiscoverSiblingsFromParent;
|
|
60
|
+
/**
|
|
61
|
+
* Recursively discover all IS-A descendants and build a tree structure.
|
|
62
|
+
* Root-level children appear as top-level cards; grandchildren nest inside.
|
|
63
|
+
*/
|
|
64
|
+
private DiscoverDescendants;
|
|
65
|
+
/** Relay navigation events from child cards */
|
|
66
|
+
OnCardNavigate(event: EntityHierarchyNavigationEvent): void;
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MjIsaRelatedPanelComponent, never>;
|
|
68
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MjIsaRelatedPanelComponent, "mj-isa-related-panel", never, { "Record": { "alias": "Record"; "required": false; }; "EditMode": { "alias": "EditMode"; "required": false; }; "Collapsed": { "alias": "Collapsed"; "required": false; }; }, { "Navigate": "Navigate"; }, never, never, false, never>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=isa-related-panel.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isa-related-panel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/isa-related-panel/isa-related-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EAEtC,SAAS,EAAE,aAAa,EACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAc,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAA+C,cAAc,EAAE,MAAM,uBAAuB,CAAC;;AAEpG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAQa,0BAA2B,YAAW,SAAS;IAC1D,OAAO,CAAC,GAAG,CAA6B;IAExC,wDAAwD;IAC/C,MAAM,EAAE,UAAU,GAAG,IAAI,CAAQ;IAE1C,iEAAiE;IACxD,QAAQ,UAAS;IAE1B,0EAA0E;IACjE,SAAS,UAAS;IAE3B,iDAAiD;IACvC,QAAQ,oCAA2C;IAE7D,qFAAqF;IACrF,YAAY,EAAE,cAAc,EAAE,CAAM;IAEpC,uDAAuD;IACvD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,oFAAoF;IACpF,IAAI,iBAAiB,IAAI,MAAM,CAI9B;IAED,0DAA0D;IAC1D,IAAI,gBAAgB,IAAI,YAAY,GAAG,IAAI,CAE1C;IAED,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAMzC;;;;OAIG;YACW,oBAAoB;IAqBlC;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAuBlC;;;OAGG;YACW,mBAAmB;IAQjC,+CAA+C;IAC/C,cAAc,CAAC,KAAK,EAAE,8BAA8B,GAAG,IAAI;yCA5GhD,0BAA0B;2CAA1B,0BAA0B;CA+GtC"}
|