@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.
Files changed (84) hide show
  1. package/README.md +17 -3
  2. package/dist/lib/config-panels/artifact-config-panel.component.js +2 -2
  3. package/dist/lib/config-panels/component-config-panel.component.d.ts +51 -0
  4. package/dist/lib/config-panels/component-config-panel.component.d.ts.map +1 -0
  5. package/dist/lib/config-panels/component-config-panel.component.js +246 -0
  6. package/dist/lib/config-panels/component-config-panel.component.js.map +1 -0
  7. package/dist/lib/config-panels/index.d.ts +1 -0
  8. package/dist/lib/config-panels/index.d.ts.map +1 -1
  9. package/dist/lib/config-panels/index.js +1 -0
  10. package/dist/lib/config-panels/index.js.map +1 -1
  11. package/dist/lib/config-panels/query-config-panel.component.js +2 -2
  12. package/dist/lib/config-panels/view-config-panel.component.js +2 -2
  13. package/dist/lib/config-panels/weburl-config-panel.component.js +2 -2
  14. package/dist/lib/dashboard-viewer/dashboard-viewer.component.d.ts +58 -1
  15. package/dist/lib/dashboard-viewer/dashboard-viewer.component.d.ts.map +1 -1
  16. package/dist/lib/dashboard-viewer/dashboard-viewer.component.js +186 -4
  17. package/dist/lib/dashboard-viewer/dashboard-viewer.component.js.map +1 -1
  18. package/dist/lib/dashboard-viewer.module.d.ts +22 -17
  19. package/dist/lib/dashboard-viewer.module.d.ts.map +1 -1
  20. package/dist/lib/dashboard-viewer.module.js +29 -4
  21. package/dist/lib/dashboard-viewer.module.js.map +1 -1
  22. package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.d.ts +35 -1
  23. package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.d.ts.map +1 -1
  24. package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.js +307 -34
  25. package/dist/lib/dialogs/part-dialog/dashboard-part-dialog.component.js.map +1 -1
  26. package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.d.ts +79 -0
  27. package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.d.ts.map +1 -0
  28. package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.js +461 -0
  29. package/dist/lib/dialogs/properties-dialog/dashboard-properties-dialog.component.js.map +1 -0
  30. package/dist/lib/dialogs/property-default-editor/property-default-editor.component.d.ts +41 -0
  31. package/dist/lib/dialogs/property-default-editor/property-default-editor.component.d.ts.map +1 -0
  32. package/dist/lib/dialogs/property-default-editor/property-default-editor.component.js +248 -0
  33. package/dist/lib/dialogs/property-default-editor/property-default-editor.component.js.map +1 -0
  34. package/dist/lib/models/dashboard-config-validator.d.ts +30 -0
  35. package/dist/lib/models/dashboard-config-validator.d.ts.map +1 -0
  36. package/dist/lib/models/dashboard-config-validator.js +107 -0
  37. package/dist/lib/models/dashboard-config-validator.js.map +1 -0
  38. package/dist/lib/models/dashboard-part-interfaces.d.ts +42 -0
  39. package/dist/lib/models/dashboard-part-interfaces.d.ts.map +1 -0
  40. package/dist/lib/models/dashboard-part-interfaces.js +180 -0
  41. package/dist/lib/models/dashboard-part-interfaces.js.map +1 -0
  42. package/dist/lib/models/dashboard-properties.d.ts +182 -0
  43. package/dist/lib/models/dashboard-properties.d.ts.map +1 -0
  44. package/dist/lib/models/dashboard-properties.js +263 -0
  45. package/dist/lib/models/dashboard-properties.js.map +1 -0
  46. package/dist/lib/models/dashboard-types.d.ts +8 -0
  47. package/dist/lib/models/dashboard-types.d.ts.map +1 -1
  48. package/dist/lib/models/dashboard-types.js.map +1 -1
  49. package/dist/lib/models/part-inputs-editor.d.ts +36 -0
  50. package/dist/lib/models/part-inputs-editor.d.ts.map +1 -0
  51. package/dist/lib/models/part-inputs-editor.js +53 -0
  52. package/dist/lib/models/part-inputs-editor.js.map +1 -0
  53. package/dist/lib/parts/artifact-part.component.d.ts.map +1 -1
  54. package/dist/lib/parts/artifact-part.component.js +5 -4
  55. package/dist/lib/parts/artifact-part.component.js.map +1 -1
  56. package/dist/lib/parts/base-dashboard-part.d.ts +50 -1
  57. package/dist/lib/parts/base-dashboard-part.d.ts.map +1 -1
  58. package/dist/lib/parts/base-dashboard-part.js +108 -1
  59. package/dist/lib/parts/base-dashboard-part.js.map +1 -1
  60. package/dist/lib/parts/component-part.component.d.ts +54 -0
  61. package/dist/lib/parts/component-part.component.d.ts.map +1 -0
  62. package/dist/lib/parts/component-part.component.js +221 -0
  63. package/dist/lib/parts/component-part.component.js.map +1 -0
  64. package/dist/lib/parts/index.d.ts +1 -0
  65. package/dist/lib/parts/index.d.ts.map +1 -1
  66. package/dist/lib/parts/index.js +1 -0
  67. package/dist/lib/parts/index.js.map +1 -1
  68. package/dist/lib/parts/query-part.component.d.ts +25 -1
  69. package/dist/lib/parts/query-part.component.d.ts.map +1 -1
  70. package/dist/lib/parts/query-part.component.js +93 -10
  71. package/dist/lib/parts/query-part.component.js.map +1 -1
  72. package/dist/lib/parts/view-part.component.d.ts +18 -1
  73. package/dist/lib/parts/view-part.component.d.ts.map +1 -1
  74. package/dist/lib/parts/view-part.component.js +74 -10
  75. package/dist/lib/parts/view-part.component.js.map +1 -1
  76. package/dist/lib/parts/weburl-part.component.d.ts +14 -0
  77. package/dist/lib/parts/weburl-part.component.d.ts.map +1 -1
  78. package/dist/lib/parts/weburl-part.component.js +62 -5
  79. package/dist/lib/parts/weburl-part.component.js.map +1 -1
  80. package/dist/public-api.d.ts +8 -0
  81. package/dist/public-api.d.ts.map +1 -1
  82. package/dist/public-api.js +8 -0
  83. package/dist/public-api.js.map +1 -1
  84. package/package.json +15 -13
