@memberjunction/ng-core-entity-forms 5.38.0 → 5.40.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.
Files changed (154) hide show
  1. package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
  2. package/dist/lib/custom/AIAgents/ai-agent-form.component.js +14 -7
  3. package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
  4. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts +17 -0
  5. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts.map +1 -1
  6. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +695 -557
  7. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -1
  8. package/dist/lib/custom/Actions/action-execution-log-form.component.js +2 -2
  9. package/dist/lib/custom/Actions/action-form.component.js +2 -2
  10. package/dist/lib/custom/Entities/entity-form.component.js +4 -4
  11. package/dist/lib/custom/Entities/entity-form.component.js.map +1 -1
  12. package/dist/lib/custom/Queries/query-form.component.d.ts +13 -4
  13. package/dist/lib/custom/Queries/query-form.component.d.ts.map +1 -1
  14. package/dist/lib/custom/Queries/query-form.component.js +374 -326
  15. package/dist/lib/custom/Queries/query-form.component.js.map +1 -1
  16. package/dist/lib/custom/Tests/test-form.component.js +2 -3
  17. package/dist/lib/custom/Tests/test-form.component.js.map +1 -1
  18. package/dist/lib/custom/Tests/test-suite-form.component.js +1 -2
  19. package/dist/lib/custom/Tests/test-suite-form.component.js.map +1 -1
  20. package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts +24 -0
  21. package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts.map +1 -1
  22. package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js +411 -234
  23. package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js.map +1 -1
  24. package/dist/lib/custom/ai-agent-run/ai-agent-run-visualization.component.js +2 -2
  25. package/dist/lib/custom/ai-agent-run/ai-agent-run-visualization.component.js.map +1 -1
  26. package/dist/lib/custom/custom-forms.module.d.ts +39 -41
  27. package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
  28. package/dist/lib/custom/custom-forms.module.js +8 -9
  29. package/dist/lib/custom/custom-forms.module.js.map +1 -1
  30. package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js +75 -69
  31. package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js.map +1 -1
  32. package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js +3 -3
  33. package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js.map +1 -1
  34. package/dist/lib/generated/Entities/MJAIModelCost/mjaimodelcost.form.component.js +10 -6
  35. package/dist/lib/generated/Entities/MJAIModelCost/mjaimodelcost.form.component.js.map +1 -1
  36. package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.js +3 -3
  37. package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.js.map +1 -1
  38. package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.d.ts.map +1 -1
  39. package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.js +65 -39
  40. package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.js.map +1 -1
  41. package/dist/lib/generated/Entities/MJAPIKey/mjapikey.form.component.d.ts.map +1 -1
  42. package/dist/lib/generated/Entities/MJAPIKey/mjapikey.form.component.js +29 -21
  43. package/dist/lib/generated/Entities/MJAPIKey/mjapikey.form.component.js.map +1 -1
  44. package/dist/lib/generated/Entities/MJApplication/mjapplication.form.component.d.ts.map +1 -1
  45. package/dist/lib/generated/Entities/MJApplication/mjapplication.form.component.js +47 -11
  46. package/dist/lib/generated/Entities/MJApplication/mjapplication.form.component.js.map +1 -1
  47. package/dist/lib/generated/Entities/MJArtifact/mjartifact.form.component.d.ts.map +1 -1
  48. package/dist/lib/generated/Entities/MJArtifact/mjartifact.form.component.js +24 -6
  49. package/dist/lib/generated/Entities/MJArtifact/mjartifact.form.component.js.map +1 -1
  50. package/dist/lib/generated/Entities/MJArtifactVersion/mjartifactversion.form.component.d.ts.map +1 -1
  51. package/dist/lib/generated/Entities/MJArtifactVersion/mjartifactversion.form.component.js +27 -9
  52. package/dist/lib/generated/Entities/MJArtifactVersion/mjartifactversion.form.component.js.map +1 -1
  53. package/dist/lib/generated/Entities/MJClusterAnalysis/mjclusteranalysis.form.component.d.ts +10 -0
  54. package/dist/lib/generated/Entities/MJClusterAnalysis/mjclusteranalysis.form.component.d.ts.map +1 -0
  55. package/dist/lib/generated/Entities/MJClusterAnalysis/mjclusteranalysis.form.component.js +93 -0
  56. package/dist/lib/generated/Entities/MJClusterAnalysis/mjclusteranalysis.form.component.js.map +1 -0
  57. package/dist/lib/generated/Entities/MJClusterAnalysisCluster/mjclusteranalysiscluster.form.component.d.ts +10 -0
  58. package/dist/lib/generated/Entities/MJClusterAnalysisCluster/mjclusteranalysiscluster.form.component.d.ts.map +1 -0
  59. package/dist/lib/generated/Entities/MJClusterAnalysisCluster/mjclusteranalysiscluster.form.component.js +66 -0
  60. package/dist/lib/generated/Entities/MJClusterAnalysisCluster/mjclusteranalysiscluster.form.component.js.map +1 -0
  61. package/dist/lib/generated/Entities/MJCompany/mjcompany.form.component.d.ts.map +1 -1
  62. package/dist/lib/generated/Entities/MJCompany/mjcompany.form.component.js +27 -9
  63. package/dist/lib/generated/Entities/MJCompany/mjcompany.form.component.js.map +1 -1
  64. package/dist/lib/generated/Entities/MJContentItemTag/mjcontentitemtag.form.component.d.ts.map +1 -1
  65. package/dist/lib/generated/Entities/MJContentItemTag/mjcontentitemtag.form.component.js +13 -3
  66. package/dist/lib/generated/Entities/MJContentItemTag/mjcontentitemtag.form.component.js.map +1 -1
  67. package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.d.ts.map +1 -1
  68. package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.js +29 -11
  69. package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.js.map +1 -1
  70. package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.d.ts.map +1 -1
  71. package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js +100 -64
  72. package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js.map +1 -1
  73. package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.d.ts.map +1 -1
  74. package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.js +58 -24
  75. package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.js.map +1 -1
  76. package/dist/lib/generated/Entities/MJIntegrationObjectField/mjintegrationobjectfield.form.component.js +10 -8
  77. package/dist/lib/generated/Entities/MJIntegrationObjectField/mjintegrationobjectfield.form.component.js.map +1 -1
  78. package/dist/lib/generated/Entities/MJMagicLinkInvite/mjmagiclinkinvite.form.component.d.ts +10 -0
  79. package/dist/lib/generated/Entities/MJMagicLinkInvite/mjmagiclinkinvite.form.component.d.ts.map +1 -0
  80. package/dist/lib/generated/Entities/MJMagicLinkInvite/mjmagiclinkinvite.form.component.js +173 -0
  81. package/dist/lib/generated/Entities/MJMagicLinkInvite/mjmagiclinkinvite.form.component.js.map +1 -0
  82. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedDomain/mjmagiclinkinvitealloweddomain.form.component.d.ts +10 -0
  83. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedDomain/mjmagiclinkinvitealloweddomain.form.component.d.ts.map +1 -0
  84. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedDomain/mjmagiclinkinvitealloweddomain.form.component.js +58 -0
  85. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedDomain/mjmagiclinkinvitealloweddomain.form.component.js.map +1 -0
  86. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedPath/mjmagiclinkinviteallowedpath.form.component.d.ts +10 -0
  87. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedPath/mjmagiclinkinviteallowedpath.form.component.d.ts.map +1 -0
  88. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedPath/mjmagiclinkinviteallowedpath.form.component.js +58 -0
  89. package/dist/lib/generated/Entities/MJMagicLinkInviteAllowedPath/mjmagiclinkinviteallowedpath.form.component.js.map +1 -0
  90. package/dist/lib/generated/Entities/MJMagicLinkInviteApplication/mjmagiclinkinviteapplication.form.component.d.ts +10 -0
  91. package/dist/lib/generated/Entities/MJMagicLinkInviteApplication/mjmagiclinkinviteapplication.form.component.d.ts.map +1 -0
  92. package/dist/lib/generated/Entities/MJMagicLinkInviteApplication/mjmagiclinkinviteapplication.form.component.js +58 -0
  93. package/dist/lib/generated/Entities/MJMagicLinkInviteApplication/mjmagiclinkinviteapplication.form.component.js.map +1 -0
  94. package/dist/lib/generated/Entities/MJMagicLinkInviteRole/mjmagiclinkinviterole.form.component.d.ts +10 -0
  95. package/dist/lib/generated/Entities/MJMagicLinkInviteRole/mjmagiclinkinviterole.form.component.d.ts.map +1 -0
  96. package/dist/lib/generated/Entities/MJMagicLinkInviteRole/mjmagiclinkinviterole.form.component.js +58 -0
  97. package/dist/lib/generated/Entities/MJMagicLinkInviteRole/mjmagiclinkinviterole.form.component.js.map +1 -0
  98. package/dist/lib/generated/Entities/MJMagicLinkRedemption/mjmagiclinkredemption.form.component.d.ts +10 -0
  99. package/dist/lib/generated/Entities/MJMagicLinkRedemption/mjmagiclinkredemption.form.component.d.ts.map +1 -0
  100. package/dist/lib/generated/Entities/MJMagicLinkRedemption/mjmagiclinkredemption.form.component.js +68 -0
  101. package/dist/lib/generated/Entities/MJMagicLinkRedemption/mjmagiclinkredemption.form.component.js.map +1 -0
  102. package/dist/lib/generated/Entities/MJResourceType/mjresourcetype.form.component.d.ts.map +1 -1
  103. package/dist/lib/generated/Entities/MJResourceType/mjresourcetype.form.component.js +26 -8
  104. package/dist/lib/generated/Entities/MJResourceType/mjresourcetype.form.component.js.map +1 -1
  105. package/dist/lib/generated/Entities/MJRole/mjrole.form.component.d.ts.map +1 -1
  106. package/dist/lib/generated/Entities/MJRole/mjrole.form.component.js +52 -16
  107. package/dist/lib/generated/Entities/MJRole/mjrole.form.component.js.map +1 -1
  108. package/dist/lib/generated/Entities/MJScheduledJob/mjscheduledjob.form.component.js +27 -25
  109. package/dist/lib/generated/Entities/MJScheduledJob/mjscheduledjob.form.component.js.map +1 -1
  110. package/dist/lib/generated/Entities/MJSignatureAccount/mjsignatureaccount.form.component.d.ts +10 -0
  111. package/dist/lib/generated/Entities/MJSignatureAccount/mjsignatureaccount.form.component.d.ts.map +1 -0
  112. package/dist/lib/generated/Entities/MJSignatureAccount/mjsignatureaccount.form.component.js +115 -0
  113. package/dist/lib/generated/Entities/MJSignatureAccount/mjsignatureaccount.form.component.js.map +1 -0
  114. package/dist/lib/generated/Entities/MJSignatureProvider/mjsignatureprovider.form.component.d.ts +10 -0
  115. package/dist/lib/generated/Entities/MJSignatureProvider/mjsignatureprovider.form.component.d.ts.map +1 -0
  116. package/dist/lib/generated/Entities/MJSignatureProvider/mjsignatureprovider.form.component.js +101 -0
  117. package/dist/lib/generated/Entities/MJSignatureProvider/mjsignatureprovider.form.component.js.map +1 -0
  118. package/dist/lib/generated/Entities/MJSignatureRequest/mjsignaturerequest.form.component.d.ts +10 -0
  119. package/dist/lib/generated/Entities/MJSignatureRequest/mjsignaturerequest.form.component.d.ts.map +1 -0
  120. package/dist/lib/generated/Entities/MJSignatureRequest/mjsignaturerequest.form.component.js +153 -0
  121. package/dist/lib/generated/Entities/MJSignatureRequest/mjsignaturerequest.form.component.js.map +1 -0
  122. package/dist/lib/generated/Entities/MJSignatureRequestDocument/mjsignaturerequestdocument.form.component.d.ts +10 -0
  123. package/dist/lib/generated/Entities/MJSignatureRequestDocument/mjsignaturerequestdocument.form.component.d.ts.map +1 -0
  124. package/dist/lib/generated/Entities/MJSignatureRequestDocument/mjsignaturerequestdocument.form.component.js +78 -0
  125. package/dist/lib/generated/Entities/MJSignatureRequestDocument/mjsignaturerequestdocument.form.component.js.map +1 -0
  126. package/dist/lib/generated/Entities/MJSignatureRequestLog/mjsignaturerequestlog.form.component.d.ts +10 -0
  127. package/dist/lib/generated/Entities/MJSignatureRequestLog/mjsignaturerequestlog.form.component.d.ts.map +1 -0
  128. package/dist/lib/generated/Entities/MJSignatureRequestLog/mjsignaturerequestlog.form.component.js +84 -0
  129. package/dist/lib/generated/Entities/MJSignatureRequestLog/mjsignaturerequestlog.form.component.js.map +1 -0
  130. package/dist/lib/generated/Entities/MJSignatureRequestRecipient/mjsignaturerequestrecipient.form.component.d.ts +10 -0
  131. package/dist/lib/generated/Entities/MJSignatureRequestRecipient/mjsignaturerequestrecipient.form.component.d.ts.map +1 -0
  132. package/dist/lib/generated/Entities/MJSignatureRequestRecipient/mjsignaturerequestrecipient.form.component.js +88 -0
  133. package/dist/lib/generated/Entities/MJSignatureRequestRecipient/mjsignaturerequestrecipient.form.component.js.map +1 -0
  134. package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.js +8 -6
  135. package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.js.map +1 -1
  136. package/dist/lib/generated/Entities/MJUser/mjuser.form.component.d.ts.map +1 -1
  137. package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js +156 -102
  138. package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js.map +1 -1
  139. package/dist/lib/generated/Entities/MJUserView/mjuserview.form.component.d.ts.map +1 -1
  140. package/dist/lib/generated/Entities/MJUserView/mjuserview.form.component.js +34 -26
  141. package/dist/lib/generated/Entities/MJUserView/mjuserview.form.component.js.map +1 -1
  142. package/dist/lib/generated/Entities/MJViewType/mjviewtype.form.component.d.ts +10 -0
  143. package/dist/lib/generated/Entities/MJViewType/mjviewtype.form.component.d.ts.map +1 -0
  144. package/dist/lib/generated/Entities/MJViewType/mjviewtype.form.component.js +91 -0
  145. package/dist/lib/generated/Entities/MJViewType/mjviewtype.form.component.js.map +1 -0
  146. package/dist/lib/generated/generated-forms.module.d.ts +265 -250
  147. package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
  148. package/dist/lib/generated/generated-forms.module.js +224 -179
  149. package/dist/lib/generated/generated-forms.module.js.map +1 -1
  150. package/package.json +36 -36
  151. package/dist/lib/custom/Queries/query-category-dialog.component.d.ts +0 -34
  152. package/dist/lib/custom/Queries/query-category-dialog.component.d.ts.map +0 -1
  153. package/dist/lib/custom/Queries/query-category-dialog.component.js +0 -203
  154. package/dist/lib/custom/Queries/query-category-dialog.component.js.map +0 -1
