@memberjunction/ng-list-management 0.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/lib/components/list-management-dialog/list-management-dialog.component.d.ts +170 -0
  2. package/dist/lib/components/list-management-dialog/list-management-dialog.component.d.ts.map +1 -0
  3. package/dist/lib/components/list-management-dialog/list-management-dialog.component.js +943 -0
  4. package/dist/lib/components/list-management-dialog/list-management-dialog.component.js.map +1 -0
  5. package/dist/lib/components/list-share-dialog/list-share-dialog.component.d.ts +137 -0
  6. package/dist/lib/components/list-share-dialog/list-share-dialog.component.d.ts.map +1 -0
  7. package/dist/lib/components/list-share-dialog/list-share-dialog.component.js +658 -0
  8. package/dist/lib/components/list-share-dialog/list-share-dialog.component.js.map +1 -0
  9. package/dist/lib/models/list-management.models.d.ts +206 -0
  10. package/dist/lib/models/list-management.models.d.ts.map +1 -0
  11. package/dist/lib/models/list-management.models.js +2 -0
  12. package/dist/lib/models/list-management.models.js.map +1 -0
  13. package/dist/lib/models/list-sharing.models.d.ts +193 -0
  14. package/dist/lib/models/list-sharing.models.d.ts.map +1 -0
  15. package/dist/lib/models/list-sharing.models.js +2 -0
  16. package/dist/lib/models/list-sharing.models.js.map +1 -0
  17. package/dist/lib/module.d.ts +44 -0
  18. package/dist/lib/module.d.ts.map +1 -0
  19. package/dist/lib/module.js +101 -0
  20. package/dist/lib/module.js.map +1 -0
  21. package/dist/lib/services/list-management.service.d.ts +69 -0
  22. package/dist/lib/services/list-management.service.d.ts.map +1 -0
  23. package/dist/lib/services/list-management.service.js +411 -0
  24. package/dist/lib/services/list-management.service.js.map +1 -0
  25. package/dist/lib/services/list-sharing.service.d.ts +98 -0
  26. package/dist/lib/services/list-sharing.service.d.ts.map +1 -0
  27. package/dist/lib/services/list-sharing.service.js +483 -0
  28. package/dist/lib/services/list-sharing.service.js.map +1 -0
  29. package/dist/public-api.d.ts +13 -0
  30. package/dist/public-api.d.ts.map +1 -0
  31. package/dist/public-api.js +23 -0
  32. package/dist/public-api.js.map +1 -0
  33. package/package.json +48 -6
  34. package/README.md +0 -45
