@mediusinc/mng-commons 0.19.1 → 0.19.2
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/components/layout/services/main-layout.component.service.mjs +3 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +21 -15
- package/esm2020/lib/models/config.model.mjs +1 -1
- package/esm2020/lib/services/commons.service.mjs +6 -1
- package/fesm2015/mediusinc-mng-commons.mjs +33 -20
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +27 -14
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/models/config.model.d.ts +1 -0
- package/lib/services/commons.service.d.ts +2 -0
- package/package.json +1 -1
- package/version-info.json +5 -5
|
@@ -7362,6 +7362,7 @@ class MngCommonsService {
|
|
|
7362
7362
|
this._menuModeSubject = new BehaviorSubject(this._menuMode);
|
|
7363
7363
|
this._menuItems = [];
|
|
7364
7364
|
this._menuPinEnabled = false;
|
|
7365
|
+
this._menuSidebarSlim = false;
|
|
7365
7366
|
this._menuActiveKeySubject = new Subject();
|
|
7366
7367
|
this._menuResetSubject = new Subject();
|
|
7367
7368
|
// breadcrumbs
|
|
@@ -7473,6 +7474,9 @@ class MngCommonsService {
|
|
|
7473
7474
|
get menuPinEnabled() {
|
|
7474
7475
|
return this._menuPinEnabled;
|
|
7475
7476
|
}
|
|
7477
|
+
get menuSidebarSlim() {
|
|
7478
|
+
return this._menuSidebarSlim;
|
|
7479
|
+
}
|
|
7476
7480
|
// BREADCRUMB section
|
|
7477
7481
|
get breadcrumbHome$() {
|
|
7478
7482
|
return this.breadcrumbHomeSubject.asObservable();
|
|
@@ -7513,6 +7517,7 @@ class MngCommonsService {
|
|
|
7513
7517
|
this._menuModeSubject.next(this._menuMode);
|
|
7514
7518
|
this._menuItems = this.moduleConfig?.menu?.menuItems ?? [];
|
|
7515
7519
|
this._menuPinEnabled = this.moduleConfig?.menu?.pinEnabled ?? false;
|
|
7520
|
+
this._menuSidebarSlim = this.moduleConfig?.menu?.sidebarSlim ?? false;
|
|
7516
7521
|
// visual
|
|
7517
7522
|
this._colorScheme = this.moduleConfig?.app?.colorScheme ?? 'light';
|
|
7518
7523
|
// ripple
|
|
@@ -9708,14 +9713,16 @@ class MngTableComponent {
|
|
|
9708
9713
|
}
|
|
9709
9714
|
ngOnInit() {
|
|
9710
9715
|
this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
|
|
9716
|
+
// Used for configs within this method and is not dynamically set by TableDynamicDescriptor
|
|
9717
|
+
const baseConfigDescriptor = this.initialDescriptor;
|
|
9711
9718
|
if (!(this.initialDescriptor instanceof TableDynamicDescriptor)) {
|
|
9712
9719
|
this.descriptor = this.initialDescriptor;
|
|
9713
9720
|
}
|
|
9714
9721
|
// map row settings
|
|
9715
9722
|
this.filterDescriptors = this.descriptor?.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor) ?? [];
|
|
9716
9723
|
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9717
|
-
this.rows =
|
|
9718
|
-
this.rowsPerPageOptions =
|
|
9724
|
+
this.rows = baseConfigDescriptor?.defaultNumRows ?? 25;
|
|
9725
|
+
this.rowsPerPageOptions = baseConfigDescriptor?.rowsPerPageOptions ?? [25, 50, 100];
|
|
9719
9726
|
// process actions
|
|
9720
9727
|
for (const action of this.actions) {
|
|
9721
9728
|
switch (action.position) {
|
|
@@ -9729,14 +9736,14 @@ class MngTableComponent {
|
|
|
9729
9736
|
}
|
|
9730
9737
|
this.showInlineActionsColumn = typeof this.columnActionComponent !== 'undefined' || this.rowInlineActions.length > 0;
|
|
9731
9738
|
// define all styles
|
|
9732
|
-
this.className =
|
|
9733
|
-
this.tableFullHeightOffset =
|
|
9734
|
-
this.rowHeight =
|
|
9739
|
+
this.className = baseConfigDescriptor?.className ?? '';
|
|
9740
|
+
this.tableFullHeightOffset = baseConfigDescriptor?.tableFullHeightOffset ?? null;
|
|
9741
|
+
this.rowHeight = baseConfigDescriptor?.rowHeight ?? null;
|
|
9735
9742
|
if (typeof this.isColumnClickable === 'undefined') {
|
|
9736
9743
|
// define if cell click is being observed via output
|
|
9737
9744
|
this.isColumnClickable = this.rowClickActions.length > 0 || this.cellClickEventEmitter.observed;
|
|
9738
9745
|
}
|
|
9739
|
-
switch (
|
|
9746
|
+
switch (baseConfigDescriptor?.size) {
|
|
9740
9747
|
case TableSizeEnum.Small:
|
|
9741
9748
|
this.className += ' p-datatable-sm';
|
|
9742
9749
|
break;
|
|
@@ -9744,17 +9751,17 @@ class MngTableComponent {
|
|
|
9744
9751
|
this.className += ' p-datatable-lg';
|
|
9745
9752
|
break;
|
|
9746
9753
|
}
|
|
9747
|
-
if (
|
|
9754
|
+
if (baseConfigDescriptor?.hasGridlines) {
|
|
9748
9755
|
this.className += ' p-datatable-gridlines';
|
|
9749
9756
|
}
|
|
9750
|
-
if (
|
|
9751
|
-
this.columnActionMinWidth = StylesUtil.calculateTableColumnActionWidth(
|
|
9757
|
+
if (baseConfigDescriptor && !this.columnActionMinWidth) {
|
|
9758
|
+
this.columnActionMinWidth = StylesUtil.calculateTableColumnActionWidth(baseConfigDescriptor, this.rowInlineActions);
|
|
9752
9759
|
}
|
|
9753
9760
|
// check if infinite scroll
|
|
9754
9761
|
let paginationMode = TablePaginationModeEnum.None;
|
|
9755
|
-
if (typeof
|
|
9762
|
+
if (typeof baseConfigDescriptor?.paginationMode !== 'undefined') {
|
|
9756
9763
|
// descriptor choice is the most strong - if defined, use this value
|
|
9757
|
-
paginationMode =
|
|
9764
|
+
paginationMode = baseConfigDescriptor.paginationMode;
|
|
9758
9765
|
}
|
|
9759
9766
|
else if (typeof this.dataProvider !== 'undefined') {
|
|
9760
9767
|
// when data provider is used, use pagination
|
|
@@ -9762,8 +9769,8 @@ class MngTableComponent {
|
|
|
9762
9769
|
}
|
|
9763
9770
|
if (paginationMode === TablePaginationModeEnum.InfiniteScroll) {
|
|
9764
9771
|
this.infiniteScroll = true;
|
|
9765
|
-
this.tableFullHeightOffset =
|
|
9766
|
-
this.rowHeight =
|
|
9772
|
+
this.tableFullHeightOffset = baseConfigDescriptor?.tableFullHeightOffset ?? 315;
|
|
9773
|
+
this.rowHeight = baseConfigDescriptor?.rowHeight ?? 45;
|
|
9767
9774
|
this.useQueryParams = false;
|
|
9768
9775
|
}
|
|
9769
9776
|
else if (paginationMode === TablePaginationModeEnum.Pagination) {
|
|
@@ -9817,7 +9824,7 @@ class MngTableComponent {
|
|
|
9817
9824
|
}
|
|
9818
9825
|
const initialQueryParamMap = this.route.snapshot.queryParamMap;
|
|
9819
9826
|
if (this.useQueryParams &&
|
|
9820
|
-
((!initialQueryParamMap.has('sort') &&
|
|
9827
|
+
((!initialQueryParamMap.has('sort') && baseConfigDescriptor?.hasDefaultSort) ||
|
|
9821
9828
|
(!initialQueryParamMap.has('filter') && this.filterDescriptors.some(fd => fd.hasDefaultValue)))) {
|
|
9822
9829
|
// default sort/filters are applied, no additional filtering/sorting is specified in query param
|
|
9823
9830
|
// redirect must be done at first step
|
|
@@ -9951,6 +9958,10 @@ class MngTableComponent {
|
|
|
9951
9958
|
this.descriptor = this.initialDescriptor.toTableDescriptorFromData(res);
|
|
9952
9959
|
this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
|
|
9953
9960
|
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9961
|
+
this.isPagination = false;
|
|
9962
|
+
this.infiniteScroll = false;
|
|
9963
|
+
this.rows = this.initialDescriptor.defaultNumRows;
|
|
9964
|
+
this.rowsPerPageOptions = this.initialDescriptor.rowsPerPageOptions;
|
|
9954
9965
|
// } else {
|
|
9955
9966
|
// this.descriptor = this.initialDescriptor.onDataReceivedTypeBuilding(res);
|
|
9956
9967
|
}
|
|
@@ -10968,6 +10979,8 @@ class MngMainLayoutComponentService {
|
|
|
10968
10979
|
this._pinActiveSubject = new BehaviorSubject(this._pinActive);
|
|
10969
10980
|
this._innerWidth = 1920;
|
|
10970
10981
|
this._innerWidthSubject = new BehaviorSubject(this._innerWidth);
|
|
10982
|
+
this.sidebarActive = !mngCommons.menuSidebarSlim;
|
|
10983
|
+
this.sidebarStatic = !mngCommons.menuSidebarSlim;
|
|
10971
10984
|
}
|
|
10972
10985
|
get overlayMenuActive$() {
|
|
10973
10986
|
return this._overlayMenuActiveSubject.asObservable();
|