@memberjunction/ng-entity-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 (87) hide show
  1. package/README.md +28 -0
  2. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts +48 -1
  3. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts.map +1 -1
  4. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js +631 -279
  5. package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js.map +1 -1
  6. package/dist/lib/entity-cards/entity-cards.component.d.ts +2 -0
  7. package/dist/lib/entity-cards/entity-cards.component.d.ts.map +1 -1
  8. package/dist/lib/entity-cards/entity-cards.component.js +30 -2
  9. package/dist/lib/entity-cards/entity-cards.component.js.map +1 -1
  10. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts +64 -2
  11. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -1
  12. package/dist/lib/entity-data-grid/entity-data-grid.component.js +516 -187
  13. package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -1
  14. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts +2 -0
  15. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts.map +1 -1
  16. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js +38 -4
  17. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js.map +1 -1
  18. package/dist/lib/entity-viewer/entity-viewer.component.d.ts +39 -3
  19. package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
  20. package/dist/lib/entity-viewer/entity-viewer.component.js +189 -50
  21. package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
  22. package/dist/lib/entity-viewer/view-property-chips.d.ts +17 -0
  23. package/dist/lib/entity-viewer/view-property-chips.d.ts.map +1 -0
  24. package/dist/lib/entity-viewer/view-property-chips.js +42 -0
  25. package/dist/lib/entity-viewer/view-property-chips.js.map +1 -0
  26. package/dist/lib/recycle-bin/recycle-bin-chip.component.d.ts +10 -2
  27. package/dist/lib/recycle-bin/recycle-bin-chip.component.d.ts.map +1 -1
  28. package/dist/lib/recycle-bin/recycle-bin-chip.component.js +37 -5
  29. package/dist/lib/recycle-bin/recycle-bin-chip.component.js.map +1 -1
  30. package/dist/lib/recycle-bin/recycle-bin.component.js +3 -3
  31. package/dist/lib/recycle-bin/recycle-bin.component.js.map +1 -1
  32. package/dist/lib/utils/record.util.d.ts +21 -1
  33. package/dist/lib/utils/record.util.d.ts.map +1 -1
  34. package/dist/lib/utils/record.util.js +108 -0
  35. package/dist/lib/utils/record.util.js.map +1 -1
  36. package/dist/lib/view-config-panel/view-config-panel.component.d.ts +378 -54
  37. package/dist/lib/view-config-panel/view-config-panel.component.d.ts.map +1 -1
  38. package/dist/lib/view-config-panel/view-config-panel.component.js +3837 -1010
  39. package/dist/lib/view-config-panel/view-config-panel.component.js.map +1 -1
  40. package/dist/lib/view-properties-editor/view-properties-editor.component.d.ts +52 -0
  41. package/dist/lib/view-properties-editor/view-properties-editor.component.d.ts.map +1 -0
  42. package/dist/lib/view-properties-editor/view-properties-editor.component.js +445 -0
  43. package/dist/lib/view-properties-editor/view-properties-editor.component.js.map +1 -0
  44. package/dist/lib/view-selector/view-selector.component.d.ts +22 -1
  45. package/dist/lib/view-selector/view-selector.component.d.ts.map +1 -1
  46. package/dist/lib/view-selector/view-selector.component.js +288 -149
  47. package/dist/lib/view-selector/view-selector.component.js.map +1 -1
  48. package/dist/lib/view-types/descriptors/calendar-view-type.d.ts +22 -0
  49. package/dist/lib/view-types/descriptors/calendar-view-type.d.ts.map +1 -0
  50. package/dist/lib/view-types/descriptors/calendar-view-type.js +38 -0
  51. package/dist/lib/view-types/descriptors/calendar-view-type.js.map +1 -0
  52. package/dist/lib/view-types/index.d.ts +3 -2
  53. package/dist/lib/view-types/index.d.ts.map +1 -1
  54. package/dist/lib/view-types/index.js +5 -2
  55. package/dist/lib/view-types/index.js.map +1 -1
  56. package/dist/lib/view-types/renderers/calendar-placement.d.ts +97 -0
  57. package/dist/lib/view-types/renderers/calendar-placement.d.ts.map +1 -0
  58. package/dist/lib/view-types/renderers/calendar-placement.js +145 -0
  59. package/dist/lib/view-types/renderers/calendar-placement.js.map +1 -0
  60. package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.d.ts +36 -0
  61. package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.d.ts.map +1 -0
  62. package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.js +167 -0
  63. package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.js.map +1 -0
  64. package/dist/lib/view-types/renderers/calendar-view-renderer.component.d.ts +107 -0
  65. package/dist/lib/view-types/renderers/calendar-view-renderer.component.d.ts.map +1 -0
  66. package/dist/lib/view-types/renderers/calendar-view-renderer.component.js +501 -0
  67. package/dist/lib/view-types/renderers/calendar-view-renderer.component.js.map +1 -0
  68. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts +3 -1
  69. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts.map +1 -1
  70. package/dist/lib/view-types/renderers/grid-view-renderer.component.js +12 -3
  71. package/dist/lib/view-types/renderers/grid-view-renderer.component.js.map +1 -1
  72. package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts.map +1 -1
  73. package/dist/lib/view-types/renderers/map-view-renderer.component.js +3 -3
  74. package/dist/lib/view-types/renderers/map-view-renderer.component.js.map +1 -1
  75. package/dist/lib/view-workspace/view-workspace.component.d.ts +40 -1
  76. package/dist/lib/view-workspace/view-workspace.component.d.ts.map +1 -1
  77. package/dist/lib/view-workspace/view-workspace.component.js +185 -15
  78. package/dist/lib/view-workspace/view-workspace.component.js.map +1 -1
  79. package/dist/module.d.ts +35 -31
  80. package/dist/module.d.ts.map +1 -1
  81. package/dist/module.js +21 -3
  82. package/dist/module.js.map +1 -1
  83. package/dist/public-api.d.ts +5 -0
  84. package/dist/public-api.d.ts.map +1 -1
  85. package/dist/public-api.js +5 -0
  86. package/dist/public-api.js.map +1 -1
  87. package/package.json +22 -21
