@unnilouis.org/vs-chipdropdown 16.3.6 → 17.0.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.
@@ -3,11 +3,11 @@ import { Injectable, Component, EventEmitter, Input, ViewChild, Output, NgModule
3
3
  import * as i1 from '@angular/common/http';
4
4
  import { HttpClientModule, HttpClient } from '@angular/common/http';
5
5
  import * as i5 from '@angular/material/autocomplete';
6
- import { MatAutocompleteTrigger, MatAutocompleteModule } from '@angular/material/autocomplete';
7
- import { map, takeUntil, debounceTime, distinctUntilChanged, switchMap, finalize } from 'rxjs/operators';
6
+ import { MatAutocompleteTrigger, MatAutocomplete, MatAutocompleteModule } from '@angular/material/autocomplete';
7
+ import { map, takeUntil, debounceTime, distinctUntilChanged, tap, switchMap, finalize } from 'rxjs/operators';
8
8
  import { fromEvent } from 'rxjs';
9
9
  import * as i2 from '@angular/forms';
10
- import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
+ import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
11
11
  import { ENTER, COMMA } from '@angular/cdk/keycodes';
12
12
  import * as i3 from '@angular/material/form-field';
13
13
  import { MatFormFieldModule } from '@angular/material/form-field';
@@ -20,528 +20,372 @@ import * as i8 from '@angular/material/icon';
20
20
  import { MatIconModule } from '@angular/material/icon';
21
21
  import * as i9 from '@ngx-translate/core';
22
22
  import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
23
- import { TranslateHttpLoader } from '@ngx-translate/http-loader';
24
23
  import { MatInputModule } from '@angular/material/input';
25
24
  import { MatSelectModule } from '@angular/material/select';
26
25
  import { MatGridListModule } from '@angular/material/grid-list';
26
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
27
27
 
28
- class VsChipdropdownService {
29
- constructor(http) {
30
- this.http = http;
31
- }
32
- postApi(Apiurl, json = {}, params) {
33
- const getToken = localStorage.getItem("sessionData");
34
- let tokenValue = JSON.parse(getToken);
35
- let token = tokenValue.token;
36
- console.log("params", params);
37
- let paradata = '';
38
- if (params !== undefined && params !== null && params !== '') {
39
- paradata = params;
40
- }
41
- const headers = { Authorization: "Token " + token };
42
- return this.http.post(Apiurl + paradata, json, {
43
- headers: headers,
44
- });
45
- }
46
- GetApi(Apiurl, params = '') {
47
- const getToken = localStorage.getItem("sessionData");
48
- let tokenValue = JSON.parse(getToken);
49
- let token = tokenValue.token;
50
- console.log("params", params);
51
- let paradata = '';
52
- if (params !== undefined && params !== null && params !== '') {
53
- paradata = params;
54
- }
55
- const headers = { Authorization: "Token " + token };
56
- return this.http.get(Apiurl + paradata, {
57
- headers: headers,
58
- });
59
- }
60
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
61
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownService, providedIn: 'root' }); }
62
- }
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownService, decorators: [{
64
- type: Injectable,
65
- args: [{
66
- providedIn: 'root'
67
- }]
68
- }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
28
+ class VsChipdropdownService {
29
+ constructor(http) {
30
+ this.http = http;
31
+ }
32
+ postApi(Apiurl, json = {}, params) {
33
+ const getToken = localStorage.getItem("sessionData");
34
+ let tokenValue = JSON.parse(getToken);
35
+ let token = tokenValue.token;
36
+ console.log("params", params);
37
+ let paradata = '';
38
+ if (params !== undefined && params !== null && params !== '') {
39
+ paradata = params;
40
+ }
41
+ const headers = { Authorization: "Token " + token };
42
+ return this.http.post(Apiurl + paradata, json, {
43
+ headers: headers,
44
+ });
45
+ }
46
+ GetApi(Apiurl, params = '') {
47
+ const getToken = localStorage.getItem("sessionData");
48
+ let tokenValue = JSON.parse(getToken);
49
+ let token = tokenValue.token;
50
+ console.log("params", params);
51
+ let paradata = '';
52
+ if (params !== undefined && params !== null && params !== '') {
53
+ paradata = params;
54
+ }
55
+ const headers = { Authorization: "Token " + token };
56
+ return this.http.get(Apiurl + paradata, {
57
+ headers: headers,
58
+ });
59
+ }
60
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
61
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownService, providedIn: 'root' }); }
62
+ }
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownService, decorators: [{
64
+ type: Injectable,
65
+ args: [{
66
+ providedIn: 'root'
67
+ }]
68
+ }], ctorParameters: () => [{ type: i1.HttpClient }] });
69
69
 
