@bnsights/bbsf-controls 1.0.47 → 1.0.48

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 (34) hide show
  1. package/README.md +6 -0
  2. package/bnsights-bbsf-controls-1.0.48.tgz +0 -0
  3. package/bnsights-bbsf-controls.d.ts +1 -0
  4. package/bnsights-bbsf-controls.metadata.json +1 -1
  5. package/bundles/bnsights-bbsf-controls.umd.js +730 -532
  6. package/bundles/bnsights-bbsf-controls.umd.js.map +1 -1
  7. package/esm2015/bnsights-bbsf-controls.js +2 -1
  8. package/esm2015/lib/Shared/Enums/TagInputView.js +7 -0
  9. package/esm2015/lib/Shared/Models/AutocompleteDTO.js +2 -1
  10. package/esm2015/lib/Shared/Models/AutocompleteOptions.js +2 -1
  11. package/esm2015/lib/Shared/Models/TagsInputDTO.js +1 -1
  12. package/esm2015/lib/Shared/Models/TagsInputOptions.js +9 -5
  13. package/esm2015/lib/Shared/components/ng-tag-input.js +292 -0
  14. package/esm2015/lib/Shared/default_intl.js +21 -0
  15. package/esm2015/lib/controls/AutocompleteTextBox/AutocompleteTextBox.component.js +3 -2
  16. package/esm2015/lib/controls/DateTimePicker/DateTimePicker.component.js +6 -1
  17. package/esm2015/lib/controls/Paging/Paging.component.js +21 -16
  18. package/esm2015/lib/controls/TagsInput/TagsInput.component.js +2 -2
  19. package/esm2015/lib/controls/bbsf-controls.module.js +4 -2
  20. package/esm2015/public-api.js +3 -1
  21. package/fesm2015/bnsights-bbsf-controls.js +355 -28
  22. package/fesm2015/bnsights-bbsf-controls.js.map +1 -1
  23. package/lib/Shared/Enums/TagInputView.d.ts +5 -0
  24. package/lib/Shared/Models/AutocompleteDTO.d.ts +1 -0
  25. package/lib/Shared/Models/AutocompleteOptions.d.ts +1 -0
  26. package/lib/Shared/Models/TagsInputDTO.d.ts +4 -2
  27. package/lib/Shared/Models/TagsInputOptions.d.ts +3 -0
  28. package/lib/Shared/components/ng-tag-input.d.ts +45 -0
  29. package/lib/Shared/default_intl.d.ts +10 -0
  30. package/lib/controls/AutocompleteTextBox/AutocompleteTextBox.component.d.ts +1 -0
  31. package/lib/controls/Paging/Paging.component.d.ts +5 -2
  32. package/package.json +1 -1
  33. package/public-api.d.ts +2 -0
  34. package/bnsights-bbsf-controls-1.0.47.tgz +0 -0
@@ -378,6 +378,345 @@
378
378
  { type: i0.Injectable, args: [{ providedIn: 'root' },] }
379
379
  ];
380
380
 
