@nettyapps/ntybase 21.1.9 → 21.1.12

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.
@@ -1607,28 +1607,37 @@ class NettyAgGridBase extends NettyAppsBase {
1607
1607
  // ---------------------------------------------
1608
1608
  onShowHideColumns() {
1609
1609
  this.gridColumnsVisible.update((a) => !a);
1610
- this.showHideColumnsAsync();
1611
- }
1612
- showHideColumnsAsync() {
1613
- setTimeout(() => this.showHideColumns(), 400);
1614
- }
1615
- showHideColumns() {
1616
- var fields = this.columnDefs()
1617
- .filter((columnDef) => columnDef.ntyHide === 'x')
1618
- .map((columnDef) => columnDef.field);
1619
- this.gridApi?.setColumnsVisible(fields, this.gridColumnsVisible());
1620
- }
1621
- showHideEmbeddedColumnsAsync() {
1622
- setTimeout(() => this.showHideEmbeddedColumns(), 100);
1610
+ this.initAgGrid();
1623
1611
  }
1624
- showHideEmbeddedColumns() {
1625
- if (this.columnDefs() == undefined || this.columnDefs() == null) {
1626
- return;
1627
- }
1628
- var fields = this.columnDefs()
1629
- .filter((columnDef) => columnDef.ntyEmbeddedHide == 'x')
1630
- .map((columnDef) => columnDef.field);
1631
- this.gridApi?.setColumnsVisible(fields, !this._isEmbedded());
1612
+ // showHideColumnsAsync() {
1613
+ // setTimeout(() => this.showHideColumns(), 400);
1614
+ // }
1615
+ // showHideColumns() {
1616
+ // var fields = this.columnDefs()
1617
+ // .filter((columnDef: any) => columnDef.ntyHide === 'x')
1618
+ // .map((columnDef: any) => columnDef.field);
1619
+ // this.gridApi?.setColumnsVisible(fields, this.gridColumnsVisible());
1620
+ // }
1621
+ // showHideEmbeddedColumnsAsync() {
1622
+ // setTimeout(() => this.showHideEmbeddedColumns(), 100);
1623
+ // }
1624
+ // showHideEmbeddedColumns() {
1625
+ // if (this.columnDefs() == undefined || this.columnDefs() == null) {
1626
+ // return;
1627
+ // }
1628
+ // var fields = this.columnDefs()
1629
+ // .filter((columnDef: any) => columnDef.ntyEmbeddedHide == 'x')
1630
+ // .map((columnDef: any) => columnDef.field);
1631
+ // this.gridApi?.setColumnsVisible(fields, !this._isEmbedded());
1632
+ // }
1633
+ isHidden(isEmbeddedHide, isVisibleHide) {
1634
+ const isEmbedded = this._isEmbedded();
1635
+ const isVisibleSwitchOn = this.gridColumnsVisible();
1636
+ if (isVisibleHide && !isVisibleSwitchOn)
1637
+ return true;
1638
+ if (isEmbeddedHide && isEmbedded)
1639
+ return true;
1640
+ return false;
1632
1641
  }
1633
1642
  // *****************************************
1634
1643
  // *** Logging Functions ***
@@ -1999,15 +2008,13 @@ class NettyAgGridListBase extends NettyAgGridBase {
1999
2008
  }
2000
2009
  if (this.hasValidValue(this.parameterGUID())) {
2001
2010
  this.setFilter();
2002
- if (this._isEmbedded()) {
2003
- this.loadData();
2004
- }
2005
- //this.loadData();
2011
+ this.loadData();
2006
2012
  }
2007
2013
  else if (!this._isPopupValid()) {
2008
2014
  // Clear right side nav if parameterGUID is not provided
2009
2015
  this.commonService.clearOutlet();
2010
2016
  }
2017
+ console.log("effect.", this.parameterGUID());
2011
2018
  });
2012
2019
  effect(() => {
2013
2020
  const update = this.commonService.updates();
@@ -2026,7 +2033,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
2026
2033
  // Manage filter expanded state
2027
2034
  effect(() => {
2028
2035
  this._isEmbedded();
2029
- this.showHideEmbeddedColumnsAsync();
2036
+ this.initAgGrid();
2030
2037
  });
2031
2038
  effect(() => {
2032
2039
  const name = this.pageName();
@@ -2041,6 +2048,27 @@ class NettyAgGridListBase extends NettyAgGridBase {
2041
2048
  });
2042
2049
  }
2043
2050
  });
2051
+ effect(() => {
2052
+ const isEmbedded = this._isEmbedded();
2053
+ const currentPref = this.preferenceType();
2054
+ const currentSearch = this.searchValueName();
2055
+ if (isEmbedded) {
2056
+ if (currentPref && !currentPref.endsWith('_isEmbedded')) {
2057
+ this.preferenceType.set(`${currentPref}_isEmbedded`);
2058
+ }
2059
+ if (currentSearch && !currentSearch.endsWith('_isEmbedded')) {
2060
+ this.searchValueName.set(`${currentSearch}_isEmbedded`);
2061
+ }
2062
+ }
2063
+ else {
2064
+ if (currentPref?.endsWith('_isEmbedded')) {
2065
+ this.preferenceType.set(currentPref.replace('_isEmbedded', ''));
2066
+ }
2067
+ if (currentSearch?.endsWith('_isEmbedded')) {
2068
+ this.searchValueName.set(currentSearch.replace('_isEmbedded', ''));
2069
+ }
2070
+ }
2071
+ });
2044
2072
  }
2045
2073
  /**
2046
2074
  * Validates if the given value is equal to null,undefined or ''
@@ -4570,5 +4598,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
4570
4598
  * Generated bundle index. Do not edit.
4571
4599
  */
4572
4600
 
4573
- export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridListBase, NettyAgGridListFilterBase, NettyAgGridLogBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyAppsFilterBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyLoadingComponent, NtyLoadingInterceptor, Ntybase, NtybaseModule, PageTitle, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor };
4601
+ export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridListBase, NettyAgGridListFilterBase, NettyAgGridLogBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyAppsFilterBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyLoadingComponent, NtyLoadingInterceptor, NtyLoadingService, Ntybase, NtybaseModule, PageTitle, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor };
4574
4602
  //# sourceMappingURL=nettyapps-ntybase.mjs.map