@mediusinc/mng-commons 0.7.0 → 0.7.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/assets/i18n/en.json +3 -3
- package/assets/i18n/sl.json +3 -3
- package/esm2020/lib/api/utils/medius-rest.util.mjs +52 -26
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +26 -9
- package/esm2020/lib/components/tableview/table/table.component.mjs +29 -12
- package/esm2020/lib/descriptors/action.descriptor.mjs +3 -1
- package/esm2020/lib/descriptors/field.descriptor.mjs +2 -2
- package/esm2020/lib/descriptors/filter.descriptor.mjs +61 -3
- package/esm2020/lib/services/commons.service.mjs +3 -3
- package/esm2020/lib/utils/enum.util.mjs +3 -3
- package/fesm2015/mediusinc-mng-commons.mjs +166 -49
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +164 -48
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/medius-rest.util.d.ts +4 -2
- package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +2 -0
- package/lib/components/tableview/table/table.component.d.ts +1 -2
- package/lib/descriptors/action.descriptor.d.ts +2 -2
- package/lib/descriptors/filter.descriptor.d.ts +21 -2
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_datatable.scss +36 -0
|
@@ -3,10 +3,12 @@ import { FilterMetadata, LazyLoadEvent } from 'primeng/api';
|
|
|
3
3
|
import { FilterDescriptor } from '../../descriptors';
|
|
4
4
|
import { MediusFilterMatchType, MediusQueryParam, MediusQueryParamBuilder } from '../models';
|
|
5
5
|
export declare class MediusRestUtil {
|
|
6
|
-
static readonly matchModeMapping
|
|
6
|
+
private static readonly matchModeMapping;
|
|
7
7
|
static fromAngularQueryParamsToMediusQueryParams(params: Params, filterDescriptors: Array<FilterDescriptor<any>>, defaultItemsPerPage?: number, defaultOffset?: number): MediusQueryParam;
|
|
8
8
|
static fromPrimeLazyLoadEventToAngularQueryParams(event: LazyLoadEvent, defaultItemsPerPage?: number, defaultOffset?: number): Params;
|
|
9
9
|
static fromPrimeLazyLoadEventToMediusQueryParams(event: LazyLoadEvent): MediusQueryParam;
|
|
10
10
|
static addMediusFilterFromPrimeFilterMetadata(queryParamBuilder: MediusQueryParamBuilder, property: string, filterMetadata: FilterMetadata): void;
|
|
11
|
-
static getMediusFilterMatchTypeFromPrimeMatchMode(matchMode: string): MediusFilterMatchType;
|
|
11
|
+
static getMediusFilterMatchTypeFromPrimeMatchMode(matchMode: string, dataType?: FilterDescriptor.TypeEnum): MediusFilterMatchType;
|
|
12
|
+
static getMapping(matchMode: string, dataType?: FilterDescriptor.TypeEnum, idx?: number): MatchModeMapType | null;
|
|
12
13
|
}
|
|
14
|
+
export declare type MatchModeMapType = [string, string, MediusFilterMatchType, FilterDescriptor.TypeEnum | null];
|
|
@@ -21,6 +21,8 @@ export declare class MngTableColumnFilterComponent<T> implements OnInit {
|
|
|
21
21
|
primeMatchModes: SelectItem[] | null;
|
|
22
22
|
constructor(primeConfig: PrimeNGConfig);
|
|
23
23
|
ngOnInit(): void;
|
|
24
|
+
valueToDate(value: unknown): Date | null;
|
|
25
|
+
dateFilter(value: T, filterCallback: Function): void;
|
|
24
26
|
autocompleteFilter(value: T, filterCallback: Function): void;
|
|
25
27
|
dropdownFilter(value: T, filterCallback: Function): void;
|
|
26
28
|
toLookupFilterValue(value?: any): any;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AfterContentInit, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges, TemplateRef, Type } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
-
import { LazyLoadEvent, SortMeta } from 'primeng/api';
|
|
5
|
-
import { FilterMetadata } from 'primeng/api/filtermetadata';
|
|
4
|
+
import { FilterMetadata, LazyLoadEvent, SortMeta } from 'primeng/api';
|
|
6
5
|
import { Table } from 'primeng/table';
|
|
7
6
|
import { Observable } from 'rxjs';
|
|
8
7
|
import { MediusQueryResult } from '../../../api/models';
|
|
@@ -117,8 +117,8 @@ export declare class ActionDescriptor<T> {
|
|
|
117
117
|
* may lead to unexpected behaviour
|
|
118
118
|
*/
|
|
119
119
|
withRunConfirmation(icon?: string, title?: string, message?: string, acceptTitle?: string, rejectTitle?: string, runConfirmationConfigMapFn?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>, confirmConfig: Confirmation) => Confirmation): this;
|
|
120
|
-
withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean):
|
|
121
|
-
withRunNotificationError(title?: string, message?: string, hasNotification?: boolean):
|
|
120
|
+
withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean): this;
|
|
121
|
+
withRunNotificationError(title?: string, message?: string, hasNotification?: boolean): this;
|
|
122
122
|
}
|
|
123
123
|
export declare namespace ActionDescriptor {
|
|
124
124
|
enum SizeEnum {
|
|
@@ -10,14 +10,30 @@ export declare class FilterDescriptor<T> {
|
|
|
10
10
|
protected _filterType: FilterDescriptor.TypeEnum;
|
|
11
11
|
protected _filterProperty?: string;
|
|
12
12
|
protected _matchModes: string[] | null;
|
|
13
|
+
protected _numberMinFractionDigits?: number;
|
|
14
|
+
protected _numberMaxFractionDigits?: number;
|
|
15
|
+
protected _numberUseGrouping: boolean;
|
|
16
|
+
protected _datePickerFormat?: string;
|
|
17
|
+
protected _datePickerShowTime: boolean;
|
|
13
18
|
protected _placeholder?: string;
|
|
14
19
|
protected _className: string;
|
|
20
|
+
protected _columnClassName: string;
|
|
21
|
+
protected _columnWidth: number | null;
|
|
22
|
+
protected _columnMinWidth: number | null;
|
|
15
23
|
constructor(property: string);
|
|
16
24
|
get filterType(): FilterDescriptor.TypeEnum;
|
|
17
25
|
get filterProperty(): string | undefined;
|
|
18
26
|
get matchModes(): string[] | null;
|
|
27
|
+
get numberMinFractionDigits(): number | undefined;
|
|
28
|
+
get numberMaxFractionDigits(): number | undefined;
|
|
29
|
+
get numberUseGrouping(): boolean;
|
|
30
|
+
get datePickerFormat(): string | undefined;
|
|
31
|
+
get datePickerShowTime(): boolean;
|
|
19
32
|
get placeholder(): string | undefined;
|
|
20
33
|
get className(): string;
|
|
34
|
+
get columnClassName(): string;
|
|
35
|
+
get columnWidth(): number | null;
|
|
36
|
+
get columnMinWidth(): number | null;
|
|
21
37
|
get property(): string;
|
|
22
38
|
asFilterType(filterType: FilterDescriptor.TypeEnum): this;
|
|
23
39
|
/**
|
|
@@ -25,8 +41,13 @@ export declare class FilterDescriptor<T> {
|
|
|
25
41
|
* @param filterProperty
|
|
26
42
|
*/
|
|
27
43
|
withFilterProperty(filterProperty: string): this;
|
|
44
|
+
withNumberFractions(min?: number, max?: number): this;
|
|
45
|
+
withNumberGrouping(useGrouping?: boolean): this;
|
|
46
|
+
withDateFormat(format?: string, showTime?: boolean): this;
|
|
28
47
|
withPlaceholder(placeholder: string): this;
|
|
29
48
|
withClassName(className: string): this;
|
|
49
|
+
withColumnClassName(className: string): this;
|
|
50
|
+
withColumnWidth(width?: number, minWidth?: number): this;
|
|
30
51
|
withMatchModes(matchModes: Array<FilterDescriptor.MatchModeEnum>): this;
|
|
31
52
|
copy(): FilterDescriptor<T>;
|
|
32
53
|
protected copyFieldsTo(descriptor: FilterDescriptor<T>): void;
|
|
@@ -48,9 +69,7 @@ export declare namespace FilterDescriptor {
|
|
|
48
69
|
NotEquals = "notEquals",
|
|
49
70
|
In = "in",
|
|
50
71
|
LessThan = "lt",
|
|
51
|
-
LessThanOrEqualTo = "lte",
|
|
52
72
|
GreaterThan = "gt",
|
|
53
|
-
GreaterThanOrEqualTo = "gte",
|
|
54
73
|
Between = "between",
|
|
55
74
|
DateIs = "dateIs",
|
|
56
75
|
DateIsNot = "dateIsNot",
|
package/package.json
CHANGED
|
@@ -7,6 +7,42 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.p-datatable-thead > tr.mng-column-filter-row {
|
|
11
|
+
> th {
|
|
12
|
+
padding-left: 0.15rem;
|
|
13
|
+
padding-right: 0.15rem;
|
|
14
|
+
|
|
15
|
+
// string
|
|
16
|
+
&.mng-column-filter-0 {
|
|
17
|
+
min-width: 135px;
|
|
18
|
+
}
|
|
19
|
+
// number
|
|
20
|
+
&.mng-column-filter-1 {
|
|
21
|
+
min-width: 165px;
|
|
22
|
+
}
|
|
23
|
+
// date
|
|
24
|
+
&.mng-column-filter-3 {
|
|
25
|
+
min-width: 170px;
|
|
26
|
+
}
|
|
27
|
+
// boolean
|
|
28
|
+
&.mng-column-filter-2 {
|
|
29
|
+
min-width: 80px;
|
|
30
|
+
}
|
|
31
|
+
// lookup, lookup enum
|
|
32
|
+
&.mng-column-filter-4,
|
|
33
|
+
&.mng-column-filter-5 {
|
|
34
|
+
min-width: 180px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.p-column-filter-menu-button,
|
|
38
|
+
.p-column-filter-clear-button {
|
|
39
|
+
width: 1.75rem;
|
|
40
|
+
height: 1.75rem;
|
|
41
|
+
margin-left: 0.1rem;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
10
46
|
.p-datatable-tbody > tr > td {
|
|
11
47
|
&.column-action {
|
|
12
48
|
padding-top: 0.1rem;
|