@qubesense/customer-farm 0.1.2 → 0.1.4
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.
- package/esm2020/lib/customer-farm.component.mjs +203 -0
- package/esm2020/lib/customer-farm.module.mjs +106 -0
- package/esm2020/lib/customer-farm.service.mjs +129 -0
- package/esm2020/lib/dependencies/customer-farm-api-urls.mjs +19 -0
- package/esm2020/lib/dependencies/customer-farm-model.mjs +57 -0
- package/esm2020/public-api.mjs +9 -0
- package/esm2020/qubesense-customer-farm.mjs +5 -0
- package/fesm2015/qubesense-customer-farm.mjs +539 -0
- package/fesm2015/qubesense-customer-farm.mjs.map +1 -0
- package/fesm2020/qubesense-customer-farm.mjs +514 -0
- package/fesm2020/qubesense-customer-farm.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/customer-farm.component.d.ts +80 -0
- package/lib/customer-farm.module.d.ts +24 -0
- package/lib/customer-farm.service.d.ts +58 -0
- package/lib/dependencies/customer-farm-api-urls.d.ts +9 -0
- package/lib/dependencies/customer-farm-model.d.ts +48 -0
- package/package.json +31 -11
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/.eslintrc.json +0 -44
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -7
- package/src/lib/customer-farm.component.html +0 -93
- package/src/lib/customer-farm.component.scss +0 -0
- package/src/lib/customer-farm.component.ts +0 -207
- package/src/lib/customer-farm.module.ts +0 -54
- package/src/lib/customer-farm.service.ts +0 -126
- package/src/lib/dependencies/customer-farm-api-urls.ts +0 -22
- package/src/lib/dependencies/customer-farm-model.ts +0 -52
- package/src/test.ts +0 -27
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export class CustomerFarmModel {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.formCode = null;
|
|
4
|
+
this.formId = '';
|
|
5
|
+
this.recordId = null;
|
|
6
|
+
this.customerId = null;
|
|
7
|
+
this.customerName = '';
|
|
8
|
+
this.defaultWarehouse = '';
|
|
9
|
+
this.personInCharge = '';
|
|
10
|
+
this.displayName = '';
|
|
11
|
+
this.primaryVetId = '';
|
|
12
|
+
this.PICTattoo = '';
|
|
13
|
+
this.isActive = true;
|
|
14
|
+
this.isDeleted = false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class CustomerFarmConfigrationModel {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.formCode = null;
|
|
20
|
+
this.customerId = null;
|
|
21
|
+
this.defaultView = false;
|
|
22
|
+
this.showModal = false;
|
|
23
|
+
this.showGrid = false;
|
|
24
|
+
this.isSearchable = false;
|
|
25
|
+
this.showClientData = false;
|
|
26
|
+
this.customerData = null;
|
|
27
|
+
this.userMessages = false;
|
|
28
|
+
this.requiredCustomerFarmSection = false;
|
|
29
|
+
this.allowedCustomerFarmSection = false;
|
|
30
|
+
this.requiredCustomerFarmFields = new RequiredCustomerFarmFields();
|
|
31
|
+
this.allowedCustomerFarmFields = new AllowedCustomerFarmFields();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export class RequiredCustomerFarmFields {
|
|
35
|
+
constructor() {
|
|
36
|
+
this.customerName = true;
|
|
37
|
+
this.customerId = true;
|
|
38
|
+
this.defaultWarehouse = true;
|
|
39
|
+
this.personInCharge = true;
|
|
40
|
+
this.primaryVetId = true;
|
|
41
|
+
this.displayName = true;
|
|
42
|
+
this.PICTattoo = false;
|
|
43
|
+
this.profileImageURL = false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export class AllowedCustomerFarmFields {
|
|
47
|
+
constructor() {
|
|
48
|
+
this.customerName = true;
|
|
49
|
+
this.defaultWarehouse = true;
|
|
50
|
+
this.personInCharge = true;
|
|
51
|
+
this.primaryVetId = true;
|
|
52
|
+
this.PICTattoo = true;
|
|
53
|
+
this.displayName = true;
|
|
54
|
+
this.profileImageURL = false;
|
|
55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XG4gICAgZGlzcGxheU5hbWU6IGJvb2xlYW4gPSB0cnVlO1xyXG4gICAgcHJvZmlsZUltYWdlVVJMOiBib29sZWFuID0gZmFsc2U7XHJcbn1cclxuXHJcbiJdfQ==
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of customer-farm
|
|
3
|
+
*/
|
|
4
|
+
export * from './lib/customer-farm.service';
|
|
5
|
+
export * from './lib/customer-farm.component';
|
|
6
|
+
export * from './lib/customer-farm.module';
|
|
7
|
+
export * from './lib/dependencies/customer-farm-api-urls';
|
|
8
|
+
export * from './lib/dependencies/customer-farm-model';
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2N1c3RvbWVyLWZhcm0vc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLDJDQUEyQyxDQUFDO0FBQzFELGNBQWMsd0NBQXdDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxyXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgY3VzdG9tZXItZmFybVxyXG4gKi9cclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2N1c3RvbWVyLWZhcm0uc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2N1c3RvbWVyLWZhcm0uY29tcG9uZW50JztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY3VzdG9tZXItZmFybS5tb2R1bGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9kZXBlbmRlbmNpZXMvY3VzdG9tZXItZmFybS1hcGktdXJscyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2RlcGVuZGVuY2llcy9jdXN0b21lci1mYXJtLW1vZGVsJztcclxuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXViZXNlbnNlLWN1c3RvbWVyLWZhcm0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9jdXN0b21lci1mYXJtL3NyYy9xdWJlc2Vuc2UtY3VzdG9tZXItZmFybS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
|
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, EventEmitter, Component, Output, Input, NgModule } from '@angular/core';
|
|
4
|
+
import * as i3 from '@qubesense/base-services';
|
|
5
|
+
import { KendoGridviewConfigurationModel, KendoGridViewModule } from '@qubesense/base-services';
|
|
6
|
+
import * as i2 from '@angular/forms';
|
|
7
|
+
import { Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
8
|
+
import * as i4 from '@angular/material/form-field';
|
|
9
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
10
|
+
import * as i5 from '@angular/material/input';
|
|
11
|
+
import { MatInputModule } from '@angular/material/input';
|
|
12
|
+
import * as i6 from '@angular/common';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
14
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
15
|
+
import { CdkStepperModule } from '@angular/cdk/stepper';
|
|
16
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
17
|
+
import { MatOptionModule, MatNativeDateModule } from '@angular/material/core';
|
|
18
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
19
|
+
import { MatGridListModule } from '@angular/material/grid-list';
|
|
20
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
21
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
22
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
23
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
24
|
+
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
25
|
+
import { GridModule, SharedModule, ExcelModule } from '@progress/kendo-angular-grid';
|
|
26
|
+
|
|
27
|
+
class CustomerFarmApiUrls {
|
|
28
|
+
constructor() {
|
|
29
|
+
//api Url string for get data by Id
|
|
30
|
+
this.getCustomerFarmByIdUrl = 'api/CustomerFarm/GetById';
|
|
31
|
+
//api Url string for insert Customer data
|
|
32
|
+
this.insertCustomerFarmDataUrl = 'api/CustomerFarm/Create';
|
|
33
|
+
//api Url string for update Customer record
|
|
34
|
+
this.updateCustomerFarmDataUrl = 'api/CustomerFarm/Update';
|
|
35
|
+
//api Url string for delete Customer record
|
|
36
|
+
this.deleteCustomerFarmDataUrl = 'api/CustomerFarm/Delete';
|
|
37
|
+
//api Url string for get Customer list
|
|
38
|
+
this.getCustomerFarmListUrl = 'api/CustomerFarm/GetAll';
|
|
39
|
+
//api Url string for get Customer dropdown list
|
|
40
|
+
this.getCustomerFarmDropdownListUrl = 'api/CustomerFarm/GetDropdownList';
|
|
41
|
+
//api Url string for get Customer dropdown list
|
|
42
|
+
this.getcustomerlistbykeyword = 'api/CustomerFarm/SearchCustomer';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class CustomerFarmService {
|
|
47
|
+
constructor(dataAccessService) {
|
|
48
|
+
this.dataAccessService = dataAccessService;
|
|
49
|
+
this.customerFarmApiUrls = new CustomerFarmApiUrls();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* service for get customer data by Id
|
|
53
|
+
*
|
|
54
|
+
* @param customerGUID
|
|
55
|
+
*
|
|
56
|
+
* @returns Response Data from Database
|
|
57
|
+
*/
|
|
58
|
+
GetDataById(customerGUID) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
try {
|
|
61
|
+
const url = this.customerFarmApiUrls.getCustomerFarmByIdUrl + '/' + customerGUID;
|
|
62
|
+
const resultResponse = yield this.dataAccessService.GetDataById(url);
|
|
63
|
+
return resultResponse;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* service for inserting customer data into database
|
|
72
|
+
*
|
|
73
|
+
* @param customerFarmModel
|
|
74
|
+
*
|
|
75
|
+
* @returns Response message from Database
|
|
76
|
+
*/
|
|
77
|
+
InsertData(customerFarmModel) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
try {
|
|
80
|
+
const url = this.customerFarmApiUrls.insertCustomerFarmDataUrl;
|
|
81
|
+
const resultResponse = yield this.dataAccessService.InsertData(url, customerFarmModel);
|
|
82
|
+
return resultResponse;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* service for update customer Data
|
|
91
|
+
*
|
|
92
|
+
* @param customerFarmModel
|
|
93
|
+
*
|
|
94
|
+
* @returns Response message from Database
|
|
95
|
+
*/
|
|
96
|
+
UpdateData(customerFarmModel) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
try {
|
|
99
|
+
const url = this.customerFarmApiUrls.updateCustomerFarmDataUrl;
|
|
100
|
+
const resultResponse = yield this.dataAccessService.UpdateData(url, customerFarmModel);
|
|
101
|
+
return resultResponse;
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* service for delete customer data by GUID
|
|
110
|
+
*
|
|
111
|
+
* @param customerFarmModel
|
|
112
|
+
*
|
|
113
|
+
* @returns Response message from Database
|
|
114
|
+
*/
|
|
115
|
+
DeleteData(recordId) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
try {
|
|
118
|
+
const url = this.customerFarmApiUrls.deleteCustomerFarmDataUrl + '/' + recordId;
|
|
119
|
+
const resultResponse = yield this.dataAccessService.DeleteData(url);
|
|
120
|
+
return resultResponse;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* service for get data for customer grid
|
|
129
|
+
*
|
|
130
|
+
* @param customerFarmModel
|
|
131
|
+
*
|
|
132
|
+
* @returns Response Data from Database
|
|
133
|
+
*/
|
|
134
|
+
GetListData(customerDataModel) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
try {
|
|
137
|
+
const url = this.customerFarmApiUrls.getCustomerFarmListUrl;
|
|
138
|
+
const resultResponse = yield this.dataAccessService.GetListData(url, customerDataModel);
|
|
139
|
+
return resultResponse;
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* service for get data for customer DropDown List
|
|
148
|
+
*
|
|
149
|
+
* @returns
|
|
150
|
+
*/
|
|
151
|
+
GetCustomersDropdownList() {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
try {
|
|
154
|
+
const url = this.customerFarmApiUrls.getCustomerFarmDropdownListUrl;
|
|
155
|
+
const resultResponse = yield this.dataAccessService.GetDropdownListData(url);
|
|
156
|
+
return resultResponse;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
GetCustomerListByKeyword(value) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
try {
|
|
166
|
+
const url = this.customerFarmApiUrls.getcustomerlistbykeyword + '/' + value;
|
|
167
|
+
const resultResponse = yield this.dataAccessService.GetDataById(url);
|
|
168
|
+
return resultResponse;
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
CustomerFarmService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmService, deps: [{ token: i3.DataAccessService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
177
|
+
CustomerFarmService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmService, providedIn: 'root' });
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmService, decorators: [{
|
|
179
|
+
type: Injectable,
|
|
180
|
+
args: [{
|
|
181
|
+
providedIn: 'root'
|
|
182
|
+
}]
|
|
183
|
+
}], ctorParameters: function () { return [{ type: i3.DataAccessService }]; } });
|
|
184
|
+
|
|
185
|
+
class CustomerFarmModel {
|
|
186
|
+
constructor() {
|
|
187
|
+
this.formCode = null;
|
|
188
|
+
this.formId = '';
|
|
189
|
+
this.recordId = null;
|
|
190
|
+
this.customerId = null;
|
|
191
|
+
this.customerName = '';
|
|
192
|
+
this.defaultWarehouse = '';
|
|
193
|
+
this.personInCharge = '';
|
|
194
|
+
this.displayName = '';
|
|
195
|
+
this.primaryVetId = '';
|
|
196
|
+
this.PICTattoo = '';
|
|
197
|
+
this.isActive = true;
|
|
198
|
+
this.isDeleted = false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
class CustomerFarmConfigrationModel {
|
|
202
|
+
constructor() {
|
|
203
|
+
this.formCode = null;
|
|
204
|
+
this.customerId = null;
|
|
205
|
+
this.defaultView = false;
|
|
206
|
+
this.showModal = false;
|
|
207
|
+
this.showGrid = false;
|
|
208
|
+
this.isSearchable = false;
|
|
209
|
+
this.showClientData = false;
|
|
210
|
+
this.customerData = null;
|
|
211
|
+
this.userMessages = false;
|
|
212
|
+
this.requiredCustomerFarmSection = false;
|
|
213
|
+
this.allowedCustomerFarmSection = false;
|
|
214
|
+
this.requiredCustomerFarmFields = new RequiredCustomerFarmFields();
|
|
215
|
+
this.allowedCustomerFarmFields = new AllowedCustomerFarmFields();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
class RequiredCustomerFarmFields {
|
|
219
|
+
constructor() {
|
|
220
|
+
this.customerName = true;
|
|
221
|
+
this.customerId = true;
|
|
222
|
+
this.defaultWarehouse = true;
|
|
223
|
+
this.personInCharge = true;
|
|
224
|
+
this.primaryVetId = true;
|
|
225
|
+
this.displayName = true;
|
|
226
|
+
this.PICTattoo = false;
|
|
227
|
+
this.profileImageURL = false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
class AllowedCustomerFarmFields {
|
|
231
|
+
constructor() {
|
|
232
|
+
this.customerName = true;
|
|
233
|
+
this.defaultWarehouse = true;
|
|
234
|
+
this.personInCharge = true;
|
|
235
|
+
this.primaryVetId = true;
|
|
236
|
+
this.PICTattoo = true;
|
|
237
|
+
this.displayName = true;
|
|
238
|
+
this.profileImageURL = false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
class CustomerFarmComponent {
|
|
243
|
+
constructor(customerFarmService, formBuilder, errorLogService, toastr) {
|
|
244
|
+
this.customerFarmService = customerFarmService;
|
|
245
|
+
this.formBuilder = formBuilder;
|
|
246
|
+
this.errorLogService = errorLogService;
|
|
247
|
+
this.toastr = toastr;
|
|
248
|
+
this.customerFarmData = new EventEmitter();
|
|
249
|
+
this.customerFarmConfiguration = new CustomerFarmConfigrationModel();
|
|
250
|
+
this.userMessages = [];
|
|
251
|
+
this.gridData = [];
|
|
252
|
+
this.gridConfiguration = new KendoGridviewConfigurationModel();
|
|
253
|
+
this.hideButtons = false;
|
|
254
|
+
this.isViewCall = false;
|
|
255
|
+
this.speciesList = [];
|
|
256
|
+
}
|
|
257
|
+
ngOnInit() {
|
|
258
|
+
this.DeclareForm();
|
|
259
|
+
if (this.customerFarmConfiguration.showGrid) {
|
|
260
|
+
this.gridConfiguration.FormCode = 'CUFA';
|
|
261
|
+
this.gridConfiguration.showModal = true;
|
|
262
|
+
this.gridConfiguration.actions = { 'View': false, 'Edit': true, 'Delete': true, 'Generate PDF': false };
|
|
263
|
+
this.GetListData();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
DeclareForm() {
|
|
267
|
+
this.customerFarmForm = this.formBuilder.group({
|
|
268
|
+
recordId: [null],
|
|
269
|
+
customerId: [null],
|
|
270
|
+
customerName: [null],
|
|
271
|
+
defaultWarehouse: [null],
|
|
272
|
+
personInCharge: [null],
|
|
273
|
+
displayName: [null],
|
|
274
|
+
primaryVetId: [null],
|
|
275
|
+
PICTattoo: [null],
|
|
276
|
+
isActive: [true]
|
|
277
|
+
});
|
|
278
|
+
if (this.customerFarmConfiguration.requiredCustomerFarmFields.customerName) {
|
|
279
|
+
this.customerFarmForm.get('customerName').addValidators(Validators.required);
|
|
280
|
+
this.customerFarmForm.get('customerName').addValidators(Validators.pattern('^[a-zA-Z ]*$'));
|
|
281
|
+
this.customerFarmForm.get('customerName').addValidators(Validators.minLength(3));
|
|
282
|
+
}
|
|
283
|
+
if (this.customerFarmConfiguration.requiredCustomerFarmFields.defaultWarehouse) {
|
|
284
|
+
this.customerFarmForm.get('defaultWarehouse').addValidators(Validators.required);
|
|
285
|
+
}
|
|
286
|
+
if (this.customerFarmConfiguration.requiredCustomerFarmFields.personInCharge) {
|
|
287
|
+
this.customerFarmForm.get('personInCharge').addValidators(Validators.required);
|
|
288
|
+
}
|
|
289
|
+
if (this.customerFarmConfiguration.requiredCustomerFarmFields.primaryVetId) {
|
|
290
|
+
this.customerFarmForm.get('primaryVetId').addValidators(Validators.required);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
///////////////////////////////////standard methods/////////////////////////////////////////////////////
|
|
294
|
+
/**
|
|
295
|
+
* @description
|
|
296
|
+
*
|
|
297
|
+
* edit data list item using data item GUID
|
|
298
|
+
*
|
|
299
|
+
* @param customerId
|
|
300
|
+
*
|
|
301
|
+
* gets customer GUID from gridData and passes it to this function
|
|
302
|
+
*/
|
|
303
|
+
EditData(customerId) {
|
|
304
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
305
|
+
const getResponse = yield this.customerFarmService.GetDataById(customerId);
|
|
306
|
+
this.customerFarmForm.controls['recordId'].setValue(getResponse.apiData.recordId);
|
|
307
|
+
this.customerFarmForm.controls['customerId'].setValue(getResponse.apiData.customerId);
|
|
308
|
+
this.customerFarmForm.controls['customerName'].setValue(getResponse.apiData.customerName);
|
|
309
|
+
this.customerFarmForm.controls['defaultWarehouse'].setValue(getResponse.apiData.defaultWarehouse);
|
|
310
|
+
this.customerFarmForm.controls['personInCharge'].setValue(getResponse.apiData.personInCharge);
|
|
311
|
+
this.customerFarmForm.controls['displayName'].setValue(getResponse.apiData.displayName);
|
|
312
|
+
this.customerFarmForm.controls['primaryVetId'].setValue(getResponse.apiData.primaryVetId);
|
|
313
|
+
this.customerFarmForm.controls['PICTattoo'].setValue(getResponse.apiData.picTattoo);
|
|
314
|
+
this.customerFarmForm.controls['isActive'].setValue(getResponse.apiData.isActive);
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* @description
|
|
319
|
+
*
|
|
320
|
+
* this method converts all form inputs into model class
|
|
321
|
+
*
|
|
322
|
+
* @returns model with new form values
|
|
323
|
+
*/
|
|
324
|
+
ConvertFormToModel() {
|
|
325
|
+
const customerFarmModel = new CustomerFarmModel();
|
|
326
|
+
customerFarmModel.recordId = this.customerFarmForm.value.recordId;
|
|
327
|
+
customerFarmModel.customerName = this.customerFarmForm.value.customerName;
|
|
328
|
+
customerFarmModel.defaultWarehouse = this.customerFarmForm.value.defaultWarehouse;
|
|
329
|
+
customerFarmModel.personInCharge = this.customerFarmForm.value.personInCharge;
|
|
330
|
+
customerFarmModel.displayName = this.customerFarmForm.value.displayName;
|
|
331
|
+
customerFarmModel.primaryVetId = this.customerFarmForm.value.primaryVetId;
|
|
332
|
+
customerFarmModel.PICTattoo = this.customerFarmForm.value.PICTattoo;
|
|
333
|
+
customerFarmModel.customerId = this.customerFarmConfiguration.customerId;
|
|
334
|
+
customerFarmModel.formCode = this.customerFarmConfiguration.formCode;
|
|
335
|
+
return customerFarmModel;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* @description
|
|
339
|
+
* clear form data
|
|
340
|
+
*/
|
|
341
|
+
ClearForm() {
|
|
342
|
+
this.DeclareForm();
|
|
343
|
+
}
|
|
344
|
+
emitDataToParent() {
|
|
345
|
+
let customerFarmModel = new CustomerFarmModel();
|
|
346
|
+
customerFarmModel = this.ConvertFormToModel();
|
|
347
|
+
this.customerFarmData.emit(customerFarmModel);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* @description
|
|
351
|
+
*
|
|
352
|
+
* Insert customer data into database
|
|
353
|
+
*/
|
|
354
|
+
InsertData() {
|
|
355
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
356
|
+
let customerFarmModel = new CustomerFarmModel();
|
|
357
|
+
customerFarmModel = this.ConvertFormToModel();
|
|
358
|
+
const getResponse = yield this.customerFarmService.InsertData(customerFarmModel);
|
|
359
|
+
this.userMessages = getResponse.message.userMessage;
|
|
360
|
+
if (this.customerFarmConfiguration.userMessages) {
|
|
361
|
+
this.toastr.ShowSuccess(this.userMessages.toString());
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* @description
|
|
367
|
+
*
|
|
368
|
+
* update customer data into database
|
|
369
|
+
*/
|
|
370
|
+
UpdateData() {
|
|
371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
+
let customerFarmModel = new CustomerFarmModel();
|
|
373
|
+
customerFarmModel = this.ConvertFormToModel();
|
|
374
|
+
const getResponse = yield this.customerFarmService.UpdateData(customerFarmModel);
|
|
375
|
+
this.userMessages = getResponse.message.userMessage;
|
|
376
|
+
if (this.customerFarmConfiguration.userMessages) {
|
|
377
|
+
this.toastr.ShowSuccess(this.userMessages.toString());
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* @description
|
|
383
|
+
*
|
|
384
|
+
* Delete customer data into database
|
|
385
|
+
*/
|
|
386
|
+
DeleteData(value) {
|
|
387
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
388
|
+
const getResponse = yield this.customerFarmService.DeleteData(value);
|
|
389
|
+
this.userMessages = getResponse.message.userMessage;
|
|
390
|
+
if (this.customerFarmConfiguration.userMessages) {
|
|
391
|
+
this.toastr.ShowSuccess(this.userMessages.toString());
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* @description
|
|
397
|
+
*
|
|
398
|
+
* Grid events calls
|
|
399
|
+
*/
|
|
400
|
+
handleGridEvents(gridEvents) {
|
|
401
|
+
gridEvents.editRecord.subscribe((recordId) => {
|
|
402
|
+
this.hideButtons = false;
|
|
403
|
+
this.isViewCall = false;
|
|
404
|
+
this.EditData(recordId);
|
|
405
|
+
this.customerFarmForm.enable();
|
|
406
|
+
});
|
|
407
|
+
gridEvents.deleteRecord.subscribe((recordId) => {
|
|
408
|
+
this.DeleteData(recordId);
|
|
409
|
+
});
|
|
410
|
+
gridEvents.viewRecord.subscribe((recordId) => __awaiter(this, void 0, void 0, function* () {
|
|
411
|
+
this.EditData(recordId);
|
|
412
|
+
this.customerFarmForm.disable();
|
|
413
|
+
}));
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* @description
|
|
417
|
+
* get data for Customer grid list
|
|
418
|
+
*/
|
|
419
|
+
GetListData() {
|
|
420
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
421
|
+
const customerFarmModel = new CustomerFarmModel();
|
|
422
|
+
try {
|
|
423
|
+
const getResponse = yield this.customerFarmService.GetListData(customerFarmModel);
|
|
424
|
+
this.gridData = getResponse.apiData;
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
this.errorLogService.saveError(error);
|
|
428
|
+
this.toastr.ShowAllErrors(error.error.message.userMessage);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
CustomerFarmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmComponent, deps: [{ token: CustomerFarmService }, { token: i2.FormBuilder }, { token: i3.ErrorLogService }, { token: i3.ToastrNotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
434
|
+
CustomerFarmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: CustomerFarmComponent, selector: "lib-customer-farm", inputs: { customerFarmConfiguration: "customerFarmConfiguration" }, outputs: { customerFarmData: "customerFarmData" }, ngImport: i0, template: "<div class=\"flex flex-col flex-auto min-w-0 w-full\">\r\n <!-- form code starts here -->\r\n <!--content-->\r\n <div class=\"sm:w-full overflow-hidden\" *ngIf=\"customerFarmConfiguration.showModal\">\r\n\r\n <!--form body-->\r\n <form class=\"flex flex-col overflow-hidden\" [formGroup]=\"customerFarmForm\">\r\n <!-- Customer Farm section start -->\r\n\r\n <div class=\"sm:flex\">\r\n <div class=\"w-full\">\r\n <div class=\"sm:flex px-8 pt-4\">\r\n <mat-form-field class=\"flex-auto w-full mr-4\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.customerName\">\r\n <mat-label>Client Name</mat-label>\r\n <input matInput id=\"customerName\" placeholder=\"Client Name\" pattern=\"^[a-zA-Z ]*$\"\r\n minlength=\"3\" [formControlName]=\"'customerName'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('customerName').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.customerName \">\r\n Client Name is required\r\n </mat-error>\r\n <mat-error *ngIf=\"customerFarmForm.get('customerName').hasError('pattern')\">\r\n Please enter valid Client name\r\n </mat-error>\r\n <mat-error *ngIf=\"customerFarmForm.get('customerName').hasError('minlength')\">\r\n Client name must be of atleast 3 characters\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"flex-auto w-full\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.defaultWarehouse\">\r\n <mat-label>Default Warehouse</mat-label>\r\n <input matInput id=\"defaultWarehouse\" placeholder=\"Default Warehouse\"\r\n [formControlName]=\"'defaultWarehouse'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('defaultWarehouse').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.defaultWarehouse\">\r\n Default Warehouse is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"sm:flex px-8 pt-4\">\r\n <mat-form-field class=\"flex-auto w-full mr-4\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.personInCharge\">\r\n <mat-label>Person In Charge</mat-label>\r\n <input matInput id=\"personInCharge\" placeholder=\"Person In Charge\"\r\n [formControlName]=\"'personInCharge'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('personInCharge').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.personInCharge\">\r\n Person In Charge is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"flex-auto w-full\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.displayName\">\r\n <mat-label>Display Name</mat-label>\r\n <input matInput id=\"displayName\" placeholder=\"Display Name\"\r\n [formControlName]=\"'displayName'\" (change)=\"emitDataToParent()\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"sm:flex px-8 pt-4\">\r\n <mat-form-field class=\"flex-auto w-full mr-4\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.primaryVetId\">\r\n <mat-label>Primary Vet</mat-label>\r\n <input matInput id=\"primaryVetId\" placeholder=\"Primary Vet\"\r\n [formControlName]=\"'primaryVetId'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('primaryVetId').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.primaryVetId\">\r\n Primary Vet is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"flex-auto w-full\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.PICTattoo\">\r\n <mat-label>PIC/Tattoo (if applicable)</mat-label>\r\n <input matInput id=\"PICTattoo\" placeholder=\"PIC/Tattoo\" [formControlName]=\"'PICTattoo'\"\r\n (change)=\"emitDataToParent()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <!-- Customer Farm section End -->\r\n\r\n </form>\r\n </div>\r\n <!-- form code ends here -->\r\n\r\n</div>\r\n<div *ngIf=\"customerFarmConfiguration.showGrid\">\r\n <lib-kendo-grid-view [configuration]=\"gridConfiguration\" (events)=\"handleGridEvents($event)\"></lib-kendo-grid-view>\r\n </div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.KendoGridViewComponent, selector: "lib-kendo-grid-view", inputs: ["configuration"], outputs: ["events"] }] });
|
|
435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmComponent, decorators: [{
|
|
436
|
+
type: Component,
|
|
437
|
+
args: [{ selector: 'lib-customer-farm', template: "<div class=\"flex flex-col flex-auto min-w-0 w-full\">\r\n <!-- form code starts here -->\r\n <!--content-->\r\n <div class=\"sm:w-full overflow-hidden\" *ngIf=\"customerFarmConfiguration.showModal\">\r\n\r\n <!--form body-->\r\n <form class=\"flex flex-col overflow-hidden\" [formGroup]=\"customerFarmForm\">\r\n <!-- Customer Farm section start -->\r\n\r\n <div class=\"sm:flex\">\r\n <div class=\"w-full\">\r\n <div class=\"sm:flex px-8 pt-4\">\r\n <mat-form-field class=\"flex-auto w-full mr-4\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.customerName\">\r\n <mat-label>Client Name</mat-label>\r\n <input matInput id=\"customerName\" placeholder=\"Client Name\" pattern=\"^[a-zA-Z ]*$\"\r\n minlength=\"3\" [formControlName]=\"'customerName'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('customerName').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.customerName \">\r\n Client Name is required\r\n </mat-error>\r\n <mat-error *ngIf=\"customerFarmForm.get('customerName').hasError('pattern')\">\r\n Please enter valid Client name\r\n </mat-error>\r\n <mat-error *ngIf=\"customerFarmForm.get('customerName').hasError('minlength')\">\r\n Client name must be of atleast 3 characters\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"flex-auto w-full\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.defaultWarehouse\">\r\n <mat-label>Default Warehouse</mat-label>\r\n <input matInput id=\"defaultWarehouse\" placeholder=\"Default Warehouse\"\r\n [formControlName]=\"'defaultWarehouse'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('defaultWarehouse').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.defaultWarehouse\">\r\n Default Warehouse is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"sm:flex px-8 pt-4\">\r\n <mat-form-field class=\"flex-auto w-full mr-4\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.personInCharge\">\r\n <mat-label>Person In Charge</mat-label>\r\n <input matInput id=\"personInCharge\" placeholder=\"Person In Charge\"\r\n [formControlName]=\"'personInCharge'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('personInCharge').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.personInCharge\">\r\n Person In Charge is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"flex-auto w-full\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.displayName\">\r\n <mat-label>Display Name</mat-label>\r\n <input matInput id=\"displayName\" placeholder=\"Display Name\"\r\n [formControlName]=\"'displayName'\" (change)=\"emitDataToParent()\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"sm:flex px-8 pt-4\">\r\n <mat-form-field class=\"flex-auto w-full mr-4\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.primaryVetId\">\r\n <mat-label>Primary Vet</mat-label>\r\n <input matInput id=\"primaryVetId\" placeholder=\"Primary Vet\"\r\n [formControlName]=\"'primaryVetId'\" (change)=\"emitDataToParent()\">\r\n <mat-error\r\n *ngIf=\"customerFarmForm.get('primaryVetId').hasError('required') && customerFarmConfiguration.requiredCustomerFarmFields.primaryVetId\">\r\n Primary Vet is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"flex-auto w-full\"\r\n *ngIf=\"customerFarmConfiguration.allowedCustomerFarmFields.PICTattoo\">\r\n <mat-label>PIC/Tattoo (if applicable)</mat-label>\r\n <input matInput id=\"PICTattoo\" placeholder=\"PIC/Tattoo\" [formControlName]=\"'PICTattoo'\"\r\n (change)=\"emitDataToParent()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <!-- Customer Farm section End -->\r\n\r\n </form>\r\n </div>\r\n <!-- form code ends here -->\r\n\r\n</div>\r\n<div *ngIf=\"customerFarmConfiguration.showGrid\">\r\n <lib-kendo-grid-view [configuration]=\"gridConfiguration\" (events)=\"handleGridEvents($event)\"></lib-kendo-grid-view>\r\n </div>\r\n" }]
|
|
438
|
+
}], ctorParameters: function () { return [{ type: CustomerFarmService }, { type: i2.FormBuilder }, { type: i3.ErrorLogService }, { type: i3.ToastrNotificationService }]; }, propDecorators: { customerFarmData: [{
|
|
439
|
+
type: Output
|
|
440
|
+
}], customerFarmConfiguration: [{
|
|
441
|
+
type: Input
|
|
442
|
+
}] } });
|
|
443
|
+
|
|
444
|
+
class CustomerFarmModule {
|
|
445
|
+
}
|
|
446
|
+
CustomerFarmModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
447
|
+
CustomerFarmModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmModule, declarations: [CustomerFarmComponent], imports: [MatIconModule,
|
|
448
|
+
MatInputModule,
|
|
449
|
+
MatToolbarModule,
|
|
450
|
+
ReactiveFormsModule,
|
|
451
|
+
FormsModule,
|
|
452
|
+
CommonModule,
|
|
453
|
+
GridModule,
|
|
454
|
+
ButtonsModule,
|
|
455
|
+
MatGridListModule,
|
|
456
|
+
MatFormFieldModule,
|
|
457
|
+
ReactiveFormsModule,
|
|
458
|
+
MatInputModule,
|
|
459
|
+
MatOptionModule,
|
|
460
|
+
MatSelectModule,
|
|
461
|
+
MatCheckboxModule,
|
|
462
|
+
SharedModule,
|
|
463
|
+
MatButtonModule,
|
|
464
|
+
MatDatepickerModule,
|
|
465
|
+
MatNativeDateModule,
|
|
466
|
+
ExcelModule,
|
|
467
|
+
MatStepperModule,
|
|
468
|
+
CdkStepperModule,
|
|
469
|
+
KendoGridViewModule], exports: [CustomerFarmComponent] });
|
|
470
|
+
CustomerFarmModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmModule, imports: [MatIconModule,
|
|
471
|
+
MatInputModule,
|
|
472
|
+
MatToolbarModule,
|
|
473
|
+
ReactiveFormsModule,
|
|
474
|
+
FormsModule,
|
|
475
|
+
CommonModule,
|
|
476
|
+
GridModule,
|
|
477
|
+
ButtonsModule,
|
|
478
|
+
MatGridListModule,
|
|
479
|
+
MatFormFieldModule,
|
|
480
|
+
ReactiveFormsModule,
|
|
481
|
+
MatInputModule,
|
|
482
|
+
MatOptionModule,
|
|
483
|
+
MatSelectModule,
|
|
484
|
+
MatCheckboxModule,
|
|
485
|
+
SharedModule,
|
|
486
|
+
MatButtonModule,
|
|
487
|
+
MatDatepickerModule,
|
|
488
|
+
MatNativeDateModule,
|
|
489
|
+
ExcelModule,
|
|
490
|
+
MatStepperModule,
|
|
491
|
+
CdkStepperModule,
|
|
492
|
+
KendoGridViewModule] });
|
|
493
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomerFarmModule, decorators: [{
|
|
494
|
+
type: NgModule,
|
|
495
|
+
args: [{
|
|
496
|
+
declarations: [
|
|
497
|
+
CustomerFarmComponent
|
|
498
|
+
],
|
|
499
|
+
imports: [
|
|
500
|
+
MatIconModule,
|
|
501
|
+
MatInputModule,
|
|
502
|
+
MatToolbarModule,
|
|
503
|
+
ReactiveFormsModule,
|
|
504
|
+
FormsModule,
|
|
505
|
+
CommonModule,
|
|
506
|
+
GridModule,
|
|
507
|
+
ButtonsModule,
|
|
508
|
+
MatGridListModule,
|
|
509
|
+
MatFormFieldModule,
|
|
510
|
+
ReactiveFormsModule,
|
|
511
|
+
MatInputModule,
|
|
512
|
+
MatOptionModule,
|
|
513
|
+
MatSelectModule,
|
|
514
|
+
MatCheckboxModule,
|
|
515
|
+
SharedModule,
|
|
516
|
+
MatButtonModule,
|
|
517
|
+
MatDatepickerModule,
|
|
518
|
+
MatNativeDateModule,
|
|
519
|
+
ExcelModule,
|
|
520
|
+
MatStepperModule,
|
|
521
|
+
CdkStepperModule,
|
|
522
|
+
KendoGridViewModule
|
|
523
|
+
],
|
|
524
|
+
exports: [
|
|
525
|
+
CustomerFarmComponent
|
|
526
|
+
]
|
|
527
|
+
}]
|
|
528
|
+
}] });
|
|
529
|
+
|
|
530
|
+
/*
|
|
531
|
+
* Public API Surface of customer-farm
|
|
532
|
+
*/
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Generated bundle index. Do not edit.
|
|
536
|
+
*/
|
|
537
|
+
|
|
538
|
+
export { AllowedCustomerFarmFields, CustomerFarmApiUrls, CustomerFarmComponent, CustomerFarmConfigrationModel, CustomerFarmModel, CustomerFarmModule, CustomerFarmService, RequiredCustomerFarmFields };
|
|
539
|
+
//# sourceMappingURL=qubesense-customer-farm.mjs.map
|