@unnilouis.org/vs-chipdropdown 0.0.29-beta-16 → 0.0.29-beta-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +2 -2
  2. package/bundles/unnilouis.org-vs-chipdropdown.umd.js +600 -0
  3. package/bundles/unnilouis.org-vs-chipdropdown.umd.js.map +1 -0
  4. package/bundles/unnilouis.org-vs-chipdropdown.umd.min.js +16 -0
  5. package/bundles/unnilouis.org-vs-chipdropdown.umd.min.js.map +1 -0
  6. package/esm2015/lib/vs-chipdd-cmp/vs-chipdd-cmp.component.js +273 -0
  7. package/esm2015/lib/vs-chipdropdown.component.js +19 -0
  8. package/esm2015/lib/vs-chipdropdown.module.js +39 -0
  9. package/esm2015/lib/vs-chipdropdown.service.js +49 -0
  10. package/esm2015/public-api.js +8 -0
  11. package/esm2015/unnilouis.org-vs-chipdropdown.js +5 -0
  12. package/esm5/lib/vs-chipdd-cmp/vs-chipdd-cmp.component.js +289 -0
  13. package/esm5/lib/vs-chipdropdown.component.js +17 -0
  14. package/esm5/lib/vs-chipdropdown.module.js +42 -0
  15. package/esm5/lib/vs-chipdropdown.service.js +52 -0
  16. package/esm5/public-api.js +8 -0
  17. package/esm5/unnilouis.org-vs-chipdropdown.js +5 -0
  18. package/fesm2015/unnilouis.org-vs-chipdropdown.js +373 -0
  19. package/fesm2015/unnilouis.org-vs-chipdropdown.js.map +1 -0
  20. package/fesm5/unnilouis.org-vs-chipdropdown.js +393 -0
  21. package/fesm5/unnilouis.org-vs-chipdropdown.js.map +1 -0
  22. package/lib/vs-chipdd-cmp/vs-chipdd-cmp.component.d.ts +0 -3
  23. package/lib/vs-chipdropdown.component.d.ts +4 -4
  24. package/lib/vs-chipdropdown.module.d.ts +0 -17
  25. package/lib/vs-chipdropdown.service.d.ts +0 -3
  26. package/package.json +15 -19
  27. package/{index.d.ts → unnilouis.org-vs-chipdropdown.d.ts} +0 -1
  28. package/unnilouis.org-vs-chipdropdown.metadata.json +1 -0
  29. package/esm2022/lib/vs-chipdd-cmp/vs-chipdd-cmp.component.mjs +0 -243
  30. package/esm2022/lib/vs-chipdropdown.component.mjs +0 -19
  31. package/esm2022/lib/vs-chipdropdown.module.mjs +0 -61
  32. package/esm2022/lib/vs-chipdropdown.service.mjs +0 -45
  33. package/esm2022/public-api.mjs +0 -8
  34. package/esm2022/unnilouis.org-vs-chipdropdown.mjs +0 -5
  35. package/fesm2022/unnilouis.org-vs-chipdropdown.mjs +0 -368
  36. package/fesm2022/unnilouis.org-vs-chipdropdown.mjs.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # VsChipdropdown
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.2.0.
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.13.
4
4
 
5
5
  ## Code scaffolding
6
6
 
