@sumaris-net/ngx-components 1.20.16 → 1.20.19
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 +634 -9
- 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 +12 -0
- package/esm2015/public_api.js +5 -2
- package/esm2015/src/app/core/form/editor.class.js +8 -7
- package/esm2015/src/app/core/form/entity-editor-modal.class.js +417 -0
- package/esm2015/src/app/core/services/platform.service.js +5 -5
- package/esm2015/src/app/shared/directives/resizable/resizable.component.js +54 -0
- package/esm2015/src/app/shared/directives/resizable/resizable.directive.js +34 -0
- package/esm2015/src/app/shared/directives/resizable/resizable.module.js +12 -0
- package/esm2015/src/app/shared/material/chips/testing/chips.test.js +1 -1
- package/fesm2015/sumaris-net.ngx-components.js +505 -13
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +4 -1
- package/src/app/core/form/editor.class.d.ts +2 -1
- package/src/app/core/form/entity-editor-modal.class.d.ts +118 -0
- package/src/app/shared/directives/resizable/resizable.component.d.ts +18 -0
- package/src/app/shared/directives/resizable/resizable.directive.d.ts +9 -0
- package/src/app/shared/directives/resizable/resizable.module.d.ts +2 -0
- package/src/app/shared/material/chips/testing/chips.test.d.ts +2 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -50,6 +50,9 @@ export * from './src/app/shared/directives/autofocus.directive';
|
|
|
50
50
|
export * from './src/app/shared/directives/ng-var.directive';
|
|
51
51
|
export * from './src/app/shared/directives/drag-and-drop.directive';
|
|
52
52
|
export * from './src/app/shared/directives/autotitle.directive';
|
|
53
|
+
export * from './src/app/shared/directives/resizable/resizable.directive';
|
|
54
|
+
export * from './src/app/shared/directives/resizable/resizable.component';
|
|
55
|
+
export * from './src/app/shared/directives/resizable/resizable.module';
|
|
53
56
|
export * from './src/app/shared/pipes/pipes.module';
|
|
54
57
|
export * from './src/app/shared/pipes/date-format.pipe';
|
|
55
58
|
export * from './src/app/shared/pipes/date-from-now.pipe';
|
|
@@ -132,6 +135,7 @@ export * from './src/app/core/services/storage/entity-store.class';
|
|
|
132
135
|
export * from './src/app/core/services/validator/base.validator.class';
|
|
133
136
|
export * from './src/app/core/form/editor.class';
|
|
134
137
|
export * from './src/app/core/form/entity-editor.class';
|
|
138
|
+
export * from './src/app/core/form/entity-editor-modal.class';
|
|
135
139
|
export * from './src/app/core/form/entity-metadata.component';
|
|
136
140
|
export * from './src/app/core/form/form.class';
|
|
137
141
|
export * from './src/app/core/form/form.utils';
|
|
@@ -192,4 +196,3 @@ export * from './src/app/core/table/testing/table.testing.module';
|
|
|
192
196
|
export * from './src/app/core/table/testing/table.testing';
|
|
193
197
|
export * from './src/app/core/text-popover/testing/text-popover.testing.module';
|
|
194
198
|
export * from './src/app/core/text-popover/testing/text-popover.testing';
|
|
195
|
-
export { UriUtils } from './src/app/shared/file/uri.utils';
|
|
@@ -168,7 +168,8 @@ export declare abstract class AppTabEditor<T = any, ID = number, O = any> extend
|
|
|
168
168
|
get selectedTabIndex(): number;
|
|
169
169
|
readonly selectedTabIndexChange: EventEmitter<number>;
|
|
170
170
|
tabGroup: MatTabGroup;
|
|
171
|
-
protected constructor(route: ActivatedRoute,
|
|
171
|
+
protected constructor(route: ActivatedRoute, // Modal editor give 'null'
|
|
172
|
+
router: Router, alertCtrl: AlertController, translate: TranslateService, options?: AppTabEditorOptions);
|
|
172
173
|
ngOnInit(): void;
|
|
173
174
|
ngOnDestroy(): void;
|
|
174
175
|
setSelectedTabIndex(value: number, opts?: {
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ModalController } from '@ionic/angular';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import { LocalSettingsService } from '../services/local-settings.service';
|
|
5
|
+
import { Entity } from '../services/model/entity.model';
|
|
6
|
+
import { UsageMode } from '../services/model/settings.model';
|
|
7
|
+
import { FormGroup } from '@angular/forms';
|
|
8
|
+
import { AppTabEditor, AppTabEditorOptions } from './editor.class';
|
|
9
|
+
import { DateFormatPipe } from '../../shared/pipes/date-format.pipe';
|
|
10
|
+
import { Environment } from '../../../environments/environment.class';
|
|
11
|
+
import { WaitForOptions } from '../../shared/observables';
|
|
12
|
+
import { FormErrorTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
13
|
+
import { AppErrorWithDetails } from './entity-editor.class';
|
|
14
|
+
export interface IEntityEditorModalOptions<T extends Entity<T, ID> = Entity<any, any>, ID = number> {
|
|
15
|
+
usageMode: UsageMode;
|
|
16
|
+
data: T;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
onAfterModalInit?: <M extends AppEntityEditorModal<T, ID>>(modal: M) => void | Promise<void>;
|
|
19
|
+
onDelete?: (event: UIEvent, data: T) => Promise<boolean>;
|
|
20
|
+
mobile: boolean;
|
|
21
|
+
i18nSuffix?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class AppEntityEditorModalOptions extends AppTabEditorOptions {
|
|
24
|
+
i18nPrefix?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare abstract class AppEntityEditorModal<T extends Entity<T, ID>, ID = number, O extends AppEntityEditorModalOptions = AppEntityEditorModalOptions> extends AppTabEditor<T, ID> implements OnInit, OnDestroy, AfterViewInit, IEntityEditorModalOptions<T, ID> {
|
|
27
|
+
protected dataType: new () => T;
|
|
28
|
+
private _usageMode;
|
|
29
|
+
protected _logPrefix: any;
|
|
30
|
+
protected _isNewData: boolean;
|
|
31
|
+
protected readonly dateFormat: DateFormatPipe;
|
|
32
|
+
protected readonly cd: ChangeDetectorRef;
|
|
33
|
+
protected readonly settings: LocalSettingsService;
|
|
34
|
+
protected readonly modalCtrl: ModalController;
|
|
35
|
+
protected errorTranslator: FormErrorTranslator;
|
|
36
|
+
protected readonly environement: Environment;
|
|
37
|
+
saving: boolean;
|
|
38
|
+
$title: Subject<string>;
|
|
39
|
+
data: T;
|
|
40
|
+
mobile: boolean;
|
|
41
|
+
usageMode: UsageMode;
|
|
42
|
+
onAfterModalInit: <M extends AppEntityEditorModal<T, ID>>(modal: M) => void | Promise<void>;
|
|
43
|
+
onDelete: (event: UIEvent, data: T) => Promise<boolean>;
|
|
44
|
+
i18nSuffix: string;
|
|
45
|
+
set isNewData(value: boolean);
|
|
46
|
+
get isNewData(): boolean;
|
|
47
|
+
set disabled(value: boolean);
|
|
48
|
+
get disabled(): boolean;
|
|
49
|
+
get isOnFieldMode(): boolean;
|
|
50
|
+
markAsSaving(opts?: {
|
|
51
|
+
emitEvent?: boolean;
|
|
52
|
+
}): void;
|
|
53
|
+
markAsSaved(opts?: {
|
|
54
|
+
emitEvent?: boolean;
|
|
55
|
+
}): void;
|
|
56
|
+
protected constructor(injector: Injector, dataType: new () => T, options?: O);
|
|
57
|
+
ngOnInit(): Promise<void>;
|
|
58
|
+
ngAfterViewInit(): void;
|
|
59
|
+
ngOnDestroy(): void;
|
|
60
|
+
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
61
|
+
load(): Promise<void>;
|
|
62
|
+
reload(): Promise<void>;
|
|
63
|
+
unload(opts?: {
|
|
64
|
+
emitEvent?: boolean;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
updateView(data: T | null, opts?: {
|
|
67
|
+
emitEvent?: boolean;
|
|
68
|
+
openTabIndex?: number;
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Enable or disable state
|
|
72
|
+
*/
|
|
73
|
+
updateViewState(data: T, opts?: {
|
|
74
|
+
onlySelf?: boolean;
|
|
75
|
+
emitEvent?: boolean;
|
|
76
|
+
}): void;
|
|
77
|
+
saveAndClose(event?: Event): Promise<boolean>;
|
|
78
|
+
close(event: UIEvent): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Save the editor, by calling the dataService.save().
|
|
81
|
+
* Ensure that editor if valid. If not, display an error
|
|
82
|
+
* @param event
|
|
83
|
+
* @param opts
|
|
84
|
+
*/
|
|
85
|
+
save(event?: Event, opts?: any): Promise<boolean>;
|
|
86
|
+
/**
|
|
87
|
+
* Save data (if dirty and valid), and return it. Otherwise, return nil value.
|
|
88
|
+
*/
|
|
89
|
+
saveAndGetDataIfValid(): Promise<T | undefined>;
|
|
90
|
+
delete(event?: UIEvent): Promise<boolean>;
|
|
91
|
+
resetError(opts?: {
|
|
92
|
+
emitEvent?: boolean;
|
|
93
|
+
}): void;
|
|
94
|
+
setError(err: string | AppErrorWithDetails, opts?: {
|
|
95
|
+
emitEvent?: boolean;
|
|
96
|
+
detailsCssClass?: string;
|
|
97
|
+
}): void;
|
|
98
|
+
protected abstract registerForms(): any;
|
|
99
|
+
protected abstract computeTitle(data: T): Promise<string>;
|
|
100
|
+
protected abstract setValue(data: T): Promise<void> | void;
|
|
101
|
+
protected abstract get form(): FormGroup;
|
|
102
|
+
protected abstract getFirstInvalidTabIndex(): number;
|
|
103
|
+
protected waitWhilePending(opts?: WaitForOptions): Promise<void>;
|
|
104
|
+
protected getValue(): Promise<T>;
|
|
105
|
+
protected getJsonValueToSave(): Promise<any>;
|
|
106
|
+
/**
|
|
107
|
+
* Compute the title
|
|
108
|
+
*
|
|
109
|
+
* @param data
|
|
110
|
+
*/
|
|
111
|
+
protected updateTitle(data?: T): Promise<void>;
|
|
112
|
+
protected scrollToTop(duration?: number): Promise<void>;
|
|
113
|
+
protected markForCheck(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Open the first tab that is invalid
|
|
116
|
+
*/
|
|
117
|
+
private openFirstInvalidTab;
|
|
118
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { MatColumnDef } from '@angular/material/table';
|
|
3
|
+
export declare class ResizableComponent {
|
|
4
|
+
readonly columnDef: MatColumnDef;
|
|
5
|
+
resizable: boolean;
|
|
6
|
+
sizeChanged: EventEmitter<number>;
|
|
7
|
+
width: string | null;
|
|
8
|
+
minWidth: string | null;
|
|
9
|
+
maxWidth: string | null;
|
|
10
|
+
private debug;
|
|
11
|
+
constructor(columnDef: MatColumnDef);
|
|
12
|
+
onResize(width: number, opts?: {
|
|
13
|
+
emitEvent: boolean;
|
|
14
|
+
}): void;
|
|
15
|
+
onFit(opts?: {
|
|
16
|
+
emitEvent: boolean;
|
|
17
|
+
}): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export declare class ResizableDirective {
|
|
4
|
+
private readonly document;
|
|
5
|
+
private readonly elementRef;
|
|
6
|
+
readonly resizable: Observable<number>;
|
|
7
|
+
readonly fit: Observable<MouseEvent[]>;
|
|
8
|
+
constructor(document: any, elementRef: ElementRef<HTMLElement>);
|
|
9
|
+
}
|
|
@@ -2,6 +2,7 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
3
|
import { MatAutocompleteConfigHolder } from '../../autocomplete/material.autocomplete';
|
|
4
4
|
import { LoadResult } from '../../../services/entity-service.class';
|
|
5
|
+
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
|
5
6
|
declare class EntityTestClass {
|
|
6
7
|
id: number;
|
|
7
8
|
label: string;
|
|
@@ -13,7 +14,7 @@ export declare class ChipsTestPage implements OnInit {
|
|
|
13
14
|
private _$items;
|
|
14
15
|
form: FormGroup;
|
|
15
16
|
autocompleteFields: MatAutocompleteConfigHolder;
|
|
16
|
-
appearance:
|
|
17
|
+
appearance: MatFormFieldAppearance;
|
|
17
18
|
constructor(formBuilder: FormBuilder);
|
|
18
19
|
ngOnInit(): void;
|
|
19
20
|
loadData(): Promise<void>;
|