@coreui/angular-pro 4.2.30 → 4.2.32

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.
@@ -7,8 +7,8 @@ import * as i1 from '@angular/animations';
7
7
  import { animation, animate, style, useAnimation, trigger, state, transition, group, query } from '@angular/animations';
8
8
  import * as i3 from '@angular/router';
9
9
  import { NavigationEnd, RouterModule } from '@angular/router';
10
- import { BehaviorSubject, Observable, fromEvent, zipWith, withLatestFrom, Subject, distinctUntilChanged, takeUntil, map, debounceTime } from 'rxjs';
11
- import { filter } from 'rxjs/operators';
10
+ import { BehaviorSubject, Observable, fromEvent, zipWith, withLatestFrom, Subject, distinctUntilChanged, takeUntil as takeUntil$1, map, debounceTime } from 'rxjs';
11
+ import { filter, takeUntil } from 'rxjs/operators';
12
12
  import { isValid, format } from 'date-fns';
13
13
  import { __classPrivateFieldSet, __classPrivateFieldGet, __rest } from 'tslib';
14
14
  import * as i2 from '@angular/forms';
@@ -453,12 +453,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
453
453
  args: ['class']
454
454
  }] } });
455
455
 
456
- let nextId$1 = 0;
456
+ let nextId$2 = 0;
457
457
  class AccordionItemComponent {
458
458
  constructor(accordionService) {
459
459
  this.accordionService = accordionService;
460
460
  this._visible = false;
461
- this.contentId = `accordion-item-${nextId$1++}`;
461
+ this.contentId = `accordion-item-${nextId$2++}`;
462
462
  this.itemContext = { $implicit: this.visible };
463
463
  this.templates = {};
464
464
  }
@@ -8375,10 +8375,10 @@ class MultiSelectOptgroupLabelComponent {
8375
8375
  }
8376
8376
  }
8377
8377
  MultiSelectOptgroupLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptgroupLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8378
- MultiSelectOptgroupLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MultiSelectOptgroupLabelComponent, selector: "c-multi-select-optgroup-label", host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:block}\n"] });
8378
+ MultiSelectOptgroupLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MultiSelectOptgroupLabelComponent, selector: "c-multi-select-optgroup-label", host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
8379
8379
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptgroupLabelComponent, decorators: [{
8380
8380
  type: Component,
8381
- args: [{ selector: 'c-multi-select-optgroup-label', template: "<ng-content></ng-content>\n", styles: [":host{display:block}\n"] }]
8381
+ args: [{ selector: 'c-multi-select-optgroup-label', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}\n"] }]
8382
8382
  }], ctorParameters: function () { return []; }, propDecorators: { hostClasses: [{
8383
8383
  type: HostBinding,
8384
8384
  args: ['class']
@@ -8404,10 +8404,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
8404
8404
  type: Injectable
8405
8405
  }], ctorParameters: function () { return []; } });
8406
8406
 
