@memberjunction/ng-find-record 2.6.1

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,37 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { BaseEntity, EntityFieldInfo } from '@memberjunction/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class FindRecordDialogComponent {
5
+ DialogTitle: string;
6
+ DialogWidth: string;
7
+ DialogHeight: string;
8
+ /**
9
+ * Optional, set this to the currently selected record to start the dialog with that record selected, if desired. This property will be updated as the user selects records in the dialog.
10
+ */
11
+ SelectedRecord: BaseEntity | null;
12
+ get DialogVisible(): boolean;
13
+ set DialogVisible(value: boolean);
14
+ private _dialogVisible;
15
+ /**
16
+ * 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
17
+ */
18
+ DialogClosed: EventEmitter<boolean>;
19
+ /**
20
+ * The name of the entity to show records for.
21
+ */
22
+ EntityName: string;
23
+ /**
24
+ * Optional, list of fields to be displayed in the grid of search results, if not specified, the default fields will be displayed
25
+ */
26
+ DisplayFields: EntityFieldInfo[];
27
+ /**
28
+ * When a record is selected, this event is emitted with the selected record
29
+ */
30
+ OnRecordSelected: EventEmitter<BaseEntity<unknown>>;
31
+ OnCancel(): void;
32
+ BubbleOnRecordSelected(record: any): void;
33
+ OnOK(): void;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<FindRecordDialogComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<FindRecordDialogComponent, "mj-find-record-dialog", never, { "DialogTitle": { "alias": "DialogTitle"; "required": false; }; "DialogWidth": { "alias": "DialogWidth"; "required": false; }; "DialogHeight": { "alias": "DialogHeight"; "required": false; }; "SelectedRecord": { "alias": "SelectedRecord"; "required": false; }; "DialogVisible": { "alias": "DialogVisible"; "required": false; }; "EntityName": { "alias": "EntityName"; "required": false; }; "DisplayFields": { "alias": "DisplayFields"; "required": false; }; }, { "DialogClosed": "DialogClosed"; "OnRecordSelected": "OnRecordSelected"; }, never, never, false, never>;
36
+ }
37
+ //# 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,EAAqB,YAAY,EAAU,MAAM,eAAe,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;;AAGnE,qBAKa,yBAAyB;IAC3B,WAAW,EAAE,MAAM,CAAiB;IACpC,WAAW,EAAE,MAAM,CAAW;IAC9B,YAAY,EAAE,MAAM,CAAW;IAExC;;OAEG;IACM,cAAc,EAAE,UAAU,GAAG,IAAI,CAAQ;IAElD,IAAa,aAAa,IAAI,OAAO,CAEpC;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAK/B;IACD,OAAO,CAAC,cAAc,CAAkB;IACxC;;OAEG;IACO,YAAY,wBAA+B;IAGrD;;OAEG;IACM,UAAU,EAAE,MAAM,CAAM;IAEjC;;OAEG;IACM,aAAa,EAAE,eAAe,EAAE,CAAM;IAI9C;;OAEG;IACM,gBAAgB,oCAAkC;IAErD,QAAQ;IAKR,sBAAsB,CAAC,MAAM,EAAE,GAAG;IAKlC,IAAI;yCArDA,yBAAyB;2CAAzB,yBAAyB;CAyDrC"}
@@ -0,0 +1,105 @@
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 "./find-record.component";
6
+ function FindRecordDialogComponent_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 FindRecordDialogComponent_Conditional_0_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
10
+ i0.ɵɵelementStart(1, "mj-find-record", 2);
11
+ i0.ɵɵlistener("OnRecordSelected", function FindRecordDialogComponent_Conditional_0_Template_mj_find_record_OnRecordSelected_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.BubbleOnRecordSelected($event)); });
12
+ i0.ɵɵelementEnd();
13
+ i0.ɵɵelementStart(2, "kendo-dialog-actions")(3, "button", 3);
14
+ i0.ɵɵlistener("click", function FindRecordDialogComponent_Conditional_0_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnOK()); });
15
+ i0.ɵɵtext(4, "OK");
16
+ i0.ɵɵelementEnd();
17
+ i0.ɵɵelementStart(5, "button", 4);
18
+ i0.ɵɵlistener("click", function FindRecordDialogComponent_Conditional_0_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
19
+ i0.ɵɵtext(6, "Cancel");
20
+ i0.ɵɵelementEnd()()();
21
+ } if (rf & 2) {
22
+ const ctx_r1 = i0.ɵɵnextContext();
23
+ i0.ɵɵproperty("width", ctx_r1.DialogWidth)("height", ctx_r1.DialogHeight)("title", ctx_r1.DialogTitle);
24
+ i0.ɵɵadvance();
25
+ i0.ɵɵproperty("EntityName", ctx_r1.EntityName)("DisplayFields", ctx_r1.DisplayFields);
26
+ } }
27
+ export class FindRecordDialogComponent {
28
+ constructor() {
29
+ this.DialogTitle = 'Find Record';
30
+ this.DialogWidth = '700px';
31
+ this.DialogHeight = '450px';
32
+ /**
33
+ * Optional, set this to the currently selected record to start the dialog with that record selected, if desired. This property will be updated as the user selects records in the dialog.
34
+ */
35
+ this.SelectedRecord = null;
36
+ this._dialogVisible = false;
37
+ /**
38
+ * 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
39
+ */
40
+ this.DialogClosed = new EventEmitter();
41
+ ///// REST OF THE BELOW JUST GET MAPPED TO THE CONTAINED RecordSelectorComponent
42
+ /**
43
+ * The name of the entity to show records for.
44
+ */
45
+ this.EntityName = '';
46
+ /**
47
+ * Optional, list of fields to be displayed in the grid of search results, if not specified, the default fields will be displayed
48
+ */
49
+ this.DisplayFields = []; // Fields to display in the grid
50
+ /**
51
+ * When a record is selected, this event is emitted with the selected record
52
+ */
53
+ this.OnRecordSelected = new EventEmitter();
54
+ }
55
+ get DialogVisible() {
56
+ return this._dialogVisible;
57
+ }
58
+ set DialogVisible(value) {
59
+ if (value !== this._dialogVisible && value) {
60
+ // do init stuff here as needed
61
+ }
62
+ this._dialogVisible = value;
63
+ }
64
+ OnCancel() {
65
+ this.DialogVisible = false;
66
+ this.DialogClosed.emit(false);
67
+ }
68
+ BubbleOnRecordSelected(record) {
69
+ this.SelectedRecord = record;
70
+ this.OnRecordSelected.emit(record);
71
+ }
72
+ OnOK() {
73
+ this.DialogVisible = false;
74
+ this.DialogClosed.emit(true);
75
+ }
76
+ }
77
+ FindRecordDialogComponent.ɵfac = function FindRecordDialogComponent_Factory(t) { return new (t || FindRecordDialogComponent)(); };
78
+ FindRecordDialogComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FindRecordDialogComponent, selectors: [["mj-find-record-dialog"]], inputs: { DialogTitle: "DialogTitle", DialogWidth: "DialogWidth", DialogHeight: "DialogHeight", SelectedRecord: "SelectedRecord", DialogVisible: "DialogVisible", EntityName: "EntityName", DisplayFields: "DisplayFields" }, outputs: { DialogClosed: "DialogClosed", OnRecordSelected: "OnRecordSelected" }, decls: 1, vars: 1, consts: [[3, "width", "height", "title"], [3, "close", "width", "height", "title"], [3, "OnRecordSelected", "EntityName", "DisplayFields"], ["kendoButton", "", "themeColor", "primary", 3, "click"], ["kendoButton", "", 3, "click"]], template: function FindRecordDialogComponent_Template(rf, ctx) { if (rf & 1) {
79
+ i0.ɵɵtemplate(0, FindRecordDialogComponent_Conditional_0_Template, 7, 5, "kendo-dialog", 0);
80
+ } if (rf & 2) {
81
+ i0.ɵɵconditional(ctx.DialogVisible ? 0 : -1);
82
+ } }, dependencies: [i1.DialogComponent, i1.DialogActionsComponent, i2.ButtonComponent, i3.FindRecordComponent] });
83
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FindRecordDialogComponent, [{
84
+ type: Component,
85
+ args: [{ selector: 'mj-find-record-dialog', template: "@if (DialogVisible) {\n <kendo-dialog\n [width]=\"DialogWidth\"\n [height]=\"DialogHeight\"\n [title]=\"DialogTitle\" \n (close)=\"OnCancel()\"\n >\n <mj-find-record\n [EntityName]=\"EntityName\"\n [DisplayFields]=\"DisplayFields\"\n (OnRecordSelected)=\"BubbleOnRecordSelected($event)\"\n >\n </mj-find-record>\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}" }]
86
+ }], null, { DialogTitle: [{
87
+ type: Input
88
+ }], DialogWidth: [{
89
+ type: Input
90
+ }], DialogHeight: [{
91
+ type: Input
92
+ }], SelectedRecord: [{
93
+ type: Input
94
+ }], DialogVisible: [{
95
+ type: Input
96
+ }], DialogClosed: [{
97
+ type: Output
98
+ }], EntityName: [{
99
+ type: Input
100
+ }], DisplayFields: [{
101
+ type: Input
102
+ }], OnRecordSelected: [{
103
+ type: Output
104
+ }] }); })();
105
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FindRecordDialogComponent, { className: "FindRecordDialogComponent" }); })();
@@ -0,0 +1,29 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { BaseEntity, EntityFieldInfo } from '@memberjunction/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class FindRecordComponent {
5
+ /**
6
+ * The name of the entity to show records for.
7
+ */
8
+ EntityName: string;
9
+ /**
10
+ * Optional, list of fields to be displayed in the grid of search results, if not specified, the default fields will be displayed
11
+ */
12
+ DisplayFields: EntityFieldInfo[];
13
+ /**
14
+ * When a record is selected, this event is emitted with the selected record
15
+ */
16
+ OnRecordSelected: EventEmitter<BaseEntity<unknown>>;
17
+ searchTerm: string;
18
+ records: any[];
19
+ loading: boolean;
20
+ searchHasRun: boolean;
21
+ private entityInfo;
22
+ ngOnInit(): void;
23
+ onFind(): void;
24
+ onSelectionChange(event: any): void;
25
+ protected doSearch(searchTerm: string): Promise<BaseEntity[]>;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<FindRecordComponent, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<FindRecordComponent, "mj-find-record", never, { "EntityName": { "alias": "EntityName"; "required": false; }; "DisplayFields": { "alias": "DisplayFields"; "required": false; }; }, { "OnRecordSelected": "OnRecordSelected"; }, never, never, false, never>;
28
+ }
29
+ //# sourceMappingURL=find-record.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-record.component.d.ts","sourceRoot":"","sources":["../../src/lib/find-record.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAkB,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,eAAe,EAA2C,MAAM,sBAAsB,CAAC;;AAG5G,qBAKa,mBAAmB;IAC9B;;OAEG;IACM,UAAU,EAAE,MAAM,CAAM;IAEjC;;OAEG;IACa,aAAa,EAAE,eAAe,EAAE,CAAM;IAEtD;;OAEG;IACO,gBAAgB,oCAAkC;IAErD,UAAU,EAAE,MAAM,CAAM;IACxB,OAAO,EAAE,GAAG,EAAE,CAAM;IAEpB,OAAO,UAAS;IAChB,YAAY,EAAE,OAAO,CAAS;IACrC,OAAO,CAAC,UAAU,CAAyB;IAE3C,QAAQ;IAiBR,MAAM;IASC,iBAAiB,CAAC,KAAK,EAAE,GAAG;cAMnB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;yCAvDxD,mBAAmB;2CAAnB,mBAAmB;CAwE/B"}
@@ -0,0 +1,143 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
11
+ import { LogError, Metadata, RunView } from '@memberjunction/core';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "@angular/common";
14
+ import * as i2 from "@angular/forms";
15
+ import * as i3 from "@progress/kendo-angular-grid";
16
+ import * as i4 from "@progress/kendo-angular-buttons";
17
+ import * as i5 from "@progress/kendo-angular-inputs";
18
+ const _c0 = () => ({ mode: "single" });
19
+ function FindRecordComponent_div_4_Template(rf, ctx) { if (rf & 1) {
20
+ i0.ɵɵelementStart(0, "div");
21
+ i0.ɵɵtext(1, "Searching...");
22
+ i0.ɵɵelementEnd();
23
+ } }
24
+ function FindRecordComponent_div_5_kendo_grid_column_2_Template(rf, ctx) { if (rf & 1) {
25
+ i0.ɵɵelement(0, "kendo-grid-column", 5);
26
+ } if (rf & 2) {
27
+ const field_r3 = ctx.$implicit;
28
+ i0.ɵɵproperty("field", field_r3.Name)("title", field_r3.DisplayNameOrName);
29
+ } }
30
+ function FindRecordComponent_div_5_Template(rf, ctx) { if (rf & 1) {
31
+ const _r1 = i0.ɵɵgetCurrentView();
32
+ i0.ɵɵelementStart(0, "div")(1, "kendo-grid", 3);
33
+ i0.ɵɵlistener("selectionChange", function FindRecordComponent_div_5_Template_kendo_grid_selectionChange_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSelectionChange($event)); });
34
+ i0.ɵɵtemplate(2, FindRecordComponent_div_5_kendo_grid_column_2_Template, 1, 2, "kendo-grid-column", 4);
35
+ i0.ɵɵelementEnd()();
36
+ } if (rf & 2) {
37
+ const ctx_r1 = i0.ɵɵnextContext();
38
+ i0.ɵɵadvance();
39
+ i0.ɵɵproperty("data", ctx_r1.records)("height", 280)("selectable", i0.ɵɵpureFunction0(4, _c0));
40
+ i0.ɵɵadvance();
41
+ i0.ɵɵproperty("ngForOf", ctx_r1.DisplayFields);
42
+ } }
43
+ function FindRecordComponent_div_6_Template(rf, ctx) { if (rf & 1) {
44
+ i0.ɵɵelementStart(0, "div");
45
+ i0.ɵɵtext(1, "No records found.");
46
+ i0.ɵɵelementEnd();
47
+ } }
48
+ export class FindRecordComponent {
49
+ constructor() {
50
+ /**
51
+ * The name of the entity to show records for.
52
+ */
53
+ this.EntityName = '';
54
+ /**
55
+ * Optional, list of fields to be displayed in the grid of search results, if not specified, the default fields will be displayed
56
+ */
57
+ this.DisplayFields = []; // Fields to display in the grid
58
+ /**
59
+ * When a record is selected, this event is emitted with the selected record
60
+ */
61
+ this.OnRecordSelected = new EventEmitter();
62
+ this.searchTerm = ''; // User search term
63
+ this.records = []; // Store search results
64
+ this.loading = false; // Loading state for search
65
+ this.searchHasRun = false; // has a search been run
66
+ }
67
+ ngOnInit() {
68
+ // Fetch the entity metadata based on EntityName
69
+ const md = new Metadata();
70
+ this.entityInfo = md.EntityByName(this.EntityName);
71
+ if (!this.entityInfo) {
72
+ LogError(`Entity ${this.EntityName} not found`);
73
+ return;
74
+ }
75
+ // Set display fields (you can adjust the logic based on your entity structure)
76
+ if (this.DisplayFields.length === 0) {
77
+ this.DisplayFields = this.entityInfo.Fields.filter((field) => field.DefaultInView || field.IsPrimaryKey || field.IsNameField || field.IncludeInUserSearchAPI);
78
+ }
79
+ }
80
+ onFind() {
81
+ this.loading = true;
82
+ this.doSearch(this.searchTerm).then((results) => {
83
+ this.records = results;
84
+ this.loading = false;
85
+ });
86
+ }
87
+ onSelectionChange(event) {
88
+ // Emit the selected record
89
+ this.OnRecordSelected.emit(event.selectedRows[0].dataItem);
90
+ }
91
+ // Stub function for simulating a database search (replace with actual search logic)
92
+ doSearch(searchTerm) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ const rv = new RunView();
95
+ const result = yield rv.RunView({
96
+ EntityName: this.EntityName,
97
+ UserSearchString: searchTerm,
98
+ ResultType: 'entity_object'
99
+ });
100
+ if (result && result.Success) {
101
+ return result.Results;
102
+ this.searchHasRun = true;
103
+ }
104
+ else {
105
+ const errorMessage = `Error searching for ${this.EntityName}: ${result.ErrorMessage}`;
106
+ LogError(errorMessage);
107
+ throw new Error(errorMessage);
108
+ }
109
+ });
110
+ }
111
+ }
112
+ FindRecordComponent.ɵfac = function FindRecordComponent_Factory(t) { return new (t || FindRecordComponent)(); };
113
+ FindRecordComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FindRecordComponent, selectors: [["mj-find-record"]], inputs: { EntityName: "EntityName", DisplayFields: "DisplayFields" }, outputs: { OnRecordSelected: "OnRecordSelected" }, decls: 7, vars: 4, consts: [["type", "text", "placeholder", "Start typing to search...", 1, "find-textbox", 3, "ngModelChange", "ngModel"], ["kendoButton", "", 1, "find-button", 3, "click"], [4, "ngIf"], [3, "selectionChange", "data", "height", "selectable"], [3, "field", "title", 4, "ngFor", "ngForOf"], [3, "field", "title"]], template: function FindRecordComponent_Template(rf, ctx) { if (rf & 1) {
114
+ i0.ɵɵelementStart(0, "div")(1, "kendo-textbox", 0);
115
+ i0.ɵɵtwoWayListener("ngModelChange", function FindRecordComponent_Template_kendo_textbox_ngModelChange_1_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.searchTerm, $event) || (ctx.searchTerm = $event); return $event; });
116
+ i0.ɵɵelementEnd();
117
+ i0.ɵɵelementStart(2, "button", 1);
118
+ i0.ɵɵlistener("click", function FindRecordComponent_Template_button_click_2_listener() { return ctx.onFind(); });
119
+ i0.ɵɵtext(3, "Find");
120
+ i0.ɵɵelementEnd();
121
+ i0.ɵɵtemplate(4, FindRecordComponent_div_4_Template, 2, 0, "div", 2)(5, FindRecordComponent_div_5_Template, 3, 5, "div", 2)(6, FindRecordComponent_div_6_Template, 2, 0, "div", 2);
122
+ i0.ɵɵelementEnd();
123
+ } if (rf & 2) {
124
+ i0.ɵɵadvance();
125
+ i0.ɵɵtwoWayProperty("ngModel", ctx.searchTerm);
126
+ i0.ɵɵadvance(3);
127
+ i0.ɵɵproperty("ngIf", ctx.loading);
128
+ i0.ɵɵadvance();
129
+ i0.ɵɵproperty("ngIf", !ctx.loading && ctx.records.length > 0);
130
+ i0.ɵɵadvance();
131
+ i0.ɵɵproperty("ngIf", !ctx.loading && ctx.records.length === 0 && ctx.searchHasRun);
132
+ } }, dependencies: [i1.NgForOf, i1.NgIf, i2.NgControlStatus, i2.NgModel, i3.GridComponent, i3.ColumnComponent, i4.ButtonComponent, i5.TextBoxComponent], 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}\n\n.find-textbox[_ngcontent-%COMP%] {\n width: 500px;\n margin-right: 10px;\n margin-bottom: 10px;\n}\n\n.find-button[_ngcontent-%COMP%] {\n width: 75px;\n margin-bottom: 10px;\n}"] });
133
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FindRecordComponent, [{
134
+ type: Component,
135
+ args: [{ selector: 'mj-find-record', template: "<div> \n <kendo-textbox\n class=\"find-textbox\"\n type=\"text\"\n placeholder=\"Start typing to search...\"\n [(ngModel)]=\"searchTerm\"\n >\n </kendo-textbox>\n <button class =\"find-button\" kendoButton (click)=\"onFind()\">Find</button>\n\n <div *ngIf=\"loading\">Searching...</div>\n <div *ngIf=\"!loading && records.length > 0\">\n <kendo-grid \n [data]=\"records\" \n [height]=\"280\" \n [selectable]=\"{ mode: 'single' }\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n <kendo-grid-column *ngFor=\"let field of DisplayFields\" [field]=\"field.Name\" [title]=\"field.DisplayNameOrName\"></kendo-grid-column>\n </kendo-grid>\n </div>\n <div *ngIf=\"!loading && records.length === 0 && searchHasRun\">No records found.</div>\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}\n\n.find-textbox {\n width: 500px;\n margin-right: 10px;\n margin-bottom: 10px;\n}\n\n.find-button {\n width: 75px;\n margin-bottom: 10px;\n}"] }]
136
+ }], null, { EntityName: [{
137
+ type: Input
138
+ }], DisplayFields: [{
139
+ type: Input
140
+ }], OnRecordSelected: [{
141
+ type: Output
142
+ }] }); })();
143
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FindRecordComponent, { className: "FindRecordComponent" }); })();
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./lib/find-record.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 "@angular/forms";
7
+ import * as i6 from "@progress/kendo-angular-grid";
8
+ import * as i7 from "@memberjunction/ng-container-directives";
9
+ import * as i8 from "@progress/kendo-angular-buttons";
10
+ import * as i9 from "@progress/kendo-angular-listbox";
11
+ import * as i10 from "@progress/kendo-angular-inputs";
12
+ export declare class FindRecordModule {
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<FindRecordModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FindRecordModule, [typeof i1.FindRecordComponent, typeof i2.FindRecordDialogComponent], [typeof i3.CommonModule, typeof i4.DialogsModule, typeof i5.FormsModule, typeof i6.GridModule, typeof i7.ContainerDirectivesModule, typeof i8.ButtonsModule, typeof i9.ListBoxModule, typeof i10.InputsModule], [typeof i1.FindRecordComponent, typeof i2.FindRecordDialogComponent]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<FindRecordModule>;
16
+ }
17
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;;AAeA,qBAoBa,gBAAgB;yCAAhB,gBAAgB;0CAAhB,gBAAgB;0CAAhB,gBAAgB;CAAI"}
package/dist/module.js ADDED
@@ -0,0 +1,58 @@
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 { InputsModule } from '@progress/kendo-angular-inputs';
8
+ import { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';
9
+ import { FindRecordComponent } from './lib/find-record.component';
10
+ import { FindRecordDialogComponent } from './lib/dialog.component';
11
+ import { FormsModule } from '@angular/forms';
12
+ import { GridModule } from '@progress/kendo-angular-grid';
13
+ import * as i0 from "@angular/core";
14
+ export class FindRecordModule {
15
+ }
16
+ FindRecordModule.ɵfac = function FindRecordModule_Factory(t) { return new (t || FindRecordModule)(); };
17
+ FindRecordModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: FindRecordModule });
18
+ FindRecordModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
19
+ DialogsModule,
20
+ FormsModule,
21
+ GridModule,
22
+ ContainerDirectivesModule,
23
+ ButtonsModule,
24
+ ListBoxModule,
25
+ InputsModule] });
26
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FindRecordModule, [{
27
+ type: NgModule,
28
+ args: [{
29
+ declarations: [
30
+ FindRecordComponent,
31
+ FindRecordDialogComponent
32
+ ],
33
+ imports: [
34
+ CommonModule,
35
+ DialogsModule,
36
+ FormsModule,
37
+ GridModule,
38
+ ContainerDirectivesModule,
39
+ ButtonsModule,
40
+ ListBoxModule,
41
+ InputsModule
42
+ ],
43
+ exports: [
44
+ FindRecordComponent,
45
+ FindRecordDialogComponent
46
+ ]
47
+ }]
48
+ }], null, null); })();
49
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(FindRecordModule, { declarations: [FindRecordComponent,
50
+ FindRecordDialogComponent], imports: [CommonModule,
51
+ DialogsModule,
52
+ FormsModule,
53
+ GridModule,
54
+ ContainerDirectivesModule,
55
+ ButtonsModule,
56
+ ListBoxModule,
57
+ InputsModule], exports: [FindRecordComponent,
58
+ FindRecordDialogComponent] }); })();
@@ -0,0 +1,4 @@
1
+ export * from './module';
2
+ export * from './lib/find-record.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,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Public API Surface
3
+ */
4
+ export * from './module';
5
+ export * from './lib/find-record.component';
6
+ export * from './lib/dialog.component';
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@memberjunction/ng-find-record",
3
+ "version": "2.6.1",
4
+ "description": "MemberJunction: Angular Component to allow a user to find a single record in any entity",
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-grid": "16.2.0",
27
+ "@progress/kendo-angular-buttons": "16.2.0",
28
+ "@progress/kendo-angular-inputs": "16.2.0",
29
+ "@progress/kendo-angular-dialog": "16.2.0",
30
+ "@progress/kendo-angular-listbox": "16.2.0"
31
+ },
32
+ "dependencies": {
33
+ "@memberjunction/core-entities": "2.6.1",
34
+ "@memberjunction/global": "2.6.1",
35
+ "@memberjunction/core": "2.6.1",
36
+ "@memberjunction/ng-container-directives": "2.6.1",
37
+ "@memberjunction/ng-shared": "2.6.1",
38
+ "tslib": "^2.3.0"
39
+ },
40
+ "sideEffects": false
41
+ }