@lukfel/ng-scaffold 20.0.46 → 20.0.47

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.
@@ -1244,18 +1244,45 @@ class ScaffoldComponent {
1244
1244
  this._subscription.add(this.breakpointService.breakpoint$.subscribe((breakpointState) => {
1245
1245
  if (this.libraryConfig?.debugging)
1246
1246
  this.logger.log('[BreakpointState]', breakpointState);
1247
+ let isMobile = false;
1247
1248
  if (breakpointState.breakpoints[Breakpoints.XSmall]) {
1248
- this.isMobile = true;
1249
+ isMobile = true;
1249
1250
  }
1250
1251
  else if (breakpointState.breakpoints[Breakpoints.Small]) {
1251
- this.isMobile = true;
1252
+ isMobile = true;
1252
1253
  }
1253
1254
  else if (breakpointState.breakpoints[Breakpoints.Medium]) {
1254
- this.isMobile = false;
1255
+ isMobile = false;
1255
1256
  }
1256
1257
  else if (breakpointState.breakpoints[Breakpoints.Large]) {
1257
- this.isMobile = false;
1258
+ isMobile = false;
1258
1259
  }
1260
+ if (this.headerConfig?.responsiveConfig?.enable) {
1261
+ const config = this.headerConfig.responsiveConfig;
1262
+ if (isMobile && !this.isMobile) {
1263
+ const rightMenuButtons = [...this.headerConfig?.rightMenuButtons || []];
1264
+ this.previousRightMenuButtons = [...rightMenuButtons];
1265
+ const excludedButtons = rightMenuButtons.filter((button) => config?.excludeButtonIds?.includes(button.id));
1266
+ const includedButtons = rightMenuButtons.filter((button) => !config?.excludeButtonIds?.includes(button.id));
1267
+ if (rightMenuButtons?.length) {
1268
+ const updatedHeaderConfig = {
1269
+ ...this.headerConfig,
1270
+ rightMenuButtons: [...excludedButtons, { id: 'menu', matIcon: (!config.matIcon && !config.svgLogo) ? 'more_vert' : config.matIcon, svgIcon: config.svgLogo, menuButtons: [...includedButtons] }]
1271
+ };
1272
+ this.headerConfigUpdated(updatedHeaderConfig);
1273
+ }
1274
+ }
1275
+ else if (!isMobile && this.isMobile) {
1276
+ if (this.previousRightMenuButtons?.length) {
1277
+ const updatedHeaderConfig = {
1278
+ ...this.headerConfig,
1279
+ rightMenuButtons: [...this.previousRightMenuButtons]
1280
+ };
1281
+ this.headerConfigUpdated(updatedHeaderConfig);
1282
+ }
1283
+ }
1284
+ }
1285
+ this.isMobile = isMobile;
1259
1286
  }));
1260
1287
  // Listen for route changes
1261
1288
  this._subscription.add(this.routerService.routeHistory$.subscribe((routeHistory) => {