@coreui/angular-pro 4.2.31 → 4.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/multi-select/multi-select/multi-select.component.mjs +116 -45
- package/esm2020/lib/multi-select/multi-select-optgroup/multi-select-optgroup-label.component.mjs +4 -4
- package/esm2020/lib/multi-select/multi-select-optgroup/multi-select-optgroup.component.mjs +2 -2
- package/esm2020/lib/multi-select/multi-select-option/multi-select-option.component.mjs +65 -20
- package/esm2020/lib/multi-select/multi-select.type.mjs +1 -1
- package/esm2020/lib/smart-table/smart-table-filter/filter-input.directive.mjs +2 -1
- package/fesm2015/coreui-angular-pro.mjs +187 -72
- package/fesm2015/coreui-angular-pro.mjs.map +1 -1
- package/fesm2020/coreui-angular-pro.mjs +181 -70
- package/fesm2020/coreui-angular-pro.mjs.map +1 -1
- package/lib/multi-select/multi-select/multi-select.component.d.ts +30 -7
- package/lib/multi-select/multi-select-optgroup/multi-select-optgroup.component.d.ts +1 -1
- package/lib/multi-select/multi-select-option/multi-select-option.component.d.ts +20 -13
- package/lib/multi-select/multi-select.type.d.ts +9 -2
- package/package.json +1 -1
|
@@ -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$
|
|
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$
|
|
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:
|
|
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:
|
|
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,
|
|
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 ?
|
|
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,53 @@ class MultiSelectOptionComponent {
|
|
|
8470
8491
|
this.selected = this.disabled ? this.selected : !this.selected;
|
|
8471
8492
|
this.focus('mouse');
|
|
8472
8493
|
}
|
|
8473
|
-
|
|
8494
|
+
ngAfterViewInit() {
|
|
8495
|
+
var _a, _b;
|
|
8474
8496
|
setTimeout(() => {
|
|
8475
8497
|
var _a;
|
|
8476
|
-
this.hasContent = !!((_a = this.
|
|
8498
|
+
this.hasContent = !!((_a = this.contentDiv) === null || _a === void 0 ? void 0 : _a.nativeElement.childNodes.length);
|
|
8499
|
+
if (!this.hasContent) {
|
|
8500
|
+
this.changeDetectorRef.markForCheck();
|
|
8501
|
+
}
|
|
8477
8502
|
});
|
|
8478
|
-
if (
|
|
8479
|
-
|
|
8503
|
+
if (this.label === undefined) {
|
|
8504
|
+
const innerText = this.elementRef.nativeElement.textContent.trim() || this.elementRef.nativeElement.innerText.trim();
|
|
8505
|
+
this.label = innerText || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.trim()) || '...';
|
|
8480
8506
|
}
|
|
8481
8507
|
if (this.value === undefined) {
|
|
8482
|
-
this.value = this.
|
|
8508
|
+
this.value = ((_b = this.label) === null || _b === void 0 ? void 0 : _b.trim()) || '...';
|
|
8483
8509
|
}
|
|
8484
8510
|
}
|
|
8511
|
+
/** Get the label for this element which is required by the FocusableOption interface. */
|
|
8485
8512
|
getLabel() {
|
|
8486
8513
|
var _a;
|
|
8487
8514
|
return ((_a = this.label) !== null && _a !== void 0 ? _a : this.value);
|
|
8488
8515
|
}
|
|
8489
8516
|
focus(origin = 'program') {
|
|
8490
|
-
if (this.dropdownVisible) {
|
|
8517
|
+
if (this.dropdownVisible && !this.disabled) {
|
|
8491
8518
|
this.focusMonitor.focusVia(this.elementRef, origin, { preventScroll: false });
|
|
8492
8519
|
this.changeDetectorRef.markForCheck();
|
|
8493
8520
|
}
|
|
8494
8521
|
}
|
|
8495
8522
|
ngOnDestroy() {
|
|
8496
|
-
this.
|
|
8523
|
+
__classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f").next(true);
|
|
8524
|
+
__classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f").complete();
|
|
8497
8525
|
}
|
|
8498
|
-
|
|
8499
|
-
this.
|
|
8526
|
+
setSubscriptions() {
|
|
8527
|
+
this.multiSelectService.multiSelectVisible$
|
|
8528
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f")))
|
|
8529
|
+
.subscribe(visible => {
|
|
8500
8530
|
this.dropdownVisible = visible;
|
|
8501
8531
|
});
|
|
8502
8532
|
}
|
|
8503
8533
|
}
|
|
8504
|
-
|
|
8505
|
-
MultiSelectOptionComponent.ɵ
|
|
8534
|
+
_MultiSelectOptionComponent_destroy$ = new WeakMap();
|
|
8535
|
+
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 });
|
|
8536
|
+
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
8537
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptionComponent, decorators: [{
|
|
8507
8538
|
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.
|
|
8539
|
+
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"] }]
|
|
8540
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$3.FocusMonitor }, { type: MultiSelectService }]; }, propDecorators: { optionsStyle: [{
|
|
8510
8541
|
type: Input
|
|
8511
8542
|
}], label: [{
|
|
8512
8543
|
type: Input
|
|
@@ -8516,9 +8547,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8516
8547
|
type: Input
|
|
8517
8548
|
}], selectedChange: [{
|
|
8518
8549
|
type: Output
|
|
8519
|
-
}],
|
|
8550
|
+
}], contentDiv: [{
|
|
8520
8551
|
type: ViewChild,
|
|
8521
8552
|
args: ['contentDiv']
|
|
8553
|
+
}], id: [{
|
|
8554
|
+
type: Input
|
|
8555
|
+
}, {
|
|
8556
|
+
type: HostBinding
|
|
8522
8557
|
}], disabled: [{
|
|
8523
8558
|
type: Input
|
|
8524
8559
|
}], selected: [{
|
|
@@ -8526,6 +8561,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8526
8561
|
}], hostClasses: [{
|
|
8527
8562
|
type: HostBinding,
|
|
8528
8563
|
args: ['class']
|
|
8564
|
+
}], role: [{
|
|
8565
|
+
type: Input
|
|
8566
|
+
}, {
|
|
8567
|
+
type: HostBinding,
|
|
8568
|
+
args: ['role']
|
|
8529
8569
|
}], tabIndex: [{
|
|
8530
8570
|
type: HostBinding,
|
|
8531
8571
|
args: ['attr.tabindex']
|
|
@@ -8538,6 +8578,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8538
8578
|
}], ariaSelected: [{
|
|
8539
8579
|
type: HostBinding,
|
|
8540
8580
|
args: ['attr.aria-selected']
|
|
8581
|
+
}], onKeyDown: [{
|
|
8582
|
+
type: HostListener,
|
|
8583
|
+
args: ['keydown', ['$event']]
|
|
8541
8584
|
}], onKeyUp: [{
|
|
8542
8585
|
type: HostListener,
|
|
8543
8586
|
args: ['keyup', ['$event']]
|
|
@@ -8651,6 +8694,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8651
8694
|
type: Input
|
|
8652
8695
|
}] } });
|
|
8653
8696
|
|
|
8697
|
+
var _MultiSelectComponent_destroy$;
|
|
8654
8698
|
// @ts-ignore
|
|
8655
8699
|
const observeReferenceModifier = {
|
|
8656
8700
|
name: 'observeReferenceModifier', enabled: true, phase: 'main', fn({ state }) { },
|
|
@@ -8681,17 +8725,22 @@ class MultiSelectComponent {
|
|
|
8681
8725
|
this.focusMonitor = focusMonitor;
|
|
8682
8726
|
this.multiSelectService = multiSelectService;
|
|
8683
8727
|
this.iterableDiffers = iterableDiffers;
|
|
8728
|
+
_MultiSelectComponent_destroy$.set(this, new Subject());
|
|
8684
8729
|
this.onChange = (value) => { };
|
|
8730
|
+
this.onTouched = () => { };
|
|
8685
8731
|
this.cleaner = true;
|
|
8686
8732
|
this._disabled = false;
|
|
8687
8733
|
this._multiple = false;
|
|
8688
8734
|
this.nativeName = '';
|
|
8689
8735
|
this.nativeId = '';
|
|
8736
|
+
this.options = [];
|
|
8690
8737
|
this.optionsMaxHeight = 'auto';
|
|
8691
8738
|
this.optionsStyle = 'checkbox';
|
|
8692
8739
|
this.placeholder = 'Select...';
|
|
8693
8740
|
this.search = true;
|
|
8694
8741
|
this.searchNoResultsLabel = 'no items';
|
|
8742
|
+
this._searchValue = '';
|
|
8743
|
+
this.searchValueChange = new EventEmitter();
|
|
8695
8744
|
this.selectAll = true;
|
|
8696
8745
|
this.selectAllLabel = 'Select all options';
|
|
8697
8746
|
this.selectionType = 'tags';
|
|
@@ -8699,6 +8748,8 @@ class MultiSelectComponent {
|
|
|
8699
8748
|
this.selectionTypeCounterTextPluralMap = { '=1': 'item selected', 'other': 'items selected' };
|
|
8700
8749
|
this._value = [''];
|
|
8701
8750
|
this.valueChange = new EventEmitter();
|
|
8751
|
+
this._virtualScroller = false;
|
|
8752
|
+
this._visibleItems = 10;
|
|
8702
8753
|
this._visible = false;
|
|
8703
8754
|
this.visibleChange = new EventEmitter();
|
|
8704
8755
|
/**
|
|
@@ -8708,7 +8759,7 @@ class MultiSelectComponent {
|
|
|
8708
8759
|
this.popperjsOptions = {
|
|
8709
8760
|
strategy: 'fixed', modifiers: [observeReferenceModifier, {
|
|
8710
8761
|
name: 'offset', options: {
|
|
8711
|
-
offset:
|
|
8762
|
+
offset: () => this.selectionType === 'tags' && this.selectedOptions.length ? [-2, 8] : [-12, 12]
|
|
8712
8763
|
}
|
|
8713
8764
|
}]
|
|
8714
8765
|
};
|
|
@@ -8716,19 +8767,19 @@ class MultiSelectComponent {
|
|
|
8716
8767
|
this._selectedOptions = [];
|
|
8717
8768
|
this._tabIndex = '-1';
|
|
8718
8769
|
this.visibleOptions = 0;
|
|
8719
|
-
this._searchValue = '';
|
|
8720
8770
|
this._subtreeFocused = this.focusOrigin(null);
|
|
8721
8771
|
this.differ = this.iterableDiffers.find(this._value).create();
|
|
8722
8772
|
}
|
|
8723
8773
|
writeValue(value) {
|
|
8724
8774
|
if (value !== null) {
|
|
8725
|
-
this.value = value;
|
|
8775
|
+
this.value = Array.isArray(value) ? [...value] : [value !== null && value !== void 0 ? value : ''];
|
|
8726
8776
|
}
|
|
8727
8777
|
}
|
|
8728
8778
|
registerOnChange(fn) {
|
|
8729
8779
|
this.onChange = fn;
|
|
8730
8780
|
}
|
|
8731
8781
|
registerOnTouched(fn) {
|
|
8782
|
+
this.onTouched = fn;
|
|
8732
8783
|
}
|
|
8733
8784
|
setDisabledState(isDisabled) {
|
|
8734
8785
|
this.disabled = isDisabled;
|
|
@@ -8748,16 +8799,29 @@ class MultiSelectComponent {
|
|
|
8748
8799
|
get multiple() {
|
|
8749
8800
|
return this._multiple;
|
|
8750
8801
|
}
|
|
8802
|
+
set searchValue(value) {
|
|
8803
|
+
if (this._searchValue !== value.trimStart()) {
|
|
8804
|
+
this._searchValue = value.trimStart();
|
|
8805
|
+
this.visible = !!this.searchValue.length || this.visible;
|
|
8806
|
+
this.filterOptions(this.searchValue);
|
|
8807
|
+
this.inputElementSize();
|
|
8808
|
+
this.searchValueChange.emit(this._searchValue);
|
|
8809
|
+
}
|
|
8810
|
+
}
|
|
8811
|
+
get searchValue() {
|
|
8812
|
+
return this._searchValue;
|
|
8813
|
+
}
|
|
8751
8814
|
/**
|
|
8752
8815
|
* Initial value of multi-select
|
|
8816
|
+
* @type string | string[]
|
|
8753
8817
|
*/
|
|
8754
8818
|
set value(value) {
|
|
8755
8819
|
const newValue = Array.isArray(value) ? [...value] : [value !== null && value !== void 0 ? value : ''];
|
|
8756
8820
|
if (this.differ) {
|
|
8757
8821
|
const changes = this.differ.diff(newValue);
|
|
8758
8822
|
if (changes) {
|
|
8759
|
-
this._value = newValue;
|
|
8760
|
-
this.onChange(newValue);
|
|
8823
|
+
this._value = [...newValue];
|
|
8824
|
+
this.onChange([...newValue]);
|
|
8761
8825
|
this.selectOptions();
|
|
8762
8826
|
// not required here:
|
|
8763
8827
|
// this.selectedOptionsUpdate();
|
|
@@ -8769,18 +8833,43 @@ class MultiSelectComponent {
|
|
|
8769
8833
|
var _a, _b;
|
|
8770
8834
|
return this.multiple ? [...this._value] : (_b = (_a = this._value[0]) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
|
|
8771
8835
|
}
|
|
8836
|
+
/**
|
|
8837
|
+
* Enable virtual scroller for the options list.
|
|
8838
|
+
* @type boolean
|
|
8839
|
+
* @default false
|
|
8840
|
+
* todo: virtual scroller implementation
|
|
8841
|
+
*/
|
|
8842
|
+
set virtualScroller(value) {
|
|
8843
|
+
this._virtualScroller = coerceBooleanProperty(value);
|
|
8844
|
+
}
|
|
8845
|
+
get virtualScroller() {
|
|
8846
|
+
return this._virtualScroller;
|
|
8847
|
+
}
|
|
8848
|
+
/**
|
|
8849
|
+
* Amount of visible options, if set - overwrites optionsMaxHeight
|
|
8850
|
+
* @type number
|
|
8851
|
+
* @default 10
|
|
8852
|
+
*/
|
|
8853
|
+
set visibleItems(value) {
|
|
8854
|
+
this._visibleItems = value || 1;
|
|
8855
|
+
this.optionsMaxHeight = ((42 * value) + 16).toString();
|
|
8856
|
+
}
|
|
8857
|
+
get visibleItems() {
|
|
8858
|
+
return this._visibleItems;
|
|
8859
|
+
}
|
|
8772
8860
|
/**
|
|
8773
8861
|
* Toggle the visibility of the dropdown select component.
|
|
8774
8862
|
* @type boolean
|
|
8775
8863
|
* @default false
|
|
8776
8864
|
*/
|
|
8777
8865
|
set visible(value) {
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
this.
|
|
8782
|
-
|
|
8783
|
-
|
|
8866
|
+
var _a;
|
|
8867
|
+
const visible = coerceBooleanProperty(value);
|
|
8868
|
+
if (visible !== this._visible) {
|
|
8869
|
+
this._visible = visible;
|
|
8870
|
+
this.multiSelectService.toggleVisible(visible);
|
|
8871
|
+
if (visible) {
|
|
8872
|
+
(_a = this.listKeyManager) === null || _a === void 0 ? void 0 : _a.setFirstItemActive();
|
|
8784
8873
|
}
|
|
8785
8874
|
}
|
|
8786
8875
|
}
|
|
@@ -8796,7 +8885,7 @@ class MultiSelectComponent {
|
|
|
8796
8885
|
return this._selectedOptions;
|
|
8797
8886
|
}
|
|
8798
8887
|
get selectedOptionsText() {
|
|
8799
|
-
return this.selectedOptions.map(
|
|
8888
|
+
return this.selectedOptions.map(option => option.label).join(', ');
|
|
8800
8889
|
}
|
|
8801
8890
|
get counterText() {
|
|
8802
8891
|
return `${this.selectedOptions.length} ${this.selectionTypeCounterText}`;
|
|
@@ -8823,6 +8912,9 @@ class MultiSelectComponent {
|
|
|
8823
8912
|
'is-invalid': this.valid === false
|
|
8824
8913
|
};
|
|
8825
8914
|
}
|
|
8915
|
+
get ariaMultiSelectable() {
|
|
8916
|
+
return this.multiple;
|
|
8917
|
+
}
|
|
8826
8918
|
get tabIndex() {
|
|
8827
8919
|
return this._tabIndex;
|
|
8828
8920
|
}
|
|
@@ -8833,8 +8925,10 @@ class MultiSelectComponent {
|
|
|
8833
8925
|
}
|
|
8834
8926
|
onKeyUp($event) {
|
|
8835
8927
|
var _a;
|
|
8836
|
-
if (this.disabled)
|
|
8928
|
+
if (this.disabled) {
|
|
8837
8929
|
return;
|
|
8930
|
+
}
|
|
8931
|
+
this.onTouched();
|
|
8838
8932
|
if ($event.key === 'Escape') {
|
|
8839
8933
|
this.visible = false;
|
|
8840
8934
|
this.searchValue = '';
|
|
@@ -8857,16 +8951,20 @@ class MultiSelectComponent {
|
|
|
8857
8951
|
}
|
|
8858
8952
|
}
|
|
8859
8953
|
onKeyDown($event) {
|
|
8860
|
-
|
|
8954
|
+
var _a;
|
|
8955
|
+
if (this.disabled) {
|
|
8861
8956
|
return;
|
|
8957
|
+
}
|
|
8862
8958
|
// avoid setting focus to option while on input element
|
|
8863
|
-
if ($event.target === this.inputElement.nativeElement)
|
|
8959
|
+
if ($event.target === this.inputElement.nativeElement) {
|
|
8864
8960
|
return;
|
|
8865
|
-
|
|
8961
|
+
}
|
|
8962
|
+
(_a = this.listKeyManager) === null || _a === void 0 ? void 0 : _a.onKeydown($event);
|
|
8866
8963
|
}
|
|
8867
8964
|
onClick($event) {
|
|
8868
|
-
if (this.disabled)
|
|
8965
|
+
if (this.disabled) {
|
|
8869
8966
|
return;
|
|
8967
|
+
}
|
|
8870
8968
|
if (!this.visible) {
|
|
8871
8969
|
this.visible = true;
|
|
8872
8970
|
this.setFocus('mouse', 'onClick');
|
|
@@ -8875,15 +8973,7 @@ class MultiSelectComponent {
|
|
|
8875
8973
|
this.visible = false;
|
|
8876
8974
|
this.setFocus('mouse', 'onClick');
|
|
8877
8975
|
}
|
|
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;
|
|
8976
|
+
this.onTouched();
|
|
8887
8977
|
}
|
|
8888
8978
|
get subtreeFocused() {
|
|
8889
8979
|
return this._subtreeFocused;
|
|
@@ -8893,8 +8983,9 @@ class MultiSelectComponent {
|
|
|
8893
8983
|
this.visible = value === false ? false : this.visible;
|
|
8894
8984
|
}
|
|
8895
8985
|
focusOrigin(origin) {
|
|
8896
|
-
if (this.disabled)
|
|
8986
|
+
if (this.disabled) {
|
|
8897
8987
|
return false;
|
|
8988
|
+
}
|
|
8898
8989
|
const focused = !!origin;
|
|
8899
8990
|
this.searchValue = focused ? this.searchValue : '';
|
|
8900
8991
|
return focused;
|
|
@@ -8903,6 +8994,8 @@ class MultiSelectComponent {
|
|
|
8903
8994
|
this.tabIndex = '0';
|
|
8904
8995
|
}
|
|
8905
8996
|
ngOnDestroy() {
|
|
8997
|
+
__classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f").next(true);
|
|
8998
|
+
__classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f").complete();
|
|
8906
8999
|
this.multiselectSubscribe(false);
|
|
8907
9000
|
this.setFocusMonitor(false);
|
|
8908
9001
|
}
|
|
@@ -8920,12 +9013,19 @@ class MultiSelectComponent {
|
|
|
8920
9013
|
}
|
|
8921
9014
|
ngAfterContentInit() {
|
|
8922
9015
|
this.visibleOptions = this.multiSelectOptions.length;
|
|
9016
|
+
this.multiSelectOptions.changes
|
|
9017
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f")))
|
|
9018
|
+
.subscribe(next => {
|
|
9019
|
+
var _a;
|
|
9020
|
+
this.visibleOptions = (_a = this.multiSelectOptions) === null || _a === void 0 ? void 0 : _a.filter((item) => item.visible).length;
|
|
9021
|
+
this.selectOptions();
|
|
9022
|
+
});
|
|
8923
9023
|
}
|
|
8924
9024
|
ngAfterViewInit() {
|
|
8925
9025
|
this.selectOptions();
|
|
8926
9026
|
this.multiselectSubscribe();
|
|
8927
9027
|
this.listKeyManager = new FocusKeyManager(this.multiSelectOptions).withHomeAndEnd().withTypeAhead();
|
|
8928
|
-
this.listKeyManager.skipPredicate(item => (
|
|
9028
|
+
this.listKeyManager.skipPredicate(item => (item.disabled || !item.visible));
|
|
8929
9029
|
this.listKeyManager.setFirstItemActive();
|
|
8930
9030
|
this.setFocusMonitor(!this.disabled);
|
|
8931
9031
|
// not required here:
|
|
@@ -8935,12 +9035,8 @@ class MultiSelectComponent {
|
|
|
8935
9035
|
});
|
|
8936
9036
|
}
|
|
8937
9037
|
multiselectSubscribe(subscribe = true) {
|
|
8938
|
-
var _a, _b
|
|
9038
|
+
var _a, _b;
|
|
8939
9039
|
if (subscribe) {
|
|
8940
|
-
this.multiSelectOptionsSubscription = this.multiSelectOptions.changes.subscribe(change => {
|
|
8941
|
-
// console.log('multiSelectOptions change', change)
|
|
8942
|
-
this.selectOptions();
|
|
8943
|
-
});
|
|
8944
9040
|
this.multiselectVisibleSubscription = this.multiSelectService.multiSelectVisible$.subscribe((visible) => {
|
|
8945
9041
|
if (this.isDropdownVisible !== visible) {
|
|
8946
9042
|
this.isDropdownVisible = visible;
|
|
@@ -8970,8 +9066,7 @@ class MultiSelectComponent {
|
|
|
8970
9066
|
}
|
|
8971
9067
|
else {
|
|
8972
9068
|
(_a = this.multiselectVisibleSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
8973
|
-
(_b = this.
|
|
8974
|
-
(_c = this.multiselectStateSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
|
|
9069
|
+
(_b = this.multiselectStateSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
8975
9070
|
}
|
|
8976
9071
|
}
|
|
8977
9072
|
selectOptions() {
|
|
@@ -8983,8 +9078,9 @@ class MultiSelectComponent {
|
|
|
8983
9078
|
}
|
|
8984
9079
|
clearAllOptions($event) {
|
|
8985
9080
|
this.selectedOptions.forEach((option) => {
|
|
8986
|
-
if (!option._disabled)
|
|
9081
|
+
if (!option._disabled) {
|
|
8987
9082
|
option.selected = false;
|
|
9083
|
+
}
|
|
8988
9084
|
});
|
|
8989
9085
|
this.selectedOptionsUpdate();
|
|
8990
9086
|
if ($event) {
|
|
@@ -8994,8 +9090,9 @@ class MultiSelectComponent {
|
|
|
8994
9090
|
}
|
|
8995
9091
|
selectAllOptions() {
|
|
8996
9092
|
this.multiSelectOptions.forEach((option, index) => {
|
|
8997
|
-
if (!option.disabled && option.visible)
|
|
9093
|
+
if (!option.disabled && option.visible) {
|
|
8998
9094
|
option.selected = true;
|
|
9095
|
+
}
|
|
8999
9096
|
});
|
|
9000
9097
|
this.selectedOptionsUpdate();
|
|
9001
9098
|
}
|
|
@@ -9004,8 +9101,9 @@ class MultiSelectComponent {
|
|
|
9004
9101
|
}
|
|
9005
9102
|
setFocus(origin = 'program', methodName) {
|
|
9006
9103
|
var _a, _b;
|
|
9007
|
-
if (this.disabled)
|
|
9104
|
+
if (this.disabled) {
|
|
9008
9105
|
return;
|
|
9106
|
+
}
|
|
9009
9107
|
const element = (_a = this.inputElement) !== null && _a !== void 0 ? _a : this.elementRef;
|
|
9010
9108
|
const preventScroll = origin === 'program';
|
|
9011
9109
|
(_b = this.focusMonitor) === null || _b === void 0 ? void 0 : _b.focusVia(element, origin, { preventScroll: preventScroll });
|
|
@@ -9016,11 +9114,11 @@ class MultiSelectComponent {
|
|
|
9016
9114
|
const searchString = (_a = value.toLowerCase()) !== null && _a !== void 0 ? _a : '';
|
|
9017
9115
|
(_b = this.multiSelectOptions) === null || _b === void 0 ? void 0 : _b.forEach((item, index) => {
|
|
9018
9116
|
var _a, _b;
|
|
9019
|
-
if (
|
|
9020
|
-
item.visible =
|
|
9117
|
+
if (this.search === 'external' || !searchString) {
|
|
9118
|
+
item.visible = true;
|
|
9021
9119
|
}
|
|
9022
9120
|
else {
|
|
9023
|
-
item.visible = true;
|
|
9121
|
+
item.visible = (_b = (_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchString)) !== null && _b !== void 0 ? _b : true;
|
|
9024
9122
|
}
|
|
9025
9123
|
});
|
|
9026
9124
|
this.visibleOptions = (_c = this.multiSelectOptions) === null || _c === void 0 ? void 0 : _c.filter((item) => item.visible).length;
|
|
@@ -9031,8 +9129,9 @@ class MultiSelectComponent {
|
|
|
9031
9129
|
this.updateNativeSelect();
|
|
9032
9130
|
}
|
|
9033
9131
|
updateNativeSelect() {
|
|
9034
|
-
if (!this.nativeSelectRef)
|
|
9132
|
+
if (!this.nativeSelectRef) {
|
|
9035
9133
|
return;
|
|
9134
|
+
}
|
|
9036
9135
|
const options = this.selectedOptions.map(item => {
|
|
9037
9136
|
const { selected, value, label } = item;
|
|
9038
9137
|
return { selected, value, label };
|
|
@@ -9055,8 +9154,9 @@ class MultiSelectComponent {
|
|
|
9055
9154
|
}
|
|
9056
9155
|
}
|
|
9057
9156
|
handleSearchKeyDown($event) {
|
|
9058
|
-
if (this.searchValue.length || this.selectedOptions.length === 0)
|
|
9157
|
+
if (this.searchValue.length || this.selectedOptions.length === 0) {
|
|
9059
9158
|
return;
|
|
9159
|
+
}
|
|
9060
9160
|
if (['Backspace', 'Delete'].includes($event.key)) {
|
|
9061
9161
|
$event.stopPropagation();
|
|
9062
9162
|
const last = this.selectedOptions.filter(option => !option.disabled).pop();
|
|
@@ -9094,13 +9194,14 @@ class MultiSelectComponent {
|
|
|
9094
9194
|
}
|
|
9095
9195
|
}
|
|
9096
9196
|
}
|
|
9197
|
+
_MultiSelectComponent_destroy$ = new WeakMap();
|
|
9097
9198
|
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: [
|
|
9199
|
+
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
9200
|
MultiSelectService,
|
|
9100
9201
|
{
|
|
9101
9202
|
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MultiSelectComponent), multi: true
|
|
9102
9203
|
}
|
|
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
|
|
9204
|
+
], 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
9205
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
9105
9206
|
type: Component,
|
|
9106
9207
|
args: [{ selector: 'c-multi-select', exportAs: 'cMultiSelect', providers: [
|
|
@@ -9108,7 +9209,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9108
9209
|
{
|
|
9109
9210
|
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MultiSelectComponent), multi: true
|
|
9110
9211
|
}
|
|
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
|
|
9212
|
+
], 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
9213
|
}], 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
9214
|
type: Input
|
|
9114
9215
|
}], disabled: [{
|
|
@@ -9119,6 +9220,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9119
9220
|
type: Input
|
|
9120
9221
|
}], nativeId: [{
|
|
9121
9222
|
type: Input
|
|
9223
|
+
}], options: [{
|
|
9224
|
+
type: Input
|
|
9122
9225
|
}], optionsMaxHeight: [{
|
|
9123
9226
|
type: Input
|
|
9124
9227
|
}], optionsStyle: [{
|
|
@@ -9129,6 +9232,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9129
9232
|
type: Input
|
|
9130
9233
|
}], searchNoResultsLabel: [{
|
|
9131
9234
|
type: Input
|
|
9235
|
+
}], searchValue: [{
|
|
9236
|
+
type: Input
|
|
9237
|
+
}], searchValueChange: [{
|
|
9238
|
+
type: Output
|
|
9132
9239
|
}], selectAll: [{
|
|
9133
9240
|
type: Input
|
|
9134
9241
|
}], selectAllLabel: [{
|
|
@@ -9147,6 +9254,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9147
9254
|
type: Output
|
|
9148
9255
|
}], valid: [{
|
|
9149
9256
|
type: Input
|
|
9257
|
+
}], virtualScroller: [{
|
|
9258
|
+
type: Input
|
|
9259
|
+
}], visibleItems: [{
|
|
9260
|
+
type: Input
|
|
9150
9261
|
}], visible: [{
|
|
9151
9262
|
type: Input
|
|
9152
9263
|
}], visibleChange: [{
|
|
@@ -9172,6 +9283,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9172
9283
|
}], hostClasses: [{
|
|
9173
9284
|
type: HostBinding,
|
|
9174
9285
|
args: ['class']
|
|
9286
|
+
}], ariaMultiSelectable: [{
|
|
9287
|
+
type: HostBinding,
|
|
9288
|
+
args: ['attr.aria-multiselectable']
|
|
9175
9289
|
}], tabIndex: [{
|
|
9176
9290
|
type: HostBinding,
|
|
9177
9291
|
args: ['attr.tabindex']
|
|
@@ -12756,7 +12870,7 @@ class FilterInputDirective {
|
|
|
12756
12870
|
setSubscription(subscribe = !__classPrivateFieldGet(this, _FilterInputDirective_valueSubscription, "f")) {
|
|
12757
12871
|
if (subscribe) {
|
|
12758
12872
|
__classPrivateFieldSet(this, _FilterInputDirective_valueSubscription, this.value$
|
|
12759
|
-
.pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12873
|
+
.pipe(distinctUntilChanged(), takeUntil$1(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12760
12874
|
.subscribe(value => {
|
|
12761
12875
|
if (__classPrivateFieldGet(this, _FilterInputDirective_value, "f") !== value) {
|
|
12762
12876
|
__classPrivateFieldSet(this, _FilterInputDirective_value, value, "f");
|
|
@@ -12768,7 +12882,7 @@ class FilterInputDirective {
|
|
|
12768
12882
|
__classPrivateFieldSet(this, _FilterInputDirective_inputSubscription, fromEvent(this.elementRef.nativeElement, this.onEvent)
|
|
12769
12883
|
.pipe(map(event => {
|
|
12770
12884
|
return event.target.value;
|
|
12771
|
-
}), debounceTime(dueTime), takeUntil(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12885
|
+
}), debounceTime(dueTime), takeUntil$1(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12772
12886
|
.subscribe((value) => {
|
|
12773
12887
|
if (value !== __classPrivateFieldGet(this, _FilterInputDirective_value, "f")) {
|
|
12774
12888
|
this.value$.next(value);
|
|
@@ -12777,6 +12891,7 @@ class FilterInputDirective {
|
|
|
12777
12891
|
}
|
|
12778
12892
|
else {
|
|
12779
12893
|
__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f").next(true);
|
|
12894
|
+
__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f").complete();
|
|
12780
12895
|
}
|
|
12781
12896
|
}
|
|
12782
12897
|
}
|