@sumaris-net/ngx-components 1.6.2 → 1.6.3
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/bundles/sumaris-net.ngx-components.umd.js +477 -201
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +7 -0
- package/esm2015/src/app/core/auth/modal/modal-auth.js +21 -9
- package/esm2015/src/app/shared/form/field.model.js +1 -1
- package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +81 -88
- package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +2 -2
- package/esm2015/src/app/shared/material/chips/material.chips.js +336 -79
- package/esm2015/src/app/shared/material/chips/testing/chips.test.js +7 -4
- package/esm2015/src/app/shared/material/swipe/material.swipe.js +5 -5
- package/esm2015/src/app/shared/material/swipe/testing/swipe.test.js +2 -2
- package/fesm2015/sumaris-net.ngx-components.js +442 -179
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/auth/modal/modal-auth.d.ts +12 -5
- package/src/app/shared/form/field.model.d.ts +2 -1
- package/src/app/shared/material/autocomplete/material.autocomplete.d.ts +35 -35
- package/src/app/shared/material/chips/material.chips.d.ts +35 -10
- package/src/app/shared/material/swipe/material.swipe.d.ts +2 -2
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { ChangeDetectorRef } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, OnInit } from '@angular/core';
|
|
2
2
|
import { ModalController } from '@ionic/angular';
|
|
3
3
|
import { AccountService } from '../../services/account.service';
|
|
4
|
-
export declare class AuthModal {
|
|
4
|
+
export declare class AuthModal implements OnInit {
|
|
5
5
|
private accountService;
|
|
6
6
|
private viewCtrl;
|
|
7
|
-
private
|
|
8
|
-
loading: boolean;
|
|
7
|
+
private cd;
|
|
8
|
+
get loading(): boolean;
|
|
9
9
|
private form;
|
|
10
|
-
constructor(accountService: AccountService, viewCtrl: ModalController,
|
|
10
|
+
constructor(accountService: AccountService, viewCtrl: ModalController, cd: ChangeDetectorRef);
|
|
11
|
+
ngOnInit(): void;
|
|
11
12
|
cancel(): void;
|
|
12
13
|
doSubmit(): Promise<any>;
|
|
13
14
|
protected markForCheck(): void;
|
|
15
|
+
protected markAsLoading(opts?: {
|
|
16
|
+
emitEvent?: boolean;
|
|
17
|
+
}): void;
|
|
18
|
+
protected markAsLoaded(opts?: {
|
|
19
|
+
emitEvent?: boolean;
|
|
20
|
+
}): void;
|
|
14
21
|
}
|
|
@@ -2,7 +2,8 @@ import { ObjectMap, Property } from '../types';
|
|
|
2
2
|
import { InjectionToken } from '@angular/core';
|
|
3
3
|
import { MatAutocompleteFieldAddOptions } from '../material/autocomplete/material.autocomplete';
|
|
4
4
|
export declare type DisplayFn = (obj: any) => string;
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type EqualsFn = (o1: any, o2: any) => boolean;
|
|
6
|
+
export declare type CompareFn = (o1: any, o2: any) => number;
|
|
6
7
|
export declare type FormFieldType = 'integer' | 'double' | 'boolean' | 'string' | 'enum' | 'color' | 'peer' | 'entity' | 'entities' | 'date' | 'dateTime';
|
|
7
8
|
export declare interface FormFieldDefinition<T = any> {
|
|
8
9
|
key: string;
|
|
@@ -3,7 +3,7 @@ import { ControlValueAccessor, FormControl, FormGroupDirective } from '@angular/
|
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
import { LoadResult, SuggestFn, SuggestService } from '../../services/entity-service.class';
|
|
5
5
|
import { InputElement } from '../../inputs';
|
|
6
|
-
import {
|
|
6
|
+
import { DisplayFn, EqualsFn } from '../../form/field.model';
|
|
7
7
|
import { FloatLabelType } from '@angular/material/form-field';
|
|
8
8
|
import { MatSelect } from '@angular/material/select';
|
|
9
9
|
import { MatAutocomplete, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
@@ -15,7 +15,7 @@ export declare interface MatAutocompleteFieldConfig<T = any, F = any> {
|
|
|
15
15
|
columnSizes?: (number | 'auto' | undefined)[];
|
|
16
16
|
columnNames?: (string | undefined)[];
|
|
17
17
|
displayWith?: DisplayFn;
|
|
18
|
-
|
|
18
|
+
equals?: EqualsFn;
|
|
19
19
|
showAllOnFocus?: boolean;
|
|
20
20
|
showPanelOnFocus?: boolean;
|
|
21
21
|
class?: string;
|
|
@@ -39,31 +39,12 @@ export declare class MatAutocompleteConfigHolder {
|
|
|
39
39
|
add<T = any, F = any>(fieldName: string, options?: MatAutocompleteFieldAddOptions<T, F>): MatAutocompleteFieldConfig<T, F>;
|
|
40
40
|
get<T = any>(fieldName: string): MatAutocompleteFieldConfig<T>;
|
|
41
41
|
}
|
|
42
|
-
export declare class MatAutocompleteField implements OnInit,
|
|
42
|
+
export declare class MatAutocompleteField implements OnInit, OnDestroy, InputElement, ControlValueAccessor {
|
|
43
43
|
protected cd: ChangeDetectorRef;
|
|
44
44
|
private formGroupDir;
|
|
45
45
|
private _onChangeCallback;
|
|
46
46
|
private _onTouchedCallback;
|
|
47
|
-
|
|
48
|
-
private _implicitValue;
|
|
49
|
-
private _subscription;
|
|
50
|
-
private _itemsSubscription;
|
|
51
|
-
private _openedSubscription;
|
|
52
|
-
private _filter$;
|
|
53
|
-
private _itemCount;
|
|
54
|
-
private _reload$;
|
|
55
|
-
_readonly: boolean;
|
|
56
|
-
_tabindex: number;
|
|
57
|
-
matSelectItems$: Observable<any[]>;
|
|
58
|
-
$inputItems: BehaviorSubject<any[]>;
|
|
59
|
-
$filteredItems: BehaviorSubject<any[]>;
|
|
60
|
-
searchable: boolean;
|
|
61
|
-
displayValue: string;
|
|
62
|
-
_moreItemsCount: number;
|
|
63
|
-
_fetchMore$: EventEmitter<Event>;
|
|
64
|
-
get itemCount(): number;
|
|
65
|
-
get canFetchMore(): boolean;
|
|
66
|
-
compareWith: (o1: any, o2: any) => boolean;
|
|
47
|
+
equals: EqualsFn;
|
|
67
48
|
logPrefix: string;
|
|
68
49
|
formControl: FormControl;
|
|
69
50
|
formControlName: string;
|
|
@@ -93,7 +74,37 @@ export declare class MatAutocompleteField implements OnInit, InputElement, OnDes
|
|
|
93
74
|
fetchMoreThreshold: string;
|
|
94
75
|
suggestLengthThreshold: number;
|
|
95
76
|
showLoadingSpinner: boolean;
|
|
77
|
+
clicked: EventEmitter<MouseEvent>;
|
|
78
|
+
blurred: EventEmitter<FocusEvent>;
|
|
79
|
+
focused: EventEmitter<FocusEvent>;
|
|
80
|
+
dropButtonClick: EventEmitter<UIEvent>;
|
|
81
|
+
keydownEscape: EventEmitter<any>;
|
|
82
|
+
keyupEnter: EventEmitter<any>;
|
|
83
|
+
matSelect: MatSelect;
|
|
84
|
+
matInputText: ElementRef;
|
|
85
|
+
autocomplete: MatAutocomplete;
|
|
86
|
+
autocompleteTrigger: MatAutocompleteTrigger;
|
|
96
87
|
animationsDisabled: boolean;
|
|
88
|
+
_readonly: boolean;
|
|
89
|
+
_tabindex: number;
|
|
90
|
+
matSelectItems$: Observable<any[]>;
|
|
91
|
+
$inputItems: BehaviorSubject<any[]>;
|
|
92
|
+
$filteredItems: BehaviorSubject<any[]>;
|
|
93
|
+
searchable: boolean;
|
|
94
|
+
displayValue: string;
|
|
95
|
+
_moreItemsCount: number;
|
|
96
|
+
_fetchMore$: EventEmitter<Event>;
|
|
97
|
+
private _onFetchMoreCallback;
|
|
98
|
+
private _implicitValue;
|
|
99
|
+
private _subscription;
|
|
100
|
+
private _itemsSubscription;
|
|
101
|
+
private _openedSubscription;
|
|
102
|
+
private _$filter;
|
|
103
|
+
private _itemCount;
|
|
104
|
+
private _reload$;
|
|
105
|
+
constructor(cd: ChangeDetectorRef, formGroupDir: FormGroupDirective);
|
|
106
|
+
get itemCount(): number;
|
|
107
|
+
get canFetchMore(): boolean;
|
|
97
108
|
set filter(value: any);
|
|
98
109
|
get filter(): any;
|
|
99
110
|
set readonly(value: boolean);
|
|
@@ -102,20 +113,9 @@ export declare class MatAutocompleteField implements OnInit, InputElement, OnDes
|
|
|
102
113
|
get tabindex(): number;
|
|
103
114
|
set items(value: Observable<any[]> | any[]);
|
|
104
115
|
get items(): Observable<any[]> | any[];
|
|
105
|
-
onClick: EventEmitter<MouseEvent>;
|
|
106
|
-
onBlur: EventEmitter<FocusEvent>;
|
|
107
|
-
onFocus: EventEmitter<FocusEvent>;
|
|
108
|
-
onDropButtonClick: EventEmitter<UIEvent>;
|
|
109
|
-
onKeydownEscape: EventEmitter<any>;
|
|
110
|
-
onKeyupEnter: EventEmitter<any>;
|
|
111
|
-
matSelect: MatSelect;
|
|
112
|
-
matInputText: ElementRef;
|
|
113
|
-
matAutocomplete: MatAutocomplete;
|
|
114
|
-
matAutocompleteTrigger: MatAutocompleteTrigger;
|
|
115
116
|
get value(): any;
|
|
116
117
|
get disabled(): any;
|
|
117
118
|
get enabled(): any;
|
|
118
|
-
constructor(cd: ChangeDetectorRef, formGroupDir: FormGroupDirective);
|
|
119
119
|
ngOnInit(): void;
|
|
120
120
|
ngOnDestroy(): void;
|
|
121
121
|
/**
|
|
@@ -127,7 +127,7 @@ export declare class MatAutocompleteField implements OnInit, InputElement, OnDes
|
|
|
127
127
|
registerOnTouched(fn: any): void;
|
|
128
128
|
setDisabledState(isDisabled: boolean): void;
|
|
129
129
|
focus(): void;
|
|
130
|
-
|
|
130
|
+
filterInputTextFocusEvent(event: FocusEvent): boolean;
|
|
131
131
|
filterInputTextBlurEvent(event: FocusEvent): boolean;
|
|
132
132
|
filterMatSelectFocusEvent(event: FocusEvent): void;
|
|
133
133
|
filterMatSelectBlurEvent(event: FocusEvent): boolean;
|
|
@@ -2,18 +2,17 @@ import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '
|
|
|
2
2
|
import { ControlValueAccessor, FormControl, FormGroupDirective } from '@angular/forms';
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
import { FloatLabelType } from '@angular/material/form-field';
|
|
5
|
-
import { MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
5
|
+
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
6
6
|
import { InputElement } from '../../inputs';
|
|
7
7
|
import { SuggestFn } from '../../services/entity-service.class';
|
|
8
|
-
import { DisplayFn } from '../../form/field.model';
|
|
8
|
+
import { DisplayFn, EqualsFn } from '../../form/field.model';
|
|
9
9
|
import { MatAutocompleteFieldConfig } from '../autocomplete/material.autocomplete';
|
|
10
|
-
import { getPropertyByPath } from '../../functions';
|
|
11
10
|
export declare class MatChipsField implements InputElement, ControlValueAccessor, OnInit, OnDestroy {
|
|
12
11
|
protected cd: ChangeDetectorRef;
|
|
13
12
|
private formGroupDir;
|
|
14
13
|
private _onChangeCallback;
|
|
15
14
|
private _onTouchedCallback;
|
|
16
|
-
|
|
15
|
+
equals: EqualsFn;
|
|
17
16
|
logPrefix: string;
|
|
18
17
|
formControl: FormControl;
|
|
19
18
|
formControlName: string;
|
|
@@ -32,34 +31,50 @@ export declare class MatChipsField implements InputElement, ControlValueAccessor
|
|
|
32
31
|
highlightAccent: boolean;
|
|
33
32
|
showAllOnFocus: boolean;
|
|
34
33
|
showPanelOnFocus: boolean;
|
|
35
|
-
|
|
34
|
+
autofocus: boolean;
|
|
36
35
|
config: MatAutocompleteFieldConfig;
|
|
37
36
|
i18nPrefix: string;
|
|
38
37
|
noResultMessage: string;
|
|
39
|
-
|
|
38
|
+
classList: string;
|
|
39
|
+
panelWidth: string;
|
|
40
|
+
matAutocompletePosition: 'auto' | 'above' | 'below';
|
|
40
41
|
debug: boolean;
|
|
42
|
+
itemSize: string;
|
|
43
|
+
fetchMoreThreshold: string;
|
|
44
|
+
suggestLengthThreshold: number;
|
|
45
|
+
showLoadingSpinner: boolean;
|
|
41
46
|
clicked: EventEmitter<MouseEvent>;
|
|
42
47
|
blurred: EventEmitter<FocusEvent>;
|
|
43
48
|
focused: EventEmitter<FocusEvent>;
|
|
49
|
+
dropButtonClick: EventEmitter<UIEvent>;
|
|
50
|
+
keydownEscape: EventEmitter<any>;
|
|
51
|
+
keyupEnter: EventEmitter<any>;
|
|
44
52
|
matInputText: ElementRef;
|
|
53
|
+
autocomplete: MatAutocomplete;
|
|
45
54
|
autocompleteTrigger: MatAutocompleteTrigger;
|
|
46
55
|
_tabindex: number;
|
|
47
56
|
$inputItems: BehaviorSubject<any[]>;
|
|
48
|
-
filteredItems
|
|
49
|
-
onDropButtonClick: EventEmitter<UIEvent>;
|
|
57
|
+
$filteredItems: BehaviorSubject<any[]>;
|
|
50
58
|
inputControl: FormControl;
|
|
51
|
-
|
|
59
|
+
_moreItemsCount: number;
|
|
60
|
+
_fetchMore$: EventEmitter<Event>;
|
|
61
|
+
private _onFetchMoreCallback;
|
|
62
|
+
private _implicitValue;
|
|
52
63
|
private _subscription;
|
|
53
64
|
private _itemsSubscription;
|
|
65
|
+
private _openedSubscription;
|
|
54
66
|
private _$filter;
|
|
55
67
|
private _itemCount;
|
|
68
|
+
private _reload$;
|
|
56
69
|
constructor(cd: ChangeDetectorRef, formGroupDir: FormGroupDirective);
|
|
57
70
|
get itemCount(): number;
|
|
71
|
+
get canFetchMore(): boolean;
|
|
58
72
|
set filter(value: any);
|
|
59
73
|
get filter(): any;
|
|
60
74
|
set tabindex(value: number);
|
|
61
75
|
get tabindex(): number;
|
|
62
76
|
set items(value: Observable<any[]> | any[]);
|
|
77
|
+
get items(): Observable<any[]> | any[];
|
|
63
78
|
get value(): any[];
|
|
64
79
|
get disabled(): any;
|
|
65
80
|
get enabled(): any;
|
|
@@ -80,14 +95,24 @@ export declare class MatChipsField implements InputElement, ControlValueAccessor
|
|
|
80
95
|
/**
|
|
81
96
|
* Allow to reload content. Useful when filter has been changed but not detected
|
|
82
97
|
*/
|
|
83
|
-
reloadItems(): void;
|
|
98
|
+
reloadItems(value?: any): void;
|
|
84
99
|
writeValue(value: any[]): void;
|
|
85
100
|
registerOnChange(fn: any): void;
|
|
86
101
|
registerOnTouched(fn: any): void;
|
|
87
102
|
setDisabledState(isDisabled: boolean): void;
|
|
88
103
|
focus(): void;
|
|
89
104
|
filterInputTextFocusEvent(event: FocusEvent): boolean;
|
|
105
|
+
filterInputTextBlurEvent(event: FocusEvent): boolean;
|
|
106
|
+
filterChipsFocusEvent(event: FocusEvent): void;
|
|
90
107
|
clearValue(event: UIEvent): void;
|
|
108
|
+
_initAutocompleteInfiniteScroll(threshold?: string): void;
|
|
109
|
+
get isOpen(): boolean;
|
|
110
|
+
closePanel(): void;
|
|
91
111
|
private suggest;
|
|
112
|
+
private fetchMore;
|
|
113
|
+
private updateImplicitValue;
|
|
114
|
+
private getAutocompletePanel;
|
|
115
|
+
private checkIfTouched;
|
|
92
116
|
private markForCheck;
|
|
117
|
+
private markAsLoading;
|
|
93
118
|
}
|
|
@@ -2,7 +2,7 @@ import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '
|
|
|
2
2
|
import { ControlValueAccessor, FormControl, FormGroupDirective } from '@angular/forms';
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
import { InputElement, selectInputContent } from '../../inputs';
|
|
5
|
-
import {
|
|
5
|
+
import { EqualsFn, DisplayFn } from '../../form/field.model';
|
|
6
6
|
import { FloatLabelType } from '@angular/material/form-field';
|
|
7
7
|
import { IonSlides } from '@ionic/angular';
|
|
8
8
|
import { MatButton } from '@angular/material/button';
|
|
@@ -33,7 +33,7 @@ export declare class MatSwipeField implements OnInit, InputElement, OnDestroy, C
|
|
|
33
33
|
required: boolean;
|
|
34
34
|
mobile: boolean;
|
|
35
35
|
clearable: boolean;
|
|
36
|
-
|
|
36
|
+
equals: EqualsFn | null;
|
|
37
37
|
displayWith: DisplayFn | null;
|
|
38
38
|
displayAttributes: string[];
|
|
39
39
|
appAutofocus: boolean;
|