@@ -0,0 +1,263 @@
1
+ /**
2
+ * Dashboard properties, part input mappings, events and wires (plan § 4 and § 4.1).
3
+ *
4
+ * A dashboard declares properties; a host sets their values once; each part maps them onto its own
5
+ * inputs under its own names. A wire sets a dashboard property from a part's event (a selection),
6
+ * never a part's input. All of it is optional and lives in the dashboard's saved config: a dashboard
7
+ * with no properties, mappings or wires renders and saves exactly as before.
8
+ *
9
+ * Everything here is plain TypeScript, so it is tested without Angular.
10
+ */
11
+ import { IsPropertyValueOfType, ResolvePropertyDefault, } from '@memberjunction/core';
12
+ /** A part that declares nothing (an Artifact part, or a part whose source isn't chosen yet). */
13
+ export const EMPTY_PART_INTERFACE = { Inputs: [], Events: [] };
14
+ /** An event a part raised (informational, so no Before/After pair). Values null: the selection was cleared. */
15
+ export class DashboardPartEventArgs {
16
+ Event;
17
+ Values;
18
+ constructor(
19
+ /** The event's name, one the part declares. */
20
+ Event,
21
+ /** The event's values by name (a record's fields, a row's columns, an event's parameters), or null. */
22
+ Values) {
23
+ this.Event = Event;
24
+ this.Values = Values;
25
+ }
26
+ }
27
+ /** The part config key that holds a part's input mappings. */
28
+ export const INPUT_MAPPINGS_KEY = 'inputMappings';
29
+ /** The View part's selection event and the Query part's. */
30
+ export const RECORD_SELECTED_EVENT = 'RecordSelected';
31
+ export const ROW_SELECTED_EVENT = 'RowSelected';
32
+ /**
33
+ * True when a value of type `source` can fill an input or property of type `target`: the same type,
34
+ * either side `any`, or a uuid or date into a string.
35
+ */
36
+ export function IsTypeCompatible(source, target) {
37
+ if (source === 'unsupported' || target === 'unsupported')
38
+ return false;
39
+ if (source === 'any' || target === 'any' || source === target)
40
+ return true;
41
+ return target === 'string' && (source === 'uuid' || source === 'date');
42
+ }
43
+ /** A SQL type name (an entity field's or a query column's) as a dashboard value type. */
44
+ export function SqlTypeToValueType(sqlType) {
45
+ const raw = (sqlType ?? '').toLowerCase();
46
+ const parenIdx = raw.indexOf('(');
47
+ const t = (parenIdx >= 0 ? raw.slice(0, parenIdx) : raw).trim();
48
+ if (t === 'uniqueidentifier' || t === 'uuid')
49
+ return 'uuid';
50
+ if (['bit', 'boolean', 'bool'].includes(t))
51
+ return 'boolean';
52
+ if (['int', 'bigint', 'smallint', 'tinyint', 'decimal', 'numeric', 'float', 'real', 'money', 'smallmoney', 'integer', 'double precision'].includes(t))
53
+ return 'number';
54
+ if (['date', 'datetime', 'datetime2', 'datetimeoffset', 'smalldatetime', 'timestamp', 'timestamptz'].includes(t))
55
+ return 'date';
56
+ if (['char', 'varchar', 'nchar', 'nvarchar', 'text', 'ntext', 'citext'].includes(t))
57
+ return 'string';
58
+ return 'any';
59
+ }
60
+ /** A component prop's or event parameter's declared type as a dashboard value type. */
61
+ export function ComponentTypeToValueType(type) {
62
+ const t = (type ?? '').trim().toLowerCase();
63
+ if (t === 'string' || t === 'number' || t === 'boolean')
64
+ return t;
65
+ return t === '' || t === 'any' ? 'any' : 'unsupported';
66
+ }
67
+ /** Matches `{Name}` placeholders in a Web URL part's URL. */
68
+ const URL_PLACEHOLDER = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
69
+ /** The distinct `{Name}` placeholders in a URL, in order. */
70
+ export function ParseUrlPlaceholders(url) {
71
+ const names = [];
72
+ for (const match of (url ?? '').matchAll(URL_PLACEHOLDER)) {
73
+ if (!names.includes(match[1]))
74
+ names.push(match[1]);
75
+ }
76
+ return names;
77
+ }
78
+ /** The URL with each placeholder that has a value replaced by the URL-encoded value. Others stay. */
79
+ export function FillUrlPlaceholders(url, values) {
80
+ return url.replace(URL_PLACEHOLDER, (whole, name) => {
81
+ const value = values[name];
82
+ return value === null || value === undefined ? whole : encodeURIComponent(String(value));
83
+ });
84
+ }
85
+ /** The input mappings in a part's config; empty when it has none. */
86
+ export function GetInputMappings(config) {
87
+ const mappings = config?.[INPUT_MAPPINGS_KEY];
88
+ return Array.isArray(mappings) ? mappings : [];
89
+ }
90
+ /**
91
+ * A value from an event (a record field, a row column, an event parameter) as a property value: a
92
+ * Date becomes an ISO string, a primitive stays, anything else (an object, a list) is no value.
93
+ */
94
+ export function NormalizeEventValue(value) {
95
+ if (value instanceof Date)
96
+ return isNaN(value.getTime()) ? null : value.toISOString();
97
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')
98
+ return value;
99
+ return null;
100
+ }
101
+ /** Works out a default, or null when it can't be (a malformed default is refused on save). */
102
+ function resolveDefault(def, ctx) {
103
+ if (!def)
104
+ return null;
105
+ try {
106
+ return ResolvePropertyDefault(def, ctx);
107
+ }
108
+ catch {
109
+ return null;
110
+ }
111
+ }
112
+ function hasValue(value) {
113
+ return value !== null && value !== undefined;
114
+ }
115
+ /**
116
+ * Works out the dashboard's property values. For each property, the first of: the value the host
117
+ * set; the value the latest wired event set; the property's default (a token worked out with the
118
+ * context's user, clock and zone). A host value of null or undefined counts as not set.
119
+ *
120
+ * No loops: the values a panel sees leave out the values its own events set, so a part is never
121
+ * refreshed by its own selection.
122
+ */
123
+ export class DashboardPropertyResolver {
124
+ properties;
125
+ ctx;
126
+ hostValues = {};
127
+ eventValues = new Map();
128
+ constructor(properties, ctx) {
129
+ this.properties = properties;
130
+ this.ctx = ctx;
131
+ }
132
+ /** The dashboard's properties. */
133
+ get Properties() {
134
+ return this.properties;
135
+ }
136
+ /** Takes a new list of properties; event values for properties that no longer exist are dropped. */
137
+ SetProperties(properties) {
138
+ this.properties = properties;
139
+ for (const name of [...this.eventValues.keys()]) {
140
+ if (!properties.some(p => p.Name === name))
141
+ this.eventValues.delete(name);
142
+ }
143
+ }
144
+ /** Takes the host's values (the viewer's Properties input). */
145
+ SetHostValues(values) {
146
+ this.hostValues = { ...(values ?? {}) };
147
+ }
148
+ /** Records that a panel's event set a property. A null value clears it, as a cleared selection does. */
149
+ SetEventValue(property, value, panel) {
150
+ if (value === null) {
151
+ this.ClearEventValue(property, panel);
152
+ }
153
+ else {
154
+ this.eventValues.set(property, { Value: value, Panel: panel });
155
+ }
156
+ }
157
+ /** Removes every event value, as when the parts are rebuilt and their selections are gone. */
158
+ ClearEventValues() {
159
+ this.eventValues.clear();
160
+ }
161
+ /** Removes the event value of a property, when that panel set it. */
162
+ ClearEventValue(property, panel) {
163
+ if (this.eventValues.get(property)?.Panel === panel)
164
+ this.eventValues.delete(property);
165
+ }
166
+ /** Every property's value as the panel sees it (without the values its own events set). */
167
+ ValuesFor(panel) {
168
+ const ctx = this.ctx();
169
+ const values = {};
170
+ for (const property of this.properties) {
171
+ values[property.Name] = this.valueOf(property, panel, ctx);
172
+ }
173
+ return values;
174
+ }
175
+ valueOf(property, panel, ctx) {
176
+ const host = NormalizeEventValue(this.hostValues[property.Name]);
177
+ if (hasValue(host))
178
+ return host;
179
+ const event = this.eventValues.get(property.Name);
180
+ if (event && event.Panel !== panel && hasValue(event.Value))
181
+ return event.Value;
182
+ return resolveDefault(property.Default, ctx);
183
+ }
184
+ }
185
+ /**
186
+ * Why a mapping doesn't fit, or null when it does: an input the part doesn't declare, an input only
187
+ * the server may set, a property the dashboard doesn't have, or types that don't match.
188
+ */
189
+ export function MappingProblem(mapping, inputs, properties) {
190
+ const input = inputs.find(i => i.Name === mapping.Input);
191
+ if (!input)
192
+ return `Input "${mapping.Input}" is not one the part declares.`;
193
+ if (input.ServerSet)
194
+ return `Input "${mapping.Input}" is set by the server and can't be mapped.`;
195
+ if (mapping.Property) {
196
+ const property = properties.find(p => p.Name === mapping.Property);
197
+ if (!property)
198
+ return `Input "${mapping.Input}" is mapped from "${mapping.Property}", which the dashboard doesn't have.`;
199
+ if (!IsTypeCompatible(property.Type, input.Type)) {
200
+ return `Input "${mapping.Input}" (${input.Type}) can't take "${mapping.Property}" (${property.Type}).`;
201
+ }
202
+ }
203
+ if (!mapping.Property && !mapping.Default)
204
+ return `Input "${mapping.Input}" has neither a property nor a default.`;
205
+ return null;
206
+ }
207
+ /**
208
+ * Works out a part's inputs from its mappings, in the plan's order: the dashboard property's value
209
+ * (host, then event, then the property's default, already in `values`), then the mapping's default,
210
+ * then the input's own default (no key: the part applies it).
211
+ *
212
+ * A required input with none of these is missing. An unmapped input the user fills on the part (a
213
+ * query parameter) is left to the user; one only the server sets is never missing here.
214
+ */
215
+ export function ResolvePartInputs(inputs, mappings, properties, values, ctx) {
216
+ const resolution = { Values: {}, Missing: [], Broken: [] };
217
+ for (const mapping of mappings) {
218
+ const problem = MappingProblem(mapping, inputs, properties);
219
+ if (problem) {
220
+ resolution.Broken.push(problem);
221
+ continue;
222
+ }
223
+ const fromProperty = mapping.Property ? values[mapping.Property] : null;
224
+ const value = hasValue(fromProperty) ? fromProperty : resolveDefault(mapping.Default, ctx);
225
+ if (hasValue(value))
226
+ resolution.Values[mapping.Input] = value;
227
+ }
228
+ resolution.Missing = inputs
229
+ .filter(input => isMissing(input, mappings.some(m => m.Input === input.Name), resolution.Values))
230
+ .map(input => input.Name);
231
+ return resolution;
232
+ }
233
+ function isMissing(input, mapped, values) {
234
+ if (!input.IsRequired || input.HasOwnDefault || input.ServerSet || hasValue(values[input.Name]))
235
+ return false;
236
+ return mapped || !input.UserCanFill;
237
+ }
238
+ /** A stable key for a resolution, so a part reloads only when what it runs with changed. */
239
+ export function PartInputResolutionKey(resolution) {
240
+ if (!resolution)
241
+ return '';
242
+ const values = Object.keys(resolution.Values).sort().map(k => [k, resolution.Values[k]]);
243
+ return JSON.stringify({ v: values, m: resolution.Missing, b: resolution.Broken });
244
+ }
245
+ /** The message a part shows when it stops: its broken mappings, then its missing inputs. */
246
+ export function PartInputProblemMessage(resolution) {
247
+ if (!resolution)
248
+ return null;
249
+ const lines = [...resolution.Broken];
250
+ if (resolution.Missing.length > 0) {
251
+ lines.push(`Missing a value for ${resolution.Missing.map(n => `"${n}"`).join(', ')}.`);
252
+ }
253
+ return lines.length > 0 ? lines.join(' ') : null;
254
+ }
255
+ /** True when a value fits a dashboard value type (`any` takes every value; null fits all). */
256
+ export function IsValueOfDashboardType(value, type) {
257
+ if (type === 'any')
258
+ return true;
259
+ if (type === 'unsupported')
260
+ return value === null;
261
+ return IsPropertyValueOfType(value, type);
262
+ }
263
+ //# sourceMappingURL=dashboard-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-properties.js","sourceRoot":"","sources":["../../../src/lib/models/dashboard-properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACH,qBAAqB,EAKrB,sBAAsB,GACzB,MAAM,sBAAsB,CAAC;AA2E9B,gGAAgG;AAChG,MAAM,CAAC,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,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,sBAAsB,CAAC,KAAoB,EAAE,IAAwB;IACjF,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,IAAI,KAAK,aAAa;QAAE,OAAO,KAAK,KAAK,IAAI,CAAC;IAClD,OAAO,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * Dashboard properties, part input mappings, events and wires (plan § 4 and § 4.1).\n *\n * A dashboard declares properties; a host sets their values once; each part maps them onto its own\n * inputs under its own names. A wire sets a dashboard property from a part's event (a selection),\n * never a part's input. All of it is optional and lives in the dashboard's saved config: a dashboard\n * with no properties, mappings or wires renders and saves exactly as before.\n *\n * Everything here is plain TypeScript, so it is tested without Angular.\n */\nimport {\n IsPropertyValueOfType,\n PropertyDefault,\n PropertyResolutionContext,\n PropertyValue,\n PropertyValueType,\n ResolvePropertyDefault,\n} from '@memberjunction/core';\n\n/** A dashboard property: a view property's shape without Target and AllowOverride. */\nexport interface DashboardProperty {\n /** Unique within the dashboard. */\n Name: string;\n Type: PropertyValueType;\n Description?: string;\n /** Used when neither the host nor a wired event gives a value: a fixed value or a context token. */\n Default?: PropertyDefault;\n /** True: a part input it feeds has no value until something sets it. Shown in the designer. */\n IsRequired?: boolean;\n}\n\n/** One of a part's inputs, fed by a dashboard property, fixed by a default, or both. */\nexport interface DashboardPartInputMapping {\n /** The part's own input: a view property, a query parameter, a component prop or a URL placeholder. */\n Input: string;\n /** The dashboard property that feeds it. Omitted: the input takes Default alone. */\n Property?: string;\n /** Used when the dashboard property has no value, and always when Property is omitted. */\n Default?: PropertyDefault;\n}\n\n/** Sets a dashboard property from one value of a part's event. */\nexport interface DashboardWire {\n /** The panel (part) that raises the event. */\n Panel: string;\n /** One of the events that part declares. */\n Event: string;\n /** Which of the event's values: a record's field, a row's column or an event's parameter. */\n Value: string;\n /** The dashboard property it sets. */\n Property: string;\n}\n\n/**\n * The type of a part's input or event value. `any` takes every property type (a URL placeholder, a\n * component prop typed `any`); `unsupported` takes none (an array parameter, an object prop).\n */\nexport type DashboardValueType = PropertyValueType | 'any' | 'unsupported';\n\n/** One input a part declares. */\nexport interface DashboardPartInput {\n Name: string;\n Type: DashboardValueType;\n Description?: string;\n /** The part can't run without a value for it. */\n IsRequired: boolean;\n /** The input has a default of its own (a view property's or query parameter's default, a prop's defaultValue). */\n HasOwnDefault: boolean;\n /** Only server code sets it (a view property with AllowOverride false, a server-set query parameter): never mapped. */\n ServerSet: boolean;\n /** The user fills it on the part when it is not mapped (a query parameter in the parameter form). */\n UserCanFill?: boolean;\n}\n\n/** One value an event carries. */\nexport interface DashboardEventValue {\n Name: string;\n Type: DashboardValueType;\n}\n\n/** One event a part declares. */\nexport interface DashboardPartEventInfo {\n Name: string;\n Values: DashboardEventValue[];\n}\n\n/** What a part declares: its inputs and its events. */\nexport interface DashboardPartInterface {\n Inputs: DashboardPartInput[];\n Events: DashboardPartEventInfo[];\n}\n\n/** A part that declares nothing (an Artifact part, or a part whose source isn't chosen yet). */\nexport const EMPTY_PART_INTERFACE: DashboardPartInterface = { Inputs: [], Events: [] };\n\n/** The values of a dashboard's properties as one part sees them. */\nexport type DashboardPropertyValues = Record<string, PropertyValue>;\n\n/** What the viewer hands a part: the dashboard's properties and their values for that part. */\nexport interface DashboardPartContext {\n Properties: DashboardProperty[];\n Values: DashboardPropertyValues;\n}\n\n/** An event a part raised (informational, so no Before/After pair). Values null: the selection was cleared. */\nexport class DashboardPartEventArgs {\n constructor(\n /** The event's name, one the part declares. */\n public Event: string,\n /** The event's values by name (a record's fields, a row's columns, an event's parameters), or null. */\n public Values: Record<string, unknown> | null,\n ) {}\n}\n\n/** A part's inputs worked out from the dashboard. */\nexport interface PartInputResolution {\n /** A value for each mapped input that has one. An input without a key takes its own default. */\n Values: Record<string, PropertyValue>;\n /** Required inputs with no value: the part stops and names them. */\n Missing: string[];\n /** Mappings that no longer fit the part or the dashboard: the part stops and shows them. */\n Broken: string[];\n}\n\n/** The part config key that holds a part's input mappings. */\nexport const INPUT_MAPPINGS_KEY = 'inputMappings';\n\n/** The View part's selection event and the Query part's. */\nexport const RECORD_SELECTED_EVENT = 'RecordSelected';\nexport const ROW_SELECTED_EVENT = 'RowSelected';\n\n/**\n * True when a value of type `source` can fill an input or property of type `target`: the same type,\n * either side `any`, or a uuid or date into a string.\n */\nexport function IsTypeCompatible(source: DashboardValueType, target: DashboardValueType): boolean {\n if (source === 'unsupported' || target === 'unsupported') return false;\n if (source === 'any' || target === 'any' || source === target) return true;\n return target === 'string' && (source === 'uuid' || source === 'date');\n}\n\n/** A SQL type name (an entity field's or a query column's) as a dashboard value type. */\nexport function SqlTypeToValueType(sqlType: string | null | undefined): DashboardValueType {\n const raw = (sqlType ?? '').toLowerCase();\n const parenIdx = raw.indexOf('(');\n const t = (parenIdx >= 0 ? raw.slice(0, parenIdx) : raw).trim();\n if (t === 'uniqueidentifier' || t === 'uuid') return 'uuid';\n if (['bit', 'boolean', 'bool'].includes(t)) return 'boolean';\n if (['int', 'bigint', 'smallint', 'tinyint', 'decimal', 'numeric', 'float', 'real', 'money', 'smallmoney', 'integer', 'double precision'].includes(t)) return 'number';\n if (['date', 'datetime', 'datetime2', 'datetimeoffset', 'smalldatetime', 'timestamp', 'timestamptz'].includes(t)) return 'date';\n if (['char', 'varchar', 'nchar', 'nvarchar', 'text', 'ntext', 'citext'].includes(t)) return 'string';\n return 'any';\n}\n\n/** A component prop's or event parameter's declared type as a dashboard value type. */\nexport function ComponentTypeToValueType(type: string | null | undefined): DashboardValueType {\n const t = (type ?? '').trim().toLowerCase();\n if (t === 'string' || t === 'number' || t === 'boolean') return t;\n return t === '' || t === 'any' ? 'any' : 'unsupported';\n}\n\n/** Matches `{Name}` placeholders in a Web URL part's URL. */\nconst URL_PLACEHOLDER = /\\{([A-Za-z_][A-Za-z0-9_]*)\\}/g;\n\n/** The distinct `{Name}` placeholders in a URL, in order. */\nexport function ParseUrlPlaceholders(url: string | null | undefined): string[] {\n const names: string[] = [];\n for (const match of (url ?? '').matchAll(URL_PLACEHOLDER)) {\n if (!names.includes(match[1])) names.push(match[1]);\n }\n return names;\n}\n\n/** The URL with each placeholder that has a value replaced by the URL-encoded value. Others stay. */\nexport function FillUrlPlaceholders(url: string, values: Record<string, PropertyValue>): string {\n return url.replace(URL_PLACEHOLDER, (whole, name: string) => {\n const value = values[name];\n return value === null || value === undefined ? whole : encodeURIComponent(String(value));\n });\n}\n\n/** The input mappings in a part's config; empty when it has none. */\nexport function GetInputMappings(config: Record<string, unknown> | null | undefined): DashboardPartInputMapping[] {\n const mappings = config?.[INPUT_MAPPINGS_KEY];\n return Array.isArray(mappings) ? (mappings as DashboardPartInputMapping[]) : [];\n}\n\n/**\n * A value from an event (a record field, a row column, an event parameter) as a property value: a\n * Date becomes an ISO string, a primitive stays, anything else (an object, a list) is no value.\n */\nexport function NormalizeEventValue(value: unknown): PropertyValue {\n if (value instanceof Date) return isNaN(value.getTime()) ? null : value.toISOString();\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') return value;\n return null;\n}\n\n/** Works out a default, or null when it can't be (a malformed default is refused on save). */\nfunction resolveDefault(def: PropertyDefault | undefined, ctx: PropertyResolutionContext): PropertyValue {\n if (!def) return null;\n try {\n return ResolvePropertyDefault(def, ctx);\n } catch {\n return null;\n }\n}\n\nfunction hasValue(value: PropertyValue | undefined): value is string | number | boolean {\n return value !== null && value !== undefined;\n}\n\n/** The value an event set for a property, and the panel whose event set it. */\ninterface EventValue {\n Value: PropertyValue;\n Panel: string;\n}\n\n/**\n * Works out the dashboard's property values. For each property, the first of: the value the host\n * set; the value the latest wired event set; the property's default (a token worked out with the\n * context's user, clock and zone). A host value of null or undefined counts as not set.\n *\n * No loops: the values a panel sees leave out the values its own events set, so a part is never\n * refreshed by its own selection.\n */\nexport class DashboardPropertyResolver {\n private hostValues: Record<string, unknown> = {};\n private readonly eventValues = new Map<string, EventValue>();\n\n constructor(private properties: DashboardProperty[], private readonly ctx: () => PropertyResolutionContext) {}\n\n /** The dashboard's properties. */\n public get Properties(): DashboardProperty[] {\n return this.properties;\n }\n\n /** Takes a new list of properties; event values for properties that no longer exist are dropped. */\n public SetProperties(properties: DashboardProperty[]): void {\n this.properties = properties;\n for (const name of [...this.eventValues.keys()]) {\n if (!properties.some(p => p.Name === name)) this.eventValues.delete(name);\n }\n }\n\n /** Takes the host's values (the viewer's Properties input). */\n public SetHostValues(values: Record<string, unknown> | null | undefined): void {\n this.hostValues = { ...(values ?? {}) };\n }\n\n /** Records that a panel's event set a property. A null value clears it, as a cleared selection does. */\n public SetEventValue(property: string, value: PropertyValue, panel: string): void {\n if (value === null) {\n this.ClearEventValue(property, panel);\n } else {\n this.eventValues.set(property, { Value: value, Panel: panel });\n }\n }\n\n /** Removes every event value, as when the parts are rebuilt and their selections are gone. */\n public ClearEventValues(): void {\n this.eventValues.clear();\n }\n\n /** Removes the event value of a property, when that panel set it. */\n public ClearEventValue(property: string, panel: string): void {\n if (this.eventValues.get(property)?.Panel === panel) this.eventValues.delete(property);\n }\n\n /** Every property's value as the panel sees it (without the values its own events set). */\n public ValuesFor(panel: string | null): DashboardPropertyValues {\n const ctx = this.ctx();\n const values: DashboardPropertyValues = {};\n for (const property of this.properties) {\n values[property.Name] = this.valueOf(property, panel, ctx);\n }\n return values;\n }\n\n private valueOf(property: DashboardProperty, panel: string | null, ctx: PropertyResolutionContext): PropertyValue {\n const host = NormalizeEventValue(this.hostValues[property.Name]);\n if (hasValue(host)) return host;\n const event = this.eventValues.get(property.Name);\n if (event && event.Panel !== panel && hasValue(event.Value)) return event.Value;\n return resolveDefault(property.Default, ctx);\n }\n}\n\n/**\n * Why a mapping doesn't fit, or null when it does: an input the part doesn't declare, an input only\n * the server may set, a property the dashboard doesn't have, or types that don't match.\n */\nexport function MappingProblem(mapping: DashboardPartInputMapping, inputs: DashboardPartInput[], properties: DashboardProperty[]): string | null {\n const input = inputs.find(i => i.Name === mapping.Input);\n if (!input) return `Input \"${mapping.Input}\" is not one the part declares.`;\n if (input.ServerSet) return `Input \"${mapping.Input}\" is set by the server and can't be mapped.`;\n if (mapping.Property) {\n const property = properties.find(p => p.Name === mapping.Property);\n if (!property) return `Input \"${mapping.Input}\" is mapped from \"${mapping.Property}\", which the dashboard doesn't have.`;\n if (!IsTypeCompatible(property.Type, input.Type)) {\n return `Input \"${mapping.Input}\" (${input.Type}) can't take \"${mapping.Property}\" (${property.Type}).`;\n }\n }\n if (!mapping.Property && !mapping.Default) return `Input \"${mapping.Input}\" has neither a property nor a default.`;\n return null;\n}\n\n/**\n * Works out a part's inputs from its mappings, in the plan's order: the dashboard property's value\n * (host, then event, then the property's default, already in `values`), then the mapping's default,\n * then the input's own default (no key: the part applies it).\n *\n * A required input with none of these is missing. An unmapped input the user fills on the part (a\n * query parameter) is left to the user; one only the server sets is never missing here.\n */\nexport function ResolvePartInputs(\n inputs: DashboardPartInput[],\n mappings: DashboardPartInputMapping[],\n properties: DashboardProperty[],\n values: DashboardPropertyValues,\n ctx: PropertyResolutionContext,\n): PartInputResolution {\n const resolution: PartInputResolution = { Values: {}, Missing: [], Broken: [] };\n for (const mapping of mappings) {\n const problem = MappingProblem(mapping, inputs, properties);\n if (problem) {\n resolution.Broken.push(problem);\n continue;\n }\n const fromProperty = mapping.Property ? values[mapping.Property] : null;\n const value = hasValue(fromProperty) ? fromProperty : resolveDefault(mapping.Default, ctx);\n if (hasValue(value)) resolution.Values[mapping.Input] = value;\n }\n resolution.Missing = inputs\n .filter(input => isMissing(input, mappings.some(m => m.Input === input.Name), resolution.Values))\n .map(input => input.Name);\n return resolution;\n}\n\nfunction isMissing(input: DashboardPartInput, mapped: boolean, values: Record<string, PropertyValue>): boolean {\n if (!input.IsRequired || input.HasOwnDefault || input.ServerSet || hasValue(values[input.Name])) return false;\n return mapped || !input.UserCanFill;\n}\n\n/** A stable key for a resolution, so a part reloads only when what it runs with changed. */\nexport function PartInputResolutionKey(resolution: PartInputResolution | null): string {\n if (!resolution) return '';\n const values = Object.keys(resolution.Values).sort().map(k => [k, resolution.Values[k]]);\n return JSON.stringify({ v: values, m: resolution.Missing, b: resolution.Broken });\n}\n\n/** The message a part shows when it stops: its broken mappings, then its missing inputs. */\nexport function PartInputProblemMessage(resolution: PartInputResolution | null): string | null {\n if (!resolution) return null;\n const lines = [...resolution.Broken];\n if (resolution.Missing.length > 0) {\n lines.push(`Missing a value for ${resolution.Missing.map(n => `\"${n}\"`).join(', ')}.`);\n }\n return lines.length > 0 ? lines.join(' ') : null;\n}\n\n/** True when a value fits a dashboard value type (`any` takes every value; null fits all). */\nexport function IsValueOfDashboardType(value: PropertyValue, type: DashboardValueType): boolean {\n if (type === 'any') return true;\n if (type === 'unsupported') return value === null;\n return IsPropertyValueOfType(value, type);\n}\n"]}
@@ -8,6 +8,7 @@
8
8
  * - No redundant arrays or conversion functions needed