381
+ /*! *****************************************************************************
382
+ Copyright (c) Microsoft Corporation.
383
+
384
+ Permission to use, copy, modify, and/or distribute this software for any
385
+ purpose with or without fee is hereby granted.
386
+
387
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
388
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
389
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
390
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
391
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
392
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
393
+ PERFORMANCE OF THIS SOFTWARE.
394
+ ***************************************************************************** */
395
+ /* global Reflect, Promise */
396
+ var extendStatics = function (d, b) {
397
+ extendStatics = Object.setPrototypeOf ||
398
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
399
+ function (d, b) { for (var p in b)
400
+ if (Object.prototype.hasOwnProperty.call(b, p))
401
+ d[p] = b[p]; };
402
+ return extendStatics(d, b);
403
+ };
404
+ function __extends(d, b) {
405
+ if (typeof b !== "function" && b !== null)
406
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
407
+ extendStatics(d, b);
408
+ function __() { this.constructor = d; }
409
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
410
+ }
411
+ var __assign = function () {
412
+ __assign = Object.assign || function __assign(t) {
413
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
414
+ s = arguments[i];
415
+ for (var p in s)
416
+ if (Object.prototype.hasOwnProperty.call(s, p))
417
+ t[p] = s[p];
418
+ }
419
+ return t;
420
+ };
421
+ return __assign.apply(this, arguments);
422
+ };
423
+ function __rest(s, e) {
424
+ var t = {};
425
+ for (var p in s)
426
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
427
+ t[p] = s[p];
428
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
429
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
430
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
431
+ t[p[i]] = s[p[i]];
432
+ }
433
+ return t;
434
+ }
435
+ function __decorate(decorators, target, key, desc) {
436
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
437
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
438
+ r = Reflect.decorate(decorators, target, key, desc);
439
+ else
440
+ for (var i = decorators.length - 1; i >= 0; i--)
441
+ if (d = decorators[i])
442
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
443
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
444
+ }
445
+ function __param(paramIndex, decorator) {
446
+ return function (target, key) { decorator(target, key, paramIndex); };
447
+ }
448
+ function __metadata(metadataKey, metadataValue) {
449
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
450
+ return Reflect.metadata(metadataKey, metadataValue);
451
+ }
452
+ function __awaiter(thisArg, _arguments, P, generator) {
453
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
454
+ return new (P || (P = Promise))(function (resolve, reject) {
455
+ function fulfilled(value) { try {
456
+ step(generator.next(value));
457
+ }
458
+ catch (e) {
459
+ reject(e);
460
+ } }
461
+ function rejected(value) { try {
462
+ step(generator["throw"](value));
463
+ }
464
+ catch (e) {
465
+ reject(e);
466
+ } }
467
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
468
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
469
+ });
470
+ }
471
+ function __generator(thisArg, body) {
472
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
473
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
474
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
475
+ function verb(n) { return function (v) { return step([n, v]); }; }
476
+ function step(op) {
477
+ if (f)
478
+ throw new TypeError("Generator is already executing.");
479
+ while (_)
480
+ try {
481
+ 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)
482
+ return t;
483
+ if (y = 0, t)
484
+ op = [op[0] & 2, t.value];
485
+ switch (op[0]) {
486
+ case 0:
487
+ case 1:
488
+ t = op;
489
+ break;
490
+ case 4:
491
+ _.label++;
492
+ return { value: op[1], done: false };
493
+ case 5:
494
+ _.label++;
495
+ y = op[1];
496
+ op = [0];
497
+ continue;
498
+ case 7:
499
+ op = _.ops.pop();
500
+ _.trys.pop();
501
+ continue;
502
+ default:
503
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
504
+ _ = 0;
505
+ continue;
506
+ }
507
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
508
+ _.label = op[1];
509
+ break;
510
+ }
511
+ if (op[0] === 6 && _.label < t[1]) {
512
+ _.label = t[1];
513
+ t = op;
514
+ break;
515
+ }
516
+ if (t && _.label < t[2]) {
517
+ _.label = t[2];
518
+ _.ops.push(op);
519
+ break;
520
+ }
521
+ if (t[2])
522
+ _.ops.pop();
523
+ _.trys.pop();
524
+ continue;
525
+ }
526
+ op = body.call(thisArg, _);
527
+ }
528
+ catch (e) {
529
+ op = [6, e];
530
+ y = 0;
531
+ }
532
+ finally {
533
+ f = t = 0;
534
+ }
535
+ if (op[0] & 5)
536
+ throw op[1];
537
+ return { value: op[0] ? op[1] : void 0, done: true };
538
+ }
539
+ }
540
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
541
+ if (k2 === undefined)
542
+ k2 = k;
543
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
544
+ }) : (function (o, m, k, k2) {
545
+ if (k2 === undefined)
546
+ k2 = k;
547
+ o[k2] = m[k];
548
+ });
549
+ function __exportStar(m, o) {
550
+ for (var p in m)
551
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
552
+ __createBinding(o, m, p);
553
+ }
554
+ function __values(o) {
555
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
556
+ if (m)
557
+ return m.call(o);
558
+ if (o && typeof o.length === "number")
559
+ return {
560
+ next: function () {
561
+ if (o && i >= o.length)
562
+ o = void 0;
563
+ return { value: o && o[i++], done: !o };
564
+ }
565
+ };
566
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
567
+ }
568
+ function __read(o, n) {
569
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
570
+ if (!m)
571
+ return o;
572
+ var i = m.call(o), r, ar = [], e;
573
+ try {
574
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
575
+ ar.push(r.value);
576
+ }
577
+ catch (error) {
578
+ e = { error: error };
579
+ }
580
+ finally {
581
+ try {
582
+ if (r && !r.done && (m = i["return"]))
583
+ m.call(i);
584
+ }
585
+ finally {
586
+ if (e)
587
+ throw e.error;
588
+ }
589
+ }
590
+ return ar;
591
+ }
592
+ /** @deprecated */
593
+ function __spread() {
594
+ for (var ar = [], i = 0; i < arguments.length; i++)
595
+ ar = ar.concat(__read(arguments[i]));
596
+ return ar;
597
+ }
598
+ /** @deprecated */
599
+ function __spreadArrays() {
600
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
601
+ s += arguments[i].length;
602
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
603
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
604
+ r[k] = a[j];
605
+ return r;
606
+ }
607
+ function __spreadArray(to, from, pack) {
608
+ if (pack || arguments.length === 2)
609
+ for (var i = 0, l = from.length, ar; i < l; i++) {
610
+ if (ar || !(i in from)) {
611
+ if (!ar)
612
+ ar = Array.prototype.slice.call(from, 0, i);
613
+ ar[i] = from[i];
614
+ }
615
+ }
616
+ return to.concat(ar || Array.prototype.slice.call(from));
617
+ }
618
+ function __await(v) {
619
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
620
+ }
621
+ function __asyncGenerator(thisArg, _arguments, generator) {
622
+ if (!Symbol.asyncIterator)
623
+ throw new TypeError("Symbol.asyncIterator is not defined.");
624
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
625
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
626
+ function verb(n) { if (g[n])
627
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
628
+ function resume(n, v) { try {
629
+ step(g[n](v));
630
+ }
631
+ catch (e) {
632
+ settle(q[0][3], e);
633
+ } }
634
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
635
+ function fulfill(value) { resume("next", value); }
636
+ function reject(value) { resume("throw", value); }
637
+ function settle(f, v) { if (f(v), q.shift(), q.length)
638
+ resume(q[0][0], q[0][1]); }
639
+ }
640
+ function __asyncDelegator(o) {
641
+ var i, p;
642
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
643
+ 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; }
644
+ }
645
+ function __asyncValues(o) {
646
+ if (!Symbol.asyncIterator)
647
+ throw new TypeError("Symbol.asyncIterator is not defined.");
648
+ var m = o[Symbol.asyncIterator], i;
649
+ 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);
650
+ 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); }); }; }
651
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
652
+ }
653
+ function __makeTemplateObject(cooked, raw) {
654
+ if (Object.defineProperty) {
655
+ Object.defineProperty(cooked, "raw", { value: raw });
656
+ }
657
+ else {
658
+ cooked.raw = raw;
659
+ }
660
+ return cooked;
661
+ }
662
+ ;
663
+ var __setModuleDefault = Object.create ? (function (o, v) {
664
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
665
+ }) : function (o, v) {
666
+ o["default"] = v;
667
+ };
668
+ function __importStar(mod) {
669
+ if (mod && mod.__esModule)
670
+ return mod;
671
+ var result = {};
672
+ if (mod != null)
673
+ for (var k in mod)
674
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
675
+ __createBinding(result, mod, k);
676
+ __setModuleDefault(result, mod);
677
+ return result;
678
+ }
679
+ function __importDefault(mod) {
680
+ return (mod && mod.__esModule) ? mod : { default: mod };
681
+ }
682
+ function __classPrivateFieldGet(receiver, state, kind, f) {
683
+ if (kind === "a" && !f)
684
+ throw new TypeError("Private accessor was defined without a getter");
685
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
686
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
687
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
688
+ }
689
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
690
+ if (kind === "m")
691
+ throw new TypeError("Private method is not writable");
692
+ if (kind === "a" && !f)
693
+ throw new TypeError("Private accessor was defined without a setter");
694
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
695
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
696
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
697
+ }
698
+
699
+ // here is the default text string - just adjust the strings to reflect your preferred language
700
+ var DefaultIntl = /** @class */ (function (_super) {
701
+ __extends(DefaultIntl, _super);
702
+ function DefaultIntl(utilityService) {
703
+ var _this = _super.call(this) || this;
704
+ _this.utilityService = utilityService;
705
+ /** A label for the range 'from' in picker info */
706
+ _this.rangeFromLabel = _this.utilityService.getResourceValue("From");
707
+ /** A label for the range 'to' in picker info */
708
+ _this.rangeToLabel = _this.utilityService.getResourceValue("To");
709
+ return _this;
710
+ }
711
+ return DefaultIntl;
712
+ }(ngPickDatetime.OwlDateTimeIntl));
713
+ DefaultIntl.decorators = [
714
+ { type: i0.Injectable }
715
+ ];
716
+ DefaultIntl.ctorParameters = function () { return [
717
+ { type: bbsfUtilities.UtilityService }
718
+ ]; };
719
+
381
720
  var DateInputComponent = /** @class */ (function () {
382
721
  // tslint:disable-next-line: max-line-length
383
722
  function DateInputComponent(datepipe, onChangeService, ErrorHandler, controlUtility, controlContainer, DateInputControlHost, UtilityService, translate, controlValidationService, dateTimeAdapter) {
@@ -557,6 +896,9 @@
557
896
  { type: i0.Component, args: [{
558
897
  selector: 'BBSF-DateTimePicker',
559
898
  template: "<div class=\"b-control b-date-picker\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\">\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group\">\r\n <input autocomplete=\"off\" (dateTimeChange)=\"onDateSelect($event)\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}} \"\r\n [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"{{options.Name}}\" [owlDateTime]=\"dt1\" [owlDateTimeTrigger]=\"dt1\"\r\n [class.is-invalid]=\"DatePickerFormControl.invalid && DatePickerFormControl.touched\"\r\n [min]=\"options.StartDate\" [max]=\"options.EndDate\" [hour12Timer]=\"options.Hour12Timer\" [selectMode]=\"getSelectMode(options.SelectMode)\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" #Dateinput>\r\n\r\n <owl-date-time [pickerType]=\"getPickerType(options.PickerType)\"\r\n [startView]=\"getStartView(options.StartView)\" [firstDayOfWeek]=\"options.FirstDayOfWeek\"\r\n [hour12Timer]=\"options.Hour12Timer\" #dt1></owl-date-time>\r\n \r\n <div class=\"input-group-append\">\r\n <span class=\"input-group-text\" [owlDateTimeTrigger]=\"dt1\">\r\n <span class=\"svg-icon\">\r\n <svg id=\"Group_356\" data-name=\"Group 356\" xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" viewBox=\"0 0 48 48\">\r\n <path id=\"Path_6737\" data-name=\"Path 6737\" d=\"M11.583,1a1,1,0,0,0-2,0V5.7h2Z\" style=\"\"></path>\r\n <path id=\"Path_6738\" data-name=\"Path 6738\" d=\"M38.417,1a1,1,0,0,0-2,0V5.7h2Z\"></path>\r\n <path id=\"Path_6739\" data-name=\"Path 6739\" d=\"M0,43.146C0,45.822,1.826,48,4.07,48H43.928C46.174,48,48,45.822,48,43.146V17.121H0Z\" fill=\"#d5d5d5\"></path>\r\n <path id=\"Path_6740\" data-name=\"Path 6740\" d=\"M43.929,5.7H38.417v5.512a1,1,0,1,1-2,0V5.7H11.583v5.512a1,1,0,1,1-2,0V5.7H4.07C1.826,5.7,0,7.877,0,10.555v4.566H48V10.555C48,7.877,46.174,5.7,43.929,5.7Z\" fill=\"#595959\"></path>\r\n </svg>\r\n </span>\r\n </span>\r\n <!--<span class=\"input-group-text\" *ngIf=\"options.EnableCopyToClipboard\"\r\n (click)=\"copyInputMessage(Dateinput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>-->\r\n </div>\r\n </div>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(DatePickerFormControl.invalid && DatePickerFormControl.touched)\">\r\n {{getErrorValidation(DatePickerFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n <div class=\"control-desc\"*ngIf=\"options.LabelDescription!=null\">{{options.LabelDescription}}</div>\r\n \r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n</div>\r\n",
899
+ providers: [
900
+ { provide: ngPickDatetime.OwlDateTimeIntl, useClass: DefaultIntl }
901
+ ],
560
902
  styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}\n"]
561
903
  },] }
562
904
  ];
@@ -774,529 +1116,211 @@
774
1116
  if (this.options.IsRequired) {
775
1117
  this.validationRules.push(forms.Validators.required);
776
1118
  }
777
- this.fileUploadFormControl.setValidators(this.validationRules);
778
- this.fileUploadFormControl.setAsyncValidators(this.validationRulesasync);
779
- if (this.options.IsDisabled) {
780
- this.fileUploadFormControl.disable();
781
- }
782
- this.MultipleFileUplaodControlHost.ngSubmit.subscribe(function (value) {
783
- _this.group.markAllAsTouched();
784
- _this.markAllAsTouched = true;
785
- });
786
- this.fileUploadFormControl.setValue(this.options.Value);
787
- };
788
- FileUploadComponent.prototype.ngAfterViewInit = function () {
789
- if (this.options.AttributeList != null) {
790
- var element = document.getElementById(this.options.Name);
791
- for (var index = 0; index < this.options.AttributeList.length; index++) {
792
- element.setAttribute(this.options.AttributeList[index].Key, this.options.AttributeList[index].value);
793
- }
794
- }
795
- };
796
- FileUploadComponent.prototype.showGlobalError = function () {
797
- this.controlUtility.showGlobalError();
798
- };
799
- FileUploadComponent.prototype.getErrorValidation = function (ErrorList) {
800
- if (this.markAllAsTouched && this.group.invalid) {
801
- this.showGlobalError();
802
- this.markAllAsTouched = false;
803
- }
804
- return this.controlUtility.getErrorValidationMassage(ErrorList, this.group, this.options);
805
- };
806
- FileUploadComponent.prototype.fileOverAnother = function (event) {
807
- this.hasAnotherDropZoneOver = event;
808
- };
809
- FileUploadComponent.prototype.onFileChange = function () {
810
- var _this = this;
811
- var FilesArray = [];
812
- if (this.options.IsMultipleFile && this.options.MinNoOfFiles != null && this.options.MinNoOfFiles > 0 && this.options.MinNoOfFiles > this.uploader.queue.length) {
813
- var formControl = this.fileUploadFormControl;
814
- formControl.setErrors({ MinFileCountValidationKey: this.options.MinNoOfFiles });
815
- formControl.markAsTouched();
816
- this.uploader.queue = [];
817
- return;
818
- }
819
- if (this.options.IsMultipleFile && this.options.MaxNoOfFiles != null && this.options.MaxNoOfFiles > 0 && this.options.MaxNoOfFiles < this.uploader.queue.length) {
820
- var formControl = this.fileUploadFormControl;
821
- formControl.setErrors({ MaxFileCountValidationKey: this.options.MaxNoOfFiles });
822
- formControl.markAsTouched();
823
- this.uploader.queue = [];
824
- return;
825
- }
826
- if (this.options.IsMultipleFile && (this.options.MaxSizeForAllFilesInMB != null && this.options.MaxSizeForAllFilesInMB > 0)) {
827
- var AllSizeFile = 0;
828
- for (var index = 0; index < this.uploader.queue.length; index++) {
829
- var element = this.uploader.queue[index];
830
- var file = element.file;
831
- AllSizeFile = AllSizeFile + file.size;
832
- }
833
- var MaxSizeForAllFiles = this.options.MaxSizeForAllFilesInMB * 1000 * 1000;
834
- if (AllSizeFile > MaxSizeForAllFiles) {
835
- var formControl = this.fileUploadFormControl;
836
- formControl.setErrors({ MaxSizeForAllFilesInMB: this.options.MaxSizeForAllFilesInMB + 'M' });
837
- formControl.markAsTouched();
838
- this.uploader.queue = [];
839
- return;
840
- }
841
- }
842
- var AddedQueue = this.uploader.queue.filter(function (object) { return object["some"].lastModified != null; });
843
- var _loop_1 = function (index) {
844
- var element = AddedQueue[index];
845
- var file = element.file;
846
- var maxFileSize = this_1.options.FileMaxSizeInMB * 1000 * 1000;
847
- if (file) {
848
- var fileType = file.type;
849
- if (file.size > maxFileSize) {
850
- var formControl = this_1.fileUploadFormControl;
851
- formControl.setErrors({ FileMaxSizeInMB: this_1.options.FileMaxSizeInMB + 'M' });
852
- formControl.markAsTouched();
853
- this_1.uploader.queue = [];
854
- return { value: void 0 };
855
- }
856
- if (this_1.options.FileUploadAcceptsTypes != null && this_1.options.FileUploadAcceptsTypes.length > 0 && !(this_1.AcceptedTypeArray.includes(fileType.toUpperCase()) || this_1.AcceptedTypeArray.includes(fileType.toLowerCase()))) {
857
- var formControl = this_1.fileUploadFormControl;
858
- formControl.setErrors({ ToolTipTypeError: this_1.ToolTipTypeArray });
859
- formControl.markAsTouched();
860
- this_1.uploader.queue = [];
861
- return { value: void 0 };
862
- }
863
- var reader_1 = new FileReader();
864
- var fileObject = file.rawFile;
865
- reader_1.readAsDataURL(fileObject);
866
- reader_1.onload = function () {
867
- var existingID_GUID = null;
868
- if (!_this.options.IsMultipleFile && _this.file)
869
- existingID_GUID = _this.file.NameWithExtension == file.name ? _this.file.ID_GUID : null;
870
- var AddedFile = {
871
- FileName: file.name,
872
- FileType: file.type,
873
- FileBase64: reader_1.result.toString().split(',')[1],
874
- FileSizeInMB: ((file.size / 1000) / 1000),
875
- NameWithExtension: file.name,
876
- ID_GUID: existingID_GUID
877
- };
878
- if (_this.options.IsMultipleFile == false) {
879
- _this.fileUploadModel = new FileUploadModel();
880
- _this.fileUploadModel.File = AddedFile;
881
- _this.fileUploadFormControl.setValue(_this.fileUploadModel);
882
- _this.group.get(_this.options.Name).setValue(_this.fileUploadModel);
883
- }
884
- else {
885
- FilesArray.push(AddedFile);
886
- _this.multipleFileUploadModel.UploadedFiles = FilesArray;
887
- if (_this.options.Value != null && _this.options.Value != undefined) {
888
- if (_this.options.Value.CorrelationID_GUID == null) {
889
- _this.multipleFileUploadModel.RemovedFiles = [];
890
- }
891
- }
892
- _this.fileUploadFormControl.setValue(_this.multipleFileUploadModel);
893
- _this.group.get(_this.options.Name).setValue(_this.multipleFileUploadModel);
894
- }
895
- };
896
- var originalValue = this_1.group.get(this_1.options.Name).value;
897
- if (this_1.options.PatchFunction && this_1.options.PatchPath && this_1.group.get(this_1.options.Name).valid) {
898
- this_1.controlUtility.patchControlValue(originalValue, this_1.options.PatchFunction, this_1.options.PatchPath);
899
- }
900
- this_1.OnChange.emit(originalValue);
901
- }
902
- };
903
- var this_1 = this;
904
- for (var index = 0; index < AddedQueue.length; index++) {
905
- var state_1 = _loop_1(index);
906
- if (typeof state_1 === "object")
907
- return state_1.value;
908
- }
909
- };
910
- FileUploadComponent.prototype.removeFromControlValue = function (item) {
911
- if (this.options.IsMultipleFile == false) {
912
- this.fileUploadModel = null;
913
- if (this.options.IsRequired == true) {
914
- this.fileUploadFormControl.markAsTouched();
915
- this.fileUploadFormControl.invalid;
916
- }
917
- this.group.get(this.options.Name).setValue(this.fileUploadModel);
918
- }
919
- else {
920
- if (this.options.Value != null && this.options.Value != undefined) {
921
- if (this.options.Value.CorrelationID_GUID == null) {
922
- this.deletedFiles = [];
923
- this.multipleFileUploadModel.RemovedFiles = [];
924
- }
925
- else {
926
- if (this.multipleFileUploadModel.RemovedFiles.length == 0) {
927
- var FileObject_1 = item.file.rawFile;
928
- var DeletedItem = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension == FileObject_1.name; })[0];
929
- this.multipleFileUploadModel.ExistingFiles = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension != FileObject_1.name; });
930
- this.deletedFiles.push(DeletedItem);
931
- this.multipleFileUploadModel.RemovedFiles.push(DeletedItem.ID_GUID);
932
- }
933
- else {
934
- var FileObject_2 = item.file.rawFile;
935
- var deletedList = this.deletedFiles.filter(function (Object) { return Object.NameWithExtension == FileObject_2.name; });
936
- if (deletedList.length == 0 || deletedList == undefined) {
937
- var DeletedItem = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension == FileObject_2.name; })[0];
938
- this.multipleFileUploadModel.ExistingFiles = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension != FileObject_2.name; });
939
- this.deletedFiles.push(DeletedItem);
940
- this.multipleFileUploadModel.RemovedFiles.push(DeletedItem.ID_GUID);
941
- }
942
- }
943
- }
944
- }
945
- else {
946
- this.deletedFiles = [];
947
- this.multipleFileUploadModel.RemovedFiles = [];
948
- }
949
- this.multipleFileUploadModel.UploadedFiles = this.multipleFileUploadModel.UploadedFiles.filter(function (Object) { return Object.NameWithExtension != item._file.name; });
950
- if ((this.multipleFileUploadModel.UploadedFiles == null || this.multipleFileUploadModel.UploadedFiles == []) && this.options.IsRequired) {
951
- this.fileUploadFormControl.markAsTouched();
952
- this.fileUploadFormControl.invalid;
953
- }
954
- this.fileUploadFormControl.setValue(this.multipleFileUploadModel);
955
- this.group.get(this.options.Name).setValue(this.multipleFileUploadModel);
956
- }
957
- };
958
- return FileUploadComponent;
959
- }());
960
- FileUploadComponent.controlContainerstatic = null;
961
- FileUploadComponent.decorators = [
962
- { type: i0.Component, args: [{
963
- selector: 'BBSF-FileUplaod',
964
- template: "\r\n<div class=\"b-control b-fileupload\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\">\r\n <label class=\"col-form-label col-sm-12 mb-2\" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n\r\n <ejs-tooltip id=\"tooltip\" content='{{ValidationMessage}}' tipPointerPosition='Middle'\r\n *ngIf=\"(ValidationMessage!=null&&ValidationMessage!='')\">\r\n <i class=\"fa fa-info-circle\" data-plugin=\"tooltip\" data-html=\"true\">\r\n </i>\r\n </ejs-tooltip>\r\n\r\n\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n\r\n <div>\r\n\r\n <div ng2FileDrop *ngIf=\"(options.IsDropZone)&&(!((options.IsMultipleFile==false)&&(uploader.queue.length)>0))\"\r\n [ngClass]=\"{'another-file-over-class': hasAnotherDropZoneOver}\" (onFileDrop)=\"onFileChange()\"\r\n (fileOver)=\"fileOverAnother($event)\" [uploader]=\"uploader\" [accept]=\"AcceptedType\"\r\n class=\"well my-drop-zoneform-control bnsights-control {{options.ExtraClasses}}\"\r\n (change)=\"onFileChange()\" id=\"{{options.Name}}\" multiple=\"{{options.IsMultipleFile?'multiple':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" type=\"file\" formControlName=\"{{options.Name}}\"\r\n id=\"options.Name\" #fileInput\r\n [class.is-invalid]=\"fileUploadFormControl.invalid && fileUploadFormControl.touched\">\r\n\r\n\r\n <div class=\"dragndrop text-center\">\r\n <p class=\"drag-icon mb-3\">\r\n <i class=\"fas fa-cloud-download-alt\"></i>\r\n </p>\r\n <p>\r\n {{UtilityService.getResourceValue(\"DragAndDropHere\")}}\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"(!options.IsDropZone)&&!((uploader.queue.length>0)&&(!options.IsMultipleFile))\">\r\n <button type=\"button\" class=\"btn btn-light btn-sm file-fake-input mb-3\" (click)=\"fileInput.click();\">\r\n <i class=\"icon fa fa-cloud-upload-alt\"></i>\r\n {{UtilityService.getResourceValue(\"Upload\")}}\r\n </button>\r\n <input ng2FileSelect [uploader]=\"uploader\" [accept]=\"AcceptedType\"\r\n class=\"fileSelector customFileUploadPlacment hidden v-required-multiplefiles d-none\" id=\"file\"\r\n multiple=\"{{options.IsMultipleFile?'multiple':''}}\" name=\"file\" type=\"file\" value=\"\"\r\n autocomplete=\"off\" (change)=\"onFileChange()\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\"\r\n id=\"{{options.Name}}\" aria-describedby=\"email-error\" aria-invalid=\"true\" type=\"file\"\r\n formControlName=\"{{options.Name}}\" id=\"options.Name\" #fileInput\r\n [class.is-invalid]=\"fileUploadFormControl.invalid && fileUploadFormControl.touched\">\r\n </div>\r\n\r\n </div>\r\n\r\n <div *ngFor=\"let item of uploader.queue\">\r\n <div class=\"fileInfoContainer ui-file btn-group mb-3\">\r\n <a href=\"{{ item?._file?.url}}\" download>\r\n <button type=\"button\" class=\"download-link btn btn-light btn-sm\">\r\n <span>\r\n <i class=\"icon fa fa-download\"></i>\r\n <span class=\"upload-file-info\">{{ item?.file?.name }}</span>\r\n </span>\r\n </button>\r\n </a>\r\n <span class=\"removeUIFile remove-link btn btn-xs btn-danger d-flex align-items-center justify-content-center\"\r\n (click)=\"item.remove();removeFromControlValue(item)\">\r\n <i class=\"fa fa-times px-0\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"text-danger Required-text\" *ngIf=\"(fileUploadFormControl.invalid && fileUploadFormControl.touched)\">\r\n {{getErrorValidation(fileUploadFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n\r\n\r\n <div class=\"col-md-9 col-sm-9\">\r\n\r\n <div>\r\n <label>\r\n {{options.LabelDescription}}\r\n </label>\r\n </div>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n</div>\r\n",
965
- styles: [".e-tip-content{background-color:#afafaf;color:#fff;padding-left:10px;padding-right:10px;padding-top:2px}.my-drop-zone{border:dotted 3px lightgray}.nv-file-over{border:dotted 3px red}.another-file-over-class{border:dotted 3px green}html,body{height:100%}\n"]
966
- },] }
967
- ];
968
- FileUploadComponent.ctorParameters = function () { return [
969
- { type: forms.ControlContainer, decorators: [{ type: i0.Optional }] },
970
- { type: forms.FormGroupDirective },
971
- { type: ControlUtility },
972
- { type: bbsfUtilities.UtilityService },
973
- { type: bbsfUtilities.ControlValidationService },
974
- { type: GlobalSettings }
975
- ]; };
976
- FileUploadComponent.propDecorators = {
977
- fileInput: [{ type: i0.ViewChild, args: ['fileInput', { static: false },] }],
978
- group: [{ type: i0.Input }],
979
- options: [{ type: i0.Input }],
980
- OnChange: [{ type: i0.Output }]
981
- };
982
-
983
- /*! *****************************************************************************
984
- Copyright (c) Microsoft Corporation.
985
-
986
- Permission to use, copy, modify, and/or distribute this software for any
987
- purpose with or without fee is hereby granted.
988
-
989
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
990
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
991
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
992
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
993
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
994
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
995
- PERFORMANCE OF THIS SOFTWARE.
996
- ***************************************************************************** */
997
- /* global Reflect, Promise */
998
- var extendStatics = function (d, b) {
999
- extendStatics = Object.setPrototypeOf ||
1000
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1001
- function (d, b) { for (var p in b)
1002
- if (Object.prototype.hasOwnProperty.call(b, p))
1003
- d[p] = b[p]; };
1004
- return extendStatics(d, b);
1005
- };
1006
- function __extends(d, b) {
1007
- if (typeof b !== "function" && b !== null)
1008
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1009
- extendStatics(d, b);
1010
- function __() { this.constructor = d; }
1011
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1012
- }
1013
- var __assign = function () {
1014
- __assign = Object.assign || function __assign(t) {
1015
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1016
- s = arguments[i];
1017
- for (var p in s)
1018
- if (Object.prototype.hasOwnProperty.call(s, p))
1019
- t[p] = s[p];
1119
+ this.fileUploadFormControl.setValidators(this.validationRules);
1120
+ this.fileUploadFormControl.setAsyncValidators(this.validationRulesasync);
1121
+ if (this.options.IsDisabled) {
1122
+ this.fileUploadFormControl.disable();
1020
1123
  }
1021
- return t;
1124
+ this.MultipleFileUplaodControlHost.ngSubmit.subscribe(function (value) {
1125
+ _this.group.markAllAsTouched();
1126
+ _this.markAllAsTouched = true;
1127
+ });
1128
+ this.fileUploadFormControl.setValue(this.options.Value);
1022
1129
  };
1023
- return __assign.apply(this, arguments);
1024
- };
1025
- function __rest(s, e) {
1026
- var t = {};
1027
- for (var p in s)
1028
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1029
- t[p] = s[p];
1030
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1031
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1032
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1033
- t[p[i]] = s[p[i]];
1130
+ FileUploadComponent.prototype.ngAfterViewInit = function () {
1131
+ if (this.options.AttributeList != null) {
1132
+ var element = document.getElementById(this.options.Name);
1133
+ for (var index = 0; index < this.options.AttributeList.length; index++) {
1134
+ element.setAttribute(this.options.AttributeList[index].Key, this.options.AttributeList[index].value);
1135
+ }
1034
1136
  }
1035
- return t;
1036
- }
1037
- function __decorate(decorators, target, key, desc) {
1038
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1039
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1040
- r = Reflect.decorate(decorators, target, key, desc);
1041
- else
1042
- for (var i = decorators.length - 1; i >= 0; i--)
1043
- if (d = decorators[i])
1044
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1045
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1046
- }
1047
- function __param(paramIndex, decorator) {
1048
- return function (target, key) { decorator(target, key, paramIndex); };
1049
- }
1050
- function __metadata(metadataKey, metadataValue) {
1051
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1052
- return Reflect.metadata(metadataKey, metadataValue);
1053
- }
1054
- function __awaiter(thisArg, _arguments, P, generator) {
1055
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1056
- return new (P || (P = Promise))(function (resolve, reject) {
1057
- function fulfilled(value) { try {
1058
- step(generator.next(value));
1137
+ };
1138
+ FileUploadComponent.prototype.showGlobalError = function () {
1139
+ this.controlUtility.showGlobalError();
1140
+ };
1141
+ FileUploadComponent.prototype.getErrorValidation = function (ErrorList) {
1142
+ if (this.markAllAsTouched && this.group.invalid) {
1143
+ this.showGlobalError();
1144
+ this.markAllAsTouched = false;
1059
1145
  }
1060
- catch (e) {
1061
- reject(e);
1062
- } }
1063
- function rejected(value) { try {
1064
- step(generator["throw"](value));
1146
+ return this.controlUtility.getErrorValidationMassage(ErrorList, this.group, this.options);
1147
+ };
1148
+ FileUploadComponent.prototype.fileOverAnother = function (event) {
1149
+ this.hasAnotherDropZoneOver = event;
1150
+ };
1151
+ FileUploadComponent.prototype.onFileChange = function () {
1152
+ var _this = this;
1153
+ var FilesArray = [];
1154
+ if (this.options.IsMultipleFile && this.options.MinNoOfFiles != null && this.options.MinNoOfFiles > 0 && this.options.MinNoOfFiles > this.uploader.queue.length) {
1155
+ var formControl = this.fileUploadFormControl;
1156
+ formControl.setErrors({ MinFileCountValidationKey: this.options.MinNoOfFiles });
1157
+ formControl.markAsTouched();
1158
+ this.uploader.queue = [];
1159
+ return;
1065
1160
  }
1066
- catch (e) {
1067
- reject(e);
1068
- } }
1069
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1070
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1071
- });
1072
- }
1073
- function __generator(thisArg, body) {
1074
- var _ = { label: 0, sent: function () { if (t[0] & 1)
1075
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1076
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
1077
- function verb(n) { return function (v) { return step([n, v]); }; }
1078
- function step(op) {
1079
- if (f)
1080
- throw new TypeError("Generator is already executing.");
1081
- while (_)
1082
- try {
1083
- 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)
1084
- return t;
1085
- if (y = 0, t)
1086
- op = [op[0] & 2, t.value];
1087
- switch (op[0]) {
1088
- case 0:
1089
- case 1:
1090
- t = op;
1091
- break;
1092
- case 4:
1093
- _.label++;
1094
- return { value: op[1], done: false };
1095
- case 5:
1096
- _.label++;
1097
- y = op[1];
1098
- op = [0];
1099
- continue;
1100
- case 7:
1101
- op = _.ops.pop();
1102
- _.trys.pop();
1103
- continue;
1104
- default:
1105
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1106
- _ = 0;
1107
- continue;
1108
- }
1109
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
1110
- _.label = op[1];
1111
- break;
1112
- }
1113
- if (op[0] === 6 && _.label < t[1]) {
1114
- _.label = t[1];
1115
- t = op;
1116
- break;
1117
- }
1118
- if (t && _.label < t[2]) {
1119
- _.label = t[2];
1120
- _.ops.push(op);
1121
- break;
1122
- }
1123
- if (t[2])
1124
- _.ops.pop();
1125
- _.trys.pop();
1126
- continue;
1127
- }
1128
- op = body.call(thisArg, _);
1129
- }
1130
- catch (e) {
1131
- op = [6, e];
1132
- y = 0;
1161
+ if (this.options.IsMultipleFile && this.options.MaxNoOfFiles != null && this.options.MaxNoOfFiles > 0 && this.options.MaxNoOfFiles < this.uploader.queue.length) {
1162
+ var formControl = this.fileUploadFormControl;
1163
+ formControl.setErrors({ MaxFileCountValidationKey: this.options.MaxNoOfFiles });
1164
+ formControl.markAsTouched();
1165
+ this.uploader.queue = [];
1166
+ return;
1167
+ }
1168
+ if (this.options.IsMultipleFile && (this.options.MaxSizeForAllFilesInMB != null && this.options.MaxSizeForAllFilesInMB > 0)) {
1169
+ var AllSizeFile = 0;
1170
+ for (var index = 0; index < this.uploader.queue.length; index++) {
1171
+ var element = this.uploader.queue[index];
1172
+ var file = element.file;
1173
+ AllSizeFile = AllSizeFile + file.size;
1133
1174
  }
1134
- finally {
1135
- f = t = 0;
1175
+ var MaxSizeForAllFiles = this.options.MaxSizeForAllFilesInMB * 1000 * 1000;
1176
+ if (AllSizeFile > MaxSizeForAllFiles) {
1177
+ var formControl = this.fileUploadFormControl;
1178
+ formControl.setErrors({ MaxSizeForAllFilesInMB: this.options.MaxSizeForAllFilesInMB + 'M' });
1179
+ formControl.markAsTouched();
1180
+ this.uploader.queue = [];
1181
+ return;
1136
1182
  }
1137
- if (op[0] & 5)
1138
- throw op[1];
1139
- return { value: op[0] ? op[1] : void 0, done: true };
1140
- }
1141
- }
1142
- var __createBinding = Object.create ? (function (o, m, k, k2) {
1143
- if (k2 === undefined)
1144
- k2 = k;
1145
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
1146
- }) : (function (o, m, k, k2) {
1147
- if (k2 === undefined)
1148
- k2 = k;
1149
- o[k2] = m[k];
1150
- });
1151
- function __exportStar(m, o) {
1152
- for (var p in m)
1153
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
1154
- __createBinding(o, m, p);
1155
- }
1156
- function __values(o) {
1157
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1158
- if (m)
1159
- return m.call(o);
1160
- if (o && typeof o.length === "number")
1161
- return {
1162
- next: function () {
1163
- if (o && i >= o.length)
1164
- o = void 0;
1165
- return { value: o && o[i++], done: !o };
1183
+ }
1184
+ var AddedQueue = this.uploader.queue.filter(function (object) { return object["some"].lastModified != null; });
1185
+ var _loop_1 = function (index) {
1186
+ var element = AddedQueue[index];
1187
+ var file = element.file;
1188
+ var maxFileSize = this_1.options.FileMaxSizeInMB * 1000 * 1000;
1189
+ if (file) {
1190
+ var fileType = file.type;
1191
+ if (file.size > maxFileSize) {
1192
+ var formControl = this_1.fileUploadFormControl;
1193
+ formControl.setErrors({ FileMaxSizeInMB: this_1.options.FileMaxSizeInMB + 'M' });
1194
+ formControl.markAsTouched();
1195
+ this_1.uploader.queue = [];
1196
+ return { value: void 0 };
1197
+ }
1198
+ if (this_1.options.FileUploadAcceptsTypes != null && this_1.options.FileUploadAcceptsTypes.length > 0 && !(this_1.AcceptedTypeArray.includes(fileType.toUpperCase()) || this_1.AcceptedTypeArray.includes(fileType.toLowerCase()))) {
1199
+ var formControl = this_1.fileUploadFormControl;
1200
+ formControl.setErrors({ ToolTipTypeError: this_1.ToolTipTypeArray });
1201
+ formControl.markAsTouched();
1202
+ this_1.uploader.queue = [];
1203
+ return { value: void 0 };
1204
+ }
1205
+ var reader_1 = new FileReader();
1206
+ var fileObject = file.rawFile;
1207
+ reader_1.readAsDataURL(fileObject);
1208
+ reader_1.onload = function () {
1209
+ var existingID_GUID = null;
1210
+ if (!_this.options.IsMultipleFile && _this.file)
1211
+ existingID_GUID = _this.file.NameWithExtension == file.name ? _this.file.ID_GUID : null;
1212
+ var AddedFile = {
1213
+ FileName: file.name,
1214
+ FileType: file.type,
1215
+ FileBase64: reader_1.result.toString().split(',')[1],
1216
+ FileSizeInMB: ((file.size / 1000) / 1000),
1217
+ NameWithExtension: file.name,
1218
+ ID_GUID: existingID_GUID
1219
+ };
1220
+ if (_this.options.IsMultipleFile == false) {
1221
+ _this.fileUploadModel = new FileUploadModel();
1222
+ _this.fileUploadModel.File = AddedFile;
1223
+ _this.fileUploadFormControl.setValue(_this.fileUploadModel);
1224
+ _this.group.get(_this.options.Name).setValue(_this.fileUploadModel);
1225
+ }
1226
+ else {
1227
+ FilesArray.push(AddedFile);
1228
+ _this.multipleFileUploadModel.UploadedFiles = FilesArray;
1229
+ if (_this.options.Value != null && _this.options.Value != undefined) {
1230
+ if (_this.options.Value.CorrelationID_GUID == null) {
1231
+ _this.multipleFileUploadModel.RemovedFiles = [];
1232
+ }
1233
+ }
1234
+ _this.fileUploadFormControl.setValue(_this.multipleFileUploadModel);
1235
+ _this.group.get(_this.options.Name).setValue(_this.multipleFileUploadModel);
1236
+ }
1237
+ };
1238
+ var originalValue = this_1.group.get(this_1.options.Name).value;
1239
+ if (this_1.options.PatchFunction && this_1.options.PatchPath && this_1.group.get(this_1.options.Name).valid) {
1240
+ this_1.controlUtility.patchControlValue(originalValue, this_1.options.PatchFunction, this_1.options.PatchPath);
1241
+ }
1242
+ this_1.OnChange.emit(originalValue);
1166
1243
  }
1167
1244
  };
1168
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1169
- }
1170
- function __read(o, n) {
1171
- var m = typeof Symbol === "function" && o[Symbol.iterator];
1172
- if (!m)
1173
- return o;
1174
- var i = m.call(o), r, ar = [], e;
1175
- try {
1176
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
1177
- ar.push(r.value);
1178
- }
1179
- catch (error) {
1180
- e = { error: error };
1181
- }
1182
- finally {
1183
- try {
1184
- if (r && !r.done && (m = i["return"]))
1185
- m.call(i);
1245
+ var this_1 = this;
1246
+ for (var index = 0; index < AddedQueue.length; index++) {
1247
+ var state_1 = _loop_1(index);
1248
+ if (typeof state_1 === "object")
1249
+ return state_1.value;
1186
1250
  }
1187
- finally {
1188
- if (e)
1189
- throw e.error;
1251
+ };
1252
+ FileUploadComponent.prototype.removeFromControlValue = function (item) {
1253
+ if (this.options.IsMultipleFile == false) {
1254
+ this.fileUploadModel = null;
1255
+ if (this.options.IsRequired == true) {
1256
+ this.fileUploadFormControl.markAsTouched();
1257
+ this.fileUploadFormControl.invalid;
1258
+ }
1259
+ this.group.get(this.options.Name).setValue(this.fileUploadModel);
1190
1260
  }
1191
- }
1192
- return ar;
1193
- }
1194
- /** @deprecated */
1195
- function __spread() {
1196
- for (var ar = [], i = 0; i < arguments.length; i++)
1197
- ar = ar.concat(__read(arguments[i]));
1198
- return ar;
1199
- }
1200
- /** @deprecated */
1201
- function __spreadArrays() {
1202
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
1203
- s += arguments[i].length;
1204
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
1205
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1206
- r[k] = a[j];
1207
- return r;
1208
- }
1209
- function __spreadArray(to, from, pack) {
1210
- if (pack || arguments.length === 2)
1211
- for (var i = 0, l = from.length, ar; i < l; i++) {
1212
- if (ar || !(i in from)) {
1213
- if (!ar)
1214
- ar = Array.prototype.slice.call(from, 0, i);
1215
- ar[i] = from[i];
1261
+ else {
1262
+ if (this.options.Value != null && this.options.Value != undefined) {
1263
+ if (this.options.Value.CorrelationID_GUID == null) {
1264
+ this.deletedFiles = [];
1265
+ this.multipleFileUploadModel.RemovedFiles = [];
1266
+ }
1267
+ else {
1268
+ if (this.multipleFileUploadModel.RemovedFiles.length == 0) {
1269
+ var FileObject_1 = item.file.rawFile;
1270
+ var DeletedItem = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension == FileObject_1.name; })[0];
1271
+ this.multipleFileUploadModel.ExistingFiles = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension != FileObject_1.name; });
1272
+ this.deletedFiles.push(DeletedItem);
1273
+ this.multipleFileUploadModel.RemovedFiles.push(DeletedItem.ID_GUID);
1274
+ }
1275
+ else {
1276
+ var FileObject_2 = item.file.rawFile;
1277
+ var deletedList = this.deletedFiles.filter(function (Object) { return Object.NameWithExtension == FileObject_2.name; });
1278
+ if (deletedList.length == 0 || deletedList == undefined) {
1279
+ var DeletedItem = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension == FileObject_2.name; })[0];
1280
+ this.multipleFileUploadModel.ExistingFiles = this.multipleFileUploadModel.ExistingFiles.filter(function (Object) { return Object.NameWithExtension != FileObject_2.name; });
1281
+ this.deletedFiles.push(DeletedItem);
1282
+ this.multipleFileUploadModel.RemovedFiles.push(DeletedItem.ID_GUID);
1283
+ }
1284
+ }
1285
+ }
1286
+ }
1287
+ else {
1288
+ this.deletedFiles = [];
1289
+ this.multipleFileUploadModel.RemovedFiles = [];
1290
+ }
1291
+ this.multipleFileUploadModel.UploadedFiles = this.multipleFileUploadModel.UploadedFiles.filter(function (Object) { return Object.NameWithExtension != item._file.name; });
1292
+ if ((this.multipleFileUploadModel.UploadedFiles == null || this.multipleFileUploadModel.UploadedFiles == []) && this.options.IsRequired) {
1293
+ this.fileUploadFormControl.markAsTouched();
1294
+ this.fileUploadFormControl.invalid;
1216
1295
  }
1296
+ this.fileUploadFormControl.setValue(this.multipleFileUploadModel);
1297
+ this.group.get(this.options.Name).setValue(this.multipleFileUploadModel);
1217
1298
  }
1218
- return to.concat(ar || Array.prototype.slice.call(from));
1219
- }
1220
- function __await(v) {
1221
- return this instanceof __await ? (this.v = v, this) : new __await(v);
1222
- }
1223
- function __asyncGenerator(thisArg, _arguments, generator) {
1224
- if (!Symbol.asyncIterator)
1225
- throw new TypeError("Symbol.asyncIterator is not defined.");
1226
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
1227
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1228
- function verb(n) { if (g[n])
1229
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1230
- function resume(n, v) { try {
1231
- step(g[n](v));
1232
- }
1233
- catch (e) {
1234
- settle(q[0][3], e);
1235
- } }
1236
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1237
- function fulfill(value) { resume("next", value); }
1238
- function reject(value) { resume("throw", value); }
1239
- function settle(f, v) { if (f(v), q.shift(), q.length)
1240
- resume(q[0][0], q[0][1]); }
1241
- }
1242
- function __asyncDelegator(o) {
1243
- var i, p;
1244
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1245
- 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; }
1246
- }
1247
- function __asyncValues(o) {
1248
- if (!Symbol.asyncIterator)
1249
- throw new TypeError("Symbol.asyncIterator is not defined.");
1250
- var m = o[Symbol.asyncIterator], i;
1251
- 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);
1252
- 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); }); }; }
1253
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
1254
- }
1255
- function __makeTemplateObject(cooked, raw) {
1256
- if (Object.defineProperty) {
1257
- Object.defineProperty(cooked, "raw", { value: raw });
1258
- }
1259
- else {
1260
- cooked.raw = raw;
1261
- }
1262
- return cooked;
1263
- }
1264
- ;
1265
- var __setModuleDefault = Object.create ? (function (o, v) {
1266
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1267
- }) : function (o, v) {
1268
- o["default"] = v;
1269
- };
1270
- function __importStar(mod) {
1271
- if (mod && mod.__esModule)
1272
- return mod;
1273
- var result = {};
1274
- if (mod != null)
1275
- for (var k in mod)
1276
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
1277
- __createBinding(result, mod, k);
1278
- __setModuleDefault(result, mod);
1279
- return result;
1280
- }
1281
- function __importDefault(mod) {
1282
- return (mod && mod.__esModule) ? mod : { default: mod };
1283
- }
1284
- function __classPrivateFieldGet(receiver, state, kind, f) {
1285
- if (kind === "a" && !f)
1286
- throw new TypeError("Private accessor was defined without a getter");
1287
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1288
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
1289
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1290
- }
1291
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
1292
- if (kind === "m")
1293
- throw new TypeError("Private method is not writable");
1294
- if (kind === "a" && !f)
1295
- throw new TypeError("Private accessor was defined without a setter");
1296
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1297
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
1298
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1299
- }
1299
+ };
1300
+ return FileUploadComponent;
1301
+ }());
1302
+ FileUploadComponent.controlContainerstatic = null;
1303
+ FileUploadComponent.decorators = [
1304
+ { type: i0.Component, args: [{
1305
+ selector: 'BBSF-FileUplaod',
1306
+ template: "\r\n<div class=\"b-control b-fileupload\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\">\r\n <label class=\"col-form-label col-sm-12 mb-2\" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n\r\n <ejs-tooltip id=\"tooltip\" content='{{ValidationMessage}}' tipPointerPosition='Middle'\r\n *ngIf=\"(ValidationMessage!=null&&ValidationMessage!='')\">\r\n <i class=\"fa fa-info-circle\" data-plugin=\"tooltip\" data-html=\"true\">\r\n </i>\r\n </ejs-tooltip>\r\n\r\n\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n\r\n <div>\r\n\r\n <div ng2FileDrop *ngIf=\"(options.IsDropZone)&&(!((options.IsMultipleFile==false)&&(uploader.queue.length)>0))\"\r\n [ngClass]=\"{'another-file-over-class': hasAnotherDropZoneOver}\" (onFileDrop)=\"onFileChange()\"\r\n (fileOver)=\"fileOverAnother($event)\" [uploader]=\"uploader\" [accept]=\"AcceptedType\"\r\n class=\"well my-drop-zoneform-control bnsights-control {{options.ExtraClasses}}\"\r\n (change)=\"onFileChange()\" id=\"{{options.Name}}\" multiple=\"{{options.IsMultipleFile?'multiple':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" type=\"file\" formControlName=\"{{options.Name}}\"\r\n id=\"options.Name\" #fileInput\r\n [class.is-invalid]=\"fileUploadFormControl.invalid && fileUploadFormControl.touched\">\r\n\r\n\r\n <div class=\"dragndrop text-center\">\r\n <p class=\"drag-icon mb-3\">\r\n <i class=\"fas fa-cloud-download-alt\"></i>\r\n </p>\r\n <p>\r\n {{UtilityService.getResourceValue(\"DragAndDropHere\")}}\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"(!options.IsDropZone)&&!((uploader.queue.length>0)&&(!options.IsMultipleFile))\">\r\n <button type=\"button\" class=\"btn btn-light btn-sm file-fake-input mb-3\" (click)=\"fileInput.click();\">\r\n <i class=\"icon fa fa-cloud-upload-alt\"></i>\r\n {{UtilityService.getResourceValue(\"Upload\")}}\r\n </button>\r\n <input ng2FileSelect [uploader]=\"uploader\" [accept]=\"AcceptedType\"\r\n class=\"fileSelector customFileUploadPlacment hidden v-required-multiplefiles d-none\" id=\"file\"\r\n multiple=\"{{options.IsMultipleFile?'multiple':''}}\" name=\"file\" type=\"file\" value=\"\"\r\n autocomplete=\"off\" (change)=\"onFileChange()\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\"\r\n id=\"{{options.Name}}\" aria-describedby=\"email-error\" aria-invalid=\"true\" type=\"file\"\r\n formControlName=\"{{options.Name}}\" id=\"options.Name\" #fileInput\r\n [class.is-invalid]=\"fileUploadFormControl.invalid && fileUploadFormControl.touched\">\r\n </div>\r\n\r\n </div>\r\n\r\n <div *ngFor=\"let item of uploader.queue\">\r\n <div class=\"fileInfoContainer ui-file btn-group mb-3\">\r\n <a href=\"{{ item?._file?.url}}\" download>\r\n <button type=\"button\" class=\"download-link btn btn-light btn-sm\">\r\n <span>\r\n <i class=\"icon fa fa-download\"></i>\r\n <span class=\"upload-file-info\">{{ item?.file?.name }}</span>\r\n </span>\r\n </button>\r\n </a>\r\n <span class=\"removeUIFile remove-link btn btn-xs btn-danger d-flex align-items-center justify-content-center\"\r\n (click)=\"item.remove();removeFromControlValue(item)\">\r\n <i class=\"fa fa-times px-0\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"text-danger Required-text\" *ngIf=\"(fileUploadFormControl.invalid && fileUploadFormControl.touched)\">\r\n {{getErrorValidation(fileUploadFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n\r\n\r\n <div class=\"col-md-9 col-sm-9\">\r\n\r\n <div>\r\n <label>\r\n {{options.LabelDescription}}\r\n </label>\r\n </div>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n</div>\r\n",
1307
+ styles: [".e-tip-content{background-color:#afafaf;color:#fff;padding-left:10px;padding-right:10px;padding-top:2px}.my-drop-zone{border:dotted 3px lightgray}.nv-file-over{border:dotted 3px red}.another-file-over-class{border:dotted 3px green}html,body{height:100%}\n"]
1308
+ },] }
1309
+ ];
1310
+ FileUploadComponent.ctorParameters = function () { return [
1311
+ { type: forms.ControlContainer, decorators: [{ type: i0.Optional }] },
1312
+ { type: forms.FormGroupDirective },
1313
+ { type: ControlUtility },
1314
+ { type: bbsfUtilities.UtilityService },
1315
+ { type: bbsfUtilities.ControlValidationService },
1316
+ { type: GlobalSettings }
1317
+ ]; };
1318
+ FileUploadComponent.propDecorators = {
1319
+ fileInput: [{ type: i0.ViewChild, args: ['fileInput', { static: false },] }],
1320
+ group: [{ type: i0.Input }],
1321
+ options: [{ type: i0.Input }],
1322
+ OnChange: [{ type: i0.Output }]
1323
+ };
1300
1324
 