@@ -0,0 +1,52 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { ContextToken, EntityFieldInfo, EntityInfo, PropertyOffsetUnit, PropertyValueType, UserViewProperty, UserViewPropertyOperator } from '@memberjunction/core';
3
+ import * as i0 from "@angular/core";
4
+ /** How a property's default is given in the editor. */
5
+ export type ViewPropertyDefaultMode = 'none' | 'value' | 'token';
6
+ /**
7
+ * The Properties panel of the view designer: add, edit and remove a view's declared properties
8
+ * (name, type, description, default as a fixed value or a token with an offset, required, allow
9
+ * override, target field and operator). Edits are immutable: every change emits a new list
10
+ * through `PropertiesChange`, so `[(Properties)]` works.
11
+ */
12
+ export declare class ViewPropertiesEditorComponent {
13
+ /** The view's entity: its fields are the targets a property can filter. */
14
+ Entity: EntityInfo | null;
15
+ /** The properties being edited. */
16
+ Properties: UserViewProperty[];
17
+ /** True when the user cannot edit the view. */
18
+ Disabled: boolean;
19
+ PropertiesChange: EventEmitter<UserViewProperty[]>;
20
+ readonly Types: readonly ["string", "number", "boolean", "date", "uuid"];
21
+ readonly Tokens: readonly ["Context.UserID", "Context.UserEmail", "Context.UserName", "Context.Now", "Context.Today", "Context.StartOfWeek", "Context.StartOfMonth", "Context.StartOfQuarter", "Context.StartOfYear"];
22
+ readonly OffsetUnits: readonly ["day", "week", "month", "quarter", "year"];
23
+ /** Fields a property can target: every non-binary field, in display order. */
24
+ get FieldOptions(): EntityFieldInfo[];
25
+ /** What is wrong with the properties now, each naming the property; saving is blocked while any remain. */
26
+ get Problems(): string[];
27
+ OperatorsFor(type: PropertyValueType): readonly UserViewPropertyOperator[];
28
+ DefaultMode(property: UserViewProperty): ViewPropertyDefaultMode;
29
+ /** True when the property's default is a date token, which can take an offset. */
30
+ TakesOffset(property: UserViewProperty): boolean;
31
+ /** The fixed default as the text an input shows. */
32
+ DefaultText(property: UserViewProperty): string;
33
+ AddProperty(): void;
34
+ RemoveProperty(index: number): void;
35
+ Update(index: number, patch: Partial<UserViewProperty>): void;
36
+ SetField(index: number, field: string): void;
37
+ SetOperator(index: number, operator: UserViewPropertyOperator): void;
38
+ /** A new type keeps the operator only if the type allows it, and drops a fixed default. */
39
+ SetType(index: number, type: PropertyValueType): void;
40
+ SetDefaultMode(index: number, mode: ViewPropertyDefaultMode): void;
41
+ /** A fixed default from what the user typed: a number for a number property, true/false for a boolean, blank for none. */
42
+ SetDefaultValue(index: number, text: string): void;
43
+ /** A user token takes no offset, so choosing one drops it. */
44
+ SetToken(index: number, token: ContextToken): void;
45
+ /** An offset of 0 (or blank) removes it. */
46
+ SetOffset(index: number, amount: number | null, unit: PropertyOffsetUnit): void;
47
+ private emit;
48
+ private nextName;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<ViewPropertiesEditorComponent, never>;
50
+ static ɵcmp: i0.ɵɵComponentDeclaration<ViewPropertiesEditorComponent, "mj-view-properties-editor", never, { "Entity": { "alias": "Entity"; "required": false; }; "Properties": { "alias": "Properties"; "required": false; }; "Disabled": { "alias": "Disabled"; "required": false; }; }, { "PropertiesChange": "PropertiesChange"; }, never, never, false, never>;
51
+ }
52
+ //# sourceMappingURL=view-properties-editor.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-properties-editor.component.d.ts","sourceRoot":"","sources":["../../../src/lib/view-properties-editor/view-properties-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAiB,MAAM,eAAe,CAAC;AACvE,OAAO,EAEL,YAAY,EACZ,eAAe,EACf,UAAU,EAIV,kBAAkB,EAClB,iBAAiB,EAEjB,gBAAgB,EAChB,wBAAwB,EAEzB,MAAM,sBAAsB,CAAC;;AAE9B,uDAAuD;AACvD,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAIjE;;;;;GAKG;AACH,qBAMa,6BA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AQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAKzD,4CAA4C;IACrC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAMtF,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,QAAQ;yCA9GL,6BAA6B;2CAA7B,6BAA6B;CAoHzC"}
@@ -0,0 +1,445 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { CONTEXT_TOKENS, PROPERTY_OFFSET_UNITS, PROPERTY_VALUE_TYPES, USER_VIEW_PROPERTY_OPERATORS_BY_TYPE, ValidateUserViewProperties, } from '@memberjunction/core';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/forms";
5
+ import * as i2 from "@memberjunction/ng-ui-components";
6
+ const _forTrack0 = ($index, $item) => $item.Name;
7
+ function ViewPropertiesEditorComponent_For_7_For_11_Template(rf, ctx) { if (rf & 1) {
8
+ i0.ɵɵelementStart(0, "option", 12);
9
+ i0.ɵɵtext(1);
10
+ i0.ɵɵelementEnd();
11
+ } if (rf & 2) {
12
+ const type_r4 = ctx.$implicit;
13
+ i0.ɵɵproperty("value", type_r4);
14
+ i0.ɵɵadvance();
15
+ i0.ɵɵtextInterpolate(type_r4);
16
+ } }
17
+ function ViewPropertiesEditorComponent_For_7_For_24_Template(rf, ctx) { if (rf & 1) {
18
+ i0.ɵɵelementStart(0, "option", 12);
19
+ i0.ɵɵtext(1);
20
+ i0.ɵɵelementEnd();
21
+ } if (rf & 2) {
22
+ const field_r5 = ctx.$implicit;
23
+ i0.ɵɵproperty("value", field_r5.Name);
24
+ i0.ɵɵadvance();
25
+ i0.ɵɵtextInterpolate(field_r5.DisplayNameOrName);
26
+ } }
27
+ function ViewPropertiesEditorComponent_For_7_For_30_Template(rf, ctx) { if (rf & 1) {
28
+ i0.ɵɵelementStart(0, "option", 12);
29
+ i0.ɵɵtext(1);
30
+ i0.ɵɵelementEnd();
31
+ } if (rf & 2) {
32
+ const op_r6 = ctx.$implicit;
33
+ i0.ɵɵproperty("value", op_r6);
34
+ i0.ɵɵadvance();
35
+ i0.ɵɵtextInterpolate(op_r6);
36
+ } }
37
+ function ViewPropertiesEditorComponent_For_7_Conditional_42_Conditional_3_Template(rf, ctx) { if (rf & 1) {
38
+ const _r7 = i0.ɵɵgetCurrentView();
39
+ i0.ɵɵelementStart(0, "select", 11);
40
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Conditional_42_Conditional_3_Template_select_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r7); const ɵ$index_10_r2 = i0.ɵɵnextContext(2).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetDefaultValue(ɵ$index_10_r2, $event)); });
41
+ i0.ɵɵelementStart(1, "option", 24);
42
+ i0.ɵɵtext(2, "(none)");
43
+ i0.ɵɵelementEnd();
44
+ i0.ɵɵelementStart(3, "option", 25);
45
+ i0.ɵɵtext(4, "true");
46
+ i0.ɵɵelementEnd();
47
+ i0.ɵɵelementStart(5, "option", 26);
48
+ i0.ɵɵtext(6, "false");
49
+ i0.ɵɵelementEnd()();
50
+ } if (rf & 2) {
51
+ const ctx_r7 = i0.ɵɵnextContext(2);
52
+ const property_r9 = ctx_r7.$implicit;
53
+ const ɵ$index_10_r2 = ctx_r7.$index;
54
+ const ctx_r2 = i0.ɵɵnextContext();
55
+ i0.ɵɵproperty("id", "vpe-default-" + ɵ$index_10_r2)("ngModel", ctx_r2.DefaultText(property_r9))("disabled", ctx_r2.Disabled);
56
+ } }
57
+ function ViewPropertiesEditorComponent_For_7_Conditional_42_Conditional_4_Template(rf, ctx) { if (rf & 1) {
58
+ const _r10 = i0.ɵɵgetCurrentView();
59
+ i0.ɵɵelementStart(0, "input", 27);
60
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Conditional_42_Conditional_4_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r10); const ɵ$index_10_r2 = i0.ɵɵnextContext(2).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetDefaultValue(ɵ$index_10_r2, $event ?? "")); });
61
+ i0.ɵɵelementEnd();
62
+ } if (rf & 2) {
63
+ const ctx_r7 = i0.ɵɵnextContext(2);
64
+ const property_r9 = ctx_r7.$implicit;
65
+ const ɵ$index_10_r2 = ctx_r7.$index;
66
+ const ctx_r2 = i0.ɵɵnextContext();
67
+ i0.ɵɵproperty("id", "vpe-default-" + ɵ$index_10_r2)("type", property_r9.Type === "number" ? "number" : property_r9.Type === "date" ? "date" : "text")("ngModel", ctx_r2.DefaultText(property_r9))("disabled", ctx_r2.Disabled);
68
+ } }
69
+ function ViewPropertiesEditorComponent_For_7_Conditional_42_Template(rf, ctx) { if (rf & 1) {
70
+ i0.ɵɵelementStart(0, "div", 8)(1, "label");
71
+ i0.ɵɵtext(2, "Value");
72
+ i0.ɵɵelementEnd();
73
+ i0.ɵɵconditionalCreate(3, ViewPropertiesEditorComponent_For_7_Conditional_42_Conditional_3_Template, 7, 3, "select", 22)(4, ViewPropertiesEditorComponent_For_7_Conditional_42_Conditional_4_Template, 1, 4, "input", 23);
74
+ i0.ɵɵelementEnd();
75
+ } if (rf & 2) {
76
+ const ctx_r7 = i0.ɵɵnextContext();
77
+ const property_r9 = ctx_r7.$implicit;
78
+ const ɵ$index_10_r2 = ctx_r7.$index;
79
+ i0.ɵɵadvance();
80
+ i0.ɵɵattribute("for", "vpe-default-" + ɵ$index_10_r2);
81
+ i0.ɵɵadvance(2);
82
+ i0.ɵɵconditional(property_r9.Type === "boolean" ? 3 : 4);
83
+ } }
84
+ function ViewPropertiesEditorComponent_For_7_Conditional_43_For_5_Template(rf, ctx) { if (rf & 1) {
85
+ i0.ɵɵelementStart(0, "option", 12);
86
+ i0.ɵɵtext(1);
87
+ i0.ɵɵelementEnd();
88
+ } if (rf & 2) {
89
+ const token_r12 = ctx.$implicit;
90
+ i0.ɵɵproperty("value", token_r12);
91
+ i0.ɵɵadvance();
92
+ i0.ɵɵtextInterpolate(token_r12);
93
+ } }
94
+ function ViewPropertiesEditorComponent_For_7_Conditional_43_Conditional_6_For_7_Template(rf, ctx) { if (rf & 1) {
95
+ i0.ɵɵelementStart(0, "option", 12);
96
+ i0.ɵɵtext(1);
97
+ i0.ɵɵelementEnd();
98
+ } if (rf & 2) {
99
+ const unit_r14 = ctx.$implicit;
100
+ i0.ɵɵproperty("value", unit_r14);
101
+ i0.ɵɵadvance();
102
+ i0.ɵɵtextInterpolate(unit_r14);
103
+ } }
104
+ function ViewPropertiesEditorComponent_For_7_Conditional_43_Conditional_6_Template(rf, ctx) { if (rf & 1) {
105
+ const _r13 = i0.ɵɵgetCurrentView();
106
+ i0.ɵɵelementStart(0, "div", 28)(1, "label");
107
+ i0.ɵɵtext(2, "Offset");
108
+ i0.ɵɵelementEnd();
109
+ i0.ɵɵelementStart(3, "div", 29)(4, "input", 30);
110
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Conditional_43_Conditional_6_Template_input_ngModelChange_4_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r7 = i0.ɵɵnextContext(2); const property_r9 = ctx_r7.$implicit; const ɵ$index_10_r2 = ctx_r7.$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetOffset(ɵ$index_10_r2, $event, (property_r9.Default == null ? null : property_r9.Default.Offset == null ? null : property_r9.Default.Offset.Unit) ?? "day")); });
111
+ i0.ɵɵelementEnd();
112
+ i0.ɵɵelementStart(5, "select", 31);
113
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Conditional_43_Conditional_6_Template_select_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r7 = i0.ɵɵnextContext(2); const property_r9 = ctx_r7.$implicit; const ɵ$index_10_r2 = ctx_r7.$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetOffset(ɵ$index_10_r2, (property_r9.Default == null ? null : property_r9.Default.Offset == null ? null : property_r9.Default.Offset.Amount) ?? null, $event)); });
114
+ i0.ɵɵrepeaterCreate(6, ViewPropertiesEditorComponent_For_7_Conditional_43_Conditional_6_For_7_Template, 2, 2, "option", 12, i0.ɵɵrepeaterTrackByIdentity);
115
+ i0.ɵɵelementEnd()()();
116
+ } if (rf & 2) {
117
+ const ctx_r7 = i0.ɵɵnextContext(2);
118
+ const property_r9 = ctx_r7.$implicit;
119
+ const ɵ$index_10_r2 = ctx_r7.$index;
120
+ const ctx_r2 = i0.ɵɵnextContext();
121
+ i0.ɵɵadvance();
122
+ i0.ɵɵattribute("for", "vpe-offset-" + ɵ$index_10_r2);
123
+ i0.ɵɵadvance(3);
124
+ i0.ɵɵproperty("id", "vpe-offset-" + ɵ$index_10_r2)("ngModel", (property_r9.Default == null ? null : property_r9.Default.Offset == null ? null : property_r9.Default.Offset.Amount) ?? null)("disabled", ctx_r2.Disabled);
125
+ i0.ɵɵadvance();
126
+ i0.ɵɵproperty("ngModel", (property_r9.Default == null ? null : property_r9.Default.Offset == null ? null : property_r9.Default.Offset.Unit) ?? "day")("disabled", ctx_r2.Disabled || !(property_r9.Default == null ? null : property_r9.Default.Offset));
127
+ i0.ɵɵadvance();
128
+ i0.ɵɵrepeater(ctx_r2.OffsetUnits);
129
+ } }
130
+ function ViewPropertiesEditorComponent_For_7_Conditional_43_Template(rf, ctx) { if (rf & 1) {
131
+ const _r11 = i0.ɵɵgetCurrentView();
132
+ i0.ɵɵelementStart(0, "div", 8)(1, "label");
133
+ i0.ɵɵtext(2, "Token");
134
+ i0.ɵɵelementEnd();
135
+ i0.ɵɵelementStart(3, "select", 11);
136
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Conditional_43_Template_select_ngModelChange_3_listener($event) { i0.ɵɵrestoreView(_r11); const ɵ$index_10_r2 = i0.ɵɵnextContext().$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetToken(ɵ$index_10_r2, $event)); });
137
+ i0.ɵɵrepeaterCreate(4, ViewPropertiesEditorComponent_For_7_Conditional_43_For_5_Template, 2, 2, "option", 12, i0.ɵɵrepeaterTrackByIdentity);
138
+ i0.ɵɵelementEnd()();
139
+ i0.ɵɵconditionalCreate(6, ViewPropertiesEditorComponent_For_7_Conditional_43_Conditional_6_Template, 8, 6, "div", 28);
140
+ } if (rf & 2) {
141
+ const ctx_r7 = i0.ɵɵnextContext();
142
+ const property_r9 = ctx_r7.$implicit;
143
+ const ɵ$index_10_r2 = ctx_r7.$index;
144
+ const ctx_r2 = i0.ɵɵnextContext();
145
+ i0.ɵɵadvance();
146
+ i0.ɵɵattribute("for", "vpe-token-" + ɵ$index_10_r2);
147
+ i0.ɵɵadvance(2);
148
+ i0.ɵɵproperty("id", "vpe-token-" + ɵ$index_10_r2)("ngModel", property_r9.Default == null ? null : property_r9.Default.Token)("disabled", ctx_r2.Disabled);
149
+ i0.ɵɵadvance();
150
+ i0.ɵɵrepeater(ctx_r2.Tokens);
151
+ i0.ɵɵadvance(2);
152
+ i0.ɵɵconditional(ctx_r2.TakesOffset(property_r9) ? 6 : -1);
153
+ } }
154
+ function ViewPropertiesEditorComponent_For_7_Conditional_51_Template(rf, ctx) { if (rf & 1) {
155
+ i0.ɵɵelementStart(0, "span", 21);
156
+ i0.ɵɵelement(1, "i", 32);
157
+ i0.ɵɵtext(2, " only server code sets it");
158
+ i0.ɵɵelementEnd();
159
+ } }
160
+ function ViewPropertiesEditorComponent_For_7_Template(rf, ctx) { if (rf & 1) {
161
+ const _r1 = i0.ɵɵgetCurrentView();
162
+ i0.ɵɵelementStart(0, "div", 2)(1, "div", 7)(2, "div", 8)(3, "label");
163
+ i0.ɵɵtext(4, "Name");
164
+ i0.ɵɵelementEnd();
165
+ i0.ɵɵelementStart(5, "input", 9);
166
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_input_ngModelChange_5_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.Update(ɵ$index_10_r2, { Name: $event })); });
167
+ i0.ɵɵelementEnd()();
168
+ i0.ɵɵelementStart(6, "div", 10)(7, "label");
169
+ i0.ɵɵtext(8, "Type");
170
+ i0.ɵɵelementEnd();
171
+ i0.ɵɵelementStart(9, "select", 11);
172
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_select_ngModelChange_9_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetType(ɵ$index_10_r2, $event)); });
173
+ i0.ɵɵrepeaterCreate(10, ViewPropertiesEditorComponent_For_7_For_11_Template, 2, 2, "option", 12, i0.ɵɵrepeaterTrackByIdentity);
174
+ i0.ɵɵelementEnd()();
175
+ i0.ɵɵelementStart(12, "button", 13);
176
+ i0.ɵɵlistener("click", function ViewPropertiesEditorComponent_For_7_Template_button_click_12_listener() { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.RemoveProperty(ɵ$index_10_r2)); });
177
+ i0.ɵɵelement(13, "i", 14);
178
+ i0.ɵɵelementEnd()();
179
+ i0.ɵɵelementStart(14, "div", 8)(15, "label");
180
+ i0.ɵɵtext(16, "Description");
181
+ i0.ɵɵelementEnd();
182
+ i0.ɵɵelementStart(17, "input", 9);
183
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_input_ngModelChange_17_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.Update(ɵ$index_10_r2, { Description: $event || undefined })); });
184
+ i0.ɵɵelementEnd()();
185
+ i0.ɵɵelementStart(18, "div", 7)(19, "div", 8)(20, "label");
186
+ i0.ɵɵtext(21, "Filters field");
187
+ i0.ɵɵelementEnd();
188
+ i0.ɵɵelementStart(22, "select", 11);
189
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_select_ngModelChange_22_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetField(ɵ$index_10_r2, $event)); });
190
+ i0.ɵɵrepeaterCreate(23, ViewPropertiesEditorComponent_For_7_For_24_Template, 2, 2, "option", 12, _forTrack0);
191
+ i0.ɵɵelementEnd()();
192
+ i0.ɵɵelementStart(25, "div", 10)(26, "label");
193
+ i0.ɵɵtext(27, "Operator");
194
+ i0.ɵɵelementEnd();
195
+ i0.ɵɵelementStart(28, "select", 11);
196
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_select_ngModelChange_28_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetOperator(ɵ$index_10_r2, $event)); });
197
+ i0.ɵɵrepeaterCreate(29, ViewPropertiesEditorComponent_For_7_For_30_Template, 2, 2, "option", 12, i0.ɵɵrepeaterTrackByIdentity);
198
+ i0.ɵɵelementEnd()()();
199
+ i0.ɵɵelementStart(31, "div", 7)(32, "div", 10)(33, "label");
200
+ i0.ɵɵtext(34, "Default");
201
+ i0.ɵɵelementEnd();
202
+ i0.ɵɵelementStart(35, "select", 11);
203
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_select_ngModelChange_35_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SetDefaultMode(ɵ$index_10_r2, $event)); });
204
+ i0.ɵɵelementStart(36, "option", 15);
205
+ i0.ɵɵtext(37, "None");
206
+ i0.ɵɵelementEnd();
207
+ i0.ɵɵelementStart(38, "option", 16);
208
+ i0.ɵɵtext(39, "Fixed value");
209
+ i0.ɵɵelementEnd();
210
+ i0.ɵɵelementStart(40, "option", 17);
211
+ i0.ɵɵtext(41, "Context token");
212
+ i0.ɵɵelementEnd()()();
213
+ i0.ɵɵconditionalCreate(42, ViewPropertiesEditorComponent_For_7_Conditional_42_Template, 5, 2, "div", 8);
214
+ i0.ɵɵconditionalCreate(43, ViewPropertiesEditorComponent_For_7_Conditional_43_Template, 7, 5);
215
+ i0.ɵɵelementEnd();
216
+ i0.ɵɵelementStart(44, "div", 18)(45, "label", 19)(46, "input", 20);
217
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_input_ngModelChange_46_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.Update(ɵ$index_10_r2, { IsRequired: $event })); });
218
+ i0.ɵɵelementEnd();
219
+ i0.ɵɵtext(47, " Required ");
220
+ i0.ɵɵelementEnd();
221
+ i0.ɵɵelementStart(48, "label", 19)(49, "input", 20);
222
+ i0.ɵɵlistener("ngModelChange", function ViewPropertiesEditorComponent_For_7_Template_input_ngModelChange_49_listener($event) { const ɵ$index_10_r2 = i0.ɵɵrestoreView(_r1).$index; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.Update(ɵ$index_10_r2, { AllowOverride: $event })); });
223
+ i0.ɵɵelementEnd();
224
+ i0.ɵɵtext(50, " Allow override ");
225
+ i0.ɵɵconditionalCreate(51, ViewPropertiesEditorComponent_For_7_Conditional_51_Template, 3, 0, "span", 21);
226
+ i0.ɵɵelementEnd()()();
227
+ } if (rf & 2) {
228
+ const property_r9 = ctx.$implicit;
229
+ const ɵ$index_10_r2 = ctx.$index;
230
+ const ctx_r2 = i0.ɵɵnextContext();
231
+ i0.ɵɵadvance(3);
232
+ i0.ɵɵattribute("for", "vpe-name-" + ɵ$index_10_r2);
233
+ i0.ɵɵadvance(2);
234
+ i0.ɵɵproperty("id", "vpe-name-" + ɵ$index_10_r2)("ngModel", property_r9.Name)("disabled", ctx_r2.Disabled);
235
+ i0.ɵɵadvance(2);
236
+ i0.ɵɵattribute("for", "vpe-type-" + ɵ$index_10_r2);
237
+ i0.ɵɵadvance(2);
238
+ i0.ɵɵproperty("id", "vpe-type-" + ɵ$index_10_r2)("ngModel", property_r9.Type)("disabled", ctx_r2.Disabled);
239
+ i0.ɵɵadvance();
240
+ i0.ɵɵrepeater(ctx_r2.Types);
241
+ i0.ɵɵadvance(2);
242
+ i0.ɵɵproperty("disabled", ctx_r2.Disabled);
243
+ i0.ɵɵattribute("aria-label", "Remove property " + property_r9.Name);
244
+ i0.ɵɵadvance(3);
245
+ i0.ɵɵattribute("for", "vpe-desc-" + ɵ$index_10_r2);
246
+ i0.ɵɵadvance(2);
247
+ i0.ɵɵproperty("id", "vpe-desc-" + ɵ$index_10_r2)("ngModel", property_r9.Description ?? "")("disabled", ctx_r2.Disabled);
248
+ i0.ɵɵadvance(3);
249
+ i0.ɵɵattribute("for", "vpe-target-" + ɵ$index_10_r2);
250
+ i0.ɵɵadvance(2);
251
+ i0.ɵɵproperty("id", "vpe-target-" + ɵ$index_10_r2)("ngModel", property_r9.Target.Field)("disabled", ctx_r2.Disabled);
252
+ i0.ɵɵadvance();
253
+ i0.ɵɵrepeater(ctx_r2.FieldOptions);
254
+ i0.ɵɵadvance(3);
255
+ i0.ɵɵattribute("for", "vpe-op-" + ɵ$index_10_r2);
256
+ i0.ɵɵadvance(2);
257
+ i0.ɵɵproperty("id", "vpe-op-" + ɵ$index_10_r2)("ngModel", property_r9.Target.Operator)("disabled", ctx_r2.Disabled);
258
+ i0.ɵɵadvance();
259
+ i0.ɵɵrepeater(ctx_r2.OperatorsFor(property_r9.Type));
260
+ i0.ɵɵadvance(4);
261
+ i0.ɵɵattribute("for", "vpe-default-mode-" + ɵ$index_10_r2);
262
+ i0.ɵɵadvance(2);
263
+ i0.ɵɵproperty("id", "vpe-default-mode-" + ɵ$index_10_r2)("ngModel", ctx_r2.DefaultMode(property_r9))("disabled", ctx_r2.Disabled);
264
+ i0.ɵɵadvance(7);
265
+ i0.ɵɵconditional(ctx_r2.DefaultMode(property_r9) === "value" ? 42 : -1);
266
+ i0.ɵɵadvance();
267
+ i0.ɵɵconditional(ctx_r2.DefaultMode(property_r9) === "token" ? 43 : -1);
268
+ i0.ɵɵadvance(3);
269
+ i0.ɵɵproperty("ngModel", property_r9.IsRequired === true)("disabled", ctx_r2.Disabled);
270
+ i0.ɵɵadvance(3);
271
+ i0.ɵɵproperty("ngModel", property_r9.AllowOverride !== false)("disabled", ctx_r2.Disabled);
272
+ i0.ɵɵadvance(2);
273
+ i0.ɵɵconditional(property_r9.AllowOverride === false ? 51 : -1);
274
+ } }
275
+ function ViewPropertiesEditorComponent_ForEmpty_8_Template(rf, ctx) { if (rf & 1) {
276
+ i0.ɵɵelementStart(0, "p", 3);
277
+ i0.ɵɵtext(1, "This view has no properties.");
278
+ i0.ɵɵelementEnd();
279
+ } }
280
+ function ViewPropertiesEditorComponent_Conditional_12_For_2_Template(rf, ctx) { if (rf & 1) {
281
+ i0.ɵɵelementStart(0, "li");
282
+ i0.ɵɵtext(1);
283
+ i0.ɵɵelementEnd();
284
+ } if (rf & 2) {
285
+ const problem_r15 = ctx.$implicit;
286
+ i0.ɵɵadvance();
287
+ i0.ɵɵtextInterpolate(problem_r15);
288
+ } }
289
+ function ViewPropertiesEditorComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
290
+ i0.ɵɵelementStart(0, "ul", 6);
291
+ i0.ɵɵrepeaterCreate(1, ViewPropertiesEditorComponent_Conditional_12_For_2_Template, 2, 1, "li", null, i0.ɵɵrepeaterTrackByIdentity);
292
+ i0.ɵɵelementEnd();
293
+ } if (rf & 2) {
294
+ const ctx_r2 = i0.ɵɵnextContext();
295
+ i0.ɵɵadvance();
296
+ i0.ɵɵrepeater(ctx_r2.Problems);
297
+ } }
298
+ const USER_TOKENS = ['Context.UserID', 'Context.UserEmail', 'Context.UserName'];
299
+ /**
300
+ * The Properties panel of the view designer: add, edit and remove a view's declared properties
301
+ * (name, type, description, default as a fixed value or a token with an offset, required, allow
302
+ * override, target field and operator). Edits are immutable: every change emits a new list
303
+ * through `PropertiesChange`, so `[(Properties)]` works.
304
+ */
305
+ export class ViewPropertiesEditorComponent {
306
+ /** The view's entity: its fields are the targets a property can filter. */
307
+ Entity = null;
308
+ /** The properties being edited. */
309
+ Properties = [];
310
+ /** True when the user cannot edit the view. */
311
+ Disabled = false;
312
+ PropertiesChange = new EventEmitter();
313
+ Types = PROPERTY_VALUE_TYPES;
314
+ Tokens = CONTEXT_TOKENS;
315
+ OffsetUnits = PROPERTY_OFFSET_UNITS;
316
+ /** Fields a property can target: every non-binary field, in display order. */
317
+ get FieldOptions() {
318
+ return (this.Entity?.Fields ?? []).filter(f => !f.IsBinaryFieldType);
319
+ }
320
+ /** What is wrong with the properties now, each naming the property; saving is blocked while any remain. */
321
+ get Problems() {
322
+ return ValidateUserViewProperties(this.Properties, this.FieldOptions.map(f => f.Name));
323
+ }
324
+ OperatorsFor(type) {
325
+ return USER_VIEW_PROPERTY_OPERATORS_BY_TYPE[type] ?? [];
326
+ }
327
+ DefaultMode(property) {
328
+ if (!property.Default)
329
+ return 'none';
330
+ return property.Default.Token !== undefined ? 'token' : 'value';
331
+ }
332
+ /** True when the property's default is a date token, which can take an offset. */
333
+ TakesOffset(property) {
334
+ return !!property.Default?.Token && !USER_TOKENS.includes(property.Default.Token);
335
+ }
336
+ /** The fixed default as the text an input shows. */
337
+ DefaultText(property) {
338
+ const value = property.Default?.Value;
339
+ return value === null || value === undefined ? '' : String(value);
340
+ }
341
+ AddProperty() {
342
+ const field = this.FieldOptions[0]?.Name ?? '';
343
+ this.emit([...this.Properties, { Name: this.nextName(), Type: 'string', AllowOverride: true, Target: { Field: field, Operator: '=' } }]);
344
+ }
345
+ RemoveProperty(index) {
346
+ this.emit(this.Properties.filter((_, i) => i !== index));
347
+ }
348
+ Update(index, patch) {
349
+ this.emit(this.Properties.map((p, i) => (i === index ? { ...p, ...patch } : p)));
350
+ }
351
+ SetField(index, field) {
352
+ this.Update(index, { Target: { ...this.Properties[index].Target, Field: field } });
353
+ }
354
+ SetOperator(index, operator) {
355
+ this.Update(index, { Target: { ...this.Properties[index].Target, Operator: operator } });
356
+ }
357
+ /** A new type keeps the operator only if the type allows it, and drops a fixed default. */
358
+ SetType(index, type) {
359
+ const property = this.Properties[index];
360
+ const operators = this.OperatorsFor(type);
361
+ const operator = operators.includes(property.Target.Operator) ? property.Target.Operator : operators[0];
362
+ const keepDefault = this.DefaultMode(property) === 'token';
363
+ this.Update(index, { Type: type, Target: { ...property.Target, Operator: operator }, Default: keepDefault ? property.Default : undefined });
364
+ }
365
+ SetDefaultMode(index, mode) {
366
+ const defaults = {
367
+ none: undefined,
368
+ value: { Value: null },
369
+ token: { Token: this.Properties[index].Type === 'uuid' ? 'Context.UserID' : 'Context.Today' },
370
+ };
371
+ this.Update(index, { Default: defaults[mode] });
372
+ }
373
+ /** A fixed default from what the user typed: a number for a number property, true/false for a boolean, blank for none. */
374
+ SetDefaultValue(index, text) {
375
+ const type = this.Properties[index].Type;
376
+ const trimmed = text.trim();
377
+ let value = trimmed.length === 0 ? null : text;
378
+ if (value !== null && type === 'number')
379
+ value = Number(trimmed);
380
+ if (value !== null && type === 'boolean')
381
+ value = trimmed === 'true';
382
+ this.Update(index, { Default: { Value: value } });
383
+ }
384
+ /** A user token takes no offset, so choosing one drops it. */
385
+ SetToken(index, token) {
386
+ const offset = USER_TOKENS.includes(token) ? undefined : this.Properties[index].Default?.Offset;
387
+ this.Update(index, { Default: { Token: token, Offset: offset } });
388
+ }
389
+ /** An offset of 0 (or blank) removes it. */
390
+ SetOffset(index, amount, unit) {
391
+ const current = this.Properties[index].Default;
392
+ const offset = amount ? { Amount: Math.trunc(amount), Unit: unit } : undefined;
393
+ this.Update(index, { Default: { Token: current?.Token, Offset: offset } });
394
+ }
395
+ emit(properties) {
396
+ this.Properties = properties;
397
+ this.PropertiesChange.emit(properties);
398
+ }
399
+ nextName() {
400
+ const taken = new Set(this.Properties.map(p => p.Name.toLowerCase()));
401
+ let n = this.Properties.length + 1;
402
+ while (taken.has(`property${n}`))
403
+ n++;
404
+ return `Property${n}`;
405
+ }
406
+ static ɵfac = function ViewPropertiesEditorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ViewPropertiesEditorComponent)(); };
407
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ViewPropertiesEditorComponent, selectors: [["mj-view-properties-editor"]], inputs: { Entity: "Entity", Properties: "Properties", Disabled: "Disabled" }, outputs: { PropertiesChange: "PropertiesChange" }, standalone: false, decls: 13, vars: 3, consts: [[1, "vpe"], [1, "vpe-intro"], [1, "vpe-card"], [1, "vpe-empty"], ["mjButton", "", "variant", "outline", "size", "sm", 3, "click", "disabled"], [1, "fa-solid", "fa-plus"], ["role", "alert", 1, "vpe-problems"], [1, "vpe-row"], [1, "vpe-field"], ["type", "text", 1, "vpe-input", 3, "ngModelChange", "id", "ngModel", "disabled"], [1, "vpe-field", "vpe-narrow"], [1, "vpe-input", 3, "ngModelChange", "id", "ngModel", "disabled"], [3, "value"], ["mjButton", "", "variant", "icon", "size", "sm", "title", "Remove property", 1, "vpe-remove", 3, "click", "disabled"], [1, "fa-solid", "fa-trash"], ["value", "none"], ["value", "value"], ["value", "token"], [1, "vpe-flags"], [1, "vpe-check"], ["type", "checkbox", 3, "ngModelChange", "ngModel", "disabled"], [1, "vpe-hint"], [1, "vpe-input", 3, "id", "ngModel", "disabled"], [1, "vpe-input", 3, "id", "type", "ngModel", "disabled"], ["value", ""], ["value", "true"], ["value", "false"], [1, "vpe-input", 3, "ngModelChange", "id", "type", "ngModel", "disabled"], [1, "vpe-field", "vpe-offset"], [1, "vpe-offset-inputs"], ["type", "number", "step", "1", 1, "vpe-input", 3, "ngModelChange", "id", "ngModel", "disabled"], ["aria-label", "Offset unit", 1, "vpe-input", 3, "ngModelChange", "ngModel", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-lock"]], template: function ViewPropertiesEditorComponent_Template(rf, ctx) { if (rf & 1) {
408
+ i0.ɵɵelementStart(0, "div", 0)(1, "p", 1);
409
+ i0.ɵɵtext(2, " A property is a named input that adds one filter on a field when a run gives it a value or it has a default. Turn off ");
410
+ i0.ɵɵelementStart(3, "strong");
411
+ i0.ɵɵtext(4, "Allow override");
412
+ i0.ɵɵelementEnd();
413
+ i0.ɵɵtext(5, " to let only server code set it. ");
414
+ i0.ɵɵelementEnd();
415
+ i0.ɵɵrepeaterCreate(6, ViewPropertiesEditorComponent_For_7_Template, 52, 33, "div", 2, i0.ɵɵrepeaterTrackByIndex, false, ViewPropertiesEditorComponent_ForEmpty_8_Template, 2, 0, "p", 3);
416
+ i0.ɵɵelementStart(9, "button", 4);
417
+ i0.ɵɵlistener("click", function ViewPropertiesEditorComponent_Template_button_click_9_listener() { return ctx.AddProperty(); });
418
+ i0.ɵɵelement(10, "i", 5);
419
+ i0.ɵɵtext(11, " Add property ");
420
+ i0.ɵɵelementEnd();
421
+ i0.ɵɵconditionalCreate(12, ViewPropertiesEditorComponent_Conditional_12_Template, 3, 0, "ul", 6);
422
+ i0.ɵɵelementEnd();
423
+ } if (rf & 2) {
424
+ i0.ɵɵadvance(6);
425
+ i0.ɵɵrepeater(ctx.Properties);
426
+ i0.ɵɵadvance(3);
427
+ i0.ɵɵproperty("disabled", ctx.Disabled || ctx.FieldOptions.length === 0);
428
+ i0.ɵɵadvance(3);
429
+ i0.ɵɵconditional(ctx.Problems.length > 0 ? 12 : -1);
430
+ } }, dependencies: [i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.NumberValueAccessor, i1.CheckboxControlValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.NgModel, i2.MJButtonDirective], styles: [".vpe[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-3);\n}\n\n.vpe-intro[_ngcontent-%COMP%], \n.vpe-empty[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-muted);\n}\n\n.vpe-card[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-2);\n padding: var(--mj-space-3);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n background: var(--mj-bg-surface-card);\n}\n\n.vpe-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-end;\n gap: var(--mj-space-2);\n}\n\n.vpe-field[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-1);\n flex: 1;\n min-width: 0;\n}\n\n.vpe-narrow[_ngcontent-%COMP%] {\n flex: 0 0 120px;\n}\n\n.vpe-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n font-weight: 500;\n color: var(--mj-text-secondary);\n}\n\n.vpe-input[_ngcontent-%COMP%] {\n width: 100%;\n padding: 6px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-sm);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface);\n box-sizing: border-box;\n}\n\n.vpe-input[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--mj-border-focus);\n}\n\n.vpe-offset-inputs[_ngcontent-%COMP%] {\n display: flex;\n gap: var(--mj-space-1);\n}\n\n.vpe-flags[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-4);\n}\n\n.vpe-check[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-1);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-primary);\n}\n\n.vpe-hint[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: var(--mj-text-xs);\n}\n\n.vpe-problems[_ngcontent-%COMP%] {\n margin: 0;\n padding-left: var(--mj-space-4);\n font-size: var(--mj-text-xs);\n color: var(--mj-status-error-text);\n}"] });
431
+ }
432
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ViewPropertiesEditorComponent, [{
433
+ type: Component,
434
+ args: [{ standalone: false, selector: 'mj-view-properties-editor', template: "<div class=\"vpe\">\n <p class=\"vpe-intro\">\n A property is a named input that adds one filter on a field when a run gives it a value or it has a default.\n Turn off <strong>Allow override</strong> to let only server code set it.\n </p>\n\n @for (property of Properties; track $index; let i = $index) {\n <div class=\"vpe-card\">\n <div class=\"vpe-row\">\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-name-' + i\">Name</label>\n <input [id]=\"'vpe-name-' + i\" type=\"text\" class=\"vpe-input\" [ngModel]=\"property.Name\" (ngModelChange)=\"Update(i, { Name: $event })\" [disabled]=\"Disabled\" />\n </div>\n <div class=\"vpe-field vpe-narrow\">\n <label [attr.for]=\"'vpe-type-' + i\">Type</label>\n <select [id]=\"'vpe-type-' + i\" class=\"vpe-input\" [ngModel]=\"property.Type\" (ngModelChange)=\"SetType(i, $event)\" [disabled]=\"Disabled\">\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\" class=\"vpe-remove\" (click)=\"RemoveProperty(i)\" [disabled]=\"Disabled\" [attr.aria-label]=\"'Remove property ' + property.Name\" title=\"Remove property\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-desc-' + i\">Description</label>\n <input [id]=\"'vpe-desc-' + i\" type=\"text\" class=\"vpe-input\" [ngModel]=\"property.Description ?? ''\" (ngModelChange)=\"Update(i, { Description: $event || undefined })\" [disabled]=\"Disabled\" />\n </div>\n\n <div class=\"vpe-row\">\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-target-' + i\">Filters field</label>\n <select [id]=\"'vpe-target-' + i\" class=\"vpe-input\" [ngModel]=\"property.Target.Field\" (ngModelChange)=\"SetField(i, $event)\" [disabled]=\"Disabled\">\n @for (field of FieldOptions; track field.Name) {\n <option [value]=\"field.Name\">{{ field.DisplayNameOrName }}</option>\n }\n </select>\n </div>\n <div class=\"vpe-field vpe-narrow\">\n <label [attr.for]=\"'vpe-op-' + i\">Operator</label>\n <select [id]=\"'vpe-op-' + i\" class=\"vpe-input\" [ngModel]=\"property.Target.Operator\" (ngModelChange)=\"SetOperator(i, $event)\" [disabled]=\"Disabled\">\n @for (op of OperatorsFor(property.Type); track op) {\n <option [value]=\"op\">{{ op }}</option>\n }\n </select>\n </div>\n </div>\n\n <div class=\"vpe-row\">\n <div class=\"vpe-field vpe-narrow\">\n <label [attr.for]=\"'vpe-default-mode-' + i\">Default</label>\n <select [id]=\"'vpe-default-mode-' + i\" class=\"vpe-input\" [ngModel]=\"DefaultMode(property)\" (ngModelChange)=\"SetDefaultMode(i, $event)\" [disabled]=\"Disabled\">\n <option value=\"none\">None</option>\n <option value=\"value\">Fixed value</option>\n <option value=\"token\">Context token</option>\n </select>\n </div>\n @if (DefaultMode(property) === 'value') {\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-default-' + i\">Value</label>\n @if (property.Type === 'boolean') {\n <select [id]=\"'vpe-default-' + i\" class=\"vpe-input\" [ngModel]=\"DefaultText(property)\" (ngModelChange)=\"SetDefaultValue(i, $event)\" [disabled]=\"Disabled\">\n <option value=\"\">(none)</option>\n <option value=\"true\">true</option>\n <option value=\"false\">false</option>\n </select>\n } @else {\n <input [id]=\"'vpe-default-' + i\" class=\"vpe-input\"\n [type]=\"property.Type === 'number' ? 'number' : property.Type === 'date' ? 'date' : 'text'\"\n [ngModel]=\"DefaultText(property)\" (ngModelChange)=\"SetDefaultValue(i, $event ?? '')\" [disabled]=\"Disabled\" />\n }\n </div>\n }\n @if (DefaultMode(property) === 'token') {\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-token-' + i\">Token</label>\n <select [id]=\"'vpe-token-' + i\" class=\"vpe-input\" [ngModel]=\"property.Default?.Token\" (ngModelChange)=\"SetToken(i, $event)\" [disabled]=\"Disabled\">\n @for (token of Tokens; track token) {\n <option [value]=\"token\">{{ token }}</option>\n }\n </select>\n </div>\n @if (TakesOffset(property)) {\n <div class=\"vpe-field vpe-offset\">\n <label [attr.for]=\"'vpe-offset-' + i\">Offset</label>\n <div class=\"vpe-offset-inputs\">\n <input [id]=\"'vpe-offset-' + i\" type=\"number\" step=\"1\" class=\"vpe-input\" [ngModel]=\"property.Default?.Offset?.Amount ?? null\"\n (ngModelChange)=\"SetOffset(i, $event, property.Default?.Offset?.Unit ?? 'day')\" [disabled]=\"Disabled\" />\n <select class=\"vpe-input\" aria-label=\"Offset unit\" [ngModel]=\"property.Default?.Offset?.Unit ?? 'day'\"\n (ngModelChange)=\"SetOffset(i, property.Default?.Offset?.Amount ?? null, $event)\" [disabled]=\"Disabled || !property.Default?.Offset\">\n @for (unit of OffsetUnits; track unit) {\n <option [value]=\"unit\">{{ unit }}</option>\n }\n </select>\n </div>\n </div>\n }\n }\n </div>\n\n <div class=\"vpe-flags\">\n <label class=\"vpe-check\">\n <input type=\"checkbox\" [ngModel]=\"property.IsRequired === true\" (ngModelChange)=\"Update(i, { IsRequired: $event })\" [disabled]=\"Disabled\" />\n Required\n </label>\n <label class=\"vpe-check\">\n <input type=\"checkbox\" [ngModel]=\"property.AllowOverride !== false\" (ngModelChange)=\"Update(i, { AllowOverride: $event })\" [disabled]=\"Disabled\" />\n Allow override\n @if (property.AllowOverride === false) {\n <span class=\"vpe-hint\"><i class=\"fa-solid fa-lock\" aria-hidden=\"true\"></i> only server code sets it</span>\n }\n </label>\n </div>\n </div>\n } @empty {\n <p class=\"vpe-empty\">This view has no properties.</p>\n }\n\n <button mjButton variant=\"outline\" size=\"sm\" (click)=\"AddProperty()\" [disabled]=\"Disabled || FieldOptions.length === 0\">\n <i class=\"fa-solid fa-plus\"></i> Add property\n </button>\n\n @if (Problems.length > 0) {\n <ul class=\"vpe-problems\" role=\"alert\">\n @for (problem of Problems; track problem) {\n <li>{{ problem }}</li>\n }\n </ul>\n }\n</div>\n", styles: [".vpe {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-3);\n}\n\n.vpe-intro,\n.vpe-empty {\n margin: 0;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-muted);\n}\n\n.vpe-card {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-2);\n padding: var(--mj-space-3);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n background: var(--mj-bg-surface-card);\n}\n\n.vpe-row {\n display: flex;\n align-items: flex-end;\n gap: var(--mj-space-2);\n}\n\n.vpe-field {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-1);\n flex: 1;\n min-width: 0;\n}\n\n.vpe-narrow {\n flex: 0 0 120px;\n}\n\n.vpe-field label {\n font-size: var(--mj-text-xs);\n font-weight: 500;\n color: var(--mj-text-secondary);\n}\n\n.vpe-input {\n width: 100%;\n padding: 6px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-sm);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface);\n box-sizing: border-box;\n}\n\n.vpe-input:focus {\n outline: none;\n border-color: var(--mj-border-focus);\n}\n\n.vpe-offset-inputs {\n display: flex;\n gap: var(--mj-space-1);\n}\n\n.vpe-flags {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-4);\n}\n\n.vpe-check {\n display: flex;\n align-items: center;\n gap: var(--mj-space-1);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-primary);\n}\n\n.vpe-hint {\n color: var(--mj-text-muted);\n font-size: var(--mj-text-xs);\n}\n\n.vpe-problems {\n margin: 0;\n padding-left: var(--mj-space-4);\n font-size: var(--mj-text-xs);\n color: var(--mj-status-error-text);\n}\n"] }]
435
+ }], null, { Entity: [{
436
+ type: Input
437
+ }], Properties: [{
438
+ type: Input
439
+ }], Disabled: [{
440
+ type: Input
441
+ }], PropertiesChange: [{
442
+ type: Output
443
+ }] }); })();
444
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ViewPropertiesEditorComponent, { className: "ViewPropertiesEditorComponent", filePath: "src/lib/view-properties-editor/view-properties-editor.component.ts", lineNumber: 35 }); })();
445
+ //# sourceMappingURL=view-properties-editor.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-properties-editor.component.js","sourceRoot":"","sources":["../../../src/lib/view-properties-editor/view-properties-editor.component.ts","../../../src/lib/view-properties-editor/view-properties-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,cAAc,EAId,qBAAqB,EACrB,oBAAoB,EAIpB,oCAAoC,EAGpC,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;;;;;;ICEhB,kCAAuB;IAAA,YAAU;IAAA,iBAAS;;;IAAlC,+BAAc;IAAC,cAAU;IAAV,6BAAU;;;IAmBjC,kCAA6B;IAAA,YAA6B;IAAA,iBAAS;;;IAA3D,qCAAoB;IAAC,cAA6B;IAA7B,gDAA6B;;;IAQ1D,kCAAqB;IAAA,YAAQ;IAAA,iBAAS;;;IAA9B,6BAAY;IAAC,cAAQ;IAAR,2BAAQ;;;;IAmB7B,kCAAyJ;IAAnE,8RAAiB,6CAA0B,KAAC;IAChI,kCAAiB;IAAA,sBAAM;IAAA,iBAAS;IAChC,kCAAqB;IAAA,oBAAI;IAAA,iBAAS;IAClC,kCAAsB;IAAA,qBAAK;IAC7B,AAD6B,iBAAS,EAC7B;;;;;;IAJ0H,AAA/E,AAA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P,2BAA2B;;kBAMpC,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBACL,MAAM;;kFAPI,6BAA6B","sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport {\n CONTEXT_TOKENS,\n ContextToken,\n EntityFieldInfo,\n EntityInfo,\n PROPERTY_OFFSET_UNITS,\n PROPERTY_VALUE_TYPES,\n PropertyDefault,\n PropertyOffsetUnit,\n PropertyValueType,\n USER_VIEW_PROPERTY_OPERATORS_BY_TYPE,\n UserViewProperty,\n UserViewPropertyOperator,\n ValidateUserViewProperties,\n} from '@memberjunction/core';\n\n/** How a property's default is given in the editor. */\nexport type ViewPropertyDefaultMode = 'none' | 'value' | 'token';\n\nconst USER_TOKENS: readonly ContextToken[] = ['Context.UserID', 'Context.UserEmail', 'Context.UserName'];\n\n/**\n * The Properties panel of the view designer: add, edit and remove a view's declared properties\n * (name, type, description, default as a fixed value or a token with an offset, required, allow\n * override, target field and operator). Edits are immutable: every change emits a new list\n * through `PropertiesChange`, so `[(Properties)]` works.\n */\n@Component({\n standalone: false,\n selector: 'mj-view-properties-editor',\n templateUrl: './view-properties-editor.component.html',\n styleUrls: ['./view-properties-editor.component.css'],\n})\nexport class ViewPropertiesEditorComponent {\n /** The view's entity: its fields are the targets a property can filter. */\n @Input() Entity: EntityInfo | null = null;\n /** The properties being edited. */\n @Input() Properties: UserViewProperty[] = [];\n /** True when the user cannot edit the view. */\n @Input() Disabled = false;\n @Output() PropertiesChange = new EventEmitter<UserViewProperty[]>();\n\n public readonly Types = PROPERTY_VALUE_TYPES;\n public readonly Tokens = CONTEXT_TOKENS;\n public readonly OffsetUnits = PROPERTY_OFFSET_UNITS;\n\n /** Fields a property can target: every non-binary field, in display order. */\n public get FieldOptions(): EntityFieldInfo[] {\n return (this.Entity?.Fields ?? []).filter(f => !f.IsBinaryFieldType);\n }\n\n /** What is wrong with the properties now, each naming the property; saving is blocked while any remain. */\n public get Problems(): string[] {\n return ValidateUserViewProperties(this.Properties, this.FieldOptions.map(f => f.Name));\n }\n\n public OperatorsFor(type: PropertyValueType): readonly UserViewPropertyOperator[] {\n return USER_VIEW_PROPERTY_OPERATORS_BY_TYPE[type] ?? [];\n }\n\n public DefaultMode(property: UserViewProperty): ViewPropertyDefaultMode {\n if (!property.Default) return 'none';\n return property.Default.Token !== undefined ? 'token' : 'value';\n }\n\n /** True when the property's default is a date token, which can take an offset. */\n public TakesOffset(property: UserViewProperty): boolean {\n return !!property.Default?.Token && !USER_TOKENS.includes(property.Default.Token);\n }\n\n /** The fixed default as the text an input shows. */\n public DefaultText(property: UserViewProperty): string {\n const value = property.Default?.Value;\n return value === null || value === undefined ? '' : String(value);\n }\n\n public AddProperty(): void {\n const field = this.FieldOptions[0]?.Name ?? '';\n this.emit([...this.Properties, { Name: this.nextName(), Type: 'string', AllowOverride: true, Target: { Field: field, Operator: '=' } }]);\n }\n\n public RemoveProperty(index: number): void {\n this.emit(this.Properties.filter((_, i) => i !== index));\n }\n\n public Update(index: number, patch: Partial<UserViewProperty>): void {\n this.emit(this.Properties.map((p, i) => (i === index ? { ...p, ...patch } : p)));\n }\n\n public SetField(index: number, field: string): void {\n this.Update(index, { Target: { ...this.Properties[index].Target, Field: field } });\n }\n\n public SetOperator(index: number, operator: UserViewPropertyOperator): void {\n this.Update(index, { Target: { ...this.Properties[index].Target, Operator: operator } });\n }\n\n /** A new type keeps the operator only if the type allows it, and drops a fixed default. */\n public SetType(index: number, type: PropertyValueType): void {\n const property = this.Properties[index];\n const operators = this.OperatorsFor(type);\n const operator = operators.includes(property.Target.Operator) ? property.Target.Operator : operators[0];\n const keepDefault = this.DefaultMode(property) === 'token';\n this.Update(index, { Type: type, Target: { ...property.Target, Operator: operator }, Default: keepDefault ? property.Default : undefined });\n }\n\n public SetDefaultMode(index: number, mode: ViewPropertyDefaultMode): void {\n const defaults: Record<ViewPropertyDefaultMode, PropertyDefault | undefined> = {\n none: undefined,\n value: { Value: null },\n token: { Token: this.Properties[index].Type === 'uuid' ? 'Context.UserID' : 'Context.Today' },\n };\n this.Update(index, { Default: defaults[mode] });\n }\n\n /** A fixed default from what the user typed: a number for a number property, true/false for a boolean, blank for none. */\n public SetDefaultValue(index: number, text: string): void {\n const type = this.Properties[index].Type;\n const trimmed = text.trim();\n let value: string | number | boolean | null = trimmed.length === 0 ? null : text;\n if (value !== null && type === 'number') value = Number(trimmed);\n if (value !== null && type === 'boolean') value = trimmed === 'true';\n this.Update(index, { Default: { Value: value } });\n }\n\n /** A user token takes no offset, so choosing one drops it. */\n public SetToken(index: number, token: ContextToken): void {\n const offset = USER_TOKENS.includes(token) ? undefined : this.Properties[index].Default?.Offset;\n this.Update(index, { Default: { Token: token, Offset: offset } });\n }\n\n /** An offset of 0 (or blank) removes it. */\n public SetOffset(index: number, amount: number | null, unit: PropertyOffsetUnit): void {\n const current = this.Properties[index].Default;\n const offset = amount ? { Amount: Math.trunc(amount), Unit: unit } : undefined;\n this.Update(index, { Default: { Token: current?.Token, Offset: offset } });\n }\n\n private emit(properties: UserViewProperty[]): void {\n this.Properties = properties;\n this.PropertiesChange.emit(properties);\n }\n\n private nextName(): string {\n const taken = new Set(this.Properties.map(p => p.Name.toLowerCase()));\n let n = this.Properties.length + 1;\n while (taken.has(`property${n}`)) n++;\n return `Property${n}`;\n }\n}\n","<div class=\"vpe\">\n <p class=\"vpe-intro\">\n A property is a named input that adds one filter on a field when a run gives it a value or it has a default.\n Turn off <strong>Allow override</strong> to let only server code set it.\n </p>\n\n @for (property of Properties; track $index; let i = $index) {\n <div class=\"vpe-card\">\n <div class=\"vpe-row\">\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-name-' + i\">Name</label>\n <input [id]=\"'vpe-name-' + i\" type=\"text\" class=\"vpe-input\" [ngModel]=\"property.Name\" (ngModelChange)=\"Update(i, { Name: $event })\" [disabled]=\"Disabled\" />\n </div>\n <div class=\"vpe-field vpe-narrow\">\n <label [attr.for]=\"'vpe-type-' + i\">Type</label>\n <select [id]=\"'vpe-type-' + i\" class=\"vpe-input\" [ngModel]=\"property.Type\" (ngModelChange)=\"SetType(i, $event)\" [disabled]=\"Disabled\">\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\" class=\"vpe-remove\" (click)=\"RemoveProperty(i)\" [disabled]=\"Disabled\" [attr.aria-label]=\"'Remove property ' + property.Name\" title=\"Remove property\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-desc-' + i\">Description</label>\n <input [id]=\"'vpe-desc-' + i\" type=\"text\" class=\"vpe-input\" [ngModel]=\"property.Description ?? ''\" (ngModelChange)=\"Update(i, { Description: $event || undefined })\" [disabled]=\"Disabled\" />\n </div>\n\n <div class=\"vpe-row\">\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-target-' + i\">Filters field</label>\n <select [id]=\"'vpe-target-' + i\" class=\"vpe-input\" [ngModel]=\"property.Target.Field\" (ngModelChange)=\"SetField(i, $event)\" [disabled]=\"Disabled\">\n @for (field of FieldOptions; track field.Name) {\n <option [value]=\"field.Name\">{{ field.DisplayNameOrName }}</option>\n }\n </select>\n </div>\n <div class=\"vpe-field vpe-narrow\">\n <label [attr.for]=\"'vpe-op-' + i\">Operator</label>\n <select [id]=\"'vpe-op-' + i\" class=\"vpe-input\" [ngModel]=\"property.Target.Operator\" (ngModelChange)=\"SetOperator(i, $event)\" [disabled]=\"Disabled\">\n @for (op of OperatorsFor(property.Type); track op) {\n <option [value]=\"op\">{{ op }}</option>\n }\n </select>\n </div>\n </div>\n\n <div class=\"vpe-row\">\n <div class=\"vpe-field vpe-narrow\">\n <label [attr.for]=\"'vpe-default-mode-' + i\">Default</label>\n <select [id]=\"'vpe-default-mode-' + i\" class=\"vpe-input\" [ngModel]=\"DefaultMode(property)\" (ngModelChange)=\"SetDefaultMode(i, $event)\" [disabled]=\"Disabled\">\n <option value=\"none\">None</option>\n <option value=\"value\">Fixed value</option>\n <option value=\"token\">Context token</option>\n </select>\n </div>\n @if (DefaultMode(property) === 'value') {\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-default-' + i\">Value</label>\n @if (property.Type === 'boolean') {\n <select [id]=\"'vpe-default-' + i\" class=\"vpe-input\" [ngModel]=\"DefaultText(property)\" (ngModelChange)=\"SetDefaultValue(i, $event)\" [disabled]=\"Disabled\">\n <option value=\"\">(none)</option>\n <option value=\"true\">true</option>\n <option value=\"false\">false</option>\n </select>\n } @else {\n <input [id]=\"'vpe-default-' + i\" class=\"vpe-input\"\n [type]=\"property.Type === 'number' ? 'number' : property.Type === 'date' ? 'date' : 'text'\"\n [ngModel]=\"DefaultText(property)\" (ngModelChange)=\"SetDefaultValue(i, $event ?? '')\" [disabled]=\"Disabled\" />\n }\n </div>\n }\n @if (DefaultMode(property) === 'token') {\n <div class=\"vpe-field\">\n <label [attr.for]=\"'vpe-token-' + i\">Token</label>\n <select [id]=\"'vpe-token-' + i\" class=\"vpe-input\" [ngModel]=\"property.Default?.Token\" (ngModelChange)=\"SetToken(i, $event)\" [disabled]=\"Disabled\">\n @for (token of Tokens; track token) {\n <option [value]=\"token\">{{ token }}</option>\n }\n </select>\n </div>\n @if (TakesOffset(property)) {\n <div class=\"vpe-field vpe-offset\">\n <label [attr.for]=\"'vpe-offset-' + i\">Offset</label>\n <div class=\"vpe-offset-inputs\">\n <input [id]=\"'vpe-offset-' + i\" type=\"number\" step=\"1\" class=\"vpe-input\" [ngModel]=\"property.Default?.Offset?.Amount ?? null\"\n (ngModelChange)=\"SetOffset(i, $event, property.Default?.Offset?.Unit ?? 'day')\" [disabled]=\"Disabled\" />\n <select class=\"vpe-input\" aria-label=\"Offset unit\" [ngModel]=\"property.Default?.Offset?.Unit ?? 'day'\"\n (ngModelChange)=\"SetOffset(i, property.Default?.Offset?.Amount ?? null, $event)\" [disabled]=\"Disabled || !property.Default?.Offset\">\n @for (unit of OffsetUnits; track unit) {\n <option [value]=\"unit\">{{ unit }}</option>\n }\n </select>\n </div>\n </div>\n }\n }\n </div>\n\n <div class=\"vpe-flags\">\n <label class=\"vpe-check\">\n <input type=\"checkbox\" [ngModel]=\"property.IsRequired === true\" (ngModelChange)=\"Update(i, { IsRequired: $event })\" [disabled]=\"Disabled\" />\n Required\n </label>\n <label class=\"vpe-check\">\n <input type=\"checkbox\" [ngModel]=\"property.AllowOverride !== false\" (ngModelChange)=\"Update(i, { AllowOverride: $event })\" [disabled]=\"Disabled\" />\n Allow override\n @if (property.AllowOverride === false) {\n <span class=\"vpe-hint\"><i class=\"fa-solid fa-lock\" aria-hidden=\"true\"></i> only server code sets it</span>\n }\n </label>\n </div>\n </div>\n } @empty {\n <p class=\"vpe-empty\">This view has no properties.</p>\n }\n\n <button mjButton variant=\"outline\" size=\"sm\" (click)=\"AddProperty()\" [disabled]=\"Disabled || FieldOptions.length === 0\">\n <i class=\"fa-solid fa-plus\"></i> Add property\n </button>\n\n @if (Problems.length > 0) {\n <ul class=\"vpe-problems\" role=\"alert\">\n @for (problem of Problems; track problem) {\n <li>{{ problem }}</li>\n }\n </ul>\n }\n</div>\n"]}