@elderbyte/ngx-starter 13.6.0 → 13.7.0
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/common/utils/collection-util.mjs +4 -1
- package/esm2020/lib/components/select/elder-select/elder-select.component.mjs +2 -2
- package/esm2020/lib/components/select/multi/elder-multi-select-base.mjs +96 -38
- package/esm2020/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.mjs +13 -13
- package/fesm2015/elderbyte-ngx-starter.mjs +109 -49
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +109 -49
- package/fesm2020/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/common/utils/collection-util.d.ts +1 -0
- package/lib/components/select/multi/elder-multi-select-base.d.ts +29 -15
- package/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.d.ts +11 -11
- package/package.json +1 -1
|
@@ -2227,6 +2227,9 @@ class CollectionUtil {
|
|
|
2227
2227
|
}
|
|
2228
2228
|
return true;
|
|
2229
2229
|
}
|
|
2230
|
+
static hasElements(list) {
|
|
2231
|
+
return list !== null && list !== undefined && list.length > 0;
|
|
2232
|
+
}
|
|
2230
2233
|
}
|
|
2231
2234
|
CollectionUtil.logger = LoggerFactory.getLogger('CollectionUtil');
|
|
2232
2235
|
|
|
@@ -21009,7 +21012,7 @@ class ElderSelectComponent extends ElderSelectBase {
|
|
|
21009
21012
|
* *
|
|
21010
21013
|
**************************************************************************/
|
|
21011
21014
|
set entity(entity) {
|
|
21012
|
-
this.entity$.next(entity);
|
|
21015
|
+
this.entity$.next(entity);
|
|
21013
21016
|
this.writeValueInternal(this.entityToValue(entity));
|
|
21014
21017
|
}
|
|
21015
21018
|
get entity() {
|
|
@@ -21346,67 +21349,121 @@ class ElderMultiSelectBase extends ElderSelectBase {
|
|
|
21346
21349
|
* *
|
|
21347
21350
|
**************************************************************************/
|
|
21348
21351
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
21349
|
-
this.
|
|
21350
|
-
this.
|
|
21351
|
-
if (values) {
|
|
21352
|
-
return values.map(v => this.getEntityId(v));
|
|
21353
|
-
}
|
|
21354
|
-
else {
|
|
21355
|
-
return null;
|
|
21356
|
-
}
|
|
21357
|
-
}));
|
|
21352
|
+
this.entities$ = new BehaviorSubject([]);
|
|
21353
|
+
this.entityIdsChange = this.valueChange.pipe(map(values => this.entityIdsFromValues(values)));
|
|
21358
21354
|
}
|
|
21359
21355
|
/***************************************************************************
|
|
21360
21356
|
* *
|
|
21361
21357
|
* Properties *
|
|
21362
21358
|
* *
|
|
21363
21359
|
**************************************************************************/
|
|
21364
|
-
|
|
21365
|
-
|
|
21366
|
-
|
|
21367
|
-
*/
|
|
21368
|
-
set valueIds(ids) {
|
|
21369
|
-
if (!this.equalIds(ids, this._valueIds)) {
|
|
21370
|
-
this._valueIds = ids;
|
|
21371
|
-
this.selectValuesByIds(ids);
|
|
21372
|
-
}
|
|
21360
|
+
set entities(entities) {
|
|
21361
|
+
this.entities$.next(entities);
|
|
21362
|
+
this.writeValueInternal(this.entitiesToValues(entities));
|
|
21373
21363
|
}
|
|
21374
|
-
get
|
|
21375
|
-
|
|
21376
|
-
|
|
21364
|
+
get entities() {
|
|
21365
|
+
return this.entities$.getValue();
|
|
21366
|
+
}
|
|
21367
|
+
set entityIds(ids) {
|
|
21368
|
+
if (this.valueAsId) {
|
|
21369
|
+
this.writeValueInternal(ids);
|
|
21377
21370
|
}
|
|
21378
21371
|
else {
|
|
21379
|
-
|
|
21372
|
+
this.selectEntitiesByIds(ids);
|
|
21380
21373
|
}
|
|
21381
21374
|
}
|
|
21375
|
+
get entityIds() {
|
|
21376
|
+
return this.entityIdsFromValues(this.value);
|
|
21377
|
+
}
|
|
21378
|
+
/***************************************************************************
|
|
21379
|
+
* *
|
|
21380
|
+
* Public API *
|
|
21381
|
+
* *
|
|
21382
|
+
**************************************************************************/
|
|
21383
|
+
updateValueByEntities(entities) {
|
|
21384
|
+
this.updateValue(this.entitiesToValues(entities));
|
|
21385
|
+
}
|
|
21382
21386
|
/***************************************************************************
|
|
21383
21387
|
* *
|
|
21384
21388
|
* Internal Methods *
|
|
21385
21389
|
* *
|
|
21386
21390
|
**************************************************************************/
|
|
21387
21391
|
onSuggestionsDcChanged(data) {
|
|
21388
|
-
if (this.
|
|
21389
|
-
this.
|
|
21392
|
+
if (this.valueAsId) {
|
|
21393
|
+
this.selectEntitiesByIds(this.entityIds);
|
|
21394
|
+
}
|
|
21395
|
+
}
|
|
21396
|
+
/**
|
|
21397
|
+
* This method is invoked after a value has been written to this control.
|
|
21398
|
+
*
|
|
21399
|
+
*/
|
|
21400
|
+
writeToControl(value) {
|
|
21401
|
+
if (this.valueAsId) {
|
|
21402
|
+
const entityIds = value;
|
|
21403
|
+
// Value was written as entity ids, ensure we select entity by id
|
|
21404
|
+
this.logger.debug('writeToControl: value was written as ids: ' + entityIds, value);
|
|
21405
|
+
this.selectEntitiesByIds(entityIds);
|
|
21406
|
+
}
|
|
21407
|
+
else {
|
|
21408
|
+
// Value was written as entity, ensure entity is updated
|
|
21409
|
+
const currentEntities = this.entities;
|
|
21410
|
+
const newEntities = value;
|
|
21411
|
+
this.logger.debug('writeToControl: value was written as entities (size): ' + newEntities?.length, value);
|
|
21412
|
+
if (!this.equalEntities(currentEntities, newEntities)) {
|
|
21413
|
+
this.entities$.next(newEntities);
|
|
21414
|
+
}
|
|
21415
|
+
else {
|
|
21416
|
+
this.logger.warn('Ignored written entities as they are already set to entities$!');
|
|
21417
|
+
}
|
|
21390
21418
|
}
|
|
21419
|
+
super.writeToControl(value);
|
|
21391
21420
|
}
|
|
21392
21421
|
/***************************************************************************
|
|
21393
21422
|
* *
|
|
21394
21423
|
* Private Methods *
|
|
21395
21424
|
* *
|
|
21396
21425
|
**************************************************************************/
|
|
21397
|
-
|
|
21426
|
+
entityIdsFromValues(values) {
|
|
21427
|
+
return values?.map(v => this.entityIdFromValue(v));
|
|
21428
|
+
}
|
|
21429
|
+
entityIdFromValue(value) {
|
|
21430
|
+
if (this.valueAsId) {
|
|
21431
|
+
return value;
|
|
21432
|
+
}
|
|
21433
|
+
else {
|
|
21434
|
+
const entity = value;
|
|
21435
|
+
return this.getEntityId(entity);
|
|
21436
|
+
}
|
|
21437
|
+
}
|
|
21438
|
+
entitiesToValues(entities) {
|
|
21439
|
+
return entities?.map(e => this.entityToValue(e));
|
|
21440
|
+
}
|
|
21441
|
+
entityToValue(entity) {
|
|
21442
|
+
if (this.valueAsId) {
|
|
21443
|
+
const id = this.getEntityId(entity);
|
|
21444
|
+
return id;
|
|
21445
|
+
}
|
|
21446
|
+
else {
|
|
21447
|
+
return entity;
|
|
21448
|
+
}
|
|
21449
|
+
}
|
|
21450
|
+
getEntityIds(values) {
|
|
21398
21451
|
return values.map(v => this.getEntityId(v));
|
|
21399
21452
|
}
|
|
21400
21453
|
equalIds(idsA, idsB) {
|
|
21401
21454
|
return Sets.equalContent(idsA, idsB);
|
|
21402
21455
|
}
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21456
|
+
equalEntities(entitiesA, entitiesB) {
|
|
21457
|
+
return this.equalIds(this.getEntityIds(entitiesA), this.getEntityIds(entitiesB));
|
|
21458
|
+
}
|
|
21459
|
+
selectEntitiesByIds(ids) {
|
|
21460
|
+
const currentEntities = this.entities;
|
|
21461
|
+
if (currentEntities && this.equalIds(this.getEntityIds(currentEntities), ids)) {
|
|
21462
|
+
return; // Entities already loaded
|
|
21406
21463
|
}
|
|
21407
|
-
if (ids
|
|
21408
|
-
if (
|
|
21409
|
-
this.writeValueInternal([]);
|
|
21464
|
+
if (!CollectionUtil.hasElements(ids)) {
|
|
21465
|
+
if (CollectionUtil.hasElements(currentEntities)) {
|
|
21466
|
+
this.writeValueInternal([]);
|
|
21410
21467
|
}
|
|
21411
21468
|
}
|
|
21412
21469
|
else {
|
|
@@ -21418,8 +21475,8 @@ class ElderMultiSelectBase extends ElderSelectBase {
|
|
|
21418
21475
|
loaded.forEach((v, k) => existing.set(k, v));
|
|
21419
21476
|
return existing;
|
|
21420
21477
|
}), map(allValuesMap => Array.from(allValuesMap.values())) // TODO Sort?
|
|
21421
|
-
).subscribe(
|
|
21422
|
-
this.
|
|
21478
|
+
).subscribe(entities => {
|
|
21479
|
+
this.entities = entities;
|
|
21423
21480
|
});
|
|
21424
21481
|
}
|
|
21425
21482
|
else {
|
|
@@ -21433,6 +21490,7 @@ class ElderMultiSelectBase extends ElderSelectBase {
|
|
|
21433
21490
|
this.updateState(ElderSelectComponentState.error(err));
|
|
21434
21491
|
return of([]);
|
|
21435
21492
|
}), map(values => {
|
|
21493
|
+
this.logger.debug('Loaded entities by id:', values);
|
|
21436
21494
|
const valueMap = new Map();
|
|
21437
21495
|
values.forEach(v => valueMap.set(this.getEntityId(v), v));
|
|
21438
21496
|
return valueMap;
|
|
@@ -21451,12 +21509,14 @@ class ElderMultiSelectBase extends ElderSelectBase {
|
|
|
21451
21509
|
}
|
|
21452
21510
|
}
|
|
21453
21511
|
ElderMultiSelectBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: ElderMultiSelectBase, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
21454
|
-
ElderMultiSelectBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.1", type: ElderMultiSelectBase, inputs: {
|
|
21512
|
+
ElderMultiSelectBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.1", type: ElderMultiSelectBase, inputs: { entities: "entities", entityIds: "entityIds" }, outputs: { entityIdsChange: "entityIdsChange" }, usesInheritance: true, ngImport: i0 });
|
|
21455
21513
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: ElderMultiSelectBase, decorators: [{
|
|
21456
21514
|
type: Directive
|
|
21457
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: {
|
|
21515
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { entityIdsChange: [{
|
|
21458
21516
|
type: Output
|
|
21459
|
-
}],
|
|
21517
|
+
}], entities: [{
|
|
21518
|
+
type: Input
|
|
21519
|
+
}], entityIds: [{
|
|
21460
21520
|
type: Input
|
|
21461
21521
|
}] } });
|
|
21462
21522
|
|
|
@@ -21475,7 +21535,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
21475
21535
|
}]
|
|
21476
21536
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
|
|
21477
21537
|
|
|
21478
|
-
class
|
|
21538
|
+
class SelectChip {
|
|
21479
21539
|
constructor(value, displayText, color, removeable) {
|
|
21480
21540
|
this.value = value;
|
|
21481
21541
|
this.displayText = displayText;
|
|
@@ -21500,13 +21560,13 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
|
|
|
21500
21560
|
this.chipColorResolver$ = new BehaviorSubject((value) => undefined);
|
|
21501
21561
|
this.selectable = true;
|
|
21502
21562
|
this.allowRemove = true;
|
|
21503
|
-
this.
|
|
21504
|
-
this.
|
|
21563
|
+
this.selectChips$ = combineLatest([
|
|
21564
|
+
this.entities$,
|
|
21505
21565
|
this.displayPropertyResolver$,
|
|
21506
21566
|
this.chipColorResolver$
|
|
21507
21567
|
]).pipe(map(([values, dPR, cCR]) => {
|
|
21508
21568
|
if (values) {
|
|
21509
|
-
return values.map(v => new
|
|
21569
|
+
return values.map(v => new SelectChip(v, dPR(v), cCR(v), this.allowRemove));
|
|
21510
21570
|
}
|
|
21511
21571
|
else {
|
|
21512
21572
|
return [];
|
|
@@ -21575,19 +21635,19 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
|
|
|
21575
21635
|
}
|
|
21576
21636
|
}
|
|
21577
21637
|
addLabels(labels) {
|
|
21578
|
-
const current = this.
|
|
21638
|
+
const current = this.entities ? this.entities : [];
|
|
21579
21639
|
this.replaceWith([...current, ...labels]);
|
|
21580
21640
|
}
|
|
21581
21641
|
addLabel(label) {
|
|
21582
21642
|
this.addLabels([label]);
|
|
21583
21643
|
}
|
|
21584
21644
|
removeLabel(toRemove) {
|
|
21585
|
-
const remaining = this.
|
|
21645
|
+
const remaining = this.entities
|
|
21586
21646
|
.filter(l => !this.isEqual(l, toRemove));
|
|
21587
21647
|
this.replaceWith(remaining);
|
|
21588
21648
|
}
|
|
21589
|
-
replaceWith(
|
|
21590
|
-
this.
|
|
21649
|
+
replaceWith(entities) {
|
|
21650
|
+
this.updateValueByEntities(entities);
|
|
21591
21651
|
}
|
|
21592
21652
|
/***************************************************************************
|
|
21593
21653
|
* *
|
|
@@ -21595,8 +21655,8 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
|
|
|
21595
21655
|
* *
|
|
21596
21656
|
**************************************************************************/
|
|
21597
21657
|
isAlreadyPresent(queryValue) {
|
|
21598
|
-
if (this.
|
|
21599
|
-
return this.
|
|
21658
|
+
if (this.entities) {
|
|
21659
|
+
return this.entities.some(v => this.isEqual(v, queryValue));
|
|
21600
21660
|
}
|
|
21601
21661
|
else {
|
|
21602
21662
|
return false;
|
|
@@ -21612,10 +21672,10 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
|
|
|
21612
21672
|
}
|
|
21613
21673
|
}
|
|
21614
21674
|
ElderMultiSelectChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: ElderMultiSelectChipsComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
21615
|
-
ElderMultiSelectChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: ElderMultiSelectChipsComponent, selector: "elder-multi-select-chips", inputs: { allowRemove: "allowRemove", chipTemplate: "chipTemplate", chipColorResolver: "chipColorResolver" }, providers: buildFormIntegrationProviders(ElderMultiSelectChipsComponent), queries: [{ propertyName: "chipTemplateQuery", first: true, predicate: ElderSelectChipDirective, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "inputControl", first: true, predicate: ["chipInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field *ngIf=\"(
|
|
21675
|
+
ElderMultiSelectChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: ElderMultiSelectChipsComponent, selector: "elder-multi-select-chips", inputs: { allowRemove: "allowRemove", chipTemplate: "chipTemplate", chipColorResolver: "chipColorResolver" }, providers: buildFormIntegrationProviders(ElderMultiSelectChipsComponent), queries: [{ propertyName: "chipTemplateQuery", first: true, predicate: ElderSelectChipDirective, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "inputControl", first: true, predicate: ["chipInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field *ngIf=\"(selectChips$ | async) as chipValues\" fxFlex\n class=\"elder-std-form-field\"\n [appearance]=\"appearance\"\n [floatLabel]=\"floatLabel\"\n [color]=\"color\"\n>\n\n <mat-label *ngIf=\"label\">{{label | translate}}</mat-label>\n\n\n <ng-container matPrefix *ngIf=\"(mergedState$ | async) as state\">\n\n <mat-icon *ngIf=\"icon\" disabled\n class=\"leading-icon prefix-padding noselect\"\n [class.loading]=\"state.loading\"\n [color]=\"state?.error ? 'warn' : color\">\n {{icon}}\n </mat-icon>\n\n\n <mat-icon *ngIf=\"!icon && state?.error\"\n class=\"leading-icon prefix-padding noselect\"\n color=\"warn\">\n warning\n </mat-icon>\n </ng-container>\n\n <!-- A dynamic input -->\n\n <mat-chip-list selectable #chips>\n <mat-chip *ngFor=\"let chipModel of chipValues\"\n class=\"noselect\"\n [color]=\"chipModel.color\" selectable selected\n [removable]=\"chipModel.removeable\"\n (removed)=\"removeLabel(chipModel.value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"chipTemplate || simpleChipTemplate; context: {$implicit: chipModel}\">\n </ng-container>\n <mat-icon matChipRemove *ngIf=\"chipModel.removeable\">cancel</mat-icon>\n </mat-chip>\n\n <input matInput type=\"text\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [name]=\"name + '-multi-chips-inner-input'\"\n [placeholder]=\"placeholder | translate\"\n [matChipInputFor]=\"chips\"\n [matAutocomplete]\n [elderElderAutocomplete]=\"elderAuto\" [queryFilter]=\"queryFilter\" [filters]=\"filters\" [sorts]=\"sorts\"\n autocomplete=\"off\"\n #chipInput>\n </mat-chip-list>\n\n <elder-autocomplete\n #elderAuto=\"elderAutocomplete\"\n [suggestionsDc]=\"suggestionsDc$ | async\"\n [valueTemplate]=\"valueTemplate\"\n [displayPropertyResolver]=\"displayPropertyResolver$ | async\"\n [isOptionDisabledFn]=\"isOptionDisabledInternalFn\"\n [isOptionHiddenFn]=\"isOptionHiddenInternalFn\"\n (optionSelected)=\"onOptionSelected($any($event))\"\n ></elder-autocomplete>\n\n <mat-hint *ngIf=\"hint\">{{hint | translate}}</mat-hint>\n\n</mat-form-field>\n\n\n<ng-template #simpleChipTemplate let-chipModel>\n {{chipModel.displayText}}\n</ng-template>\n\n", styles: [".prefix-padding{padding-right:4px}.leading-icon{font-size:16px;width:16px;height:16px}\n"], components: [{ type: i1$5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2$1.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: ElderAutocompleteComponent, selector: "elder-autocomplete", inputs: ["isOptionDisabledFn", "isOptionHiddenFn", "enabled", "valueTemplate", "suggestionsDc", "displayPropertyResolver"], outputs: ["optionSelected"], exportAs: ["elderAutocomplete"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i1$5.MatLabel, selector: "mat-label" }, { type: i1$5.MatPrefix, selector: "[matPrefix]" }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$1.MatChipRemove, selector: "[matChipRemove]" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i2$1.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i1$6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: ElderAutocompleteDirective, selector: "[elderElderAutocomplete]", inputs: ["queryFilter", "filters", "sorts", "elderElderAutocomplete"] }, { type: i1$5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }], pipes: { "async": i3$1.AsyncPipe, "translate": i1$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
21616
21676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: ElderMultiSelectChipsComponent, decorators: [{
|
|
21617
21677
|
type: Component,
|
|
21618
|
-
args: [{ selector: 'elder-multi-select-chips', changeDetection: ChangeDetectionStrategy.OnPush, providers: buildFormIntegrationProviders(ElderMultiSelectChipsComponent), template: "<mat-form-field *ngIf=\"(
|
|
21678
|
+
args: [{ selector: 'elder-multi-select-chips', changeDetection: ChangeDetectionStrategy.OnPush, providers: buildFormIntegrationProviders(ElderMultiSelectChipsComponent), template: "<mat-form-field *ngIf=\"(selectChips$ | async) as chipValues\" fxFlex\n class=\"elder-std-form-field\"\n [appearance]=\"appearance\"\n [floatLabel]=\"floatLabel\"\n [color]=\"color\"\n>\n\n <mat-label *ngIf=\"label\">{{label | translate}}</mat-label>\n\n\n <ng-container matPrefix *ngIf=\"(mergedState$ | async) as state\">\n\n <mat-icon *ngIf=\"icon\" disabled\n class=\"leading-icon prefix-padding noselect\"\n [class.loading]=\"state.loading\"\n [color]=\"state?.error ? 'warn' : color\">\n {{icon}}\n </mat-icon>\n\n\n <mat-icon *ngIf=\"!icon && state?.error\"\n class=\"leading-icon prefix-padding noselect\"\n color=\"warn\">\n warning\n </mat-icon>\n </ng-container>\n\n <!-- A dynamic input -->\n\n <mat-chip-list selectable #chips>\n <mat-chip *ngFor=\"let chipModel of chipValues\"\n class=\"noselect\"\n [color]=\"chipModel.color\" selectable selected\n [removable]=\"chipModel.removeable\"\n (removed)=\"removeLabel(chipModel.value)\"\n >\n <ng-container\n *ngTemplateOutlet=\"chipTemplate || simpleChipTemplate; context: {$implicit: chipModel}\">\n </ng-container>\n <mat-icon matChipRemove *ngIf=\"chipModel.removeable\">cancel</mat-icon>\n </mat-chip>\n\n <input matInput type=\"text\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [name]=\"name + '-multi-chips-inner-input'\"\n [placeholder]=\"placeholder | translate\"\n [matChipInputFor]=\"chips\"\n [matAutocomplete]\n [elderElderAutocomplete]=\"elderAuto\" [queryFilter]=\"queryFilter\" [filters]=\"filters\" [sorts]=\"sorts\"\n autocomplete=\"off\"\n #chipInput>\n </mat-chip-list>\n\n <elder-autocomplete\n #elderAuto=\"elderAutocomplete\"\n [suggestionsDc]=\"suggestionsDc$ | async\"\n [valueTemplate]=\"valueTemplate\"\n [displayPropertyResolver]=\"displayPropertyResolver$ | async\"\n [isOptionDisabledFn]=\"isOptionDisabledInternalFn\"\n [isOptionHiddenFn]=\"isOptionHiddenInternalFn\"\n (optionSelected)=\"onOptionSelected($any($event))\"\n ></elder-autocomplete>\n\n <mat-hint *ngIf=\"hint\">{{hint | translate}}</mat-hint>\n\n</mat-form-field>\n\n\n<ng-template #simpleChipTemplate let-chipModel>\n {{chipModel.displayText}}\n</ng-template>\n\n", styles: [".prefix-padding{padding-right:4px}.leading-icon{font-size:16px;width:16px;height:16px}\n"] }]
|
|
21619
21679
|
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { allowRemove: [{
|
|
21620
21680
|
type: Input
|
|
21621
21681
|
}], inputControl: [{
|