9
9
  */
10
10
  import { ResolvedLayoutConfig } from 'golden-layout';
11
+ import type { DashboardProperty, DashboardWire } from './dashboard-properties';
11
12
  /**
12
13
  * Root configuration for a dashboard.
13
14
  * Stored in Dashboard.UIConfigDetails as JSON.
@@ -24,6 +25,13 @@ export interface DashboardConfig {
24
25
  layout: ResolvedLayoutConfig | null;
25
26
  /** Dashboard-level settings (not per-panel) */
26
27
  settings: DashboardSettings;
28
+ /**
29
+ * The dashboard's properties: values a host sets once (the viewer's `Properties` input) and each
30
+ * part maps onto its own inputs (`inputMappings` in the part's config). Absent: none.
31
+ */
32
+ Properties?: DashboardProperty[];
33
+ /** Wires: a part's event sets a dashboard property. Absent: none. */
34
+ Wires?: DashboardWire[];
27
35
  }
28
36
  /**
29
37
  * Dashboard-level settings
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-types.d.ts","sourceRoot":"","sources":["../../../src/lib/models/dashboard-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAMrD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpC,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,mBAAmB;IACnB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,YAAY,EAAE,OAAO,CAAC;IACtB,mCAAmC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,sCAAsC;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,mCAAmC;IACnC,YAAY,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAOxC,CAAC;AAMF;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IACxB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAMD;;GAEG;AACH,MAAM,WAAW,q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AAC,MAAM,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,IAAI,IAAI,CAAC;AACtD,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,iBAAiB,CAAC,MAAmC,EAAE,OAAe;IAClF,OAAO,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * Types and interfaces for the Dashboard Viewer component.\n * These define the configuration schema for metadata-driven dashboards.\n *\n * DESIGN PRINCIPLE: Single Source of Truth\n * - Golden Layout's native config is the ground truth for layout AND panel data\n * - Full DashboardPanel objects are stored in componentState within the layout\n * - No redundant arrays or conversion functions needed\n */\n\nimport { ResolvedLayoutConfig } from 'golden-layout';\n\n// ========================================\n// Dashboard Configuration\n// ========================================\n\n/**\n * Root configuration for a dashboard.\n * Stored in Dashboard.UIConfigDetails as JSON.\n *\n * The layout contains EVERYTHING - both geometry AND panel configurations.\n * Panel data is embedded in each component's componentState within the layout tree.\n */\nexport interface DashboardConfig {\n /**\n * Golden Layout configuration - THE SINGLE SOURCE OF TRUTH\n * Contains both layout geometry AND panel configurations (in componentState)\n * Stored as GL's native format for lossless persistence\n */\n layout: ResolvedLayoutConfig | null;\n /** Dashboard-level settings (not per-panel) */\n settings: DashboardSettings;\n}\n\n/**\n * Dashboard-level settings\n */\nexport interface DashboardSettings {\n /** Visual theme */\n theme: 'light' | 'dark';\n /** Show panel headers with title/actions */\n showHeaders: boolean;\n /** Allow panels to pop out into separate windows */\n enablePopout: boolean;\n /** Allow panels to be maximized */\n enableMaximize: boolean;\n /** Allow users to rearrange panels */\n enableDragDrop: boolean;\n /** Allow users to resize panels */\n enableResize: boolean;\n}\n\n/**\n * Default dashboard settings\n */\nexport const DEFAULT_DASHBOARD_SETTINGS: DashboardSettings = {\n theme: 'light',\n showHeaders: true,\n enablePopout: false,\n enableMaximize: true,\n enableDragDrop: true,\n enableResize: true\n};\n\n// ========================================\n// Panel Configuration (stored in componentState)\n// ========================================\n\n/**\n * Complete panel data stored in Golden Layout's componentState.\n * This is the ONLY place panel configuration lives.\n */\nexport interface DashboardPanel {\n /** Unique panel identifier */\n id: string;\n /** Display title */\n title: string;\n /** Optional icon class (Font Awesome) */\n icon?: string;\n /** Reference to DashboardPartType.ID */\n partTypeId: string;\n /** Type-specific configuration */\n config: PanelConfig;\n /** Persisted panel state (e.g., scroll position, selections) */\n state?: Record<string, unknown>;\n}\n\n/**\n * Generic panel configuration interface.\n * Each panel type (View, Query, Artifact, WebURL, etc.) defines its own config shape.\n * The `type` field must match the DashboardPartType.Name from metadata.\n *\n * This is intentionally generic to support pluggable panel types - new types can be\n * added via metadata without requiring code changes to this interface.\n */\nexport interface PanelConfig {\n /** Type discriminator - must match DashboardPartType.Name */\n type: string;\n /** Any additional configuration properties specific to the panel type */\n [key: string]: unknown;\n}\n\n// ========================================\n// Events\n// ========================================\n\n/**\n * Event emitted when a panel interacts with content\n */\nexport interface PanelInteractionEvent {\n /** Panel that emitted the event */\n panelId: string;\n /** Type of interaction */\n interactionType: 'record-select' | 'record-open' | 'entity-link' | 'query-execute' | 'custom';\n /** Interaction payload */\n payload: Record<string, unknown>;\n}\n\n/**\n * Event emitted when dashboard configuration changes\n */\nexport interface DashboardConfigChangedEvent {\n /** Updated configuration */\n config: DashboardConfig;\n /** What changed */\n changeType: 'panel-added' | 'panel-removed' | 'panel-config' | 'layout' | 'settings';\n}\n\n/**\n * Event emitted when layout changes (resize, move, etc.)\n */\nexport interface LayoutChangedEvent {\n /** Updated layout - Golden Layout's native format */\n layout: ResolvedLayoutConfig;\n /** What changed */\n changeType: 'resize' | 'move' | 'stack' | 'close' | 'maximize';\n}\n\n// ========================================\n// Navigation Request Events\n// ========================================\n\n/**\n * Union type for all navigation requests from dashboard parts.\n * These are high-level abstractions - the parent component handles routing.\n */\nexport type DashboardNavRequest =\n | OpenEntityRecordNavRequest\n | OpenDashboardNavRequest\n | OpenQueryNavRequest\n | OpenApplicationNavRequest\n | OpenNavItemNavRequest;\n\n/**\n * Base interface for navigation requests\n */\nexport interface BaseNavRequest {\n /** Type discriminator for the navigation request */\n type: string;\n /** Source panel ID that initiated the request */\n sourcePanelId: string;\n /** Whether to open in a new tab/window */\n openInNewTab?: boolean;\n}\n\n/**\n * Request to open a specific entity record by entity name and ID\n */\nexport interface OpenEntityRecordNavRequest extends BaseNavRequest {\n type: 'OpenEntityRecord';\n /** Entity name */\n entityName: string;\n /** Record primary key value (URL segment format) */\n recordId: string;\n /** Optional: Open in edit or view mode */\n mode?: 'view' | 'edit';\n}\n\n/**\n * Request to navigate to another dashboard\n */\nexport interface OpenDashboardNavRequest extends BaseNavRequest {\n type: 'OpenDashboard';\n /** Dashboard ID */\n dashboardId: string;\n /** Optional: Dashboard category to navigate to first */\n categoryId?: string;\n}\n\n/**\n * Request to navigate to a query\n */\nexport interface OpenQueryNavRequest extends BaseNavRequest {\n type: 'OpenQuery';\n /** Query ID */\n queryId: string;\n /** Optional: Pre-filled parameter values */\n parameters?: Record<string, unknown>;\n /** Optional: Auto-execute on open */\n autoExecute?: boolean;\n}\n\n/**\n * Request to navigate to another application\n */\nexport interface OpenApplicationNavRequest extends BaseNavRequest {\n type: 'OpenApplication';\n /** Application name or ID */\n applicationId: string;\n /** Optional: Specific resource/tab within the app */\n resourceName?: string;\n}\n\n/**\n * Request to navigate to a specific nav item within an application.\n * Supports setting URL query parameters after navigation.\n */\nexport interface OpenNavItemNavRequest extends BaseNavRequest {\n type: 'OpenNavItem';\n /** Application name (e.g., 'Data Explorer'). If omitted, stays in current app. */\n appName?: string;\n /** Navigation item label within the app (e.g., 'Queries') */\n navItemName: string;\n /** URL query parameters to apply after navigation */\n queryParams?: Record<string, string>;\n}\n\n/**\n * Event wrapper for navigation requests emitted from dashboard parts\n */\nexport interface DashboardNavRequestEvent {\n /** The navigation request */\n request: DashboardNavRequest;\n /** Panel data at time of request (for context) */\n panel: DashboardPanel;\n}\n\n// ========================================\n// Validation\n// ========================================\n\n/**\n * Result of configuration validation\n */\nexport interface ValidationResult {\n /** Whether the configuration is valid */\n valid: boolean;\n /** Validation errors */\n errors: ValidationError[];\n /** Validation warnings */\n warnings: ValidationWarning[];\n}\n\nexport interface ValidationError {\n field: string;\n message: string;\n}\n\nexport interface ValidationWarning {\n field: string;\n message: string;\n}\n\n// ========================================\n// Utility Functions\n// ========================================\n\n/**\n * Creates a default dashboard configuration with empty layout\n */\nexport function CreateDefaultDashboardConfig(): DashboardConfig {\n return {\n layout: null,\n settings: { ...DEFAULT_DASHBOARD_SETTINGS }\n };\n}\n\n/** @deprecated Use {@link CreateDefaultDashboardConfig}. */\nexport function createDefaultDashboardConfig(): DashboardConfig {\n return CreateDefaultDashboardConfig();\n}\n\n/**\n * Generates a unique panel ID\n */\nexport function GeneratePanelId(): string {\n return `panel-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\n\n/** @deprecated Use {@link GeneratePanelId}. */\nexport function generatePanelId(): string {\n return GeneratePanelId();\n}\n\n/**\n * Extract all panels from a Golden Layout config.\n * Walks the layout tree and extracts DashboardPanel from each component's componentState.\n */\nexport function ExtractPanelsFromLayout(layout: ResolvedLayoutConfig | null): DashboardPanel[] {\n if (!layout?.root) {\n return [];\n }\n\n const panels: DashboardPanel[] = [];\n\n const extractFromNode = (node: ResolvedLayoutConfig['root']): void => {\n if (!node) return;\n\n // If this is a component, extract the panel from componentState\n if (node.type === 'component') {\n const componentNode = node as unknown as { componentState?: DashboardPanel };\n if (componentNode.componentState?.id) {\n panels.push(componentNode.componentState);\n }\n }\n\n // Recursively process children\n const containerNode = node as unknown as { content?: ResolvedLayoutConfig['root'][] };\n if (containerNode.content && Array.isArray(containerNode.content)) {\n for (const child of containerNode.content) {\n extractFromNode(child);\n }\n }\n };\n\n extractFromNode(layout.root);\n return panels;\n}\n\n/** @deprecated Use {@link ExtractPanelsFromLayout}. */\nexport function extractPanelsFromLayout(layout: ResolvedLayoutConfig | null): DashboardPanel[] {\n return ExtractPanelsFromLayout(layout);\n}\n\n/**\n * Find a panel in the layout by ID\n */\nexport function FindPanelInLayout(layout: ResolvedLayoutConfig | null, panelId: string): DashboardPanel | null {\n const panels = ExtractPanelsFromLayout(layout);\n return panels.find(p => p.id === panelId) || null;\n}\n\n/** @deprecated Use {@link FindPanelInLayout}. */\nexport function findPanelInLayout(layout: ResolvedLayoutConfig | null, panelId: string): DashboardPanel | null {\n return FindPanelInLayout(layout, panelId);\n}\n\n"]}
1
+ {"version":3,"file":"dashboard-types.js","sourceRoot":"","sources":["../../../src/lib/models/dashboard-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoDH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsB;IACzD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,KAAK;IACnB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,IAAI;CACrB,CAAC;AAyMF,2CAA2C;AAC3C,oBAAoB;AACpB,2CAA2C;AAE3C;;GAEG;AACH,MAAM,UAAU,4BAA4B;IACxC,OAAO;QACH,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,EAAE,GAAG,0BAA0B,EAAE;KAC9C,CAAC;AACN,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,4BAA4B;IACxC,OAAO,4BAA4B,EAAE,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC3B,OAAO,SAAS,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC/E,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,eAAe;IAC3B,OAAO,eAAe,EAAE,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uB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U,iBAAiB,CAAC,MAAmC,EAAE,OAAe;IAClF,OAAO,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * Types and interfaces for the Dashboard Viewer component.\n * These define the configuration schema for metadata-driven dashboards.\n *\n * DESIGN PRINCIPLE: Single Source of Truth\n * - Golden Layout's native config is the ground truth for layout AND panel data\n * - Full DashboardPanel objects are stored in componentState within the layout\n * - No redundant arrays or conversion functions needed\n */\n\nimport { ResolvedLayoutConfig } from 'golden-layout';\nimport type { DashboardProperty, DashboardWire } from './dashboard-properties';\n\n// ========================================\n// Dashboard Configuration\n// ========================================\n\n/**\n * Root configuration for a dashboard.\n * Stored in Dashboard.UIConfigDetails as JSON.\n *\n * The layout contains EVERYTHING - both geometry AND panel configurations.\n * Panel data is embedded in each component's componentState within the layout tree.\n */\nexport interface DashboardConfig {\n /**\n * Golden Layout configuration - THE SINGLE SOURCE OF TRUTH\n * Contains both layout geometry AND panel configurations (in componentState)\n * Stored as GL's native format for lossless persistence\n */\n layout: ResolvedLayoutConfig | null;\n /** Dashboard-level settings (not per-panel) */\n settings: DashboardSettings;\n /**\n * The dashboard's properties: values a host sets once (the viewer's `Properties` input) and each\n * part maps onto its own inputs (`inputMappings` in the part's config). Absent: none.\n */\n Properties?: DashboardProperty[];\n /** Wires: a part's event sets a dashboard property. Absent: none. */\n Wires?: DashboardWire[];\n}\n\n/**\n * Dashboard-level settings\n */\nexport interface DashboardSettings {\n /** Visual theme */\n theme: 'light' | 'dark';\n /** Show panel headers with title/actions */\n showHeaders: boolean;\n /** Allow panels to pop out into separate windows */\n enablePopout: boolean;\n /** Allow panels to be maximized */\n enableMaximize: boolean;\n /** Allow users to rearrange panels */\n enableDragDrop: boolean;\n /** Allow users to resize panels */\n enableResize: boolean;\n}\n\n/**\n * Default dashboard settings\n */\nexport const DEFAULT_DASHBOARD_SETTINGS: DashboardSettings = {\n theme: 'light',\n showHeaders: true,\n enablePopout: false,\n enableMaximize: true,\n enableDragDrop: true,\n enableResize: true\n};\n\n// ========================================\n// Panel Configuration (stored in componentState)\n// ========================================\n\n/**\n * Complete panel data stored in Golden Layout's componentState.\n * This is the ONLY place panel configuration lives.\n */\nexport interface DashboardPanel {\n /** Unique panel identifier */\n id: string;\n /** Display title */\n title: string;\n /** Optional icon class (Font Awesome) */\n icon?: string;\n /** Reference to DashboardPartType.ID */\n partTypeId: string;\n /** Type-specific configuration */\n config: PanelConfig;\n /** Persisted panel state (e.g., scroll position, selections) */\n state?: Record<string, unknown>;\n}\n\n/**\n * Generic panel configuration interface.\n * Each panel type (View, Query, Artifact, WebURL, etc.) defines its own config shape.\n * The `type` field must match the DashboardPartType.Name from metadata.\n *\n * This is intentionally generic to support pluggable panel types - new types can be\n * added via metadata without requiring code changes to this interface.\n */\nexport interface PanelConfig {\n /** Type discriminator - must match DashboardPartType.Name */\n type: string;\n /** Any additional configuration properties specific to the panel type */\n [key: string]: unknown;\n}\n\n// ========================================\n// Events\n// ========================================\n\n/**\n * Event emitted when a panel interacts with content\n */\nexport interface PanelInteractionEvent {\n /** Panel that emitted the event */\n panelId: string;\n /** Type of interaction */\n interactionType: 'record-select' | 'record-open' | 'entity-link' | 'query-execute' | 'custom';\n /** Interaction payload */\n payload: Record<string, unknown>;\n}\n\n/**\n * Event emitted when dashboard configuration changes\n */\nexport interface DashboardConfigChangedEvent {\n /** Updated configuration */\n config: DashboardConfig;\n /** What changed */\n changeType: 'panel-added' | 'panel-removed' | 'panel-config' | 'layout' | 'settings';\n}\n\n/**\n * Event emitted when layout changes (resize, move, etc.)\n */\nexport interface LayoutChangedEvent {\n /** Updated layout - Golden Layout's native format */\n layout: ResolvedLayoutConfig;\n /** What changed */\n changeType: 'resize' | 'move' | 'stack' | 'close' | 'maximize';\n}\n\n// ========================================\n// Navigation Request Events\n// ========================================\n\n/**\n * Union type for all navigation requests from dashboard parts.\n * These are high-level abstractions - the parent component handles routing.\n */\nexport type DashboardNavRequest =\n | OpenEntityRecordNavRequest\n | OpenDashboardNavRequest\n | OpenQueryNavRequest\n | OpenApplicationNavRequest\n | OpenNavItemNavRequest;\n\n/**\n * Base interface for navigation requests\n */\nexport interface BaseNavRequest {\n /** Type discriminator for the navigation request */\n type: string;\n /** Source panel ID that initiated the request */\n sourcePanelId: string;\n /** Whether to open in a new tab/window */\n openInNewTab?: boolean;\n}\n\n/**\n * Request to open a specific entity record by entity name and ID\n */\nexport interface OpenEntityRecordNavRequest extends BaseNavRequest {\n type: 'OpenEntityRecord';\n /** Entity name */\n entityName: string;\n /** Record primary key value (URL segment format) */\n recordId: string;\n /** Optional: Open in edit or view mode */\n mode?: 'view' | 'edit';\n}\n\n/**\n * Request to navigate to another dashboard\n */\nexport interface OpenDashboardNavRequest extends BaseNavRequest {\n type: 'OpenDashboard';\n /** Dashboard ID */\n dashboardId: string;\n /** Optional: Dashboard category to navigate to first */\n categoryId?: string;\n}\n\n/**\n * Request to navigate to a query\n */\nexport interface OpenQueryNavRequest extends BaseNavRequest {\n type: 'OpenQuery';\n /** Query ID */\n queryId: string;\n /** Optional: Pre-filled parameter values */\n parameters?: Record<string, unknown>;\n /** Optional: Auto-execute on open */\n autoExecute?: boolean;\n}\n\n/**\n * Request to navigate to another application\n */\nexport interface OpenApplicationNavRequest extends BaseNavRequest {\n type: 'OpenApplication';\n /** Application name or ID */\n applicationId: string;\n /** Optional: Specific resource/tab within the app */\n resourceName?: string;\n}\n\n/**\n * Request to navigate to a specific nav item within an application.\n * Supports setting URL query parameters after navigation.\n */\nexport interface OpenNavItemNavRequest extends BaseNavRequest {\n type: 'OpenNavItem';\n /** Application name (e.g., 'Data Explorer'). If omitted, stays in current app. */\n appName?: string;\n /** Navigation item label within the app (e.g., 'Queries') */\n navItemName: string;\n /** URL query parameters to apply after navigation */\n queryParams?: Record<string, string>;\n}\n\n/**\n * Event wrapper for navigation requests emitted from dashboard parts\n */\nexport interface DashboardNavRequestEvent {\n /** The navigation request */\n request: DashboardNavRequest;\n /** Panel data at time of request (for context) */\n panel: DashboardPanel;\n}\n\n// ========================================\n// Validation\n// ========================================\n\n/**\n * Result of configuration validation\n */\nexport interface ValidationResult {\n /** Whether the configuration is valid */\n valid: boolean;\n /** Validation errors */\n errors: ValidationError[];\n /** Validation warnings */\n warnings: ValidationWarning[];\n}\n\nexport interface ValidationError {\n field: string;\n message: string;\n}\n\nexport interface ValidationWarning {\n field: string;\n message: string;\n}\n\n// ========================================\n// Utility Functions\n// ========================================\n\n/**\n * Creates a default dashboard configuration with empty layout\n */\nexport function CreateDefaultDashboardConfig(): DashboardConfig {\n return {\n layout: null,\n settings: { ...DEFAULT_DASHBOARD_SETTINGS }\n };\n}\n\n/** @deprecated Use {@link CreateDefaultDashboardConfig}. */\nexport function createDefaultDashboardConfig(): DashboardConfig {\n return CreateDefaultDashboardConfig();\n}\n\n/**\n * Generates a unique panel ID\n */\nexport function GeneratePanelId(): string {\n return `panel-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\n\n/** @deprecated Use {@link GeneratePanelId}. */\nexport function generatePanelId(): string {\n return GeneratePanelId();\n}\n\n/**\n * Extract all panels from a Golden Layout config.\n * Walks the layout tree and extracts DashboardPanel from each component's componentState.\n */\nexport function ExtractPanelsFromLayout(layout: ResolvedLayoutConfig | null): DashboardPanel[] {\n if (!layout?.root) {\n return [];\n }\n\n const panels: DashboardPanel[] = [];\n\n const extractFromNode = (node: ResolvedLayoutConfig['root']): void => {\n if (!node) return;\n\n // If this is a component, extract the panel from componentState\n if (node.type === 'component') {\n const componentNode = node as unknown as { componentState?: DashboardPanel };\n if (componentNode.componentState?.id) {\n panels.push(componentNode.componentState);\n }\n }\n\n // Recursively process children\n const containerNode = node as unknown as { content?: ResolvedLayoutConfig['root'][] };\n if (containerNode.content && Array.isArray(containerNode.content)) {\n for (const child of containerNode.content) {\n extractFromNode(child);\n }\n }\n };\n\n extractFromNode(layout.root);\n return panels;\n}\n\n/** @deprecated Use {@link ExtractPanelsFromLayout}. */\nexport function extractPanelsFromLayout(layout: ResolvedLayoutConfig | null): DashboardPanel[] {\n return ExtractPanelsFromLayout(layout);\n}\n\n/**\n * Find a panel in the layout by ID\n */\nexport function FindPanelInLayout(layout: ResolvedLayoutConfig | null, panelId: string): DashboardPanel | null {\n const panels = ExtractPanelsFromLayout(layout);\n return panels.find(p => p.id === panelId) || null;\n}\n\n/** @deprecated Use {@link FindPanelInLayout}. */\nexport function findPanelInLayout(layout: ResolvedLayoutConfig | null, panelId: string): DashboardPanel | null {\n return FindPanelInLayout(layout, panelId);\n}\n\n"]}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The model behind a part's Inputs list in the part dialog: every input the part declares, each fed
3
+ * by a dashboard property, fixed by a default, both (the default when the property has no value), or
4
+ * left to its own default. Server-set inputs are listed but can't be mapped. Mappings to inputs the
5
+ * part no longer declares are kept apart so the user sees and removes them. Plain TypeScript.
6
+ */
7
+ import type { PropertyDefault, PropertyValueType } from '@memberjunction/core';
8
+ import { DashboardPartInput, DashboardPartInputMapping, DashboardPartInterface, DashboardProperty } from './dashboard-properties';
9
+ /** One declared input and how it is fed. */
10
+ export interface PartInputRow {
11
+ Input: DashboardPartInput;
12
+ /** The dashboard property that feeds it, or null. */
13
+ Property: string | null;
14
+ /** Its default: alone it fixes the input; with a property it is used when the property has no value. */
15
+ Default: PropertyDefault | undefined;
16
+ }
17
+ export declare class PartInputsEditor {
18
+ readonly Interface: DashboardPartInterface;
19
+ /** One row per declared input, in the part's order. */
20
+ readonly Rows: PartInputRow[];
21
+ /** Mappings to inputs the part doesn't declare (for example a view property renamed since). */
22
+ Orphans: DashboardPartInputMapping[];
23
+ constructor(Interface: DashboardPartInterface, mappings: DashboardPartInputMapping[]);
24
+ /** The type a row's default takes: the input's type, or text for an input that takes any value. */
25
+ DefaultType(row: PartInputRow): PropertyValueType;
26
+ /** The dashboard properties whose type fits the row's input. */
27
+ CompatibleProperties(row: PartInputRow, properties: DashboardProperty[]): DashboardProperty[];
28
+ /** True when the input can be mapped: not server-set, and of a type a property can fill. */
29
+ CanMap(row: PartInputRow): boolean;
30
+ RemoveOrphan(index: number): void;
31
+ /** The part's mappings: each row with a property or a default, then the orphans (which a save refuses). */
32
+ BuildMappings(): DashboardPartInputMapping[];
33
+ /** What the part dialog refuses: undeclared or server-set inputs, missing properties, mismatched types, bad defaults. */
34
+ Problems(partTitle: string, properties: DashboardProperty[]): string[];
35
+ }
36
+ //# sourceMappingURL=part-inputs-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"part-inputs-editor.d.ts","sourceRoot":"","sources":["../../../src/lib/models/part-inputs-editor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EACH,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EAEpB,MAAM,wBAAwB,CAAC;AAEhC,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,wGAAwG;IACxG,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;CACxC;AAED,qBAAa,gBAAgB;aAMG,SAAS,EAAE,sBAAsB;IAL7D,uDAAuD;IACvD,SAAgB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrC,+FAA+F;IACxF,OAAO,EAAE,yBAAyB,EAAE,CAAC;gBAEhB,SAAS,EAAE,sBAAsB,EAAE,QAAQ,EAAE,yBAAyB,EAAE;IAQpG,mGAAmG;IAC5F,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,iBAAiB;IAKxD,gEAAgE;IACzD,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE;IAIpG,4FAA4F;IACrF,MAAM,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO;IAIlC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIxC,2GAA2G;IACpG,aAAa,IAAI,yBAAyB,EAAE;IAYnD,yHAAyH;IAClH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE;CAGhF"}
@@ -0,0 +1,53 @@
1
+ import { ValidatePartMappings } from './dashboard-config-validator';
2
+ import { IsTypeCompatible, } from './dashboard-properties';
3
+ export class PartInputsEditor {
4
+ Interface;
5
+ /** One row per declared input, in the part's order. */
6
+ Rows;
7
+ /** Mappings to inputs the part doesn't declare (for example a view property renamed since). */
8
+ Orphans;
9
+ constructor(Interface, mappings) {
10
+ this.Interface = Interface;
11
+ this.Rows = Interface.Inputs.map(input => {
12
+ const mapping = mappings.find(m => m.Input === input.Name);
13
+ return { Input: input, Property: mapping?.Property ?? null, Default: mapping?.Default };
14
+ });
15
+ this.Orphans = mappings.filter(m => !Interface.Inputs.some(i => i.Name === m.Input));
16
+ }
17
+ /** The type a row's default takes: the input's type, or text for an input that takes any value. */
18
+ DefaultType(row) {
19
+ const type = row.Input.Type;
20
+ return type === 'any' || type === 'unsupported' ? 'string' : type;
21
+ }
22
+ /** The dashboard properties whose type fits the row's input. */
23
+ CompatibleProperties(row, properties) {
24
+ return properties.filter(p => IsTypeCompatible(p.Type, row.Input.Type));
25
+ }
26
+ /** True when the input can be mapped: not server-set, and of a type a property can fill. */
27
+ CanMap(row) {
28
+ return !row.Input.ServerSet && row.Input.Type !== 'unsupported';
29
+ }
30
+ RemoveOrphan(index) {
31
+ this.Orphans = this.Orphans.filter((_, i) => i !== index);
32
+ }
33
+ /** The part's mappings: each row with a property or a default, then the orphans (which a save refuses). */
34
+ BuildMappings() {
35
+ const mappings = [];
36
+ for (const row of this.Rows) {
37
+ if (!row.Property && !row.Default)
38
+ continue;
39
+ const mapping = { Input: row.Input.Name };
40
+ if (row.Property)
41
+ mapping.Property = row.Property;
42
+ if (row.Default)
43
+ mapping.Default = row.Default;
44
+ mappings.push(mapping);
45
+ }
46
+ return [...mappings, ...this.Orphans];
47
+ }
48
+ /** What the part dialog refuses: undeclared or server-set inputs, missing properties, mismatched types, bad defaults. */
49
+ Problems(partTitle, properties) {
50
+ return ValidatePartMappings(partTitle, this.BuildMappings(), this.Interface, properties);
51
+ }
52
+ }
53
+ //# sourceMappingURL=part-inputs-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"part-inputs-editor.js","sourceRoot":"","sources":["../../../src/lib/models/part-inputs-editor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAKH,gBAAgB,GACnB,MAAM,wBAAwB,CAAC;AAWhC,MAAM,OAAO,gBAAgB;IAMG;IAL5B,uDAAuD;IACvC,IAAI,CAAiB;IACrC,+FAA+F;IACxF,OAAO,CAA8B;IAE5C,YAA4B,SAAiC,EAAE,QAAqC;QAAxE,cAAS,GAAT,SAAS,CAAwB;QACzD,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACrC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAC5F,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,mGAAmG;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AQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,yHAAyH;IAClH,QAAQ,CAAC,SAAiB,EAAE,UAA+B;QAC9D,OAAO,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC7F,CAAC;CACJ","sourcesContent":["/**\n * The model behind a part's Inputs list in the part dialog: every input the part declares, each fed\n * by a dashboard property, fixed by a default, both (the default when the property has no value), or\n * left to its own default. Server-set inputs are listed but can't be mapped. Mappings to inputs the\n * part no longer declares are kept apart so the user sees and removes them. Plain TypeScript.\n */\nimport type { PropertyDefault, PropertyValueType } from '@memberjunction/core';\nimport { ValidatePartMappings } from './dashboard-config-validator';\nimport {\n DashboardPartInput,\n DashboardPartInputMapping,\n DashboardPartInterface,\n DashboardProperty,\n IsTypeCompatible,\n} from './dashboard-properties';\n\n/** One declared input and how it is fed. */\nexport interface PartInputRow {\n Input: DashboardPartInput;\n /** The dashboard property that feeds it, or null. */\n Property: string | null;\n /** Its default: alone it fixes the input; with a property it is used when the property has no value. */\n Default: PropertyDefault | undefined;\n}\n\nexport class PartInputsEditor {\n /** One row per declared input, in the part's order. */\n public readonly Rows: PartInputRow[];\n /** Mappings to inputs the part doesn't declare (for example a view property renamed since). */\n public Orphans: DashboardPartInputMapping[];\n\n constructor(public readonly Interface: DashboardPartInterface, mappings: DashboardPartInputMapping[]) {\n this.Rows = Interface.Inputs.map(input => {\n const mapping = mappings.find(m => m.Input === input.Name);\n return { Input: input, Property: mapping?.Property ?? null, Default: mapping?.Default };\n });\n this.Orphans = mappings.filter(m => !Interface.Inputs.some(i => i.Name === m.Input));\n }\n\n /** The type a row's default takes: the input's type, or text for an input that takes any value. */\n public DefaultType(row: PartInputRow): PropertyValueType {\n const type = row.Input.Type;\n return type === 'any' || type === 'unsupported' ? 'string' : type;\n }\n\n /** The dashboard properties whose type fits the row's input. */\n public CompatibleProperties(row: PartInputRow, properties: DashboardProperty[]): DashboardProperty[] {\n return properties.filter(p => IsTypeCompatible(p.Type, row.Input.Type));\n }\n\n /** True when the input can be mapped: not server-set, and of a type a property can fill. */\n public CanMap(row: PartInputRow): boolean {\n return !row.Input.ServerSet && row.Input.Type !== 'unsupported';\n }\n\n public RemoveOrphan(index: number): void {\n this.Orphans = this.Orphans.filter((_, i) => i !== index);\n }\n\n /** The part's mappings: each row with a property or a default, then the orphans (which a save refuses). */\n public BuildMappings(): DashboardPartInputMapping[] {\n const mappings: DashboardPartInputMapping[] = [];\n for (const row of this.Rows) {\n if (!row.Property && !row.Default) continue;\n const mapping: DashboardPartInputMapping = { Input: row.Input.Name };\n if (row.Property) mapping.Property = row.Property;\n if (row.Default) mapping.Default = row.Default;\n mappings.push(mapping);\n }\n return [...mappings, ...this.Orphans];\n }\n\n /** What the part dialog refuses: undeclared or server-set inputs, missing properties, mismatched types, bad defaults. */\n public Problems(partTitle: string, properties: DashboardProperty[]): string[] {\n return ValidatePartMappings(partTitle, this.BuildMappings(), this.Interface, properties);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-part.component.d.ts","sourceRoot":"","sources":["../../../src/lib/parts/artifact-part.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAS,MAAM,eAAe,CAAC;AAE9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;;AAE/B;;;GAGG;AACH,qBA+Fa,qBAAsB,SAAQ,iBA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
  i0.ɵɵelementEnd();
