@memberjunction/ng-dashboard-viewer 6.2.0-edge.4 → 6.2.0-edge.6
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 +17 -3
- package/dist/lib/config-panels/artifact-config-panel.component.js +2 -2
- package/dist/lib/config-panels/component-config-panel.component.d.ts +51 -0
- package/dist/lib/config-panels/component-config-panel.component.d.ts.map +1 -0
- package/dist/lib/config-panels/component-config-panel.component.js +246 -0
- package/dist/lib/config-panels/component-config-panel.component.js.map +1 -0
- package/dist/lib/config-panels/index.d.ts +1 -0
- package/dist/lib/config-panels/index.d.ts.map +1 -1
- package/dist/lib/config-panels/index.js +1 -0
- package/dist/lib/config-panels/index.js.map +1 -1
- package/dist/lib/config-panels/query-config-panel.component.js +2 -2
- package/dist/lib/config-panels/view-config-panel.component.js +2 -2
- package/dist/lib/config-panels/weburl-config-panel.component.js +2 -2
- package/dist/lib/dashboard-viewer/dashboard-viewer.component.d.ts +58 -1
- package/dist/lib/dashboard-viewer/dashboard-viewer.component.d.ts.map +1 -1
- package/dist/lib/dashboard-viewer/dashboard-viewer.component.js +186 -4
- package/dist/lib/dashboard-viewer/dashboard-viewer.component.js.map +1 -1
- package/dist/lib/dashboard-viewer.module.d.ts +22 -17
- package/dist/lib/dashboard-viewer.module.d.ts.map +1 -1
- package/dist/lib/dashboard-viewer.module.js +29 -4
- package/dist/lib/dashboard-viewer.module.js.map +1 -1
- package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.d.ts +35 -1
- package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.d.ts.map +1 -1
- package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.js +307 -34
- package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.js.map +1 -1
- package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.d.ts +79 -0
- package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.d.ts.map +1 -0
- package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.js +461 -0
- package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.js.map +1 -0
- package/dist/lib/dialogs/property-default-editor/property-default-editor.component.d.ts +41 -0
- package/dist/lib/dialogs/property-default-editor/property-default-editor.component.d.ts.map +1 -0
- package/dist/lib/dialogs/property-default-editor/property-default-editor.component.js +248 -0
- package/dist/lib/dialogs/property-default-editor/property-default-editor.component.js.map +1 -0
- package/dist/lib/models/dashboard-config-validator.d.ts +30 -0
- package/dist/lib/models/dashboard-config-validator.d.ts.map +1 -0
- package/dist/lib/models/dashboard-config-validator.js +107 -0
- package/dist/lib/models/dashboard-config-validator.js.map +1 -0
- package/dist/lib/models/dashboard-part-interfaces.d.ts +42 -0
- package/dist/lib/models/dashboard-part-interfaces.d.ts.map +1 -0
- package/dist/lib/models/dashboard-part-interfaces.js +180 -0
- package/dist/lib/models/dashboard-part-interfaces.js.map +1 -0
- package/dist/lib/models/dashboard-properties.d.ts +182 -0
- package/dist/lib/models/dashboard-properties.d.ts.map +1 -0
- package/dist/lib/models/dashboard-properties.js +263 -0
- package/dist/lib/models/dashboard-properties.js.map +1 -0
- package/dist/lib/models/dashboard-types.d.ts +8 -0
- package/dist/lib/models/dashboard-types.d.ts.map +1 -1
- package/dist/lib/models/dashboard-types.js.map +1 -1
- package/dist/lib/models/part-inputs-editor.d.ts +36 -0
- package/dist/lib/models/part-inputs-editor.d.ts.map +1 -0
- package/dist/lib/models/part-inputs-editor.js +53 -0
- package/dist/lib/models/part-inputs-editor.js.map +1 -0
- package/dist/lib/parts/artifact-part.component.d.ts.map +1 -1
- package/dist/lib/parts/artifact-part.component.js +5 -4
- package/dist/lib/parts/artifact-part.component.js.map +1 -1
- package/dist/lib/parts/base-dashboard-part.d.ts +50 -1
- package/dist/lib/parts/base-dashboard-part.d.ts.map +1 -1
- package/dist/lib/parts/base-dashboard-part.js +108 -1
- package/dist/lib/parts/base-dashboard-part.js.map +1 -1
- package/dist/lib/parts/component-part.component.d.ts +54 -0
- package/dist/lib/parts/component-part.component.d.ts.map +1 -0
- package/dist/lib/parts/component-part.component.js +221 -0
- package/dist/lib/parts/component-part.component.js.map +1 -0
- package/dist/lib/parts/index.d.ts +1 -0
- package/dist/lib/parts/index.d.ts.map +1 -1
- package/dist/lib/parts/index.js +1 -0
- package/dist/lib/parts/index.js.map +1 -1
- package/dist/lib/parts/query-part.component.d.ts +25 -1
- package/dist/lib/parts/query-part.component.d.ts.map +1 -1
- package/dist/lib/parts/query-part.component.js +93 -10
- package/dist/lib/parts/query-part.component.js.map +1 -1
- package/dist/lib/parts/view-part.component.d.ts +18 -1
- package/dist/lib/parts/view-part.component.d.ts.map +1 -1
- package/dist/lib/parts/view-part.component.js +74 -10
- package/dist/lib/parts/view-part.component.js.map +1 -1
- package/dist/lib/parts/weburl-part.component.d.ts +14 -0
- package/dist/lib/parts/weburl-part.component.d.ts.map +1 -1
- package/dist/lib/parts/weburl-part.component.js +62 -5
- package/dist/lib/parts/weburl-part.component.js.map +1 -1
- package/dist/public-api.d.ts +8 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +8 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +15 -13
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Component, EventEmitter, Input, Output, inject } from '@angular/core';
|
|
2
|
+
import { PROPERTY_VALUE_TYPES } from '@memberjunction/core';
|
|
3
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
4
|
+
import { ValidateDashboardBindings } from '../../models/dashboard-config-validator';
|
|
5
|
+
import { LoadPartInterface } from '../../models/dashboard-part-interfaces';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
import * as i2 from "@memberjunction/ng-shared-generic";
|
|
9
|
+
import * as i3 from "@memberjunction/ng-ui-components";
|
|
10
|
+
import * as i4 from "../property-default-editor/property-default-editor.component";
|
|
11
|
+
const _forTrack0 = ($index, $item) => $item.id;
|
|
12
|
+
const _forTrack1 = ($index, $item) => $item.Name;
|
|
13
|
+
function DashboardPropertiesDialogComponent_Conditional_0_For_8_For_11_Template(rf, ctx) { if (rf & 1) {
|
|
14
|
+
i0.ɵɵelementStart(0, "option", 19);
|
|
15
|
+
i0.ɵɵtext(1);
|
|
16
|
+
i0.ɵɵelementEnd();
|
|
17
|
+
} if (rf & 2) {
|
|
18
|
+
const type_r5 = ctx.$implicit;
|
|
19
|
+
i0.ɵɵproperty("value", type_r5);
|
|
20
|
+
i0.ɵɵadvance();
|
|
21
|
+
i0.ɵɵtextInterpolate(type_r5);
|
|
22
|
+
} }
|
|
23
|
+
function DashboardPropertiesDialogComponent_Conditional_0_For_8_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
25
|
+
i0.ɵɵelementStart(0, "div", 5)(1, "div", 14)(2, "div", 15)(3, "label");
|
|
26
|
+
i0.ɵɵtext(4, "Name");
|
|
27
|
+
i0.ɵɵelementEnd();
|
|
28
|
+
i0.ɵɵelementStart(5, "input", 16);
|
|
29
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_For_8_Template_input_ngModelChange_5_listener($event) { const ɵ$index_14_r4 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.UpdateProperty(ɵ$index_14_r4, { Name: $event })); });
|
|
30
|
+
i0.ɵɵelementEnd()();
|
|
31
|
+
i0.ɵɵelementStart(6, "div", 17)(7, "label");
|
|
32
|
+
i0.ɵɵtext(8, "Type");
|
|
33
|
+
i0.ɵɵelementEnd();
|
|
34
|
+
i0.ɵɵelementStart(9, "select", 18);
|
|
35
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_For_8_Template_select_ngModelChange_9_listener($event) { const ɵ$index_14_r4 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.SetPropertyType(ɵ$index_14_r4, $event)); });
|
|
36
|
+
i0.ɵɵrepeaterCreate(10, DashboardPropertiesDialogComponent_Conditional_0_For_8_For_11_Template, 2, 2, "option", 19, i0.ɵɵrepeaterTrackByIdentity);
|
|
37
|
+
i0.ɵɵelementEnd()();
|
|
38
|
+
i0.ɵɵelementStart(12, "button", 20);
|
|
39
|
+
i0.ɵɵlistener("click", function DashboardPropertiesDialogComponent_Conditional_0_For_8_Template_button_click_12_listener() { const ɵ$index_14_r4 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.RemoveProperty(ɵ$index_14_r4)); });
|
|
40
|
+
i0.ɵɵelement(13, "i", 21);
|
|
41
|
+
i0.ɵɵelementEnd()();
|
|
42
|
+
i0.ɵɵelementStart(14, "div", 15)(15, "label");
|
|
43
|
+
i0.ɵɵtext(16, "Description");
|
|
44
|
+
i0.ɵɵelementEnd();
|
|
45
|
+
i0.ɵɵelementStart(17, "input", 16);
|
|
46
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_For_8_Template_input_ngModelChange_17_listener($event) { const ɵ$index_14_r4 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.UpdateProperty(ɵ$index_14_r4, { Description: $event })); });
|
|
47
|
+
i0.ɵɵelementEnd()();
|
|
48
|
+
i0.ɵɵelementStart(18, "div", 15)(19, "span", 22);
|
|
49
|
+
i0.ɵɵtext(20, "Default");
|
|
50
|
+
i0.ɵɵelementEnd();
|
|
51
|
+
i0.ɵɵelementStart(21, "mj-property-default-editor", 23);
|
|
52
|
+
i0.ɵɵlistener("DefaultChange", function DashboardPropertiesDialogComponent_Conditional_0_For_8_Template_mj_property_default_editor_DefaultChange_21_listener($event) { const ɵ$index_14_r4 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.SetPropertyDefault(ɵ$index_14_r4, $event)); });
|
|
53
|
+
i0.ɵɵelementEnd()();
|
|
54
|
+
i0.ɵɵelementStart(22, "label", 24)(23, "input", 25);
|
|
55
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_For_8_Template_input_ngModelChange_23_listener($event) { const ɵ$index_14_r4 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.UpdateProperty(ɵ$index_14_r4, { IsRequired: $event })); });
|
|
56
|
+
i0.ɵɵelementEnd();
|
|
57
|
+
i0.ɵɵtext(24, " Required ");
|
|
58
|
+
i0.ɵɵelementEnd()();
|
|
59
|
+
} if (rf & 2) {
|
|
60
|
+
const property_r6 = ctx.$implicit;
|
|
61
|
+
const ɵ$index_14_r4 = ctx.$index;
|
|
62
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
63
|
+
i0.ɵɵadvance(3);
|
|
64
|
+
i0.ɵɵattribute("for", "dpd-name-" + ɵ$index_14_r4);
|
|
65
|
+
i0.ɵɵadvance(2);
|
|
66
|
+
i0.ɵɵproperty("id", "dpd-name-" + ɵ$index_14_r4)("ngModel", property_r6.Name);
|
|
67
|
+
i0.ɵɵadvance(2);
|
|
68
|
+
i0.ɵɵattribute("for", "dpd-type-" + ɵ$index_14_r4);
|
|
69
|
+
i0.ɵɵadvance(2);
|
|
70
|
+
i0.ɵɵproperty("id", "dpd-type-" + ɵ$index_14_r4)("ngModel", property_r6.Type);
|
|
71
|
+
i0.ɵɵadvance();
|
|
72
|
+
i0.ɵɵrepeater(ctx_r1.Types);
|
|
73
|
+
i0.ɵɵadvance(2);
|
|
74
|
+
i0.ɵɵattribute("aria-label", "Remove property " + property_r6.Name);
|
|
75
|
+
i0.ɵɵadvance(3);
|
|
76
|
+
i0.ɵɵattribute("for", "dpd-desc-" + ɵ$index_14_r4);
|
|
77
|
+
i0.ɵɵadvance(2);
|
|
78
|
+
i0.ɵɵproperty("id", "dpd-desc-" + ɵ$index_14_r4)("ngModel", property_r6.Description ?? "");
|
|
79
|
+
i0.ɵɵadvance(4);
|
|
80
|
+
i0.ɵɵproperty("Default", property_r6.Default)("Type", property_r6.Type)("Label", "Default of " + property_r6.Name);
|
|
81
|
+
i0.ɵɵadvance(2);
|
|
82
|
+
i0.ɵɵproperty("ngModel", property_r6.IsRequired === true);
|
|
83
|
+
} }
|
|
84
|
+
function DashboardPropertiesDialogComponent_Conditional_0_ForEmpty_9_Template(rf, ctx) { if (rf & 1) {
|
|
85
|
+
i0.ɵɵelementStart(0, "p", 6);
|
|
86
|
+
i0.ɵɵtext(1, "This dashboard has no properties.");
|
|
87
|
+
i0.ɵɵelementEnd();
|
|
88
|
+
} }
|
|
89
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
90
|
+
i0.ɵɵelement(0, "mj-loading", 9);
|
|
91
|
+
} }
|
|
92
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
93
|
+
i0.ɵɵelementStart(0, "option", 19);
|
|
94
|
+
i0.ɵɵtext(1);
|
|
95
|
+
i0.ɵɵelementEnd();
|
|
96
|
+
} if (rf & 2) {
|
|
97
|
+
const panel_r10 = ctx.$implicit;
|
|
98
|
+
i0.ɵɵproperty("value", panel_r10.id);
|
|
99
|
+
i0.ɵɵadvance();
|
|
100
|
+
i0.ɵɵtextInterpolate(panel_r10.title);
|
|
101
|
+
} }
|
|
102
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
103
|
+
i0.ɵɵelementStart(0, "option", 19);
|
|
104
|
+
i0.ɵɵtext(1);
|
|
105
|
+
i0.ɵɵelementEnd();
|
|
106
|
+
} if (rf & 2) {
|
|
107
|
+
const event_r11 = ctx.$implicit;
|
|
108
|
+
i0.ɵɵproperty("value", event_r11.Name);
|
|
109
|
+
i0.ɵɵadvance();
|
|
110
|
+
i0.ɵɵtextInterpolate(event_r11.Name);
|
|
111
|
+
} }
|
|
112
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_9_Template(rf, ctx) { if (rf & 1) {
|
|
113
|
+
i0.ɵɵelementStart(0, "option", 19);
|
|
114
|
+
i0.ɵɵtext(1);
|
|
115
|
+
i0.ɵɵelementEnd();
|
|
116
|
+
} if (rf & 2) {
|
|
117
|
+
const value_r12 = ctx.$implicit;
|
|
118
|
+
i0.ɵɵproperty("value", value_r12.Name);
|
|
119
|
+
i0.ɵɵadvance();
|
|
120
|
+
i0.ɵɵtextInterpolate(value_r12.Name);
|
|
121
|
+
} }
|
|
122
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_14_Template(rf, ctx) { if (rf & 1) {
|
|
123
|
+
i0.ɵɵelementStart(0, "option", 19);
|
|
124
|
+
i0.ɵɵtext(1);
|
|
125
|
+
i0.ɵɵelementEnd();
|
|
126
|
+
} if (rf & 2) {
|
|
127
|
+
const property_r13 = ctx.$implicit;
|
|
128
|
+
i0.ɵɵproperty("value", property_r13.Name);
|
|
129
|
+
i0.ɵɵadvance();
|
|
130
|
+
i0.ɵɵtextInterpolate(property_r13.Name);
|
|
131
|
+
} }
|
|
132
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
133
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
134
|
+
i0.ɵɵelementStart(0, "div", 26)(1, "select", 28);
|
|
135
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_Template_select_ngModelChange_1_listener($event) { const ɵ$index_81_r9 = i0.ɵɵrestoreView(_r8).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.UpdateWire(ɵ$index_81_r9, { Panel: $event })); });
|
|
136
|
+
i0.ɵɵrepeaterCreate(2, DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_3_Template, 2, 2, "option", 19, _forTrack0);
|
|
137
|
+
i0.ɵɵelementEnd();
|
|
138
|
+
i0.ɵɵelementStart(4, "select", 28);
|
|
139
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_Template_select_ngModelChange_4_listener($event) { const ɵ$index_81_r9 = i0.ɵɵrestoreView(_r8).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.UpdateWire(ɵ$index_81_r9, { Event: $event })); });
|
|
140
|
+
i0.ɵɵrepeaterCreate(5, DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_6_Template, 2, 2, "option", 19, _forTrack1);
|
|
141
|
+
i0.ɵɵelementEnd();
|
|
142
|
+
i0.ɵɵelementStart(7, "select", 28);
|
|
143
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_Template_select_ngModelChange_7_listener($event) { const ɵ$index_81_r9 = i0.ɵɵrestoreView(_r8).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.UpdateWire(ɵ$index_81_r9, { Value: $event })); });
|
|
144
|
+
i0.ɵɵrepeaterCreate(8, DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_9_Template, 2, 2, "option", 19, _forTrack1);
|
|
145
|
+
i0.ɵɵelementEnd();
|
|
146
|
+
i0.ɵɵelementStart(10, "span", 29);
|
|
147
|
+
i0.ɵɵelement(11, "i", 30);
|
|
148
|
+
i0.ɵɵelementEnd();
|
|
149
|
+
i0.ɵɵelementStart(12, "select", 28);
|
|
150
|
+
i0.ɵɵlistener("ngModelChange", function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_Template_select_ngModelChange_12_listener($event) { const ɵ$index_81_r9 = i0.ɵɵrestoreView(_r8).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.UpdateWire(ɵ$index_81_r9, { Property: $event })); });
|
|
151
|
+
i0.ɵɵrepeaterCreate(13, DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_For_14_Template, 2, 2, "option", 19, i0.ɵɵrepeaterTrackByIndex);
|
|
152
|
+
i0.ɵɵelementEnd();
|
|
153
|
+
i0.ɵɵelementStart(15, "button", 31);
|
|
154
|
+
i0.ɵɵlistener("click", function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_Template_button_click_15_listener() { const ɵ$index_81_r9 = i0.ɵɵrestoreView(_r8).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.RemoveWire(ɵ$index_81_r9)); });
|
|
155
|
+
i0.ɵɵelement(16, "i", 21);
|
|
156
|
+
i0.ɵɵelementEnd()();
|
|
157
|
+
} if (rf & 2) {
|
|
158
|
+
const wire_r14 = ctx.$implicit;
|
|
159
|
+
const ɵ$index_81_r9 = ctx.$index;
|
|
160
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
161
|
+
i0.ɵɵadvance();
|
|
162
|
+
i0.ɵɵproperty("ngModel", wire_r14.Panel);
|
|
163
|
+
i0.ɵɵattribute("aria-label", "Part of wire " + (ɵ$index_81_r9 + 1));
|
|
164
|
+
i0.ɵɵadvance();
|
|
165
|
+
i0.ɵɵrepeater(ctx_r1.WireSources);
|
|
166
|
+
i0.ɵɵadvance(2);
|
|
167
|
+
i0.ɵɵproperty("ngModel", wire_r14.Event);
|
|
168
|
+
i0.ɵɵattribute("aria-label", "Event of wire " + (ɵ$index_81_r9 + 1));
|
|
169
|
+
i0.ɵɵadvance();
|
|
170
|
+
i0.ɵɵrepeater(ctx_r1.EventsOf(wire_r14));
|
|
171
|
+
i0.ɵɵadvance(2);
|
|
172
|
+
i0.ɵɵproperty("ngModel", wire_r14.Value);
|
|
173
|
+
i0.ɵɵattribute("aria-label", "Value of wire " + (ɵ$index_81_r9 + 1));
|
|
174
|
+
i0.ɵɵadvance();
|
|
175
|
+
i0.ɵɵrepeater(ctx_r1.ValuesOf(wire_r14));
|
|
176
|
+
i0.ɵɵadvance(4);
|
|
177
|
+
i0.ɵɵproperty("ngModel", wire_r14.Property);
|
|
178
|
+
i0.ɵɵattribute("aria-label", "Property of wire " + (ɵ$index_81_r9 + 1));
|
|
179
|
+
i0.ɵɵadvance();
|
|
180
|
+
i0.ɵɵrepeater(ctx_r1.EditProperties);
|
|
181
|
+
i0.ɵɵadvance(2);
|
|
182
|
+
i0.ɵɵattribute("aria-label", "Remove wire " + (ɵ$index_81_r9 + 1));
|
|
183
|
+
} }
|
|
184
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_ForEmpty_2_Template(rf, ctx) { if (rf & 1) {
|
|
185
|
+
i0.ɵɵelementStart(0, "p", 6);
|
|
186
|
+
i0.ɵɵtext(1, "No wires.");
|
|
187
|
+
i0.ɵɵelementEnd();
|
|
188
|
+
} }
|
|
189
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
190
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
191
|
+
i0.ɵɵrepeaterCreate(0, DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_For_1_Template, 17, 9, "div", 26, i0.ɵɵrepeaterTrackByIndex, false, DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_ForEmpty_2_Template, 2, 0, "p", 6);
|
|
192
|
+
i0.ɵɵelementStart(3, "button", 27);
|
|
193
|
+
i0.ɵɵlistener("click", function DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.AddWire()); });
|
|
194
|
+
i0.ɵɵelement(4, "i", 8);
|
|
195
|
+
i0.ɵɵtext(5, " Add wire ");
|
|
196
|
+
i0.ɵɵelementEnd();
|
|
197
|
+
} if (rf & 2) {
|
|
198
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
199
|
+
i0.ɵɵrepeater(ctx_r1.EditWires);
|
|
200
|
+
i0.ɵɵadvance(3);
|
|
201
|
+
i0.ɵɵproperty("disabled", ctx_r1.WireSources.length === 0 || ctx_r1.EditProperties.length === 0);
|
|
202
|
+
} }
|
|
203
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_20_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
204
|
+
i0.ɵɵelementStart(0, "li");
|
|
205
|
+
i0.ɵɵtext(1);
|
|
206
|
+
i0.ɵɵelementEnd();
|
|
207
|
+
} if (rf & 2) {
|
|
208
|
+
const problem_r15 = ctx.$implicit;
|
|
209
|
+
i0.ɵɵadvance();
|
|
210
|
+
i0.ɵɵtextInterpolate(problem_r15);
|
|
211
|
+
} }
|
|
212
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Conditional_20_Template(rf, ctx) { if (rf & 1) {
|
|
213
|
+
i0.ɵɵelementStart(0, "ul", 10);
|
|
214
|
+
i0.ɵɵrepeaterCreate(1, DashboardPropertiesDialogComponent_Conditional_0_Conditional_20_For_2_Template, 2, 1, "li", null, i0.ɵɵrepeaterTrackByIdentity);
|
|
215
|
+
i0.ɵɵelementEnd();
|
|
216
|
+
} if (rf & 2) {
|
|
217
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
218
|
+
i0.ɵɵadvance();
|
|
219
|
+
i0.ɵɵrepeater(ctx_r1.Problems);
|
|
220
|
+
} }
|
|
221
|
+
function DashboardPropertiesDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
222
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
223
|
+
i0.ɵɵelementStart(0, "mj-dialog", 1);
|
|
224
|
+
i0.ɵɵlistener("Close", function DashboardPropertiesDialogComponent_Conditional_0_Template_mj_dialog_Close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.Cancel()); });
|
|
225
|
+
i0.ɵɵelementStart(1, "div", 2)(2, "section")(3, "div", 3);
|
|
226
|
+
i0.ɵɵtext(4, "Properties");
|
|
227
|
+
i0.ɵɵelementEnd();
|
|
228
|
+
i0.ɵɵelementStart(5, "p", 4);
|
|
229
|
+
i0.ɵɵtext(6, " A property is a value the page hosting the dashboard sets once, such as a chapter. Each part maps it onto its own inputs in Edit part. A property's default is used when nothing sets it. ");
|
|
230
|
+
i0.ɵɵelementEnd();
|
|
231
|
+
i0.ɵɵrepeaterCreate(7, DashboardPropertiesDialogComponent_Conditional_0_For_8_Template, 25, 14, "div", 5, i0.ɵɵrepeaterTrackByIndex, false, DashboardPropertiesDialogComponent_Conditional_0_ForEmpty_9_Template, 2, 0, "p", 6);
|
|
232
|
+
i0.ɵɵelementStart(10, "button", 7);
|
|
233
|
+
i0.ɵɵlistener("click", function DashboardPropertiesDialogComponent_Conditional_0_Template_button_click_10_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.AddProperty()); });
|
|
234
|
+
i0.ɵɵelement(11, "i", 8);
|
|
235
|
+
i0.ɵɵtext(12, " Add property ");
|
|
236
|
+
i0.ɵɵelementEnd()();
|
|
237
|
+
i0.ɵɵelementStart(13, "section")(14, "div", 3);
|
|
238
|
+
i0.ɵɵtext(15, "Wires");
|
|
239
|
+
i0.ɵɵelementEnd();
|
|
240
|
+
i0.ɵɵelementStart(16, "p", 4);
|
|
241
|
+
i0.ɵɵtext(17, "A wire sets a property from a part's selection, so selecting a row in one part filters the parts that map that property.");
|
|
242
|
+
i0.ɵɵelementEnd();
|
|
243
|
+
i0.ɵɵconditionalCreate(18, DashboardPropertiesDialogComponent_Conditional_0_Conditional_18_Template, 1, 0, "mj-loading", 9)(19, DashboardPropertiesDialogComponent_Conditional_0_Conditional_19_Template, 6, 2);
|
|
244
|
+
i0.ɵɵelementEnd();
|
|
245
|
+
i0.ɵɵconditionalCreate(20, DashboardPropertiesDialogComponent_Conditional_0_Conditional_20_Template, 3, 0, "ul", 10);
|
|
246
|
+
i0.ɵɵelementEnd();
|
|
247
|
+
i0.ɵɵelementStart(21, "mj-dialog-actions")(22, "button", 11);
|
|
248
|
+
i0.ɵɵlistener("click", function DashboardPropertiesDialogComponent_Conditional_0_Template_button_click_22_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.Apply()); });
|
|
249
|
+
i0.ɵɵelement(23, "i", 12);
|
|
250
|
+
i0.ɵɵtext(24, " Apply ");
|
|
251
|
+
i0.ɵɵelementEnd();
|
|
252
|
+
i0.ɵɵelementStart(25, "button", 13);
|
|
253
|
+
i0.ɵɵlistener("click", function DashboardPropertiesDialogComponent_Conditional_0_Template_button_click_25_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.Cancel()); });
|
|
254
|
+
i0.ɵɵtext(26, "Cancel");
|
|
255
|
+
i0.ɵɵelementEnd()()();
|
|
256
|
+
} if (rf & 2) {
|
|
257
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
258
|
+
i0.ɵɵproperty("Visible", true);
|
|
259
|
+
i0.ɵɵadvance(7);
|
|
260
|
+
i0.ɵɵrepeater(ctx_r1.EditProperties);
|
|
261
|
+
i0.ɵɵadvance(11);
|
|
262
|
+
i0.ɵɵconditional(ctx_r1.IsLoading ? 18 : 19);
|
|
263
|
+
i0.ɵɵadvance(2);
|
|
264
|
+
i0.ɵɵconditional(ctx_r1.Problems.length > 0 ? 20 : -1);
|
|
265
|
+
i0.ɵɵadvance(2);
|
|
266
|
+
i0.ɵɵproperty("disabled", !ctx_r1.CanApply);
|
|
267
|
+
} }
|
|
268
|
+
/**
|
|
269
|
+
* The dashboard designer's Properties panel and Wires list, on `mj-dialog`.
|
|
270
|
+
*
|
|
271
|
+
* Properties: add, edit and remove the dashboard's properties (name, type, description, required,
|
|
272
|
+
* and a default: a fixed value or a context token). Wires: each sets a property from one value of a
|
|
273
|
+
* part's event (a View part's `RecordSelected`, a Query part's `RowSelected`, a component's declared
|
|
274
|
+
* events). Apply is refused while a property, a wire or a part's mapping no longer fits, for
|
|
275
|
+
* example a property renamed while a part still maps it.
|
|
276
|
+
*
|
|
277
|
+
* The host opens and closes it, for example with `@if` around `[Visible]="true"`.
|
|
278
|
+
*/
|
|
279
|
+
export class DashboardPropertiesDialogComponent extends BaseAngularComponent {
|
|
280
|
+
cdr = inject(ChangeDetectorRef);
|
|
281
|
+
/** Whether the dialog shows. Opening copies the inputs and loads what each part declares. */
|
|
282
|
+
set Visible(value) {
|
|
283
|
+
const wasVisible = this._visible;
|
|
284
|
+
this._visible = value;
|
|
285
|
+
if (value && !wasVisible) {
|
|
286
|
+
Promise.resolve().then(() => this.open());
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
get Visible() {
|
|
290
|
+
return this._visible;
|
|
291
|
+
}
|
|
292
|
+
_visible = false;
|
|
293
|
+
/** The dashboard's properties. */
|
|
294
|
+
Properties = [];
|
|
295
|
+
/** The dashboard's wires. */
|
|
296
|
+
Wires = [];
|
|
297
|
+
/** The dashboard's parts. */
|
|
298
|
+
Panels = [];
|
|
299
|
+
/** Emitted on Apply with the edited properties and wires. */
|
|
300
|
+
Saved = new EventEmitter();
|
|
301
|
+
/** Emitted on Cancel or close. */
|
|
302
|
+
Cancelled = new EventEmitter();
|
|
303
|
+
Types = PROPERTY_VALUE_TYPES;
|
|
304
|
+
/** The properties being edited. */
|
|
305
|
+
EditProperties = [];
|
|
306
|
+
/** The wires being edited. */
|
|
307
|
+
EditWires = [];
|
|
308
|
+
/** What each part declares, by panel ID; null when it couldn't load. */
|
|
309
|
+
Interfaces = new Map();
|
|
310
|
+
IsLoading = false;
|
|
311
|
+
openCount = 0;
|
|
312
|
+
destroyed = false;
|
|
313
|
+
/** Everything Apply refuses: properties, wires, and the parts' mappings against the edited properties. */
|
|
314
|
+
get Problems() {
|
|
315
|
+
return ValidateDashboardBindings({
|
|
316
|
+
Properties: this.EditProperties,
|
|
317
|
+
Wires: this.EditWires,
|
|
318
|
+
Panels: this.Panels,
|
|
319
|
+
Interfaces: this.Interfaces,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
get CanApply() {
|
|
323
|
+
return !this.IsLoading && this.Problems.length === 0;
|
|
324
|
+
}
|
|
325
|
+
/** The parts that raise at least one event a wire can start from. */
|
|
326
|
+
get WireSources() {
|
|
327
|
+
return this.Panels.filter(p => (this.Interfaces.get(p.id)?.Events.length ?? 0) > 0);
|
|
328
|
+
}
|
|
329
|
+
/** The events a wire's part raises. */
|
|
330
|
+
EventsOf(wire) {
|
|
331
|
+
return this.Interfaces.get(wire.Panel)?.Events ?? [];
|
|
332
|
+
}
|
|
333
|
+
/** The values a wire's event carries. */
|
|
334
|
+
ValuesOf(wire) {
|
|
335
|
+
return this.EventsOf(wire).find(e => e.Name === wire.Event)?.Values ?? [];
|
|
336
|
+
}
|
|
337
|
+
AddProperty() {
|
|
338
|
+
this.EditProperties = [...this.EditProperties, { Name: this.nextName(), Type: 'string' }];
|
|
339
|
+
}
|
|
340
|
+
RemoveProperty(index) {
|
|
341
|
+
this.EditProperties = this.EditProperties.filter((_, i) => i !== index);
|
|
342
|
+
}
|
|
343
|
+
UpdateProperty(index, patch) {
|
|
344
|
+
this.EditProperties = this.EditProperties.map((p, i) => (i === index ? withoutUndefined({ ...p, ...patch }) : p));
|
|
345
|
+
}
|
|
346
|
+
/** A new type drops a fixed default (it may not fit) and keeps a token. */
|
|
347
|
+
SetPropertyType(index, type) {
|
|
348
|
+
const property = this.EditProperties[index];
|
|
349
|
+
this.UpdateProperty(index, { Type: type, Default: property.Default?.Token ? property.Default : undefined });
|
|
350
|
+
}
|
|
351
|
+
SetPropertyDefault(index, value) {
|
|
352
|
+
this.UpdateProperty(index, { Default: value });
|
|
353
|
+
}
|
|
354
|
+
/** Adds a wire from the first part that raises events, to the first property. */
|
|
355
|
+
AddWire() {
|
|
356
|
+
const source = this.WireSources[0];
|
|
357
|
+
const event = source ? this.Interfaces.get(source.id)?.Events[0] : undefined;
|
|
358
|
+
this.EditWires = [...this.EditWires, {
|
|
359
|
+
Panel: source?.id ?? '',
|
|
360
|
+
Event: event?.Name ?? '',
|
|
361
|
+
Value: event?.Values[0]?.Name ?? '',
|
|
362
|
+
Property: this.EditProperties[0]?.Name ?? '',
|
|
363
|
+
}];
|
|
364
|
+
}
|
|
365
|
+
RemoveWire(index) {
|
|
366
|
+
this.EditWires = this.EditWires.filter((_, i) => i !== index);
|
|
367
|
+
}
|
|
368
|
+
/** A new part resets the event and value to its first ones; a new event resets the value. */
|
|
369
|
+
UpdateWire(index, patch) {
|
|
370
|
+
this.EditWires = this.EditWires.map((wire, i) => (i === index ? this.patchWire(wire, patch) : wire));
|
|
371
|
+
}
|
|
372
|
+
Apply() {
|
|
373
|
+
if (!this.CanApply)
|
|
374
|
+
return;
|
|
375
|
+
this.Saved.emit({ Properties: this.EditProperties, Wires: this.EditWires });
|
|
376
|
+
}
|
|
377
|
+
Cancel() {
|
|
378
|
+
this.Cancelled.emit();
|
|
379
|
+
}
|
|
380
|
+
ngOnDestroy() {
|
|
381
|
+
this.destroyed = true;
|
|
382
|
+
this.openCount++;
|
|
383
|
+
}
|
|
384
|
+
patchWire(wire, patch) {
|
|
385
|
+
const next = { ...wire, ...patch };
|
|
386
|
+
if (patch.Panel !== undefined && patch.Panel !== wire.Panel) {
|
|
387
|
+
const event = this.Interfaces.get(next.Panel)?.Events[0];
|
|
388
|
+
next.Event = event?.Name ?? '';
|
|
389
|
+
next.Value = event?.Values[0]?.Name ?? '';
|
|
390
|
+
}
|
|
391
|
+
else if (patch.Event !== undefined && patch.Event !== wire.Event) {
|
|
392
|
+
next.Value = this.ValuesOf(next)[0]?.Name ?? '';
|
|
393
|
+
}
|
|
394
|
+
return next;
|
|
395
|
+
}
|
|
396
|
+
/** Copies the inputs and loads what each part declares. */
|
|
397
|
+
async open() {
|
|
398
|
+
const openId = ++this.openCount;
|
|
399
|
+
this.EditProperties = this.Properties.map(p => ({ ...p }));
|
|
400
|
+
this.EditWires = this.Wires.map(w => ({ ...w }));
|
|
401
|
+
this.Interfaces = new Map();
|
|
402
|
+
this.IsLoading = true;
|
|
403
|
+
this.cdr.markForCheck();
|
|
404
|
+
const interfaces = new Map();
|
|
405
|
+
await Promise.all(this.Panels.map(async (panel) => {
|
|
406
|
+
try {
|
|
407
|
+
interfaces.set(panel.id, await LoadPartInterface(panel.config, this.ProviderToUse));
|
|
408
|
+
}
|
|
409
|
+
catch {
|
|
410
|
+
interfaces.set(panel.id, null);
|
|
411
|
+
}
|
|
412
|
+
}));
|
|
413
|
+
if (openId !== this.openCount || this.destroyed)
|
|
414
|
+
return;
|
|
415
|
+
this.Interfaces = interfaces;
|
|
416
|
+
this.IsLoading = false;
|
|
417
|
+
this.cdr.detectChanges();
|
|
418
|
+
}
|
|
419
|
+
nextName() {
|
|
420
|
+
const taken = new Set(this.EditProperties.map(p => p.Name.toLowerCase()));
|
|
421
|
+
let n = this.EditProperties.length + 1;
|
|
422
|
+
while (taken.has(`property${n}`))
|
|
423
|
+
n++;
|
|
424
|
+
return `Property${n}`;
|
|
425
|
+
}
|
|
426
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵDashboardPropertiesDialogComponent_BaseFactory; return function DashboardPropertiesDialogComponent_Factory(__ngFactoryType__) { return (ɵDashboardPropertiesDialogComponent_BaseFactory || (ɵDashboardPropertiesDialogComponent_BaseFactory = i0.ɵɵgetInheritedFactory(DashboardPropertiesDialogComponent)))(__ngFactoryType__ || DashboardPropertiesDialogComponent); }; })();
|
|
427
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DashboardPropertiesDialogComponent, selectors: [["mj-dashboard-properties-dialog"]], inputs: { Visible: "Visible", Properties: "Properties", Wires: "Wires", Panels: "Panels" }, outputs: { Saved: "Saved", Cancelled: "Cancelled" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["Size", "lg", "Title", "Properties and wires", 3, "Visible"], ["Size", "lg", "Title", "Properties and wires", 3, "Close", "Visible"], [1, "dpd"], [1, "dpd__label"], [1, "dpd__hint"], [1, "dpd__card"], [1, "dpd__empty"], ["mjButton", "", "Variant", "outline", "Size", "sm", "type", "button", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-plus"], ["Text", "Loading parts...", "Size", "small"], ["role", "alert", 1, "dpd__problems"], ["mjButton", "", "Variant", "primary", "type", "button", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-check"], ["mjButton", "", "Variant", "secondary", "type", "button", 3, "click"], [1, "dpd__row"], [1, "dpd__field"], ["type", "text", 1, "mj-input", 3, "ngModelChange", "id", "ngModel"], [1, "dpd__field", "dpd__field--narrow"], [1, "mj-input", 3, "ngModelChange", "id", "ngModel"], [3, "value"], ["mjButton", "", "Variant", "icon", "Size", "sm", "type", "button", "title", "Remove property", 1, "dpd__remove", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash"], [1, "dpd__field-label"], [3, "DefaultChange", "Default", "Type", "Label"], [1, "dpd__check"], ["type", "checkbox", 1, "mj-checkbox", 3, "ngModelChange", "ngModel"], [1, "dpd__wire"], ["mjButton", "", "Variant", "outline", "Size", "sm", "type", "button", 3, "click", "disabled"], [1, "mj-input", 3, "ngModelChange", "ngModel"], ["aria-hidden", "true", 1, "dpd__arrow"], [1, "fa-solid", "fa-arrow-right"], ["mjButton", "", "Variant", "icon", "Size", "sm", "type", "button", "title", "Remove wire", 3, "click"]], template: function DashboardPropertiesDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
428
|
+
i0.ɵɵconditionalCreate(0, DashboardPropertiesDialogComponent_Conditional_0_Template, 27, 5, "mj-dialog", 0);
|
|
429
|
+
} if (rf & 2) {
|
|
430
|
+
i0.ɵɵconditional(ctx.Visible ? 0 : -1);
|
|
431
|
+
} }, dependencies: [i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.CheckboxControlValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.NgModel, i2.LoadingComponent, i3.MJDialogComponent, i3.MJDialogActionsComponent, i3.MJButtonDirective, i4.PropertyDefaultEditorComponent], styles: [".dpd[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: var(--mj-space-4); }\n.dpd[_ngcontent-%COMP%] section[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: var(--mj-space-2); align-items: flex-start; }\n.dpd__label[_ngcontent-%COMP%] { font-size: var(--mj-text-xs); font-weight: var(--mj-font-semibold); color: var(--mj-text-secondary); }\n.dpd__hint[_ngcontent-%COMP%] { margin: 0; font-size: 12px; color: var(--mj-text-muted); }\n.dpd__empty[_ngcontent-%COMP%] { margin: 0; font-size: 13px; color: var(--mj-text-muted); }\n.dpd__card[_ngcontent-%COMP%] {\n display: flex; flex-direction: column; gap: var(--mj-space-2); align-self: stretch;\n padding: 10px 12px; border: 1px solid var(--mj-border-subtle); border-radius: var(--mj-radius-md);\n}\n.dpd__row[_ngcontent-%COMP%] { display: flex; gap: var(--mj-space-2); align-items: flex-end; }\n.dpd__field[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: 4px; flex: 1; }\n.dpd__field--narrow[_ngcontent-%COMP%] { flex: 0 0 120px; }\n.dpd__field[_ngcontent-%COMP%] label[_ngcontent-%COMP%], .dpd__field-label[_ngcontent-%COMP%] { font-size: 12px; color: var(--mj-text-secondary); }\n.dpd__check[_ngcontent-%COMP%] { display: flex; align-items: center; gap: var(--mj-space-2); font-size: 13px; }\n.dpd__wire[_ngcontent-%COMP%] { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; align-self: stretch; }\n.dpd__wire[_ngcontent-%COMP%] select[_ngcontent-%COMP%] { flex: 1 1 120px; min-width: 110px; }\n.dpd__arrow[_ngcontent-%COMP%] { color: var(--mj-text-muted); }\n.dpd__problems[_ngcontent-%COMP%] { margin: 0; padding-left: 18px; font-size: 13px; color: var(--mj-status-error-text); }"] });
|
|
432
|
+
}
|
|
433
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashboardPropertiesDialogComponent, [{
|
|
434
|
+
type: Component,
|
|
435
|
+
args: [{ standalone: false, selector: 'mj-dashboard-properties-dialog', template: "@if (Visible) {\n <mj-dialog [Visible]=\"true\" Size=\"lg\" Title=\"Properties and wires\" (Close)=\"Cancel()\">\n <div class=\"dpd\">\n <section>\n <div class=\"dpd__label\">Properties</div>\n <p class=\"dpd__hint\">\n A property is a value the page hosting the dashboard sets once, such as a chapter. Each part maps it onto its own\n inputs in Edit part. A property's default is used when nothing sets it.\n </p>\n @for (property of EditProperties; track $index; let i = $index) {\n <div class=\"dpd__card\">\n <div class=\"dpd__row\">\n <div class=\"dpd__field\">\n <label [attr.for]=\"'dpd-name-' + i\">Name</label>\n <input [id]=\"'dpd-name-' + i\" class=\"mj-input\" type=\"text\" [ngModel]=\"property.Name\" (ngModelChange)=\"UpdateProperty(i, { Name: $event })\">\n </div>\n <div class=\"dpd__field dpd__field--narrow\">\n <label [attr.for]=\"'dpd-type-' + i\">Type</label>\n <select [id]=\"'dpd-type-' + i\" class=\"mj-input\" [ngModel]=\"property.Type\" (ngModelChange)=\"SetPropertyType(i, $event)\">\n @for (type of Types; track type) {\n <option [value]=\"type\">{{ type }}</option>\n }\n </select>\n </div>\n <button mjButton Variant=\"icon\" Size=\"sm\" type=\"button\" class=\"dpd__remove\" title=\"Remove property\"\n [attr.aria-label]=\"'Remove property ' + property.Name\" (click)=\"RemoveProperty(i)\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <div class=\"dpd__field\">\n <label [attr.for]=\"'dpd-desc-' + i\">Description</label>\n <input [id]=\"'dpd-desc-' + i\" class=\"mj-input\" type=\"text\" [ngModel]=\"property.Description ?? ''\" (ngModelChange)=\"UpdateProperty(i, { Description: $event })\">\n </div>\n <div class=\"dpd__field\">\n <span class=\"dpd__field-label\">Default</span>\n <mj-property-default-editor [Default]=\"property.Default\" [Type]=\"property.Type\" [Label]=\"'Default of ' + property.Name\"\n (DefaultChange)=\"SetPropertyDefault(i, $event)\"></mj-property-default-editor>\n </div>\n <label class=\"dpd__check\">\n <input type=\"checkbox\" class=\"mj-checkbox\" [ngModel]=\"property.IsRequired === true\" (ngModelChange)=\"UpdateProperty(i, { IsRequired: $event })\">\n Required\n </label>\n </div>\n } @empty {\n <p class=\"dpd__empty\">This dashboard has no properties.</p>\n }\n <button mjButton Variant=\"outline\" Size=\"sm\" type=\"button\" (click)=\"AddProperty()\">\n <i class=\"fa-solid fa-plus\" aria-hidden=\"true\"></i> Add property\n </button>\n </section>\n\n <section>\n <div class=\"dpd__label\">Wires</div>\n <p class=\"dpd__hint\">A wire sets a property from a part's selection, so selecting a row in one part filters the parts that map that property.</p>\n @if (IsLoading) {\n <mj-loading Text=\"Loading parts...\" Size=\"small\"></mj-loading>\n } @else {\n @for (wire of EditWires; track $index; let i = $index) {\n <div class=\"dpd__wire\">\n <select class=\"mj-input\" [attr.aria-label]=\"'Part of wire ' + (i + 1)\" [ngModel]=\"wire.Panel\" (ngModelChange)=\"UpdateWire(i, { Panel: $event })\">\n @for (panel of WireSources; track panel.id) {\n <option [value]=\"panel.id\">{{ panel.title }}</option>\n }\n </select>\n <select class=\"mj-input\" [attr.aria-label]=\"'Event of wire ' + (i + 1)\" [ngModel]=\"wire.Event\" (ngModelChange)=\"UpdateWire(i, { Event: $event })\">\n @for (event of EventsOf(wire); track event.Name) {\n <option [value]=\"event.Name\">{{ event.Name }}</option>\n }\n </select>\n <select class=\"mj-input\" [attr.aria-label]=\"'Value of wire ' + (i + 1)\" [ngModel]=\"wire.Value\" (ngModelChange)=\"UpdateWire(i, { Value: $event })\">\n @for (value of ValuesOf(wire); track value.Name) {\n <option [value]=\"value.Name\">{{ value.Name }}</option>\n }\n </select>\n <span class=\"dpd__arrow\" aria-hidden=\"true\"><i class=\"fa-solid fa-arrow-right\"></i></span>\n <select class=\"mj-input\" [attr.aria-label]=\"'Property of wire ' + (i + 1)\" [ngModel]=\"wire.Property\" (ngModelChange)=\"UpdateWire(i, { Property: $event })\">\n @for (property of EditProperties; track $index) {\n <option [value]=\"property.Name\">{{ property.Name }}</option>\n }\n </select>\n <button mjButton Variant=\"icon\" Size=\"sm\" type=\"button\" title=\"Remove wire\" [attr.aria-label]=\"'Remove wire ' + (i + 1)\" (click)=\"RemoveWire(i)\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n } @empty {\n <p class=\"dpd__empty\">No wires.</p>\n }\n <button mjButton Variant=\"outline\" Size=\"sm\" type=\"button\" [disabled]=\"WireSources.length === 0 || EditProperties.length === 0\" (click)=\"AddWire()\">\n <i class=\"fa-solid fa-plus\" aria-hidden=\"true\"></i> Add wire\n </button>\n }\n </section>\n\n @if (Problems.length > 0) {\n <ul class=\"dpd__problems\" role=\"alert\">\n @for (problem of Problems; track problem) {\n <li>{{ problem }}</li>\n }\n </ul>\n }\n </div>\n <mj-dialog-actions>\n <button mjButton Variant=\"primary\" type=\"button\" [disabled]=\"!CanApply\" (click)=\"Apply()\">\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i> Apply\n </button>\n <button mjButton Variant=\"secondary\" type=\"button\" (click)=\"Cancel()\">Cancel</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n", styles: [".dpd { display: flex; flex-direction: column; gap: var(--mj-space-4); }\n.dpd section { display: flex; flex-direction: column; gap: var(--mj-space-2); align-items: flex-start; }\n.dpd__label { font-size: var(--mj-text-xs); font-weight: var(--mj-font-semibold); color: var(--mj-text-secondary); }\n.dpd__hint { margin: 0; font-size: 12px; color: var(--mj-text-muted); }\n.dpd__empty { margin: 0; font-size: 13px; color: var(--mj-text-muted); }\n.dpd__card {\n display: flex; flex-direction: column; gap: var(--mj-space-2); align-self: stretch;\n padding: 10px 12px; border: 1px solid var(--mj-border-subtle); border-radius: var(--mj-radius-md);\n}\n.dpd__row { display: flex; gap: var(--mj-space-2); align-items: flex-end; }\n.dpd__field { display: flex; flex-direction: column; gap: 4px; flex: 1; }\n.dpd__field--narrow { flex: 0 0 120px; }\n.dpd__field label, .dpd__field-label { font-size: 12px; color: var(--mj-text-secondary); }\n.dpd__check { display: flex; align-items: center; gap: var(--mj-space-2); font-size: 13px; }\n.dpd__wire { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; align-self: stretch; }\n.dpd__wire select { flex: 1 1 120px; min-width: 110px; }\n.dpd__arrow { color: var(--mj-text-muted); }\n.dpd__problems { margin: 0; padding-left: 18px; font-size: 13px; color: var(--mj-status-error-text); }\n"] }]
|
|
436
|
+
}], null, { Visible: [{
|
|
437
|
+
type: Input
|
|
438
|
+
}], Properties: [{
|
|
439
|
+
type: Input
|
|
440
|
+
}], Wires: [{
|
|
441
|
+
type: Input
|
|
442
|
+
}], Panels: [{
|
|
443
|
+
type: Input
|
|
444
|
+
}], Saved: [{
|
|
445
|
+
type: Output
|
|
446
|
+
}], Cancelled: [{
|
|
447
|
+
type: Output
|
|
448
|
+
}] }); })();
|
|
449
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DashboardPropertiesDialogComponent, { className: "DashboardPropertiesDialogComponent", filePath: "src/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.ts", lineNumber: 38 }); })();
|
|
450
|
+
/** The property without empty optional keys, so the saved JSON carries only what was set. */
|
|
451
|
+
function withoutUndefined(property) {
|
|
452
|
+
const result = { ...property };
|
|
453
|
+
if (!result.Description)
|
|
454
|
+
delete result.Description;
|
|
455
|
+
if (!result.Default)
|
|
456
|
+
delete result.Default;
|
|
457
|
+
if (result.IsRequired !== true)
|
|
458
|
+
delete result.IsRequired;
|
|
459
|
+
return result;
|
|
460
|
+
}
|
|
461
|
+
//# sourceMappingURL=dashboard-properties-dialog.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-properties-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.ts","../../../../src/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAa,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAsC,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AASrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;;;;;;;;;ICQvD,kCAAuB;IAAA,YAAU;IAAA,iBAAS;;;IAAlC,+BAAc;IAAC,cAAU;IAAV,6BAAU;;;;IAPrC,AADF,AADF,AADF,8BAAuB,cACC,cACI,YACc;IAAA,oBAAI;IAAA,iBAAQ;IAChD,iCAA2I;IAAtD,+PAAiB,qCAAkB,gBAAgB,CAAC,KAAC;IAC5I,AADE,iBAA2I,EACvI;IAEJ,AADF,+BAA2C,YACL;IAAA,oBAAI;IAAA,iBAAQ;IAChD,kCAAuH;IAA7C,gQAAiB,6CAA0B,KAAC;IACpH,iJAEC;IAEL,AADE,iBAAS,EACL;IACN,mCAC2F;IAA5B,2OAAS,oCAAiB,KAAC;IACxF,yBAAoD;IAExD,AADE,iBAAS,EACL;IAEJ,AADF,gCAAwB,aACc;IAAA,4BAAW;IAAA,iBAAQ;IACvD,kCAA+J;IAA7D,gQAAiB,qCAAkB,uBAAuB,CAAC,KAAC;IAChK,AADE,iBAA+J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AAkC;YCrC/C,2GAAe;;YAAf,sCA4GC;;;iFDvEY,kCAAkC;cAN9C,SAAS;6BACM,KAAK,YACP,gCAAgC;;kBAQzC,KAAK;;kBAcL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,MAAM;;kBAEN,MAAM;;kFA3BE,kCAAkC;AA0K/C,6FAA6F;AAC7F,SAAS,gBAAgB,CAAC,QAA2B;IACjD,MAAM,MAAM,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,WAAW;QAAE,OAAO,MAAM,CAAC,WAAW,CAAC;IACnD,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IAC3C,IAAI,MAAM,CAAC,UAAU,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC;IACzD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, Output, inject } from '@angular/core';\nimport { PROPERTY_VALUE_TYPES, PropertyDefault, PropertyValueType } from '@memberjunction/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport type { DashboardPanel } from '../../models/dashboard-types';\nimport {\n DashboardEventValue,\n DashboardPartEventInfo,\n DashboardPartInterface,\n DashboardProperty,\n DashboardWire,\n} from '../../models/dashboard-properties';\nimport { ValidateDashboardBindings } from '../../models/dashboard-config-validator';\nimport { LoadPartInterface } from '../../models/dashboard-part-interfaces';\n\n/** What the properties dialog gives back on Apply. */\nexport interface DashboardPropertiesDialogResult {\n Properties: DashboardProperty[];\n Wires: DashboardWire[];\n}\n\n/**\n * The dashboard designer's Properties panel and Wires list, on `mj-dialog`.\n *\n * Properties: add, edit and remove the dashboard's properties (name, type, description, required,\n * and a default: a fixed value or a context token). Wires: each sets a property from one value of a\n * part's event (a View part's `RecordSelected`, a Query part's `RowSelected`, a component's declared\n * events). Apply is refused while a property, a wire or a part's mapping no longer fits, for\n * example a property renamed while a part still maps it.\n *\n * The host opens and closes it, for example with `@if` around `[Visible]=\"true\"`.\n */\n@Component({\n standalone: false,\n selector: 'mj-dashboard-properties-dialog',\n templateUrl: './dashboard-properties-dialog.component.html',\n styleUrls: ['./dashboard-properties-dialog.component.css']\n})\nexport class DashboardPropertiesDialogComponent extends BaseAngularComponent implements OnDestroy {\n private readonly cdr = inject(ChangeDetectorRef);\n\n /** Whether the dialog shows. Opening copies the inputs and loads what each part declares. */\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible) {\n Promise.resolve().then(() => this.open());\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n private _visible = false;\n\n /** The dashboard's properties. */\n @Input() Properties: DashboardProperty[] = [];\n /** The dashboard's wires. */\n @Input() Wires: DashboardWire[] = [];\n /** The dashboard's parts. */\n @Input() Panels: DashboardPanel[] = [];\n\n /** Emitted on Apply with the edited properties and wires. */\n @Output() Saved = new EventEmitter<DashboardPropertiesDialogResult>();\n /** Emitted on Cancel or close. */\n @Output() Cancelled = new EventEmitter<void>();\n\n public readonly Types = PROPERTY_VALUE_TYPES;\n\n /** The properties being edited. */\n public EditProperties: DashboardProperty[] = [];\n /** The wires being edited. */\n public EditWires: DashboardWire[] = [];\n /** What each part declares, by panel ID; null when it couldn't load. */\n public Interfaces = new Map<string, DashboardPartInterface | null>();\n public IsLoading = false;\n\n private openCount = 0;\n private destroyed = false;\n\n /** Everything Apply refuses: properties, wires, and the parts' mappings against the edited properties. */\n public get Problems(): string[] {\n return ValidateDashboardBindings({\n Properties: this.EditProperties,\n Wires: this.EditWires,\n Panels: this.Panels,\n Interfaces: this.Interfaces,\n });\n }\n\n public get CanApply(): boolean {\n return !this.IsLoading && this.Problems.length === 0;\n }\n\n /** The parts that raise at least one event a wire can start from. */\n public get WireSources(): DashboardPanel[] {\n return this.Panels.filter(p => (this.Interfaces.get(p.id)?.Events.length ?? 0) > 0);\n }\n\n /** The events a wire's part raises. */\n public EventsOf(wire: DashboardWire): DashboardPartEventInfo[] {\n return this.Interfaces.get(wire.Panel)?.Events ?? [];\n }\n\n /** The values a wire's event carries. */\n public ValuesOf(wire: DashboardWire): DashboardEventValue[] {\n return this.EventsOf(wire).find(e => e.Name === wire.Event)?.Values ?? [];\n }\n\n public AddProperty(): void {\n this.EditProperties = [...this.EditProperties, { Name: this.nextName(), Type: 'string' }];\n }\n\n public RemoveProperty(index: number): void {\n this.EditProperties = this.EditProperties.filter((_, i) => i !== index);\n }\n\n public UpdateProperty(index: number, patch: Partial<DashboardProperty>): void {\n this.EditProperties = this.EditProperties.map((p, i) => (i === index ? withoutUndefined({ ...p, ...patch }) : p));\n }\n\n /** A new type drops a fixed default (it may not fit) and keeps a token. */\n public SetPropertyType(index: number, type: PropertyValueType): void {\n const property = this.EditProperties[index];\n this.UpdateProperty(index, { Type: type, Default: property.Default?.Token ? property.Default : undefined });\n }\n\n public SetPropertyDefault(index: number, value: PropertyDefault | undefined): void {\n this.UpdateProperty(index, { Default: value });\n }\n\n /** Adds a wire from the first part that raises events, to the first property. */\n public AddWire(): void {\n const source = this.WireSources[0];\n const event = source ? this.Interfaces.get(source.id)?.Events[0] : undefined;\n this.EditWires = [...this.EditWires, {\n Panel: source?.id ?? '',\n Event: event?.Name ?? '',\n Value: event?.Values[0]?.Name ?? '',\n Property: this.EditProperties[0]?.Name ?? '',\n }];\n }\n\n public RemoveWire(index: number): void {\n this.EditWires = this.EditWires.filter((_, i) => i !== index);\n }\n\n /** A new part resets the event and value to its first ones; a new event resets the value. */\n public UpdateWire(index: number, patch: Partial<DashboardWire>): void {\n this.EditWires = this.EditWires.map((wire, i) => (i === index ? this.patchWire(wire, patch) : wire));\n }\n\n public Apply(): void {\n if (!this.CanApply) return;\n this.Saved.emit({ Properties: this.EditProperties, Wires: this.EditWires });\n }\n\n public Cancel(): void {\n this.Cancelled.emit();\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.openCount++;\n }\n\n private patchWire(wire: DashboardWire, patch: Partial<DashboardWire>): DashboardWire {\n const next = { ...wire, ...patch };\n if (patch.Panel !== undefined && patch.Panel !== wire.Panel) {\n const event = this.Interfaces.get(next.Panel)?.Events[0];\n next.Event = event?.Name ?? '';\n next.Value = event?.Values[0]?.Name ?? '';\n } else if (patch.Event !== undefined && patch.Event !== wire.Event) {\n next.Value = this.ValuesOf(next)[0]?.Name ?? '';\n }\n return next;\n }\n\n /** Copies the inputs and loads what each part declares. */\n private async open(): Promise<void> {\n const openId = ++this.openCount;\n this.EditProperties = this.Properties.map(p => ({ ...p }));\n this.EditWires = this.Wires.map(w => ({ ...w }));\n this.Interfaces = new Map();\n this.IsLoading = true;\n this.cdr.markForCheck();\n const interfaces = new Map<string, DashboardPartInterface | null>();\n await Promise.all(this.Panels.map(async panel => {\n try {\n interfaces.set(panel.id, await LoadPartInterface(panel.config, this.ProviderToUse));\n } catch {\n interfaces.set(panel.id, null);\n }\n }));\n if (openId !== this.openCount || this.destroyed) return;\n this.Interfaces = interfaces;\n this.IsLoading = false;\n this.cdr.detectChanges();\n }\n\n private nextName(): string {\n const taken = new Set(this.EditProperties.map(p => p.Name.toLowerCase()));\n let n = this.EditProperties.length + 1;\n while (taken.has(`property${n}`)) n++;\n return `Property${n}`;\n }\n}\n\n/** The property without empty optional keys, so the saved JSON carries only what was set. */\nfunction withoutUndefined(property: DashboardProperty): DashboardProperty {\n const result = { ...property };\n if (!result.Description) delete result.Description;\n if (!result.Default) delete result.Default;\n if (result.IsRequired !== true) delete result.IsRequired;\n return result;\n}\n","@if (Visible) {\n <mj-dialog [Visible]=\"true\" Size=\"lg\" Title=\"Properties and wires\" (Close)=\"Cancel()\">\n <div class=\"dpd\">\n <section>\n <div class=\"dpd__label\">Properties</div>\n <p class=\"dpd__hint\">\n A property is a value the page hosting the dashboard sets once, such as a chapter. Each part maps it onto its own\n inputs in Edit part. A property's default is used when nothing sets it.\n </p>\n @for (property of EditProperties; track $index; let i = $index) {\n <div class=\"dpd__card\">\n <div class=\"dpd__row\">\n <div class=\"dpd__field\">\n <label [attr.for]=\"'dpd-name-' + i\">Name</label>\n <input [id]=\"'dpd-name-' + i\" class=\"mj-input\" type=\"text\" [ngModel]=\"property.Name\" (ngModelChange)=\"UpdateProperty(i, { Name: $event })\">\n </div>\n <div class=\"dpd__field dpd__field--narrow\">\n <label [attr.for]=\"'dpd-type-' + i\">Type</label>\n <select [id]=\"'dpd-type-' + i\" class=\"mj-input\" [ngModel]=\"property.Type\" (ngModelChange)=\"SetPropertyType(i, $event)\">\n @for (type of Types; track type) {\n <option [value]=\"type\">{{ type }}</option>\n }\n </select>\n </div>\n <button mjButton Variant=\"icon\" Size=\"sm\" type=\"button\" class=\"dpd__remove\" title=\"Remove property\"\n [attr.aria-label]=\"'Remove property ' + property.Name\" (click)=\"RemoveProperty(i)\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <div class=\"dpd__field\">\n <label [attr.for]=\"'dpd-desc-' + i\">Description</label>\n <input [id]=\"'dpd-desc-' + i\" class=\"mj-input\" type=\"text\" [ngModel]=\"property.Description ?? ''\" (ngModelChange)=\"UpdateProperty(i, { Description: $event })\">\n </div>\n <div class=\"dpd__field\">\n <span class=\"dpd__field-label\">Default</span>\n <mj-property-default-editor [Default]=\"property.Default\" [Type]=\"property.Type\" [Label]=\"'Default of ' + property.Name\"\n (DefaultChange)=\"SetPropertyDefault(i, $event)\"></mj-property-default-editor>\n </div>\n <label class=\"dpd__check\">\n <input type=\"checkbox\" class=\"mj-checkbox\" [ngModel]=\"property.IsRequired === true\" (ngModelChange)=\"UpdateProperty(i, { IsRequired: $event })\">\n Required\n </label>\n </div>\n } @empty {\n <p class=\"dpd__empty\">This dashboard has no properties.</p>\n }\n <button mjButton Variant=\"outline\" Size=\"sm\" type=\"button\" (click)=\"AddProperty()\">\n <i class=\"fa-solid fa-plus\" aria-hidden=\"true\"></i> Add property\n </button>\n </section>\n\n <section>\n <div class=\"dpd__label\">Wires</div>\n <p class=\"dpd__hint\">A wire sets a property from a part's selection, so selecting a row in one part filters the parts that map that property.</p>\n @if (IsLoading) {\n <mj-loading Text=\"Loading parts...\" Size=\"small\"></mj-loading>\n } @else {\n @for (wire of EditWires; track $index; let i = $index) {\n <div class=\"dpd__wire\">\n <select class=\"mj-input\" [attr.aria-label]=\"'Part of wire ' + (i + 1)\" [ngModel]=\"wire.Panel\" (ngModelChange)=\"UpdateWire(i, { Panel: $event })\">\n @for (panel of WireSources; track panel.id) {\n <option [value]=\"panel.id\">{{ panel.title }}</option>\n }\n </select>\n <select class=\"mj-input\" [attr.aria-label]=\"'Event of wire ' + (i + 1)\" [ngModel]=\"wire.Event\" (ngModelChange)=\"UpdateWire(i, { Event: $event })\">\n @for (event of EventsOf(wire); track event.Name) {\n <option [value]=\"event.Name\">{{ event.Name }}</option>\n }\n </select>\n <select class=\"mj-input\" [attr.aria-label]=\"'Value of wire ' + (i + 1)\" [ngModel]=\"wire.Value\" (ngModelChange)=\"UpdateWire(i, { Value: $event })\">\n @for (value of ValuesOf(wire); track value.Name) {\n <option [value]=\"value.Name\">{{ value.Name }}</option>\n }\n </select>\n <span class=\"dpd__arrow\" aria-hidden=\"true\"><i class=\"fa-solid fa-arrow-right\"></i></span>\n <select class=\"mj-input\" [attr.aria-label]=\"'Property of wire ' + (i + 1)\" [ngModel]=\"wire.Property\" (ngModelChange)=\"UpdateWire(i, { Property: $event })\">\n @for (property of EditProperties; track $index) {\n <option [value]=\"property.Name\">{{ property.Name }}</option>\n }\n </select>\n <button mjButton Variant=\"icon\" Size=\"sm\" type=\"button\" title=\"Remove wire\" [attr.aria-label]=\"'Remove wire ' + (i + 1)\" (click)=\"RemoveWire(i)\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n } @empty {\n <p class=\"dpd__empty\">No wires.</p>\n }\n <button mjButton Variant=\"outline\" Size=\"sm\" type=\"button\" [disabled]=\"WireSources.length === 0 || EditProperties.length === 0\" (click)=\"AddWire()\">\n <i class=\"fa-solid fa-plus\" aria-hidden=\"true\"></i> Add wire\n </button>\n }\n </section>\n\n @if (Problems.length > 0) {\n <ul class=\"dpd__problems\" role=\"alert\">\n @for (problem of Problems; track problem) {\n <li>{{ problem }}</li>\n }\n </ul>\n }\n </div>\n <mj-dialog-actions>\n <button mjButton Variant=\"primary\" type=\"button\" [disabled]=\"!CanApply\" (click)=\"Apply()\">\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i> Apply\n </button>\n <button mjButton Variant=\"secondary\" type=\"button\" (click)=\"Cancel()\">Cancel</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ContextToken, PropertyDefault, PropertyOffsetUnit, PropertyValue, PropertyValueType } from '@memberjunction/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** How a default is given: none, a fixed value, or a context token. */
|
|
5
|
+
export type PropertyDefaultMode = 'none' | 'value' | 'token';
|
|
6
|
+
/** A fixed value from what the user typed: a number for a number type, true/false for a boolean, blank for none. */
|
|
7
|
+
export declare function ParseDefaultValueText(text: string, type: PropertyValueType): PropertyValue;
|
|
8
|
+
/**
|
|
9
|
+
* Edits one default (a dashboard property's, or a part input mapping's): none, a fixed value of the
|
|
10
|
+
* given type, or a context token with an optional offset for date tokens. Every change emits a new
|
|
11
|
+
* default (undefined for none) through `DefaultChange`, so `[(Default)]` works.
|
|
12
|
+
*/
|
|
13
|
+
export declare class PropertyDefaultEditorComponent {
|
|
14
|
+
/** The default being edited; undefined for none. */
|
|
15
|
+
Default: PropertyDefault | undefined;
|
|
16
|
+
/** The type a fixed value takes. */
|
|
17
|
+
Type: PropertyValueType;
|
|
18
|
+
/** The accessible name of the controls. */
|
|
19
|
+
Label: string;
|
|
20
|
+
/** The text of the "no default" choice. */
|
|
21
|
+
NoneLabel: string;
|
|
22
|
+
Disabled: boolean;
|
|
23
|
+
DefaultChange: EventEmitter<PropertyDefault | undefined>;
|
|
24
|
+
readonly Tokens: readonly ["Context.UserID", "Context.UserEmail", "Context.UserName", "Context.Now", "Context.Today", "Context.StartOfWeek", "Context.StartOfMonth", "Context.StartOfQuarter", "Context.StartOfYear"];
|
|
25
|
+
readonly OffsetUnits: readonly ["day", "week", "month", "quarter", "year"];
|
|
26
|
+
get Mode(): PropertyDefaultMode;
|
|
27
|
+
/** The fixed value as the text an input shows. */
|
|
28
|
+
get ValueText(): string;
|
|
29
|
+
/** True when the default is a date token, which can take an offset. */
|
|
30
|
+
get TakesOffset(): boolean;
|
|
31
|
+
SetMode(mode: PropertyDefaultMode): void;
|
|
32
|
+
SetValue(text: string): void;
|
|
33
|
+
/** A user token takes no offset, so choosing one drops it. */
|
|
34
|
+
SetToken(token: ContextToken): void;
|
|
35
|
+
/** An offset of 0 (or blank) removes it. */
|
|
36
|
+
SetOffset(amount: number | null, unit: PropertyOffsetUnit): void;
|
|
37
|
+
private emit;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PropertyDefaultEditorComponent, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PropertyDefaultEditorComponent, "mj-property-default-editor", never, { "Default": { "alias": "Default"; "required": false; }; "Type": { "alias": "Type"; "required": false; }; "Label": { "alias": "Label"; "required": false; }; "NoneLabel": { "alias": "NoneLabel"; "required": false; }; "Disabled": { "alias": "Disabled"; "required": false; }; }, { "DefaultChange": "DefaultChange"; }, never, never, false, never>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=property-default-editor.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-default-editor.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialogs/property-default-editor/property-default-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAiB,MAAM,eAAe,CAAC;AACvE,OAAO,EAEH,YAAY,EAEZ,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;;AAE9B,uEAAuE;AACvE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAI7D,oHAAoH;AACpH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAM1F;AAED;;;;GAIG;AACH,qBAkDa,8BAA8B;IACvC,oDAAoD;IAC3C,OAAO,EAAE,eAAe,GAAG,SAAS,CAAa;IAC1D,oCAAoC;IAC3B,IAAI,EAAE,iBAAiB,CAAY;IAC5C,2CAA2C;IAClC,KAAK,SAAa;IAC3B,2CAA2C;IAClC,SAAS,SAAgB;IACzB,QAAQ,UAAS;IAChB,aAAa,4CAAmD;IAE1E,SAAgB,MAAM,uMAAkB;IACxC,SAAgB,WAAW,uDAAyB;IAEpD,IAAW,IAAI,IAAI,mBAAmB,CAGrC;IAED,kDAAkD;IAClD,IAAW,SAAS,IAAI,MAAM,CAG7B;IAED,uEAAuE;IACvE,IAAW,WAAW,IAAI,OAAO,CAEhC;IAEM,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI;IASxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAInC,8DAA8D;IACvD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAK1C,4CAA4C;IACrC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAMvE,OAAO,CAAC,IAAI;yCAzDH,8BAA8B;2CAA9B,8BAA8B;CA6D1C"}
|