@mediusinc/mng-commons 0.17.2 → 0.17.4

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 (28) hide show
  1. package/esm2020/lib/api/models/query-result.model.mjs +1 -1
  2. package/esm2020/lib/components/action/editor/action-editor.component.mjs +1 -1
  3. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +1 -1
  4. package/esm2020/lib/components/layout/menu-item.component.mjs +34 -6
  5. package/esm2020/lib/components/layout/menu.component.mjs +1 -1
  6. package/esm2020/lib/components/tableview/table/table.component.mjs +9 -3
  7. package/esm2020/lib/data-providers/table.data-provider.mjs +15 -1
  8. package/esm2020/lib/data-providers/tableview.data-provider.mjs +15 -1
  9. package/esm2020/lib/descriptors/column.descriptor.mjs +2 -1
  10. package/esm2020/lib/descriptors/table.descriptor.mjs +1 -1
  11. package/esm2020/lib/descriptors/tableview.descriptor.mjs +21 -4
  12. package/esm2020/lib/descriptors/types/table.type.mjs +2 -1
  13. package/esm2020/lib/pipes/enumerate-async.pipe.mjs +1 -1
  14. package/fesm2015/mediusinc-mng-commons.mjs +94 -15
  15. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  16. package/fesm2020/mediusinc-mng-commons.mjs +89 -10
  17. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  18. package/lib/api/models/query-result.model.d.ts +1 -1
  19. package/lib/components/layout/menu-item.component.d.ts +12 -4
  20. package/lib/components/tableview/table/table.component.d.ts +3 -1
  21. package/lib/data-providers/table.data-provider.d.ts +8 -0
  22. package/lib/data-providers/tableview.data-provider.d.ts +8 -0
  23. package/lib/descriptors/tableview.descriptor.d.ts +6 -0
  24. package/lib/descriptors/types/table.type.d.ts +2 -1
  25. package/package.json +1 -1
  26. package/scss/mng-overrides/_layout_dialog.scss +15 -3
  27. package/scss/mng-overrides/_theme_datatable.scss +17 -11
  28. package/version-info.json +5 -5
@@ -14,7 +14,7 @@ export declare class MediusQueryResult<T> implements IMediusQueryResult<T> {
14
14
  allDataCount?: number;
15
15
  pageData?: Array<T>;
16
16
  static discriminator?: string;
17
- static fromArray<T>(pageData: T[], allDataCount?: number): MediusQueryResult<unknown>;
17
+ static fromArray<T>(pageData: T[], allDataCount?: number): MediusQueryResult<T>;
18
18
  static attributeTypeMap: Array<AttributeDef>;
19
19
  static getAttributeTypeMap(): AttributeDef[];
20
20
  }