8407
+ var _MultiSelectOptionComponent_destroy$;
8408
+ /** The next id to use for creating unique DOM IDs. */
8409
+ let nextId$1 = 0;
8407
8410
  class MultiSelectOptionComponent {
8408
- constructor(elementRef, renderer, changeDetectorRef, focusMonitor, multiSelectService) {
8411
+ constructor(elementRef, changeDetectorRef, focusMonitor, multiSelectService) {
8409
8412
  this.elementRef = elementRef;
8410
- this.renderer = renderer;
8411
8413
  this.changeDetectorRef = changeDetectorRef;
8412
8414
  this.focusMonitor = focusMonitor;
8413
8415
  this.multiSelectService = multiSelectService;
@@ -8416,8 +8418,19 @@ class MultiSelectOptionComponent {
8416
8418
  this.selectedChange = new EventEmitter();
8417
8419
  this.hasContent = true;
8418
8420
  this.dropdownVisible = false;
8421
+ _MultiSelectOptionComponent_destroy$.set(this, new Subject());
8422
+ this._generatedId = `coreui-option-${nextId$1++}`;
8423
+ this._id = this._generatedId;
8419
8424
  this._disabled = false;
8420
8425
  this._selected = false;
8426
+ this.setSubscriptions();
8427
+ }
8428
+ /** The id of the option element. */
8429
+ get id() {
8430
+ return this._id || this._generatedId;
8431
+ }
8432
+ set id(value) {
8433
+ this._id = value;
8421
8434
  }
8422
8435
  set disabled(value) {
8423
8436
  this._disabled = coerceBooleanProperty(value);
@@ -8447,14 +8460,22 @@ class MultiSelectOptionComponent {
8447
8460
  'd-none': !this.visible
8448
8461
  };
8449
8462
  }
8463
+ get role() {
8464
+ return 'option';
8465
+ }
8450
8466
  get tabIndex() {
8451
- return this.disabled ? '-1' : '0';
8467
+ return this.disabled ? -1 : 0;
8452
8468
  }
8453
8469
  get ariaDisabled() {
8454
8470
  return this.disabled || null;
8455
8471
  }
8456
8472
  get ariaSelected() {
8457
- return this.selected;
8473
+ return this.selected || undefined;
8474
+ }
8475
+ onKeyDown($event) {
8476
+ if (['Space'].includes($event.code)) {
8477
+ $event.preventDefault();
8478
+ }
8458
8479
  }
8459
8480
  onKeyUp($event) {
8460
8481
  if (this.dropdownVisible) {
@@ -8470,43 +8491,52 @@ class MultiSelectOptionComponent {
8470
8491
  this.selected = this.disabled ? this.selected : !this.selected;
8471
8492
  this.focus('mouse');
8472
8493
  }
8473
- ngAfterContentInit() {
8494
+ ngAfterViewInit() {
8474
8495
  setTimeout(() => {
8475
- var _a;
8476
- this.hasContent = !!((_a = this.content) === null || _a === void 0 ? void 0 : _a.nativeElement.childNodes.length);
8496
+ var _a, _b, _c;
8497
+ this.hasContent = !!((_a = this.contentDiv) === null || _a === void 0 ? void 0 : _a.nativeElement.childNodes.length);
8498
+ if (this.label === undefined) {
8499
+ const innerText = this.elementRef.nativeElement.textContent.trim() || this.elementRef.nativeElement.innerText.trim();
8500
+ this.label = innerText || ((_b = this.value) === null || _b === void 0 ? void 0 : _b.trim()) || '...';
8501
+ }
8502
+ if (this.value === undefined) {
8503
+ this.value = ((_c = this.label) === null || _c === void 0 ? void 0 : _c.trim()) || '...';
8504
+ }
8505
+ if (!this.hasContent) {
8506
+ this.changeDetectorRef.markForCheck();
8507
+ }
8477
8508
  });
8478
- if (!this.label) {
8479
- this.label = this.elementRef.nativeElement.innerText || this.value;
8480
- }
8481
- if (this.value === undefined) {
8482
- this.value = this.elementRef.nativeElement.innerText || this.label;
8483
- }
8484
8509
  }
8510
+ /** Get the label for this element which is required by the FocusableOption interface. */
8485
8511
  getLabel() {
8486
8512
  var _a;
8487
8513
  return ((_a = this.label) !== null && _a !== void 0 ? _a : this.value);
8488
8514
  }
8489
8515
  focus(origin = 'program') {
8490
- if (this.dropdownVisible) {
8516
+ if (this.dropdownVisible && !this.disabled) {
8491
8517
  this.focusMonitor.focusVia(this.elementRef, origin, { preventScroll: false });
8492
8518
  this.changeDetectorRef.markForCheck();
8493
8519
  }
8494
8520
  }
8495
8521
  ngOnDestroy() {
8496
- this.multiselectVisibleSubscription.unsubscribe();
8522
+ __classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f").next(true);
8523
+ __classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f").complete();
8497
8524
  }
8498
- ngOnInit() {
8499
- this.multiselectVisibleSubscription = this.multiSelectService.multiSelectVisible$.subscribe(visible => {
8525
+ setSubscriptions() {
8526
+ this.multiSelectService.multiSelectVisible$
8527
+ .pipe(takeUntil(__classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f")))
8528
+ .subscribe(visible => {
8500
8529
  this.dropdownVisible = visible;
8501
8530
  });
8502
8531
  }
8503
8532
  }
8504
- MultiSelectOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptionComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1$3.FocusMonitor }, { token: MultiSelectService }], target: i0.ɵɵFactoryTarget.Component });
8505
- MultiSelectOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MultiSelectOptionComponent, selector: "c-multi-select-option", inputs: { optionsStyle: "optionsStyle", label: "label", value: "value", visible: "visible", disabled: "disabled", selected: "selected" }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "keyup": "onKeyUp($event)", "click": "onClick($event)" }, properties: { "class": "this.hostClasses", "attr.tabindex": "this.tabIndex", "attr.disabled": "this.ariaDisabled", "attr.aria-disabled": "this.ariaDisabled", "attr.aria-selected": "this.ariaSelected" } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["contentDiv"], descendants: true }], ngImport: i0, template: "<div #contentDiv><ng-content></ng-content></div>\n<div *ngIf=\"!hasContent\">\n {{label ?? value}}\n</div>\n\n", styles: [":host{display:block;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
8533
+ _MultiSelectOptionComponent_destroy$ = new WeakMap();
8534
+ MultiSelectOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptionComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$3.FocusMonitor }, { token: MultiSelectService }], target: i0.ɵɵFactoryTarget.Component });
8535
+ MultiSelectOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MultiSelectOptionComponent, selector: "c-multi-select-option", inputs: { optionsStyle: "optionsStyle", label: "label", value: "value", visible: "visible", id: "id", disabled: "disabled", selected: "selected", role: "role" }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "keydown": "onKeyDown($event)", "keyup": "onKeyUp($event)", "click": "onClick($event)" }, properties: { "id": "this.id", "class": "this.hostClasses", "role": "this.role", "attr.tabindex": "this.tabIndex", "attr.disabled": "this.ariaDisabled", "attr.aria-disabled": "this.ariaDisabled", "attr.aria-selected": "this.ariaSelected" } }, viewQueries: [{ propertyName: "contentDiv", first: true, predicate: ["contentDiv"], descendants: true }], exportAs: ["cMultiSelectOption"], ngImport: i0, template: "<div #contentDiv><ng-content></ng-content></div>\n<div *ngIf=\"!hasContent\">\n {{label ?? value}}\n</div>\n\n", styles: [":host{display:block;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
8506
8536
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptionComponent, decorators: [{
8507
8537
  type: Component,
8508
- args: [{ selector: 'c-multi-select-option', template: "<div #contentDiv><ng-content></ng-content></div>\n<div *ngIf=\"!hasContent\">\n {{label ?? value}}\n</div>\n\n", styles: [":host{display:block;-webkit-user-select:none;user-select:none}\n"] }]
8509
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1$3.FocusMonitor }, { type: MultiSelectService }]; }, propDecorators: { optionsStyle: [{
8538
+ args: [{ selector: 'c-multi-select-option', exportAs: 'cMultiSelectOption', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #contentDiv><ng-content></ng-content></div>\n<div *ngIf=\"!hasContent\">\n {{label ?? value}}\n</div>\n\n", styles: [":host{display:block;-webkit-user-select:none;user-select:none}\n"] }]
8539
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$3.FocusMonitor }, { type: MultiSelectService }]; }, propDecorators: { optionsStyle: [{
8510
8540
  type: Input
8511
8541
  }], label: [{
8512
8542
  type: Input
@@ -8516,9 +8546,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
8516
8546
  type: Input
8517
8547
  }], selectedChange: [{
8518
8548
  type: Output
8519
- }], content: [{
8549
+ }], contentDiv: [{
8520
8550
  type: ViewChild,
8521
8551
  args: ['contentDiv']
8552
+ }], id: [{
8553
+ type: Input
8554
+ }, {
8555
+ type: HostBinding
8522
8556
  }], disabled: [{
8523
8557
  type: Input
8524
8558
  }], selected: [{
@@ -8526,6 +8560,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
8526
8560
  }], hostClasses: [{
8527
8561
  type: HostBinding,
8528
8562
  args: ['class']
8563
+ }], role: [{
8564
+ type: Input
8565
+ }, {
8566
+ type: HostBinding,
8567
+ args: ['role']
8529
8568
  }], tabIndex: [{
8530
8569
  type: HostBinding,
8531
8570
  args: ['attr.tabindex']
@@ -8538,6 +8577,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
8538
8577
  }], ariaSelected: [{
8539
8578
  type: HostBinding,
8540
8579
  args: ['attr.aria-selected']
8580
+ }], onKeyDown: [{
8581
+ type: HostListener,
8582
+ args: ['keydown', ['$event']]
8541
8583
  }], onKeyUp: [{
8542
8584
  type: HostListener,
8543
8585
  args: ['keyup', ['$event']]
@@ -8651,6 +8693,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
8651
8693
  type: Input
8652
8694
  }] } });
8653
8695
 
8696
+ var _MultiSelectComponent_destroy$;
8654
8697
  // @ts-ignore
