@sumaris-net/ngx-components 2.4.0 → 2.4.1
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 +15 -1
- package/esm2020/public_api.mjs +2 -1
- package/esm2020/src/app/core/form/entity/entity-editor.class.mjs +2 -2
- package/esm2020/src/app/core/form/form.utils.mjs +11 -1
- package/esm2020/src/app/core/form/text-popover/text-form.component.mjs +3 -3
- package/esm2020/src/app/core/services/local-settings.service.mjs +1 -1
- package/esm2020/src/app/core/services/network.service.mjs +1 -1
- package/esm2020/src/app/core/services/storage/entity-store.class.mjs +1 -1
- package/esm2020/src/app/core/table/async-table.class.mjs +9 -5
- package/esm2020/src/app/core/table/entities-table-datasource.class.mjs +1 -1
- package/esm2020/src/app/core/table/table.class.mjs +3 -2
- package/esm2020/src/app/shared/dates.mjs +5 -3
- package/esm2020/src/app/shared/events.mjs +1 -1
- package/esm2020/src/app/shared/material/datetime/material.date.mjs +16 -15
- package/esm2020/src/app/shared/material/datetime/material.dateshort.mjs +225 -167
- package/esm2020/src/app/shared/material/datetime/material.datetime.mjs +10 -7
- package/esm2020/src/app/shared/material/datetime/testing/mat-dateshort.test.mjs +103 -0
- package/esm2020/src/app/shared/material/material.testing.module.mjs +12 -1
- package/esm2020/src/app/shared/pipes/date-format.pipe.mjs +1 -1
- package/esm2020/src/app/shared/pipes/pipes.module.mjs +1 -1
- package/esm2020/src/app/social/user-event/user-event.service.mjs +1 -1
- package/fesm2015/sumaris-net.ngx-components.mjs +463 -289
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +463 -290
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/src/app/core/form/entity/entity-editor.class.d.ts +1 -1
- package/src/app/core/form/form.utils.d.ts +1 -1
- package/src/app/shared/dates.d.ts +1 -1
- package/src/app/shared/events.d.ts +2 -2
- package/src/app/shared/material/datetime/material.date.d.ts +2 -2
- package/src/app/shared/material/datetime/material.dateshort.d.ts +40 -32
- package/src/app/shared/material/datetime/testing/mat-dateshort.test.d.ts +29 -0
- package/src/app/shared/material/material.testing.module.d.ts +16 -15
- package/src/app/shared/pipes/date-format.pipe.d.ts +1 -1
- package/src/theme/_ngx-components.scss +15 -9
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -233,6 +233,7 @@ export * from './src/app/shared/material/latlong/testing/latlong.test';
|
|
|
233
233
|
export * from './src/app/shared/material/swipe/testing/swipe.test';
|
|
234
234
|
export * from './src/app/shared/material/datetime/testing/mat-date-time.test';
|
|
235
235
|
export * from './src/app/shared/material/datetime/testing/mat-date.test';
|
|
236
|
+
export * from './src/app/shared/material/datetime/testing/mat-dateshort.test';
|
|
236
237
|
export * from './src/app/shared/material/chips/testing/chips.test';
|
|
237
238
|
export * from './src/app/shared/material/numpad/testing/numpad.test';
|
|
238
239
|
export * from './src/app/shared/testing/observable.test';
|
|
@@ -259,7 +259,7 @@ export declare class AppFormArray<T extends Entity<T>, C extends AbstractControl
|
|
|
259
259
|
onlySelf?: boolean;
|
|
260
260
|
emitEvent?: boolean;
|
|
261
261
|
}): void;
|
|
262
|
-
patchValue(values: any[], options?: {
|
|
262
|
+
patchValue(values: any[] | null | undefined, options?: {
|
|
263
263
|
onlySelf?: boolean;
|
|
264
264
|
emitEvent?: boolean;
|
|
265
265
|
}): void;
|
|
@@ -10,7 +10,7 @@ export declare class DateUtils {
|
|
|
10
10
|
static fromDateISOString: typeof fromDateISOString;
|
|
11
11
|
static toDuration: typeof toDuration;
|
|
12
12
|
static min(date1: Moment, date2: Moment): Moment;
|
|
13
|
-
static max(date1: Moment, date2: Moment): Moment;
|
|
13
|
+
static max(date1: Moment | string, date2: Moment | string): Moment;
|
|
14
14
|
static equals(date1: Moment | string, date2: Moment | string): boolean;
|
|
15
15
|
static isSame(date1: Moment | string, date2: Moment | string, granularity?: unitOfTime.StartOf): boolean;
|
|
16
16
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
export interface PromiseEventPayload<R = any> {
|
|
4
|
-
success: (R
|
|
5
|
-
error: (
|
|
4
|
+
success: (value?: R) => void;
|
|
5
|
+
error: (reason?: any) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare type PromiseEvent<R = any, D = void> = CustomEvent<PromiseEventPayload<R> & D>;
|
|
8
8
|
export declare function createPromiseEventEmitter<R = any, D = void>(): EventEmitter<PromiseEvent<R, D>>;
|
|
@@ -15,7 +15,7 @@ export declare class MatDate implements OnInit, AfterViewInit, OnDestroy, Contro
|
|
|
15
15
|
private formGroupDir;
|
|
16
16
|
private _onChangeCallback;
|
|
17
17
|
private _onTouchedCallback;
|
|
18
|
-
private _subscription;
|
|
18
|
+
private readonly _subscription;
|
|
19
19
|
private _writing;
|
|
20
20
|
private _disabling;
|
|
21
21
|
private _tabindex;
|
|
@@ -70,5 +70,5 @@ export declare class MatDate implements OnInit, AfterViewInit, OnDestroy, Contro
|
|
|
70
70
|
private markAsDirty;
|
|
71
71
|
private markForCheck;
|
|
72
72
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatDate, [null, null, null, null, { optional: true; }]>;
|
|
73
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MatDate, "mat-date-field", never, { "mobile": "mobile"; "formControl": "formControl"; "formControlName": "formControlName"; "placeholder": "placeholder"; "floatLabel": "floatLabel"; "appearance": "appearance"; "required": "required"; "compact": "compact"; "placeholderChar": "placeholderChar"; "autofocus": "autofocus"; "startDate": "startDate"; "clearable": "clearable"; "timezone": "timezone"; "datePickerFilter": "datePickerFilter"; "readonly": "readonly"; "tabindex": "tabindex"; }, {}, never, ["mat-error", "mat-hint", "[matPrefix]"], false>;
|
|
73
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatDate, "mat-date-field", never, { "mobile": "mobile"; "formControl": "formControl"; "formControlName": "formControlName"; "placeholder": "placeholder"; "floatLabel": "floatLabel"; "appearance": "appearance"; "required": "required"; "compact": "compact"; "placeholderChar": "placeholderChar"; "autofocus": "autofocus"; "startDate": "startDate"; "clearable": "clearable"; "timezone": "timezone"; "datePickerFilter": "datePickerFilter"; "readonly": "readonly"; "tabindex": "tabindex"; }, {}, never, ["mat-error", "mat-hint", "[matPrefix]", "[matSuffix]"], false>;
|
|
74
74
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ChangeDetectorRef, ElementRef, OnInit
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormGroupDirective, UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
4
|
import { Moment } from 'moment/moment';
|
|
5
5
|
import { InputElement } from '../../inputs';
|
|
6
6
|
import { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';
|
|
7
|
-
import { MatDatepicker } from '@angular/material/datepicker';
|
|
8
|
-
import {
|
|
7
|
+
import { DateFilterFn, MatDatepicker, MatDatepickerInputEvent } from '@angular/material/datepicker';
|
|
8
|
+
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
export declare class MatDateShort implements OnInit, ControlValueAccessor, InputElement {
|
|
11
11
|
private dateAdapter;
|
|
@@ -15,53 +15,61 @@ export declare class MatDateShort implements OnInit, ControlValueAccessor, Input
|
|
|
15
15
|
private formGroupDir;
|
|
16
16
|
private _onChangeCallback;
|
|
17
17
|
private _onTouchedCallback;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_value: Moment;
|
|
18
|
+
private readonly _subscription;
|
|
19
|
+
private _writing;
|
|
20
|
+
private _disabling;
|
|
21
|
+
private _tabindex;
|
|
22
|
+
private _readonly;
|
|
23
|
+
textControl: UntypedFormControl;
|
|
24
|
+
datePattern: string;
|
|
26
25
|
locale: string;
|
|
27
|
-
|
|
26
|
+
readonly mask: RegExp[];
|
|
28
27
|
mobile: boolean;
|
|
29
|
-
disabled: boolean;
|
|
30
28
|
formControl: UntypedFormControl;
|
|
31
29
|
formControlName: string;
|
|
32
30
|
placeholder: string;
|
|
33
31
|
floatLabel: FloatLabelType;
|
|
34
32
|
appearance: MatFormFieldAppearance;
|
|
35
|
-
readonly: boolean;
|
|
36
33
|
required: boolean;
|
|
37
34
|
compact: boolean;
|
|
38
35
|
placeholderChar: string;
|
|
36
|
+
autofocus: boolean;
|
|
37
|
+
startDate: Moment | null;
|
|
38
|
+
clearable: boolean;
|
|
39
|
+
datePickerFilter: DateFilterFn<Moment>;
|
|
40
|
+
set readonly(value: boolean);
|
|
41
|
+
get readonly(): boolean;
|
|
39
42
|
set tabindex(value: number);
|
|
40
43
|
get tabindex(): number;
|
|
41
|
-
startDate: Date;
|
|
42
|
-
clearable: boolean;
|
|
43
|
-
datePicker1: MatDatepicker<Moment>;
|
|
44
|
-
datePicker2: MatDatepicker<Moment>;
|
|
45
|
-
matInputs: QueryList<ElementRef>;
|
|
46
44
|
get value(): any;
|
|
47
|
-
|
|
45
|
+
get disabled(): boolean;
|
|
46
|
+
datePicker: MatDatepicker<Moment>;
|
|
47
|
+
_matInput: ElementRef;
|
|
48
|
+
constructor(dateAdapter: MomentDateAdapter, translate: TranslateService, formBuilder: UntypedFormBuilder, cd: ChangeDetectorRef, formGroupDir: FormGroupDirective);
|
|
48
49
|
ngOnInit(): void;
|
|
49
|
-
|
|
50
|
+
ngAfterViewInit(): void;
|
|
51
|
+
ngOnDestroy(): void;
|
|
52
|
+
writeValue(value: any): void;
|
|
50
53
|
registerOnChange(fn: any): void;
|
|
51
54
|
registerOnTouched(fn: any): void;
|
|
52
55
|
setDisabledState(isDisabled: boolean): void;
|
|
53
|
-
|
|
56
|
+
openDatePicker(): void;
|
|
57
|
+
focus(): void;
|
|
58
|
+
clear(): void;
|
|
59
|
+
protected _onDatePickerChange(event: MatDatepickerInputEvent<Moment>): void;
|
|
60
|
+
protected _checkIfTouched(opts?: {
|
|
61
|
+
emitEvent?: boolean;
|
|
62
|
+
}): void;
|
|
63
|
+
protected _openDatePickerIfMobile(event: Event): Promise<void>;
|
|
64
|
+
protected _closeDatePicker(eventData: any): void;
|
|
65
|
+
protected _preventEvent(event: Event): void;
|
|
54
66
|
private updatePattern;
|
|
55
67
|
private onFormChange;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
focus(): void;
|
|
62
|
-
protected waitKeyboardHide(waitKeyboardDelay: boolean): Promise<void>;
|
|
63
|
-
protected updateTabIndex(): void;
|
|
64
|
-
protected markForCheck(): void;
|
|
68
|
+
private waitKeyboardHide;
|
|
69
|
+
private updateTabIndex;
|
|
70
|
+
private markAsTouched;
|
|
71
|
+
private markAsDirty;
|
|
72
|
+
private markForCheck;
|
|
65
73
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatDateShort, [null, null, null, null, { optional: true; }]>;
|
|
66
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MatDateShort, "mat-date-short-field", never, { "mobile": "mobile"; "
|
|
74
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatDateShort, "mat-date-short-field", never, { "mobile": "mobile"; "formControl": "formControl"; "formControlName": "formControlName"; "placeholder": "placeholder"; "floatLabel": "floatLabel"; "appearance": "appearance"; "required": "required"; "compact": "compact"; "placeholderChar": "placeholderChar"; "autofocus": "autofocus"; "startDate": "startDate"; "clearable": "clearable"; "datePickerFilter": "datePickerFilter"; "readonly": "readonly"; "tabindex": "tabindex"; }, {}, never, ["mat-error", "mat-hint", "[matPrefix]", "[matSuffix]"], false>;
|
|
67
75
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ChangeDetectorRef, OnInit } from '@angular/core';
|
|
2
|
+
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
3
|
+
import 'moment-timezone';
|
|
4
|
+
import { Subscription } from 'rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DateShortTestPage implements OnInit {
|
|
7
|
+
protected formBuilder: UntypedFormBuilder;
|
|
8
|
+
protected cd: ChangeDetectorRef;
|
|
9
|
+
showLogPanel: boolean;
|
|
10
|
+
logContent: string;
|
|
11
|
+
memoryHide: boolean;
|
|
12
|
+
memoryMobile: boolean;
|
|
13
|
+
memoryTimer: Subscription;
|
|
14
|
+
form: UntypedFormGroup;
|
|
15
|
+
constructor(formBuilder: UntypedFormBuilder, cd: ChangeDetectorRef);
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
loadData(): Promise<void>;
|
|
18
|
+
doSubmit(event: any): void;
|
|
19
|
+
log(message: string): void;
|
|
20
|
+
clearLogPanel(): void;
|
|
21
|
+
startMemoryTimer(): void;
|
|
22
|
+
stopMemoryTimer(): void;
|
|
23
|
+
stringify: {
|
|
24
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
25
|
+
(value: any, replacer?: (string | number)[], space?: string | number): string;
|
|
26
|
+
};
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DateShortTestPage, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DateShortTestPage, "app-data-short-test", never, {}, {}, never, never, false>;
|
|
29
|
+
}
|
|
@@ -2,23 +2,24 @@ import { TestingPage } from '../testing/tests.page';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "./datetime/testing/mat-date-time.test";
|
|
4
4
|
import * as i2 from "./datetime/testing/mat-date.test";
|
|
5
|
-
import * as i3 from "./
|
|
6
|
-
import * as i4 from "./
|
|
7
|
-
import * as i5 from "./
|
|
8
|
-
import * as i6 from "./
|
|
9
|
-
import * as i7 from "./
|
|
10
|
-
import * as i8 from "./
|
|
11
|
-
import * as i9 from "
|
|
12
|
-
import * as i10 from "
|
|
13
|
-
import * as i11 from "@
|
|
14
|
-
import * as i12 from "@angular
|
|
15
|
-
import * as i13 from "
|
|
16
|
-
import * as i14 from "
|
|
17
|
-
import * as i15 from "@
|
|
18
|
-
import * as i16 from "
|
|
5
|
+
import * as i3 from "./datetime/testing/mat-dateshort.test";
|
|
6
|
+
import * as i4 from "./autocomplete/testing/autocomplete.test";
|
|
7
|
+
import * as i5 from "./latlong/testing/latlong.test";
|
|
8
|
+
import * as i6 from "./numpad/testing/numpad.test";
|
|
9
|
+
import * as i7 from "./swipe/testing/swipe.test";
|
|
10
|
+
import * as i8 from "./chips/testing/chips.test";
|
|
11
|
+
import * as i9 from "./badge/badge.test";
|
|
12
|
+
import * as i10 from "../testing/observable.test";
|
|
13
|
+
import * as i11 from "@angular/common";
|
|
14
|
+
import * as i12 from "@ionic/angular";
|
|
15
|
+
import * as i13 from "@angular/forms";
|
|
16
|
+
import * as i14 from "./material.module";
|
|
17
|
+
import * as i15 from "@ngx-translate/core";
|
|
18
|
+
import * as i16 from "@angular/router";
|
|
19
|
+
import * as i17 from "../pipes/pipes.module";
|
|
19
20
|
export declare const SHARED_MATERIAL_TESTING_PAGES: TestingPage[];
|
|
20
21
|
export declare class MaterialTestingModule {
|
|
21
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialTestingModule, never>;
|
|
22
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialTestingModule, [typeof i1.DateTimeTestPage, typeof i2.DateTestPage, typeof i3.
|
|
23
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialTestingModule, [typeof i1.DateTimeTestPage, typeof i2.DateTestPage, typeof i3.DateShortTestPage, typeof i4.AutocompleteTestPage, typeof i5.LatLongTestPage, typeof i6.NumpadTestPage, typeof i7.SwipeTestPage, typeof i8.ChipsTestPage, typeof i9.MatBadgeTestPage, typeof i10.ObservableTestPage], [typeof i11.CommonModule, typeof i12.IonicModule, typeof i13.ReactiveFormsModule, typeof i14.SharedMaterialModule, typeof i15.TranslateModule, typeof i16.RouterModule, typeof i17.SharedPipesModule], [typeof i14.SharedMaterialModule, typeof i16.RouterModule, typeof i1.DateTimeTestPage, typeof i2.DateTestPage, typeof i3.DateShortTestPage, typeof i4.AutocompleteTestPage, typeof i5.LatLongTestPage, typeof i6.NumpadTestPage, typeof i7.SwipeTestPage, typeof i8.ChipsTestPage, typeof i10.ObservableTestPage]>;
|
|
23
24
|
static ɵinj: i0.ɵɵInjectorDeclaration<MaterialTestingModule>;
|
|
24
25
|
}
|
|
@@ -14,7 +14,7 @@ export declare abstract class AbstractDateFormat {
|
|
|
14
14
|
pattern?: string;
|
|
15
15
|
time?: boolean;
|
|
16
16
|
seconds?: boolean;
|
|
17
|
-
}): string
|
|
17
|
+
}): string | Promise<string>;
|
|
18
18
|
protected _updateTranslations(translations: any): void;
|
|
19
19
|
protected _getTranslationValue(translations: any, key: string, defaultValue: string): string;
|
|
20
20
|
}
|
|
@@ -132,6 +132,7 @@ ion-menu.menu-side-left {
|
|
|
132
132
|
.form-container,
|
|
133
133
|
form.form-container {
|
|
134
134
|
color: $app-form-color;
|
|
135
|
+
@include font-size(16px);
|
|
135
136
|
|
|
136
137
|
.mat-form-field-disabled,
|
|
137
138
|
.mat-input-element:disabled {
|
|
@@ -151,29 +152,32 @@ form.form-container {
|
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
mat-form-field {
|
|
154
|
-
|
|
155
|
+
//@include font-size-important(16px);
|
|
155
156
|
|
|
156
157
|
ion-icon[matPrefix],
|
|
157
158
|
mat-icon[matPrefix],
|
|
158
159
|
.mat-form-field-prefix ion-icon,
|
|
159
160
|
.mat-form-field-prefix .mat-icon {
|
|
160
|
-
font-size:
|
|
161
|
+
$font-size: calculateRem(24px);
|
|
162
|
+
$margin-vertical: calculateRem(4px);
|
|
163
|
+
font-size: $font-size !important;
|
|
161
164
|
line-height: 1.125;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
height: $font-size;
|
|
166
|
+
width: $font-size;
|
|
167
|
+
margin-left: $margin-vertical;
|
|
168
|
+
margin-right: $margin-vertical;
|
|
165
169
|
position: relative;
|
|
166
|
-
bottom: -
|
|
170
|
+
bottom: calc(calc(1rem - $font-size) / 2);
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
ion-icon[matSuffix],
|
|
170
174
|
mat-icon[matSuffix],
|
|
171
175
|
.mat-form-field-suffix ion-icon,
|
|
172
176
|
.mat-form-field-suffix .mat-icon {
|
|
173
|
-
//width: 0.8em !important;
|
|
174
177
|
|
|
175
178
|
&.large {
|
|
176
|
-
font-size:
|
|
179
|
+
$font-size: calculateRem(24px);
|
|
180
|
+
font-size: $font-size;
|
|
177
181
|
line-height: 1.125;
|
|
178
182
|
}
|
|
179
183
|
}
|
|
@@ -242,6 +246,8 @@ mat-form-field {
|
|
|
242
246
|
|
|
243
247
|
// --- mat-date-time
|
|
244
248
|
mat-date-time-field {
|
|
249
|
+
//@include font-size-important(16px);
|
|
250
|
+
|
|
245
251
|
// Need for errors injected using the <ng-content> tag
|
|
246
252
|
mat-error {
|
|
247
253
|
text-align: end;
|
|
@@ -1310,7 +1316,7 @@ ion-modal.modal-fullscreen {
|
|
|
1310
1316
|
.mat-cell {
|
|
1311
1317
|
/* smaller size, for the comment icon */
|
|
1312
1318
|
mat-icon.comment {
|
|
1313
|
-
font-size
|
|
1319
|
+
@include font-size(16pt);
|
|
1314
1320
|
height: 100%;
|
|
1315
1321
|
vertical-align: center;
|
|
1316
1322
|
color: var(--ion-color-tertiary, grey);
|