@elderbyte/ngx-starter 13.7.7 → 13.8.1
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/data/data-context/data-context-builder.mjs +4 -3
- package/esm2020/lib/common/templates/template-slot-manager.mjs +34 -6
- package/esm2020/lib/common/utils/filter-util.mjs +11 -2
- package/esm2020/lib/components/navigation/toolbar/elder-toolbar.service.mjs +5 -3
- package/esm2020/lib/components/navigation/toolbar/toolbar/elder-toolbar.component.mjs +17 -13
- package/esm2020/lib/components/navigation/toolbar/toolbar-column-position.mjs +1 -1
- package/esm2020/lib/components/select/elder-select/elder-select.component.mjs +2 -17
- package/esm2020/lib/components/select/elder-select-base.mjs +2 -1
- package/esm2020/lib/components/select/multi/elder-multi-select-base.mjs +13 -4
- package/esm2020/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.mjs +3 -3
- package/esm2020/lib/components/shell/shell/elder-shell.component.mjs +1 -1
- package/fesm2015/elderbyte-ngx-starter.mjs +122 -83
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +121 -83
- package/fesm2020/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/common/templates/template-slot-manager.d.ts +13 -1
- package/lib/components/navigation/toolbar/toolbar/elder-toolbar.component.d.ts +13 -10
- package/lib/components/navigation/toolbar/toolbar-column-position.d.ts +9 -1
- package/lib/components/select/elder-select/elder-select.component.d.ts +0 -11
- package/lib/components/select/multi/elder-multi-select-base.d.ts +6 -0
- package/lib/components/shell/shell/elder-shell.component.d.ts +3 -2
- package/package.json +1 -1
|
@@ -4406,6 +4406,57 @@ class DelegateContinuableDataSource extends DelegateDataSource {
|
|
|
4406
4406
|
}
|
|
4407
4407
|
}
|
|
4408
4408
|
|
|
4409
|
+
class FilterUtil {
|
|
4410
|
+
static filterData(data, filters) {
|
|
4411
|
+
FilterUtil.logger.debug('Filtering data with ' + data.length + ' items.', filters);
|
|
4412
|
+
if (filters && filters.length > 0) {
|
|
4413
|
+
for (const filter of filters) {
|
|
4414
|
+
data = data.filter(e => FilterUtil.matches(e, filter));
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4417
|
+
return data;
|
|
4418
|
+
}
|
|
4419
|
+
static matches(entity, filter) {
|
|
4420
|
+
if (filter.value === null || filter.value === undefined) {
|
|
4421
|
+
return true;
|
|
4422
|
+
}
|
|
4423
|
+
let value;
|
|
4424
|
+
if (entity === null || entity === undefined) {
|
|
4425
|
+
value = null;
|
|
4426
|
+
}
|
|
4427
|
+
else if (typeof entity === 'object') {
|
|
4428
|
+
value = entity[filter.key];
|
|
4429
|
+
}
|
|
4430
|
+
else {
|
|
4431
|
+
value = String(entity); // Support filtering primitive values
|
|
4432
|
+
}
|
|
4433
|
+
if (Array.isArray(filter.value)) {
|
|
4434
|
+
for (const val of filter.value) {
|
|
4435
|
+
if (FilterUtil.matchesValue(value, val)) {
|
|
4436
|
+
return true;
|
|
4437
|
+
}
|
|
4438
|
+
}
|
|
4439
|
+
return false;
|
|
4440
|
+
}
|
|
4441
|
+
else {
|
|
4442
|
+
return FilterUtil.matchesValue(value, filter.value);
|
|
4443
|
+
}
|
|
4444
|
+
}
|
|
4445
|
+
static matchesValue(haystack, needle) {
|
|
4446
|
+
if (haystack === needle) {
|
|
4447
|
+
return true;
|
|
4448
|
+
}
|
|
4449
|
+
if (haystack === null || haystack === undefined) {
|
|
4450
|
+
return false;
|
|
4451
|
+
}
|
|
4452
|
+
const str = String(haystack);
|
|
4453
|
+
const match = str.toLowerCase().startsWith(needle.toLowerCase());
|
|
4454
|
+
// FilterUtil.logger.debug('Haystack: ' + str + ' starts with needle: ' + needle + ' --> ' + match);
|
|
4455
|
+
return match;
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4458
|
+
FilterUtil.logger = LoggerFactory.getLogger(FilterUtil.constructor.name);
|
|
4459
|
+
|
|
4409
4460
|
/**
|
|
4410
4461
|
* Provides the ability to build a IDataContext<T>.
|
|
4411
4462
|
*/
|
|
@@ -4531,12 +4582,12 @@ class DataContextBuilder {
|
|
|
4531
4582
|
* *
|
|
4532
4583
|
**************************************************************************/
|
|
4533
4584
|
buildLocal(items, idProperty) {
|
|
4534
|
-
return this.build(LocalListDataSource.from(items, idProperty));
|
|
4585
|
+
return this.build(LocalListDataSource.from(items, idProperty, this._localSort, FilterUtil.filterData));
|
|
4535
4586
|
}
|
|
4536
4587
|
buildLocalActivePaged(data, idProperty) {
|
|
4537
4588
|
this._skipLocalSort = true;
|
|
4538
4589
|
this.activePaged();
|
|
4539
|
-
return this.build(LocalPagedDataSource.from(data, idProperty, this._localSort));
|
|
4590
|
+
return this.build(LocalPagedDataSource.from(data, idProperty, this._localSort, FilterUtil.filterData));
|
|
4540
4591
|
}
|
|
4541
4592
|
/***************************************************************************
|
|
4542
4593
|
* *
|
|
@@ -6096,48 +6147,6 @@ class PropertyPathUtil {
|
|
|
6096
6147
|
}
|
|
6097
6148
|
}
|
|
6098
6149
|
|
|
6099
|
-
class FilterUtil {
|
|
6100
|
-
static filterData(data, filters) {
|
|
6101
|
-
FilterUtil.logger.debug('Filtering data with ' + data.length + ' items.', filters);
|
|
6102
|
-
if (filters && filters.length > 0) {
|
|
6103
|
-
for (const filter of filters) {
|
|
6104
|
-
data = data.filter(e => FilterUtil.matches(e, filter));
|
|
6105
|
-
}
|
|
6106
|
-
}
|
|
6107
|
-
return data;
|
|
6108
|
-
}
|
|
6109
|
-
static matches(entity, filter) {
|
|
6110
|
-
if (filter.value === null || filter.value === undefined) {
|
|
6111
|
-
return true;
|
|
6112
|
-
}
|
|
6113
|
-
const value = entity[filter.key];
|
|
6114
|
-
if (Array.isArray(filter.value)) {
|
|
6115
|
-
for (const val of filter.value) {
|
|
6116
|
-
if (FilterUtil.matchesValue(value, val)) {
|
|
6117
|
-
return true;
|
|
6118
|
-
}
|
|
6119
|
-
}
|
|
6120
|
-
return false;
|
|
6121
|
-
}
|
|
6122
|
-
else {
|
|
6123
|
-
return FilterUtil.matchesValue(value, filter.value);
|
|
6124
|
-
}
|
|
6125
|
-
}
|
|
6126
|
-
static matchesValue(haystack, needle) {
|
|
6127
|
-
if (haystack === needle) {
|
|
6128
|
-
return true;
|
|
6129
|
-
}
|
|
6130
|
-
if (haystack === null || haystack === undefined) {
|
|
6131
|
-
return false;
|
|
6132
|
-
}
|
|
6133
|
-
const str = String(haystack);
|
|
6134
|
-
const match = str.toLowerCase().startsWith(needle.toLowerCase());
|
|
6135
|
-
// FilterUtil.logger.debug('Haystack: ' + str + ' starts with needle: ' + needle + ' --> ' + match);
|
|
6136
|
-
return match;
|
|
6137
|
-
}
|
|
6138
|
-
}
|
|
6139
|
-
FilterUtil.logger = LoggerFactory.getLogger(FilterUtil.constructor.name);
|
|
6140
|
-
|
|
6141
6150
|
class NextNumberUtil {
|
|
6142
6151
|
/***************************************************************************
|
|
6143
6152
|
* *
|
|
@@ -14631,7 +14640,11 @@ class TemplateSlotManager {
|
|
|
14631
14640
|
* Constructors *
|
|
14632
14641
|
* *
|
|
14633
14642
|
**************************************************************************/
|
|
14634
|
-
|
|
14643
|
+
/**
|
|
14644
|
+
* Create a new Template Slot Manager.
|
|
14645
|
+
* @param slotDefinitions Slot definitions, supporting synonyms
|
|
14646
|
+
*/
|
|
14647
|
+
constructor(slotDefinitions) {
|
|
14635
14648
|
/***************************************************************************
|
|
14636
14649
|
* *
|
|
14637
14650
|
* Fields *
|
|
@@ -14641,10 +14654,15 @@ class TemplateSlotManager {
|
|
|
14641
14654
|
/** Default templates (App Level) */
|
|
14642
14655
|
this._defaultSlotTemplates = new Map();
|
|
14643
14656
|
/** Custom templates (Component Level) */
|
|
14644
|
-
this._slotTemplates = new Map();
|
|
14657
|
+
this._slotTemplates = new Map();
|
|
14645
14658
|
this._activeSlotTemplates = new Map();
|
|
14646
|
-
|
|
14647
|
-
|
|
14659
|
+
/**
|
|
14660
|
+
* Key: A synonym slot name
|
|
14661
|
+
* Value: The primary slot the synonym is resolving to
|
|
14662
|
+
*/
|
|
14663
|
+
this._slotSynonyms = new Map();
|
|
14664
|
+
for (const slotDefinition of slotDefinitions) {
|
|
14665
|
+
this.initSlot(slotDefinition);
|
|
14648
14666
|
}
|
|
14649
14667
|
}
|
|
14650
14668
|
/***************************************************************************
|
|
@@ -14657,6 +14675,7 @@ class TemplateSlotManager {
|
|
|
14657
14675
|
* over time.
|
|
14658
14676
|
*/
|
|
14659
14677
|
activeSlotTemplate(slot) {
|
|
14678
|
+
slot = this.resolveSlot(slot);
|
|
14660
14679
|
const activeColumn = this._activeSlotTemplates.get(slot);
|
|
14661
14680
|
if (activeColumn) {
|
|
14662
14681
|
return activeColumn.asObservable();
|
|
@@ -14673,7 +14692,7 @@ class TemplateSlotManager {
|
|
|
14673
14692
|
* @param isDefault if the given template should be used as global default
|
|
14674
14693
|
*/
|
|
14675
14694
|
registerSlotTemplate(slot, template, isDefault = false) {
|
|
14676
|
-
|
|
14695
|
+
slot = this.resolveSlot(slot);
|
|
14677
14696
|
if (isDefault) {
|
|
14678
14697
|
this._defaultSlotTemplates.set(slot, template);
|
|
14679
14698
|
}
|
|
@@ -14690,6 +14709,7 @@ class TemplateSlotManager {
|
|
|
14690
14709
|
*/
|
|
14691
14710
|
deregisterSlotTemplate(template, slot) {
|
|
14692
14711
|
if (slot) {
|
|
14712
|
+
slot = this.resolveSlot(slot);
|
|
14693
14713
|
if (this._slotTemplates.get(slot) === template) {
|
|
14694
14714
|
this.removeSlotTemplate(slot);
|
|
14695
14715
|
}
|
|
@@ -14707,6 +14727,23 @@ class TemplateSlotManager {
|
|
|
14707
14727
|
* Private methods *
|
|
14708
14728
|
* *
|
|
14709
14729
|
**************************************************************************/
|
|
14730
|
+
initSlot(slotDefinition) {
|
|
14731
|
+
let slot;
|
|
14732
|
+
if (slotDefinition instanceof Array) {
|
|
14733
|
+
slot = slotDefinition.shift();
|
|
14734
|
+
this.registerSlotSynonyms(slot, slotDefinition);
|
|
14735
|
+
}
|
|
14736
|
+
else {
|
|
14737
|
+
slot = slotDefinition;
|
|
14738
|
+
}
|
|
14739
|
+
this._activeSlotTemplates.set(slot, new BehaviorSubject(null));
|
|
14740
|
+
}
|
|
14741
|
+
registerSlotSynonyms(primarySlot, synonyms) {
|
|
14742
|
+
synonyms.forEach(synonym => this._slotSynonyms.set(synonym, primarySlot));
|
|
14743
|
+
}
|
|
14744
|
+
resolveSlot(slot) {
|
|
14745
|
+
return this._slotSynonyms.get(slot) ?? slot;
|
|
14746
|
+
}
|
|
14710
14747
|
removeSlotTemplate(slot) {
|
|
14711
14748
|
this.logger.trace('Deregistering template slot at ', slot);
|
|
14712
14749
|
this._slotTemplates.delete(slot);
|
|
@@ -14741,10 +14778,12 @@ class ElderToolbarService {
|
|
|
14741
14778
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
14742
14779
|
this.slotManager = new TemplateSlotManager([
|
|
14743
14780
|
'left',
|
|
14781
|
+
'left.begin',
|
|
14782
|
+
['left.end', 'left.actions'],
|
|
14744
14783
|
'center',
|
|
14745
14784
|
'right',
|
|
14746
|
-
'
|
|
14747
|
-
'right.
|
|
14785
|
+
['right.begin', 'right.actions'],
|
|
14786
|
+
'right.end',
|
|
14748
14787
|
]);
|
|
14749
14788
|
}
|
|
14750
14789
|
/***************************************************************************
|
|
@@ -15067,10 +15106,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImpor
|
|
|
15067
15106
|
|
|
15068
15107
|
class ElderToolbarComponent {
|
|
15069
15108
|
/***************************************************************************
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
15109
|
+
* *
|
|
15110
|
+
* Constructor *
|
|
15111
|
+
* *
|
|
15112
|
+
**************************************************************************/
|
|
15074
15113
|
constructor(toolbarService) {
|
|
15075
15114
|
this.toolbarService = toolbarService;
|
|
15076
15115
|
/***************************************************************************
|
|
@@ -15079,24 +15118,28 @@ class ElderToolbarComponent {
|
|
|
15079
15118
|
* *
|
|
15080
15119
|
**************************************************************************/
|
|
15081
15120
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
15082
|
-
this.leftColumnTemplate$ = toolbarService.activeColumnTemplate('left');
|
|
15083
|
-
this.centerColumnTemplate$ = toolbarService.activeColumnTemplate('center');
|
|
15084
|
-
this.rightColumnTemplate$ = toolbarService.activeColumnTemplate('right');
|
|
15085
|
-
this.leftActionsColumnTemplate$ = toolbarService.activeColumnTemplate('left.actions');
|
|
15086
|
-
this.rightActionsColumnTemplate$ = toolbarService.activeColumnTemplate('right.actions');
|
|
15087
15121
|
}
|
|
15088
15122
|
/***************************************************************************
|
|
15089
15123
|
* *
|
|
15090
15124
|
* Life Cycle *
|
|
15091
15125
|
* *
|
|
15092
15126
|
**************************************************************************/
|
|
15093
|
-
ngOnInit() {
|
|
15127
|
+
ngOnInit() {
|
|
15128
|
+
}
|
|
15129
|
+
/***************************************************************************
|
|
15130
|
+
* *
|
|
15131
|
+
* Public API *
|
|
15132
|
+
* *
|
|
15133
|
+
**************************************************************************/
|
|
15134
|
+
slotTemplate$(slot) {
|
|
15135
|
+
return this.toolbarService.activeColumnTemplate(slot);
|
|
15136
|
+
}
|
|
15094
15137
|
}
|
|
15095
15138
|
ElderToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ElderToolbarComponent, deps: [{ token: ElderToolbarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
15096
|
-
ElderToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: ElderToolbarComponent, selector: "elder-toolbar, ebs-toolbar", inputs: { color: "color" }, ngImport: i0, template: "\n\n<div fxLayout=\"row\">\n\n <ng-content></ng-content>\n\n <mat-toolbar fxLayout=\"row\" fxLayoutAlign=\"start center\"\n [color]=\"color ? color : 'primary'\">\n\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container *ngTemplateOutlet=\"(
|
|
15139
|
+
ElderToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: ElderToolbarComponent, selector: "elder-toolbar, ebs-toolbar", inputs: { color: "color" }, ngImport: i0, template: "\n\n<div fxLayout=\"row\">\n\n <ng-content></ng-content>\n\n <mat-toolbar fxLayout=\"row\" fxLayoutAlign=\"start center\"\n [color]=\"color ? color : 'primary'\">\n\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('left.begin') | async)\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('left') | async) || defaultLeftColumnTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('left.end') | async) || defaultEmptyTemplate\"></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('center') | async) || defaultCenterColumnTemplate\"></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('right.begin') | async) || defaultEmptyTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('right') | async) || defaultRightColumnTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('right.end') | async)\"></ng-container>\n </div>\n\n\n <!-- Default Templates -->\n\n <ng-template #defaultLeftColumnTemplate>\n\n <elder-toolbar-title></elder-toolbar-title>\n\n </ng-template>\n\n\n <ng-template #defaultCenterColumnTemplate></ng-template>\n\n <ng-template #defaultEmptyTemplate></ng-template>\n\n\n <ng-template #defaultRightColumnTemplate>\n\n <elder-language-switcher [slimMode]=\"true\"></elder-language-switcher>\n\n </ng-template>\n\n </mat-toolbar>\n\n</div>\n\n", styles: [""], components: [{ type: i2$3.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { type: ElderToolbarTitleComponent, selector: "elder-toolbar-title, ebs-toolbar-title" }, { type: ElderLanguageSwitcherComponent, selector: "elder-language-switcher, ebs-language-switcher", inputs: ["slimMode"] }], directives: [{ type: i5.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i5.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { 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"] }], pipes: { "async": i3$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
15097
15140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ElderToolbarComponent, decorators: [{
|
|
15098
15141
|
type: Component,
|
|
15099
|
-
args: [{ selector: 'elder-toolbar, ebs-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n\n<div fxLayout=\"row\">\n\n <ng-content></ng-content>\n\n <mat-toolbar fxLayout=\"row\" fxLayoutAlign=\"start center\"\n [color]=\"color ? color : 'primary'\">\n\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container *ngTemplateOutlet=\"(
|
|
15142
|
+
args: [{ selector: 'elder-toolbar, ebs-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n\n<div fxLayout=\"row\">\n\n <ng-content></ng-content>\n\n <mat-toolbar fxLayout=\"row\" fxLayoutAlign=\"start center\"\n [color]=\"color ? color : 'primary'\">\n\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('left.begin') | async)\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('left') | async) || defaultLeftColumnTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('left.end') | async) || defaultEmptyTemplate\"></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('center') | async) || defaultCenterColumnTemplate\"></ng-container>\n </div>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('right.begin') | async) || defaultEmptyTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('right') | async) || defaultRightColumnTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"(slotTemplate$('right.end') | async)\"></ng-container>\n </div>\n\n\n <!-- Default Templates -->\n\n <ng-template #defaultLeftColumnTemplate>\n\n <elder-toolbar-title></elder-toolbar-title>\n\n </ng-template>\n\n\n <ng-template #defaultCenterColumnTemplate></ng-template>\n\n <ng-template #defaultEmptyTemplate></ng-template>\n\n\n <ng-template #defaultRightColumnTemplate>\n\n <elder-language-switcher [slimMode]=\"true\"></elder-language-switcher>\n\n </ng-template>\n\n </mat-toolbar>\n\n</div>\n\n", styles: [""] }]
|
|
15100
15143
|
}], ctorParameters: function () { return [{ type: ElderToolbarService }]; }, propDecorators: { color: [{
|
|
15101
15144
|
type: Input
|
|
15102
15145
|
}] } });
|
|
@@ -20314,6 +20357,7 @@ class ElderSelectBase extends FormFieldBaseComponent {
|
|
|
20314
20357
|
this.autoCleanUp();
|
|
20315
20358
|
if (data instanceof Array) {
|
|
20316
20359
|
this.suggestionsDc = DataContextBuilder.start()
|
|
20360
|
+
.localSort()
|
|
20317
20361
|
.buildLocal(data); // Memory leak
|
|
20318
20362
|
this.suggestionsDc.start();
|
|
20319
20363
|
}
|
|
@@ -21077,6 +21121,7 @@ class ElderSelectComponent extends ElderSelectBase {
|
|
|
21077
21121
|
ElderSelectFirstUtil.trySelectFirst(this);
|
|
21078
21122
|
}
|
|
21079
21123
|
updateValueByEntity(entity) {
|
|
21124
|
+
this._entity$.next(entity);
|
|
21080
21125
|
this.updateValue(this.entityToValue(entity));
|
|
21081
21126
|
}
|
|
21082
21127
|
/***************************************************************************
|
|
@@ -21188,22 +21233,6 @@ class ElderSelectComponent extends ElderSelectBase {
|
|
|
21188
21233
|
}
|
|
21189
21234
|
super.writeToControl(value);
|
|
21190
21235
|
}
|
|
21191
|
-
/**
|
|
21192
|
-
* @description
|
|
21193
|
-
* Writes a new value to the element.
|
|
21194
|
-
*
|
|
21195
|
-
* This method is called by the forms API to write to the view when programmatic
|
|
21196
|
-
* changes from model to view are requested.
|
|
21197
|
-
*
|
|
21198
|
-
* @param value The new value for the element
|
|
21199
|
-
*/
|
|
21200
|
-
writeValue(value) {
|
|
21201
|
-
// this.logger.debug('ElderSelectBase.writeValue(): Current value-id ' + this._valueId + ', new value: ', value);
|
|
21202
|
-
super.writeValue(value);
|
|
21203
|
-
}
|
|
21204
|
-
isNullOrEmpty(value) {
|
|
21205
|
-
return (value == null || value === '');
|
|
21206
|
-
}
|
|
21207
21236
|
}
|
|
21208
21237
|
ElderSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ElderSelectComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
21209
21238
|
ElderSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: ElderSelectComponent, selector: "elder-select", inputs: { nullDisplay: "nullDisplay", autocomplete: "autocomplete", allowNull: "allowNull", entity: "entity", entityId: "entityId", hintProperty: "hintProperty", hintPropertyResolver: "hintPropertyResolver" }, outputs: { entityIdChange: "entityIdChange", entityIdUpdated: "entityIdUpdated", entityChange: "entityChange", entityUpdated: "entityUpdated" }, providers: [
|
|
@@ -21314,13 +21343,22 @@ class ElderMultiSelectBase extends ElderSelectBase {
|
|
|
21314
21343
|
this.entities$ = new BehaviorSubject([]);
|
|
21315
21344
|
this.entityIdsChange = this.valueChange.pipe(map(values => this.entityIdsFromValues(values)));
|
|
21316
21345
|
this.entityIdsUpdated = this.valueUpdated.pipe(map(values => this.entityIdsFromValues(values)));
|
|
21317
|
-
this.entitiesUpdated = this.entityIdsUpdated.pipe(switchMap(
|
|
21346
|
+
this.entitiesUpdated = this.entityIdsUpdated.pipe(tap(entityIds => this.logger.debug('Awaiting entities with ids', entityIds)), switchMap(entityIds => this.awaitEntitiesWithId(entityIds, this.timeoutAfterMs)), catchError(err => {
|
|
21318
21347
|
this.logger.warn(`awaitEntitiesWithId -> timed out after: ${this.timeoutAfterMs}`, err);
|
|
21319
21348
|
return EMPTY;
|
|
21320
21349
|
}));
|
|
21321
21350
|
}
|
|
21322
21351
|
awaitEntitiesWithId(entityIds, timeoutMs) {
|
|
21323
|
-
return this.entities$.pipe(filter(entities => this.equalIds(this.getEntityIds(entities), entityIds)), take(1), timeout(timeoutMs));
|
|
21352
|
+
return this.entities$.pipe(tap(entities => this.logger.debug('Got entities for ids' + entityIds, entities)), filter(entities => this.equalIds(this.getEntityIds(entities), entityIds)), take(1), timeout(timeoutMs));
|
|
21353
|
+
}
|
|
21354
|
+
/***************************************************************************
|
|
21355
|
+
* *
|
|
21356
|
+
* Properties *
|
|
21357
|
+
* *
|
|
21358
|
+
**************************************************************************/
|
|
21359
|
+
updateValueByEntities(entities) {
|
|
21360
|
+
this.entities$.next(entities);
|
|
21361
|
+
this.updateValue(this.entitiesToValues(entities));
|
|
21324
21362
|
}
|
|
21325
21363
|
/***************************************************************************
|
|
21326
21364
|
* *
|
|
@@ -21612,7 +21650,7 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
|
|
|
21612
21650
|
}
|
|
21613
21651
|
addLabels(labels) {
|
|
21614
21652
|
const current = this.entities ? this.entities : [];
|
|
21615
|
-
this.
|
|
21653
|
+
this.updateValueByEntities([...current, ...labels]);
|
|
21616
21654
|
}
|
|
21617
21655
|
addLabel(label) {
|
|
21618
21656
|
this.addLabels([label]);
|
|
@@ -21620,7 +21658,7 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
|
|
|
21620
21658
|
removeLabel(toRemove) {
|
|
21621
21659
|
const remaining = this.entities
|
|
21622
21660
|
.filter(l => !this.isEqual(l, toRemove));
|
|
21623
|
-
this.
|
|
21661
|
+
this.updateValueByEntities(remaining);
|
|
21624
21662
|
}
|
|
21625
21663
|
/***************************************************************************
|
|
21626
21664
|
* *
|