8655
8698
  const observeReferenceModifier = {
8656
8699
  name: 'observeReferenceModifier', enabled: true, phase: 'main', fn({ state }) { },
@@ -8681,17 +8724,22 @@ class MultiSelectComponent {
8681
8724
  this.focusMonitor = focusMonitor;
8682
8725
  this.multiSelectService = multiSelectService;
8683
8726
  this.iterableDiffers = iterableDiffers;
8727
+ _MultiSelectComponent_destroy$.set(this, new Subject());
8684
8728
  this.onChange = (value) => { };
8729
+ this.onTouched = () => { };
8685
8730
  this.cleaner = true;
8686
8731
  this._disabled = false;
8687
8732
  this._multiple = false;
8688
8733
  this.nativeName = '';
8689
8734
  this.nativeId = '';
8735
+ this.options = [];
8690
8736
  this.optionsMaxHeight = 'auto';
8691
8737
  this.optionsStyle = 'checkbox';
8692
8738
  this.placeholder = 'Select...';
8693
8739
  this.search = true;
8694
8740
  this.searchNoResultsLabel = 'no items';
8741
+ this._searchValue = '';
8742
+ this.searchValueChange = new EventEmitter();
8695
8743
  this.selectAll = true;
8696
8744
  this.selectAllLabel = 'Select all options';
8697
8745
  this.selectionType = 'tags';
@@ -8699,6 +8747,8 @@ class MultiSelectComponent {
8699
8747
  this.selectionTypeCounterTextPluralMap = { '=1': 'item selected', 'other': 'items selected' };
8700
8748
  this._value = [''];
8701
8749
  this.valueChange = new EventEmitter();
8750
+ this._virtualScroller = false;
8751
+ this._visibleItems = 10;
8702
8752
  this._visible = false;
8703
8753
  this.visibleChange = new EventEmitter();
8704
8754
  /**
@@ -8708,7 +8758,7 @@ class MultiSelectComponent {
8708
8758
  this.popperjsOptions = {
8709
8759
  strategy: 'fixed', modifiers: [observeReferenceModifier, {
8710
8760
  name: 'offset', options: {
8711
- offset: [0, this.selectionType === 'tags' ? 8 : 10]
8761
+ offset: () => this.selectionType === 'tags' && this.selectedOptions.length ? [-2, 8] : [-12, 12]
8712
8762
  }
8713
8763
  }]
8714
8764
  };
@@ -8716,19 +8766,19 @@ class MultiSelectComponent {
8716
8766
  this._selectedOptions = [];
8717
8767
  this._tabIndex = '-1';
8718
8768
  this.visibleOptions = 0;
8719
- this._searchValue = '';
8720
8769
  this._subtreeFocused = this.focusOrigin(null);
8721
8770
  this.differ = this.iterableDiffers.find(this._value).create();
8722
8771
  }
8723
8772
  writeValue(value) {
8724
8773
  if (value !== null) {
8725
- this.value = value;
8774
+ this.value = Array.isArray(value) ? [...value] : [value !== null && value !== void 0 ? value : ''];
8726
8775
  }
8727
8776
  }
8728
8777
  registerOnChange(fn) {
8729
8778
  this.onChange = fn;
8730
8779
  }
8731
8780
  registerOnTouched(fn) {
8781
+ this.onTouched = fn;
8732
8782
  }
8733
8783
  setDisabledState(isDisabled) {
8734
8784
  this.disabled = isDisabled;
@@ -8748,16 +8798,29 @@ class MultiSelectComponent {
8748
8798
  get multiple() {
8749
8799
  return this._multiple;
8750
8800
  }
8801
+ set searchValue(value) {
8802
+ if (this._searchValue !== value.trimStart()) {
8803
+ this._searchValue = value.trimStart();
8804
+ this.visible = !!this.searchValue.length || this.visible;
8805
+ this.filterOptions(this.searchValue);
8806
+ this.inputElementSize();
8807
+ this.searchValueChange.emit(this._searchValue);
8808
+ }
8809
+ }
8810
+ get searchValue() {
8811
+ return this._searchValue;
8812
+ }
8751
8813
  /**
8752
8814
  * Initial value of multi-select
8815
+ * @type string | string[]
8753
8816
  */
8754
8817
  set value(value) {
8755
8818
  const newValue = Array.isArray(value) ? [...value] : [value !== null && value !== void 0 ? value : ''];
8756
8819
  if (this.differ) {
8757
8820
  const changes = this.differ.diff(newValue);
8758
8821
  if (changes) {
8759
- this._value = newValue;
8760
- this.onChange(newValue);
8822
+ this._value = [...newValue];
8823
+ this.onChange([...newValue]);
8761
8824
  this.selectOptions();
8762
8825
  // not required here:
8763
8826
  // this.selectedOptionsUpdate();
@@ -8769,18 +8832,43 @@ class MultiSelectComponent {
8769
8832
  var _a, _b;
8770
8833
  return this.multiple ? [...this._value] : (_b = (_a = this._value[0]) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
8771
8834
  }
8835
+ /**
8836
+ * Enable virtual scroller for the options list.
8837
+ * @type boolean
8838
+ * @default false
8839
+ * todo: virtual scroller implementation
8840
+ */
8841
+ set virtualScroller(value) {
8842
+ this._virtualScroller = coerceBooleanProperty(value);
8843
+ }
8844
+ get virtualScroller() {
8845
+ return this._virtualScroller;
8846
+ }
8847
+ /**
8848
+ * Amount of visible options, if set - overwrites optionsMaxHeight
8849
+ * @type number
8850
+ * @default 10
8851
+ */
8852
+ set visibleItems(value) {
8853
+ this._visibleItems = value || 1;
8854
+ this.optionsMaxHeight = ((42 * value) + 16).toString();
8855
+ }
8856
+ get visibleItems() {
8857
+ return this._visibleItems;
8858
+ }
8772
8859
  /**
8773
8860
  * Toggle the visibility of the dropdown select component.
8774
8861
  * @type boolean
8775
8862
  * @default false
8776
8863
  */
8777
8864
  set visible(value) {
8778
- const newValue = coerceBooleanProperty(value);
8779
- if (newValue !== this._visible) {
8780
- this._visible = newValue;
8781
- this.multiSelectService.toggleVisible(newValue);
8782
- if (newValue) {
8783
- this.listKeyManager.setFirstItemActive();
8865
+ var _a;
8866
+ const visible = coerceBooleanProperty(value);
8867
+ if (visible !== this._visible) {
8868
+ this._visible = visible;
8869
+ this.multiSelectService.toggleVisible(visible);
8870
+ if (visible) {
8871
+ (_a = this.listKeyManager) === null || _a === void 0 ? void 0 : _a.setFirstItemActive();
8784
8872
  }
8785
8873
  }
8786
8874
  }
@@ -8796,7 +8884,7 @@ class MultiSelectComponent {
8796
8884
  return this._selectedOptions;
8797
8885
  }
8798
8886
  get selectedOptionsText() {
8799
- return this.selectedOptions.map((option) => option.label).join(', ');
8887
+ return this.selectedOptions.map(option => option.label).join(', ');
8800
8888
  }
8801
8889
  get counterText() {
8802
8890
  return `${this.selectedOptions.length} ${this.selectionTypeCounterText}`;
@@ -8823,6 +8911,9 @@ class MultiSelectComponent {
8823
8911
  'is-invalid': this.valid === false
8824
8912
  };
8825
8913
  }
8914
+ get ariaMultiSelectable() {
8915
+ return this.multiple;
8916
+ }
8826
8917
  get tabIndex() {
8827
8918
  return this._tabIndex;
8828
8919
  }
@@ -8833,8 +8924,10 @@ class MultiSelectComponent {
8833
8924
  }
8834
8925
  onKeyUp($event) {
8835
8926
  var _a;
8836
- if (this.disabled)
8927
+ if (this.disabled) {
8837
8928
  return;
8929
+ }
8930
+ this.onTouched();
8838
8931
  if ($event.key === 'Escape') {
8839
8932
  this.visible = false;
8840
8933
  this.searchValue = '';
@@ -8857,16 +8950,20 @@ class MultiSelectComponent {
8857
8950
  }
8858
8951
  }
8859
8952
  onKeyDown($event) {
8860
- if (this.disabled)
8953
+ var _a;
8954
+ if (this.disabled) {
8861
8955
  return;
8956
+ }
8862
8957
  // avoid setting focus to option while on input element
8863
- if ($event.target === this.inputElement.nativeElement)
8958
+ if ($event.target === this.inputElement.nativeElement) {
8864
8959
  return;
8865
- this.listKeyManager.onKeydown($event);
8960
+ }
8961
+ (_a = this.listKeyManager) === null || _a === void 0 ? void 0 : _a.onKeydown($event);
8866
8962
  }
8867
8963
  onClick($event) {
8868
- if (this.disabled)
8964
+ if (this.disabled) {
8869
8965
  return;
8966
+ }
8870
8967
  if (!this.visible) {
8871
8968
  this.visible = true;
8872
8969
  this.setFocus('mouse', 'onClick');
@@ -8875,15 +8972,7 @@ class MultiSelectComponent {
8875
8972
  this.visible = false;
8876
8973
  this.setFocus('mouse', 'onClick');
8877
8974
  }
8878
- }
8879
- set searchValue(value) {
8880
- this._searchValue = value.trim();
8881
- this.visible = !!this.searchValue.length || this.visible;
8882
- this.filterOptions(this.searchValue);
8883
- this.inputElementSize();
8884
- }
8885
- get searchValue() {
8886
- return this._searchValue;
8975
+ this.onTouched();
8887
8976
  }
8888
8977
  get subtreeFocused() {
8889
8978
  return this._subtreeFocused;
@@ -8893,8 +8982,9 @@ class MultiSelectComponent {
8893
8982
  this.visible = value === false ? false : this.visible;
8894
8983
  }
8895
8984
  focusOrigin(origin) {
8896
- if (this.disabled)
8985
+ if (this.disabled) {
8897
8986
  return false;
8987
+ }
8898
8988
  const focused = !!origin;
8899
8989
  this.searchValue = focused ? this.searchValue : '';
8900
8990
  return focused;
@@ -8903,6 +8993,8 @@ class MultiSelectComponent {
8903
8993
  this.tabIndex = '0';
8904
8994
  }
8905
8995
  ngOnDestroy() {
8996
+ __classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f").next(true);
8997
+ __classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f").complete();
8906
8998
  this.multiselectSubscribe(false);
8907
8999
  this.setFocusMonitor(false);
8908
9000
  }
@@ -8920,12 +9012,19 @@ class MultiSelectComponent {
8920
9012
  }
8921
9013
  ngAfterContentInit() {
8922
9014
  this.visibleOptions = this.multiSelectOptions.length;
9015
+ this.multiSelectOptions.changes
9016
+ .pipe(takeUntil(__classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f")))
9017
+ .subscribe(next => {
9018
+ var _a;
9019
+ this.visibleOptions = (_a = this.multiSelectOptions) === null || _a === void 0 ? void 0 : _a.filter((item) => item.visible).length;
9020
+ this.selectOptions();
9021
+ });
8923
9022
  }
8924
9023
  ngAfterViewInit() {
8925
9024
  this.selectOptions();
8926
9025
  this.multiselectSubscribe();
8927
9026
  this.listKeyManager = new FocusKeyManager(this.multiSelectOptions).withHomeAndEnd().withTypeAhead();
8928
- this.listKeyManager.skipPredicate(item => (!item.visible || item.disabled));
9027
+ this.listKeyManager.skipPredicate(item => (item.disabled || !item.visible));
8929
9028
  this.listKeyManager.setFirstItemActive();
8930
9029
  this.setFocusMonitor(!this.disabled);
8931
9030
  // not required here:
@@ -8935,12 +9034,8 @@ class MultiSelectComponent {
8935
9034
  });
8936
9035
  }
8937
9036
  multiselectSubscribe(subscribe = true) {
8938
- var _a, _b, _c;
9037
+ var _a, _b;
8939
9038
  if (subscribe) {
8940
- this.multiSelectOptionsSubscription = this.multiSelectOptions.changes.subscribe(change => {
8941
- // console.log('multiSelectOptions change', change)
8942
- this.selectOptions();
8943
- });
8944
9039
  this.multiselectVisibleSubscription = this.multiSelectService.multiSelectVisible$.subscribe((visible) => {
8945
9040
  if (this.isDropdownVisible !== visible) {
8946
9041
  this.isDropdownVisible = visible;
@@ -8970,8 +9065,7 @@ class MultiSelectComponent {
8970
9065
  }
8971
9066
  else {
8972
9067
  (_a = this.multiselectVisibleSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
8973
- (_b = this.multiSelectOptionsSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
8974
- (_c = this.multiselectStateSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
9068
+ (_b = this.multiselectStateSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
8975
9069
  }
8976
9070
  }
8977
9071
  selectOptions() {
@@ -8983,8 +9077,9 @@ class MultiSelectComponent {
8983
9077
  }
8984
9078
  clearAllOptions($event) {
8985
9079
  this.selectedOptions.forEach((option) => {
8986
- if (!option._disabled)
9080
+ if (!option._disabled) {
8987
9081
  option.selected = false;
9082
+ }
8988
9083
  });
8989
9084
  this.selectedOptionsUpdate();
8990
9085
  if ($event) {
@@ -8994,8 +9089,9 @@ class MultiSelectComponent {
8994
9089
  }
8995
9090
  selectAllOptions() {
8996
9091
  this.multiSelectOptions.forEach((option, index) => {
8997
- if (!option.disabled && option.visible)
9092
+ if (!option.disabled && option.visible) {
8998
9093
  option.selected = true;
9094
+ }
8999
9095
  });
9000
9096
  this.selectedOptionsUpdate();
9001
9097
  }
@@ -9004,8 +9100,9 @@ class MultiSelectComponent {
9004
9100
  }
9005
9101
  setFocus(origin = 'program', methodName) {
9006
9102
  var _a, _b;
9007
- if (this.disabled)
9103
+ if (this.disabled) {
9008
9104
  return;
9105
+ }
9009
9106
  const element = (_a = this.inputElement) !== null && _a !== void 0 ? _a : this.elementRef;
9010
9107
  const preventScroll = origin === 'program';
9011
9108
  (_b = this.focusMonitor) === null || _b === void 0 ? void 0 : _b.focusVia(element, origin, { preventScroll: preventScroll });
@@ -9016,11 +9113,11 @@ class MultiSelectComponent {
9016
9113
  const searchString = (_a = value.toLowerCase()) !== null && _a !== void 0 ? _a : '';
9017
9114
  (_b = this.multiSelectOptions) === null || _b === void 0 ? void 0 : _b.forEach((item, index) => {
9018
9115
  var _a, _b;
9019
- if (!!searchString) {
9020
- item.visible = (_b = (_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchString)) !== null && _b !== void 0 ? _b : true;
9116
+ if (this.search === 'external' || !searchString) {
9117
+ item.visible = true;
9021
9118
  }
9022
9119
  else {
9023
- item.visible = true;
9120
+ item.visible = (_b = (_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchString)) !== null && _b !== void 0 ? _b : true;
9024
9121
  }
9025
9122
  });
9026
9123
  this.visibleOptions = (_c = this.multiSelectOptions) === null || _c === void 0 ? void 0 : _c.filter((item) => item.visible).length;
@@ -9031,8 +9128,9 @@ class MultiSelectComponent {
9031
9128
  this.updateNativeSelect();
9032
9129
  }
9033
9130
  updateNativeSelect() {
9034
- if (!this.nativeSelectRef)
9131
+ if (!this.nativeSelectRef) {
9035
9132
  return;
9133
+ }
9036
9134
  const options = this.selectedOptions.map(item => {
9037
9135
  const { selected, value, label } = item;
9038
9136
  return { selected, value, label };
@@ -9055,8 +9153,9 @@ class MultiSelectComponent {
9055
9153
  }
9056
9154
  }
9057
9155
  handleSearchKeyDown($event) {
9058
- if (this.searchValue.length || this.selectedOptions.length === 0)
9156
+ if (this.searchValue.length || this.selectedOptions.length === 0) {
9059
9157
  return;
9158
+ }
9060
9159
  if (['Backspace', 'Delete'].includes($event.key)) {
9061
9160
  $event.stopPropagation();
9062
9161
  const last = this.selectedOptions.filter(option => !option.disabled).pop();
@@ -9094,13 +9193,14 @@ class MultiSelectComponent {
9094
9193
  }
9095
9194
  }
9096
9195
  }
9196
+ _MultiSelectComponent_destroy$ = new WeakMap();
9097
9197
  MultiSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: i1$3.FocusMonitor }, { token: MultiSelectService }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Component });
9098
- MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MultiSelectComponent, selector: "c-multi-select", inputs: { cleaner: "cleaner", disabled: "disabled", multiple: "multiple", nativeName: "nativeName", nativeId: "nativeId", optionsMaxHeight: "optionsMaxHeight", optionsStyle: "optionsStyle", placeholder: "placeholder", search: "search", searchNoResultsLabel: "searchNoResultsLabel", selectAll: "selectAll", selectAllLabel: "selectAllLabel", selectionType: "selectionType", selectionTypeCounterText: "selectionTypeCounterText", selectionTypeCounterTextPluralMap: "selectionTypeCounterTextPluralMap", size: "size", value: "value", valid: "valid", visible: "visible", popperjsOptions: ["popperOptions", "popperjsOptions"] }, outputs: { valueChange: "valueChange", visibleChange: "visibleChange" }, host: { listeners: { "keyup": "onKeyUp($event)", "keydown": "onKeyDown($event)", "click": "onClick($event)" }, properties: { "class": "this.hostClasses", "attr.tabindex": "this.tabIndex" } }, providers: [
9198
+ MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MultiSelectComponent, selector: "c-multi-select", inputs: { cleaner: "cleaner", disabled: "disabled", multiple: "multiple", nativeName: "nativeName", nativeId: "nativeId", options: "options", optionsMaxHeight: "optionsMaxHeight", optionsStyle: "optionsStyle", placeholder: "placeholder", search: "search", searchNoResultsLabel: "searchNoResultsLabel", searchValue: "searchValue", selectAll: "selectAll", selectAllLabel: "selectAllLabel", selectionType: "selectionType", selectionTypeCounterText: "selectionTypeCounterText", selectionTypeCounterTextPluralMap: "selectionTypeCounterTextPluralMap", size: "size", value: "value", valid: "valid", virtualScroller: "virtualScroller", visibleItems: "visibleItems", visible: "visible", popperjsOptions: ["popperOptions", "popperjsOptions"] }, outputs: { searchValueChange: "searchValueChange", valueChange: "valueChange", visibleChange: "visibleChange" }, host: { listeners: { "keyup": "onKeyUp($event)", "keydown": "onKeyDown($event)", "click": "onClick($event)" }, properties: { "class": "this.hostClasses", "attr.aria-multiselectable": "this.ariaMultiSelectable", "attr.tabindex": "this.tabIndex" } }, providers: [
9099
9199
  MultiSelectService,
9100
9200
  {
9101
9201
  provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MultiSelectComponent), multi: true
9102
9202
  }
9103
- ], queries: [{ propertyName: "multiSelectOptions", predicate: MultiSelectOptionComponent, descendants: true }], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: DropdownToggleDirective, descendants: true }, { propertyName: "dropdown", first: true, predicate: DropdownComponent, descendants: true, read: ElementRef }], exportAs: ["cMultiSelect"], usesOnChanges: true, ngImport: i0, template: "<c-dropdown #dropdown=\"cDropdown\" [autoClose]=\"'outside'\" class=\"picker\" [ngClass]=\"multiselectClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n <div [caret]=\"false\" [disabled]=\"disabled\" cDropdownToggle #dropdownToggle=\"cDropdownToggle\">\n <div class=\"form-multi-select-selection\">\n <ng-template [ngIf]=\"selectionType === 'tags'\">\n <c-multi-select-tag *ngFor=\"let option of selectedOptions; index as i\"\n (remove)=\"handleTagRemove($event)\"\n [option]=\"option\"\n tabindex=\"-1\">\n </c-multi-select-tag>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'text' && !!selectedOptionsText\">\n <span class=\"form-multi-select-search\">{{ selectedOptionsText }}</span>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'counter'\">\n <span *ngIf=\"counterTextType === 'string'; else pluralMap\">{{ counterText }}</span>\n <ng-template #pluralMap>\n <span>{{selectedOptions.length}} {{ selectedOptions.length | i18nPlural: selectionTypeCounterTextPluralMap ?? { other: counterText } }}</span>\n </ng-template>\n </ng-template>\n <!-- <ng-template [ngIf]=\"!search && selectedOptions.length === 0 && selectionType !== 'counter'\">-->\n <!-- <span class=\"form-multi-select-search\">{{ placeholder }}</span>-->\n <!-- </ng-template>-->\n </div>\n\n <input\n #inputElement\n (keydown)=\"handleSearchKeyDown($event)\"\n [(ngModel)]=\"searchValue\"\n [disabled]=\"disabled || !search\"\n [ngClass]=\"{ 'form-multi-select-search': true, disabled: (disabled || !search) }\"\n [attr.placeholder]=\"selectedOptions.length === 0 && selectionType !== 'counter' ? placeholder : null\"\n autocomplete=\"off\"\n tabindex=\"{{ disabled ? '-1' : '0' }}\"\n type=\"text\"\n >\n\n <button\n (click)=\"clearAllOptions($event)\"\n *ngIf=\"cleaner && selectedOptions.length > 0 && !disabled\"\n [disabled]=\"disabled || !isDropdownVisible\"\n aria-label=\"Clear all\"\n class=\"form-multi-select-selection-cleaner\"\n ></button>\n </div>\n\n <div *ngIf=\"!disabled\" class=\"\" cDropdownMenu #dropdownMenu=\"cDropdownMenu\" [visible]=\"dropdown.visible\">\n <ng-template [ngIfElse]=\"optionsEmpty\" [ngIf]=\"visibleOptions > 0\">\n <button (click)=\"selectAllOptions()\" *ngIf=\"selectAll && multiple\" class=\"form-multi-select-all\">\n {{ selectAllLabel }}\n </button>\n <div #multiselectOptionsDiv\n [ngStyle]=\"optionsMaxHeight !== 'auto' ? { 'maxHeight.px': optionsMaxHeight, overflow: 'scroll' } : {}\"\n class=\"form-multi-select-options\"\n >\n <ng-content></ng-content>\n </div>\n </ng-template>\n <ng-template #optionsEmpty>\n <div class=\"form-multi-select-options-empty\">{{ searchNoResultsLabel }}</div>\n </ng-template>\n </div>\n</c-dropdown>\n", styles: [":host{display:block}:host:focus-visible{outline:none}:host.cdk-focused:not(.disabled) .form-multi-select{color:var(--cui-form-multi-select-focus-color, rgba(44, 56, 74, .95));background-color:var(--cui-form-multi-select-focus-bg, #fff);border-color:var(--cui-form-multi-select-focus-border-color, #6557e4);box-shadow:0 0 0 .25rem #321fdb40}:host:not(.cdk-focused) .form-multi-select:not(.show) input.form-multi-select-search:not([placeholder]){width:.1rem;margin-inline-start:0}:host .form-multi-select-search[size]{display:inline}:host .form-multi-select-selection-tags .form-multi-select-search{height:1.5rem}:host-context(.dark-theme)::ng-deep .form-multi-select-optgroup-label{color:var(--cui-form-multi-select-disabled-color)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: DropdownComponent, selector: "c-dropdown", inputs: ["alignment", "autoClose", "dark", "direction", "placement", "popper", "popperOptions", "variant", "visible"], outputs: ["visibleChange"], exportAs: ["cDropdown"] }, { kind: "directive", type: DropdownToggleDirective, selector: "[cDropdownToggle]", inputs: ["dropdownComponent", "disabled", "caret", "split"], exportAs: ["cDropdownToggle"] }, { kind: "directive", type: DropdownMenuDirective, selector: "[cDropdownMenu]", inputs: ["alignment", "visible", "dark"], exportAs: ["cDropdownMenu"] }, { kind: "component", type: MultiSelectTagComponent, selector: "c-multi-select-tag", inputs: ["option"], outputs: ["remove"] }, { kind: "pipe", type: i1$1.I18nPluralPipe, name: "i18nPlural" }] });
9203
+ ], queries: [{ propertyName: "multiSelectOptions", predicate: MultiSelectOptionComponent, descendants: true }], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: DropdownToggleDirective, descendants: true }, { propertyName: "dropdown", first: true, predicate: DropdownComponent, descendants: true, read: ElementRef }], exportAs: ["cMultiSelect"], usesOnChanges: true, ngImport: i0, template: "<c-dropdown #dropdown=\"cDropdown\" [autoClose]=\"'outside'\" class=\"picker\" [ngClass]=\"multiselectClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n <div [caret]=\"false\" [disabled]=\"disabled\" cDropdownToggle #dropdownToggle=\"cDropdownToggle\">\n <div class=\"form-multi-select-selection\">\n <ng-template [ngIf]=\"selectionType === 'tags'\">\n <c-multi-select-tag\n *ngFor=\"let option of selectedOptions; index as i\"\n (remove)=\"handleTagRemove($event)\"\n [option]=\"option\"\n tabindex=\"-1\"\n class=\"form-multi-select-tag\"\n ></c-multi-select-tag>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'text' && !!selectedOptionsText\">\n <span class=\"form-multi-select-search\">{{ selectedOptionsText }}</span>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'counter'\">\n <span *ngIf=\"counterTextType === 'string'; else pluralMap\">{{ counterText }}</span>\n <ng-template #pluralMap>\n <span>{{selectedOptions.length}} {{ selectedOptions.length | i18nPlural: selectionTypeCounterTextPluralMap ?? { other: counterText } }}</span>\n </ng-template>\n </ng-template>\n <!-- <ng-template [ngIf]=\"!search && selectedOptions.length === 0 && selectionType !== 'counter'\">-->\n <!-- <span class=\"form-multi-select-search\">{{ placeholder }}</span>-->\n <!-- </ng-template>-->\n </div>\n\n <input\n #inputElement\n (keydown)=\"handleSearchKeyDown($event)\"\n [(ngModel)]=\"searchValue\"\n [disabled]=\"disabled || !search\"\n [ngClass]=\"{ 'form-multi-select-search': true, disabled: (disabled || !search) }\"\n [attr.placeholder]=\"selectedOptions.length === 0 && selectionType !== 'counter' ? placeholder : null\"\n autocomplete=\"off\"\n tabindex=\"{{ disabled ? '-1' : '0' }}\"\n type=\"text\"\n >\n\n <button\n (click)=\"clearAllOptions($event)\"\n *ngIf=\"cleaner && selectedOptions.length > 0 && !disabled\"\n [disabled]=\"disabled || !isDropdownVisible\"\n aria-label=\"Clear all\"\n class=\"form-multi-select-selection-cleaner\"\n ></button>\n </div>\n\n <div *ngIf=\"!disabled\" class=\"\" cDropdownMenu #dropdownMenu=\"cDropdownMenu\" [visible]=\"dropdown.visible\">\n <ng-template [ngIfElse]=\"optionsEmpty\" [ngIf]=\"visibleOptions > 0\">\n <button (click)=\"selectAllOptions()\" *ngIf=\"selectAll && multiple\" class=\"form-multi-select-all\">\n {{ selectAllLabel }}\n </button>\n <div #multiselectOptionsDiv\n [ngStyle]=\"optionsMaxHeight !== 'auto' ? { 'maxHeight.px': optionsMaxHeight, overflowY: 'scroll' } : {}\"\n class=\"form-multi-select-options\"\n >\n <ng-content></ng-content>\n </div>\n </ng-template>\n <ng-template #optionsEmpty>\n <div class=\"form-multi-select-options-empty\">{{ searchNoResultsLabel }}</div>\n </ng-template>\n </div>\n</c-dropdown>\n", styles: [":host{display:block}:host:focus-visible{outline:none}:host.cdk-focused:not(.disabled) .form-multi-select{color:var(--cui-form-multi-select-focus-color, rgba(44, 56, 74, .95));background-color:var(--cui-form-multi-select-focus-bg, #fff);border-color:var(--cui-form-multi-select-focus-border-color, #6557e4);box-shadow:0 0 0 .25rem #321fdb40}:host:not(.cdk-focused) .form-multi-select:not(.show) input.form-multi-select-search:not([placeholder]){width:.1rem;margin-inline-start:0}:host .form-multi-select-search[size]{display:inline}:host .form-multi-select-selection-tags .form-multi-select-search{height:1.5rem}:host-context(.dark-theme)::ng-deep .form-multi-select-optgroup-label{color:var(--cui-form-multi-select-disabled-color)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: DropdownComponent, selector: "c-dropdown", inputs: ["alignment", "autoClose", "dark", "direction", "placement", "popper", "popperOptions", "variant", "visible"], outputs: ["visibleChange"], exportAs: ["cDropdown"] }, { kind: "directive", type: DropdownToggleDirective, selector: "[cDropdownToggle]", inputs: ["dropdownComponent", "disabled", "caret", "split"], exportAs: ["cDropdownToggle"] }, { kind: "directive", type: DropdownMenuDirective, selector: "[cDropdownMenu]", inputs: ["alignment", "visible", "dark"], exportAs: ["cDropdownMenu"] }, { kind: "component", type: MultiSelectTagComponent, selector: "c-multi-select-tag", inputs: ["option"], outputs: ["remove"] }, { kind: "pipe", type: i1$1.I18nPluralPipe, name: "i18nPlural" }] });
9104
9204
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectComponent, decorators: [{
9105
9205
  type: Component,
9106
9206
  args: [{ selector: 'c-multi-select', exportAs: 'cMultiSelect', providers: [
@@ -9108,7 +9208,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
9108
9208
  {
9109
9209
  provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MultiSelectComponent), multi: true
9110
9210
  }
9111
- ], template: "<c-dropdown #dropdown=\"cDropdown\" [autoClose]=\"'outside'\" class=\"picker\" [ngClass]=\"multiselectClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n <div [caret]=\"false\" [disabled]=\"disabled\" cDropdownToggle #dropdownToggle=\"cDropdownToggle\">\n <div class=\"form-multi-select-selection\">\n <ng-template [ngIf]=\"selectionType === 'tags'\">\n <c-multi-select-tag *ngFor=\"let option of selectedOptions; index as i\"\n (remove)=\"handleTagRemove($event)\"\n [option]=\"option\"\n tabindex=\"-1\">\n </c-multi-select-tag>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'text' && !!selectedOptionsText\">\n <span class=\"form-multi-select-search\">{{ selectedOptionsText }}</span>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'counter'\">\n <span *ngIf=\"counterTextType === 'string'; else pluralMap\">{{ counterText }}</span>\n <ng-template #pluralMap>\n <span>{{selectedOptions.length}} {{ selectedOptions.length | i18nPlural: selectionTypeCounterTextPluralMap ?? { other: counterText } }}</span>\n </ng-template>\n </ng-template>\n <!-- <ng-template [ngIf]=\"!search && selectedOptions.length === 0 && selectionType !== 'counter'\">-->\n <!-- <span class=\"form-multi-select-search\">{{ placeholder }}</span>-->\n <!-- </ng-template>-->\n </div>\n\n <input\n #inputElement\n (keydown)=\"handleSearchKeyDown($event)\"\n [(ngModel)]=\"searchValue\"\n [disabled]=\"disabled || !search\"\n [ngClass]=\"{ 'form-multi-select-search': true, disabled: (disabled || !search) }\"\n [attr.placeholder]=\"selectedOptions.length === 0 && selectionType !== 'counter' ? placeholder : null\"\n autocomplete=\"off\"\n tabindex=\"{{ disabled ? '-1' : '0' }}\"\n type=\"text\"\n >\n\n <button\n (click)=\"clearAllOptions($event)\"\n *ngIf=\"cleaner && selectedOptions.length > 0 && !disabled\"\n [disabled]=\"disabled || !isDropdownVisible\"\n aria-label=\"Clear all\"\n class=\"form-multi-select-selection-cleaner\"\n ></button>\n </div>\n\n <div *ngIf=\"!disabled\" class=\"\" cDropdownMenu #dropdownMenu=\"cDropdownMenu\" [visible]=\"dropdown.visible\">\n <ng-template [ngIfElse]=\"optionsEmpty\" [ngIf]=\"visibleOptions > 0\">\n <button (click)=\"selectAllOptions()\" *ngIf=\"selectAll && multiple\" class=\"form-multi-select-all\">\n {{ selectAllLabel }}\n </button>\n <div #multiselectOptionsDiv\n [ngStyle]=\"optionsMaxHeight !== 'auto' ? { 'maxHeight.px': optionsMaxHeight, overflow: 'scroll' } : {}\"\n class=\"form-multi-select-options\"\n >\n <ng-content></ng-content>\n </div>\n </ng-template>\n <ng-template #optionsEmpty>\n <div class=\"form-multi-select-options-empty\">{{ searchNoResultsLabel }}</div>\n </ng-template>\n </div>\n</c-dropdown>\n", styles: [":host{display:block}:host:focus-visible{outline:none}:host.cdk-focused:not(.disabled) .form-multi-select{color:var(--cui-form-multi-select-focus-color, rgba(44, 56, 74, .95));background-color:var(--cui-form-multi-select-focus-bg, #fff);border-color:var(--cui-form-multi-select-focus-border-color, #6557e4);box-shadow:0 0 0 .25rem #321fdb40}:host:not(.cdk-focused) .form-multi-select:not(.show) input.form-multi-select-search:not([placeholder]){width:.1rem;margin-inline-start:0}:host .form-multi-select-search[size]{display:inline}:host .form-multi-select-selection-tags .form-multi-select-search{height:1.5rem}:host-context(.dark-theme)::ng-deep .form-multi-select-optgroup-label{color:var(--cui-form-multi-select-disabled-color)}\n"] }]
9211
+ ], template: "<c-dropdown #dropdown=\"cDropdown\" [autoClose]=\"'outside'\" class=\"picker\" [ngClass]=\"multiselectClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n <div [caret]=\"false\" [disabled]=\"disabled\" cDropdownToggle #dropdownToggle=\"cDropdownToggle\">\n <div class=\"form-multi-select-selection\">\n <ng-template [ngIf]=\"selectionType === 'tags'\">\n <c-multi-select-tag\n *ngFor=\"let option of selectedOptions; index as i\"\n (remove)=\"handleTagRemove($event)\"\n [option]=\"option\"\n tabindex=\"-1\"\n class=\"form-multi-select-tag\"\n ></c-multi-select-tag>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'text' && !!selectedOptionsText\">\n <span class=\"form-multi-select-search\">{{ selectedOptionsText }}</span>\n </ng-template>\n <ng-template [ngIf]=\"selectionType === 'counter'\">\n <span *ngIf=\"counterTextType === 'string'; else pluralMap\">{{ counterText }}</span>\n <ng-template #pluralMap>\n <span>{{selectedOptions.length}} {{ selectedOptions.length | i18nPlural: selectionTypeCounterTextPluralMap ?? { other: counterText } }}</span>\n </ng-template>\n </ng-template>\n <!-- <ng-template [ngIf]=\"!search && selectedOptions.length === 0 && selectionType !== 'counter'\">-->\n <!-- <span class=\"form-multi-select-search\">{{ placeholder }}</span>-->\n <!-- </ng-template>-->\n </div>\n\n <input\n #inputElement\n (keydown)=\"handleSearchKeyDown($event)\"\n [(ngModel)]=\"searchValue\"\n [disabled]=\"disabled || !search\"\n [ngClass]=\"{ 'form-multi-select-search': true, disabled: (disabled || !search) }\"\n [attr.placeholder]=\"selectedOptions.length === 0 && selectionType !== 'counter' ? placeholder : null\"\n autocomplete=\"off\"\n tabindex=\"{{ disabled ? '-1' : '0' }}\"\n type=\"text\"\n >\n\n <button\n (click)=\"clearAllOptions($event)\"\n *ngIf=\"cleaner && selectedOptions.length > 0 && !disabled\"\n [disabled]=\"disabled || !isDropdownVisible\"\n aria-label=\"Clear all\"\n class=\"form-multi-select-selection-cleaner\"\n ></button>\n </div>\n\n <div *ngIf=\"!disabled\" class=\"\" cDropdownMenu #dropdownMenu=\"cDropdownMenu\" [visible]=\"dropdown.visible\">\n <ng-template [ngIfElse]=\"optionsEmpty\" [ngIf]=\"visibleOptions > 0\">\n <button (click)=\"selectAllOptions()\" *ngIf=\"selectAll && multiple\" class=\"form-multi-select-all\">\n {{ selectAllLabel }}\n </button>\n <div #multiselectOptionsDiv\n [ngStyle]=\"optionsMaxHeight !== 'auto' ? { 'maxHeight.px': optionsMaxHeight, overflowY: 'scroll' } : {}\"\n class=\"form-multi-select-options\"\n >\n <ng-content></ng-content>\n </div>\n </ng-template>\n <ng-template #optionsEmpty>\n <div class=\"form-multi-select-options-empty\">{{ searchNoResultsLabel }}</div>\n </ng-template>\n </div>\n</c-dropdown>\n", styles: [":host{display:block}:host:focus-visible{outline:none}:host.cdk-focused:not(.disabled) .form-multi-select{color:var(--cui-form-multi-select-focus-color, rgba(44, 56, 74, .95));background-color:var(--cui-form-multi-select-focus-bg, #fff);border-color:var(--cui-form-multi-select-focus-border-color, #6557e4);box-shadow:0 0 0 .25rem #321fdb40}:host:not(.cdk-focused) .form-multi-select:not(.show) input.form-multi-select-search:not([placeholder]){width:.1rem;margin-inline-start:0}:host .form-multi-select-search[size]{display:inline}:host .form-multi-select-selection-tags .form-multi-select-search{height:1.5rem}:host-context(.dark-theme)::ng-deep .form-multi-select-optgroup-label{color:var(--cui-form-multi-select-disabled-color)}\n"] }]
9112
9212
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: i1$3.FocusMonitor }, { type: MultiSelectService }, { type: i0.IterableDiffers }]; }, propDecorators: { cleaner: [{
9113
9213
  type: Input
9114
9214
  }], disabled: [{
@@ -9119,6 +9219,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
9119
9219
  type: Input
9120
9220
  }], nativeId: [{
9121
9221
  type: Input
9222
+ }], options: [{
9223
+ type: Input
9122
9224
  }], optionsMaxHeight: [{
9123
9225
  type: Input
9124
9226
  }], optionsStyle: [{
@@ -9129,6 +9231,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
9129
9231
  type: Input
9130
9232
  }], searchNoResultsLabel: [{
9131
9233
  type: Input
9234
+ }], searchValue: [{
9235
+ type: Input
9236
+ }], searchValueChange: [{
9237
+ type: Output
9132
9238
  }], selectAll: [{
9133
9239
  type: Input
9134
9240
  }], selectAllLabel: [{
@@ -9147,6 +9253,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
9147
9253
  type: Output
9148
9254
  }], valid: [{
9149
9255
  type: Input
9256
+ }], virtualScroller: [{
9257
+ type: Input
9258
+ }], visibleItems: [{
9259
+ type: Input
9150
9260
  }], visible: [{
9151
9261
  type: Input
9152
9262
  }], visibleChange: [{
@@ -9172,6 +9282,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
9172
9282
  }], hostClasses: [{
9173
9283
  type: HostBinding,
9174
9284
  args: ['class']
9285
+ }], ariaMultiSelectable: [{
9286
+ type: HostBinding,
9287
+ args: ['attr.aria-multiselectable']
9175
9288
  }], tabIndex: [{
9176
9289
  type: HostBinding,
9177
9290
  args: ['attr.tabindex']
@@ -12756,7 +12869,7 @@ class FilterInputDirective {
12756
12869
  setSubscription(subscribe = !__classPrivateFieldGet(this, _FilterInputDirective_valueSubscription, "f")) {
12757
12870
  if (subscribe) {
12758
12871
  __classPrivateFieldSet(this, _FilterInputDirective_valueSubscription, this.value$
12759
- .pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
12872
+ .pipe(distinctUntilChanged(), takeUntil$1(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
12760
12873
  .subscribe(value => {
12761
12874
  if (__classPrivateFieldGet(this, _FilterInputDirective_value, "f") !== value) {
12762
12875
  __classPrivateFieldSet(this, _FilterInputDirective_value, value, "f");
@@ -12768,7 +12881,7 @@ class FilterInputDirective {
12768
12881
  __classPrivateFieldSet(this, _FilterInputDirective_inputSubscription, fromEvent(this.elementRef.nativeElement, this.onEvent)
12769
12882
  .pipe(map(event => {
12770
12883
  return event.target.value;
12771
- }), debounceTime(dueTime), takeUntil(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
12884
+ }), debounceTime(dueTime), takeUntil$1(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
12772
12885
  .subscribe((value) => {
12773
12886
  if (value !== __classPrivateFieldGet(this, _FilterInputDirective_value, "f")) {
12774
12887
  this.value$.next(value);
@@ -12777,6 +12890,7 @@ class FilterInputDirective {
12777
12890
  }
12778
12891
  else {
12779
12892
  __classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f").next(true);
12893
+ __classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f").complete();
12780
12894
  }
12781
12895
  }
12782
12896
  }