1301
1325
  var EnglishArabicDTO = /** @class */ (function () {
1302
1326
  function EnglishArabicDTO() {
@@ -4115,6 +4139,7 @@
4115
4139
  function AutocompleteDTO() {
4116
4140
  this.key = "";
4117
4141
  this.value = "";
4142
+ this.image = "";
4118
4143
  }
4119
4144
  return AutocompleteDTO;
4120
4145
  }());
@@ -4144,6 +4169,7 @@
4144
4169
  this.validationRulesasync = [];
4145
4170
  this.dataList = [];
4146
4171
  this.SelectedValue = "";
4172
+ this.avatarImage = "https://upload.wikimedia.org/wikipedia/commons/7/7c/Profile_avatar_placeholder_large.png?20150327203541";
4147
4173
  this.resetError = function () {
4148
4174
  _this.controlValidationService.RemoveGlobalError();
4149
4175
  };
@@ -4345,7 +4371,7 @@
4345
4371
  { type: i0.Component, args: [{
4346
4372
  // tslint:disable-next-line: component-selector
4347
4373
  selector: 'BBSF-AutocompleteTextBox',
4348
- template: "<div class=\"b-control b-auto-complete-textbox\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n\r\n <!-- <input \r\n[(ngModel)]=\"Search\"\r\n value=\"{{Search}}\" \r\n autocomplete=\"off\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.Name}}\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\"\r\n typeaheadOptionField=\"{{Value}}\"\r\n [typeahead]=\"suggestions$\"\r\n [typeaheadAsync]=\"true\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" (typeaheadOnSelect)=\"handleResultSelected($event)\" (blur)=\"onBlur($event.target.value)\" /> -->\r\n <!-- \r\n <input ngxTypeahead autocomplete=\"off\"\r\n value=\"{{Search}}\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.Name}}\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" [taUrl]=\"options.ActionURL\"\r\n [taParams]=\"options.Params\" taQueryParam=\"{{QueryParam}}\" taApi=\"{{Api}}\" taListItemLabel=\"{{Value}}\" (taSelected)=\"handleResultSelected($event)\"> -->\r\n\r\n\r\n\r\n <ng-autocomplete *ngIf=\"!options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n [notFoundTemplate]=\"notFoundTemplate\" class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\" formControlName=\"{{options.Name}}\" aria-describedby=\"email-error\"\r\n aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\">\r\n </ng-autocomplete>\r\n\r\n <ng-autocomplete *ngIf=\"options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\" dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n formControlName=\"{{options.Name}}\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\">\r\n </ng-autocomplete>\r\n\r\n\r\n\r\n <ng-template #itemTemplate let-item>\r\n <a [innerHTML]=\"item.value\"></a>\r\n </ng-template>\r\n\r\n <ng-template #notFoundTemplate let-notFound>\r\n <div [innerHTML]=\"notFound\"></div>\r\n </ng-template>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched)\">\r\n {{getErrorValidation(AutocompleteTextBoxControl.errors|keyvalue)}}\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n <div class=\"control-desc text-dark\">{{options.LabelDescription}}</div>\r\n </div>\r\n\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n\r\n </div>\r\n </div>\r\n</div>",
4374
+ template: "<div class=\"b-control b-auto-complete-textbox\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n\r\n <!-- <input \r\n[(ngModel)]=\"Search\"\r\n value=\"{{Search}}\" \r\n autocomplete=\"off\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.Name}}\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\"\r\n typeaheadOptionField=\"{{Value}}\"\r\n [typeahead]=\"suggestions$\"\r\n [typeaheadAsync]=\"true\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" (typeaheadOnSelect)=\"handleResultSelected($event)\" (blur)=\"onBlur($event.target.value)\" /> -->\r\n <!-- \r\n <input ngxTypeahead autocomplete=\"off\"\r\n value=\"{{Search}}\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.Name}}\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" [taUrl]=\"options.ActionURL\"\r\n [taParams]=\"options.Params\" taQueryParam=\"{{QueryParam}}\" taApi=\"{{Api}}\" taListItemLabel=\"{{Value}}\" (taSelected)=\"handleResultSelected($event)\"> -->\r\n\r\n\r\n\r\n <ng-autocomplete *ngIf=\"!options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n [notFoundTemplate]=\"notFoundTemplate\" class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\" formControlName=\"{{options.Name}}\" aria-describedby=\"email-error\"\r\n aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\">\r\n </ng-autocomplete>\r\n\r\n <ng-autocomplete *ngIf=\"options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\" dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n formControlName=\"{{options.Name}}\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\">\r\n </ng-autocomplete>\r\n\r\n\r\n\r\n <ng-template #itemTemplate let-item>\r\n <img *ngIf=\"options.ItemWithImage\" style=\"border-radius:50%; height:40px; width: 40px; float:left; margin-left:5px ; margin-top: 5px;margin-right: 5px;\" src=\"{{(item.image?item.image:avatarImage)}}\" />\r\n <a [innerHTML]=\"item.value\"></a>\r\n </ng-template>\r\n\r\n <ng-template #notFoundTemplate let-notFound>\r\n <div [innerHTML]=\"notFound\"></div>\r\n </ng-template>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched)\">\r\n {{getErrorValidation(AutocompleteTextBoxControl.errors|keyvalue)}}\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n <div class=\"control-desc text-dark\">{{options.LabelDescription}}</div>\r\n </div>\r\n\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n",
4349
4375
  styles: [""]
4350
4376
  },] }
4351
4377
  ];