34
34
  } if (rf & 2) {
35
35
  const ctx_r0 = i0.ɵɵnextContext();
36
- i0.ɵɵproperty("artifactId", ctx_r0.artifactId)("currentUser", ctx_r0.currentUser)("environmentId", ctx_r0.environmentId)("versionNumber", ctx_r0.versionNumber)("showSaveToCollection", false)("showHeader", ctx_r0.showHeader)("showTabs", ctx_r0.showTabs)("showCloseButton", ctx_r0.showCloseButton)("showMaximizeButton", ctx_r0.showMaximizeButton)("viewContext", null)("canShare", false)("canEdit", false)("isMaximized", false)("refreshTrigger", ctx_r0.refreshTrigger);
36
+ i0.ɵɵproperty("Provider", ctx_r0.Provider)("artifactId", ctx_r0.artifactId)("currentUser", ctx_r0.currentUser)("environmentId", ctx_r0.environmentId)("versionNumber", ctx_r0.versionNumber)("showSaveToCollection", false)("showHeader", ctx_r0.showHeader)("showTabs", ctx_r0.showTabs)("showCloseButton", ctx_r0.showCloseButton)("showMaximizeButton", ctx_r0.showMaximizeButton)("viewContext", null)("canShare", false)("canEdit", false)("isMaximized", false)("refreshTrigger", ctx_r0.refreshTrigger);
37
37
  } }
