@sumaris-net/ngx-components 2.4.12 → 2.4.15
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/doc/changelog.md +4 -0
- package/esm2020/src/app/core/services/model/entity.model.mjs +3 -17
- package/esm2020/src/app/shared/functions.mjs +33 -1
- package/esm2020/src/app/shared/material/autocomplete/material.autocomplete.mjs +83 -12
- package/esm2020/src/app/shared/material/autocomplete/material.autocomplete.module.mjs +2 -2
- package/esm2020/src/app/shared/material/autocomplete/testing/autocomplete.test.mjs +7 -3
- package/esm2020/src/app/shared/pipes/form.pipes.mjs +4 -4
- package/fesm2015/sumaris-net.ngx-components.mjs +447 -352
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +443 -352
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/model/entity.model.d.ts +2 -1
- package/src/app/shared/functions.d.ts +2 -0
- package/src/app/shared/material/autocomplete/material.autocomplete.d.ts +19 -5
- package/src/app/shared/material/autocomplete/testing/autocomplete.test.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
|
+
import { getPropertyByPath } from '../../../shared/functions';
|
|
2
3
|
import { FilterFn } from '../../../shared/services/entity-service.class';
|
|
3
4
|
import { ObjectMap, ObjectMapEntry, PropertiesArray, PropertiesMap } from '../../../shared/types';
|
|
4
5
|
import { StoreObject } from '@apollo/client/core';
|
|
@@ -49,7 +50,7 @@ export declare abstract class EntityUtils {
|
|
|
49
50
|
static isNotEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
50
51
|
static isEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
51
52
|
static equals<T extends IEntity<any> | any>(o1: T, o2: T, checkAttribute?: keyof T): boolean;
|
|
52
|
-
static getPropertyByPath
|
|
53
|
+
static getPropertyByPath: typeof getPropertyByPath;
|
|
53
54
|
static getArrayAsMap<T = any>(source?: ObjectMapEntry<T>[]): ObjectMap<T>;
|
|
54
55
|
static getMapAsArray<T = any>(source?: ObjectMap<T>): ObjectMapEntry<T>[];
|
|
55
56
|
static getPropertyArrayAsObject(source?: PropertiesArray): PropertiesMap;
|
|
@@ -66,6 +66,7 @@ export declare function isNumberRange(value: string): boolean;
|
|
|
66
66
|
export declare function getPropertyByPath(obj: any, path: string | string[], defaultValue?: any): any;
|
|
67
67
|
export declare function getProperty<T = any, K extends keyof T = any>(obj: T, key: K): T[K];
|
|
68
68
|
export declare function getPropertyByPathAsString(obj: any, path: string | string[]): string | undefined;
|
|
69
|
+
export declare function setPropertyByPath(obj: any, path: string | string[], value: any): any;
|
|
69
70
|
export declare function sleep(ms: number): Promise<void>;
|
|
70
71
|
export declare function round(value: number | undefined | null): number;
|
|
71
72
|
export declare function equalsOrNil(value1: any, value2: any): boolean;
|
|
@@ -126,3 +127,4 @@ export declare class Beans {
|
|
|
126
127
|
[key: string]: T;
|
|
127
128
|
};
|
|
128
129
|
}
|
|
130
|
+
export declare function findParentWithClass(elem: HTMLElement, className: string): HTMLElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2, ViewRef } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormGroupDirective, UntypedFormControl } from '@angular/forms';
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
import { SuggestFn } from '../../services/entity-service.class';
|
|
@@ -7,11 +7,15 @@ import { DisplayFn, EqualsFn } from '../../form/field.model';
|
|
|
7
7
|
import { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';
|
|
8
8
|
import { MatSelect } from '@angular/material/select';
|
|
9
9
|
import { MatAutocomplete, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
10
|
-
import { IonSearchbar } from '@ionic/angular';
|
|
10
|
+
import { IonSearchbar, ModalController } from '@ionic/angular';
|
|
11
11
|
import { MatAutocompleteFieldConfig } from './material.autocomplete.config';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
|
-
export declare class MatAutocompleteField implements OnInit, OnDestroy, InputElement, ControlValueAccessor {
|
|
13
|
+
export declare class MatAutocompleteField implements OnInit, AfterViewInit, OnDestroy, InputElement, ControlValueAccessor {
|
|
14
14
|
protected cd: ChangeDetectorRef;
|
|
15
|
+
protected modalController: ModalController;
|
|
16
|
+
protected renderer: Renderer2;
|
|
17
|
+
protected document: Document;
|
|
18
|
+
private viewRef;
|
|
15
19
|
private formGroupDir;
|
|
16
20
|
private _onChangeCallback;
|
|
17
21
|
private _onTouchedCallback;
|
|
@@ -75,7 +79,7 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
75
79
|
private _$filter;
|
|
76
80
|
private _itemCount;
|
|
77
81
|
private _reload$;
|
|
78
|
-
constructor(cd: ChangeDetectorRef, formGroupDir: FormGroupDirective);
|
|
82
|
+
constructor(cd: ChangeDetectorRef, modalController: ModalController, renderer: Renderer2, document: Document, viewRef: ViewRef, formGroupDir: FormGroupDirective);
|
|
79
83
|
get itemCount(): number;
|
|
80
84
|
get canFetchMore(): boolean;
|
|
81
85
|
set filter(value: any);
|
|
@@ -92,6 +96,7 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
92
96
|
get loading(): boolean;
|
|
93
97
|
get desktop(): boolean;
|
|
94
98
|
ngOnInit(): void;
|
|
99
|
+
ngAfterViewInit(): void;
|
|
95
100
|
ngOnDestroy(): void;
|
|
96
101
|
/**
|
|
97
102
|
* Allow to reload content. Useful when filter has been changed but not detected
|
|
@@ -120,6 +125,15 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
120
125
|
private getMatSelectPanel;
|
|
121
126
|
private markForCheck;
|
|
122
127
|
protected markAsLoading(): void;
|
|
123
|
-
|
|
128
|
+
private _fixMatSelectPositionAndSearchbar;
|
|
129
|
+
private _fixMatSelectPanelPosition;
|
|
130
|
+
/**
|
|
131
|
+
* Hack : if we are in a IonModal, it's necessary to move the CdkOverlay container
|
|
132
|
+
* in the IonModal to might keep focus in IonSearchbar.
|
|
133
|
+
* @param panelElement
|
|
134
|
+
* @private
|
|
135
|
+
*/
|
|
136
|
+
private _fixSearchbarOverlay;
|
|
137
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatAutocompleteField, [null, null, null, null, null, { optional: true; }]>;
|
|
124
138
|
static ɵcmp: i0.ɵɵComponentDeclaration<MatAutocompleteField, "mat-autocomplete-field", never, { "equals": "equals"; "logPrefix": "logPrefix"; "formControl": "formControl"; "formControlName": "formControlName"; "floatLabel": "floatLabel"; "appearance": "appearance"; "placeholder": "placeholder"; "suggestFn": "suggestFn"; "required": "required"; "mobile": "mobile"; "clearable": "clearable"; "debounceTime": "debounceTime"; "displayWith": "displayWith"; "displayAttributes": "displayAttributes"; "displayColumnSizes": "displayColumnSizes"; "displayColumnNames": "displayColumnNames"; "highlightAccent": "highlightAccent"; "showAllOnFocus": "showAllOnFocus"; "showPanelOnFocus": "showPanelOnFocus"; "autofocus": "autofocus"; "config": "config"; "i18nPrefix": "i18nPrefix"; "noResultMessage": "noResultMessage"; "classList": "class"; "panelWidth": "panelWidth"; "matAutocompletePosition": "matAutocompletePosition"; "multiple": "multiple"; "itemSize": "itemSize"; "fetchMoreThreshold": "fetchMoreThreshold"; "suggestLengthThreshold": "suggestLengthThreshold"; "showLoadingSpinner": "showLoadingSpinner"; "debug": "debug"; "showSearchBar": "showSearchBar"; "stickySearchBar": "stickySearchBar"; "filter": "filter"; "readonly": "readonly"; "tabindex": "tabindex"; "items": "items"; }, { "clicked": "click"; "blurred": "blur"; "focused": "focus"; "dropButtonClick": "dropButtonClick"; "keydownEscape": "keydown.escape"; "keyupEnter": "keyup.enter"; }, never, ["[matError]", "[matAfter]", "[matPrefix]", "[matSuffix]"], false>;
|
|
125
139
|
}
|
|
@@ -4,6 +4,7 @@ import { MatAutocompleteField } from '../material.autocomplete';
|
|
|
4
4
|
import { Subscription } from 'rxjs';
|
|
5
5
|
import { LoadResult } from '../../../services/entity-service.class';
|
|
6
6
|
import { MatAutocompleteConfigHolder } from '../material.autocomplete.config';
|
|
7
|
+
import { IonModal } from '@ionic/angular';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
declare class EntityTestClass {
|
|
9
10
|
id: number;
|
|
@@ -22,6 +23,7 @@ export declare class AutocompleteTestPage implements OnInit, AfterViewInit {
|
|
|
22
23
|
memoryTimer: Subscription;
|
|
23
24
|
mode: 'mobile' | 'desktop' | 'memory' | 'temp';
|
|
24
25
|
farEntityField: MatAutocompleteField;
|
|
26
|
+
ionModal: IonModal;
|
|
25
27
|
constructor(formBuilder: UntypedFormBuilder);
|
|
26
28
|
ngOnInit(): void;
|
|
27
29
|
ngAfterViewInit(): void;
|