@@ -1,4 +1,4 @@
1
- import { Injector, OnDestroy, OnInit } from '@angular/core';
1
+ import { EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { Observable } from 'rxjs';
4
4
  import { MngMenuItem } from '../../models';
@@ -17,28 +17,36 @@ export declare class MngMenuItemComponent implements OnInit, OnDestroy {
17
17
  index: number;
18
18
  root: boolean;
19
19
  parentKey: string | null;
20
+ visibleChangeEventEmitter: EventEmitter<boolean>;
20
21
  private hostClassNoPadding;
22
+ private hostClassChildrenHidden;
21
23
  key: string;
22
24
  active: boolean;
23
25
  hover: boolean;
24
26
  private guardsIsAllowedSubject;
25
- guardsIsAllowed$: Observable<boolean>;
27
+ private guardsIsAllowed$;
26
28
  private isPermittedSubject;
27
- isPermitted$: Observable<boolean>;
29
+ private isPermitted$;
30
+ private isVisibleSubject;
31
+ isVisible$: Observable<boolean>;
32
+ private childrenVisibilitySubject;
28
33
  private itemUrl?;
29
34
  private menuSourceSubscription?;
30
35
  private menuResetSubscription?;
31
36
  private routerEventsSubscription?;
32
37
  private guardsIsAllowedSubscription?;
33
38
  private isPermittedSubscription?;
39
+ private isVisibleSubscription?;
34
40
  private isVisibleCombinedSubscription?;
41
+ private areChildrenVisibleSubscription?;
35
42
  constructor(injector: Injector, router: Router, route: ActivatedRoute, authorization: MngAuthorizationService, mngCommons: MngCommonsService, mainLayoutService: MngMainLayoutComponentService);
36
43
  ngOnInit(): void;
37
44
  updateActiveStateFromRoute(): void;
38
45
  itemClick(event: Event): void;
39
46
  onMouseEnter(): void;
40
47
  ngOnDestroy(): void;
48
+ onChildVisibleChange(visible: boolean, item: MngMenuItem, idx: number): void;
41
49
  private checkIfMenuItemIsAllowedFromGuard;
42
50
  static ɵfac: i0.ɵɵFactoryDeclaration<MngMenuItemComponent, never>;
43
- static ɵcmp: i0.ɵɵComponentDeclaration<MngMenuItemComponent, "[mng-menuitem]", never, { "item": "item"; "index": "index"; "root": "root"; "parentKey": "parentKey"; }, {}, never, never, false>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngMenuItemComponent, "[mng-menuitem]", never, { "item": "item"; "index": "index"; "root": "root"; "parentKey": "parentKey"; }, { "visibleChangeEventEmitter": "visibleChange"; }, never, never, false>;
44
52
  }
@@ -49,7 +49,9 @@ export declare class MngTableComponent<T, S> implements OnInit, OnChanges, After
49
49
  captionTemplate?: TemplateRef<any>;
50
50
  columnActionTemplate?: TemplateRef<any>;
51
51
  footerTemplate?: TemplateRef<any>;
52
- useDataProvider: boolean;
52
+ isLazy: boolean;
53
+ isPagination: boolean;
54
+ private useDataProvider;
53
55
  private useQueryParamsInitializedSubejct;
54
56
  useQueryParamsInitialized$: Observable<boolean>;
55
57
  queryResult$?: Observable<MediusQueryResult<T>>;
@@ -4,16 +4,24 @@ import { MediusQueryParam, MediusQueryResult } from '../api/models';
4
4
  import { ClassType } from '../types';
5
5
  import { DataProvider, IDataProvider } from './base.data-provider';
6
6
  export interface ITableDataProvider<T, S> extends IDataProvider<T, S> {
7
+ get isLazy(): boolean;
7
8
  getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
8
9
  getAllReload(queryParam?: MediusQueryParam): void;
9
10
  getAllReload$: Observable<MediusQueryParam | undefined>;
10
11
  }
11
12
  export declare class TableDataProvider<T, S> extends DataProvider<T, S> implements ITableDataProvider<T, S> {
13
+ protected _isLazy: boolean;
12
14
  protected _getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
13
15
  protected _getAllReloadSubject: Subject<MediusQueryParam | undefined>;
14
16
  constructor(modelType: ClassType<T>, serviceType?: Type<S>);
17
+ get isLazy(): boolean;
15
18
  get getAll(): (queryParam: MediusQueryParam, service?: S | undefined) => Observable<MediusQueryResult<T>>;
16
19
  get getAllReload$(): Observable<MediusQueryParam | undefined>;
17
20
  withGetAll(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>): this;
21
+ /**
22
+ * Use this method to use inline load without lazy loading features on table and use inline pagination, filtering and sorting.
23
+ * @param getAll
24
+ */
25
+ withGetAllEagerly(getAll: (service?: S) => Observable<Array<T>>): this;
18
26
  getAllReload(queryParam?: MediusQueryParam): void;
19
27
  }
@@ -5,17 +5,25 @@ import { ClassType, IdType } from '../types';
5
5
  import { EditorDataProvider, IEditorDataProvider } from './editor.data-provider';
6
6
  import { ITableDataProvider } from './table.data-provider';
7
7
  export interface ITableviewDataProvider<T, S> extends IEditorDataProvider<T, S> {
8
+ get isLazy(): boolean;
8
9
  getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
9
10
  getAllReload(queryParam?: MediusQueryParam): void;
10
11
  getAllReload$: Observable<MediusQueryParam | undefined>;
11
12
  }
12
13
  export declare class TableviewDataProvider<T, S> extends EditorDataProvider<T, S> implements ITableviewDataProvider<T, S>, ITableDataProvider<T, S>, IEditorDataProvider<T, S> {
14
+ protected _isLazy: boolean;
13
15
  protected _getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
14
16
  protected _getAllReloadSubject: Subject<MediusQueryParam | undefined>;
15
17
  constructor(modelType: ClassType<T>, serviceType?: Type<S>);
18
+ get isLazy(): boolean;
16
19
  get getAll(): (queryParam: MediusQueryParam, service?: S | undefined) => Observable<MediusQueryResult<T>>;
17
20
  get getAllReload$(): Observable<MediusQueryParam | undefined>;
18
21
  withGetAll(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>): this;
22
+ /**
23
+ * Use this method to use inline load without lazy loading features on table and use inline pagination, filtering and sorting.
24
+ * @param getAll
25
+ */
26
+ withGetAllEagerly(getAll: (service?: S) => Observable<Array<T>>): this;
19
27
  getAllReload(queryParam?: MediusQueryParam): void;
20
28
  }
21
29
  export declare class DynamicTableviewDataProvider extends TableviewDataProvider<any, any> implements ITableviewDataProvider<any, any>, ITableDataProvider<any, any> {
@@ -42,6 +42,12 @@ export declare class TableviewDescriptor<T> {
42
42
  withDetailsDescriptor(descriptor: EditorDescriptor<T>): this;
43
43
  withAddDescriptor(descriptor: EditorDescriptor<T>): this;
44
44
  withEditDescriptor(descriptor: EditorDescriptor<T>): this;
45
+ /**
46
+ * creates new copy of editor descriptor and makes it disabled
47
+ * usable in combination with this::withEditorDescriptors, where detailsDescriptor is made non disabled
48
+ * @param type which editor type to set to disabled
49
+ */
50
+ withDisabledEditorDescriptor(type?: TableviewEditorTypeEnum): this;
45
51
  withTableTitle(title: string): this;
46
52
  withValidator(name: string, expression: FieldValidatorFn): this;
47
53
  addColumnDescriptor<CT>(column: ColumnDescriptor<CT, T>): TableDescriptor<T>;
@@ -1,6 +1,7 @@
1
1
  export declare enum TablePaginationModeEnum {
2
2
  Pagination = 0,
3
- InfiniteScroll = 1
3
+ InfiniteScroll = 1,
4
+ None = 2
4
5
  }
5
6
  export declare enum TableFilterDisplayEnum {
6
7
  Row = 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "0.17.2",
3
+ "version": "0.17.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.1.0",
6
6
  "@angular/core": "^14.1.0",
@@ -33,22 +33,30 @@
33
33
 
34
34
  &.mng-dialog-sm {
35
35
  width: 50vw;
36
- height: initial;
37
- max-height: 90vh;
36
+ height: 70vh;
38
37
 
39
38
  @include mediaMaxLg() {
40
39
  width: 70vw;
40
+ height: 80vh;
41
41
  }
42
42
 
43
43
  @include mediaMaxMd() {
44
44
  width: 80vw;
45
45
  }
46
+
47
+ @include mediaMaxXs() {
48
+ width: 90vw;
49
+ }
46
50
  }
47
51
 
48
52
  &.mng-dialog-xs {
49
- width: 40vw;
53
+ width: 30vw;
50
54
  height: initial;
51
55
 
56
+ @media (max-width: 1500px) {
57
+ width: 45vw;
58
+ }
59
+
52
60
  @include mediaMaxLg() {
53
61
  width: 60vw;
54
62
  }
@@ -56,6 +64,10 @@
56
64
  @include mediaMaxMd() {
57
65
  width: 70vw;
58
66
  }
67
+
68
+ @include mediaMaxXs() {
69
+ width: 90vw;
70
+ }
59
71
  }
60
72
 
61
73
  &.mng-formly-field-lookup-dialog {
@@ -13,25 +13,25 @@
13
13
  padding-right: 0.15rem;
14
14
 
15
15
  // string
16
- &.mng-column-filter-0 {
17
- min-width: 135px;
16
+ .mng-column-filter-0 {
17
+ //min-width: 135px;
18
18
  }
19
19
  // number
20
- &.mng-column-filter-1 {
21
- min-width: 165px;
20
+ .mng-column-filter-1 {
21
+ //min-width: 165px;
22
22
  }
23
23
  // date
24
- &.mng-column-filter-3 {
25
- min-width: 170px;
24
+ .mng-column-filter-3 {
25
+ //min-width: 170px;
26
26
  }
27
27
  // boolean
28
- &.mng-column-filter-2 {
29
- min-width: 80px;
28
+ .mng-column-filter-2 {
29
+ //min-width: 80px;
30
30
  }
31
31
  // lookup, lookup enum
32
- &.mng-column-filter-4,
33
- &.mng-column-filter-5 {
34
- min-width: 180px;
32
+ .mng-column-filter-4,
33
+ .mng-column-filter-5 {
34
+ //min-width: 180px;
35
35
  }
36
36
 
37
37
  .p-column-filter-menu-button,
@@ -80,4 +80,10 @@
80
80
  padding-bottom: 0.05rem;
81
81
  }
82
82
  }
83
+
84
+ &.p-datatable-flex-scrollable {
85
+ .p-datatable-tbody > tr > td {
86
+ overflow: hidden;
87
+ }
88
+ }
83
89
  }
package/version-info.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "0.17.2",
4
- "tag": "v0.17.2",
3
+ "version": "0.17.4",
4
+ "tag": "v0.17.4",
5
5
  "distance": 0,
6
- "hash": "c0561ddc",
6
+ "hash": "7d047036",
7
7
  "dirty": false,
8
- "semver": "0.17.2",
9
- "raw": "v0.17.2-c0561ddc"
8
+ "semver": "0.17.4",
9
+ "raw": "v0.17.4-7d047036"
10
10
  }