@@ -1,203 +0,0 @@
1
- import { Component, Input, Output, EventEmitter } from '@angular/core';
2
- import { QueryEngine } from '@memberjunction/core-entities';
3
- import { MJNotificationService } from '@memberjunction/ng-notifications';
4
- import { BaseAngularComponent } from '@memberjunction/ng-base-types';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@angular/forms";
7
- import * as i2 from "@memberjunction/ng-ui-components";
8
- function QueryCategoryDialogComponent_Conditional_0_Conditional_18_Template(rf, ctx) { if (rf & 1) {
9
- i0.ɵɵelementStart(0, "div", 14);
10
- i0.ɵɵelement(1, "i", 18);
11
- i0.ɵɵtext(2);
12
- i0.ɵɵelementEnd();
13
- } if (rf & 2) {
14
- const ctx_r1 = i0.ɵɵnextContext(2);
15
- i0.ɵɵadvance(2);
16
- i0.ɵɵtextInterpolate1(" Full path: ", ctx_r1.getFullPath(), " ");
17
- } }
18
- function QueryCategoryDialogComponent_Conditional_0_Conditional_24_Template(rf, ctx) { if (rf & 1) {
19
- i0.ɵɵelement(0, "i", 19);
20
- i0.ɵɵtext(1, " Creating... ");
21
- } }
22
- function QueryCategoryDialogComponent_Conditional_0_Conditional_25_Template(rf, ctx) { if (rf & 1) {
23
- i0.ɵɵelement(0, "i", 20);
24
- i0.ɵɵtext(1, " Create Category ");
25
- } }
26
- function QueryCategoryDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
27
- const _r1 = i0.ɵɵgetCurrentView();
28
- i0.ɵɵelementStart(0, "mj-dialog", 1);
29
- i0.ɵɵlistener("Close", function QueryCategoryDialogComponent_Conditional_0_Template_mj_dialog_Close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.close()); });
30
- i0.ɵɵelementStart(1, "mj-dialog-titlebar")(2, "div", 2);
31
- i0.ɵɵelement(3, "i", 3);
32
- i0.ɵɵtext(4, " Create New Query Category ");
33
- i0.ɵɵelementEnd()();
34
- i0.ɵɵelementStart(5, "div", 4)(6, "div", 5)(7, "label", 6);
35
- i0.ɵɵelement(8, "i", 7);
36
- i0.ɵɵtext(9, " Category Name ");
37
- i0.ɵɵelementStart(10, "span", 8);
38
- i0.ɵɵtext(11, "*");
39
- i0.ɵɵelementEnd()();
40
- i0.ɵɵelementStart(12, "input", 9);
41
- i0.ɵɵtwoWayListener("ngModelChange", function QueryCategoryDialogComponent_Conditional_0_Template_input_ngModelChange_12_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.categoryName, $event) || (ctx_r1.categoryName = $event); return i0.ɵɵresetView($event); });
42
- i0.ɵɵelementEnd()();
43
- i0.ɵɵelementStart(13, "div", 10)(14, "label", 11);
44
- i0.ɵɵelement(15, "i", 12);
45
- i0.ɵɵtext(16, " Parent Category (Optional) ");
46
- i0.ɵɵelementEnd();
47
- i0.ɵɵelementStart(17, "mj-dropdown", 13);
48
- i0.ɵɵtwoWayListener("ngModelChange", function QueryCategoryDialogComponent_Conditional_0_Template_mj_dropdown_ngModelChange_17_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedParentId, $event) || (ctx_r1.selectedParentId = $event); return i0.ɵɵresetView($event); });
49
- i0.ɵɵelementEnd();
50
- i0.ɵɵconditionalCreate(18, QueryCategoryDialogComponent_Conditional_0_Conditional_18_Template, 3, 1, "div", 14);
51
- i0.ɵɵelementEnd()();
52
- i0.ɵɵelementStart(19, "mj-dialog-actions")(20, "button", 15);
53
- i0.ɵɵlistener("click", function QueryCategoryDialogComponent_Conditional_0_Template_button_click_20_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.close()); });
54
- i0.ɵɵelement(21, "i", 16);
55
- i0.ɵɵtext(22, " Cancel ");
56
- i0.ɵɵelementEnd();
57
- i0.ɵɵelementStart(23, "button", 17);
58
- i0.ɵɵlistener("click", function QueryCategoryDialogComponent_Conditional_0_Template_button_click_23_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.createCategory()); });
59
- i0.ɵɵconditionalCreate(24, QueryCategoryDialogComponent_Conditional_0_Conditional_24_Template, 2, 0)(25, QueryCategoryDialogComponent_Conditional_0_Conditional_25_Template, 2, 0);
60
- i0.ɵɵelementEnd()()();
61
- } if (rf & 2) {
62
- const ctx_r1 = i0.ɵɵnextContext();
63
- i0.ɵɵproperty("Visible", true)("Width", 500);
64
- i0.ɵɵadvance(12);
65
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.categoryName);
66
- i0.ɵɵadvance(5);
67
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedParentId);
68
- i0.ɵɵproperty("Data", ctx_r1.flattenedCategories)("ValuePrimitive", true);
69
- i0.ɵɵadvance();
70
- i0.ɵɵconditional(ctx_r1.selectedParentId ? 18 : -1);
71
- i0.ɵɵadvance(5);
72
- i0.ɵɵproperty("disabled", !ctx_r1.categoryName.trim() || ctx_r1.isCreating);
73
- i0.ɵɵadvance();
74
- i0.ɵɵconditional(ctx_r1.isCreating ? 24 : 25);
75
- } }
76
- export class QueryCategoryDialogComponent extends BaseAngularComponent {
77
- constructor() {
78
- super(...arguments);
79
- this.isVisible = false;
80
- this.isVisibleChange = new EventEmitter();
81
- this.onCategoryCreated = new EventEmitter();
82
- this.categoryName = '';
83
- this.selectedParentId = null;
84
- this.categories = [];
85
- this.categoryTree = [];
86
- this.flattenedCategories = [];
87
- this.isCreating = false;
88
- }
89
- ngOnInit() {
90
- this.loadCategories();
91
- }
92
- loadCategories() {
93
- this.categories = QueryEngine.Instance.Categories;
94
- this.categoryTree = this.buildCategoryTree(this.categories);
95
- this.flattenedCategories = this.flattenCategories(this.categoryTree, 0);
96
- }
97
- buildCategoryTree(categories) {
98
- const categoryMap = new Map();
99
- const rootCategories = [];
100
- // Create nodes for all categories
101
- categories.forEach(cat => {
102
- categoryMap.set(cat.ID, {
103
- id: cat.ID,
104
- name: cat.Name,
105
- fullPath: cat.Name,
106
- children: [],
107
- level: 0
108
- });
109
- });
110
- // Build the tree structure
111
- categories.forEach(cat => {
112
- const node = categoryMap.get(cat.ID);
113
- if (cat.ParentID && categoryMap.has(cat.ParentID)) {
114
- const parent = categoryMap.get(cat.ParentID);
115
- parent.children.push(node);
116
- node.fullPath = `${parent.fullPath} / ${node.name}`;
117
- }
118
- else {
119
- rootCategories.push(node);
120
- }
121
- });
122
- // Sort children alphabetically
123
- const sortNodes = (nodes) => {
124
- nodes.sort((a, b) => a.name.localeCompare(b.name));
125
- nodes.forEach(node => sortNodes(node.children));
126
- };
127
- sortNodes(rootCategories);
128
- return rootCategories;
129
- }
130
- flattenCategories(nodes, level) {
131
- const result = [];
132
- nodes.forEach(node => {
133
- node.level = level;
134
- result.push(node);
135
- if (node.children.length > 0) {
136
- result.push(...this.flattenCategories(node.children, level + 1));
137
- }
138
- });
139
- return result;
140
- }
141
- async createCategory() {
142
- if (!this.categoryName.trim()) {
143
- MJNotificationService.Instance.CreateSimpleNotification('Please enter a category name', 'warning');
144
- return;
145
- }
146
- this.isCreating = true;
147
- try {
148
- const md = this.ProviderToUse;
149
- const newCategory = await md.GetEntityObject('MJ: Query Categories');
150
- newCategory.Name = this.categoryName.trim();
151
- newCategory.ParentID = this.selectedParentId;
152
- newCategory.UserID = md.CurrentUser.ID;
153
- const saved = await newCategory.Save();
154
- if (saved) {
155
- MJNotificationService.Instance.CreateSimpleNotification('Category created successfully', 'success');
156
- this.onCategoryCreated.emit(newCategory);
157
- this.close();
158
- }
159
- else {
160
- MJNotificationService.Instance.CreateSimpleNotification(`Failed to create category: ${newCategory.LatestResult?.Message || 'Unknown error'}`, 'error');
161
- }
162
- }
163
- catch (error) {
164
- console.error('Error creating category:', error);
165
- MJNotificationService.Instance.CreateSimpleNotification('Error creating category', 'error');
166
- }
167
- finally {
168
- this.isCreating = false;
169
- }
170
- }
171
- close() {
172
- this.categoryName = '';
173
- this.selectedParentId = null;
174
- this.isVisible = false;
175
- this.isVisibleChange.emit(false);
176
- }
177
- getCategoryIndent(category) {
178
- return `${category.level * 20}px`;
179
- }
180
- getFullPath() {
181
- const parent = this.flattenedCategories.find(c => c.id === this.selectedParentId);
182
- const name = this.categoryName || 'New Category';
183
- return parent ? `${parent.fullPath} / ${name}` : name;
184
- }
185
- static { this.ɵfac = /*@__PURE__*/ (() => { let ɵQueryCategoryDialogComponent_BaseFactory; return function QueryCategoryDialogComponent_Factory(__ngFactoryType__) { return (ɵQueryCategoryDialogComponent_BaseFactory || (ɵQueryCategoryDialogComponent_BaseFactory = i0.ɵɵgetInheritedFactory(QueryCategoryDialogComponent)))(__ngFactoryType__ || QueryCategoryDialogComponent); }; })(); }
186
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCategoryDialogComponent, selectors: [["mj-query-category-dialog"]], inputs: { isVisible: "isVisible" }, outputs: { isVisibleChange: "isVisibleChange", onCategoryCreated: "onCategoryCreated" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[3, "Visible", "Width"], [3, "Close", "Visible", "Width"], [2, "display", "flex", "align-items", "center", "gap", "8px"], [1, "fa-solid", "fa-folder-plus", 2, "color", "#28a745"], [2, "padding", "20px"], [1, "form-group", 2, "margin-bottom", "20px"], ["for", "categoryName", 2, "display", "block", "margin-bottom", "8px", "font-weight", "600", "color", "var(--mj-text-secondary)"], [1, "fa-solid", "fa-tag"], [2, "color", "#dc3545"], ["name", "categoryName", "placeholder", "Enter category name...", 1, "mj-input", 2, "width", "100%", 3, "ngModelChange", "ngModel"], [1, "form-group"], ["for", "parentCategory", 2, "display", "block", "margin-bottom", "8px", "font-weight", "600", "color", "var(--mj-text-secondary)"], [1, "fa-solid", "fa-folder-tree"], ["name", "parentCategory", "TextField", "name", "ValueField", "id", "Placeholder", "-- No Parent (Top Level) --", 2, "width", "100%", 3, "ngModelChange", "ngModel", "Data", "ValuePrimitive"], [2, "margin-top", "8px", "padding", "8px", "background", "var(--mj-bg-surface-sunken)", "border-radius", "4px", "font-size", "0.85em", "color", "var(--mj-text-muted)"], ["mjButton", "", 3, "click"], [1, "fa-solid", "fa-times"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], [1, "fa-solid", "fa-info-circle"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-check"]], template: function QueryCategoryDialogComponent_Template(rf, ctx) { if (rf & 1) {
187
- i0.ɵɵconditionalCreate(0, QueryCategoryDialogComponent_Conditional_0_Template, 26, 9, "mj-dialog", 0);
188
- } if (rf & 2) {
189
- i0.ɵɵconditional(ctx.isVisible ? 0 : -1);
190
- } }, dependencies: [i1.DefaultValueAccessor, i1.NgControlStatus, i1.NgModel, i2.MJButtonDirective, i2.MJDropdownComponent, i2.MJDialogComponent, i2.MJDialogTitlebarComponent, i2.MJDialogActionsComponent], styles: ["\n\n.form-group[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.form-group[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n display: block;\n margin-bottom: 8px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n}\n\n .k-dialog {\n border-radius: var(--mj-radius-md);\n box-shadow: var(--mj-shadow-lg);\n}\n\n .k-dialog-titlebar {\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-strong);\n padding: 16px 20px;\n}\n\n .k-dialog-content {\n padding: 0;\n}"] }); }
191
- }
192
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryCategoryDialogComponent, [{
193
- type: Component,
194
- args: [{ standalone: false, selector: 'mj-query-category-dialog', template: "@if (isVisible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"500\"\n (Close)=\"close()\">\n <mj-dialog-titlebar>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <i class=\"fa-solid fa-folder-plus\" style=\"color: #28a745;\"></i>\n Create New Query Category\n </div>\n </mj-dialog-titlebar>\n <div style=\"padding: 20px;\">\n <div class=\"form-group\" style=\"margin-bottom: 20px;\">\n <label for=\"categoryName\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-tag\"></i> Category Name <span style=\"color: #dc3545;\">*</span>\n </label>\n <input class=\"mj-input\"\n [(ngModel)]=\"categoryName\"\n name=\"categoryName\"\n placeholder=\"Enter category name...\"\n style=\"width: 100%;\" />\n </div>\n <div class=\"form-group\">\n <label for=\"parentCategory\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-folder-tree\"></i> Parent Category (Optional)\n </label>\n <mj-dropdown\n [(ngModel)]=\"selectedParentId\"\n name=\"parentCategory\"\n [Data]=\"flattenedCategories\"\n TextField=\"name\"\n ValueField=\"id\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"-- No Parent (Top Level) --\"\n style=\"width: 100%;\">\n </mj-dropdown>\n @if (selectedParentId) {\n <div style=\"margin-top: 8px; padding: 8px; background: var(--mj-bg-surface-sunken); border-radius: 4px; font-size: 0.85em; color: var(--mj-text-muted);\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Full path: {{ getFullPath() }}\n </div>\n }\n </div>\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"close()\">\n <i class=\"fa-solid fa-times\"></i> Cancel\n </button>\n <button mjButton\n variant=\"primary\"\n [disabled]=\"!categoryName.trim() || isCreating\"\n (click)=\"createCategory()\">\n @if (isCreating) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i> Creating...\n } @else {\n <i class=\"fa-solid fa-check\"></i> Create Category\n }\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n", styles: ["/* Category Dialog Styles */\n.form-group {\n margin-bottom: 20px;\n}\n\n.form-group label {\n display: block;\n margin-bottom: 8px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n}\n\n::ng-deep .k-dialog {\n border-radius: var(--mj-radius-md);\n box-shadow: var(--mj-shadow-lg);\n}\n\n::ng-deep .k-dialog-titlebar {\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-strong);\n padding: 16px 20px;\n}\n\n::ng-deep .k-dialog-content {\n padding: 0;\n}\n"] }]
195
- }], null, { isVisible: [{
196
- type: Input
197
- }], isVisibleChange: [{
198
- type: Output
199
- }], onCategoryCreated: [{
200
- type: Output
201
- }] }); })();
202
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCategoryDialogComponent, { className: "QueryCategoryDialogComponent", filePath: "src/lib/custom/Queries/query-category-dialog.component.ts", lineNumber: 20 }); })();
203
- //# sourceMappingURL=query-category-dialog.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-category-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/Queries/query-category-dialog.component.ts","../../../../src/lib/custom/Queries/query-category-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAyB,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,oB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L,CAAC;IAED,KAAK;QACD,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,iBAAiB,CAAC,QAAsB;QACpC,OAAO,GAAG,QAAQ,CAAC,KAAK,GAAG,EAAE,IAAI,CAAC;IACtC,CAAC;IAED,WAAW;QACP,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAClF,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,IAAI,cAAc,CAAC;QACjD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,CAAC;oSAlIQ,4BAA4B,yBAA5B,4BAA4B;oEAA5B,4BAA4B;YCnBzC,qGAAiB;;YAAjB,wCA4DC;;;iFDzCY,4BAA4B;cANxC,SAAS;6BACI,KAAK,YACL,0BAA0B;;kBAKnC,KAAK;;kBACL,MAAM;;kBACN,MAAM;;kFAHE,4BAA4B","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { MJQueryCategoryEntity, QueryEngine } from '@memberjunction/core-entities';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\n\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\ninterface CategoryNode {\n id: string;\n name: string;\n fullPath: string;\n children: CategoryNode[];\n level: number;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-query-category-dialog',\n templateUrl: './query-category-dialog.component.html',\n styleUrls: ['./query-category-dialog.component.css']\n})\nexport class QueryCategoryDialogComponent extends BaseAngularComponent implements OnInit {\n @Input() isVisible = false;\n @Output() isVisibleChange = new EventEmitter<boolean>();\n @Output() onCategoryCreated = new EventEmitter<MJQueryCategoryEntity>();\n \n public categoryName = '';\n public selectedParentId: string | null = null;\n public categories: MJQueryCategoryEntity[] = [];\n public categoryTree: CategoryNode[] = [];\n public flattenedCategories: CategoryNode[] = [];\n public isCreating = false;\n \n ngOnInit() {\n this.loadCategories();\n }\n \n loadCategories() {\n this.categories = QueryEngine.Instance.Categories;\n this.categoryTree = this.buildCategoryTree(this.categories);\n this.flattenedCategories = this.flattenCategories(this.categoryTree, 0);\n }\n \n private buildCategoryTree(categories: MJQueryCategoryEntity[]): CategoryNode[] {\n const categoryMap = new Map<string, CategoryNode>();\n const rootCategories: CategoryNode[] = [];\n \n // Create nodes for all categories\n categories.forEach(cat => {\n categoryMap.set(cat.ID, {\n id: cat.ID,\n name: cat.Name,\n fullPath: cat.Name,\n children: [],\n level: 0\n });\n });\n \n // Build the tree structure\n categories.forEach(cat => {\n const node = categoryMap.get(cat.ID)!;\n if (cat.ParentID && categoryMap.has(cat.ParentID)) {\n const parent = categoryMap.get(cat.ParentID)!;\n parent.children.push(node);\n node.fullPath = `${parent.fullPath} / ${node.name}`;\n } else {\n rootCategories.push(node);\n }\n });\n \n // Sort children alphabetically\n const sortNodes = (nodes: CategoryNode[]) => {\n nodes.sort((a, b) => a.name.localeCompare(b.name));\n nodes.forEach(node => sortNodes(node.children));\n };\n sortNodes(rootCategories);\n \n return rootCategories;\n }\n \n private flattenCategories(nodes: CategoryNode[], level: number): CategoryNode[] {\n const result: CategoryNode[] = [];\n nodes.forEach(node => {\n node.level = level;\n result.push(node);\n if (node.children.length > 0) {\n result.push(...this.flattenCategories(node.children, level + 1));\n }\n });\n return result;\n }\n \n async createCategory() {\n if (!this.categoryName.trim()) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please enter a category name',\n 'warning'\n );\n return;\n }\n \n this.isCreating = true;\n \n try {\n const md = this.ProviderToUse;\n const newCategory = await md.GetEntityObject<MJQueryCategoryEntity>('MJ: Query Categories');\n newCategory.Name = this.categoryName.trim();\n newCategory.ParentID = this.selectedParentId;\n newCategory.UserID = md.CurrentUser.ID;\n \n const saved = await newCategory.Save();\n \n if (saved) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Category created successfully',\n 'success'\n );\n this.onCategoryCreated.emit(newCategory);\n this.close();\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to create category: ${newCategory.LatestResult?.Message || 'Unknown error'}`,\n 'error'\n );\n }\n } catch (error) {\n console.error('Error creating category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating category',\n 'error'\n );\n } finally {\n this.isCreating = false;\n }\n }\n \n close() {\n this.categoryName = '';\n this.selectedParentId = null;\n this.isVisible = false;\n this.isVisibleChange.emit(false);\n }\n \n getCategoryIndent(category: CategoryNode): string {\n return `${category.level * 20}px`;\n }\n \n getFullPath(): string {\n const parent = this.flattenedCategories.find(c => c.id === this.selectedParentId);\n const name = this.categoryName || 'New Category';\n return parent ? `${parent.fullPath} / ${name}` : name;\n }\n}","@if (isVisible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"500\"\n (Close)=\"close()\">\n <mj-dialog-titlebar>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <i class=\"fa-solid fa-folder-plus\" style=\"color: #28a745;\"></i>\n Create New Query Category\n </div>\n </mj-dialog-titlebar>\n <div style=\"padding: 20px;\">\n <div class=\"form-group\" style=\"margin-bottom: 20px;\">\n <label for=\"categoryName\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-tag\"></i> Category Name <span style=\"color: #dc3545;\">*</span>\n </label>\n <input class=\"mj-input\"\n [(ngModel)]=\"categoryName\"\n name=\"categoryName\"\n placeholder=\"Enter category name...\"\n style=\"width: 100%;\" />\n </div>\n <div class=\"form-group\">\n <label for=\"parentCategory\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-folder-tree\"></i> Parent Category (Optional)\n </label>\n <mj-dropdown\n [(ngModel)]=\"selectedParentId\"\n name=\"parentCategory\"\n [Data]=\"flattenedCategories\"\n TextField=\"name\"\n ValueField=\"id\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"-- No Parent (Top Level) --\"\n style=\"width: 100%;\">\n </mj-dropdown>\n @if (selectedParentId) {\n <div style=\"margin-top: 8px; padding: 8px; background: var(--mj-bg-surface-sunken); border-radius: 4px; font-size: 0.85em; color: var(--mj-text-muted);\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Full path: {{ getFullPath() }}\n </div>\n }\n </div>\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"close()\">\n <i class=\"fa-solid fa-times\"></i> Cancel\n </button>\n <button mjButton\n variant=\"primary\"\n [disabled]=\"!categoryName.trim() || isCreating\"\n (click)=\"createCategory()\">\n @if (isCreating) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i> Creating...\n } @else {\n <i class=\"fa-solid fa-check\"></i> Create Category\n }\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}