@memberjunction/ng-record-selector 1.7.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.
@@ -0,0 +1,54 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { BaseEntity } from '@memberjunction/core';
3
+ import { ListBoxToolbarConfig } from '@progress/kendo-angular-listbox';
4
+ import * as i0 from "@angular/core";
5
+ export declare class RecordSelectorDialogComponent {
6
+ DialogTitle: string;
7
+ DialogWidth: string;
8
+ DialogHeight: string;
9
+ get DialogVisible(): boolean;
10
+ set DialogVisible(value: boolean);
11
+ private _dialogVisible;
12
+ /**
13
+ * Emits when the dialog is closed, the parameter is true if the dialog was closed with the OK button, false if it was closed with the Cancel button
14
+ */
15
+ DialogClosed: EventEmitter<boolean>;
16
+ /**
17
+ * The name of the entity to show records for.
18
+ */
19
+ EntityName: string;
20
+ /**
21
+ * The field name within the entity to show in the list items
22
+ */
23
+ DisplayField: string;
24
+ /**
25
+ * The field name within the entity that has a CSS class representing an icon that should be displayed in the list items
26
+ */
27
+ DisplayIconField: string;
28
+ /**
29
+ * The list of records that are available
30
+ */
31
+ AvailableRecords: BaseEntity[];
32
+ /**
33
+ * The list of records that are selected
34
+ */
35
+ SelectedRecords: BaseEntity[];
36
+ /**
37
+ * The list of records that are not selected
38
+ */
39
+ UnselectedRecords: BaseEntity[];
40
+ /**
41
+ * Configurable settings for the toolbar
42
+ */
43
+ ToolbarSettings: ListBoxToolbarConfig;
44
+ RecordSelected: EventEmitter<BaseEntity[]>;
45
+ RecordUnselected: EventEmitter<BaseEntity[]>;
46
+ protected _initialSelected: BaseEntity[];
47
+ protected _initialUnselected: BaseEntity[];
48
+ protected RefreshInitialValues(): void;
49
+ OnCancel(): void;
50
+ OnOK(): void;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<RecordSelectorDialogComponent, never>;
52
+ static ɵcmp: i0.ɵɵComponentDeclaration<RecordSelectorDialogComponent, "mj-record-selector-dialog", never, { "DialogTitle": { "alias": "DialogTitle"; "required": false; }; "DialogWidth": { "alias": "DialogWidth"; "required": false; }; "DialogHeight": { "alias": "DialogHeight"; "required": false; }; "DialogVisible": { "alias": "DialogVisible"; "required": false; }; "EntityName": { "alias": "EntityName"; "required": false; }; "DisplayField": { "alias": "DisplayField"; "required": false; }; "DisplayIconField": { "alias": "DisplayIconField"; "required": false; }; "AvailableRecords": { "alias": "AvailableRecords"; "required": false; }; "SelectedRecords": { "alias": "SelectedRecords"; "required": false; }; "UnselectedRecords": { "alias": "UnselectedRecords"; "required": false; }; "ToolbarSettings": { "alias": "ToolbarSettings"; "required": false; }; }, { "DialogClosed": "DialogClosed"; "RecordSelected": "RecordSelected"; "RecordUnselected": "RecordUnselected"; }, never, never, false, never>;
53
+ }
54
+ //# sourceMappingURL=dialog.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.component.d.ts","sourceRoot":"","sources":["../../src/lib/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,YAAY,EAAkD,MAAM,eAAe,CAAC;AAEvI,OAAO,EAAY,UAAU,EAAoD,MAAM,sBAAsB,CAAC;AAG9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;;AAEvE,qBAKa,6BAA6B;IAC/B,WAAW,EAAE,MAAM,CAAoB;IACvC,WAAW,EAAE,MAAM,CAAW;IAC9B,YAAY,EAAE,MAAM,CAAW;IAExC,IAAa,aAAa,IAAI,OAAO,CAEpC;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAM/B;IACD,OAAO,CAAC,cAAc,CAAkB;IACxC;;OAEG;IACO,YAAY,wBAA+B;IAGrD;;OAEG;IACM,UAAU,EAAE,MAAM,CAAM;IACjC;;OAEG;IACM,YAAY,EAAE,MAAM,CAAM;IACnC;;OAEG;IACM,gBAAgB,EAAE,MAAM,CAAM;IACvC;;OAEG;IACM,gBAAgB,EAAE,UAAU,EAAE,CAAM;IAE7C;;OAEG;IACM,eAAe,EAAE,UAAU,EAAE,CAAM;IAC5C;;OAEG;IACM,iBAAiB,EAAE,UAAU,EAAE,CAAM;IAG9C;;OAEG;IACa,eAAe,EAAE,oBAAoB,CAGnD;IAEQ,cAAc,6BAAoC;IAClD,gBAAgB,6BAAoC;IAE9D,SAAS,CAAC,gBAAgB,EAAE,UAAU,EAAE,CAAM;IAC9C,SAAS,CAAC,kBAAkB,EAAE,UAAU,EAAE,CAAM;IAEhD,SAAS,CAAC,oBAAoB;IAKvB,QAAQ;IAYR,IAAI;yCAhFA,6BAA6B;2CAA7B,6BAA6B;CAwFzC"}
@@ -0,0 +1,141 @@
1
+ import { Component, Output, EventEmitter, Input } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@progress/kendo-angular-dialog";
4
+ import * as i2 from "@progress/kendo-angular-buttons";
5
+ import * as i3 from "./record-selector.component";
6
+ function RecordSelectorDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
7
+ const _r1 = i0.ɵɵgetCurrentView();
8
+ i0.ɵɵelementStart(0, "kendo-dialog", 1);
9
+ i0.ɵɵlistener("close", function RecordSelectorDialogComponent_Conditional_0_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
10
+ i0.ɵɵelement(1, "mj-record-selector", 2);
11
+ i0.ɵɵelementStart(2, "kendo-dialog-actions")(3, "button", 3);
12
+ i0.ɵɵlistener("click", function RecordSelectorDialogComponent_Conditional_0_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnOK()); });
13
+ i0.ɵɵtext(4, "OK");
14
+ i0.ɵɵelementEnd();
15
+ i0.ɵɵelementStart(5, "button", 4);
16
+ i0.ɵɵlistener("click", function RecordSelectorDialogComponent_Conditional_0_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
17
+ i0.ɵɵtext(6, "Cancel");
18
+ i0.ɵɵelementEnd()()();
19
+ } if (rf & 2) {
20
+ const ctx_r1 = i0.ɵɵnextContext();
21
+ i0.ɵɵproperty("width", ctx_r1.DialogWidth)("height", ctx_r1.DialogHeight)("title", ctx_r1.DialogTitle);
22
+ i0.ɵɵadvance();
23
+ i0.ɵɵproperty("AvailableRecords", ctx_r1.AvailableRecords)("DisplayField", ctx_r1.DisplayField)("SelectedRecords", ctx_r1.SelectedRecords)("EntityName", ctx_r1.EntityName)("ToolbarSettings", ctx_r1.ToolbarSettings)("DisplayIconField", ctx_r1.DisplayIconField)("UnselectedRecords", ctx_r1.UnselectedRecords);
24
+ } }
25
+ export class RecordSelectorDialogComponent {
26
+ constructor() {
27
+ this.DialogTitle = 'Select Records';
28
+ this.DialogWidth = '700px';
29
+ this.DialogHeight = '450px';
30
+ this._dialogVisible = false;
31
+ /**
32
+ * Emits when the dialog is closed, the parameter is true if the dialog was closed with the OK button, false if it was closed with the Cancel button
33
+ */
34
+ this.DialogClosed = new EventEmitter();
35
+ ///// REST OF THE BELOW JUST GET MAPPED TO THE CONTAINED RecordSelectorComponent
36
+ /**
37
+ * The name of the entity to show records for.
38
+ */
39
+ this.EntityName = '';
40
+ /**
41
+ * The field name within the entity to show in the list items
42
+ */
43
+ this.DisplayField = '';
44
+ /**
45
+ * The field name within the entity that has a CSS class representing an icon that should be displayed in the list items
46
+ */
47
+ this.DisplayIconField = '';
48
+ /**
49
+ * The list of records that are available
50
+ */
51
+ this.AvailableRecords = [];
52
+ /**
53
+ * The list of records that are selected
54
+ */
55
+ this.SelectedRecords = [];
56
+ /**
57
+ * The list of records that are not selected
58
+ */
59
+ this.UnselectedRecords = [];
60
+ /**
61
+ * Configurable settings for the toolbar
62
+ */
63
+ this.ToolbarSettings = {
64
+ position: "right",
65
+ tools: ["moveUp", "transferFrom", "transferAllFrom", "transferAllTo", "transferTo", "moveDown"],
66
+ };
67
+ this.RecordSelected = new EventEmitter();
68
+ this.RecordUnselected = new EventEmitter();
69
+ this._initialSelected = [];
70
+ this._initialUnselected = [];
71
+ }
72
+ get DialogVisible() {
73
+ return this._dialogVisible;
74
+ }
75
+ set DialogVisible(value) {
76
+ if (value !== this._dialogVisible && value) {
77
+ // showing the dialog
78
+ this.RefreshInitialValues();
79
+ }
80
+ this._dialogVisible = value;
81
+ }
82
+ RefreshInitialValues() {
83
+ this._initialSelected = this.SelectedRecords.slice();
84
+ this._initialUnselected = this.UnselectedRecords.slice();
85
+ }
86
+ OnCancel() {
87
+ // now modify the SelectedRecords Array and UnselectedRecords arrays in place in order
88
+ // to ensure they're the same arrays and drive data binding changes
89
+ this.SelectedRecords.length = 0;
90
+ this.UnselectedRecords.length = 0;
91
+ this._initialSelected.forEach(r => this.SelectedRecords.push(r));
92
+ this._initialUnselected.forEach(r => this.UnselectedRecords.push(r));
93
+ this.DialogVisible = false;
94
+ this.DialogClosed.emit(false);
95
+ }
96
+ OnOK() {
97
+ this._initialSelected = this.SelectedRecords.slice();
98
+ this._initialUnselected = this.UnselectedRecords.slice();
99
+ this.DialogVisible = false;
100
+ this.DialogClosed.emit(true);
101
+ }
102
+ }
103
+ RecordSelectorDialogComponent.ɵfac = function RecordSelectorDialogComponent_Factory(t) { return new (t || RecordSelectorDialogComponent)(); };
104
+ RecordSelectorDialogComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecordSelectorDialogComponent, selectors: [["mj-record-selector-dialog"]], inputs: { DialogTitle: "DialogTitle", DialogWidth: "DialogWidth", DialogHeight: "DialogHeight", DialogVisible: "DialogVisible", EntityName: "EntityName", DisplayField: "DisplayField", DisplayIconField: "DisplayIconField", AvailableRecords: "AvailableRecords", SelectedRecords: "SelectedRecords", UnselectedRecords: "UnselectedRecords", ToolbarSettings: "ToolbarSettings" }, outputs: { DialogClosed: "DialogClosed", RecordSelected: "RecordSelected", RecordUnselected: "RecordUnselected" }, decls: 1, vars: 1, consts: [[3, "width", "height", "title"], [3, "close", "width", "height", "title"], [3, "AvailableRecords", "DisplayField", "SelectedRecords", "EntityName", "ToolbarSettings", "DisplayIconField", "UnselectedRecords"], ["kendoButton", "", "themeColor", "primary", 3, "click"], ["kendoButton", "", 3, "click"]], template: function RecordSelectorDialogComponent_Template(rf, ctx) { if (rf & 1) {
105
+ i0.ɵɵtemplate(0, RecordSelectorDialogComponent_Conditional_0_Template, 7, 10, "kendo-dialog", 0);
106
+ } if (rf & 2) {
107
+ i0.ɵɵconditional(ctx.DialogVisible ? 0 : -1);
108
+ } }, dependencies: [i1.DialogComponent, i1.DialogActionsComponent, i2.ButtonComponent, i3.RecordSelectorComponent] });
109
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RecordSelectorDialogComponent, [{
110
+ type: Component,
111
+ args: [{ selector: 'mj-record-selector-dialog', template: "@if (DialogVisible) {\n <kendo-dialog\n [width]=\"DialogWidth\"\n [height]=\"DialogHeight\"\n [title]=\"DialogTitle\" \n (close)=\"OnCancel()\"\n >\n <mj-record-selector\n [AvailableRecords]=\"AvailableRecords\"\n [DisplayField]=\"DisplayField\"\n [SelectedRecords]=\"SelectedRecords\"\n [EntityName]=\"EntityName\"\n [ToolbarSettings]=\"ToolbarSettings\"\n [DisplayIconField]=\"DisplayIconField\"\n [UnselectedRecords]=\"UnselectedRecords\"\n >\n </mj-record-selector>\n <kendo-dialog-actions>\n <button kendoButton (click)=\"OnOK()\" themeColor=\"primary\">OK</button>\n <button kendoButton (click)=\"OnCancel()\">Cancel</button>\n </kendo-dialog-actions> \n </kendo-dialog> \n}" }]
112
+ }], null, { DialogTitle: [{
113
+ type: Input
114
+ }], DialogWidth: [{
115
+ type: Input
116
+ }], DialogHeight: [{
117
+ type: Input
118
+ }], DialogVisible: [{
119
+ type: Input
120
+ }], DialogClosed: [{
121
+ type: Output
122
+ }], EntityName: [{
123
+ type: Input
124
+ }], DisplayField: [{
125
+ type: Input
126
+ }], DisplayIconField: [{
127
+ type: Input
128
+ }], AvailableRecords: [{
129
+ type: Input
130
+ }], SelectedRecords: [{
131
+ type: Input
132
+ }], UnselectedRecords: [{
133
+ type: Input
134
+ }], ToolbarSettings: [{
135
+ type: Input
136
+ }], RecordSelected: [{
137
+ type: Output
138
+ }], RecordUnselected: [{
139
+ type: Output
140
+ }] }); })();
141
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RecordSelectorDialogComponent, { className: "RecordSelectorDialogComponent", filePath: "src/lib/dialog.component.ts", lineNumber: 13 }); })();
@@ -0,0 +1,42 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { BaseEntity } from '@memberjunction/core';
3
+ import { ListBoxComponent, ListBoxToolbarConfig } from '@progress/kendo-angular-listbox';
4
+ import * as i0 from "@angular/core";
5
+ export declare class RecordSelectorComponent {
6
+ /**
7
+ * The name of the entity to show records for.
8
+ */
9
+ EntityName: string;
10
+ /**
11
+ * The field name within the entity to show in the list items
12
+ */
13
+ DisplayField: string;
14
+ /**
15
+ * The field name within the entity that has a CSS class representing an icon that should be displayed in the list items
16
+ */
17
+ DisplayIconField: string;
18
+ /**
19
+ * The list of records that are available
20
+ */
21
+ AvailableRecords: BaseEntity[];
22
+ /**
23
+ * The list of records that are selected
24
+ */
25
+ SelectedRecords: BaseEntity[];
26
+ /**
27
+ * The list of records that are not selected
28
+ */
29
+ UnselectedRecords: BaseEntity[];
30
+ /**
31
+ * Configurable settings for the toolbar
32
+ */
33
+ ToolbarSettings: ListBoxToolbarConfig;
34
+ RecordSelected: EventEmitter<BaseEntity[]>;
35
+ RecordUnselected: EventEmitter<BaseEntity[]>;
36
+ unselectedListBox: ListBoxComponent;
37
+ selectedListBox: ListBoxComponent;
38
+ onDblClick(event: MouseEvent, listType: 'unselected' | 'selected'): void;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<RecordSelectorComponent, never>;
40
+ static ɵcmp: i0.ɵɵComponentDeclaration<RecordSelectorComponent, "mj-record-selector", never, { "EntityName": { "alias": "EntityName"; "required": false; }; "DisplayField": { "alias": "DisplayField"; "required": false; }; "DisplayIconField": { "alias": "DisplayIconField"; "required": false; }; "AvailableRecords": { "alias": "AvailableRecords"; "required": false; }; "SelectedRecords": { "alias": "SelectedRecords"; "required": false; }; "UnselectedRecords": { "alias": "UnselectedRecords"; "required": false; }; "ToolbarSettings": { "alias": "ToolbarSettings"; "required": false; }; }, { "RecordSelected": "RecordSelected"; "RecordUnselected": "RecordUnselected"; }, never, never, false, never>;
41
+ }
42
+ //# sourceMappingURL=record-selector.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-selector.component.d.ts","sourceRoot":"","sources":["../../src/lib/record-selector.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAoB,MAAM,eAAe,CAAC;AAElF,OAAO,EAAE,UAAU,EAAG,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;;AAEzF,qBAKa,uBAAuB;IAClC;;OAEG;IACM,UAAU,EAAE,MAAM,CAAM;IACjC;;OAEG;IACM,YAAY,EAAE,MAAM,CAAM;IAEnC;;OAEG;IACM,gBAAgB,EAAE,MAAM,CAAM;IAEvC;;OAEG;IACM,gBAAgB,EAAE,UAAU,EAAE,CAAM;IAE7C;;OAEG;IACM,eAAe,EAAE,UAAU,EAAE,CAAM;IAC5C;;OAEG;IACM,iBAAiB,EAAE,UAAU,EAAE,CAAM;IAG9C;;OAEG;IACa,eAAe,EAAE,oBAAoB,CAGnD;IAEQ,cAAc,6BAAoC;IAClD,gBAAgB,6BAAoC;IAGlB,iBAAiB,EAAG,gBAAgB,CAAC;IACvC,eAAe,EAAG,gBAAgB,CAAC;IAG7E,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,GAAG,UAAU,GAAG,IAAI;yCA9C7D,uBAAuB;2CAAvB,uBAAuB;CAqEnC"}
@@ -0,0 +1,157 @@
1
+ import { Component, Output, EventEmitter, Input, ViewChild } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import * as i2 from "@memberjunction/ng-container-directives";
5
+ import * as i3 from "@progress/kendo-angular-listbox";
6
+ const _c0 = ["unselected"];
7
+ const _c1 = ["selected"];
8
+ function RecordSelectorComponent_ng_template_3_Conditional_0_Template(rf, ctx) { if (rf & 1) {
9
+ i0.ɵɵelement(0, "span", 6);
10
+ } if (rf & 2) {
11
+ const dataItem_r2 = i0.ɵɵnextContext().$implicit;
12
+ const ctx_r2 = i0.ɵɵnextContext();
13
+ i0.ɵɵproperty("ngClass", dataItem_r2[ctx_r2.DisplayIconField] + " item-icon");
14
+ } }
15
+ function RecordSelectorComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
16
+ i0.ɵɵtemplate(0, RecordSelectorComponent_ng_template_3_Conditional_0_Template, 1, 1, "span", 6);
17
+ i0.ɵɵelementStart(1, "span");
18
+ i0.ɵɵtext(2);
19
+ i0.ɵɵelementEnd();
20
+ } if (rf & 2) {
21
+ const dataItem_r2 = ctx.$implicit;
22
+ const ctx_r2 = i0.ɵɵnextContext();
23
+ i0.ɵɵconditional(ctx_r2.DisplayIconField ? 0 : -1);
24
+ i0.ɵɵadvance(2);
25
+ i0.ɵɵtextInterpolate(dataItem_r2[ctx_r2.DisplayField]);
26
+ } }
27
+ function RecordSelectorComponent_ng_template_6_Conditional_0_Template(rf, ctx) { if (rf & 1) {
28
+ i0.ɵɵelement(0, "span", 6);
29
+ } if (rf & 2) {
30
+ const dataItem_r4 = i0.ɵɵnextContext().$implicit;
31
+ const ctx_r2 = i0.ɵɵnextContext();
32
+ i0.ɵɵproperty("ngClass", dataItem_r4[ctx_r2.DisplayIconField] + " item-icon");
33
+ } }
34
+ function RecordSelectorComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
35
+ i0.ɵɵtemplate(0, RecordSelectorComponent_ng_template_6_Conditional_0_Template, 1, 1, "span", 6);
36
+ i0.ɵɵelementStart(1, "span");
37
+ i0.ɵɵtext(2);
38
+ i0.ɵɵelementEnd();
39
+ } if (rf & 2) {
40
+ const dataItem_r4 = ctx.$implicit;
41
+ const ctx_r2 = i0.ɵɵnextContext();
42
+ i0.ɵɵconditional(ctx_r2.DisplayIconField ? 0 : -1);
43
+ i0.ɵɵadvance(2);
44
+ i0.ɵɵtextInterpolate(dataItem_r4[ctx_r2.DisplayField]);
45
+ } }
46
+ export class RecordSelectorComponent {
47
+ constructor() {
48
+ /**
49
+ * The name of the entity to show records for.
50
+ */
51
+ this.EntityName = '';
52
+ /**
53
+ * The field name within the entity to show in the list items
54
+ */
55
+ this.DisplayField = '';
56
+ /**
57
+ * The field name within the entity that has a CSS class representing an icon that should be displayed in the list items
58
+ */
59
+ this.DisplayIconField = '';
60
+ /**
61
+ * The list of records that are available
62
+ */
63
+ this.AvailableRecords = [];
64
+ /**
65
+ * The list of records that are selected
66
+ */
67
+ this.SelectedRecords = [];
68
+ /**
69
+ * The list of records that are not selected
70
+ */
71
+ this.UnselectedRecords = [];
72
+ /**
73
+ * Configurable settings for the toolbar
74
+ */
75
+ this.ToolbarSettings = {
76
+ position: "right",
77
+ tools: ["moveUp", "transferFrom", "transferAllFrom", "transferAllTo", "transferTo", "moveDown"],
78
+ };
79
+ this.RecordSelected = new EventEmitter();
80
+ this.RecordUnselected = new EventEmitter();
81
+ }
82
+ onDblClick(event, listType) {
83
+ const targetElement = event.target;
84
+ const listItemElement = targetElement.closest('.k-list-item');
85
+ if (listItemElement && listItemElement.parentElement) {
86
+ const itemIndex = Array.from(listItemElement.parentElement.children).indexOf(listItemElement);
87
+ if (listType === 'unselected') {
88
+ const item = this.UnselectedRecords[itemIndex];
89
+ this.SelectedRecords.push(item);
90
+ this.UnselectedRecords.splice(itemIndex, 1);
91
+ }
92
+ else {
93
+ const item = this.SelectedRecords[itemIndex];
94
+ this.UnselectedRecords.push(item);
95
+ this.SelectedRecords.splice(itemIndex, 1);
96
+ }
97
+ if (this.unselectedListBox)
98
+ this.unselectedListBox.clearSelection();
99
+ if (this.selectedListBox)
100
+ this.selectedListBox.clearSelection();
101
+ }
102
+ }
103
+ }
104
+ RecordSelectorComponent.ɵfac = function RecordSelectorComponent_Factory(t) { return new (t || RecordSelectorComponent)(); };
105
+ RecordSelectorComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecordSelectorComponent, selectors: [["mj-record-selector"]], viewQuery: function RecordSelectorComponent_Query(rf, ctx) { if (rf & 1) {
106
+ i0.ɵɵviewQuery(_c0, 5);
107
+ i0.ɵɵviewQuery(_c1, 5);
108
+ } if (rf & 2) {
109
+ let _t;
110
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.unselectedListBox = _t.first);
111
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.selectedListBox = _t.first);
112
+ } }, inputs: { EntityName: "EntityName", DisplayField: "DisplayField", DisplayIconField: "DisplayIconField", AvailableRecords: "AvailableRecords", SelectedRecords: "SelectedRecords", UnselectedRecords: "UnselectedRecords", ToolbarSettings: "ToolbarSettings" }, outputs: { RecordSelected: "RecordSelected", RecordUnselected: "RecordUnselected" }, decls: 7, vars: 7, consts: [["unselected", ""], ["selected", ""], ["mjFillContainer", ""], ["kendoListBoxDataBinding", "", 1, "list-box", 3, "dblclick", "data", "textField", "connectedWith", "toolbar"], ["kendoListBoxItemTemplate", ""], [1, "list-box", 3, "dblclick", "data", "textField", "toolbar"], [3, "ngClass"]], template: function RecordSelectorComponent_Template(rf, ctx) { if (rf & 1) {
113
+ const _r1 = i0.ɵɵgetCurrentView();
114
+ i0.ɵɵelementStart(0, "div", 2)(1, "kendo-listbox", 3, 0);
115
+ i0.ɵɵlistener("dblclick", function RecordSelectorComponent_Template_kendo_listbox_dblclick_1_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onDblClick($event, "unselected")); });
116
+ i0.ɵɵtemplate(3, RecordSelectorComponent_ng_template_3_Template, 3, 2, "ng-template", 4);
117
+ i0.ɵɵelementEnd();
118
+ i0.ɵɵelementStart(4, "kendo-listbox", 5, 1);
119
+ i0.ɵɵlistener("dblclick", function RecordSelectorComponent_Template_kendo_listbox_dblclick_4_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onDblClick($event, "selected")); });
120
+ i0.ɵɵtemplate(6, RecordSelectorComponent_ng_template_6_Template, 3, 2, "ng-template", 4);
121
+ i0.ɵɵelementEnd()();
122
+ } if (rf & 2) {
123
+ const selected_r5 = i0.ɵɵreference(5);
124
+ i0.ɵɵadvance();
125
+ i0.ɵɵproperty("data", ctx.UnselectedRecords)("textField", ctx.DisplayField)("connectedWith", selected_r5)("toolbar", ctx.ToolbarSettings);
126
+ i0.ɵɵadvance(3);
127
+ i0.ɵɵproperty("data", ctx.SelectedRecords)("textField", ctx.DisplayField)("toolbar", false);
128
+ } }, dependencies: [i1.NgClass, i2.FillContainer, i3.ListBoxComponent, i3.ItemTemplateDirective, i3.DataBindingDirective], styles: [".list-box[_ngcontent-%COMP%] {\n width: 320px;\n height: 300px;\n}\n\n.k-listbox-actions-right[_ngcontent-%COMP%] {\n margin-left: 10px;\n}\n\n.item-icon[_ngcontent-%COMP%] {\n font-size: 16px;\n width: 25px;\n margin-right: 5px;\n}"] });
129
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RecordSelectorComponent, [{
130
+ type: Component,
131
+ args: [{ selector: 'mj-record-selector', template: "<div mjFillContainer> \n <kendo-listbox\n class=\"list-box\"\n #unselected\n kendoListBoxDataBinding\n [data]=\"UnselectedRecords\"\n [textField]=\"DisplayField\"\n [connectedWith]=\"selected\"\n [toolbar]=\"ToolbarSettings\"\n (dblclick)=\"onDblClick($event, 'unselected')\"\n >\n <ng-template kendoListBoxItemTemplate let-dataItem>\n @if (this.DisplayIconField) {\n <span [ngClass]=\"dataItem[this.DisplayIconField] + ' item-icon'\"></span>\n }\n <span>{{ dataItem[DisplayField] }}</span>\n </ng-template>\n </kendo-listbox>\n <kendo-listbox \n class=\"list-box\"\n #selected \n [data]=\"SelectedRecords\" \n [textField]=\"DisplayField\"\n [toolbar]=\"false\"\n (dblclick)=\"onDblClick($event, 'selected')\"\n >\n <ng-template kendoListBoxItemTemplate let-dataItem>\n @if (this.DisplayIconField) {\n <span [ngClass]=\"dataItem[this.DisplayIconField] + ' item-icon'\"></span>\n }\n <span>{{ dataItem[DisplayField] }}</span>\n </ng-template>\n </kendo-listbox>\n</div>", styles: [".list-box {\n width: 320px;\n height: 300px;\n}\n\n.k-listbox-actions-right {\n margin-left: 10px;\n}\n\n.item-icon {\n font-size: 16px;\n width: 25px;\n margin-right: 5px;\n}"] }]
132
+ }], null, { EntityName: [{
133
+ type: Input
134
+ }], DisplayField: [{
135
+ type: Input
136
+ }], DisplayIconField: [{
137
+ type: Input
138
+ }], AvailableRecords: [{
139
+ type: Input
140
+ }], SelectedRecords: [{
141
+ type: Input
142
+ }], UnselectedRecords: [{
143
+ type: Input
144
+ }], ToolbarSettings: [{
145
+ type: Input
146
+ }], RecordSelected: [{
147
+ type: Output
148
+ }], RecordUnselected: [{
149
+ type: Output
150
+ }], unselectedListBox: [{
151
+ type: ViewChild,
152
+ args: ['unselected', { static: false }]
153
+ }], selectedListBox: [{
154
+ type: ViewChild,
155
+ args: ['selected', { static: false }]
156
+ }] }); })();
157
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RecordSelectorComponent, { className: "RecordSelectorComponent", filePath: "src/lib/record-selector.component.ts", lineNumber: 12 }); })();
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./lib/record-selector.component";
3
+ import * as i2 from "./lib/dialog.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@progress/kendo-angular-dialog";
6
+ import * as i5 from "@memberjunction/ng-container-directives";
7
+ import * as i6 from "@progress/kendo-angular-buttons";
8
+ import * as i7 from "@progress/kendo-angular-listbox";
9
+ export declare class RecordSelectorModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<RecordSelectorModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RecordSelectorModule, [typeof i1.RecordSelectorComponent, typeof i2.RecordSelectorDialogComponent], [typeof i3.CommonModule, typeof i4.DialogsModule, typeof i5.ContainerDirectivesModule, typeof i6.ButtonsModule, typeof i7.ListBoxModule], [typeof i1.RecordSelectorComponent, typeof i2.RecordSelectorDialogComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<RecordSelectorModule>;
13
+ }
14
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;AAYA,qBAiBa,oBAAoB;yCAApB,oBAAoB;0CAApB,oBAAoB;0CAApB,oBAAoB;CAAI"}
package/dist/module.js ADDED
@@ -0,0 +1,46 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ // Kendo UI Angular imports
4
+ import { DialogsModule } from "@progress/kendo-angular-dialog";
5
+ import { ButtonsModule } from '@progress/kendo-angular-buttons';
6
+ import { ListBoxModule } from '@progress/kendo-angular-listbox';
7
+ import { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';
8
+ import { RecordSelectorComponent } from './lib/record-selector.component';
9
+ import { RecordSelectorDialogComponent } from './lib/dialog.component';
10
+ import * as i0 from "@angular/core";
11
+ export class RecordSelectorModule {
12
+ }
13
+ RecordSelectorModule.ɵfac = function RecordSelectorModule_Factory(t) { return new (t || RecordSelectorModule)(); };
14
+ RecordSelectorModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: RecordSelectorModule });
15
+ RecordSelectorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
16
+ DialogsModule,
17
+ ContainerDirectivesModule,
18
+ ButtonsModule,
19
+ ListBoxModule] });
20
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RecordSelectorModule, [{
21
+ type: NgModule,
22
+ args: [{
23
+ declarations: [
24
+ RecordSelectorComponent,
25
+ RecordSelectorDialogComponent
26
+ ],
27
+ imports: [
28
+ CommonModule,
29
+ DialogsModule,
30
+ ContainerDirectivesModule,
31
+ ButtonsModule,
32
+ ListBoxModule
33
+ ],
34
+ exports: [
35
+ RecordSelectorComponent,
36
+ RecordSelectorDialogComponent
37
+ ]
38
+ }]
39
+ }], null, null); })();
40
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(RecordSelectorModule, { declarations: [RecordSelectorComponent,
41
+ RecordSelectorDialogComponent], imports: [CommonModule,
42
+ DialogsModule,
43
+ ContainerDirectivesModule,
44
+ ButtonsModule,
45
+ ListBoxModule], exports: [RecordSelectorComponent,
46
+ RecordSelectorDialogComponent] }); })();
@@ -0,0 +1,4 @@
1
+ export * from './module';
2
+ export * from './lib/record-selector.component';
3
+ export * from './lib/dialog.component';
4
+ //# sourceMappingURL=public-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Public API Surface
3
+ */
4
+ export * from './module';
5
+ export * from './lib/record-selector.component';
6
+ export * from './lib/dialog.component';
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@memberjunction/ng-record-selector",
3
+ "version": "1.7.0",
4
+ "description": "MemberJunction: Angular Components to allow a user to select/deselect items from a possible set",
5
+ "main": "./dist/public-api.js",
6
+ "typings": "./dist/public-api.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "ngc"
13
+ },
14
+ "keywords": [],
15
+ "author": "",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "@angular/compiler": "18.0.2",
19
+ "@angular/compiler-cli": "18.0.2"
20
+ },
21
+ "peerDependencies": {
22
+ "@angular/common": "18.0.2",
23
+ "@angular/core": "18.0.2",
24
+ "@angular/forms": "18.0.2",
25
+ "@angular/router": "18.0.2",
26
+ "@progress/kendo-angular-buttons": "16.2.0",
27
+ "@progress/kendo-angular-dialog": "16.2.0",
28
+ "@progress/kendo-angular-listbox": "16.2.0"
29
+ },
30
+ "dependencies": {
31
+ "@memberjunction/core-entities": "1.7.0",
32
+ "@memberjunction/global": "1.7.0",
33
+ "@memberjunction/core": "1.7.0",
34
+ "@memberjunction/ng-container-directives": "1.7.0",
35
+ "@memberjunction/ng-shared": "1.7.0",
36
+ "tslib": "^2.3.0"
37
+ },
38
+ "sideEffects": false
39
+ }