@@ -4561,7 +4587,7 @@
4561
4587
  { type: i0.Component, args: [{
4562
4588
  // tslint:disable-next-line: component-selector
4563
4589
  selector: 'BBSF-TagsInput',
4564
- template: "<div class=\"b-control b-tags-input\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n <div class=\"form-group row\" [formGroup]=\"TagsFormGroup\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <ngx-tags-input id=\"typeahead-http\" type=\"text\" class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\" [disabled]=\"options.IsDisabled\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"tags\"\r\n [class.is-invalid]=\"TagsFormControl.invalid && TagsFormControl.touched\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\"\r\n (onTagsChanged)=\"onTagsChanged($event)\" [(ngModel)]=\"tags\" removeLastOnBackspace=\"{{options.RemoveLastOnBackspace}}\" (onNoOptionsMatch)=\"onNoOptionsMatch($event)\" [options]=\"searchFunctionFactory(SearchKey.selected)\" #SearchKey scrollableOptions=\"{{options.ScrollableOptions}}\" scrollableOptionsInView=\"{{options.MaxSearchResultsCount}}\" (keypress)=\"AddTag($event.key,SearchKey)\" maxTags=\"{{options.MaxNumberTags}}\" minLengthBeforeOptions=\"{{options.MinSearchLength}}\" displayField=\"{{options.DatasourceItemText}}\" name=\"tags\">\r\n </ngx-tags-input>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(TagsFormControl.invalid && TagsFormControl.touched)\">\r\n {{getErrorValidation(TagsFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n \r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n <div class=\"control-desc text-dark\">{{options.LabelDescription}}</div>\r\n </div>\r\n\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n",
4590
+ template: "<div class=\"b-control b-tags-input\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n <div class=\"form-group row\" [formGroup]=\"TagsFormGroup\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <b-tags-input id=\"typeahead-http\" type=\"text\" class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\" [disabled]=\"options.IsDisabled\" aria-describedby=\"email-error\"\r\n aria-invalid=\"true\" formControlName=\"tags\"\r\n [class.is-invalid]=\"TagsFormControl.invalid && TagsFormControl.touched\" placeholder=\"{{options.Placeholder}}\"\r\n id=\"{{options.Name}}\" (onTagsChanged)=\"onTagsChanged($event)\" [(ngModel)]=\"tags\"\r\n removeLastOnBackspace=\"{{options.RemoveLastOnBackspace}}\" (onNoOptionsMatch)=\"onNoOptionsMatch($event)\"\r\n [options]=\"searchFunctionFactory(SearchKey.selected)\" #SearchKey\r\n scrollableOptions=\"{{options.ScrollableOptions}}\" scrollableOptionsInView=\"{{options.MaxSearchResultsCount}}\"\r\n (keypress)=\"AddTag($event.key,SearchKey)\" [ViewMode]=\"options.TagInputMode\"\r\n maxTags=\"{{options.MaxNumberTags}}\" minLengthBeforeOptions=\"{{options.MinSearchLength}}\"\r\n [showDescription]=\"options.ShowDescription\" [defaultImageURL]=\"options.DefaultImgUrl\" name=\"tags\">\r\n </b-tags-input>\r\n\r\n <div class=\"text-danger Required-text\" *ngIf=\"(TagsFormControl.invalid && TagsFormControl.touched)\">\r\n {{getErrorValidation(TagsFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n <div class=\"control-desc text-dark\">{{options.LabelDescription}}</div>\r\n </div>\r\n\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n",
4565
4591
  styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}.flip_V{transform:scaleY(-1)}\n"]
4566
4592
  },] }