70
- class VsChipdropdownComponent {
71
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
72
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: VsChipdropdownComponent, selector: "lib-vs-chipdropdown", ngImport: i0, template: `
70
+ class VsChipdropdownComponent {
71
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
72
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: VsChipdropdownComponent, selector: "lib-vs-chipdropdown", ngImport: i0, template: `
73
73
  <p>
74
74
  vs-chipdropdown works!
75
75
  </p>
76
- `, isInline: true }); }
77
- }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownComponent, decorators: [{
79
- type: Component,
76
+ `, isInline: true, styles: [""] }); }
77
+ }
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownComponent, decorators: [{
79
+ type: Component,
80
80
  args: [{ selector: 'lib-vs-chipdropdown', template: `
81
81
  <p>
82
82
  vs-chipdropdown works!
83
83
  </p>
84
- ` }]
84
+ ` }]
85
85
  }] });
86
86
 
87
- class VsChipddCmpComponent {
88
- constructor(service, fb) {
89
- this.service = service;
90
- this.fb = fb;
91
- this.Backendapi = true;
92
- this.dataEvent = new EventEmitter();
93
- this.separatorsKeysCodes = [ENTER, COMMA];
94
- this.has_next = false;
95
- this.currentpage = 1;
96
- this.Dropdowndata = [];
97
- this.has_previous = false;
98
- this.chipSelectedId = [];
99
- this.chipSelectedObj = [];
100
- this.isOptionSelected = false;
101
- this.Outputdata = [];
102
- this.formkeyarr = [];
103
- }
104
- ngOnInit() {
105
- // if (this.formGroup) {
106
- // this.DropdownForm = this.formGroup;
107
- // } else {
108
- // this.DropdownForm = this.fb.group({
109
- // value: '',
110
- // });
111
- // }
112
- // this.dupngonit();
113
- // if (this.InputFields?.defaultvalue) {
114
- // this.DropdownForm.get("value").patchValue(this.InputFields?.defaultvalue)
115
- // this.chipSelectedObj = this.InputFields?.defaultvalue
116
- // if (this.chipSelectedObj.length > 0) {
117
- // for (let foundemp of this.chipSelectedObj) {
118
- // if (this.InputFields?.Outputkey) {
119
- // this.chipSelectedId.push(foundemp[this.InputFields?.Outputkey])
120
- // }
121
- // else {
122
- // this.chipSelectedId.push(foundemp.id)
123
- // }
124
- // }
125
- // this.selected()
126
- // }
127
- // }
128
- // if (this.InputFields?.fronentdata) {
129
- // this.Dropdowndata = this.InputFields?.data
130
- // }
131
- // else {
132
- // this.getdropdown('')
133
- // }
134
- }
135
- looop() {
136
- for (let foundemp of this.chipSelectedObj) {
137
- if (!(foundemp instanceof Number)) {
138
- if (this.InputFields?.Outputkey) {
139
- this.chipSelectedId.push(foundemp[this.InputFields?.Outputkey]);
140
- }
141
- else {
142
- this.chipSelectedId.push(foundemp.id);
143
- }
144
- if (this.InputFields?.formkey) {
145
- this.formkeyarr.push(foundemp[this.InputFields?.formkey]);
146
- }
147
- }
148
- }
149
- }
150
- dupngonit() {
151
- if (this.formGroup) {
152
- this.DropdownForm = this.formGroup;
153
- if (!this.DropdownForm.contains(this.InputFields?.formcontrolname)) {
154
- this.DropdownForm.addControl(this.dynamciformcontrolparent(), new FormControl({ value: [], disabled: this.InputFields?.disabled }));
155
- }
156
- else {
157
- this.InputFields?.disabled ? this.DropdownForm.get('chipvalue').disable() : '';
158
- }
159
- }
160
- else {
161
- this.DropdownForm = this.fb.group({
162
- chipvalue: [], disabled: this.InputFields?.disabled
163
- });
164
- }
165
- console.log('this.DropdownForm', this.DropdownForm.value);
166
- // this.chipSelectedObj =
167
- // this.DropdownForm.get(this.dynamciformcontrolparent()).value &&
168
- // this.DropdownForm.get(this.dynamciformcontrolparent()).value.length !== 0
169
- // ? this.DropdownForm.get(this.dynamciformcontrolparent()).value
170
- // : [];
171
- // console.log('this.chipSelectedObj', this.chipSelectedObj);
172
- if (this.InputFields?.defaultvalue) {
173
- // this.DropdownForm.get(this.dynamciformcontrolparent()).patchValue(
174
- // this.InputFields?.formkey
175
- // ? this.InputFields?.defaultvalue[this.InputFields?.formkey]
176
- // : this.InputFields?.defaultvalue
177
- // );
178
- // this.DropdownForm.get(this.dynamciformcontrolparent()).patchValue(this.InputFields?.defaultvalue);
179
- this.chipSelectedObj = this.InputFields?.defaultvalue;
180
- this.chipSelectedId = [];
181
- this.formkeyarr = [];
182
- if (this.chipSelectedObj.length > 0) {
183
- this.looop();
184
- this.selected();
185
- }
186
- }
187
- if (this.DropdownForm.get(this.dynamciformcontrolparent()).value &&
188
- this.DropdownForm.get(this.dynamciformcontrolparent()).value.length !== 0) {
189
- this.chipSelectedObj = this.DropdownForm.get(this.dynamciformcontrolparent()).value;
190
- console.log('test', this.chipSelectedObj = this.DropdownForm.get(this.dynamciformcontrolparent()).value);
191
- this.chipSelectedId = [];
192
- this.formkeyarr = [];
193
- this.looop();
194
- this.selected();
195
- }
196
- if (this.InputFields?.fronentdata) {
197
- this.Dropdowndata = this.InputFields?.data;
198
- }
199
- this.dropdownsearch();
200
- // else {
201
- // this.getdropdown('')
202
- // }
203
- }
204
- ngOnChanges(changes) {
205
- if (changes.InputFields && changes.InputFields.currentValue) {
206
- console.log('Summary Log Changes');
207
- this.currentpage = 1;
208
- this.dupngonit();
209
- }
210
- if (changes.ResetForm && changes.ResetForm.currentValue) {
211
- console.log('hitted');
212
- // this.DropdownForm.reset();
213
- this.currentpage = 1;
214
- this.dupngonit();
215
- this.chipSelectedId = [];
216
- this.formkeyarr = [];
217
- this.chipSelectedObj = [];
218
- this.dataEvent.emit([]);
219
- }
220
- }
221
- // public displaydevelopclient(clt: any, key: string) {
222
- // return key[clt];
223
- // }
224
- autocompleteAppScroll() {
225
- if (!this.InputFields?.fronentdata) {
226
- setTimeout(() => {
227
- if (this.matAutocompleteApp &&
228
- this.autocompleteTrigger &&
229
- this.matAutocompleteApp.panel) {
230
- fromEvent(this.matAutocompleteApp.panel.nativeElement, 'scroll')
231
- .pipe(map((x) => this.matAutocompleteApp.panel.nativeElement.scrollTop), takeUntil(this.autocompleteTrigger.panelClosingActions))
232
- .subscribe((x) => {
233
- const scrollTop = this.matAutocompleteApp.panel.nativeElement.scrollTop;
234
- const scrollHeight = this.matAutocompleteApp.panel.nativeElement.scrollHeight;
235
- const elementHeight = this.matAutocompleteApp.panel.nativeElement.clientHeight;
236
- const atBottom = scrollHeight - 1 <= scrollTop + elementHeight;
237
- if (atBottom) {
238
- if (this.has_next === true) {
239
- let value = this.DropInput.nativeElement.value;
240
- let params = this.searchparams(value);
241
- this.currentpage = this.currentpage + 1;
242
- if (this.currentpage > 1) {
243
- this.service
244
- .GetApi(this.InputFields.url + '?page=' + this.currentpage, params)
245
- .subscribe((results) => {
246
- let datas = results['data'];
247
- let datapagination = results['pagination'];
248
- this.Dropdowndata = this.Dropdowndata.concat(datas);
249
- console.log('this.Dropdowndata', this.Dropdowndata);
250
- if (this.Dropdowndata.length >= 0) {
251
- this.has_next = datapagination.has_next;
252
- this.has_previous = datapagination.has_previous;
253
- this.currentpage = datapagination.index;
254
- }
255
- });
256
- }
257
- }
258
- }
259
- });
260
- }
261
- });
262
- }
263
- }
264
- dropdownsearch() {
265
- const controlName = this.dynamciformcontrolparent();
266
- const control = this.DropdownForm.get(controlName);
267
- if (control) {
268
- if (!this.InputFields?.fronentdata) {
269
- if (!this.InputFields?.url) {
270
- return false;
271
- }
272
- this.DropdownForm.get(this.dynamciformcontrolparent())
273
- .valueChanges.pipe(debounceTime(300), distinctUntilChanged(),
274
- // tap(() => {
275
- // this.DrodownLoading = true;
276
- // console.log('inside tap');
277
- // }),
278
- switchMap((value) => {
279
- if (this.isOptionSelected) {
280
- this.isOptionSelected = false;
281
- return [];
282
- }
283
- let params = this.searchparams(value);
284
- this.currentpage = 1;
285
- console.log("hiteeeedddddddddddddd>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
286
- return this.service
287
- .GetApi(this.InputFields.url + '?page=' + this.currentpage, params)
288
- .pipe(finalize(() => {
289
- this.DrodownLoading = false;
290
- }));
291
- }))
292
- .subscribe((results) => {
293
- this.dataEvent.emit('');
294
- let datas = results['data'];
295
- this.Dropdowndata = datas;
296
- });
297
- }
298
- else {
299
- // this.Dropdowndata = this.InputFields?.data
300
- this.DropdownForm.get(this.dynamciformcontrolparent()).valueChanges.subscribe((value) => {
301
- this.Dropdowndata = this.InputFields?.data.filter((item) => item[this.InputFields?.displaykey]
302
- ?.toLowerCase()
303
- .includes(value?.toLowerCase()));
304
- });
305
- }
306
- }
307
- // if (control && !this.InputFields?.fronentdata) {
308
- // this.DropdownForm.get(this.dynamciformcontrolparent())
309
- // .valueChanges.pipe(
310
- // debounceTime(200),
311
- // distinctUntilChanged(),
312
- // tap(() => {
313
- // this.DrodownLoading = true;
314
- // console.log('inside tap');
315
- // }),
316
- // switchMap((value) => {
317
- // let params = this.searchparams(value);
318
- // this.currentpage = 1;
319
- // return this.service
320
- // .GetApi(
321
- // this.InputFields.url + '?page=' + this.currentpage,
322
- // params
323
- // )
324
- // .pipe(
325
- // finalize(() => {
326
- // this.DrodownLoading = false;
327
- // })
328
- // );
329
- // })
330
- // )
331
- // .subscribe((results: any[]) => {
332
- // let datas = results['data'];
333
- // this.Dropdowndata = datas;
334
- // });
335
- // }
336
- }
337
- getdropdown(value) {
338
- this.currentpage = 1;
339
- if (this.InputFields.url) {
340
- let params = this.searchparams(value);
341
- this.service
342
- .GetApi(this.InputFields.url + '?page=' + this.currentpage, params)
343
- .subscribe((results) => {
344
- let datas = results['data'];
345
- let datapagination = results['pagination'];
346
- this.Dropdowndata = datas;
347
- setTimeout(() => {
348
- this.trigger.openPanel();
349
- }, 0);
350
- if (this.Dropdowndata.length >= 0) {
351
- this.has_next = datapagination.has_next;
352
- this.has_previous = datapagination.has_previous;
353
- this.currentpage = datapagination.index;
354
- }
355
- });
356
- }
357
- }
358
- dynamciformcontrolparent() {
359
- return this.InputFields?.formcontrolname && this.formGroup
360
- ? this.InputFields?.formcontrolname
361
- : 'chipvalue';
362
- }
363
- selected() {
364
- this.Outputdata = this.chipSelectedObj;
365
- if (this.InputFields?.Outputkey) {
366
- this.Outputdata = this.chipSelectedId;
367
- }
368
- if (this.formGroup && this.InputFields?.formcontrolname) {
369
- this.DropdownForm.get(this.dynamciformcontrolparent()).patchValue(this.formkeyarr);
370
- }
371
- console.log(this.formkeyarr);
372
- console.log('this.DropdownForm.get', this.DropdownForm.value);
373
- this.dataEvent.emit(this.Outputdata);
374
- // let data = this.DropdownForm.value.value
375
- // if (this.InputFields?.wholedata) {
376
- // this.dataEvent.emit(this.chipSelectedObj);
377
- // if (this.InputFields?.formgroup && this.InputFields?.formcontrolname) {
378
- // this.InputFields?.formgroup
379
- // .get(this.InputFields?.formcontrolname)
380
- // .patchValue(this.chipSelectedObj);
381
- // }
382
- // }
383
- // else {
384
- // if (this.InputFields?.Outputkey) {
385
- // this.dataEvent.emit(this.chipSelectedId);
386
- // if (this.InputFields?.formgroup && this.InputFields?.formcontrolname) {
387
- // this.InputFields?.formgroup
388
- // .get(this.InputFields?.formcontrolname)
389
- // .patchValue(this.chipSelectedId);
390
- // }
391
- // }
392
- // else {
393
- // this.dataEvent.emit(this.chipSelectedObj);
394
- // if (this.InputFields?.formgroup && this.InputFields?.formcontrolname) {
395
- // this.InputFields?.formgroup
396
- // .get(this.InputFields?.formcontrolname)
397
- // .patchValue(this.chipSelectedObj);
398
- // }
399
- // }
400
- // }
401
- }
402
- searchparams(value) {
403
- let params = '';
404
- if (this.InputFields.params) {
405
- params = this.InputFields.params;
406
- }
407
- let inpValue = value;
408
- inpValue
409
- ? (params += '&' + this.InputFields.searchkey + '=' + inpValue)
410
- : '';
411
- return params;
412
- }
413
- removechip(obj) {
414
- const index = this.chipSelectedObj.indexOf(obj);
415
- if (index >= 0) {
416
- this.chipSelectedObj.splice(index, 1);
417
- console.log(this.chipSelectedObj);
418
- this.chipSelectedId.splice(index, 1);
419
- console.log(this.chipSelectedId);
420
- this.formkeyarr.splice(index, 1);
421
- console.log('this.formkeyarr', this.formkeyarr);
422
- this.DropInput.nativeElement.value = '';
423
- this.selected();
424
- }
425
- }
426
- venSelected(datas) {
427
- let data = !datas && datas === '' ? datas : datas.option.value;
428
- this.isOptionSelected = true;
429
- this.DropInput.nativeElement.value = '';
430
- console.log('event.option.value', data);
431
- this.selectvenByName(data[this.comparekey(data)]);
432
- console.log('chipSelectedvenid', this.chipSelectedObj);
433
- }
434
- selectvenByName(ven) {
435
- let foundemp1 = this.chipSelectedObj.filter((e) => e[this.comparekey(e)] == ven);
436
- if (foundemp1.length) {
437
- return;
438
- }
439
- let foundemp = this.Dropdowndata.filter((e) => e[this.comparekey(e)] == ven);
440
- if (foundemp.length) {
441
- this.chipSelectedObj.push(foundemp[0]);
442
- if (this.InputFields?.Outputkey) {
443
- this.chipSelectedId.push(foundemp[0][this.InputFields?.Outputkey]);
444
- }
445
- else {
446
- this.chipSelectedId.push(foundemp[0].id);
447
- }
448
- if (this.InputFields?.formkey) {
449
- this.formkeyarr.push(foundemp[0][this.InputFields?.formkey]);
450
- }
451
- this.selected();
452
- }
453
- }
454
- comparekey(e) {
455
- if (this.InputFields?.comparekey) {
456
- return this.InputFields?.comparekey;
457
- }
458
- else {
459
- if (e?.id) {
460
- return 'id';
461
- }
462
- else {
463
- return this.InputFields.displaykey;
464
- }
465
- }
466
- }
467
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipddCmpComponent, deps: [{ token: VsChipdropdownService }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
468
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: VsChipddCmpComponent, selector: "lib-vs-chipdd-cmp", inputs: { InputFields: "InputFields", ResetForm: "ResetForm", Backendapi: "Backendapi", formGroup: "formGroup" }, outputs: { dataEvent: "dataEvent" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["autoCompleteInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }, { propertyName: "matAutocompleteApp", first: true, predicate: ["scrolll"], descendants: true }, { propertyName: "DropInput", first: true, predicate: ["DropInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\r\n <form [formGroup]=\"DropdownForm\" id=\"matChip-size\">\r\n <!-- class=\"mat-chipScroll\" -->\r\n <mat-form-field\r\n appearance=\"outline\"\r\n (click)=\"!this.InputFields?.fronentdata ? this.getdropdown('') : ''\"\r\n >\r\n <mat-label>{{ InputFields?.label | translate }}</mat-label>\r\n <!-- class=\"chip-container\" -->\r\n <mat-chip-grid multiple #chipListvendor>\r\n <!-- class=\"mat-chipEx\" -->\r\n <mat-chip-row\r\n *ngFor=\"let obj of chipSelectedObj\"\r\n [removable]=\"true\"\r\n (removed)=\"removechip(obj)\"\r\n >\r\n {{ obj[InputFields?.displaykey] }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-row>\r\n <!-- class=\"matformfieldinputstyle\" -->\r\n <input\r\n #DropInput\r\n [matAutocomplete]=\"scrolll\"\r\n [matChipInputFor]=\"chipListvendor\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorsKeysCodes\"\r\n [matChipInputAddOnBlur]=\"true\"\r\n #autoCompleteInput=\"matAutocompleteTrigger\"\r\n [formControlName]=\"this.dynamciformcontrolparent()\"\r\n />\r\n </mat-chip-grid>\r\n <mat-autocomplete\r\n #scrolll=\"matAutocomplete\"\r\n (opened)=\"autocompleteAppScroll()\"\r\n (optionSelected)=\"venSelected($event)\"\r\n >\r\n <ng-container>\r\n <mat-option\r\n *ngFor=\"let dropvalues of Dropdowndata\"\r\n [value]=\"\r\n this.InputFields?.formkey\r\n ? dropvalues[this.InputFields?.formkey]\r\n : dropvalues\r\n \"\r\n >\r\n {{ dropvalues[InputFields?.displaykey] }}\r\n </mat-option>\r\n </ng-container>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </form>\r\n</div>\r\n<!-- (click)=\"selected()\"\r\n -->\r\n<!-- (optionSelected)=\"venSelected($event)\"\r\n -->\r\n<!-- (onSelectionChange)=\"venSelected(dropvalues)\"\r\n -->", styles: [""], dependencies: [{ kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { 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.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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i7.MatChipGrid, selector: "mat-chip-grid", inputs: ["tabIndex", "disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i7.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "editable"], outputs: ["edited"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }] }); }
469
- }
470
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipddCmpComponent, decorators: [{
471
- type: Component,
472
- args: [{ selector: 'lib-vs-chipdd-cmp', template: "<div>\r\n <form [formGroup]=\"DropdownForm\" id=\"matChip-size\">\r\n <!-- class=\"mat-chipScroll\" -->\r\n <mat-form-field\r\n appearance=\"outline\"\r\n (click)=\"!this.InputFields?.fronentdata ? this.getdropdown('') : ''\"\r\n >\r\n <mat-label>{{ InputFields?.label | translate }}</mat-label>\r\n <!-- class=\"chip-container\" -->\r\n <mat-chip-grid multiple #chipListvendor>\r\n <!-- class=\"mat-chipEx\" -->\r\n <mat-chip-row\r\n *ngFor=\"let obj of chipSelectedObj\"\r\n [removable]=\"true\"\r\n (removed)=\"removechip(obj)\"\r\n >\r\n {{ obj[InputFields?.displaykey] }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-row>\r\n <!-- class=\"matformfieldinputstyle\" -->\r\n <input\r\n #DropInput\r\n [matAutocomplete]=\"scrolll\"\r\n [matChipInputFor]=\"chipListvendor\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorsKeysCodes\"\r\n [matChipInputAddOnBlur]=\"true\"\r\n #autoCompleteInput=\"matAutocompleteTrigger\"\r\n [formControlName]=\"this.dynamciformcontrolparent()\"\r\n />\r\n </mat-chip-grid>\r\n <mat-autocomplete\r\n #scrolll=\"matAutocomplete\"\r\n (opened)=\"autocompleteAppScroll()\"\r\n (optionSelected)=\"venSelected($event)\"\r\n >\r\n <ng-container>\r\n <mat-option\r\n *ngFor=\"let dropvalues of Dropdowndata\"\r\n [value]=\"\r\n this.InputFields?.formkey\r\n ? dropvalues[this.InputFields?.formkey]\r\n : dropvalues\r\n \"\r\n >\r\n {{ dropvalues[InputFields?.displaykey] }}\r\n </mat-option>\r\n </ng-container>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </form>\r\n</div>\r\n<!-- (click)=\"selected()\"\r\n -->\r\n<!-- (optionSelected)=\"venSelected($event)\"\r\n -->\r\n<!-- (onSelectionChange)=\"venSelected(dropvalues)\"\r\n -->" }]
473
- }], ctorParameters: function () { return [{ type: VsChipdropdownService }, { type: i2.FormBuilder }]; }, propDecorators: { InputFields: [{
474
- type: Input
475
- }], ResetForm: [{
476
- type: Input
477
- }], Backendapi: [{
478
- type: Input
479
- }], trigger: [{
480
- type: ViewChild,
481
- args: ['autoCompleteInput', {
482
- static: false,
483
- read: MatAutocompleteTrigger,
484
- }]
485
- }], autocompleteTrigger: [{
486
- type: ViewChild,
487
- args: [MatAutocompleteTrigger]
488
- }], matAutocompleteApp: [{
489
- type: ViewChild,
490
- args: ['scrolll']
491
- }], dataEvent: [{
492
- type: Output
493
- }], DropInput: [{
494
- type: ViewChild,
495
- args: ['DropInput']
496
- }], formGroup: [{
497
- type: Input
87
+ class VsChipddCmpComponent {
88
+ constructor(service, fb) {
89
+ this.service = service;
90
+ this.fb = fb;
91
+ this.DrodownLoading = false;
92
+ this.Backendapi = true;
93
+ this.autocompleteTrigger = MatAutocompleteTrigger;
94
+ this.matAutocompleteApp = MatAutocomplete;
95
+ this.dataEvent = new EventEmitter();
96
+ this.separatorsKeysCodes = [ENTER, COMMA];
97
+ this.has_next = false;
98
+ this.currentpage = 1;
99
+ this.Dropdowndata = [];
100
+ this.has_previous = false;
101
+ this.DropdownForm = FormGroup;
102
+ this.chipSelectedId = [];
103
+ this.chipSelectedObj = [];
104
+ }
105
+ ngOnInit() {
106
+ this.DropdownForm = this.fb.group({
107
+ value: ''
108
+ });
109
+ // if (this.InputFields?.defaultvalue) {
110
+ // this.DropdownForm.get("value").patchValue(this.InputFields?.defaultvalue)
111
+ // this.chipSelectedObj = this.InputFields?.defaultvalue
112
+ // if (this.chipSelectedObj.length > 0) {
113
+ // for (let foundemp of this.chipSelectedObj) {
114
+ // if (this.InputFields?.Outputkey) {
115
+ // this.chipSelectedId.push(foundemp[this.InputFields?.Outputkey])
116
+ // }
117
+ // else {
118
+ // this.chipSelectedId.push(foundemp.id)
119
+ // }
120
+ // }
121
+ // this.selected()
122
+ // }
123
+ // }
124
+ // if (this.InputFields?.fronentdata) {
125
+ // this.Dropdowndata = this.InputFields?.data
126
+ // }
127
+ // else {
128
+ // this.getdropdown('')
129
+ // }
130
+ }
131
+ dupngonit() {
132
+ this.DropdownForm = this.fb.group({
133
+ value: ''
134
+ });
135
+ if (this.InputFields?.defaultvalue) {
136
+ this.DropdownForm.get("value").patchValue(this.InputFields?.defaultvalue);
137
+ this.chipSelectedObj = this.InputFields?.defaultvalue;
138
+ if (this.chipSelectedObj.length > 0) {
139
+ for (let foundemp of this.chipSelectedObj) {
140
+ if (this.InputFields?.Outputkey) {
141
+ this.chipSelectedId.push(foundemp[this.InputFields?.Outputkey]);
142
+ }
143
+ else {
144
+ this.chipSelectedId.push(foundemp.id);
145
+ }
146
+ }
147
+ this.selected();
148
+ }
149
+ }
150
+ if (this.InputFields?.fronentdata) {
151
+ this.Dropdowndata = this.InputFields?.data;
152
+ }
153
+ else {
154
+ this.getdropdown('');
155
+ }
156
+ }
157
+ ngOnChanges(changes) {
158
+ if (changes['InputFields'] && changes['InputFields'].currentValue) {
159
+ console.log("Summary Log Changes");
160
+ this.currentpage = 1;
161
+ this.dupngonit();
162
+ }
163
+ if (changes['ResetForm'] && changes['ResetForm'].currentValue) {
164
+ console.log("hitted");
165
+ this.DropdownForm.reset();
166
+ this.currentpage = 1;
167
+ this.dupngonit();
168
+ this.chipSelectedId = [];
169
+ this.chipSelectedObj = [];
170
+ this.dataEvent.emit([]);
171
+ }
172
+ }
173
+ // public displaydevelopclient(clt: any, key: string) {
174
+ // return key[clt];
175
+ // }
176
+ autocompleteAppScroll() {
177
+ if (!(this.InputFields?.fronentdata)) {
178
+ setTimeout(() => {
179
+ if (this.matAutocompleteApp &&
180
+ this.autocompleteTrigger &&
181
+ this.matAutocompleteApp.panel) {
182
+ fromEvent(this.matAutocompleteApp.panel.nativeElement, 'scroll')
183
+ .pipe(map(x => this.matAutocompleteApp.panel.nativeElement.scrollTop), takeUntil(this.autocompleteTrigger.panelClosingActions))
184
+ .subscribe(x => {
185
+ const scrollTop = this.matAutocompleteApp.panel.nativeElement.scrollTop;
186
+ const scrollHeight = this.matAutocompleteApp.panel.nativeElement.scrollHeight;
187
+ const elementHeight = this.matAutocompleteApp.panel.nativeElement.clientHeight;
188
+ const atBottom = scrollHeight - 1 <= scrollTop + elementHeight;
189
+ if (atBottom) {
190
+ if (this.has_next === true) {
191
+ let value = this.DropInput.nativeElement.value;
192
+ let params = this.searchparams(value);
193
+ this.currentpage = this.currentpage + 1;
194
+ if (this.currentpage > 1) {
195
+ this.service.GetApi(this.InputFields.url + "?page=" + this.currentpage, params)
196
+ .subscribe((results) => {
197
+ let datas = results["data"];
198
+ let datapagination = results["pagination"];
199
+ this.Dropdowndata = this.Dropdowndata.concat(datas);
200
+ console.log("this.Dropdowndata", this.Dropdowndata);
201
+ if (this.Dropdowndata.length >= 0) {
202
+ this.has_next = datapagination.has_next;
203
+ this.has_previous = datapagination.has_previous;
204
+ this.currentpage = datapagination.index;
205
+ }
206
+ });
207
+ }
208
+ }
209
+ }
210
+ });
211
+ }
212
+ });
213
+ }
214
+ }
215
+ dropdownsearch() {
216
+ if (!(this.InputFields?.fronentdata)) {
217
+ this.DropdownForm.get("value").valueChanges.pipe(debounceTime(100), distinctUntilChanged(), tap(() => {
218
+ this.DrodownLoading = true;
219
+ console.log("inside tap");
220
+ }), switchMap((value) => {
221
+ let params = this.searchparams(value);
222
+ this.currentpage = 1;
223
+ return this.service.GetApi(this.InputFields.url + "?page=" + this.currentpage, params).pipe(finalize(() => {
224
+ this.DrodownLoading = false;
225
+ }));
226
+ })).subscribe((results) => {
227
+ let datas = results["data"];
228
+ this.Dropdowndata = datas;
229
+ });
230
+ }
231
+ }
232
+ getdropdown(value) {
233
+ if (this.InputFields.url) {
234
+ let params = this.searchparams(value);
235
+ this.service.GetApi(this.InputFields.url + "?page=" + this.currentpage, params)
236
+ .subscribe((results) => {
237
+ let datas = results["data"];
238
+ let datapagination = results["pagination"];
239
+ this.Dropdowndata = datas;
240
+ if (this.Dropdowndata.length >= 0) {
241
+ this.has_next = datapagination.has_next;
242
+ this.has_previous = datapagination.has_previous;
243
+ this.currentpage = datapagination.index;
244
+ }
245
+ });
246
+ }
247
+ }
248
+ selected() {
249
+ // let data = this.DropdownForm.value.value
250
+ if (this.InputFields?.wholedata) {
251
+ this.dataEvent.emit(this.chipSelectedObj);
252
+ }
253
+ else {
254
+ if (this.InputFields?.Outputkey) {
255
+ this.dataEvent.emit(this.chipSelectedId);
256
+ }
257
+ else {
258
+ this.dataEvent.emit(this.chipSelectedObj);
259
+ }
260
+ }
261
+ }
262
+ searchparams(value) {
263
+ let params = '';
264
+ if (this.InputFields.params) {
265
+ params = this.InputFields.params;
266
+ }
267
+ let inpValue = value;
268
+ inpValue ? params += '&' + this.InputFields.searchkey + '=' + inpValue : '';
269
+ return params;
270
+ }
271
+ removechip(obj) {
272
+ const index = this.chipSelectedObj.indexOf(obj);
273
+ if (index >= 0) {
274
+ this.chipSelectedObj.splice(index, 1);
275
+ console.log(this.chipSelectedObj);
276
+ this.chipSelectedId.splice(index, 1);
277
+ console.log(this.chipSelectedId);
278
+ this.DropInput.nativeElement.value = '';
279
+ this.selected();
280
+ }
281
+ }
282
+ venSelected(event) {
283
+ this.DropInput.nativeElement.value = '';
284
+ console.log('event.option.value', event.option.value);
285
+ this.selectvenByName(event.option.value[this.comparekey(event.option.value)]);
286
+ console.log('chipSelectedvenid', this.chipSelectedObj);
287
+ }
288
+ selectvenByName(ven) {
289
+ let foundemp1 = this.chipSelectedObj.filter((e) => e[this.comparekey(e)] == ven);
290
+ if (foundemp1.length) {
291
+ return;
292
+ }
293
+ let foundemp = this.Dropdowndata.filter((e) => e[this.comparekey(e)] == ven);
294
+ if (foundemp.length) {
295
+ this.chipSelectedObj.push(foundemp[0]);
296
+ if (this.InputFields?.Outputkey) {
297
+ this.chipSelectedId.push(foundemp[0][this.InputFields?.Outputkey]);
298
+ }
299
+ else {
300
+ this.chipSelectedId.push(foundemp[0].id);
301
+ }
302
+ }
303
+ }
304
+ comparekey(e) {
305
+ if (this.InputFields?.comparekey) {
306
+ return this.InputFields?.comparekey;
307
+ }
308
+ else {
309
+ if (e?.id) {
310
+ return "id";
311
+ }
312
+ else {
313
+ return this.InputFields.displaykey;
314
+ }
315
+ }
316
+ }
317
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipddCmpComponent, deps: [{ token: VsChipdropdownService }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
318
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: VsChipddCmpComponent, selector: "lib-vs-chipdd-cmp", inputs: { InputFields: "InputFields", ResetForm: "ResetForm", Backendapi: "Backendapi" }, outputs: { dataEvent: "dataEvent" }, viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }, { propertyName: "matAutocompleteApp", first: true, predicate: ["scrolll"], descendants: true }, { propertyName: "DropInput", first: true, predicate: ["DropInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\r\n <form [formGroup]=\"DropdownForm\">\r\n <mat-form-field class=\"mat-chipScroll\"\r\n appearance=\"outline\">\r\n <mat-label>{{InputFields?.label | translate}}</mat-label>\r\n <mat-chip-grid multiple #chipListvendor class=\"chip-container\">\r\n <mat-chip-row *ngFor=\"let obj of chipSelectedObj\" [removable]=\"true\" (removed)=\"removechip(obj)\" class=\"mat-chipEx\">\r\n {{ obj[InputFields?.displaykey] }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-row>\r\n <input #DropInput [matAutocomplete]=\"scrolll\" class=\"matformfieldinputstyle\"\r\n (keydown)=\"dropdownsearch()\" [matChipInputFor]=\"chipListvendor\" [matChipInputSeparatorKeyCodes]=\"\r\n separatorsKeysCodes\r\n \" [matChipInputAddOnBlur]=\"true\" formControlName=\"value\" />\r\n </mat-chip-grid>\r\n <mat-autocomplete #scrolll=\"matAutocomplete\" (optionSelected)=\"venSelected($event)\"\r\n (opened)=\"autocompleteAppScroll()\">\r\n <ng-container>\r\n <mat-option *ngFor=\"let dropvalues of Dropdowndata\" [value]=\"dropvalues\" (click)=\"selected()\">\r\n {{dropvalues[InputFields?.displaykey]}}\r\n </mat-option>\r\n </ng-container>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </form>\r\n</div>\r\n", styles: [".mat-chipScroll{width:420px!important}.mat-chipEx{text-align:left}.chip-container::-webkit-scrollbar{width:6px;height:6px}.chip-container::-webkit-scrollbar-track{background:transparent}.chip-container::-webkit-scrollbar-thumb{border-radius:20px;background:#c3c3c3}.chip-container::-webkit-scrollbar-thumb:hover{background:#a6a6a6}.mat-chipScroll .mat-chip-list-wrapper{height:80px;overflow-y:scroll}mat-form-field{width:250px;font-family:var(--base-font-family)}\n"], dependencies: [{ kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { 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.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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i7.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i7.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }] }); }
319
+ }
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipddCmpComponent, decorators: [{
321
+ type: Component,
322
+ args: [{ selector: 'lib-vs-chipdd-cmp', template: "<div>\r\n <form [formGroup]=\"DropdownForm\">\r\n <mat-form-field class=\"mat-chipScroll\"\r\n appearance=\"outline\">\r\n <mat-label>{{InputFields?.label | translate}}</mat-label>\r\n <mat-chip-grid multiple #chipListvendor class=\"chip-container\">\r\n <mat-chip-row *ngFor=\"let obj of chipSelectedObj\" [removable]=\"true\" (removed)=\"removechip(obj)\" class=\"mat-chipEx\">\r\n {{ obj[InputFields?.displaykey] }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-row>\r\n <input #DropInput [matAutocomplete]=\"scrolll\" class=\"matformfieldinputstyle\"\r\n (keydown)=\"dropdownsearch()\" [matChipInputFor]=\"chipListvendor\" [matChipInputSeparatorKeyCodes]=\"\r\n separatorsKeysCodes\r\n \" [matChipInputAddOnBlur]=\"true\" formControlName=\"value\" />\r\n </mat-chip-grid>\r\n <mat-autocomplete #scrolll=\"matAutocomplete\" (optionSelected)=\"venSelected($event)\"\r\n (opened)=\"autocompleteAppScroll()\">\r\n <ng-container>\r\n <mat-option *ngFor=\"let dropvalues of Dropdowndata\" [value]=\"dropvalues\" (click)=\"selected()\">\r\n {{dropvalues[InputFields?.displaykey]}}\r\n </mat-option>\r\n </ng-container>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </form>\r\n</div>\r\n", styles: [".mat-chipScroll{width:420px!important}.mat-chipEx{text-align:left}.chip-container::-webkit-scrollbar{width:6px;height:6px}.chip-container::-webkit-scrollbar-track{background:transparent}.chip-container::-webkit-scrollbar-thumb{border-radius:20px;background:#c3c3c3}.chip-container::-webkit-scrollbar-thumb:hover{background:#a6a6a6}.mat-chipScroll .mat-chip-list-wrapper{height:80px;overflow-y:scroll}mat-form-field{width:250px;font-family:var(--base-font-family)}\n"] }]
323
+ }], ctorParameters: () => [{ type: VsChipdropdownService }, { type: i2.FormBuilder }], propDecorators: { InputFields: [{
324
+ type: Input
325
+ }], ResetForm: [{
326
+ type: Input
327
+ }], Backendapi: [{
328
+ type: Input
329
+ }], autocompleteTrigger: [{
330
+ type: ViewChild,
331
+ args: [MatAutocompleteTrigger]
332
+ }], matAutocompleteApp: [{
333
+ type: ViewChild,
334
+ args: ['scrolll']
335
+ }], dataEvent: [{
336
+ type: Output
337
+ }], DropInput: [{
338
+ type: ViewChild,
339
+ args: ['DropInput']
498
340
  }] } });
499
341
 
500
- // import {VsSharedModuleModule} from '@unnilouis.org/vs-shared-module'
501
- class VsChipdropdownModule {
502
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
503
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownModule, declarations: [VsChipdropdownComponent, VsChipddCmpComponent], imports: [MatFormFieldModule, MatInputModule, MatSelectModule, MatAutocompleteModule, FormsModule, ReactiveFormsModule, CommonModule, MatGridListModule, MatChipsModule, MatIconModule,
504
- TranslateModule,
505
- HttpClientModule, i9.TranslateModule], exports: [VsChipddCmpComponent] }); }
506
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownModule, imports: [MatFormFieldModule, MatInputModule, MatSelectModule, MatAutocompleteModule, FormsModule, ReactiveFormsModule, CommonModule, MatGridListModule, MatChipsModule, MatIconModule,
507
- TranslateModule,
508
- HttpClientModule,
509
- TranslateModule.forRoot({
510
- loader: {
511
- provide: TranslateLoader,
512
- useFactory: httpTranslateLoader,
513
- deps: [HttpClient],
514
- },
515
- })] }); }
516
- }
517
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: VsChipdropdownModule, decorators: [{
518
- type: NgModule,
519
- args: [{
520
- declarations: [VsChipdropdownComponent, VsChipddCmpComponent],
521
- imports: [MatFormFieldModule, MatInputModule, MatSelectModule, MatAutocompleteModule, FormsModule, ReactiveFormsModule, CommonModule, MatGridListModule, MatChipsModule, MatIconModule,
522
- TranslateModule,
523
- HttpClientModule,
524
- TranslateModule.forRoot({
525
- loader: {
526
- provide: TranslateLoader,
527
- useFactory: httpTranslateLoader,
528
- deps: [HttpClient],
529
- },
530
- }),],
531
- // imports: [VsSharedModuleModule],
532
- exports: [VsChipddCmpComponent]
533
- }]
534
- }] });
535
- function httpTranslateLoader(http) {
536
- return new TranslateHttpLoader(http);
342
+ class VsChipdropdownModule {
343
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
344
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownModule, declarations: [VsChipdropdownComponent,
345
+ VsChipddCmpComponent], imports: [MatFormFieldModule, MatInputModule, MatSelectModule, MatAutocompleteModule, FormsModule, ReactiveFormsModule, CommonModule, MatGridListModule, MatChipsModule, MatIconModule,
346
+ HttpClientModule, i9.TranslateModule], exports: [VsChipddCmpComponent] }); }
347
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownModule, imports: [MatFormFieldModule, MatInputModule, MatSelectModule, MatAutocompleteModule, FormsModule, ReactiveFormsModule, CommonModule, MatGridListModule, MatChipsModule, MatIconModule,
348
+ HttpClientModule,
349
+ TranslateModule.forRoot({
350
+ loader: {
351
+ provide: TranslateLoader,
352
+ useFactory: httpTranslateLoader,
353
+ deps: [HttpClient],
354
+ },
355
+ })] }); }
356
+ }
357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: VsChipdropdownModule, decorators: [{
358
+ type: NgModule,
359
+ args: [{
360
+ declarations: [
361
+ VsChipdropdownComponent,
362
+ VsChipddCmpComponent
363
+ ],
364
+ imports: [MatFormFieldModule, MatInputModule, MatSelectModule, MatAutocompleteModule, FormsModule, ReactiveFormsModule, CommonModule, MatGridListModule, MatChipsModule, MatIconModule,
365
+ HttpClientModule,
366
+ TranslateModule.forRoot({
367
+ loader: {
368
+ provide: TranslateLoader,
369
+ useFactory: httpTranslateLoader,
370
+ deps: [HttpClient],
371
+ },
372
+ }),
373
+ ],
374
+ exports: [
375
+ VsChipddCmpComponent
376
+ ]
377
+ }]
378
+ }] });
379
+ function httpTranslateLoader(http) {
380
+ return new TranslateHttpLoader(http);
537
381
  }
538
382
 
539
- /*
540
- * Public API Surface of vs-chipdropdown
383
+ /*
384
+ * Public API Surface of vs-chipdropdown
541
385
  */
542
386
 
543
- /**
544
- * Generated bundle index. Do not edit.
387
+ /**
388
+ * Generated bundle index. Do not edit.
545
389
  */
546
390
 
547
391
  export { VsChipddCmpComponent, VsChipdropdownComponent, VsChipdropdownModule, VsChipdropdownService, httpTranslateLoader };