@mediusinc/mng-commons 0.8.0 → 0.9.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.
Files changed (74) hide show
  1. package/esm2020/lib/api/utils/medius-rest.util.mjs +6 -6
  2. package/esm2020/lib/components/action/action.component.mjs +3 -2
  3. package/esm2020/lib/components/action/editor/action-editor.component.mjs +6 -5
  4. package/esm2020/lib/components/action/route/action-route.component.mjs +2 -2
  5. package/esm2020/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +4 -4
  6. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  7. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +1 -1
  8. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +14 -15
  9. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +4 -4
  10. package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +3 -2
  11. package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +11 -11
  12. package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +10 -10
  13. package/esm2020/lib/components/tableview/table/table.component.mjs +10 -12
  14. package/esm2020/lib/components/tableview/tableview.component.mjs +2 -2
  15. package/esm2020/lib/descriptors/action.descriptor.mjs +14 -71
  16. package/esm2020/lib/descriptors/column.descriptor.mjs +22 -33
  17. package/esm2020/lib/descriptors/editor.descriptor.mjs +3 -11
  18. package/esm2020/lib/descriptors/field.descriptor.mjs +31 -95
  19. package/esm2020/lib/descriptors/filter.descriptor.mjs +6 -39
  20. package/esm2020/lib/descriptors/index.mjs +1 -3
  21. package/esm2020/lib/descriptors/interfaces/field-config.interface.mjs +2 -0
  22. package/esm2020/lib/descriptors/interfaces/index.mjs +3 -0
  23. package/esm2020/lib/descriptors/interfaces/lookup-descriptor.interface.mjs +2 -0
  24. package/esm2020/lib/descriptors/table.descriptor.mjs +6 -23
  25. package/esm2020/lib/descriptors/tableview.descriptor.mjs +5 -5
  26. package/esm2020/lib/descriptors/types/action.type.mjs +53 -0
  27. package/esm2020/lib/descriptors/types/column.type.mjs +11 -0
  28. package/esm2020/lib/descriptors/types/editor.type.mjs +8 -0
  29. package/esm2020/lib/descriptors/types/field.type.mjs +53 -0
  30. package/esm2020/lib/descriptors/types/filter.type.mjs +31 -0
  31. package/esm2020/lib/descriptors/types/index.mjs +7 -0
  32. package/esm2020/lib/descriptors/types/table.type.mjs +17 -0
  33. package/esm2020/lib/pipes/enum.pipe.mjs +2 -2
  34. package/esm2020/lib/services/action-executor.service.mjs +8 -7
  35. package/esm2020/lib/services/commons.service.mjs +5 -21
  36. package/esm2020/lib/types/type.model.mjs +1 -1
  37. package/esm2020/lib/utils/editor-formly.util.mjs +16 -15
  38. package/esm2020/lib/utils/model.util.mjs +1 -1
  39. package/esm2020/lib/utils/styles.util.mjs +9 -9
  40. package/esm2020/public-api.mjs +3 -1
  41. package/fesm2015/mediusinc-mng-commons.mjs +325 -368
  42. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  43. package/fesm2020/mediusinc-mng-commons.mjs +324 -368
  44. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  45. package/lib/api/utils/medius-rest.util.d.ts +3 -2
  46. package/lib/components/action/action.component.d.ts +2 -1
  47. package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +3 -2
  48. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +2 -1
  49. package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +5 -4
  50. package/lib/components/tableview/table/column-value/column-value.component.d.ts +8 -7
  51. package/lib/components/tableview/table/table.component.d.ts +3 -2
  52. package/lib/descriptors/action.descriptor.d.ts +9 -59
  53. package/lib/descriptors/column.descriptor.d.ts +3 -13
  54. package/lib/descriptors/editor.descriptor.d.ts +2 -9
  55. package/lib/descriptors/field.descriptor.d.ts +17 -72
  56. package/lib/descriptors/filter.descriptor.d.ts +8 -38
  57. package/lib/descriptors/index.d.ts +0 -2
  58. package/lib/descriptors/{field.descriptor.interface.d.ts → interfaces/field-config.interface.d.ts} +0 -0
  59. package/lib/descriptors/interfaces/index.d.ts +2 -0
  60. package/lib/descriptors/{lookup.descriptor.d.ts → interfaces/lookup-descriptor.interface.d.ts} +3 -3
  61. package/lib/descriptors/table.descriptor.d.ts +7 -21
  62. package/lib/descriptors/types/action.type.d.ts +45 -0
  63. package/lib/descriptors/types/column.type.d.ts +9 -0
  64. package/lib/descriptors/types/editor.type.d.ts +6 -0
  65. package/lib/descriptors/types/field.type.d.ts +44 -0
  66. package/lib/descriptors/types/filter.type.d.ts +27 -0
  67. package/lib/descriptors/types/index.d.ts +6 -0
  68. package/lib/descriptors/types/table.type.d.ts +13 -0
  69. package/lib/types/type.model.d.ts +2 -2
  70. package/lib/utils/model.util.d.ts +1 -1
  71. package/package.json +1 -1
  72. package/public-api.d.ts +2 -0
  73. package/esm2020/lib/descriptors/field.descriptor.interface.mjs +0 -2
  74. package/esm2020/lib/descriptors/lookup.descriptor.mjs +0 -2