4567
4593
  ];
@@ -4632,6 +4658,7 @@
4632
4658
  this.direction = '';
4633
4659
  this.IsFirstCall = true;
4634
4660
  this.Items = new i0.EventEmitter();
4661
+ this.subscriptions = new rxjs.Subscription();
4635
4662
  this.ReinitializePaging = function () {
4636
4663
  _this.IsFirstCall = true;
4637
4664
  _this.getItemList(1, true);
@@ -4641,31 +4668,34 @@
4641
4668
  _this.getItemList(_this.CurrentPage);
4642
4669
  };
4643
4670
  }
4671
+ PagingComponent.prototype.ngOnDestroy = function () {
4672
+ this.subscriptions.unsubscribe();
4673
+ };
4644
4674
  PagingComponent.prototype.ngOnInit = function () {
4645
4675
  var _this = this;
4646
4676
  if (this.options.IsLoadMoreControl)
4647
4677
  this.Sum = this.options.PageSize;
4648
4678
  if (this.options.DropdownFiltersControlNames != null && this.options.DropdownFiltersControlNames.length > 0) {
4649
4679
  var DropdownFiltersControlNames = this.options.DropdownFiltersControlNames;
4650
- this.onChangeService.GetValue().subscribe(function (value) {
4680
+ this.subscriptions.add(this.onChangeService.GetValue().subscribe(function (value) {
4651
4681
  var result = _this.options.DropdownFiltersControlNames.filter(function (item) { return item == value; });
4652
4682
  if (result.length > 0) {
4653
4683
  _this.IsFirstCall = true;
4654
4684
  _this.CurrentPage = 1;
4655
4685
  _this.getItemList(_this.CurrentPage, true);
4656
4686
  }
4657
- });
4687
+ }));
4658
4688
  }
4659
4689
  if (this.options.BootstrapDatePickersFiltersControlNames != null && this.options.BootstrapDatePickersFiltersControlNames.length > 0) {
4660
4690
  var BootstrapDatePickersFiltersControlNames = this.options.BootstrapDatePickersFiltersControlNames;
4661
- this.onChangeService.GetValue().subscribe(function (value) {
4691
+ this.subscriptions.add(this.onChangeService.GetValue().subscribe(function (value) {
4662
4692
  var result = _this.options.BootstrapDatePickersFiltersControlNames.filter(function (item) { return item == value; });
4663
4693
  if (result.length > 0) {
4664
4694
  _this.IsFirstCall = true;
4665
4695
  _this.CurrentPage = 1;
4666
4696
  _this.getItemList(_this.CurrentPage, true);
4667
4697
  }
4668
- });
4698
+ }));
4669
4699
  }
4670
4700
  this.IsFirstCall = true;
4671
4701
  this.getItemList(this.CurrentPage, true);
@@ -4856,21 +4886,21 @@
4856
4886
  var ControlValue = this.group.controls[FormControlName].value;
4857
4887
  if (ControlValue != undefined && ControlValue != null && ControlValue != "") {
4858
4888
  if (this.options.Filters[index].FilterType == exports.FilterType.DatePicker) {
4859
- if (Array.isArray(ControlValue)) {
4860
- for (var element = 0; element < ControlValue.length; element++) {
4861
- var value = ControlValue[element];
4862
- filters[this.options.Filters[index].ActionParameterName] = value;
4863
- }
4864
- }
4865
- else {
4866
- filters[this.options.Filters[index].ActionParameterName] = ControlValue;
4867
- }
4889
+ //if (Array.isArray(ControlValue)) {
4890
+ // for (let element = 0; element < ControlValue.length; element++) {
4891
+ // const value = ControlValue[element];
4892
+ // filters[this.options.Filters[index].ActionParameterName] = value;
4893
+ // }
4894
+ //}
4895
+ //else {
4896
+ filters[this.options.Filters[index].ActionParameterName] = ControlValue;
4897
+ //}
4868
4898
  }
4869
4899
  else {
4870
4900
  if (this.options.Filters[index].FilterType == exports.FilterType.AutocompleteTextBox)
4871
- ControlValue = JSON.stringify(ControlValue);
4901
+ ControlValue = ControlValue;
4872
4902
  if (this.options.Filters[index].FilterType == exports.FilterType.TagInput)
4873
- ControlValue = JSON.stringify(ControlValue);
4903
+ ControlValue = ControlValue;
4874
4904
  filters[this.options.Filters[index].ActionParameterName] = ControlValue;
4875
4905
  }
4876
4906
  }
@@ -7382,6 +7412,167 @@
7382
7412
  { type: common.DatePipe }
7383
7413
  ]; };