@@ -0,0 +1,658 @@
1
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { debounceTime, takeUntil } from 'rxjs/operators';
4
+ import { Metadata } from '@memberjunction/core';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "../../services/list-sharing.service";
7
+ import * as i2 from "@angular/common";
8
+ import * as i3 from "@angular/forms";
9
+ import * as i4 from "@progress/kendo-angular-dialog";
10
+ import * as i5 from "@progress/kendo-angular-buttons";
11
+ import * as i6 from "@progress/kendo-angular-inputs";
12
+ import * as i7 from "@progress/kendo-angular-dropdowns";
13
+ import * as i8 from "@memberjunction/ng-shared-generic";
14
+ function ListShareDialogComponent_kendo_dialog_0_div_2_Template(rf, ctx) { if (rf & 1) {
15
+ i0.ɵɵelementStart(0, "div", 7);
16
+ i0.ɵɵelement(1, "mj-loading", 8);
17
+ i0.ɵɵelementEnd();
18
+ } }
19
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_ng_template_12_Template(rf, ctx) { if (rf & 1) {
20
+ i0.ɵɵelement(0, "i", 25);
21
+ } }
22
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_13_div_1_span_5_Template(rf, ctx) { if (rf & 1) {
23
+ i0.ɵɵelementStart(0, "span", 32);
24
+ i0.ɵɵtext(1);
25
+ i0.ɵɵelementEnd();
26
+ } if (rf & 2) {
27
+ const recipient_r5 = i0.ɵɵnextContext().$implicit;
28
+ i0.ɵɵadvance();
29
+ i0.ɵɵtextInterpolate(recipient_r5.email);
30
+ } }
31
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_13_div_1_Template(rf, ctx) { if (rf & 1) {
32
+ const _r4 = i0.ɵɵgetCurrentView();
33
+ i0.ɵɵelementStart(0, "div", 28);
34
+ i0.ɵɵlistener("mousedown", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_13_div_1_Template_div_mousedown_0_listener() { const recipient_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.selectRecipient(recipient_r5)); });
35
+ i0.ɵɵelement(1, "i");
36
+ i0.ɵɵelementStart(2, "div", 29)(3, "span", 30);
37
+ i0.ɵɵtext(4);
38
+ i0.ɵɵelementEnd();
39
+ i0.ɵɵtemplate(5, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_13_div_1_span_5_Template, 2, 1, "span", 31);
40
+ i0.ɵɵelementEnd()();
41
+ } if (rf & 2) {
42
+ const recipient_r5 = ctx.$implicit;
43
+ const ctx_r1 = i0.ɵɵnextContext(5);
44
+ i0.ɵɵadvance();
45
+ i0.ɵɵclassMap(ctx_r1.getShareTypeIcon(recipient_r5.type));
46
+ i0.ɵɵadvance(3);
47
+ i0.ɵɵtextInterpolate(recipient_r5.name);
48
+ i0.ɵɵadvance();
49
+ i0.ɵɵproperty("ngIf", recipient_r5.email);
50
+ } }
51
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_13_Template(rf, ctx) { if (rf & 1) {
52
+ i0.ɵɵelementStart(0, "div", 26);
53
+ i0.ɵɵtemplate(1, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_13_div_1_Template, 6, 4, "div", 27);
54
+ i0.ɵɵelementEnd();
55
+ } if (rf & 2) {
56
+ const ctx_r1 = i0.ɵɵnextContext(4);
57
+ i0.ɵɵadvance();
58
+ i0.ɵɵproperty("ngForOf", ctx_r1.searchResults);
59
+ } }
60
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_14_ng_template_7_Template(rf, ctx) { if (rf & 1) {
61
+ i0.ɵɵelementStart(0, "div", 40)(1, "span", 41);
62
+ i0.ɵɵtext(2);
63
+ i0.ɵɵelementEnd();
64
+ i0.ɵɵelementStart(3, "span", 42);
65
+ i0.ɵɵtext(4);
66
+ i0.ɵɵelementEnd()();
67
+ } if (rf & 2) {
68
+ const dataItem_r7 = ctx.$implicit;
69
+ i0.ɵɵadvance(2);
70
+ i0.ɵɵtextInterpolate(dataItem_r7.label);
71
+ i0.ɵɵadvance(2);
72
+ i0.ɵɵtextInterpolate(dataItem_r7.description);
73
+ } }
74
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_14_Template(rf, ctx) { if (rf & 1) {
75
+ const _r6 = i0.ɵɵgetCurrentView();
76
+ i0.ɵɵelementStart(0, "div", 33)(1, "div", 34);
77
+ i0.ɵɵelement(2, "i");
78
+ i0.ɵɵelementStart(3, "span");
79
+ i0.ɵɵtext(4);
80
+ i0.ɵɵelementEnd();
81
+ i0.ɵɵelementStart(5, "button", 35);
82
+ i0.ɵɵlistener("click", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_14_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.clearSearch()); });
83
+ i0.ɵɵelementEnd()();
84
+ i0.ɵɵelementStart(6, "kendo-dropdownlist", 36);
85
+ i0.ɵɵtwoWayListener("ngModelChange", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_14_Template_kendo_dropdownlist_ngModelChange_6_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(4); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedPermission, $event) || (ctx_r1.selectedPermission = $event); return i0.ɵɵresetView($event); });
86
+ i0.ɵɵtemplate(7, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_14_ng_template_7_Template, 5, 2, "ng-template", 37);
87
+ i0.ɵɵelementEnd();
88
+ i0.ɵɵelementStart(8, "button", 38);
89
+ i0.ɵɵlistener("click", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_14_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.addShare()); });
90
+ i0.ɵɵelement(9, "i", 39);
91
+ i0.ɵɵtext(10, " Add ");
92
+ i0.ɵɵelementEnd()();
93
+ } if (rf & 2) {
94
+ const ctx_r1 = i0.ɵɵnextContext(4);
95
+ i0.ɵɵadvance(2);
96
+ i0.ɵɵclassMap(ctx_r1.getShareTypeIcon(ctx_r1.selectedRecipient.type));
97
+ i0.ɵɵadvance(2);
98
+ i0.ɵɵtextInterpolate(ctx_r1.selectedRecipient.name);
99
+ i0.ɵɵadvance();
100
+ i0.ɵɵproperty("look", "flat")("icon", "close");
101
+ i0.ɵɵadvance();
102
+ i0.ɵɵproperty("data", ctx_r1.permissionOptions)("textField", "label")("valueField", "value");
103
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedPermission);
104
+ i0.ɵɵproperty("valuePrimitive", true);
105
+ i0.ɵɵadvance(2);
106
+ i0.ɵɵproperty("disabled", ctx_r1.saving);
107
+ } }
108
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_Template(rf, ctx) { if (rf & 1) {
109
+ const _r3 = i0.ɵɵgetCurrentView();
110
+ i0.ɵɵelementStart(0, "div", 14)(1, "h4", 15);
111
+ i0.ɵɵtext(2, "Add people or roles");
112
+ i0.ɵɵelementEnd();
113
+ i0.ɵɵelementStart(3, "div", 16)(4, "button", 17);
114
+ i0.ɵɵlistener("click", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.setSearchType("User")); });
115
+ i0.ɵɵelement(5, "i", 18);
116
+ i0.ɵɵtext(6, " Users ");
117
+ i0.ɵɵelementEnd();
118
+ i0.ɵɵelementStart(7, "button", 17);
119
+ i0.ɵɵlistener("click", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.setSearchType("Role")); });
120
+ i0.ɵɵelement(8, "i", 19);
121
+ i0.ɵɵtext(9, " Roles ");
122
+ i0.ɵɵelementEnd()();
123
+ i0.ɵɵelementStart(10, "div", 20)(11, "kendo-textbox", 21);
124
+ i0.ɵɵlistener("valueChange", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_Template_kendo_textbox_valueChange_11_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onSearchInput($event)); })("blur", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_Template_kendo_textbox_blur_11_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.showSearchResults = false); });
125
+ i0.ɵɵtemplate(12, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_ng_template_12_Template, 1, 0, "ng-template", 22);
126
+ i0.ɵɵelementEnd();
127
+ i0.ɵɵtemplate(13, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_13_Template, 2, 1, "div", 23);
128
+ i0.ɵɵelementEnd();
129
+ i0.ɵɵtemplate(14, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_div_14_Template, 11, 11, "div", 24);
130
+ i0.ɵɵelementEnd();
131
+ } if (rf & 2) {
132
+ const ctx_r1 = i0.ɵɵnextContext(3);
133
+ i0.ɵɵadvance(4);
134
+ i0.ɵɵproperty("fillMode", ctx_r1.searchType === "User" ? "solid" : "outline")("themeColor", ctx_r1.searchType === "User" ? "primary" : "base");
135
+ i0.ɵɵadvance(3);
136
+ i0.ɵɵproperty("fillMode", ctx_r1.searchType === "Role" ? "solid" : "outline")("themeColor", ctx_r1.searchType === "Role" ? "primary" : "base");
137
+ i0.ɵɵadvance(4);
138
+ i0.ɵɵproperty("value", ctx_r1.searchText)("placeholder", "Search for " + (ctx_r1.searchType === "User" ? "users" : "roles") + "...")("clearButton", true);
139
+ i0.ɵɵadvance(2);
140
+ i0.ɵɵproperty("ngIf", ctx_r1.showSearchResults && ctx_r1.searchResults.length > 0);
141
+ i0.ɵɵadvance();
142
+ i0.ɵɵproperty("ngIf", ctx_r1.selectedRecipient);
143
+ } }
144
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_hr_2_Template(rf, ctx) { if (rf & 1) {
145
+ i0.ɵɵelement(0, "hr", 43);
146
+ } }
147
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_span_6_Template(rf, ctx) { if (rf & 1) {
148
+ i0.ɵɵelementStart(0, "span", 58);
149
+ i0.ɵɵtext(1);
150
+ i0.ɵɵelementEnd();
151
+ } if (rf & 2) {
152
+ const share_r8 = i0.ɵɵnextContext().$implicit;
153
+ i0.ɵɵadvance();
154
+ i0.ɵɵtextInterpolate(share_r8.recipientEmail);
155
+ } }
156
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_span_7_Template(rf, ctx) { if (rf & 1) {
157
+ i0.ɵɵelementStart(0, "span", 59);
158
+ i0.ɵɵtext(1, "Role");
159
+ i0.ɵɵelementEnd();
160
+ } }
161
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_kendo_dropdownlist_9_Template(rf, ctx) { if (rf & 1) {
162
+ const _r9 = i0.ɵɵgetCurrentView();
163
+ i0.ɵɵelementStart(0, "kendo-dropdownlist", 60);
164
+ i0.ɵɵlistener("valueChange", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_kendo_dropdownlist_9_Template_kendo_dropdownlist_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r9); const share_r8 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.updateSharePermission(share_r8, $event)); });
165
+ i0.ɵɵelementEnd();
166
+ } if (rf & 2) {
167
+ const share_r8 = i0.ɵɵnextContext().$implicit;
168
+ const ctx_r1 = i0.ɵɵnextContext(4);
169
+ i0.ɵɵproperty("data", ctx_r1.permissionOptions)("textField", "label")("valueField", "value")("value", share_r8.permissionLevel)("valuePrimitive", true)("disabled", ctx_r1.saving);
170
+ } }
171
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_span_10_Template(rf, ctx) { if (rf & 1) {
172
+ i0.ɵɵelementStart(0, "span", 61);
173
+ i0.ɵɵtext(1);
174
+ i0.ɵɵelementEnd();
175
+ } if (rf & 2) {
176
+ const share_r8 = i0.ɵɵnextContext().$implicit;
177
+ const ctx_r1 = i0.ɵɵnextContext(4);
178
+ i0.ɵɵadvance();
179
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.getPermissionLabel(share_r8.permissionLevel), " ");
180
+ } }
181
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_button_11_Template(rf, ctx) { if (rf & 1) {
182
+ const _r10 = i0.ɵɵgetCurrentView();
183
+ i0.ɵɵelementStart(0, "button", 62);
184
+ i0.ɵɵlistener("click", function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_button_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r10); const share_r8 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.removeShare(share_r8)); });
185
+ i0.ɵɵelementEnd();
186
+ } if (rf & 2) {
187
+ const ctx_r1 = i0.ɵɵnextContext(5);
188
+ i0.ɵɵproperty("look", "flat")("icon", "trash")("disabled", ctx_r1.saving);
189
+ } }
190
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_Template(rf, ctx) { if (rf & 1) {
191
+ i0.ɵɵelementStart(0, "div", 47)(1, "div", 48);
192
+ i0.ɵɵelement(2, "i", 49);
193
+ i0.ɵɵelementStart(3, "div", 50)(4, "span", 51);
194
+ i0.ɵɵtext(5);
195
+ i0.ɵɵelementEnd();
196
+ i0.ɵɵtemplate(6, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_span_6_Template, 2, 1, "span", 52)(7, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_span_7_Template, 2, 0, "span", 53);
197
+ i0.ɵɵelementEnd()();
198
+ i0.ɵɵelementStart(8, "div", 54);
199
+ i0.ɵɵtemplate(9, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_kendo_dropdownlist_9_Template, 1, 6, "kendo-dropdownlist", 55)(10, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_span_10_Template, 2, 1, "span", 56)(11, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_button_11_Template, 1, 3, "button", 57);
200
+ i0.ɵɵelementEnd()();
201
+ } if (rf & 2) {
202
+ const share_r8 = ctx.$implicit;
203
+ const ctx_r1 = i0.ɵɵnextContext(4);
204
+ i0.ɵɵadvance(2);
205
+ i0.ɵɵclassMap(ctx_r1.getShareTypeIcon(share_r8.type));
206
+ i0.ɵɵadvance(3);
207
+ i0.ɵɵtextInterpolate(share_r8.recipientName);
208
+ i0.ɵɵadvance();
209
+ i0.ɵɵproperty("ngIf", share_r8.recipientEmail);
210
+ i0.ɵɵadvance();
211
+ i0.ɵɵproperty("ngIf", share_r8.type === "Role");
212
+ i0.ɵɵadvance(2);
213
+ i0.ɵɵproperty("ngIf", ctx_r1.canModifyShares);
214
+ i0.ɵɵadvance();
215
+ i0.ɵɵproperty("ngIf", !ctx_r1.canModifyShares);
216
+ i0.ɵɵadvance();
217
+ i0.ɵɵproperty("ngIf", ctx_r1.canModifyShares);
218
+ } }
219
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_Template(rf, ctx) { if (rf & 1) {
220
+ i0.ɵɵelementStart(0, "div", 44)(1, "h4", 15);
221
+ i0.ɵɵtext(2, "People with access");
222
+ i0.ɵɵelementEnd();
223
+ i0.ɵɵelementStart(3, "div", 45);
224
+ i0.ɵɵtemplate(4, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_div_4_Template, 12, 8, "div", 46);
225
+ i0.ɵɵelementEnd()();
226
+ } if (rf & 2) {
227
+ const ctx_r1 = i0.ɵɵnextContext(3);
228
+ i0.ɵɵadvance(4);
229
+ i0.ɵɵproperty("ngForOf", ctx_r1.currentShares);
230
+ } }
231
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_4_p_4_Template(rf, ctx) { if (rf & 1) {
232
+ i0.ɵɵelementStart(0, "p", 66);
233
+ i0.ɵɵtext(1, " Use the search above to find users or roles to share with. ");
234
+ i0.ɵɵelementEnd();
235
+ } }
236
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_4_Template(rf, ctx) { if (rf & 1) {
237
+ i0.ɵɵelementStart(0, "div", 63);
238
+ i0.ɵɵelement(1, "i", 64);
239
+ i0.ɵɵelementStart(2, "p");
240
+ i0.ɵɵtext(3, "This list hasn't been shared with anyone yet.");
241
+ i0.ɵɵelementEnd();
242
+ i0.ɵɵtemplate(4, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_4_p_4_Template, 2, 0, "p", 65);
243
+ i0.ɵɵelementEnd();
244
+ } if (rf & 2) {
245
+ const ctx_r1 = i0.ɵɵnextContext(3);
246
+ i0.ɵɵadvance(4);
247
+ i0.ɵɵproperty("ngIf", ctx_r1.canModifyShares);
248
+ } }
249
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_5_Template(rf, ctx) { if (rf & 1) {
250
+ i0.ɵɵelementStart(0, "div", 67);
251
+ i0.ɵɵelement(1, "i", 68);
252
+ i0.ɵɵelementStart(2, "span");
253
+ i0.ɵɵtext(3, "Only the list owner can manage sharing.");
254
+ i0.ɵɵelementEnd()();
255
+ } }
256
+ function ListShareDialogComponent_kendo_dialog_0_ng_container_3_Template(rf, ctx) { if (rf & 1) {
257
+ i0.ɵɵelementContainerStart(0);
258
+ i0.ɵɵtemplate(1, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_1_Template, 15, 9, "div", 9)(2, ListShareDialogComponent_kendo_dialog_0_ng_container_3_hr_2_Template, 1, 0, "hr", 10)(3, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_3_Template, 5, 1, "div", 11)(4, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_4_Template, 5, 1, "div", 12)(5, ListShareDialogComponent_kendo_dialog_0_ng_container_3_div_5_Template, 4, 0, "div", 13);
259
+ i0.ɵɵelementContainerEnd();
260
+ } if (rf & 2) {
261
+ const ctx_r1 = i0.ɵɵnextContext(2);
262
+ i0.ɵɵadvance();
263
+ i0.ɵɵproperty("ngIf", ctx_r1.canModifyShares);
264
+ i0.ɵɵadvance();
265
+ i0.ɵɵproperty("ngIf", ctx_r1.currentShares.length > 0 && ctx_r1.canModifyShares);
266
+ i0.ɵɵadvance();
267
+ i0.ɵɵproperty("ngIf", ctx_r1.currentShares.length > 0);
268
+ i0.ɵɵadvance();
269
+ i0.ɵɵproperty("ngIf", ctx_r1.currentShares.length === 0 && !ctx_r1.loading);
270
+ i0.ɵɵadvance();
271
+ i0.ɵɵproperty("ngIf", !ctx_r1.canModifyShares);
272
+ } }
273
+ function ListShareDialogComponent_kendo_dialog_0_Template(rf, ctx) { if (rf & 1) {
274
+ const _r1 = i0.ɵɵgetCurrentView();
275
+ i0.ɵɵelementStart(0, "kendo-dialog", 1);
276
+ i0.ɵɵlistener("close", function ListShareDialogComponent_kendo_dialog_0_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCancel()); });
277
+ i0.ɵɵelementStart(1, "div", 2);
278
+ i0.ɵɵtemplate(2, ListShareDialogComponent_kendo_dialog_0_div_2_Template, 2, 0, "div", 3)(3, ListShareDialogComponent_kendo_dialog_0_ng_container_3_Template, 6, 5, "ng-container", 4);
279
+ i0.ɵɵelementEnd();
280
+ i0.ɵɵelementStart(4, "kendo-dialog-actions")(5, "button", 5);
281
+ i0.ɵɵlistener("click", function ListShareDialogComponent_kendo_dialog_0_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onDone()); });
282
+ i0.ɵɵtext(6, "Done");
283
+ i0.ɵɵelementEnd();
284
+ i0.ɵɵelementStart(7, "button", 6);
285
+ i0.ɵɵlistener("click", function ListShareDialogComponent_kendo_dialog_0_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCancel()); });
286
+ i0.ɵɵtext(8, "Cancel");
287
+ i0.ɵɵelementEnd()()();
288
+ } if (rf & 2) {
289
+ const ctx_r1 = i0.ɵɵnextContext();
290
+ i0.ɵɵproperty("title", ctx_r1.dialogTitle)("width", 500)("minWidth", 400);
291
+ i0.ɵɵadvance(2);
292
+ i0.ɵɵproperty("ngIf", ctx_r1.loading);
293
+ i0.ɵɵadvance();
294
+ i0.ɵɵproperty("ngIf", !ctx_r1.loading);
295
+ } }
296
+ /**
297
+ * Dialog component for managing list sharing.
298
+ * Allows users to share lists with other users or roles with different permission levels.
299
+ *
300
+ * Features:
301
+ * - User/role search with autocomplete
302
+ * - Permission level selection (View, Edit, Owner)
303
+ * - Current shares management
304
+ * - Remove access functionality
305
+ */
306
+ export class ListShareDialogComponent {
307
+ sharingService;
308
+ cdr;
309
+ /**
310
+ * Configuration for the dialog
311
+ */
312
+ config;
313
+ /**
314
+ * Controls dialog visibility
315
+ */
316
+ get visible() {
317
+ return this._visible;
318
+ }
319
+ set visible(value) {
320
+ if (value && !this._visible) {
321
+ this.initializeDialog();
322
+ }
323
+ this._visible = value;
324
+ }
325
+ _visible = false;
326
+ /**
327
+ * Emitted when dialog is closed with results
328
+ */
329
+ complete = new EventEmitter();
330
+ /**
331
+ * Emitted when dialog is cancelled
332
+ */
333
+ cancel = new EventEmitter();
334
+ // State
335
+ loading = false;
336
+ saving = false;
337
+ searchText = '';
338
+ searchType = 'User';
339
+ showSearchResults = false;
340
+ // Data
341
+ currentShares = [];
342
+ searchResults = [];
343
+ selectedRecipient = null;
344
+ selectedPermission = 'View';
345
+ // Track changes
346
+ sharesAdded = [];
347
+ sharesUpdated = [];
348
+ sharesRemoved = [];
349
+ // Permission options
350
+ permissionOptions = [
351
+ { value: 'View', label: 'Viewer', description: 'Can view list contents' },
352
+ { value: 'Edit', label: 'Editor', description: 'Can add/remove items' },
353
+ { value: 'Owner', label: 'Co-owner', description: 'Full control including sharing' }
354
+ ];
355
+ // Cleanup
356
+ destroy$ = new Subject();
357
+ searchSubject = new Subject();
358
+ constructor(sharingService, cdr) {
359
+ this.sharingService = sharingService;
360
+ this.cdr = cdr;
361
+ }
362
+ ngOnInit() {
363
+ this.setupSearchDebounce();
364
+ }
365
+ ngOnDestroy() {
366
+ this.destroy$.next();
367
+ this.destroy$.complete();
368
+ }
369
+ /**
370
+ * Get dialog title
371
+ */
372
+ get dialogTitle() {
373
+ return `Share "${this.config?.listName || 'List'}"`;
374
+ }
375
+ /**
376
+ * Check if there are pending changes
377
+ */
378
+ get hasChanges() {
379
+ return this.sharesAdded.length > 0 ||
380
+ this.sharesUpdated.length > 0 ||
381
+ this.sharesRemoved.length > 0;
382
+ }
383
+ /**
384
+ * Setup search with debounce
385
+ */
386
+ setupSearchDebounce() {
387
+ this.searchSubject.pipe(debounceTime(300), takeUntil(this.destroy$)).subscribe(async (searchText) => {
388
+ if (searchText.trim().length >= 2) {
389
+ await this.performSearch(searchText);
390
+ }
391
+ else {
392
+ this.searchResults = [];
393
+ this.showSearchResults = false;
394
+ }
395
+ this.cdr.detectChanges();
396
+ });
397
+ }
398
+ /**
399
+ * Initialize dialog when opened
400
+ */
401
+ async initializeDialog() {
402
+ this.resetState();
403
+ await this.loadCurrentShares();
404
+ }
405
+ /**
406
+ * Reset all state
407
+ */
408
+ resetState() {
409
+ this.searchText = '';
410
+ this.searchType = 'User';
411
+ this.showSearchResults = false;
412
+ this.searchResults = [];
413
+ this.selectedRecipient = null;
414
+ this.selectedPermission = 'View';
415
+ this.sharesAdded = [];
416
+ this.sharesUpdated = [];
417
+ this.sharesRemoved = [];
418
+ }
419
+ /**
420
+ * Load current shares for the list
421
+ */
422
+ async loadCurrentShares() {
423
+ if (!this.config)
424
+ return;
425
+ this.loading = true;
426
+ this.cdr.detectChanges();
427
+ try {
428
+ this.currentShares = await this.sharingService.getListShares(this.config.listId);
429
+ }
430
+ catch (error) {
431
+ console.error('Error loading shares:', error);
432
+ this.currentShares = [];
433
+ }
434
+ finally {
435
+ this.loading = false;
436
+ this.cdr.detectChanges();
437
+ }
438
+ }
439
+ /**
440
+ * Handle search input
441
+ */
442
+ onSearchInput(event) {
443
+ const value = event.target.value;
444
+ this.searchText = value;
445
+ this.searchSubject.next(value);
446
+ }
447
+ /**
448
+ * Clear search
449
+ */
450
+ clearSearch() {
451
+ this.searchText = '';
452
+ this.searchResults = [];
453
+ this.showSearchResults = false;
454
+ this.selectedRecipient = null;
455
+ }
456
+ /**
457
+ * Switch search type
458
+ */
459
+ setSearchType(type) {
460
+ this.searchType = type;
461
+ if (this.searchText.trim().length >= 2) {
462
+ this.searchSubject.next(this.searchText);
463
+ }
464
+ }
465
+ /**
466
+ * Perform search
467
+ */
468
+ async performSearch(searchText) {
469
+ try {
470
+ if (this.searchType === 'User') {
471
+ this.searchResults = await this.sharingService.searchUsers(searchText);
472
+ }
473
+ else {
474
+ this.searchResults = await this.sharingService.searchRoles(searchText);
475
+ }
476
+ // Filter out recipients that already have access
477
+ const existingIds = new Set(this.currentShares.map(s => s.recipientId));
478
+ this.searchResults = this.searchResults.filter(r => !existingIds.has(r.id));
479
+ // Also filter out the list owner
480
+ this.searchResults = this.searchResults.filter(r => r.id !== this.config?.currentUserId);
481
+ this.showSearchResults = this.searchResults.length > 0;
482
+ }
483
+ catch (error) {
484
+ console.error('Error searching:', error);
485
+ this.searchResults = [];
486
+ }
487
+ }
488
+ /**
489
+ * Select a recipient from search results
490
+ */
491
+ selectRecipient(recipient) {
492
+ this.selectedRecipient = recipient;
493
+ this.searchText = recipient.name;
494
+ this.showSearchResults = false;
495
+ this.cdr.detectChanges();
496
+ }
497
+ /**
498
+ * Add the selected recipient as a share
499
+ */
500
+ async addShare() {
501
+ if (!this.selectedRecipient || !this.config)
502
+ return;
503
+ this.saving = true;
504
+ try {
505
+ const md = new Metadata();
506
+ let result;
507
+ if (this.selectedRecipient.type === 'User') {
508
+ result = await this.sharingService.shareListWithUser(this.config.listId, this.selectedRecipient.id, this.selectedPermission, this.config.currentUserId);
509
+ }
510
+ else {
511
+ result = await this.sharingService.shareListWithRole(this.config.listId, this.selectedRecipient.id, this.selectedPermission, this.config.currentUserId);
512
+ }
513
+ if (result.success && result.shareId) {
514
+ // Create a ListShareInfo for tracking
515
+ const newShare = {
516
+ shareId: result.shareId,
517
+ listId: this.config.listId,
518
+ type: this.selectedRecipient.type,
519
+ recipientId: this.selectedRecipient.id,
520
+ recipientName: this.selectedRecipient.name,
521
+ recipientEmail: this.selectedRecipient.email,
522
+ permissionLevel: this.selectedPermission,
523
+ status: 'Approved'
524
+ };
525
+ this.currentShares.push(newShare);
526
+ this.sharesAdded.push(newShare);
527
+ // Clear selection
528
+ this.clearSearch();
529
+ this.selectedPermission = 'View';
530
+ }
531
+ else {
532
+ console.error('Failed to add share:', result.message);
533
+ }
534
+ }
535
+ catch (error) {
536
+ console.error('Error adding share:', error);
537
+ }
538
+ finally {
539
+ this.saving = false;
540
+ this.cdr.detectChanges();
541
+ }
542
+ }
543
+ /**
544
+ * Update permission level for an existing share
545
+ */
546
+ async updateSharePermission(share, newLevel) {
547
+ if (share.permissionLevel === newLevel)
548
+ return;
549
+ this.saving = true;
550
+ try {
551
+ const result = await this.sharingService.updateSharePermission(share.shareId, newLevel);
552
+ if (result.success) {
553
+ share.permissionLevel = newLevel;
554
+ // Track the update if not already tracked
555
+ const existingUpdate = this.sharesUpdated.find(s => s.shareId === share.shareId);
556
+ if (!existingUpdate) {
557
+ this.sharesUpdated.push({ ...share });
558
+ }
559
+ }
560
+ else {
561
+ console.error('Failed to update permission:', result.message);
562
+ }
563
+ }
564
+ catch (error) {
565
+ console.error('Error updating permission:', error);
566
+ }
567
+ finally {
568
+ this.saving = false;
569
+ this.cdr.detectChanges();
570
+ }
571
+ }
572
+ /**
573
+ * Remove a share
574
+ */
575
+ async removeShare(share) {
576
+ this.saving = true;
577
+ try {
578
+ const result = await this.sharingService.removeShare(share.shareId);
579
+ if (result.success) {
580
+ // Remove from current shares
581
+ this.currentShares = this.currentShares.filter(s => s.shareId !== share.shareId);
582
+ // Track the removal
583
+ this.sharesRemoved.push(share.shareId);
584
+ // Remove from added if it was just added in this session
585
+ this.sharesAdded = this.sharesAdded.filter(s => s.shareId !== share.shareId);
586
+ }
587
+ else {
588
+ console.error('Failed to remove share:', result.message);
589
+ }
590
+ }
591
+ catch (error) {
592
+ console.error('Error removing share:', error);
593
+ }
594
+ finally {
595
+ this.saving = false;
596
+ this.cdr.detectChanges();
597
+ }
598
+ }
599
+ /**
600
+ * Get icon for share type
601
+ */
602
+ getShareTypeIcon(type) {
603
+ return type === 'User' ? 'fa-solid fa-user' : 'fa-solid fa-users';
604
+ }
605
+ /**
606
+ * Get permission label
607
+ */
608
+ getPermissionLabel(level) {
609
+ const option = this.permissionOptions.find(o => o.value === level);
610
+ return option?.label || level;
611
+ }
612
+ /**
613
+ * Close dialog with results
614
+ */
615
+ onDone() {
616
+ const result = {
617
+ action: 'apply',
618
+ sharesAdded: this.sharesAdded,
619
+ sharesUpdated: this.sharesUpdated,
620
+ sharesRemoved: this.sharesRemoved
621
+ };
622
+ this._visible = false;
623
+ this.complete.emit(result);
624
+ }
625
+ /**
626
+ * Cancel and close dialog
627
+ */
628
+ onCancel() {
629
+ this._visible = false;
630
+ this.cancel.emit();
631
+ }
632
+ /**
633
+ * Check if current user can modify shares
634
+ */
635
+ get canModifyShares() {
636
+ return this.config?.isOwner === true;
637
+ }
638
+ static ɵfac = function ListShareDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ListShareDialogComponent)(i0.ɵɵdirectiveInject(i1.ListSharingService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
639
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ListShareDialogComponent, selectors: [["mj-list-share-dialog"]], inputs: { config: "config", visible: "visible" }, outputs: { complete: "complete", cancel: "cancel" }, decls: 1, vars: 1, consts: [[3, "title", "width", "minWidth", "close", 4, "ngIf"], [3, "close", "title", "width", "minWidth"], [1, "share-dialog-content"], ["class", "loading-container", 4, "ngIf"], [4, "ngIf"], ["kendoButton", "", "themeColor", "primary", 3, "click"], ["kendoButton", "", 3, "click"], [1, "loading-container"], ["text", "Loading shares..."], ["class", "add-share-section", 4, "ngIf"], ["class", "section-divider", 4, "ngIf"], ["class", "current-shares-section", 4, "ngIf"], ["class", "empty-state", 4, "ngIf"], ["class", "readonly-notice", 4, "ngIf"], [1, "add-share-section"], [1, "section-title"], [1, "search-type-toggle"], ["kendoButton", "", 3, "click", "fillMode", "themeColor"], [1, "fa-solid", "fa-user"], [1, "fa-solid", "fa-users"], [1, "search-container"], [3, "valueChange", "blur", "value", "placeholder", "clearButton"], ["kendoTextBoxPrefixTemplate", ""], ["class", "search-results", 4, "ngIf"], ["class", "selected-recipient", 4, "ngIf"], [1, "fa-solid", "fa-search", "search-icon"], [1, "search-results"], ["class", "search-result-item", 3, "mousedown", 4, "ngFor", "ngForOf"], [1, "search-result-item", 3, "mousedown"], [1, "recipient-info"], [1, "recipient-name"], ["class", "recipient-email", 4, "ngIf"], [1, "recipient-email"], [1, "selected-recipient"], [1, "recipient-chip"], ["kendoButton", "", 3, "click", "look", "icon"], [1, "permission-dropdown", 3, "ngModelChange", "data", "textField", "valueField", "ngModel", "valuePrimitive"], ["kendoDropDownListItemTemplate", ""], ["kendoButton", "", "themeColor", "primary", 3, "click", "disabled"], [1, "fa-solid", "fa-plus"], [1, "permission-option"], [1, "permission-label"], [1, "permission-desc"], [1, "section-divider"], [1, "current-shares-section"], [1, "share-list"], ["class", "share-item", 4, "ngFor", "ngForOf"], [1, "share-item"], [1, "share-info"], [1, "share-type-icon"], [1, "share-details"], [1, "share-name"], ["class", "share-email", 4, "ngIf"], ["class", "share-type-label", 4, "ngIf"], [1, "share-actions"], ["class", "permission-dropdown-small", 3, "data", "textField", "valueField", "value", "valuePrimitive", "disabled", "valueChange", 4, "ngIf"], ["class", "permission-badge", 4, "ngIf"], ["kendoButton", "", "title", "Remove access", 3, "look", "icon", "disabled", "click", 4, "ngIf"], [1, "share-email"], [1, "share-type-label"], [1, "permission-dropdown-small", 3, "valueChange", "data", "textField", "valueField", "value", "valuePrimitive", "disabled"], [1, "permission-badge"], ["kendoButton", "", "title", "Remove access", 3, "click", "look", "icon", "disabled"], [1, "empty-state"], [1, "fa-solid", "fa-share-nodes", "empty-icon"], ["class", "empty-hint", 4, "ngIf"], [1, "empty-hint"], [1, "readonly-notice"], [1, "fa-solid", "fa-info-circle"]], template: function ListShareDialogComponent_Template(rf, ctx) { if (rf & 1) {
640
+ i0.ɵɵtemplate(0, ListShareDialogComponent_kendo_dialog_0_Template, 9, 5, "kendo-dialog", 0);
641
+ } if (rf & 2) {
642
+ i0.ɵɵproperty("ngIf", ctx.visible);
643
+ } }, dependencies: [i2.NgForOf, i2.NgIf, i3.NgControlStatus, i3.NgModel, i4.DialogComponent, i4.DialogActionsComponent, i5.ButtonComponent, i6.TextBoxComponent, i6.TextBoxPrefixTemplateDirective, i7.ItemTemplateDirective, i7.DropDownListComponent, i8.LoadingComponent], styles: [".share-dialog-content[_ngcontent-%COMP%] {\n padding: 0;\n min-height: 200px;\n}\n\n.loading-container[_ngcontent-%COMP%] {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 200px;\n}\n\n\n\n.section-title[_ngcontent-%COMP%] {\n margin: 0 0 12px 0;\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-primary, #333);\n}\n\n.section-divider[_ngcontent-%COMP%] {\n margin: 16px 0;\n border: none;\n border-top: 1px solid var(--mj-border-color, #e0e0e0);\n}\n\n\n\n.add-share-section[_ngcontent-%COMP%] {\n margin-bottom: 16px;\n}\n\n.search-type-toggle[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n margin-bottom: 12px;\n}\n\n.search-type-toggle[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.search-type-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n margin-right: 6px;\n}\n\n\n\n.search-container[_ngcontent-%COMP%] {\n position: relative;\n}\n\n.search-icon[_ngcontent-%COMP%] {\n color: var(--mj-text-secondary, #666);\n margin-left: 8px;\n}\n\n.search-results[_ngcontent-%COMP%] {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n background: white;\n border: 1px solid var(--mj-border-color, #e0e0e0);\n border-radius: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n max-height: 200px;\n overflow-y: auto;\n z-index: 1000;\n}\n\n.search-result-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 12px;\n cursor: pointer;\n transition: background-color 0.15s;\n}\n\n.search-result-item[_ngcontent-%COMP%]:hover {\n background-color: var(--mj-hover-bg, #f5f5f5);\n}\n\n.search-result-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-text-secondary, #666);\n width: 20px;\n text-align: center;\n}\n\n.recipient-info[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.recipient-name[_ngcontent-%COMP%] {\n font-weight: 500;\n color: var(--mj-text-primary, #333);\n}\n\n.recipient-email[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--mj-text-secondary, #666);\n}\n\n\n\n.selected-recipient[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-top: 12px;\n padding: 12px;\n background: var(--mj-bg-secondary, #f8f9fa);\n border-radius: 6px;\n}\n\n.recipient-chip[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 12px;\n background: white;\n border: 1px solid var(--mj-border-color, #e0e0e0);\n border-radius: 20px;\n flex: 1;\n}\n\n.recipient-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-primary-color, #0078d4);\n}\n\n.recipient-chip[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n flex: 1;\n font-weight: 500;\n}\n\n.permission-dropdown[_ngcontent-%COMP%] {\n width: 150px;\n}\n\n\n\n.permission-option[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 4px 0;\n}\n\n.permission-label[_ngcontent-%COMP%] {\n font-weight: 500;\n}\n\n.permission-desc[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--mj-text-secondary, #666);\n}\n\n\n\n.current-shares-section[_ngcontent-%COMP%] {\n margin-top: 16px;\n}\n\n.share-list[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.share-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px;\n background: var(--mj-bg-secondary, #f8f9fa);\n border-radius: 6px;\n transition: background-color 0.15s;\n}\n\n.share-item[_ngcontent-%COMP%]:hover {\n background: var(--mj-hover-bg, #f0f0f0);\n}\n\n.share-info[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n}\n\n.share-type-icon[_ngcontent-%COMP%] {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--mj-primary-color-light, #e6f2ff);\n color: var(--mj-primary-color, #0078d4);\n border-radius: 50%;\n}\n\n.share-details[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.share-name[_ngcontent-%COMP%] {\n font-weight: 500;\n color: var(--mj-text-primary, #333);\n}\n\n.share-email[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--mj-text-secondary, #666);\n}\n\n.share-type-label[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--mj-text-secondary, #666);\n background: var(--mj-border-color, #e0e0e0);\n padding: 2px 6px;\n border-radius: 3px;\n display: inline-block;\n width: fit-content;\n}\n\n.share-actions[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.permission-dropdown-small[_ngcontent-%COMP%] {\n width: 110px;\n}\n\n.permission-badge[_ngcontent-%COMP%] {\n padding: 4px 10px;\n background: var(--mj-primary-color-light, #e6f2ff);\n color: var(--mj-primary-color, #0078d4);\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n}\n\n\n\n.empty-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px 20px;\n text-align: center;\n}\n\n.empty-icon[_ngcontent-%COMP%] {\n font-size: 48px;\n color: var(--mj-border-color, #e0e0e0);\n margin-bottom: 16px;\n}\n\n.empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0;\n color: var(--mj-text-secondary, #666);\n}\n\n.empty-hint[_ngcontent-%COMP%] {\n font-size: 13px;\n margin-top: 8px !important;\n}\n\n\n\n.readonly-notice[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n background: var(--mj-warning-bg, #fff8e1);\n border-radius: 6px;\n margin-top: 16px;\n color: var(--mj-warning-color, #856404);\n font-size: 13px;\n}\n\n.readonly-notice[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-warning-color, #ffc107);\n}\n\n\n\n[_nghost-%COMP%] kendo-dialog-actions {\n flex-direction: row;\n justify-content: flex-start;\n}"] });
644
+ }
645
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ListShareDialogComponent, [{
646
+ type: Component,
647
+ args: [{ selector: 'mj-list-share-dialog', template: "<kendo-dialog\n *ngIf=\"visible\"\n [title]=\"dialogTitle\"\n [width]=\"500\"\n [minWidth]=\"400\"\n (close)=\"onCancel()\">\n\n <div class=\"share-dialog-content\">\n <!-- Loading state -->\n <div *ngIf=\"loading\" class=\"loading-container\">\n <mj-loading text=\"Loading shares...\"></mj-loading>\n </div>\n\n <ng-container *ngIf=\"!loading\">\n <!-- Add new share section -->\n <div class=\"add-share-section\" *ngIf=\"canModifyShares\">\n <h4 class=\"section-title\">Add people or roles</h4>\n\n <!-- Search type toggle -->\n <div class=\"search-type-toggle\">\n <button kendoButton\n [fillMode]=\"searchType === 'User' ? 'solid' : 'outline'\"\n [themeColor]=\"searchType === 'User' ? 'primary' : 'base'\"\n (click)=\"setSearchType('User')\">\n <i class=\"fa-solid fa-user\"></i> Users\n </button>\n <button kendoButton\n [fillMode]=\"searchType === 'Role' ? 'solid' : 'outline'\"\n [themeColor]=\"searchType === 'Role' ? 'primary' : 'base'\"\n (click)=\"setSearchType('Role')\">\n <i class=\"fa-solid fa-users\"></i> Roles\n </button>\n </div>\n\n <!-- Search input -->\n <div class=\"search-container\">\n <kendo-textbox\n [value]=\"searchText\"\n (valueChange)=\"onSearchInput($event)\"\n [placeholder]=\"'Search for ' + (searchType === 'User' ? 'users' : 'roles') + '...'\"\n [clearButton]=\"true\"\n (blur)=\"showSearchResults = false\">\n <ng-template kendoTextBoxPrefixTemplate>\n <i class=\"fa-solid fa-search search-icon\"></i>\n </ng-template>\n </kendo-textbox>\n\n <!-- Search results dropdown -->\n <div class=\"search-results\" *ngIf=\"showSearchResults && searchResults.length > 0\">\n <div class=\"search-result-item\"\n *ngFor=\"let recipient of searchResults\"\n (mousedown)=\"selectRecipient(recipient)\">\n <i [class]=\"getShareTypeIcon(recipient.type)\"></i>\n <div class=\"recipient-info\">\n <span class=\"recipient-name\">{{ recipient.name }}</span>\n <span class=\"recipient-email\" *ngIf=\"recipient.email\">{{ recipient.email }}</span>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Selected recipient and permission -->\n <div class=\"selected-recipient\" *ngIf=\"selectedRecipient\">\n <div class=\"recipient-chip\">\n <i [class]=\"getShareTypeIcon(selectedRecipient.type)\"></i>\n <span>{{ selectedRecipient.name }}</span>\n <button kendoButton [look]=\"'flat'\" [icon]=\"'close'\" (click)=\"clearSearch()\"></button>\n </div>\n\n <kendo-dropdownlist\n [data]=\"permissionOptions\"\n [textField]=\"'label'\"\n [valueField]=\"'value'\"\n [(ngModel)]=\"selectedPermission\"\n [valuePrimitive]=\"true\"\n class=\"permission-dropdown\">\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <div class=\"permission-option\">\n <span class=\"permission-label\">{{ dataItem.label }}</span>\n <span class=\"permission-desc\">{{ dataItem.description }}</span>\n </div>\n </ng-template>\n </kendo-dropdownlist>\n\n <button kendoButton\n themeColor=\"primary\"\n [disabled]=\"saving\"\n (click)=\"addShare()\">\n <i class=\"fa-solid fa-plus\"></i> Add\n </button>\n </div>\n </div>\n\n <!-- Divider -->\n <hr class=\"section-divider\" *ngIf=\"currentShares.length > 0 && canModifyShares\">\n\n <!-- Current shares section -->\n <div class=\"current-shares-section\" *ngIf=\"currentShares.length > 0\">\n <h4 class=\"section-title\">People with access</h4>\n\n <div class=\"share-list\">\n <div class=\"share-item\" *ngFor=\"let share of currentShares\">\n <div class=\"share-info\">\n <i [class]=\"getShareTypeIcon(share.type)\" class=\"share-type-icon\"></i>\n <div class=\"share-details\">\n <span class=\"share-name\">{{ share.recipientName }}</span>\n <span class=\"share-email\" *ngIf=\"share.recipientEmail\">{{ share.recipientEmail }}</span>\n <span class=\"share-type-label\" *ngIf=\"share.type === 'Role'\">Role</span>\n </div>\n </div>\n\n <div class=\"share-actions\">\n <kendo-dropdownlist\n *ngIf=\"canModifyShares\"\n [data]=\"permissionOptions\"\n [textField]=\"'label'\"\n [valueField]=\"'value'\"\n [value]=\"share.permissionLevel\"\n [valuePrimitive]=\"true\"\n (valueChange)=\"updateSharePermission(share, $event)\"\n [disabled]=\"saving\"\n class=\"permission-dropdown-small\">\n </kendo-dropdownlist>\n\n <span class=\"permission-badge\" *ngIf=\"!canModifyShares\">\n {{ getPermissionLabel(share.permissionLevel) }}\n </span>\n\n <button kendoButton\n *ngIf=\"canModifyShares\"\n [look]=\"'flat'\"\n [icon]=\"'trash'\"\n title=\"Remove access\"\n [disabled]=\"saving\"\n (click)=\"removeShare(share)\">\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div class=\"empty-state\" *ngIf=\"currentShares.length === 0 && !loading\">\n <i class=\"fa-solid fa-share-nodes empty-icon\"></i>\n <p>This list hasn't been shared with anyone yet.</p>\n <p *ngIf=\"canModifyShares\" class=\"empty-hint\">\n Use the search above to find users or roles to share with.\n </p>\n </div>\n\n <!-- Read-only notice -->\n <div class=\"readonly-notice\" *ngIf=\"!canModifyShares\">\n <i class=\"fa-solid fa-info-circle\"></i>\n <span>Only the list owner can manage sharing.</span>\n </div>\n </ng-container>\n </div>\n\n <kendo-dialog-actions>\n <button kendoButton themeColor=\"primary\" (click)=\"onDone()\">Done</button>\n <button kendoButton (click)=\"onCancel()\">Cancel</button>\n </kendo-dialog-actions>\n</kendo-dialog>\n", styles: [".share-dialog-content {\n padding: 0;\n min-height: 200px;\n}\n\n.loading-container {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 200px;\n}\n\n/* Section styling */\n.section-title {\n margin: 0 0 12px 0;\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-primary, #333);\n}\n\n.section-divider {\n margin: 16px 0;\n border: none;\n border-top: 1px solid var(--mj-border-color, #e0e0e0);\n}\n\n/* Add share section */\n.add-share-section {\n margin-bottom: 16px;\n}\n\n.search-type-toggle {\n display: flex;\n gap: 8px;\n margin-bottom: 12px;\n}\n\n.search-type-toggle button {\n flex: 1;\n}\n\n.search-type-toggle i {\n margin-right: 6px;\n}\n\n/* Search container */\n.search-container {\n position: relative;\n}\n\n.search-icon {\n color: var(--mj-text-secondary, #666);\n margin-left: 8px;\n}\n\n.search-results {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n background: white;\n border: 1px solid var(--mj-border-color, #e0e0e0);\n border-radius: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n max-height: 200px;\n overflow-y: auto;\n z-index: 1000;\n}\n\n.search-result-item {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 12px;\n cursor: pointer;\n transition: background-color 0.15s;\n}\n\n.search-result-item:hover {\n background-color: var(--mj-hover-bg, #f5f5f5);\n}\n\n.search-result-item i {\n color: var(--mj-text-secondary, #666);\n width: 20px;\n text-align: center;\n}\n\n.recipient-info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.recipient-name {\n font-weight: 500;\n color: var(--mj-text-primary, #333);\n}\n\n.recipient-email {\n font-size: 12px;\n color: var(--mj-text-secondary, #666);\n}\n\n/* Selected recipient */\n.selected-recipient {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-top: 12px;\n padding: 12px;\n background: var(--mj-bg-secondary, #f8f9fa);\n border-radius: 6px;\n}\n\n.recipient-chip {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 12px;\n background: white;\n border: 1px solid var(--mj-border-color, #e0e0e0);\n border-radius: 20px;\n flex: 1;\n}\n\n.recipient-chip i {\n color: var(--mj-primary-color, #0078d4);\n}\n\n.recipient-chip span {\n flex: 1;\n font-weight: 500;\n}\n\n.permission-dropdown {\n width: 150px;\n}\n\n/* Permission option template */\n.permission-option {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 4px 0;\n}\n\n.permission-label {\n font-weight: 500;\n}\n\n.permission-desc {\n font-size: 11px;\n color: var(--mj-text-secondary, #666);\n}\n\n/* Current shares section */\n.current-shares-section {\n margin-top: 16px;\n}\n\n.share-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.share-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px;\n background: var(--mj-bg-secondary, #f8f9fa);\n border-radius: 6px;\n transition: background-color 0.15s;\n}\n\n.share-item:hover {\n background: var(--mj-hover-bg, #f0f0f0);\n}\n\n.share-info {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n}\n\n.share-type-icon {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--mj-primary-color-light, #e6f2ff);\n color: var(--mj-primary-color, #0078d4);\n border-radius: 50%;\n}\n\n.share-details {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.share-name {\n font-weight: 500;\n color: var(--mj-text-primary, #333);\n}\n\n.share-email {\n font-size: 12px;\n color: var(--mj-text-secondary, #666);\n}\n\n.share-type-label {\n font-size: 11px;\n color: var(--mj-text-secondary, #666);\n background: var(--mj-border-color, #e0e0e0);\n padding: 2px 6px;\n border-radius: 3px;\n display: inline-block;\n width: fit-content;\n}\n\n.share-actions {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.permission-dropdown-small {\n width: 110px;\n}\n\n.permission-badge {\n padding: 4px 10px;\n background: var(--mj-primary-color-light, #e6f2ff);\n color: var(--mj-primary-color, #0078d4);\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n}\n\n/* Empty state */\n.empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px 20px;\n text-align: center;\n}\n\n.empty-icon {\n font-size: 48px;\n color: var(--mj-border-color, #e0e0e0);\n margin-bottom: 16px;\n}\n\n.empty-state p {\n margin: 0;\n color: var(--mj-text-secondary, #666);\n}\n\n.empty-hint {\n font-size: 13px;\n margin-top: 8px !important;\n}\n\n/* Read-only notice */\n.readonly-notice {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n background: var(--mj-warning-bg, #fff8e1);\n border-radius: 6px;\n margin-top: 16px;\n color: var(--mj-warning-color, #856404);\n font-size: 13px;\n}\n\n.readonly-notice i {\n color: var(--mj-warning-color, #ffc107);\n}\n\n/* Dialog actions - buttons on left */\n:host ::ng-deep kendo-dialog-actions {\n flex-direction: row;\n justify-content: flex-start;\n}\n"] }]
648
+ }], () => [{ type: i1.ListSharingService }, { type: i0.ChangeDetectorRef }], { config: [{
649
+ type: Input
650
+ }], visible: [{
651
+ type: Input
652
+ }], complete: [{
653
+ type: Output
654
+ }], cancel: [{
655
+ type: Output
656
+ }] }); })();
657
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ListShareDialogComponent, { className: "ListShareDialogComponent" }); })();
658
+ //# sourceMappingURL=list-share-dialog.component.js.map