@@ -21,4 +21,4 @@ Run `ng test vs-chipdropdown` to execute the unit tests via [Karma](https://karm
21
21
 
22
22
  ## Further help
23
23
 
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
@@ -0,0 +1,600 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@angular/material/autocomplete'), require('rxjs/operators'), require('rxjs'), require('@angular/forms'), require('@angular/cdk/keycodes'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/select'), require('@angular/common'), require('@angular/material/grid-list'), require('@angular/material/chips'), require('@angular/material/icon'), require('@ngx-translate/core'), require('@ngx-translate/http-loader')) :
3
+ typeof define === 'function' && define.amd ? define('@unnilouis.org/vs-chipdropdown', ['exports', '@angular/core', '@angular/common/http', '@angular/material/autocomplete', 'rxjs/operators', 'rxjs', '@angular/forms', '@angular/cdk/keycodes', '@angular/material/form-field', '@angular/material/input', '@angular/material/select', '@angular/common', '@angular/material/grid-list', '@angular/material/chips', '@angular/material/icon', '@ngx-translate/core', '@ngx-translate/http-loader'], factory) :
4
+ (global = global || self, factory((global.unnilouis = global.unnilouis || {}, global.unnilouis.org = global.unnilouis.org || {}, global.unnilouis.org['vs-chipdropdown'] = {}), global.ng.core, global.ng.common.http, global.ng.material.autocomplete, global.rxjs.operators, global.rxjs, global.ng.forms, global.ng.cdk.keycodes, global.ng.material.formField, global.ng.material.input, global.ng.material.select, global.ng.common, global.ng.material.gridList, global.ng.material.chips, global.ng.material.icon, global.core$1, global.httpLoader));
5
+ }(this, (function (exports, core, http, autocomplete, operators, rxjs, forms, keycodes, formField, input, select, common, gridList, chips, icon, core$1, httpLoader) { 'use strict';
6
+
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+
23
+ var extendStatics = function(d, b) {
24
+ extendStatics = Object.setPrototypeOf ||
25
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
+ return extendStatics(d, b);
28
+ };
29
+
30
+ function __extends(d, b) {
31
+ extendStatics(d, b);
32
+ function __() { this.constructor = d; }
33
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
+ }
35
+
36
+ var __assign = function() {
37
+ __assign = Object.assign || function __assign(t) {
38
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
39
+ s = arguments[i];
40
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
+ }
42
+ return t;
43
+ };
44
+ return __assign.apply(this, arguments);
45
+ };
46
+
47
+ function __rest(s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ }
58
+
59
+ function __decorate(decorators, target, key, desc) {
60
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
64
+ }
65
+
66
+ function __param(paramIndex, decorator) {
67
+ return function (target, key) { decorator(target, key, paramIndex); }
68
+ }
69
+
70
+ function __metadata(metadataKey, metadataValue) {
71
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
+ }
73
+
74
+ function __awaiter(thisArg, _arguments, P, generator) {
75
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
+ return new (P || (P = Promise))(function (resolve, reject) {
77
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
81
+ });
82
+ }
83
+
84
+ function __generator(thisArg, body) {
85
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
+ function verb(n) { return function (v) { return step([n, v]); }; }
88
+ function step(op) {
89
+ if (f) throw new TypeError("Generator is already executing.");
90
+ while (_) try {
91
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
+ if (y = 0, t) op = [op[0] & 2, t.value];
93
+ switch (op[0]) {
94
+ case 0: case 1: t = op; break;
95
+ case 4: _.label++; return { value: op[1], done: false };
96
+ case 5: _.label++; y = op[1]; op = [0]; continue;
97
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
+ default:
99
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
+ if (t[2]) _.ops.pop();
104
+ _.trys.pop(); continue;
105
+ }
106
+ op = body.call(thisArg, _);
107
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
+ }
110
+ }
111
+
112
+ function __createBinding(o, m, k, k2) {
113
+ if (k2 === undefined) k2 = k;
114
+ o[k2] = m[k];
115
+ }
116
+
117
+ function __exportStar(m, exports) {
118
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
119
+ }
120
+
121
+ function __values(o) {
122
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
123
+ if (m) return m.call(o);
124
+ if (o && typeof o.length === "number") return {
125
+ next: function () {
126
+ if (o && i >= o.length) o = void 0;
127
+ return { value: o && o[i++], done: !o };
128
+ }
129
+ };
130
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
131
+ }
132
+
133
+ function __read(o, n) {
134
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
135
+ if (!m) return o;
136
+ var i = m.call(o), r, ar = [], e;
137
+ try {
138
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
139
+ }
140
+ catch (error) { e = { error: error }; }
141
+ finally {
142
+ try {
143
+ if (r && !r.done && (m = i["return"])) m.call(i);
144
+ }
145
+ finally { if (e) throw e.error; }
146
+ }
147
+ return ar;
148
+ }
149
+
150
+ function __spread() {
151
+ for (var ar = [], i = 0; i < arguments.length; i++)
152
+ ar = ar.concat(__read(arguments[i]));
153
+ return ar;
154
+ }
155
+
156
+ function __spreadArrays() {
157
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
158
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
159
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
160
+ r[k] = a[j];
161
+ return r;
162
+ };
163
+
164
+ function __await(v) {
165
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
166
+ }
167
+
168
+ function __asyncGenerator(thisArg, _arguments, generator) {
169
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
170
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
171
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
172
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
173
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
174
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
175
+ function fulfill(value) { resume("next", value); }
176
+ function reject(value) { resume("throw", value); }
177
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
178
+ }
179
+
180
+ function __asyncDelegator(o) {
181
+ var i, p;
182
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
183
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
184
+ }
185
+
186
+ function __asyncValues(o) {
187
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
188
+ var m = o[Symbol.asyncIterator], i;
189
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
190
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
191
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
192
+ }
193
+
194
+ function __makeTemplateObject(cooked, raw) {
195
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
196
+ return cooked;
197
+ };
198
+
199
+ function __importStar(mod) {
200
+ if (mod && mod.__esModule) return mod;
201
+ var result = {};
202
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
203
+ result.default = mod;
204
+ return result;
205
+ }
206
+
207
+ function __importDefault(mod) {
208
+ return (mod && mod.__esModule) ? mod : { default: mod };
209
+ }
210
+
211
+ function __classPrivateFieldGet(receiver, privateMap) {
212
+ if (!privateMap.has(receiver)) {
213
+ throw new TypeError("attempted to get private field on non-instance");
214
+ }
215
+ return privateMap.get(receiver);
216
+ }
217
+
218
+ function __classPrivateFieldSet(receiver, privateMap, value) {
219
+ if (!privateMap.has(receiver)) {
220
+ throw new TypeError("attempted to set private field on non-instance");
221
+ }
222
+ privateMap.set(receiver, value);
223
+ return value;
224
+ }
225
+
226
+ var VsChipdropdownService = /** @class */ (function () {
227
+ function VsChipdropdownService(http) {
228
+ this.http = http;
229
+ }
230
+ VsChipdropdownService.prototype.postApi = function (Apiurl, json, params) {
231
+ if (json === void 0) { json = {}; }
232
+ var getToken = localStorage.getItem("sessionData");
233
+ var tokenValue = JSON.parse(getToken);
234
+ var token = tokenValue.token;
235
+ console.log("params", params);
236
+ var paradata = '';
237
+ if (params !== undefined && params !== null && params !== '') {
238
+ paradata = params;
239
+ }
240
+ var headers = { Authorization: "Token " + token };
241
+ return this.http.post(Apiurl + paradata, json, {
242
+ headers: headers,
243
+ });
244
+ };
245
+ VsChipdropdownService.prototype.GetApi = function (Apiurl, params) {
246
+ if (params === void 0) { params = ''; }
247
+ var getToken = localStorage.getItem("sessionData");
248
+ var tokenValue = JSON.parse(getToken);
249
+ var token = tokenValue.token;
250
+ console.log("params", params);
251
+ var paradata = '';
252
+ if (params !== undefined && params !== null && params !== '') {
253
+ paradata = params;
254
+ }
255
+ var headers = { Authorization: "Token " + token };
256
+ return this.http.get(Apiurl + paradata, {
257
+ headers: headers,
258
+ });
259
+ };
260
+ VsChipdropdownService.ctorParameters = function () { return [
261
+ { type: http.HttpClient }
262
+ ]; };
263
+ VsChipdropdownService.ɵprov = core.ɵɵdefineInjectable({ factory: function VsChipdropdownService_Factory() { return new VsChipdropdownService(core.ɵɵinject(http.HttpClient)); }, token: VsChipdropdownService, providedIn: "root" });
264
+ VsChipdropdownService = __decorate([
265
+ core.Injectable({
266
+ providedIn: 'root'
267
+ })
268
+ ], VsChipdropdownService);
269
+ return VsChipdropdownService;
270
+ }());
271
+
272
+ var VsChipdropdownComponent = /** @class */ (function () {
273
+ function VsChipdropdownComponent() {
274
+ }
275
+ VsChipdropdownComponent.prototype.ngOnInit = function () {
276
+ };
277
+ VsChipdropdownComponent = __decorate([
278
+ core.Component({
279
+ selector: 'lib-vs-chipdropdown',
280
+ template: "\n <p>\n vs-chipdropdown works!\n </p>\n "
281
+ })
282
+ ], VsChipdropdownComponent);
283
+ return VsChipdropdownComponent;
284
+ }());
285
+
286
+ var VsChipddCmpComponent = /** @class */ (function () {
287
+ function VsChipddCmpComponent(service, fb) {
288
+ this.service = service;
289
+ this.fb = fb;
290
+ this.Backendapi = true;
291
+ this.dataEvent = new core.EventEmitter();
292
+ this.separatorsKeysCodes = [keycodes.ENTER, keycodes.COMMA];
293
+ this.has_next = false;
294
+ this.currentpage = 1;
295
+ this.Dropdowndata = [];
296
+ this.has_previous = false;
297
+ this.chipSelectedId = [];
298
+ this.chipSelectedObj = [];
299
+ }
300
+ VsChipddCmpComponent.prototype.ngOnInit = function () {
301
+ this.DropdownForm = this.fb.group({
302
+ value: ''
303
+ });
304
+ // if (this.InputFields?.defaultvalue) {
305
+ // this.DropdownForm.get("value").patchValue(this.InputFields?.defaultvalue)
306
+ // this.chipSelectedObj = this.InputFields?.defaultvalue
307
+ // if (this.chipSelectedObj.length > 0) {
308
+ // for (let foundemp of this.chipSelectedObj) {
309
+ // if (this.InputFields?.Outputkey) {
310
+ // this.chipSelectedId.push(foundemp[this.InputFields?.Outputkey])
311
+ // }
312
+ // else {
313
+ // this.chipSelectedId.push(foundemp.id)
314
+ // }
315
+ // }
316
+ // this.selected()
317
+ // }
318
+ // }
319
+ // if (this.InputFields?.fronentdata) {
320
+ // this.Dropdowndata = this.InputFields?.data
321
+ // }
322
+ // else {
323
+ // this.getdropdown('')
324
+ // }
325
+ };
326
+ VsChipddCmpComponent.prototype.dupngonit = function () {
327
+ var e_1, _a;
328
+ var _b, _c, _d, _e, _f, _g, _h;
329
+ this.DropdownForm = this.fb.group({
330
+ value: ''
331
+ });
332
+ if ((_b = this.InputFields) === null || _b === void 0 ? void 0 : _b.defaultvalue) {
333
+ this.DropdownForm.get("value").patchValue((_c = this.InputFields) === null || _c === void 0 ? void 0 : _c.defaultvalue);
334
+ this.chipSelectedObj = (_d = this.InputFields) === null || _d === void 0 ? void 0 : _d.defaultvalue;
335
+ if (this.chipSelectedObj.length > 0) {
336
+ try {
337
+ for (var _j = __values(this.chipSelectedObj), _k = _j.next(); !_k.done; _k = _j.next()) {
338
+ var foundemp = _k.value;
339
+ if ((_e = this.InputFields) === null || _e === void 0 ? void 0 : _e.Outputkey) {
340
+ this.chipSelectedId.push(foundemp[(_f = this.InputFields) === null || _f === void 0 ? void 0 : _f.Outputkey]);
341
+ }
342
+ else {
343
+ this.chipSelectedId.push(foundemp.id);
344
+ }
345
+ }
346
+ }
347
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
348
+ finally {
349
+ try {
350
+ if (_k && !_k.done && (_a = _j.return)) _a.call(_j);
351
+ }
352
+ finally { if (e_1) throw e_1.error; }
353
+ }
354
+ this.selected();
355
+ }
356
+ }
357
+ if ((_g = this.InputFields) === null || _g === void 0 ? void 0 : _g.fronentdata) {
358
+ this.Dropdowndata = (_h = this.InputFields) === null || _h === void 0 ? void 0 : _h.data;
359
+ }
360
+ else {
361
+ this.getdropdown('');
362
+ }
363
+ };
364
+ VsChipddCmpComponent.prototype.ngOnChanges = function (changes) {
365
+ if (changes.InputFields && changes.InputFields.currentValue) {
366
+ console.log("Summary Log Changes");
367
+ this.currentpage = 1;
368
+ this.dupngonit();
369
+ }
370
+ if (changes.ResetForm && changes.ResetForm.currentValue) {
371
+ console.log("hitted");
372
+ this.DropdownForm.reset();
373
+ this.currentpage = 1;
374
+ this.dupngonit();
375
+ this.chipSelectedId = [];
376
+ this.chipSelectedObj = [];
377
+ this.dataEvent.emit([]);
378
+ }
379
+ };
380
+ // public displaydevelopclient(clt: any, key: string) {
381
+ // return key[clt];
382
+ // }
383
+ VsChipddCmpComponent.prototype.autocompleteAppScroll = function () {
384
+ var _this = this;
385
+ var _a;
386
+ if (!((_a = this.InputFields) === null || _a === void 0 ? void 0 : _a.fronentdata)) {
387
+ setTimeout(function () {
388
+ if (_this.matAutocompleteApp &&
389
+ _this.autocompleteTrigger &&
390
+ _this.matAutocompleteApp.panel) {
391
+ rxjs.fromEvent(_this.matAutocompleteApp.panel.nativeElement, 'scroll')
392
+ .pipe(operators.map(function (x) { return _this.matAutocompleteApp.panel.nativeElement.scrollTop; }), operators.takeUntil(_this.autocompleteTrigger.panelClosingActions))
393
+ .subscribe(function (x) {
394
+ var scrollTop = _this.matAutocompleteApp.panel.nativeElement.scrollTop;
395
+ var scrollHeight = _this.matAutocompleteApp.panel.nativeElement.scrollHeight;
396
+ var elementHeight = _this.matAutocompleteApp.panel.nativeElement.clientHeight;
397
+ var atBottom = scrollHeight - 1 <= scrollTop + elementHeight;
398
+ if (atBottom) {
399
+ if (_this.has_next === true) {
400
+ var value = _this.DropInput.nativeElement.value;
401
+ var params = _this.searchparams(value);
402
+ _this.currentpage = _this.currentpage + 1;
403
+ if (_this.currentpage > 1) {
404
+ _this.service.GetApi(_this.InputFields.url + "?page=" + _this.currentpage, params)
405
+ .subscribe(function (results) {
406
+ var datas = results["data"];
407
+ var datapagination = results["pagination"];
408
+ _this.Dropdowndata = _this.Dropdowndata.concat(datas);
409
+ console.log("this.Dropdowndata", _this.Dropdowndata);
410
+ if (_this.Dropdowndata.length >= 0) {
411
+ _this.has_next = datapagination.has_next;
412
+ _this.has_previous = datapagination.has_previous;
413
+ _this.currentpage = datapagination.index;
414
+ }
415
+ });
416
+ }
417
+ }
418
+ }
419
+ });
420
+ }
421
+ });
422
+ }
423
+ };
424
+ VsChipddCmpComponent.prototype.dropdownsearch = function () {
425
+ var _this = this;
426
+ var _a;
427
+ if (!((_a = this.InputFields) === null || _a === void 0 ? void 0 : _a.fronentdata)) {
428
+ this.DropdownForm.get("value").valueChanges.pipe(operators.debounceTime(100), operators.distinctUntilChanged(), operators.tap(function () {
429
+ _this.DrodownLoading = true;
430
+ console.log("inside tap");
431
+ }), operators.switchMap(function (value) {
432
+ var params = _this.searchparams(value);
433
+ _this.currentpage = 1;
434
+ return _this.service.GetApi(_this.InputFields.url + "?page=" + _this.currentpage, params).pipe(operators.finalize(function () {
435
+ _this.DrodownLoading = false;
436
+ }));
437
+ })).subscribe(function (results) {
438
+ var datas = results["data"];
439
+ _this.Dropdowndata = datas;
440
+ });
441
+ }
442
+ };
443
+ VsChipddCmpComponent.prototype.getdropdown = function (value) {
444
+ var _this = this;
445
+ var params = this.searchparams(value);
446
+ this.service.GetApi(this.InputFields.url + "?page=" + this.currentpage, params)
447
+ .subscribe(function (results) {
448
+ var datas = results["data"];
449
+ var datapagination = results["pagination"];
450
+ _this.Dropdowndata = datas;
451
+ if (_this.Dropdowndata.length >= 0) {
452
+ _this.has_next = datapagination.has_next;
453
+ _this.has_previous = datapagination.has_previous;
454
+ _this.currentpage = datapagination.index;
455
+ }
456
+ });
457
+ };
458
+ VsChipddCmpComponent.prototype.selected = function () {
459
+ var _a, _b;
460
+ // let data = this.DropdownForm.value.value
461
+ if ((_a = this.InputFields) === null || _a === void 0 ? void 0 : _a.wholedata) {
462
+ this.dataEvent.emit(this.chipSelectedObj);
463
+ }
464
+ else {
465
+ if ((_b = this.InputFields) === null || _b === void 0 ? void 0 : _b.Outputkey) {
466
+ this.dataEvent.emit(this.chipSelectedId);
467
+ }
468
+ else {
469
+ this.dataEvent.emit(this.chipSelectedObj);
470
+ }
471
+ }
472
+ };
473
+ VsChipddCmpComponent.prototype.searchparams = function (value) {
474
+ var params = '';
475
+ if (this.InputFields.params) {
476
+ params = this.InputFields.params;
477
+ }
478
+ var inpValue = value;
479
+ inpValue ? params += '&' + this.InputFields.searchkey + '=' + inpValue : '';
480
+ return params;
481
+ };
482
+ VsChipddCmpComponent.prototype.removechip = function (obj) {
483
+ var index = this.chipSelectedObj.indexOf(obj);
484
+ if (index >= 0) {
485
+ this.chipSelectedObj.splice(index, 1);
486
+ console.log(this.chipSelectedObj);
487
+ this.chipSelectedId.splice(index, 1);
488
+ console.log(this.chipSelectedId);
489
+ this.DropInput.nativeElement.value = '';
490
+ this.selected();
491
+ }
492
+ };
493
+ VsChipddCmpComponent.prototype.venSelected = function (event) {
494
+ this.DropInput.nativeElement.value = '';
495
+ console.log('event.option.value', event.option.value);
496
+ this.selectvenByName(event.option.value[this.comparekey(event.option.value)]);
497
+ console.log('chipSelectedvenid', this.chipSelectedObj);
498
+ };
499
+ VsChipddCmpComponent.prototype.selectvenByName = function (ven) {
500
+ var _this = this;
501
+ var _a, _b;
502
+ var foundemp1 = this.chipSelectedObj.filter(function (e) { return e[_this.comparekey(e)] == ven; });
503
+ if (foundemp1.length) {
504
+ return;
505
+ }
506
+ var foundemp = this.Dropdowndata.filter(function (e) { return e[_this.comparekey(e)] == ven; });
507
+ if (foundemp.length) {
508
+ this.chipSelectedObj.push(foundemp[0]);
509
+ if ((_a = this.InputFields) === null || _a === void 0 ? void 0 : _a.Outputkey) {
510
+ this.chipSelectedId.push(foundemp[0][(_b = this.InputFields) === null || _b === void 0 ? void 0 : _b.Outputkey]);
511
+ }
512
+ else {
513
+ this.chipSelectedId.push(foundemp[0].id);
514
+ }
515
+ }
516
+ };
517
+ VsChipddCmpComponent.prototype.comparekey = function (e) {
518
+ var _a, _b;
519
+ if ((_a = this.InputFields) === null || _a === void 0 ? void 0 : _a.comparekey) {
520
+ return (_b = this.InputFields) === null || _b === void 0 ? void 0 : _b.comparekey;
521
+ }
522
+ else {
523
+ if (e === null || e === void 0 ? void 0 : e.id) {
524
+ return "id";
525
+ }
526
+ else {
527
+ return this.InputFields.displaykey;
528
+ }
529
+ }
530
+ };
531
+ VsChipddCmpComponent.ctorParameters = function () { return [
532
+ { type: VsChipdropdownService },
533
+ { type: forms.FormBuilder }
534
+ ]; };
535
+ __decorate([
536
+ core.Input()
537
+ ], VsChipddCmpComponent.prototype, "InputFields", void 0);
538
+ __decorate([
539
+ core.Input()
540
+ ], VsChipddCmpComponent.prototype, "ResetForm", void 0);
541
+ __decorate([
542
+ core.Input()
543
+ ], VsChipddCmpComponent.prototype, "Backendapi", void 0);
544
+ __decorate([
545
+ core.ViewChild(autocomplete.MatAutocompleteTrigger)
546
+ ], VsChipddCmpComponent.prototype, "autocompleteTrigger", void 0);
547
+ __decorate([
548
+ core.ViewChild('scrolll')
549
+ ], VsChipddCmpComponent.prototype, "matAutocompleteApp", void 0);
550
+ __decorate([
551
+ core.Output()
552
+ ], VsChipddCmpComponent.prototype, "dataEvent", void 0);
553
+ __decorate([
554
+ core.ViewChild('DropInput')
555
+ ], VsChipddCmpComponent.prototype, "DropInput", void 0);
556
+ VsChipddCmpComponent = __decorate([
557
+ core.Component({
558
+ selector: 'lib-vs-chipdd-cmp',
559
+ 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-list multiple #chipListvendor class=\"chip-container\">\r\n <mat-chip *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>\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-list>\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",
560
+ 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:0 0}.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}"]
561
+ })
562
+ ], VsChipddCmpComponent);
563
+ return VsChipddCmpComponent;
564
+ }());
565
+
566
+ var VsChipdropdownModule = /** @class */ (function () {
567
+ function VsChipdropdownModule() {
568
+ }
569
+ VsChipdropdownModule = __decorate([
570
+ core.NgModule({
571
+ declarations: [VsChipdropdownComponent, VsChipddCmpComponent],
572
+ imports: [formField.MatFormFieldModule, input.MatInputModule, select.MatSelectModule, autocomplete.MatAutocompleteModule, forms.FormsModule, forms.ReactiveFormsModule, common.CommonModule, gridList.MatGridListModule, chips.MatChipsModule, icon.MatIconModule,
573
+ core$1.TranslateModule,
574
+ http.HttpClientModule,
575
+ core$1.TranslateModule.forRoot({
576
+ loader: {
577
+ provide: core$1.TranslateLoader,
578
+ useFactory: httpTranslateLoader,
579
+ deps: [http.HttpClient],
580
+ },
581
+ }),],
582
+ exports: [VsChipddCmpComponent]
583
+ })
584
+ ], VsChipdropdownModule);
585
+ return VsChipdropdownModule;
586
+ }());
587
+ function httpTranslateLoader(http) {
588
+ return new httpLoader.TranslateHttpLoader(http);
589
+ }
590
+
591
+ exports.VsChipddCmpComponent = VsChipddCmpComponent;
592
+ exports.VsChipdropdownComponent = VsChipdropdownComponent;
593
+ exports.VsChipdropdownModule = VsChipdropdownModule;
594
+ exports.VsChipdropdownService = VsChipdropdownService;
595
+ exports.httpTranslateLoader = httpTranslateLoader;
596
+
597
+ Object.defineProperty(exports, '__esModule', { value: true });
598
+
599
+ })));
600
+ //# sourceMappingURL=unnilouis.org-vs-chipdropdown.umd.js.map