7384
7414
 
7415
+ exports.TagInputView = void 0;
7416
+ (function (TagInputView) {
7417
+ TagInputView[TagInputView["WithImage"] = 1] = "WithImage";
7418
+ TagInputView[TagInputView["WithoutImage"] = 2] = "WithoutImage";
7419
+ TagInputView[TagInputView["WithInitial"] = 3] = "WithInitial";
7420
+ })(exports.TagInputView || (exports.TagInputView = {}));
7421
+
7422
+ var noop = function () { };
7423
+ var ɵ0$1 = noop;
7424
+ var TAGS_INPUT_TEMPLATE = "\n \n<div class=\"tags-input\">\n<span class=\"tags-input__tag label label-primary badge badge-primary\" *ngFor=\"let tag of tags\">\n {{tag[displayField]}}\n <span *ngIf=\"isDeleteable(tag)\" role=\"button\" class=\"tags-input__tag-remove-btn\" (click)=\"removeTag(tag)\"\n (touch)=\"removeTag(tag)\">\n <span aria-hidden=\"true\">&times;</span>\n <span class=\"sr-only\">Close</span>\n </span>\n</span>\n\n<input *ngIf=\"options === null; else withTypeahead\" class=\"tags-input__input-field\" type=\"text\"\n [placeholder]=\"getPlaceholder()\" name=\"tags\" (keyup.enter)=\"addTag(tagInput)\"\n (keydown.backspace)=\"removeLastTag(tagInput)\" [disabled]=\"!canAddTags || maximumOfTagsReached()\"\n [hidden]=\"!canAddTags || maximumOfTagsReached()\" #tagInput />\n\n<ng-template #withTypeahead>\n <span [ngSwitch]=\"ViewMode\">\n\n <span *ngSwitchCase=\"tagInputViewEnum.WithImage\">\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithImage\" [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n #tagInput />\n </span>\n\n <span *ngSwitchCase=\"tagInputViewEnum.WithoutImage\">\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithoutImage\"\n [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n #tagInput />\n </span>\n\n <span *ngSwitchCase=\"tagInputViewEnum.WithInitial\">\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithoutInitial\"\n [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n #tagInput />\n </span>\n\n <span *ngSwitchDefault>\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithoutImage\"\n [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n #tagInput />\n </span>\n\n </span>\n\n</ng-template>\n\n<ng-template #itemTemplateWithImage let-model=\"item\" let-index=\"index\">\n <img\n style=\"border-radius:50%; height:40px; width: 40px; float:left; margin-left:5px ; margin-top: 5px;margin-right: 5px;\"\n src=\"{{(model.imageURL?model.imageURL:defaultImageURL)}}\" />\n <div>\n <a [innerHTML]=\"model.name\"></a>\n <p *ngIf=\"showDescription\">\n {{model.description}}\n </p>\n </div>\n</ng-template>\n\n<ng-template #itemTemplateWithoutImage let-model=\"item\" let-index=\"index\">\n <div>\n <a [innerHTML]=\"model.name\"></a>\n <p *ngIf=\"showDescription\">\n {{model.description}}\n </p>\n </div>\n</ng-template>\n\n<ng-template #itemTemplateWithoutInitial let-model=\"item\" let-index=\"index\">\n <div class=\"user-image\">\n <div class=\"user-initials\">{{calculateInitials(model.name)}}</div>\n </div>\n <div>\n <a [innerHTML]=\"model.name\"></a>\n <p *ngIf=\"showDescription\">\n {{model.description}}\n </p>\n </div>\n</ng-template>\n</div>\n";
7425
+ var TAGS_INPUT_STYLE = "\n :host {\n overflow: auto;\n white-space: nowrap;\n }\n\n .tags-input {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n }\n\n .tags-input__tag {\n display: inline-block;\n margin-bottom: 2px;\n margin-right: 5px;\n padding-right: 0.3em;\n }\n\n .tags-input__tag-remove-btn {\n cursor: pointer;\n display: inline-block;\n font-size: 12px;\n margin: -3px 0 0 3px;\n padding: 0;\n vertical-align: top;\n }\n\n .tags-input__input-field {\n border: none;\n flex-grow: 1;\n outline: none;\n }\n";
7426
+ var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
7427
+ provide: forms.NG_VALUE_ACCESSOR,
7428
+ useExisting: i0.forwardRef(function () { return BTagsInputComponent; }),
7429
+ multi: true
7430
+ };
7431
+ var BTagsInputComponent = /** @class */ (function () {
7432
+ function BTagsInputComponent() {
7433
+ this.selected = '';
7434
+ this.tags = [];
7435
+ this.onTouchedCallback = noop;
7436
+ this.onChangeCallback = noop;
7437
+ this.tagInputViewEnum = exports.TagInputView;
7438
+ this.removeLastOnBackspace = false;
7439
+ this.canDeleteTags = true;
7440
+ this.canAddTags = true;
7441
+ this.ViewMode = exports.TagInputView.WithoutImage;
7442
+ this.placeholder = '';
7443
+ this.showDescription = true;
7444
+ this.options = null;
7445
+ this.defaultImageURL = null;
7446
+ this.displayField = 'name';
7447
+ this.minLengthBeforeOptions = 1;
7448
+ this.scrollableOptions = false;
7449
+ this.scrollableOptionsInView = 5;
7450
+ this.onTagsChanged = new i0.EventEmitter();
7451
+ this.onMaxTagsReached = new i0.EventEmitter();
7452
+ this.onNoOptionsMatch = new i0.EventEmitter();
7453
+ }
7454
+ BTagsInputComponent.prototype.getPlaceholder = function () {
7455
+ if (this.tags && this.tags.length > 0) {
7456
+ return '';
7457
+ }
7458
+ return this.placeholder;
7459
+ };
7460
+ BTagsInputComponent.prototype.tagsChanged = function (type, tag) {
7461
+ this.onChangeCallback(this.tags);
7462
+ this.onTagsChanged.emit({
7463
+ change: type,
7464
+ tag: tag
7465
+ });
7466
+ if (this.maximumOfTagsReached()) {
7467
+ this.onMaxTagsReached.emit();
7468
+ }
7469
+ };
7470
+ BTagsInputComponent.prototype.removeLastTag = function (tagInput) {
7471
+ if (!this.removeLastOnBackspace || !this.tags.length) {
7472
+ return;
7473
+ }
7474
+ if (tagInput.value === '') {
7475
+ this.removeTag(this.tags[this.tags.length - 1]);
7476
+ }
7477
+ };
7478
+ BTagsInputComponent.prototype.addTag = function (tagInput) {
7479
+ var _a;
7480
+ if (tagInput.value.trim() !== '') {
7481
+ var tag = (_a = {},
7482
+ _a[this.displayField] = tagInput.value,
7483
+ _a);
7484
+ this.addPredefinedTag(tag);
7485
+ }
7486
+ tagInput.value = '';
7487
+ };
7488
+ BTagsInputComponent.prototype.addPredefinedTag = function (tag) {
7489
+ if (!this.maximumOfTagsReached()) {
7490
+ this.tags.push(tag);
7491
+ this.tagsChanged('add', tag);
7492
+ }
7493
+ };
7494
+ BTagsInputComponent.prototype.removeTag = function (tagToRemove) {
7495
+ if (!this.isDeleteable(tagToRemove)) {
7496
+ return;
7497
+ }
7498
+ this.tags = this.tags.filter(function (tag) { return tagToRemove !== tag; });
7499
+ this.tagsChanged('remove', tagToRemove);
7500
+ };
7501
+ BTagsInputComponent.prototype.maximumOfTagsReached = function () {
7502
+ return typeof this.maxTags !== 'undefined' && this.tags && this.tags.length >= this.maxTags;
7503
+ };
7504
+ BTagsInputComponent.prototype.isDeleteable = function (tag) {
7505
+ if (typeof tag.deleteable !== "undefined" && !tag.deleteable) {
7506
+ return false;
7507
+ }
7508
+ return this.canDeleteTags;
7509
+ };
7510
+ BTagsInputComponent.prototype.typeaheadOnSelect = function (e) {
7511
+ var _a;
7512
+ if (typeof e.item === 'string') {
7513
+ this.addPredefinedTag((_a = {},
7514
+ _a[this.displayField] = e.value,
7515
+ _a));
7516
+ }
7517
+ else {
7518
+ this.addPredefinedTag(e.item);
7519
+ }
7520
+ this.selected = '';
7521
+ };
7522
+ BTagsInputComponent.prototype.typeaheadOnNoMatch = function (e) {
7523
+ if (typeof this.onNoOptionsMatch !== 'undefined') {
7524
+ this.onNoOptionsMatch.emit(e);
7525
+ }
7526
+ };
7527
+ BTagsInputComponent.prototype.writeValue = function (value) {
7528
+ if (value !== this.tags) {
7529
+ this.tags = value;
7530
+ }
7531
+ };
7532
+ BTagsInputComponent.prototype.registerOnChange = function (fn) {
7533
+ this.onChangeCallback = fn;
7534
+ };
7535
+ BTagsInputComponent.prototype.registerOnTouched = function (fn) {
7536
+ this.onTouchedCallback = fn;
7537
+ };
7538
+ BTagsInputComponent.prototype.calculateInitials = function (name) {
7539
+ debugger;
7540
+ var fullName = name.split(' ');
7541
+ var initials = "";
7542
+ if (fullName.length > 1)
7543
+ initials = fullName.shift().charAt(0) + fullName.pop().charAt(0);
7544
+ else
7545
+ initials = fullName.shift().charAt(0);
7546
+ return initials.toUpperCase();
7547
+ };
7548
+ return BTagsInputComponent;
7549
+ }());
7550
+ BTagsInputComponent.decorators = [
7551
+ { type: i0.Component, args: [{
7552
+ selector: 'b-tags-input',
7553
+ template: TAGS_INPUT_TEMPLATE,
7554
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR],
7555
+ styles: [TAGS_INPUT_STYLE]
7556
+ },] }
7557
+ ];
7558
+ BTagsInputComponent.propDecorators = {
7559
+ maxTags: [{ type: i0.Input }],
7560
+ removeLastOnBackspace: [{ type: i0.Input }],
7561
+ canDeleteTags: [{ type: i0.Input }],
7562
+ canAddTags: [{ type: i0.Input }],
7563
+ ViewMode: [{ type: i0.Input }],
7564
+ placeholder: [{ type: i0.Input }],
7565
+ showDescription: [{ type: i0.Input }],
7566
+ options: [{ type: i0.Input }],
7567
+ defaultImageURL: [{ type: i0.Input }],
7568
+ minLengthBeforeOptions: [{ type: i0.Input }],
7569
+ scrollableOptions: [{ type: i0.Input }],
7570
+ scrollableOptionsInView: [{ type: i0.Input }],
7571
+ onTagsChanged: [{ type: i0.Output }],
7572
+ onMaxTagsReached: [{ type: i0.Output }],
7573
+ onNoOptionsMatch: [{ type: i0.Output }]
7574
+ };
7575
+
7385
7576
  var options;