@@ -3,6 +3,7 @@ import { IColumnValueComponent } from '../models';
3
3
  import { ClassType, EnumType } from '../types';
4
4
  import { ColumnDescriptor } from './column.descriptor';
5
5
  import { ModelDescriptor } from './model.descriptor';
6
+ import { TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum } from './types';
6
7
  export declare class TableDescriptor<T> {
7
8
  private readonly _model;
8
9
  private _filterDisplay;
@@ -23,8 +24,8 @@ export declare class TableDescriptor<T> {
23
24
  private _hasHover;
24
25
  private _hasGridlines;
25
26
  constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
26
- get filterDisplay(): TableDescriptor.FilterDisplayEnum;
27
- get paginationMode(): TableDescriptor.PaginationModeEnum;
27
+ get filterDisplay(): TableFilterDisplayEnum;
28
+ get paginationMode(): TablePaginationModeEnum;
28
29
  get rowsPerPageOptions(): number[];
29
30
  get defaultNumRows(): number;
30
31
  get columns(): ColumnDescriptor<any, T>[];
@@ -36,7 +37,7 @@ export declare class TableDescriptor<T> {
36
37
  get defaultSortAsc(): boolean[];
37
38
  get model(): ModelDescriptor<T>;
38
39
  get className(): string;
39
- get size(): TableDescriptor.SizeEnum;
40
+ get size(): TableSizeEnum;
40
41
  get tableFullHeightOffset(): number | undefined;
41
42
  get rowHeight(): number | undefined;
42
43
  get hasHover(): boolean;
@@ -48,33 +49,18 @@ export declare class TableDescriptor<T> {
48
49
  addColumnBoolean(property: string, yes?: string, no?: string, asIcon?: boolean): ColumnDescriptor<boolean, T>;
49
50
  addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<EnumType, T>;
50
51
  addColumnCustomComponent(property: string, customComponentType: Type<IColumnValueComponent<T>>): ColumnDescriptor<any, T>;
51
- withFilterDisplay(filterDisplayType: TableDescriptor.FilterDisplayEnum): this;
52
- withPaginationMode(paginationMode: TableDescriptor.PaginationModeEnum): this;
52
+ withFilterDisplay(filterDisplayType: TableFilterDisplayEnum): this;
53
+ withPaginationMode(paginationMode: TablePaginationModeEnum): this;
53
54
  withRowsPerPage(rows: number, options?: Array<number>): this;
54
55
  withTitle(title: string): TableDescriptor<T>;
55
56
  withHideHeader(hideHeader?: boolean): this;
56
57
  withDataKeyProperty(property: string): TableDescriptor<T>;
57
58
  withDefaultSort(property: string, asc?: boolean): TableDescriptor<T>;
58
59
  withClassName(className: string): this;
59
- withSize(size?: TableDescriptor.SizeEnum): this;
60
+ withSize(size?: TableSizeEnum): this;
60
61
  withTableFullHeightOffset(tableFullHeightOffset: number): TableDescriptor<T>;
61
62
  withRowHeight(rowHeight: number): TableDescriptor<T>;
62
63
  withHover(hover: boolean): this;
63
64
  withGridlines(gridlines: boolean): this;
64
65
  copy(): TableDescriptor<T>;
65
66
  }
66
- export declare namespace TableDescriptor {
67
- enum PaginationModeEnum {
68
- Pagination = 0,
69
- InfiniteScroll = 1
70
- }
71
- enum FilterDisplayEnum {
72
- Row = 0,
73
- Menu = 1
74
- }
75
- enum SizeEnum {
76
- Small = 0,
77
- Normal = 1,
78
- Large = 2
79
- }
80
- }
@@ -0,0 +1,45 @@
1
+ export declare enum ActionPositionEnum {
2
+ ToolbarLeft = 0,
3
+ ToolbarRight = 1,
4
+ TableHeader = 2,
5
+ RowInline = 3,
6
+ RowClick = 4,
7
+ FooterLeft = 5,
8
+ FooterRight = 6
9
+ }
10
+ export declare enum ActionActivationTriggerEnum {
11
+ OnClick = 0,
12
+ OnRoute = 1
13
+ }
14
+ export declare enum ActionTypeEnum {
15
+ Direct = 0,
16
+ Editor = 1
17
+ }
18
+ export declare enum ActionLevelEnum {
19
+ Default = 0,
20
+ Primary = 1,
21
+ Secondary = 2,
22
+ Info = 3,
23
+ Help = 4,
24
+ Success = 5,
25
+ Warning = 6,
26
+ Danger = 7
27
+ }
28
+ export declare enum ActionSizeEnum {
29
+ ExtraSmall = 0,
30
+ Small = 1,
31
+ Normal = 2,
32
+ Large = 3,
33
+ ExtraLarge = 4
34
+ }
35
+ export declare enum ActionEditorDialogSizeEnum {
36
+ ExtraSmall = 0,
37
+ Small = 1,
38
+ Normal = 2,
39
+ Large = 3,
40
+ ExtraLarge = 4
41
+ }
42
+ export declare enum ActionEditorSubmitTypeEnum {
43
+ Submit = 0,
44
+ Cancel = 1
45
+ }
@@ -0,0 +1,9 @@
1
+ export declare enum ColumnTypeEnum {
2
+ String = 0,
3
+ Number = 1,
4
+ Currency = 2,
5
+ Boolean = 3,
6
+ Date = 4,
7
+ Enum = 5,
8
+ Custom = 6
9
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum TableviewTypeEnum {
2
+ None = 0,
3
+ View = 1,
4
+ Edit = 2,
5
+ Add = 3
6
+ }
@@ -0,0 +1,44 @@
1
+ export declare enum FieldSizeEnum {
2
+ Small = 0,
3
+ Normal = 1,
4
+ Large = 2
5
+ }
6
+ export declare enum FieldInputTypeEnum {
7
+ Hidden = 0,
8
+ Label = 1,
9
+ Text = 2,
10
+ Textarea = 3,
11
+ Number = 4,
12
+ Currency = 5,
13
+ Switch = 6,
14
+ Radio = 7,
15
+ Datepicker = 8,
16
+ Mask = 9,
17
+ File = 10,
18
+ Custom = 11
19
+ }
20
+ export declare enum FieldLookupTypeEnum {
21
+ Dropdown = 0,
22
+ Autocomplete = 1,
23
+ Dialog = 2
24
+ }
25
+ export declare enum FieldManyToManyEditorTypeEnum {
26
+ DialogTableMultiselect = 0
27
+ }
28
+ export declare enum FieldManyToManyEditorActionEnum {
29
+ Add = 0,
30
+ Delete = 1
31
+ }
32
+ export declare enum FieldManyEditorTypeEnum {
33
+ DialogEditor = 0
34
+ }
35
+ export declare enum FieldManyEditorActionEnum {
36
+ View = 0,
37
+ Add = 1,
38
+ Edit = 2,
39
+ Delete = 3
40
+ }
41
+ export declare enum FieldGroupTypeEnum {
42
+ Fieldset = 0,
43
+ Logical = 1
44
+ }
@@ -0,0 +1,27 @@
1
+ export declare enum FilterTypeEnum {
2
+ String = 0,
3
+ Number = 1,
4
+ Boolean = 2,
5
+ Date = 3,
6
+ Lookup = 4,
7
+ LookupEnum = 5
8
+ }
9
+ export declare enum FilterMatchModeEnum {
10
+ StartsWith = "startsWith",
11
+ Contains = "contains",
12
+ EndsWith = "endsWith",
13
+ Equals = "equals",
14
+ NotEquals = "notEquals",
15
+ In = "in",
16
+ LessThan = "lt",
17
+ GreaterThan = "gt",
18
+ Between = "between",
19
+ DateIs = "dateIs",
20
+ DateIsNot = "dateIsNot",
21
+ DateBefore = "dateBefore",
22
+ DateAfter = "dateAfter"
23
+ }
24
+ export declare enum FilterLookupTypeEnum {
25
+ Dropdown = 0,
26
+ Autocomplete = 1
27
+ }
@@ -0,0 +1,6 @@
1
+ export * from './action.type';
2
+ export * from './column.type';
3
+ export * from './editor.type';
4
+ export * from './field.type';
5
+ export * from './filter.type';
6
+ export * from './table.type';
@@ -0,0 +1,13 @@
1
+ export declare enum TablePaginationModeEnum {
2
+ Pagination = 0,
3
+ InfiniteScroll = 1
4
+ }
5
+ export declare enum TableFilterDisplayEnum {
6
+ Row = 0,
7
+ Menu = 1
8
+ }
9
+ export declare enum TableSizeEnum {
10
+ Small = 0,
11
+ Normal = 1,
12
+ Large = 2
13
+ }
@@ -2,7 +2,7 @@ import { AbstractControl, ValidationErrors } from '@angular/forms';
2
2
  import { FormlyFieldConfig } from '@ngx-formly/core/lib/models/fieldconfig';
3
3
  import { Observable } from 'rxjs';
4
4
  import { MediusFilterMatchType } from '../api/models';
5
- import { FilterDescriptor } from '../descriptors';
5
+ import { FilterTypeEnum } from '../descriptors/types';
6
6
  export interface ClassType<T> extends Function {
7
7
  new (...args: any[]): T;
8
8
  }
@@ -17,4 +17,4 @@ export declare type MngFieldValidator = (control: AbstractControl, field: Formly
17
17
  [id: string]: any;
18
18
  }) => ValidationErrors | boolean | null;
19
19
  export declare type MngFieldValidationMessage = string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>);
20
- export declare type MatchModeMapType = [string, string, MediusFilterMatchType, FilterDescriptor.TypeEnum | null];
20
+ export declare type MatchModeMapType = [string, string, MediusFilterMatchType, FilterTypeEnum | null];
@@ -1,4 +1,4 @@
1
- import { ILookupDescriptor } from '../descriptors';
1
+ import { ILookupDescriptor } from '../descriptors/interfaces';
2
2
  import { ClassType } from '../types';
3
3
  export declare class ModelUtil {
4
4
  static findIdAttribute<T>(classType: ClassType<T>): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^13.2.0",
6
6
  "@angular/core": "^13.2.0",
package/public-api.d.ts CHANGED
@@ -22,6 +22,8 @@ export * from './lib/config/models';
22
22
  export * from './lib/config';
23
23
  export * from './lib/data-providers';
24
24
  export * from './lib/descriptors';
25
+ export * from './lib/descriptors/interfaces';
26
+ export * from './lib/descriptors/types';
25
27
  export * from './lib/models';
26
28
  export * from './lib/router';
27
29
  export * from './lib/router/models';
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGQuZGVzY3JpcHRvci5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL2Rlc2NyaXB0b3JzL2ZpZWxkLmRlc2NyaXB0b3IuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1R5cGV9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWVtcHR5LWludGVyZmFjZVxuZXhwb3J0IGludGVyZmFjZSBGaWVsZENvbmZpZyB7fVxuXG5leHBvcnQgaW50ZXJmYWNlIEZpZWxkTG9va3VwQ29uZmlnIGV4dGVuZHMgRmllbGRDb25maWcge1xuICAgIHRhYmxlPzoge1xuICAgICAgICBjYXB0aW9uQ29tcG9uZW50PzogVHlwZTxhbnk+O1xuICAgICAgICBjb2x1bW5BY3Rpb25Db21wb25lbnQ/OiBUeXBlPGFueT47XG4gICAgfTtcbn1cbiJdfQ==
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9va3VwLmRlc2NyaXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL2Rlc2NyaXB0b3JzL2xvb2t1cC5kZXNjcmlwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGV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