@elderbyte/ngx-starter 13.9.1 → 13.9.4
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/components/select/elder-entity-value-accessor.mjs +5 -4
- package/esm2020/lib/components/select/elder-select/elder-select.component.mjs +21 -13
- package/esm2020/lib/components/select/elder-select-chip.directive.mjs +15 -1
- package/esm2020/lib/components/select/elder-select-on-tab.directive.mjs +51 -22
- package/esm2020/lib/components/select/elder-select.module.mjs +7 -3
- package/esm2020/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.mjs +31 -15
- package/fesm2015/elderbyte-ngx-starter.mjs +119 -47
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +119 -47
- package/fesm2020/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/components/select/elder-entity-value-accessor.d.ts +7 -2
- package/lib/components/select/elder-select/elder-select.component.d.ts +5 -3
- package/lib/components/select/elder-select-chip.directive.d.ts +7 -0
- package/lib/components/select/elder-select-on-tab.directive.d.ts +13 -4
- package/lib/components/select/elder-select.module.d.ts +2 -2
- package/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.d.ts +12 -11
- package/package.json +1 -1
- package/src/lib/components/select/elder-select/elder-select.component.scss +12 -0
- package/src/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.scss +20 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
export interface IElderEntityValueAccessor<TEntity, TId> {
|
|
2
|
+
export interface IElderEntityValueAccessor<TEntity, TId, TValue> {
|
|
3
3
|
/**
|
|
4
4
|
* Gets or sets the entity
|
|
5
5
|
*/
|
|
@@ -23,5 +23,10 @@ export interface IElderEntityValueAccessor<TEntity, TId> {
|
|
|
23
23
|
* @param entity
|
|
24
24
|
*/
|
|
25
25
|
updateValueByEntity(entity: TEntity): void;
|
|
26
|
+
/**
|
|
27
|
+
* Convert an entity to a value for this control.
|
|
28
|
+
* @param entity
|
|
29
|
+
*/
|
|
30
|
+
entityToValue(entity: TEntity): TValue;
|
|
26
31
|
}
|
|
27
|
-
export declare function isElderEntityValueAccessor(object: any): object is IElderEntityValueAccessor<any, any>;
|
|
32
|
+
export declare function isElderEntityValueAccessor(object: any): object is IElderEntityValueAccessor<any, any, any>;
|
|
@@ -21,7 +21,7 @@ declare class EntityContext<T> {
|
|
|
21
21
|
* - Support entity id handling, input / output is the entity id vs full value.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare class ElderSelectComponent<TEntity = any, TId = any, TValue = TEntity | TId> extends ElderSelectBase<TId, TEntity, TValue> implements IElderEntityValueAccessor<TEntity, TId>, OnInit, OnDestroy {
|
|
24
|
+
export declare class ElderSelectComponent<TEntity = any, TId = any, TValue = TEntity | TId> extends ElderSelectBase<TId, TEntity, TValue> implements IElderEntityValueAccessor<TEntity, TId, TValue>, OnInit, OnDestroy {
|
|
25
25
|
/***************************************************************************
|
|
26
26
|
* *
|
|
27
27
|
* Fields *
|
|
@@ -99,13 +99,15 @@ export declare class ElderSelectComponent<TEntity = any, TId = any, TValue = TEn
|
|
|
99
99
|
* *
|
|
100
100
|
**************************************************************************/
|
|
101
101
|
onInputBlur(event: FocusEvent): void;
|
|
102
|
+
onInputFocus(autoTrigger: MatAutocompleteTrigger): void;
|
|
102
103
|
get isOptionDisabledInternalFn(): (option: TEntity) => boolean;
|
|
103
104
|
get isOptionHiddenInternalFn(): (option: TEntity) => boolean;
|
|
104
105
|
togglePanel(autoTrigger: MatAutocompleteTrigger): void;
|
|
106
|
+
openPanel(autoTrigger: MatAutocompleteTrigger): void;
|
|
105
107
|
onInputClicked(autoTrigger: MatAutocompleteTrigger): void;
|
|
106
108
|
onOptionSelected(selectedValue: TEntity): void;
|
|
107
109
|
openSelectionPopup(event: Event): void;
|
|
108
|
-
clear(event
|
|
110
|
+
clear(event?: Event): void;
|
|
109
111
|
forceReloadFirst(): void;
|
|
110
112
|
updateValueByEntity(entity: TEntity): void;
|
|
111
113
|
focus(options?: FocusOptions): void;
|
|
@@ -131,7 +133,7 @@ export declare class ElderSelectComponent<TEntity = any, TId = any, TValue = TEn
|
|
|
131
133
|
private selectEntityById;
|
|
132
134
|
private loadEntityById;
|
|
133
135
|
private findInDataContext;
|
|
134
|
-
|
|
136
|
+
entityToValue(entity: TEntity): TValue;
|
|
135
137
|
/**
|
|
136
138
|
* This method is invoked after a value has been written to this control.
|
|
137
139
|
*
|
|
@@ -7,3 +7,10 @@ export declare class ElderSelectChipDirective {
|
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderSelectChipDirective, never>;
|
|
8
8
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSelectChipDirective, "[elderElderSelectChip]", never, {}, {}, never>;
|
|
9
9
|
}
|
|
10
|
+
export declare class ElderSelectChipAvatarDirective {
|
|
11
|
+
templateRef: TemplateRef<any>;
|
|
12
|
+
viewContainer: ViewContainerRef;
|
|
13
|
+
constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef);
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderSelectChipAvatarDirective, never>;
|
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSelectChipAvatarDirective, "[elderElderSelectChipAvatar]", never, {}, {}, never>;
|
|
16
|
+
}
|
|
@@ -2,8 +2,9 @@ import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
3
3
|
import { ElderSelectBase } from './elder-select-base';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ElderSelectOnTabDirective<TEntity = any, TId = any> implements AfterViewInit, OnDestroy {
|
|
5
|
+
export declare class ElderSelectOnTabDirective<TEntity = any, TId = any, TValue = TEntity | TId> implements AfterViewInit, OnDestroy {
|
|
6
6
|
private readonly autoTrigger;
|
|
7
|
+
private readonly elderSelectBase;
|
|
7
8
|
/***************************************************************************
|
|
8
9
|
* *
|
|
9
10
|
* Fields *
|
|
@@ -32,8 +33,8 @@ export declare class ElderSelectOnTabDirective<TEntity = any, TId = any> impleme
|
|
|
32
33
|
* Event Listener *
|
|
33
34
|
* *
|
|
34
35
|
**************************************************************************/
|
|
36
|
+
onOptionSelect(): void;
|
|
35
37
|
onBlur(): void;
|
|
36
|
-
private updateValueByEntity;
|
|
37
38
|
/***************************************************************************
|
|
38
39
|
* *
|
|
39
40
|
* Life Cycle *
|
|
@@ -41,6 +42,14 @@ export declare class ElderSelectOnTabDirective<TEntity = any, TId = any> impleme
|
|
|
41
42
|
**************************************************************************/
|
|
42
43
|
ngAfterViewInit(): void;
|
|
43
44
|
ngOnDestroy(): void;
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
/***************************************************************************
|
|
46
|
+
* *
|
|
47
|
+
* Private methods *
|
|
48
|
+
* *
|
|
49
|
+
**************************************************************************/
|
|
50
|
+
private reset;
|
|
51
|
+
private writeEntity;
|
|
52
|
+
private entityToValue;
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderSelectOnTabDirective<any, any, any>, [null, { skipSelf: true; }]>;
|
|
54
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElderSelectOnTabDirective<any, any, any>, "[elderSelectOnTab]", never, {}, {}, never>;
|
|
46
55
|
}
|
|
@@ -28,7 +28,7 @@ import * as i26 from "../input/autocomplete/elder-autocomplete.module";
|
|
|
28
28
|
import * as i27 from "@angular/material/chips";
|
|
29
29
|
import * as i28 from "../../pipes/elder-pipes.module";
|
|
30
30
|
export { ElderSelectValueDirective } from './elder-select-value.directive';
|
|
31
|
-
export { ElderSelectChipDirective } from './elder-select-chip.directive';
|
|
31
|
+
export { ElderSelectChipDirective, ElderSelectChipAvatarDirective } from './elder-select-chip.directive';
|
|
32
32
|
export { ElderSelectOnTabDirective } from './elder-select-on-tab.directive';
|
|
33
33
|
export { ElderSelectComponent } from './elder-select/elder-select.component';
|
|
34
34
|
export { TemplatedSelectionDialogComponent, ISelectionModelDialogOptions } from './popup/templated-selection-dialog/templated-selection-dialog.component';
|
|
@@ -38,6 +38,6 @@ export { ElderMultiSelectChipsComponent } from './multi/elder-multi-select-chips
|
|
|
38
38
|
export { ElderAutoSelectFirstDirective } from './auto/elder-auto-select-first.directive';
|
|
39
39
|
export declare class ElderSelectModule {
|
|
40
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderSelectModule, never>;
|
|
41
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ElderSelectModule, [typeof i1.ElderSelectComponent, typeof i2.ElderSelectValueDirective, typeof i3.TemplatedSelectionDialogComponent, typeof i4.SelectionModelPopupDirective, typeof i5.ElderSelectOnTabDirective, typeof i6.ElderMultiSelectChipsComponent, typeof i7.ElderSelectChipDirective, typeof i8.ElderAutoSelectFirstDirective], [typeof i9.CommonModule, typeof i10.FormsModule, typeof i10.ReactiveFormsModule, typeof i11.MatFormFieldModule, typeof i12.MatIconModule, typeof i13.MatSelectModule, typeof i14.MatDialogModule, typeof i15.MatButtonModule, typeof i16.MatInputModule, typeof i17.MatAutocompleteModule, typeof i18.MatToolbarModule, typeof i19.MatProgressBarModule, typeof i20.MatProgressSpinnerModule, typeof i21.FlexModule, typeof i22.TranslateModule, typeof i23.ElderFormsDirectivesModule, typeof i24.ElderTableModule, typeof i25.ElderInfiniteScrollModule, typeof i26.ElderAutocompleteModule, typeof i27.MatChipsModule, typeof i28.ElderPipesModule], [typeof i1.ElderSelectComponent, typeof i2.ElderSelectValueDirective, typeof i3.TemplatedSelectionDialogComponent, typeof i4.SelectionModelPopupDirective, typeof i6.ElderMultiSelectChipsComponent, typeof i7.ElderSelectChipDirective, typeof i8.ElderAutoSelectFirstDirective]>;
|
|
41
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ElderSelectModule, [typeof i1.ElderSelectComponent, typeof i2.ElderSelectValueDirective, typeof i3.TemplatedSelectionDialogComponent, typeof i4.SelectionModelPopupDirective, typeof i5.ElderSelectOnTabDirective, typeof i6.ElderMultiSelectChipsComponent, typeof i7.ElderSelectChipDirective, typeof i7.ElderSelectChipAvatarDirective, typeof i8.ElderAutoSelectFirstDirective], [typeof i9.CommonModule, typeof i10.FormsModule, typeof i10.ReactiveFormsModule, typeof i11.MatFormFieldModule, typeof i12.MatIconModule, typeof i13.MatSelectModule, typeof i14.MatDialogModule, typeof i15.MatButtonModule, typeof i16.MatInputModule, typeof i17.MatAutocompleteModule, typeof i18.MatToolbarModule, typeof i19.MatProgressBarModule, typeof i20.MatProgressSpinnerModule, typeof i21.FlexModule, typeof i22.TranslateModule, typeof i23.ElderFormsDirectivesModule, typeof i24.ElderTableModule, typeof i25.ElderInfiniteScrollModule, typeof i26.ElderAutocompleteModule, typeof i27.MatChipsModule, typeof i28.ElderPipesModule], [typeof i1.ElderSelectComponent, typeof i2.ElderSelectValueDirective, typeof i3.TemplatedSelectionDialogComponent, typeof i4.SelectionModelPopupDirective, typeof i6.ElderMultiSelectChipsComponent, typeof i7.ElderSelectChipDirective, typeof i7.ElderSelectChipAvatarDirective, typeof i8.ElderAutoSelectFirstDirective]>;
|
|
42
42
|
static ɵinj: i0.ɵɵInjectorDeclaration<ElderSelectModule>;
|
|
43
43
|
}
|
package/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.d.ts
CHANGED
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NgZone, TemplateRef } from '@angular/core';
|
|
2
2
|
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 ChipModel<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 = any, TEntity = any, TValue = any> extends ElderMultiSelectBase<TId, TEntity, TValue>
|
|
13
|
+
export declare class ElderMultiSelectChipsComponent<TId = any, TEntity = any, TValue = any> extends ElderMultiSelectBase<TId, TEntity, TValue> {
|
|
14
14
|
/***************************************************************************
|
|
15
15
|
* *
|
|
16
16
|
* Fields *
|
|
17
17
|
* *
|
|
18
18
|
**************************************************************************/
|
|
19
19
|
private readonly log;
|
|
20
|
-
readonly selectChips$: Observable<
|
|
20
|
+
readonly selectChips$: Observable<ChipModel<TEntity>[]>;
|
|
21
21
|
private readonly chipColorResolver$;
|
|
22
22
|
selectable: boolean;
|
|
23
23
|
allowRemove: boolean;
|
|
24
|
+
chipColorEnabled: boolean;
|
|
24
25
|
private inputControl;
|
|
25
26
|
chipTemplateQuery: TemplateRef<any>;
|
|
26
27
|
private _chipTemplate;
|
|
28
|
+
chipAvatarTemplateQuery: TemplateRef<any>;
|
|
29
|
+
private _chipAvatarTemplate;
|
|
27
30
|
/***************************************************************************
|
|
28
31
|
* *
|
|
29
32
|
* Constructor *
|
|
30
33
|
* *
|
|
31
34
|
**************************************************************************/
|
|
32
35
|
constructor(zone: NgZone);
|
|
33
|
-
/***************************************************************************
|
|
34
|
-
* *
|
|
35
|
-
* Life Cycle *
|
|
36
|
-
* *
|
|
37
|
-
**************************************************************************/
|
|
38
|
-
ngOnInit(): void;
|
|
39
36
|
/***************************************************************************
|
|
40
37
|
* *
|
|
41
38
|
* Properties *
|
|
@@ -43,6 +40,8 @@ export declare class ElderMultiSelectChipsComponent<TId = any, TEntity = any, TV
|
|
|
43
40
|
**************************************************************************/
|
|
44
41
|
set chipTemplate(template: TemplateRef<any>);
|
|
45
42
|
get chipTemplate(): TemplateRef<any>;
|
|
43
|
+
set chipAvatarTemplate(template: TemplateRef<any>);
|
|
44
|
+
get chipAvatarTemplate(): TemplateRef<any>;
|
|
46
45
|
/**
|
|
47
46
|
* A function which returns the color of a given label object.
|
|
48
47
|
*/
|
|
@@ -55,6 +54,8 @@ export declare class ElderMultiSelectChipsComponent<TId = any, TEntity = any, TV
|
|
|
55
54
|
* *
|
|
56
55
|
**************************************************************************/
|
|
57
56
|
onOptionSelected(selectedValue: TEntity): void;
|
|
57
|
+
resolveChipValue(e1: TEntity): any;
|
|
58
|
+
get compareWithFn(): (e1: TEntity, e2: TEntity) => boolean;
|
|
58
59
|
focus(options?: FocusOptions): void;
|
|
59
60
|
blur(): void;
|
|
60
61
|
/***************************************************************************
|
|
@@ -65,6 +66,6 @@ export declare class ElderMultiSelectChipsComponent<TId = any, TEntity = any, TV
|
|
|
65
66
|
private isAlreadyPresent;
|
|
66
67
|
private resetInput;
|
|
67
68
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderMultiSelectChipsComponent<any, any, any>, never>;
|
|
68
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ElderMultiSelectChipsComponent<any, any, any>, "elder-multi-select-chips", never, { "allowRemove": "allowRemove"; "chipTemplate": "chipTemplate"; "chipColorResolver": "chipColorResolver"; }, {}, ["chipTemplateQuery"], never>;
|
|
69
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ElderMultiSelectChipsComponent<any, any, any>, "elder-multi-select-chips", never, { "allowRemove": "allowRemove"; "chipColorEnabled": "chipColorEnabled"; "chipTemplate": "chipTemplate"; "chipColorResolver": "chipColorResolver"; }, {}, ["chipTemplateQuery", "chipAvatarTemplateQuery"], never>;
|
|
69
70
|
}
|
|
70
71
|
export {};
|
package/package.json
CHANGED
|
@@ -28,6 +28,18 @@
|
|
|
28
28
|
height: 16px;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.suffix-icon {
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
width: 16px;
|
|
34
|
+
height: 16px;
|
|
35
|
+
// padding-left: 4px;
|
|
36
|
+
.mat-icon {
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
width: 16px;
|
|
39
|
+
height: 16px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
.clickable-icon {
|
|
32
44
|
cursor: pointer;
|
|
33
45
|
}
|
|
@@ -9,6 +9,26 @@
|
|
|
9
9
|
height: 16px;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.elder-chip-input {
|
|
13
|
+
width: 120px!important;
|
|
14
|
+
max-width: 120px!important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.small-icon-button {
|
|
18
|
+
width: 24px !important;
|
|
19
|
+
height: 24px !important;
|
|
20
|
+
line-height: 24px !important;
|
|
21
|
+
|
|
22
|
+
.mat-icon {
|
|
23
|
+
width: 16px !important;
|
|
24
|
+
height: 16px !important;
|
|
25
|
+
line-height: 16px !important;
|
|
26
|
+
}
|
|
27
|
+
.material-icons {
|
|
28
|
+
font-size: 16px !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
12
32
|
.clickable-chip {
|
|
13
33
|
cursor: pointer;
|
|
14
34
|
}
|