7386
7577
  exports.AppInjector = void 0;
7387
7578
  angular.FullCalendarModule.registerPlugins([
@@ -7432,7 +7623,8 @@
7432
7623
  RepeaterItemFieldComponent,
7433
7624
  RepeaterTableComponent,
7434
7625
  BBSFDateTimePipe,
7435
- BBSFDatePipe
7626
+ BBSFDatePipe,
7627
+ BTagsInputComponent
7436
7628
  ],
7437
7629
  imports: [
7438
7630
  common.CommonModule,
@@ -7735,6 +7927,7 @@
7735
7927
  // Params: object={};
7736
7928
  _this.QueryParam = 'query';
7737
7929
  _this.SelectedValue = null;
7930
+ _this.ItemWithImage = false;
7738
7931
  return _this;
7739
7932
  }
7740
7933
  return AutocompleteOptions;
@@ -7759,26 +7952,29 @@
7759
7952
  /** Allow User To Add Tags */
7760
7953
  _this.CanAddTags = true;
7761
7954
  /** Set Max Number Of Tags That User Can Be Select */
7762
- _this.MaxNumberTags = 100;
7955
+ _this.MaxNumberTags = 5;
7763
7956
  /** Set Min Length Of Char To Call Search Function */
7764
7957
  _this.MinSearchLength = 1;
7765
7958
  /**Allow Scrolle Option In Dropdown */
7766
7959
  _this.ScrollableOptions = true;
7767
7960
  /** Set Max Number Of Tags That will Be Appear ON Dropdown */
7768
- _this.MaxSearchResultsCount = 5;
7961
+ _this.MaxSearchResultsCount = 10;
7769
7962
  /**Value Name Of Tag Option In Dropdown */
7770
- _this.DatasourceItemValue = "key";
7963
+ _this.DatasourceItemValue = "id";
7771
7964
  /**Text Of Tag That Will Show In Dropdown */
7772
- _this.DatasourceItemText = "value";
7965
+ _this.DatasourceItemText = "name";
7773
7966
  /**Set Query Param Name By Default It's 'query'*/
7774
7967
  _this.QueryParamName = "query";
7775
7968
  /**Set Query Param Name By Default It's 'query'*/
7776
7969
  _this.SelectedItemsParamName = "SelectedItems";
7777
7970
  /**Set Filter Param Name By Default It's 'query'*/
7778
7971
  _this.FilterParamName = "";
7972
+ _this.DefaultImgUrl = "";
7779
7973
  /** allow add value of TagInput dosn't exist in list*/
7780
7974
  _this.AllowNewSelection = false;
7781
7975
  _this.ValidationToken = null;
7976
+ _this.TagInputMode = exports.TagInputView.WithoutImage;
7977
+ _this.ShowDescription = true;
7782
7978
  return _this;
7783
7979
  }
7784
7980
  return TagsInputOptions;
@@ -8280,6 +8476,7 @@
8280
8476
  exports.CustomValidator = CustomValidator;
8281
8477
  exports.DateInputComponent = DateInputComponent;
8282
8478
  exports.DatePickerOptions = DatePickerOptions;
8479
+ exports.DefaultIntl = DefaultIntl;
8283
8480
  exports.DropdownListComponent = DropdownListComponent;
8284
8481
  exports.DropdownListItem = DropdownListItem;
8285
8482
  exports.DropdownOptions = DropdownOptions;
@@ -8344,6 +8541,7 @@
8344
8541
  exports.environment = environment;
8345
8542
  exports.options = options;
8346
8543
  exports["ɵ0"] = ɵ0;
8544
+ exports["ɵa"] = BTagsInputComponent;
8347
8545
 
8348
8546
  Object.defineProperty(exports, '__esModule', { value: true });
8349
8547