@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NgZone } from '@angular/core';
|
|
2
2
|
import { ElderSelectBase } from '../elder-select-base';
|
|
3
3
|
import { IDataContext } from '../../../common/data/data-context/data-context';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
4
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Base component implementation of elder-multi-select.
|
|
@@ -12,15 +12,15 @@ import * as i0 from "@angular/core";
|
|
|
12
12
|
* - The backing Value is a list of the current selected entities. T[]
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
|
-
export declare abstract class ElderMultiSelectBase<TId,
|
|
15
|
+
export declare abstract class ElderMultiSelectBase<TId, TEntity, TValue> extends ElderSelectBase<TId, TEntity, TValue[]> {
|
|
16
16
|
/***************************************************************************
|
|
17
17
|
* *
|
|
18
18
|
* Fields *
|
|
19
19
|
* *
|
|
20
20
|
**************************************************************************/
|
|
21
21
|
private readonly logger;
|
|
22
|
-
|
|
23
|
-
readonly
|
|
22
|
+
protected readonly entities$: BehaviorSubject<TEntity[]>;
|
|
23
|
+
readonly entityIdsChange: Observable<TId[]>;
|
|
24
24
|
/***************************************************************************
|
|
25
25
|
* *
|
|
26
26
|
* Constructor *
|
|
@@ -32,28 +32,42 @@ export declare abstract class ElderMultiSelectBase<TId, T> extends ElderSelectBa
|
|
|
32
32
|
* Properties *
|
|
33
33
|
* *
|
|
34
34
|
**************************************************************************/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
set entities(entities: TEntity[]);
|
|
36
|
+
get entities(): TEntity[];
|
|
37
|
+
set entityIds(ids: TId[]);
|
|
38
|
+
get entityIds(): TId[];
|
|
39
|
+
/***************************************************************************
|
|
40
|
+
* *
|
|
41
|
+
* Public API *
|
|
42
|
+
* *
|
|
43
|
+
**************************************************************************/
|
|
44
|
+
updateValueByEntities(entities: TEntity[]): void;
|
|
41
45
|
/***************************************************************************
|
|
42
46
|
* *
|
|
43
47
|
* Internal Methods *
|
|
44
48
|
* *
|
|
45
49
|
**************************************************************************/
|
|
46
|
-
protected onSuggestionsDcChanged(data: IDataContext<
|
|
50
|
+
protected onSuggestionsDcChanged(data: IDataContext<TEntity>): void;
|
|
51
|
+
/**
|
|
52
|
+
* This method is invoked after a value has been written to this control.
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
protected writeToControl(value: TValue[]): void;
|
|
47
56
|
/***************************************************************************
|
|
48
57
|
* *
|
|
49
58
|
* Private Methods *
|
|
50
59
|
* *
|
|
51
60
|
**************************************************************************/
|
|
52
|
-
private
|
|
61
|
+
private entityIdsFromValues;
|
|
62
|
+
private entityIdFromValue;
|
|
63
|
+
private entitiesToValues;
|
|
64
|
+
private entityToValue;
|
|
65
|
+
private getEntityIds;
|
|
53
66
|
private equalIds;
|
|
54
|
-
private
|
|
67
|
+
private equalEntities;
|
|
68
|
+
private selectEntitiesByIds;
|
|
55
69
|
private loadEntityByIds;
|
|
56
70
|
private findInDataContext;
|
|
57
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ElderMultiSelectBase<any, any>, never>;
|
|
58
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderMultiSelectBase<any, any>, never, never, { "
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderMultiSelectBase<any, any, any>, never>;
|
|
72
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderMultiSelectBase<any, any, any>, never, never, { "entities": "entities"; "entityIds": "entityIds"; }, { "entityIdsChange": "entityIdsChange"; }, never>;
|
|
59
73
|
}
|
package/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.d.ts
CHANGED
|
@@ -3,21 +3,21 @@ import { ElderMultiSelectBase } from '../elder-multi-select-base';
|
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ThemePalette } from '@angular/material/core/common-behaviors/color';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
declare class
|
|
6
|
+
declare class SelectChip<T> {
|
|
7
7
|
readonly value: T;
|
|
8
8
|
readonly displayText: string;
|
|
9
9
|
readonly color: ThemePalette;
|
|
10
10
|
readonly removeable: boolean;
|
|
11
11
|
constructor(value: T, displayText: string, color: ThemePalette, removeable: boolean);
|
|
12
12
|
}
|
|
13
|
-
export declare class ElderMultiSelectChipsComponent<TId,
|
|
13
|
+
export declare class ElderMultiSelectChipsComponent<TId = any, TEntity = any, TValue = any> extends ElderMultiSelectBase<TId, TEntity, TValue> implements OnInit {
|
|
14
14
|
/***************************************************************************
|
|
15
15
|
* *
|
|
16
16
|
* Fields *
|
|
17
17
|
* *
|
|
18
18
|
**************************************************************************/
|
|
19
19
|
private readonly log;
|
|
20
|
-
readonly
|
|
20
|
+
readonly selectChips$: Observable<SelectChip<TEntity>[]>;
|
|
21
21
|
private readonly chipColorResolver$;
|
|
22
22
|
selectable: boolean;
|
|
23
23
|
allowRemove: boolean;
|
|
@@ -47,18 +47,18 @@ export declare class ElderMultiSelectChipsComponent<TId, T> extends ElderMultiSe
|
|
|
47
47
|
* A function which returns the color of a given label object.
|
|
48
48
|
*/
|
|
49
49
|
set chipColorResolver(fn: (o1: any) => ThemePalette);
|
|
50
|
-
get isOptionDisabledInternalFn(): (option:
|
|
51
|
-
get isOptionHiddenInternalFn(): (option:
|
|
50
|
+
get isOptionDisabledInternalFn(): (option: TEntity) => boolean;
|
|
51
|
+
get isOptionHiddenInternalFn(): (option: TEntity) => boolean;
|
|
52
52
|
/***************************************************************************
|
|
53
53
|
* *
|
|
54
54
|
* Public API *
|
|
55
55
|
* *
|
|
56
56
|
**************************************************************************/
|
|
57
|
-
onOptionSelected(selectedValue:
|
|
58
|
-
addLabels(labels:
|
|
57
|
+
onOptionSelected(selectedValue: TEntity): void;
|
|
58
|
+
addLabels(labels: TEntity[]): void;
|
|
59
59
|
addLabel(label: any): void;
|
|
60
|
-
removeLabel(toRemove:
|
|
61
|
-
replaceWith(
|
|
60
|
+
removeLabel(toRemove: TEntity): void;
|
|
61
|
+
replaceWith(entities: TEntity[]): void;
|
|
62
62
|
/***************************************************************************
|
|
63
63
|
* *
|
|
64
64
|
* Private methods *
|
|
@@ -66,7 +66,7 @@ export declare class ElderMultiSelectChipsComponent<TId, T> extends ElderMultiSe
|
|
|
66
66
|
**************************************************************************/
|
|
67
67
|
private isAlreadyPresent;
|
|
68
68
|
private resetInput;
|
|
69
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ElderMultiSelectChipsComponent<any, any>, never>;
|
|
70
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ElderMultiSelectChipsComponent<any, any>, "elder-multi-select-chips", never, { "allowRemove": "allowRemove"; "chipTemplate": "chipTemplate"; "chipColorResolver": "chipColorResolver"; }, {}, ["chipTemplateQuery"], never>;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderMultiSelectChipsComponent<any, any, any>, never>;
|
|
70
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ElderMultiSelectChipsComponent<any, any, any>, "elder-multi-select-chips", never, { "allowRemove": "allowRemove"; "chipTemplate": "chipTemplate"; "chipColorResolver": "chipColorResolver"; }, {}, ["chipTemplateQuery"], never>;
|
|
71
71
|
}
|
|
72
72
|
export {};
|