@sumaris-net/ngx-components 1.17.1 → 1.18.0-rc1
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 +570 -492
- 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 +5 -0
- package/esm2015/src/app/shared/hotkeys/hotkeys.service.js +7 -11
- package/esm2015/src/app/shared/inputs.js +1 -1
- package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +102 -61
- package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +20 -5
- package/esm2015/src/app/shared/material/chips/material.chips.js +26 -23
- package/esm2015/src/app/shared/material/material.module.js +1 -1
- package/fesm2015/sumaris-net.ngx-components.js +541 -472
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/hotkeys/hotkeys.service.d.ts +2 -3
- package/src/app/shared/material/autocomplete/material.autocomplete.d.ts +8 -3
- package/src/app/shared/material/autocomplete/testing/autocomplete.test.d.ts +5 -3
- package/src/theme/_ngx-components.scss +67 -20
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventManager } from '@angular/platform-browser';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { MatDialog } from '@angular/material/dialog';
|
|
4
|
-
import { ModalController
|
|
4
|
+
import { ModalController } from '@ionic/angular';
|
|
5
5
|
interface Options {
|
|
6
6
|
element: any;
|
|
7
7
|
elementName: string;
|
|
@@ -14,11 +14,10 @@ export declare class Hotkeys {
|
|
|
14
14
|
private dialog;
|
|
15
15
|
private document;
|
|
16
16
|
private modalController;
|
|
17
|
-
private popoverController;
|
|
18
17
|
private _debug;
|
|
19
18
|
private _hotkeys;
|
|
20
19
|
private _defaults;
|
|
21
|
-
constructor(eventManager: EventManager, dialog: MatDialog, document: any, modalController: ModalController
|
|
20
|
+
constructor(eventManager: EventManager, dialog: MatDialog, document: any, modalController: ModalController);
|
|
22
21
|
addShortcut(options: Partial<Options>): Observable<UIEvent>;
|
|
23
22
|
openHelpModal(): void;
|
|
24
23
|
}
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
|
+
import { IonSearchbar } from '@ionic/angular';
|
|
10
11
|
export declare interface MatAutocompleteFieldConfig<T = any, F = any> {
|
|
11
12
|
attributes: string[];
|
|
12
13
|
suggestFn?: (value: any, options?: any) => Promise<T[] | LoadResult<T>>;
|
|
@@ -14,6 +15,7 @@ export declare interface MatAutocompleteFieldConfig<T = any, F = any> {
|
|
|
14
15
|
items?: Observable<T[]> | T[];
|
|
15
16
|
columnSizes?: (number | 'auto' | undefined)[];
|
|
16
17
|
columnNames?: (string | undefined)[];
|
|
18
|
+
multiple?: boolean;
|
|
17
19
|
displayWith?: DisplayFn;
|
|
18
20
|
equals?: EqualsFn;
|
|
19
21
|
showAllOnFocus?: boolean;
|
|
@@ -75,6 +77,8 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
75
77
|
suggestLengthThreshold: number;
|
|
76
78
|
showLoadingSpinner: boolean;
|
|
77
79
|
debug: boolean;
|
|
80
|
+
showSearchBar: boolean;
|
|
81
|
+
stickySearchBar: boolean;
|
|
78
82
|
clicked: EventEmitter<MouseEvent>;
|
|
79
83
|
blurred: EventEmitter<FocusEvent>;
|
|
80
84
|
focused: EventEmitter<FocusEvent>;
|
|
@@ -82,15 +86,14 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
82
86
|
keydownEscape: EventEmitter<any>;
|
|
83
87
|
keyupEnter: EventEmitter<any>;
|
|
84
88
|
matSelect: MatSelect;
|
|
89
|
+
ionSearchbar: IonSearchbar;
|
|
85
90
|
matInputText: ElementRef;
|
|
86
91
|
autocomplete: MatAutocomplete;
|
|
87
92
|
autocompleteTrigger: MatAutocompleteTrigger;
|
|
88
93
|
_readonly: boolean;
|
|
89
94
|
_tabindex: number;
|
|
90
|
-
matSelectItems$: Observable<any[]>;
|
|
91
95
|
$inputItems: BehaviorSubject<any[]>;
|
|
92
96
|
$filteredItems: BehaviorSubject<any[]>;
|
|
93
|
-
searchable: boolean;
|
|
94
97
|
displayValue: string;
|
|
95
98
|
_moreItemsCount: number;
|
|
96
99
|
_fetchMore$: EventEmitter<Event>;
|
|
@@ -117,6 +120,7 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
117
120
|
get disabled(): boolean;
|
|
118
121
|
get enabled(): boolean;
|
|
119
122
|
get loading(): boolean;
|
|
123
|
+
get desktop(): boolean;
|
|
120
124
|
ngOnInit(): void;
|
|
121
125
|
ngOnDestroy(): void;
|
|
122
126
|
/**
|
|
@@ -130,9 +134,10 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
130
134
|
focus(): void;
|
|
131
135
|
filterInputTextFocusEvent(event: FocusEvent): boolean;
|
|
132
136
|
filterInputTextBlurEvent(event: FocusEvent): boolean;
|
|
137
|
+
ionSearchBarChanged(event: CustomEvent<InputEvent>): void;
|
|
138
|
+
ionSearchBarClear(event: UIEvent): void;
|
|
133
139
|
filterMatSelectFocusEvent(event: FocusEvent): void;
|
|
134
140
|
filterMatSelectBlurEvent(event: FocusEvent): boolean;
|
|
135
|
-
toggleSearch(event: UIEvent): void;
|
|
136
141
|
clearValue(event: UIEvent): void;
|
|
137
142
|
_initAutocompleteInfiniteScroll(threshold?: string): void;
|
|
138
143
|
_initMatSelectInfiniteScroll(threshold?: string): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { OnInit } from '@angular/core';
|
|
3
|
-
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
4
|
-
import { MatAutocompleteConfigHolder } from '../material.autocomplete';
|
|
3
|
+
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
|
4
|
+
import { MatAutocompleteConfigHolder, MatAutocompleteField } from '../material.autocomplete';
|
|
5
5
|
import { LoadResult } from '../../../services/entity-service.class';
|
|
6
6
|
import Timer = NodeJS.Timer;
|
|
7
7
|
declare class EntityTestClass {
|
|
@@ -20,18 +20,20 @@ export declare class AutocompleteTestPage implements OnInit {
|
|
|
20
20
|
memoryAutocompleteFieldName: string;
|
|
21
21
|
memoryTimer: Timer;
|
|
22
22
|
mode: 'mobile' | 'desktop' | 'memory' | 'temp';
|
|
23
|
+
entitiesArray: FormArray;
|
|
23
24
|
constructor(formBuilder: FormBuilder);
|
|
24
25
|
ngOnInit(): void;
|
|
25
26
|
loadData(): Promise<void>;
|
|
26
27
|
loadItems(): Promise<void>;
|
|
27
28
|
entityToString(item: any): string;
|
|
29
|
+
entitiesToString(items: any[]): string;
|
|
28
30
|
suggest(value: any, filter?: any): Promise<LoadResult<EntityTestClass>>;
|
|
29
31
|
doSubmit(event: any): void;
|
|
30
32
|
equals(o1: EntityTestClass, o2: EntityTestClass): boolean;
|
|
31
33
|
toggleMode(value: any): void;
|
|
32
34
|
startMemoryTimer(): void;
|
|
33
35
|
stopMemoryTimer(): void;
|
|
34
|
-
updateFilter(fieldName: string): void;
|
|
36
|
+
updateFilter(autocompleteField: MatAutocompleteField, fieldName: string): void;
|
|
35
37
|
stringify(value: any): string;
|
|
36
38
|
}
|
|
37
39
|
export {};
|
|
@@ -274,7 +274,7 @@ mat-option {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
mat-option:not(:last-
|
|
277
|
+
mat-option:not(:last-of-type) {
|
|
278
278
|
border-bottom: 1px solid #{$app-select-option-border-color};
|
|
279
279
|
}
|
|
280
280
|
|
|
@@ -322,31 +322,77 @@ mat-option:not(:last-child) {
|
|
|
322
322
|
left: 0;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
+
.mat-select-panel,
|
|
326
|
+
.mat-autocomplete-panel {
|
|
327
|
+
/* when multiple selection enable */
|
|
328
|
+
mat-pseudo-checkbox {
|
|
329
|
+
margin-left: 8px;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
325
332
|
.mat-select-panel,
|
|
326
333
|
.mat-menu-panel,
|
|
327
334
|
.mat-autocomplete-panel {
|
|
328
335
|
|
|
336
|
+
/* Avoid bad display, when opening panel for the first time */
|
|
337
|
+
&.ng-trigger-transformPanel {
|
|
338
|
+
ion-searchbar.mat-select-header,
|
|
339
|
+
ion-searchbar.mat-autocomplete-header {
|
|
340
|
+
visibility: visible;
|
|
341
|
+
display: flex;
|
|
342
|
+
opacity: 1;
|
|
343
|
+
transition: opacity 0.3s ease-in-out;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
ion-searchbar.mat-select-header,
|
|
348
|
+
ion-searchbar.mat-autocomplete-header
|
|
349
|
+
{
|
|
350
|
+
visibility: hidden;
|
|
351
|
+
display: none;
|
|
352
|
+
opacity: 0;
|
|
353
|
+
|
|
354
|
+
height: 58px;
|
|
355
|
+
background-color: var(--ion-color-secondary100) !important;
|
|
356
|
+
|
|
357
|
+
&.ion-searchbar-sticky {
|
|
358
|
+
z-index: 1001;
|
|
359
|
+
/* Set header as sticky*/
|
|
360
|
+
position: -webkit-sticky;
|
|
361
|
+
position: sticky;
|
|
362
|
+
top: 0;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
329
366
|
ion-row.mat-select-header,
|
|
330
367
|
ion-row.mat-menu-header,
|
|
331
368
|
ion-row.mat-autocomplete-header {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
369
|
+
&.multiple {
|
|
370
|
+
/* Offset due to mat-pseudo-checkbox */
|
|
371
|
+
padding-left: 32px;
|
|
372
|
+
}
|
|
373
|
+
&.column {
|
|
374
|
+
/* Set header as sticky*/
|
|
375
|
+
position: -webkit-sticky;
|
|
376
|
+
position: sticky;
|
|
377
|
+
top: 0;
|
|
378
|
+
z-index: 1001;
|
|
379
|
+
background-color: var(--ion-color-secondary);
|
|
380
|
+
border-bottom: 1px solid #{$app-select-option-border-color};
|
|
381
|
+
color: var(--ion-color-secondary-contrast);
|
|
382
|
+
line-height: 20px;
|
|
383
|
+
@include font-size(12px);
|
|
384
|
+
font-weight: 500;
|
|
385
|
+
height: 20px;
|
|
386
|
+
ion-col {
|
|
387
|
+
white-space: nowrap;
|
|
388
|
+
text-overflow: ellipsis;
|
|
389
|
+
}
|
|
390
|
+
&.ion-searchbar-sticky {
|
|
391
|
+
/* offset because of the searchbar height */
|
|
392
|
+
top: 58px;
|
|
393
|
+
}
|
|
349
394
|
}
|
|
395
|
+
|
|
350
396
|
}
|
|
351
397
|
|
|
352
398
|
ion-row.mat-select-footer,
|
|
@@ -357,7 +403,7 @@ mat-option:not(:last-child) {
|
|
|
357
403
|
position: sticky;
|
|
358
404
|
bottom: 0;
|
|
359
405
|
z-index: 1001;
|
|
360
|
-
|
|
406
|
+
border-top: 1px solid #{$app-select-option-border-color};
|
|
361
407
|
background-color: whitesmoke;
|
|
362
408
|
color: var(--ion-color-medium);
|
|
363
409
|
@include font-size(12px);
|
|
@@ -375,8 +421,9 @@ mat-option:not(:last-child) {
|
|
|
375
421
|
--ion-grid-column-padding: 0;
|
|
376
422
|
|
|
377
423
|
ion-col {
|
|
424
|
+
--ion-padding-start: 8px;
|
|
378
425
|
padding: 0 !important;
|
|
379
|
-
padding-left:
|
|
426
|
+
padding-left: var(--ion-padding-start) !important;
|
|
380
427
|
text-overflow: ellipsis;
|
|
381
428
|
overflow: hidden;
|
|
382
429
|
}
|