@ecodev/natural 45.4.2 → 45.5.0
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/esm2020/lib/classes/abstract-list.mjs +1 -1
- package/esm2020/lib/modules/dropdown-components/type-date/type-date.component.mjs +67 -34
- package/esm2020/lib/modules/hierarchic-selector/hierarchic-selector/hierarchic-selector.service.mjs +1 -1
- package/esm2020/lib/modules/search/classes/graphql-doctrine.mjs +11 -5
- package/esm2020/lib/modules/search/classes/transformers.mjs +51 -1
- package/esm2020/lib/modules/search/public-api.mjs +2 -2
- package/fesm2015/ecodev-natural.mjs +657 -573
- package/fesm2015/ecodev-natural.mjs.map +1 -1
- package/fesm2020/ecodev-natural.mjs +654 -571
- package/fesm2020/ecodev-natural.mjs.map +1 -1
- package/lib/modules/dropdown-components/type-date/type-date.component.d.ts +6 -2
- package/lib/modules/search/classes/transformers.d.ts +15 -0
- package/lib/modules/search/public-api.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4,22 +4,25 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
4
4
|
import { FilterGroupConditionField } from '../../search/classes/graphql-doctrine.types';
|
|
5
5
|
import { NaturalDropdownData } from '../../search/dropdown-container/dropdown.service';
|
|
6
6
|
import { DropdownComponent } from '../../search/types/dropdown-component';
|
|
7
|
+
import { NaturalAbstractController } from '../../../classes/abstract-controller';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
|
-
export interface TypeDateConfiguration<D =
|
|
9
|
+
export interface TypeDateConfiguration<D = Date> {
|
|
9
10
|
min?: D | null;
|
|
10
11
|
max?: D | null;
|
|
11
12
|
}
|
|
12
|
-
export declare class TypeDateComponent<D = any> implements DropdownComponent {
|
|
13
|
+
export declare class TypeDateComponent<D = any> extends NaturalAbstractController implements DropdownComponent {
|
|
13
14
|
private dateAdapter;
|
|
14
15
|
private dateFormats;
|
|
15
16
|
readonly renderedValue: BehaviorSubject<string>;
|
|
16
17
|
readonly configuration: Required<TypeDateConfiguration<D>>;
|
|
17
18
|
readonly operatorCtrl: FormControl<"equal" | "greater" | "greaterOrEqual" | "less" | "lessOrEqual">;
|
|
18
19
|
readonly valueCtrl: FormControl<D | null>;
|
|
20
|
+
readonly todayCtrl: FormControl<boolean | null>;
|
|
19
21
|
readonly operators: import("../types").PossibleComparableOperator[];
|
|
20
22
|
readonly form: FormGroup<{
|
|
21
23
|
operator: FormControl<"equal" | "greater" | "greaterOrEqual" | "less" | "lessOrEqual">;
|
|
22
24
|
value: FormControl<D | null>;
|
|
25
|
+
today: FormControl<boolean | null>;
|
|
23
26
|
}>;
|
|
24
27
|
private readonly defaults;
|
|
25
28
|
constructor(data: NaturalDropdownData<TypeDateConfiguration<D>>, dateAdapter: DateAdapter<D>, dateFormats: MatDateFormats);
|
|
@@ -27,6 +30,7 @@ export declare class TypeDateComponent<D = any> implements DropdownComponent {
|
|
|
27
30
|
isValid(): boolean;
|
|
28
31
|
isDirty(): boolean;
|
|
29
32
|
private reloadCondition;
|
|
33
|
+
private setTodayOrDate;
|
|
30
34
|
private initValidators;
|
|
31
35
|
private getDayAfter;
|
|
32
36
|
private getRenderedValue;
|
|
@@ -37,3 +37,18 @@ export declare function replaceOperatorByField(selection: NaturalSearchSelection
|
|
|
37
37
|
* {field: 'myFieldName', name:'myConfigName', condition: {myConfigName: {values: [1, 2, 3]}}}
|
|
38
38
|
*/
|
|
39
39
|
export declare function replaceOperatorByName(selection: NaturalSearchSelection): NaturalSearchSelection;
|
|
40
|
+
/**
|
|
41
|
+
* Replace `"today"` and `"tomorrow"` by their real value right now.
|
|
42
|
+
*
|
|
43
|
+
* This transformer is applied automatically and should **not** be part
|
|
44
|
+
* of Natural public API.
|
|
45
|
+
*
|
|
46
|
+
* So:
|
|
47
|
+
*
|
|
48
|
+
* {field: 'myFieldName', condition: {greater: {value: 'today'}}}
|
|
49
|
+
*
|
|
50
|
+
* will become
|
|
51
|
+
*
|
|
52
|
+
* {field: 'myFieldName', condition: {greater: {value: '2023-01-03'}}}
|
|
53
|
+
*/
|
|
54
|
+
export declare function replaceToday(selection: NaturalSearchSelection): NaturalSearchSelection;
|
|
@@ -8,5 +8,5 @@ export { NATURAL_DROPDOWN_DATA } from './dropdown-container/dropdown.service';
|
|
|
8
8
|
export { NaturalSearchModule } from './search.module';
|
|
9
9
|
export { toGraphQLDoctrineFilter } from './classes/graphql-doctrine';
|
|
10
10
|
export { fromUrl, toUrl, toNavigationParameters } from './classes/url';
|
|
11
|
-
export
|
|
11
|
+
export { replaceOperatorByName, wrapLike, replaceOperatorByField } from './classes/transformers';
|
|
12
12
|
export { NaturalSearchComponent } from './search/search.component';
|