38
38
  /**
39
39
  * Runtime renderer for Artifact dashboard parts.
@@ -259,12 +259,12 @@ let ArtifactPartComponent = class ArtifactPartComponent extends BaseDashboardPar
259
259
  this.VersionNumber = undefined;
260
260
  }
261
261
  static ɵfac = function ArtifactPartComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ArtifactPartComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.AnalyzeArtifactService)); };
262
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactPartComponent, selectors: [["mj-artifact-part"]], inputs: { CurrentUser: "CurrentUser", EnvironmentId: "EnvironmentId" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 5, vars: 8, consts: [[1, "artifact-part"], [1, "loading-state"], ["Variant", "error", "Icon", "fa-solid fa-triangle-exclamation", "Title", "Couldn't load artifact", "Size", "compact", 1, "part-placeholder", 3, "Message"], ["Icon", "fa-solid fa-palette", "Title", "No Artifact Selected", "Message", "Use Edit part to choose an artifact.", "Size", "compact", 1, "part-placeholder"], [3, "artifactId", "currentUser", "environmentId", "versionNumber", "showSaveToCollection", "showHeader", "showTabs", "showCloseButton", "showMaximizeButton", "viewContext", "canShare", "canEdit", "isMaximized", "refreshTrigger"], ["text", "Loading artifact..."], [3, "navigateToLink", "openEntityRecord", "navigationRequest", "analyzeRequested", "artifactId", "currentUser", "environmentId", "versionNumber", "showSaveToCollection", "showHeader", "showTabs", "showCloseButton", "showMaximizeButton", "viewContext", "canShare", "canEdit", "isMaximized", "refreshTrigger"]], template: function ArtifactPartComponent_Template(rf, ctx) { if (rf & 1) {
262
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactPartComponent, selectors: [["mj-artifact-part"]], inputs: { CurrentUser: "CurrentUser", EnvironmentId: "EnvironmentId" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 5, vars: 8, consts: [[1, "artifact-part"], [1, "loading-state"], ["Variant", "error", "Icon", "fa-solid fa-triangle-exclamation", "Title", "Couldn't load artifact", "Size", "compact", 1, "part-placeholder", 3, "Message"], ["Icon", "fa-solid fa-palette", "Title", "No Artifact Selected", "Message", "Use Edit part to choose an artifact.", "Size", "compact", 1, "part-placeholder"], [3, "Provider", "artifactId", "currentUser", "environmentId", "versionNumber", "showSaveToCollection", "showHeader", "showTabs", "showCloseButton", "showMaximizeButton", "viewContext", "canShare", "canEdit", "isMaximized", "refreshTrigger"], ["text", "Loading artifact..."], [3, "navigateToLink", "openEntityRecord", "navigationRequest", "analyzeRequested", "Provider", "artifactId", "currentUser", "environmentId", "versionNumber", "showSaveToCollection", "showHeader", "showTabs", "showCloseButton", "showMaximizeButton", "viewContext", "canShare", "canEdit", "isMaximized", "refreshTrigger"]], template: function ArtifactPartComponent_Template(rf, ctx) { if (rf & 1) {
263
263
  i0.ɵɵelementStart(0, "div", 0);
264
264
  i0.ɵɵconditionalCreate(1, ArtifactPartComponent_Conditional_1_Template, 2, 0, "div", 1);
265
265
  i0.ɵɵconditionalCreate(2, ArtifactPartComponent_Conditional_2_Template, 1, 1, "mj-empty-state", 2);
266
266
  i0.ɵɵconditionalCreate(3, ArtifactPartComponent_Conditional_3_Template, 1, 0, "mj-empty-state", 3);
267
- i0.ɵɵconditionalCreate(4, ArtifactPartComponent_Conditional_4_Template, 1, 14, "mj-artifact-viewer-panel", 4);
267
+ i0.ɵɵconditionalCreate(4, ArtifactPartComponent_Conditional_4_Template, 1, 15, "mj-artifact-viewer-panel", 4);
268
268
  i0.ɵɵelementEnd();
269
269
  } if (rf & 2) {
270
270
  i0.ɵɵclassProp("loading", ctx.IsLoading)("error", ctx.ErrorMessage);
@@ -317,6 +317,7 @@ export { ArtifactPartComponent };
317
317
  <!-- Artifact Viewer Panel -->
318
318
  @if (!IsLoading && !ErrorMessage && hasArtifact && artifactId) {
319
319
  <mj-artifact-viewer-panel
320
+ [Provider]="Provider"
320
321
  [artifactId]="artifactId"
321
322
  [currentUser]="currentUser"
322
323
  [environmentId]="environmentId"
@@ -344,5 +345,5 @@ export { ArtifactPartComponent };
344
345
  }], EnvironmentId: [{
345
346
  type: Input
346
347
  }] }); })();
347
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactPartComponent, { className: "ArtifactPartComponent", filePath: "src/lib/parts/artifact-part.component.ts", lineNumber: 108 }); })();
348
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactPartComponent, { className: "ArtifactPartComponent", filePath: "src/lib/parts/artifact-part.component.ts", lineNumber: 109 }); })();
348
349
  //# sourceMappingURL=artifact-part.component.js.map