@elderbyte/ngx-starter 13.9.2 → 13.9.5
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-on-tab.directive.mjs +51 -22
- package/esm2020/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.mjs +4 -4
- package/esm2020/lib/pipes/elder-pipes.module.mjs +17 -6
- package/esm2020/lib/pipes/elder-truncate.pipe.mjs +40 -0
- package/fesm2015/elderbyte-ngx-starter.mjs +102 -53
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +102 -53
- 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 +4 -2
- package/lib/components/select/elder-select-on-tab.directive.d.ts +13 -4
- package/lib/pipes/elder-pipes.module.d.ts +11 -3
- package/lib/pipes/elder-truncate.pipe.d.ts +17 -0
- package/package.json +1 -1
- package/esm2020/lib/pipes/elder-trim.pipe.mjs +0 -40
- package/lib/pipes/elder-trim.pipe.d.ts +0 -17
|
@@ -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,9 +99,11 @@ 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;
|
|
@@ -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
|
*
|
|
@@ -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
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
2
|
import { ElderRepeatPipe } from './elder-repeat.pipe';
|
|
3
|
+
import { ElderTruncatePipe } from './elder-truncate.pipe';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
import * as i1 from "./bytes.pipe";
|
|
5
6
|
import * as i2 from "./time-ago.pipe";
|
|
@@ -11,7 +12,7 @@ import * as i7 from "./iso-duration.pipe";
|
|
|
11
12
|
import * as i8 from "./elder-round.pipe";
|
|
12
13
|
import * as i9 from "./iso-interval.pipe";
|
|
13
14
|
import * as i10 from "./iso-interval-parse.pipe";
|
|
14
|
-
import * as i11 from "./elder-
|
|
15
|
+
import * as i11 from "./elder-truncate.pipe";
|
|
15
16
|
import * as i12 from "@angular/common";
|
|
16
17
|
export { BytesPipe } from './bytes.pipe';
|
|
17
18
|
export { TimeAgoPipe } from './time-ago.pipe';
|
|
@@ -23,7 +24,7 @@ export { IsoDurationPipe } from './iso-duration.pipe';
|
|
|
23
24
|
export { IsoIntervalPipe } from './iso-interval.pipe';
|
|
24
25
|
export { IsoIntervalParsePipe } from './iso-interval-parse.pipe';
|
|
25
26
|
export { ElderRoundPipe } from './elder-round.pipe';
|
|
26
|
-
export {
|
|
27
|
+
export { ElderTruncatePipe } from './elder-truncate.pipe';
|
|
27
28
|
/**
|
|
28
29
|
* @deprecated Please switch to ElderRepeatPipe
|
|
29
30
|
*/
|
|
@@ -31,8 +32,15 @@ export declare class ElderRepeatPipeLegacy extends ElderRepeatPipe implements Pi
|
|
|
31
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderRepeatPipeLegacy, never>;
|
|
32
33
|
static ɵpipe: i0.ɵɵPipeDeclaration<ElderRepeatPipeLegacy, "ebsRepeat">;
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Please switch to elderTruncate
|
|
37
|
+
*/
|
|
38
|
+
export declare class ElderTrimPipe extends ElderTruncatePipe implements PipeTransform {
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderTrimPipe, never>;
|
|
40
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ElderTrimPipe, "elderTrim">;
|
|
41
|
+
}
|
|
34
42
|
export declare class ElderPipesModule {
|
|
35
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<ElderPipesModule, never>;
|
|
36
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ElderPipesModule, [typeof i1.BytesPipe, typeof i2.TimeAgoPipe, typeof i3.TimeDurationPipe, typeof i4.WeightPipe, typeof i5.ElderRepeatPipe, typeof i6.ElderSafeUrlPipe, typeof ElderRepeatPipeLegacy, typeof i7.IsoDurationPipe, typeof i8.ElderRoundPipe, typeof i9.IsoIntervalPipe, typeof i10.IsoIntervalParsePipe, typeof i11.ElderTrimPipe], [typeof i12.CommonModule], [typeof i1.BytesPipe, typeof i2.TimeAgoPipe, typeof i3.TimeDurationPipe, typeof i4.WeightPipe, typeof i5.ElderRepeatPipe, typeof i6.ElderSafeUrlPipe, typeof ElderRepeatPipeLegacy, typeof i7.IsoDurationPipe, typeof i8.ElderRoundPipe, typeof i9.IsoIntervalPipe, typeof i10.IsoIntervalParsePipe, typeof i11.ElderTrimPipe]>;
|
|
44
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ElderPipesModule, [typeof i1.BytesPipe, typeof i2.TimeAgoPipe, typeof i3.TimeDurationPipe, typeof i4.WeightPipe, typeof i5.ElderRepeatPipe, typeof i6.ElderSafeUrlPipe, typeof ElderRepeatPipeLegacy, typeof i7.IsoDurationPipe, typeof i8.ElderRoundPipe, typeof i9.IsoIntervalPipe, typeof i10.IsoIntervalParsePipe, typeof i11.ElderTruncatePipe, typeof ElderTrimPipe], [typeof i12.CommonModule], [typeof i1.BytesPipe, typeof i2.TimeAgoPipe, typeof i3.TimeDurationPipe, typeof i4.WeightPipe, typeof i5.ElderRepeatPipe, typeof i6.ElderSafeUrlPipe, typeof ElderRepeatPipeLegacy, typeof i7.IsoDurationPipe, typeof i8.ElderRoundPipe, typeof i9.IsoIntervalPipe, typeof i10.IsoIntervalParsePipe, typeof i11.ElderTruncatePipe, typeof ElderTrimPipe]>;
|
|
37
45
|
static ɵinj: i0.ɵɵInjectorDeclaration<ElderPipesModule>;
|
|
38
46
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
declare type TrimMode = 'start' | 'end';
|
|
4
|
+
export declare class ElderTruncatePipe implements PipeTransform {
|
|
5
|
+
/**
|
|
6
|
+
* Truncate (cut off) the given input value if it is longer than maxCharacters.
|
|
7
|
+
* @param value
|
|
8
|
+
* @param maxCharacters
|
|
9
|
+
* @param trimMode truncate from
|
|
10
|
+
*/
|
|
11
|
+
transform(value: any, maxCharacters?: number, trimMode?: TrimMode): string;
|
|
12
|
+
private truncateStart;
|
|
13
|
+
private truncateEnd;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderTruncatePipe, never>;
|
|
15
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ElderTruncatePipe, "elderTruncate">;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class ElderTrimPipe {
|
|
4
|
-
/**
|
|
5
|
-
* Trim the given input value if it is longer than maxCharacters.
|
|
6
|
-
* @param value
|
|
7
|
-
* @param maxCharacters
|
|
8
|
-
* @param trimMode Trim from
|
|
9
|
-
*/
|
|
10
|
-
transform(value, maxCharacters = 10, trimMode = 'end') {
|
|
11
|
-
if ((typeof value) == 'string' && value.length > maxCharacters) {
|
|
12
|
-
let trimmed;
|
|
13
|
-
switch (trimMode) {
|
|
14
|
-
case 'start':
|
|
15
|
-
trimmed = this.trimStart(value, maxCharacters);
|
|
16
|
-
break;
|
|
17
|
-
case 'end':
|
|
18
|
-
trimmed = this.trimEnd(value, maxCharacters);
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
return trimmed + '…';
|
|
22
|
-
}
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
trimStart(value, maxCharacters) {
|
|
26
|
-
return value.substring(value.length - maxCharacters);
|
|
27
|
-
}
|
|
28
|
-
trimEnd(value, maxCharacters) {
|
|
29
|
-
return value.substring(0, maxCharacters);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
ElderTrimPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.10", ngImport: i0, type: ElderTrimPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
33
|
-
ElderTrimPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.10", ngImport: i0, type: ElderTrimPipe, name: "elderTrim" });
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.10", ngImport: i0, type: ElderTrimPipe, decorators: [{
|
|
35
|
-
type: Pipe,
|
|
36
|
-
args: [{
|
|
37
|
-
name: 'elderTrim'
|
|
38
|
-
}]
|
|
39
|
-
}] });
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxkZXItdHJpbS5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZWxkZXJieXRlL25neC1zdGFydGVyL3NyYy9saWIvcGlwZXMvZWxkZXItdHJpbS5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU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ZWQgKyAn4oCmJztcbiAgICB9XG4gICAgcmV0dXJuIHZhbHVlO1xuICB9XG5cbiAgcHJpdmF0ZSB0cmltU3RhcnQodmFsdWU6IHN0cmluZywgbWF4Q2hhcmFjdGVyczogbnVtYmVyKTogc3RyaW5nIHtcbiAgICByZXR1cm4gdmFsdWUuc3Vic3RyaW5nKHZhbHVlLmxlbmd0aCAtIG1heENoYXJhY3RlcnMpO1xuICB9XG5cbiAgcHJpdmF0ZSB0cmltRW5kKHZhbHVlOiBzdHJpbmcsIG1heENoYXJhY3RlcnM6IG51bWJlcik6IHN0cmluZyB7XG4gICAgcmV0dXJuIHZhbHVlLnN1YnN0cmluZygwLCBtYXhDaGFyYWN0ZXJzKTtcbiAgfVxuXG59XG4iXX0=
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
declare type TrimMode = 'start' | 'end';
|
|
4
|
-
export declare class ElderTrimPipe implements PipeTransform {
|
|
5
|
-
/**
|
|
6
|
-
* Trim the given input value if it is longer than maxCharacters.
|
|
7
|
-
* @param value
|
|
8
|
-
* @param maxCharacters
|
|
9
|
-
* @param trimMode Trim from
|
|
10
|
-
*/
|
|
11
|
-
transform(value: any, maxCharacters?: number, trimMode?: TrimMode): string;
|
|
12
|
-
private trimStart;
|
|
13
|
-
private trimEnd;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ElderTrimPipe, never>;
|
|
15
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<ElderTrimPipe, "elderTrim">;
|
|
16
|
-
}
|
|
17
|
-
export {};
|