@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 } from 'tslib';
|
|
14
14
|
import * as i2 from '@angular/forms';
|
|
@@ -448,12 +448,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
448
448
|
args: ['class']
|
|
449
449
|
}] } });
|
|
450
450
|
|
|
451
|
-
let nextId$
|
|
451
|
+
let nextId$2 = 0;
|
|
452
452
|
class AccordionItemComponent {
|
|
453
453
|
constructor(accordionService) {
|
|
454
454
|
this.accordionService = accordionService;
|
|
455
455
|
this._visible = false;
|
|
456
|
-
this.contentId = `accordion-item-${nextId$
|
|
456
|
+
this.contentId = `accordion-item-${nextId$2++}`;
|
|
457
457
|
this.itemContext = { $implicit: this.visible };
|
|
458
458
|
this.templates = {};
|
|
459
459
|
}
|
|
@@ -8303,10 +8303,10 @@ class MultiSelectOptgroupLabelComponent {
|
|
|
8303
8303
|
}
|
|
8304
8304
|
}
|
|
8305
8305
|
MultiSelectOptgroupLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptgroupLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8306
|
-
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:
|
|
8306
|
+
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 });
|
|
8307
8307
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptgroupLabelComponent, decorators: [{
|
|
8308
8308
|
type: Component,
|
|
8309
|
-
args: [{ selector: 'c-multi-select-optgroup-label', template:
|
|
8309
|
+
args: [{ selector: 'c-multi-select-optgroup-label', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}\n"] }]
|
|
8310
8310
|
}], ctorParameters: function () { return []; }, propDecorators: { hostClasses: [{
|
|
8311
8311
|
type: HostBinding,
|
|
8312
8312
|
args: ['class']
|
|
@@ -8332,10 +8332,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8332
8332
|
type: Injectable
|
|
8333
8333
|
}], ctorParameters: function () { return []; } });
|
|
8334
8334
|
|
|
8335
|
+
var _MultiSelectOptionComponent_destroy$;
|
|
8336
|
+
/** The next id to use for creating unique DOM IDs. */
|
|
8337
|
+
let nextId$1 = 0;
|
|
8335
8338
|
class MultiSelectOptionComponent {
|
|
8336
|
-
constructor(elementRef,
|
|
8339
|
+
constructor(elementRef, changeDetectorRef, focusMonitor, multiSelectService) {
|
|
8337
8340
|
this.elementRef = elementRef;
|
|
8338
|
-
this.renderer = renderer;
|
|
8339
8341
|
this.changeDetectorRef = changeDetectorRef;
|
|
8340
8342
|
this.focusMonitor = focusMonitor;
|
|
8341
8343
|
this.multiSelectService = multiSelectService;
|
|
@@ -8344,8 +8346,19 @@ class MultiSelectOptionComponent {
|
|
|
8344
8346
|
this.selectedChange = new EventEmitter();
|
|
8345
8347
|
this.hasContent = true;
|
|
8346
8348
|
this.dropdownVisible = false;
|
|
8349
|
+
_MultiSelectOptionComponent_destroy$.set(this, new Subject());
|
|
8350
|
+
this._generatedId = `coreui-option-${nextId$1++}`;
|
|
8351
|
+
this._id = this._generatedId;
|
|
8347
8352
|
this._disabled = false;
|
|
8348
8353
|
this._selected = false;
|
|
8354
|
+
this.setSubscriptions();
|
|
8355
|
+
}
|
|
8356
|
+
/** The id of the option element. */
|
|
8357
|
+
get id() {
|
|
8358
|
+
return this._id || this._generatedId;
|
|
8359
|
+
}
|
|
8360
|
+
set id(value) {
|
|
8361
|
+
this._id = value;
|
|
8349
8362
|
}
|
|
8350
8363
|
set disabled(value) {
|
|
8351
8364
|
this._disabled = coerceBooleanProperty(value);
|
|
@@ -8375,14 +8388,22 @@ class MultiSelectOptionComponent {
|
|
|
8375
8388
|
'd-none': !this.visible
|
|
8376
8389
|
};
|
|
8377
8390
|
}
|
|
8391
|
+
get role() {
|
|
8392
|
+
return 'option';
|
|
8393
|
+
}
|
|
8378
8394
|
get tabIndex() {
|
|
8379
|
-
return this.disabled ?
|
|
8395
|
+
return this.disabled ? -1 : 0;
|
|
8380
8396
|
}
|
|
8381
8397
|
get ariaDisabled() {
|
|
8382
8398
|
return this.disabled || null;
|
|
8383
8399
|
}
|
|
8384
8400
|
get ariaSelected() {
|
|
8385
|
-
return this.selected;
|
|
8401
|
+
return this.selected || undefined;
|
|
8402
|
+
}
|
|
8403
|
+
onKeyDown($event) {
|
|
8404
|
+
if (['Space'].includes($event.code)) {
|
|
8405
|
+
$event.preventDefault();
|
|
8406
|
+
}
|
|
8386
8407
|
}
|
|
8387
8408
|
onKeyUp($event) {
|
|
8388
8409
|
if (this.dropdownVisible) {
|
|
@@ -8398,41 +8419,50 @@ class MultiSelectOptionComponent {
|
|
|
8398
8419
|
this.selected = this.disabled ? this.selected : !this.selected;
|
|
8399
8420
|
this.focus('mouse');
|
|
8400
8421
|
}
|
|
8401
|
-
|
|
8422
|
+
ngAfterViewInit() {
|
|
8402
8423
|
setTimeout(() => {
|
|
8403
|
-
this.hasContent = !!this.
|
|
8424
|
+
this.hasContent = !!this.contentDiv?.nativeElement.childNodes.length;
|
|
8425
|
+
if (!this.hasContent) {
|
|
8426
|
+
this.changeDetectorRef.markForCheck();
|
|
8427
|
+
}
|
|
8404
8428
|
});
|
|
8405
|
-
if (
|
|
8406
|
-
|
|
8429
|
+
if (this.label === undefined) {
|
|
8430
|
+
const innerText = this.elementRef.nativeElement.textContent.trim() || this.elementRef.nativeElement.innerText.trim();
|
|
8431
|
+
this.label = innerText || this.value?.trim() || '...';
|
|
8407
8432
|
}
|
|
8408
8433
|
if (this.value === undefined) {
|
|
8409
|
-
this.value = this.
|
|
8434
|
+
this.value = this.label?.trim() || '...';
|
|
8410
8435
|
}
|
|
8411
8436
|
}
|
|
8437
|
+
/** Get the label for this element which is required by the FocusableOption interface. */
|
|
8412
8438
|
getLabel() {
|
|
8413
8439
|
return (this.label ?? this.value);
|
|
8414
8440
|
}
|
|
8415
8441
|
focus(origin = 'program') {
|
|
8416
|
-
if (this.dropdownVisible) {
|
|
8442
|
+
if (this.dropdownVisible && !this.disabled) {
|
|
8417
8443
|
this.focusMonitor.focusVia(this.elementRef, origin, { preventScroll: false });
|
|
8418
8444
|
this.changeDetectorRef.markForCheck();
|
|
8419
8445
|
}
|
|
8420
8446
|
}
|
|
8421
8447
|
ngOnDestroy() {
|
|
8422
|
-
this.
|
|
8448
|
+
__classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f").next(true);
|
|
8449
|
+
__classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f").complete();
|
|
8423
8450
|
}
|
|
8424
|
-
|
|
8425
|
-
this.
|
|
8451
|
+
setSubscriptions() {
|
|
8452
|
+
this.multiSelectService.multiSelectVisible$
|
|
8453
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _MultiSelectOptionComponent_destroy$, "f")))
|
|
8454
|
+
.subscribe(visible => {
|
|
8426
8455
|
this.dropdownVisible = visible;
|
|
8427
8456
|
});
|
|
8428
8457
|
}
|
|
8429
8458
|
}
|
|
8430
|
-
|
|
8431
|
-
MultiSelectOptionComponent.ɵ
|
|
8459
|
+
_MultiSelectOptionComponent_destroy$ = new WeakMap();
|
|
8460
|
+
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 });
|
|
8461
|
+
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 });
|
|
8432
8462
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectOptionComponent, decorators: [{
|
|
8433
8463
|
type: Component,
|
|
8434
|
-
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"] }]
|
|
8435
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.
|
|
8464
|
+
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"] }]
|
|
8465
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$3.FocusMonitor }, { type: MultiSelectService }]; }, propDecorators: { optionsStyle: [{
|
|
8436
8466
|
type: Input
|
|
8437
8467
|
}], label: [{
|
|
8438
8468
|
type: Input
|
|
@@ -8442,9 +8472,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8442
8472
|
type: Input
|
|
8443
8473
|
}], selectedChange: [{
|
|
8444
8474
|
type: Output
|
|
8445
|
-
}],
|
|
8475
|
+
}], contentDiv: [{
|
|
8446
8476
|
type: ViewChild,
|
|
8447
8477
|
args: ['contentDiv']
|
|
8478
|
+
}], id: [{
|
|
8479
|
+
type: Input
|
|
8480
|
+
}, {
|
|
8481
|
+
type: HostBinding
|
|
8448
8482
|
}], disabled: [{
|
|
8449
8483
|
type: Input
|
|
8450
8484
|
}], selected: [{
|
|
@@ -8452,6 +8486,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8452
8486
|
}], hostClasses: [{
|
|
8453
8487
|
type: HostBinding,
|
|
8454
8488
|
args: ['class']
|
|
8489
|
+
}], role: [{
|
|
8490
|
+
type: Input
|
|
8491
|
+
}, {
|
|
8492
|
+
type: HostBinding,
|
|
8493
|
+
args: ['role']
|
|
8455
8494
|
}], tabIndex: [{
|
|
8456
8495
|
type: HostBinding,
|
|
8457
8496
|
args: ['attr.tabindex']
|
|
@@ -8464,6 +8503,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8464
8503
|
}], ariaSelected: [{
|
|
8465
8504
|
type: HostBinding,
|
|
8466
8505
|
args: ['attr.aria-selected']
|
|
8506
|
+
}], onKeyDown: [{
|
|
8507
|
+
type: HostListener,
|
|
8508
|
+
args: ['keydown', ['$event']]
|
|
8467
8509
|
}], onKeyUp: [{
|
|
8468
8510
|
type: HostListener,
|
|
8469
8511
|
args: ['keyup', ['$event']]
|
|
@@ -8576,6 +8618,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8576
8618
|
type: Input
|
|
8577
8619
|
}] } });
|
|
8578
8620
|
|
|
8621
|
+
var _MultiSelectComponent_destroy$;
|
|
8579
8622
|
// @ts-ignore
|
|
8580
8623
|
const observeReferenceModifier = {
|
|
8581
8624
|
name: 'observeReferenceModifier', enabled: true, phase: 'main', fn({ state }) { },
|
|
@@ -8606,17 +8649,22 @@ class MultiSelectComponent {
|
|
|
8606
8649
|
this.focusMonitor = focusMonitor;
|
|
8607
8650
|
this.multiSelectService = multiSelectService;
|
|
8608
8651
|
this.iterableDiffers = iterableDiffers;
|
|
8652
|
+
_MultiSelectComponent_destroy$.set(this, new Subject());
|
|
8609
8653
|
this.onChange = (value) => { };
|
|
8654
|
+
this.onTouched = () => { };
|
|
8610
8655
|
this.cleaner = true;
|
|
8611
8656
|
this._disabled = false;
|
|
8612
8657
|
this._multiple = false;
|
|
8613
8658
|
this.nativeName = '';
|
|
8614
8659
|
this.nativeId = '';
|
|
8660
|
+
this.options = [];
|
|
8615
8661
|
this.optionsMaxHeight = 'auto';
|
|
8616
8662
|
this.optionsStyle = 'checkbox';
|
|
8617
8663
|
this.placeholder = 'Select...';
|
|
8618
8664
|
this.search = true;
|
|
8619
8665
|
this.searchNoResultsLabel = 'no items';
|
|
8666
|
+
this._searchValue = '';
|
|
8667
|
+
this.searchValueChange = new EventEmitter();
|
|
8620
8668
|
this.selectAll = true;
|
|
8621
8669
|
this.selectAllLabel = 'Select all options';
|
|
8622
8670
|
this.selectionType = 'tags';
|
|
@@ -8624,6 +8672,8 @@ class MultiSelectComponent {
|
|
|
8624
8672
|
this.selectionTypeCounterTextPluralMap = { '=1': 'item selected', 'other': 'items selected' };
|
|
8625
8673
|
this._value = [''];
|
|
8626
8674
|
this.valueChange = new EventEmitter();
|
|
8675
|
+
this._virtualScroller = false;
|
|
8676
|
+
this._visibleItems = 10;
|
|
8627
8677
|
this._visible = false;
|
|
8628
8678
|
this.visibleChange = new EventEmitter();
|
|
8629
8679
|
/**
|
|
@@ -8633,7 +8683,7 @@ class MultiSelectComponent {
|
|
|
8633
8683
|
this.popperjsOptions = {
|
|
8634
8684
|
strategy: 'fixed', modifiers: [observeReferenceModifier, {
|
|
8635
8685
|
name: 'offset', options: {
|
|
8636
|
-
offset:
|
|
8686
|
+
offset: () => this.selectionType === 'tags' && this.selectedOptions.length ? [-2, 8] : [-12, 12]
|
|
8637
8687
|
}
|
|
8638
8688
|
}]
|
|
8639
8689
|
};
|
|
@@ -8641,19 +8691,19 @@ class MultiSelectComponent {
|
|
|
8641
8691
|
this._selectedOptions = [];
|
|
8642
8692
|
this._tabIndex = '-1';
|
|
8643
8693
|
this.visibleOptions = 0;
|
|
8644
|
-
this._searchValue = '';
|
|
8645
8694
|
this._subtreeFocused = this.focusOrigin(null);
|
|
8646
8695
|
this.differ = this.iterableDiffers.find(this._value).create();
|
|
8647
8696
|
}
|
|
8648
8697
|
writeValue(value) {
|
|
8649
8698
|
if (value !== null) {
|
|
8650
|
-
this.value = value;
|
|
8699
|
+
this.value = Array.isArray(value) ? [...value] : [value ?? ''];
|
|
8651
8700
|
}
|
|
8652
8701
|
}
|
|
8653
8702
|
registerOnChange(fn) {
|
|
8654
8703
|
this.onChange = fn;
|
|
8655
8704
|
}
|
|
8656
8705
|
registerOnTouched(fn) {
|
|
8706
|
+
this.onTouched = fn;
|
|
8657
8707
|
}
|
|
8658
8708
|
setDisabledState(isDisabled) {
|
|
8659
8709
|
this.disabled = isDisabled;
|
|
@@ -8673,16 +8723,29 @@ class MultiSelectComponent {
|
|
|
8673
8723
|
get multiple() {
|
|
8674
8724
|
return this._multiple;
|
|
8675
8725
|
}
|
|
8726
|
+
set searchValue(value) {
|
|
8727
|
+
if (this._searchValue !== value.trimStart()) {
|
|
8728
|
+
this._searchValue = value.trimStart();
|
|
8729
|
+
this.visible = !!this.searchValue.length || this.visible;
|
|
8730
|
+
this.filterOptions(this.searchValue);
|
|
8731
|
+
this.inputElementSize();
|
|
8732
|
+
this.searchValueChange.emit(this._searchValue);
|
|
8733
|
+
}
|
|
8734
|
+
}
|
|
8735
|
+
get searchValue() {
|
|
8736
|
+
return this._searchValue;
|
|
8737
|
+
}
|
|
8676
8738
|
/**
|
|
8677
8739
|
* Initial value of multi-select
|
|
8740
|
+
* @type string | string[]
|
|
8678
8741
|
*/
|
|
8679
8742
|
set value(value) {
|
|
8680
8743
|
const newValue = Array.isArray(value) ? [...value] : [value ?? ''];
|
|
8681
8744
|
if (this.differ) {
|
|
8682
8745
|
const changes = this.differ.diff(newValue);
|
|
8683
8746
|
if (changes) {
|
|
8684
|
-
this._value = newValue;
|
|
8685
|
-
this.onChange(newValue);
|
|
8747
|
+
this._value = [...newValue];
|
|
8748
|
+
this.onChange([...newValue]);
|
|
8686
8749
|
this.selectOptions();
|
|
8687
8750
|
// not required here:
|
|
8688
8751
|
// this.selectedOptionsUpdate();
|
|
@@ -8693,18 +8756,42 @@ class MultiSelectComponent {
|
|
|
8693
8756
|
get value() {
|
|
8694
8757
|
return this.multiple ? [...this._value] : this._value[0]?.toString() ?? '';
|
|
8695
8758
|
}
|
|
8759
|
+
/**
|
|
8760
|
+
* Enable virtual scroller for the options list.
|
|
8761
|
+
* @type boolean
|
|
8762
|
+
* @default false
|
|
8763
|
+
* todo: virtual scroller implementation
|
|
8764
|
+
*/
|
|
8765
|
+
set virtualScroller(value) {
|
|
8766
|
+
this._virtualScroller = coerceBooleanProperty(value);
|
|
8767
|
+
}
|
|
8768
|
+
get virtualScroller() {
|
|
8769
|
+
return this._virtualScroller;
|
|
8770
|
+
}
|
|
8771
|
+
/**
|
|
8772
|
+
* Amount of visible options, if set - overwrites optionsMaxHeight
|
|
8773
|
+
* @type number
|
|
8774
|
+
* @default 10
|
|
8775
|
+
*/
|
|
8776
|
+
set visibleItems(value) {
|
|
8777
|
+
this._visibleItems = value || 1;
|
|
8778
|
+
this.optionsMaxHeight = ((42 * value) + 16).toString();
|
|
8779
|
+
}
|
|
8780
|
+
get visibleItems() {
|
|
8781
|
+
return this._visibleItems;
|
|
8782
|
+
}
|
|
8696
8783
|
/**
|
|
8697
8784
|
* Toggle the visibility of the dropdown select component.
|
|
8698
8785
|
* @type boolean
|
|
8699
8786
|
* @default false
|
|
8700
8787
|
*/
|
|
8701
8788
|
set visible(value) {
|
|
8702
|
-
const
|
|
8703
|
-
if (
|
|
8704
|
-
this._visible =
|
|
8705
|
-
this.multiSelectService.toggleVisible(
|
|
8706
|
-
if (
|
|
8707
|
-
this.listKeyManager
|
|
8789
|
+
const visible = coerceBooleanProperty(value);
|
|
8790
|
+
if (visible !== this._visible) {
|
|
8791
|
+
this._visible = visible;
|
|
8792
|
+
this.multiSelectService.toggleVisible(visible);
|
|
8793
|
+
if (visible) {
|
|
8794
|
+
this.listKeyManager?.setFirstItemActive();
|
|
8708
8795
|
}
|
|
8709
8796
|
}
|
|
8710
8797
|
}
|
|
@@ -8720,7 +8807,7 @@ class MultiSelectComponent {
|
|
|
8720
8807
|
return this._selectedOptions;
|
|
8721
8808
|
}
|
|
8722
8809
|
get selectedOptionsText() {
|
|
8723
|
-
return this.selectedOptions.map(
|
|
8810
|
+
return this.selectedOptions.map(option => option.label).join(', ');
|
|
8724
8811
|
}
|
|
8725
8812
|
get counterText() {
|
|
8726
8813
|
return `${this.selectedOptions.length} ${this.selectionTypeCounterText}`;
|
|
@@ -8746,6 +8833,9 @@ class MultiSelectComponent {
|
|
|
8746
8833
|
'is-invalid': this.valid === false
|
|
8747
8834
|
};
|
|
8748
8835
|
}
|
|
8836
|
+
get ariaMultiSelectable() {
|
|
8837
|
+
return this.multiple;
|
|
8838
|
+
}
|
|
8749
8839
|
get tabIndex() {
|
|
8750
8840
|
return this._tabIndex;
|
|
8751
8841
|
}
|
|
@@ -8755,8 +8845,10 @@ class MultiSelectComponent {
|
|
|
8755
8845
|
});
|
|
8756
8846
|
}
|
|
8757
8847
|
onKeyUp($event) {
|
|
8758
|
-
if (this.disabled)
|
|
8848
|
+
if (this.disabled) {
|
|
8759
8849
|
return;
|
|
8850
|
+
}
|
|
8851
|
+
this.onTouched();
|
|
8760
8852
|
if ($event.key === 'Escape') {
|
|
8761
8853
|
this.visible = false;
|
|
8762
8854
|
this.searchValue = '';
|
|
@@ -8779,16 +8871,19 @@ class MultiSelectComponent {
|
|
|
8779
8871
|
}
|
|
8780
8872
|
}
|
|
8781
8873
|
onKeyDown($event) {
|
|
8782
|
-
if (this.disabled)
|
|
8874
|
+
if (this.disabled) {
|
|
8783
8875
|
return;
|
|
8876
|
+
}
|
|
8784
8877
|
// avoid setting focus to option while on input element
|
|
8785
|
-
if ($event.target === this.inputElement.nativeElement)
|
|
8878
|
+
if ($event.target === this.inputElement.nativeElement) {
|
|
8786
8879
|
return;
|
|
8787
|
-
|
|
8880
|
+
}
|
|
8881
|
+
this.listKeyManager?.onKeydown($event);
|
|
8788
8882
|
}
|
|
8789
8883
|
onClick($event) {
|
|
8790
|
-
if (this.disabled)
|
|
8884
|
+
if (this.disabled) {
|
|
8791
8885
|
return;
|
|
8886
|
+
}
|
|
8792
8887
|
if (!this.visible) {
|
|
8793
8888
|
this.visible = true;
|
|
8794
8889
|
this.setFocus('mouse', 'onClick');
|
|
@@ -8797,15 +8892,7 @@ class MultiSelectComponent {
|
|
|
8797
8892
|
this.visible = false;
|
|
8798
8893
|
this.setFocus('mouse', 'onClick');
|
|
8799
8894
|
}
|
|
8800
|
-
|
|
8801
|
-
set searchValue(value) {
|
|
8802
|
-
this._searchValue = value.trim();
|
|
8803
|
-
this.visible = !!this.searchValue.length || this.visible;
|
|
8804
|
-
this.filterOptions(this.searchValue);
|
|
8805
|
-
this.inputElementSize();
|
|
8806
|
-
}
|
|
8807
|
-
get searchValue() {
|
|
8808
|
-
return this._searchValue;
|
|
8895
|
+
this.onTouched();
|
|
8809
8896
|
}
|
|
8810
8897
|
get subtreeFocused() {
|
|
8811
8898
|
return this._subtreeFocused;
|
|
@@ -8815,8 +8902,9 @@ class MultiSelectComponent {
|
|
|
8815
8902
|
this.visible = value === false ? false : this.visible;
|
|
8816
8903
|
}
|
|
8817
8904
|
focusOrigin(origin) {
|
|
8818
|
-
if (this.disabled)
|
|
8905
|
+
if (this.disabled) {
|
|
8819
8906
|
return false;
|
|
8907
|
+
}
|
|
8820
8908
|
const focused = !!origin;
|
|
8821
8909
|
this.searchValue = focused ? this.searchValue : '';
|
|
8822
8910
|
return focused;
|
|
@@ -8825,6 +8913,8 @@ class MultiSelectComponent {
|
|
|
8825
8913
|
this.tabIndex = '0';
|
|
8826
8914
|
}
|
|
8827
8915
|
ngOnDestroy() {
|
|
8916
|
+
__classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f").next(true);
|
|
8917
|
+
__classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f").complete();
|
|
8828
8918
|
this.multiselectSubscribe(false);
|
|
8829
8919
|
this.setFocusMonitor(false);
|
|
8830
8920
|
}
|
|
@@ -8842,12 +8932,18 @@ class MultiSelectComponent {
|
|
|
8842
8932
|
}
|
|
8843
8933
|
ngAfterContentInit() {
|
|
8844
8934
|
this.visibleOptions = this.multiSelectOptions.length;
|
|
8935
|
+
this.multiSelectOptions.changes
|
|
8936
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _MultiSelectComponent_destroy$, "f")))
|
|
8937
|
+
.subscribe(next => {
|
|
8938
|
+
this.visibleOptions = this.multiSelectOptions?.filter((item) => item.visible).length;
|
|
8939
|
+
this.selectOptions();
|
|
8940
|
+
});
|
|
8845
8941
|
}
|
|
8846
8942
|
ngAfterViewInit() {
|
|
8847
8943
|
this.selectOptions();
|
|
8848
8944
|
this.multiselectSubscribe();
|
|
8849
8945
|
this.listKeyManager = new FocusKeyManager(this.multiSelectOptions).withHomeAndEnd().withTypeAhead();
|
|
8850
|
-
this.listKeyManager.skipPredicate(item => (
|
|
8946
|
+
this.listKeyManager.skipPredicate(item => (item.disabled || !item.visible));
|
|
8851
8947
|
this.listKeyManager.setFirstItemActive();
|
|
8852
8948
|
this.setFocusMonitor(!this.disabled);
|
|
8853
8949
|
// not required here:
|
|
@@ -8858,10 +8954,6 @@ class MultiSelectComponent {
|
|
|
8858
8954
|
}
|
|
8859
8955
|
multiselectSubscribe(subscribe = true) {
|
|
8860
8956
|
if (subscribe) {
|
|
8861
|
-
this.multiSelectOptionsSubscription = this.multiSelectOptions.changes.subscribe(change => {
|
|
8862
|
-
// console.log('multiSelectOptions change', change)
|
|
8863
|
-
this.selectOptions();
|
|
8864
|
-
});
|
|
8865
8957
|
this.multiselectVisibleSubscription = this.multiSelectService.multiSelectVisible$.subscribe((visible) => {
|
|
8866
8958
|
if (this.isDropdownVisible !== visible) {
|
|
8867
8959
|
this.isDropdownVisible = visible;
|
|
@@ -8891,7 +8983,6 @@ class MultiSelectComponent {
|
|
|
8891
8983
|
}
|
|
8892
8984
|
else {
|
|
8893
8985
|
this.multiselectVisibleSubscription?.unsubscribe();
|
|
8894
|
-
this.multiSelectOptionsSubscription?.unsubscribe();
|
|
8895
8986
|
this.multiselectStateSubscription?.unsubscribe();
|
|
8896
8987
|
}
|
|
8897
8988
|
}
|
|
@@ -8903,8 +8994,9 @@ class MultiSelectComponent {
|
|
|
8903
8994
|
}
|
|
8904
8995
|
clearAllOptions($event) {
|
|
8905
8996
|
this.selectedOptions.forEach((option) => {
|
|
8906
|
-
if (!option._disabled)
|
|
8997
|
+
if (!option._disabled) {
|
|
8907
8998
|
option.selected = false;
|
|
8999
|
+
}
|
|
8908
9000
|
});
|
|
8909
9001
|
this.selectedOptionsUpdate();
|
|
8910
9002
|
if ($event) {
|
|
@@ -8914,8 +9006,9 @@ class MultiSelectComponent {
|
|
|
8914
9006
|
}
|
|
8915
9007
|
selectAllOptions() {
|
|
8916
9008
|
this.multiSelectOptions.forEach((option, index) => {
|
|
8917
|
-
if (!option.disabled && option.visible)
|
|
9009
|
+
if (!option.disabled && option.visible) {
|
|
8918
9010
|
option.selected = true;
|
|
9011
|
+
}
|
|
8919
9012
|
});
|
|
8920
9013
|
this.selectedOptionsUpdate();
|
|
8921
9014
|
}
|
|
@@ -8923,8 +9016,9 @@ class MultiSelectComponent {
|
|
|
8923
9016
|
this.setFocus('program', 'handleTagRemove');
|
|
8924
9017
|
}
|
|
8925
9018
|
setFocus(origin = 'program', methodName) {
|
|
8926
|
-
if (this.disabled)
|
|
9019
|
+
if (this.disabled) {
|
|
8927
9020
|
return;
|
|
9021
|
+
}
|
|
8928
9022
|
const element = this.inputElement ?? this.elementRef;
|
|
8929
9023
|
const preventScroll = origin === 'program';
|
|
8930
9024
|
this.focusMonitor?.focusVia(element, origin, { preventScroll: preventScroll });
|
|
@@ -8933,11 +9027,11 @@ class MultiSelectComponent {
|
|
|
8933
9027
|
filterOptions(value) {
|
|
8934
9028
|
const searchString = value.toLowerCase() ?? '';
|
|
8935
9029
|
this.multiSelectOptions?.forEach((item, index) => {
|
|
8936
|
-
if (
|
|
8937
|
-
item.visible =
|
|
9030
|
+
if (this.search === 'external' || !searchString) {
|
|
9031
|
+
item.visible = true;
|
|
8938
9032
|
}
|
|
8939
9033
|
else {
|
|
8940
|
-
item.visible = true;
|
|
9034
|
+
item.visible = item.label?.toLowerCase().includes(searchString) ?? true;
|
|
8941
9035
|
}
|
|
8942
9036
|
});
|
|
8943
9037
|
this.visibleOptions = this.multiSelectOptions?.filter((item) => item.visible).length;
|
|
@@ -8948,8 +9042,9 @@ class MultiSelectComponent {
|
|
|
8948
9042
|
this.updateNativeSelect();
|
|
8949
9043
|
}
|
|
8950
9044
|
updateNativeSelect() {
|
|
8951
|
-
if (!this.nativeSelectRef)
|
|
9045
|
+
if (!this.nativeSelectRef) {
|
|
8952
9046
|
return;
|
|
9047
|
+
}
|
|
8953
9048
|
const options = this.selectedOptions.map(item => {
|
|
8954
9049
|
const { selected, value, label } = item;
|
|
8955
9050
|
return { selected, value, label };
|
|
@@ -8972,8 +9067,9 @@ class MultiSelectComponent {
|
|
|
8972
9067
|
}
|
|
8973
9068
|
}
|
|
8974
9069
|
handleSearchKeyDown($event) {
|
|
8975
|
-
if (this.searchValue.length || this.selectedOptions.length === 0)
|
|
9070
|
+
if (this.searchValue.length || this.selectedOptions.length === 0) {
|
|
8976
9071
|
return;
|
|
9072
|
+
}
|
|
8977
9073
|
if (['Backspace', 'Delete'].includes($event.key)) {
|
|
8978
9074
|
$event.stopPropagation();
|
|
8979
9075
|
const last = this.selectedOptions.filter(option => !option.disabled).pop();
|
|
@@ -9008,13 +9104,14 @@ class MultiSelectComponent {
|
|
|
9008
9104
|
}
|
|
9009
9105
|
}
|
|
9010
9106
|
}
|
|
9107
|
+
_MultiSelectComponent_destroy$ = new WeakMap();
|
|
9011
9108
|
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 });
|
|
9012
|
-
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: [
|
|
9109
|
+
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: [
|
|
9013
9110
|
MultiSelectService,
|
|
9014
9111
|
{
|
|
9015
9112
|
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MultiSelectComponent), multi: true
|
|
9016
9113
|
}
|
|
9017
|
-
], 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
|
|
9114
|
+
], 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" }] });
|
|
9018
9115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
9019
9116
|
type: Component,
|
|
9020
9117
|
args: [{ selector: 'c-multi-select', exportAs: 'cMultiSelect', providers: [
|
|
@@ -9022,7 +9119,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9022
9119
|
{
|
|
9023
9120
|
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MultiSelectComponent), multi: true
|
|
9024
9121
|
}
|
|
9025
|
-
], 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
|
|
9122
|
+
], 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"] }]
|
|
9026
9123
|
}], 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: [{
|
|
9027
9124
|
type: Input
|
|
9028
9125
|
}], disabled: [{
|
|
@@ -9033,6 +9130,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9033
9130
|
type: Input
|
|
9034
9131
|
}], nativeId: [{
|
|
9035
9132
|
type: Input
|
|
9133
|
+
}], options: [{
|
|
9134
|
+
type: Input
|
|
9036
9135
|
}], optionsMaxHeight: [{
|
|
9037
9136
|
type: Input
|
|
9038
9137
|
}], optionsStyle: [{
|
|
@@ -9043,6 +9142,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9043
9142
|
type: Input
|
|
9044
9143
|
}], searchNoResultsLabel: [{
|
|
9045
9144
|
type: Input
|
|
9145
|
+
}], searchValue: [{
|
|
9146
|
+
type: Input
|
|
9147
|
+
}], searchValueChange: [{
|
|
9148
|
+
type: Output
|
|
9046
9149
|
}], selectAll: [{
|
|
9047
9150
|
type: Input
|
|
9048
9151
|
}], selectAllLabel: [{
|
|
@@ -9061,6 +9164,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9061
9164
|
type: Output
|
|
9062
9165
|
}], valid: [{
|
|
9063
9166
|
type: Input
|
|
9167
|
+
}], virtualScroller: [{
|
|
9168
|
+
type: Input
|
|
9169
|
+
}], visibleItems: [{
|
|
9170
|
+
type: Input
|
|
9064
9171
|
}], visible: [{
|
|
9065
9172
|
type: Input
|
|
9066
9173
|
}], visibleChange: [{
|
|
@@ -9086,6 +9193,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9086
9193
|
}], hostClasses: [{
|
|
9087
9194
|
type: HostBinding,
|
|
9088
9195
|
args: ['class']
|
|
9196
|
+
}], ariaMultiSelectable: [{
|
|
9197
|
+
type: HostBinding,
|
|
9198
|
+
args: ['attr.aria-multiselectable']
|
|
9089
9199
|
}], tabIndex: [{
|
|
9090
9200
|
type: HostBinding,
|
|
9091
9201
|
args: ['attr.tabindex']
|
|
@@ -12647,7 +12757,7 @@ class FilterInputDirective {
|
|
|
12647
12757
|
setSubscription(subscribe = !__classPrivateFieldGet(this, _FilterInputDirective_valueSubscription, "f")) {
|
|
12648
12758
|
if (subscribe) {
|
|
12649
12759
|
__classPrivateFieldSet(this, _FilterInputDirective_valueSubscription, this.value$
|
|
12650
|
-
.pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12760
|
+
.pipe(distinctUntilChanged(), takeUntil$1(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12651
12761
|
.subscribe(value => {
|
|
12652
12762
|
if (__classPrivateFieldGet(this, _FilterInputDirective_value, "f") !== value) {
|
|
12653
12763
|
__classPrivateFieldSet(this, _FilterInputDirective_value, value, "f");
|
|
@@ -12659,7 +12769,7 @@ class FilterInputDirective {
|
|
|
12659
12769
|
__classPrivateFieldSet(this, _FilterInputDirective_inputSubscription, fromEvent(this.elementRef.nativeElement, this.onEvent)
|
|
12660
12770
|
.pipe(map(event => {
|
|
12661
12771
|
return event.target.value;
|
|
12662
|
-
}), debounceTime(dueTime), takeUntil(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12772
|
+
}), debounceTime(dueTime), takeUntil$1(__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f")))
|
|
12663
12773
|
.subscribe((value) => {
|
|
12664
12774
|
if (value !== __classPrivateFieldGet(this, _FilterInputDirective_value, "f")) {
|
|
12665
12775
|
this.value$.next(value);
|
|
@@ -12668,6 +12778,7 @@ class FilterInputDirective {
|
|
|
12668
12778
|
}
|
|
12669
12779
|
else {
|
|
12670
12780
|
__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f").next(true);
|
|
12781
|
+
__classPrivateFieldGet(this, _FilterInputDirective_destroy$, "f").complete();
|
|
12671
12782
|
}
|
|
12672
12783
|
}
|
|
12673
12784
|
}
|