@solcre-org/core-ui 2.15.13 → 2.15.14

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.
@@ -10950,8 +10950,29 @@ class HeaderService {
10950
10950
  this.showDefaultFilter.set(config.showDefaultFilter);
10951
10951
  if (config.showDefaultCreate !== undefined)
10952
10952
  this.showDefaultCreate.set(config.showDefaultCreate);
10953
- if (config.customActions !== undefined)
10953
+ if (config.customActions !== undefined) {
10954
10954
  this.customActions.set(config.customActions);
10955
+ const headerActions = config.customActions
10956
+ .filter(action => {
10957
+ if (!action.mobileConfig)
10958
+ return false;
10959
+ return action.mobileConfig.showInHeader === true;
10960
+ })
10961
+ .map(action => ({
10962
+ id: action.id,
10963
+ buttonConfig: {
10964
+ type: this.getButtonTypeFromClass(action.class || ''),
10965
+ text: action.label,
10966
+ icon: action.icon,
10967
+ disabled: action.disabled,
10968
+ ariaLabel: action.label,
10969
+ customClass: action.class || '',
10970
+ requiredPermission: action.requiredPermission
10971
+ },
10972
+ callback: action.callback
10973
+ }));
10974
+ this.headerActions.set(headerActions);
10975
+ }
10955
10976
  if (config.globalActions !== undefined)
10956
10977
  this.globalActions.set(config.globalActions);
10957
10978
  if (config.customFilters !== undefined)
@@ -10975,6 +10996,19 @@ class HeaderService {
10975
10996
  if (config.refreshCallback !== undefined)
10976
10997
  this.refreshCallback.set(config.refreshCallback);
10977
10998
  }
10999
+ getButtonTypeFromClass(className) {
11000
+ if (className.includes('c-btn--primary'))
11001
+ return 'primary';
11002
+ if (className.includes('c-btn--secondary'))
11003
+ return 'secondary';
11004
+ if (className.includes('c-btn--stroke'))
11005
+ return 'stroke';
11006
+ if (className.includes('c-link'))
11007
+ return 'link';
11008
+ if (className.includes('c-icon-btn'))
11009
+ return 'icon';
11010
+ return 'primary';
11011
+ }
10978
11012
  getIsVisible() {
10979
11013
  return this.isVisible;
10980
11014
  }
@@ -11047,17 +11081,19 @@ class HeaderService {
11047
11081
  getOrderedElements() {
11048
11082
  const order = this.headerOrder();
11049
11083
  if (!order || !order.useCustomOrder || !order.elements) {
11050
- return [
11084
+ const defaultElements = [
11051
11085
  { type: HeaderElementType.GLOBAL_ACTIONS, visible: true, position: 1 },
11052
11086
  { type: HeaderElementType.CUSTOM_ACTIONS, visible: true, position: 2 },
11053
11087
  { type: HeaderElementType.FILTER, visible: true, position: 3 },
11054
11088
  { type: HeaderElementType.CREATE, visible: true, position: 4 },
11055
11089
  { type: HeaderElementType.CUSTOM_TEMPLATE, visible: true, position: 5 }
11056
11090
  ];
11091
+ return defaultElements;
11057
11092
  }
11058
- return order.elements
11093
+ const customElements = order.elements
11059
11094
  .filter(element => element.visible !== false)
11060
11095
  .sort((a, b) => (a.position || 0) - (b.position || 0));
11096
+ return customElements;
11061
11097
  }
11062
11098
  isElementVisible(elementType) {
11063
11099
  const order = this.headerOrder();
@@ -11066,7 +11102,8 @@ class HeaderService {
11066
11102
  case HeaderElementType.GLOBAL_ACTIONS:
11067
11103
  return this.globalActions().length > 0;
11068
11104
  case HeaderElementType.CUSTOM_ACTIONS:
11069
- return this.customActions().length > 0;
11105
+ const hasCustomActions = this.customActions().length > 0;
11106
+ return hasCustomActions;
11070
11107
  case HeaderElementType.FILTER:
11071
11108
  return this.showDefaultFilter() && (this.showFilter() || this.customFilters().length > 0);
11072
11109
  case HeaderElementType.CREATE:
@@ -15275,6 +15312,7 @@ class HeaderComponent {
15275
15312
  headerService = inject(HeaderService);
15276
15313
  permissionService = inject(PermissionWrapperService);
15277
15314
  cdr = inject(ChangeDetectorRef);
15315
+ mobileResolutionService = inject(MobileResolutionService);
15278
15316
  HeaderElementType = HeaderElementType;
15279
15317
  title = 'ASDSAS';
15280
15318
  user;
@@ -15420,7 +15458,20 @@ class HeaderComponent {
15420
15458
  hasPermission(action) {
15421
15459
  if (!action.requiredPermission)
15422
15460
  return true;
15423
- return this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action);
15461
+ const hasPermission = this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action);
15462
+ if (!hasPermission)
15463
+ return false;
15464
+ const isMobile = this.mobileResolutionService.isMobile();
15465
+ if (!action.mobileConfig) {
15466
+ return true;
15467
+ }
15468
+ if (isMobile) {
15469
+ if (action.mobileConfig.showInHeader === false) {
15470
+ return false;
15471
+ }
15472
+ return true;
15473
+ }
15474
+ return true;
15424
15475
  }
15425
15476
  isGlobalActionDisabled(action) {
15426
15477
  return action.isDisabled ?? false;
@@ -15440,7 +15491,21 @@ class HeaderComponent {
15440
15491
  return this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action);
15441
15492
  }
15442
15493
  isCustomActionVisible(action) {
15443
- return action.visible !== false && this.hasCustomActionPermission(action);
15494
+ if (action.visible === false)
15495
+ return false;
15496
+ if (!this.hasCustomActionPermission(action))
15497
+ return false;
15498
+ const isMobile = this.mobileResolutionService.isMobile();
15499
+ if (!action.mobileConfig) {
15500
+ return true;
15501
+ }
15502
+ if (isMobile) {
15503
+ if (action.mobileConfig.showInHeader === false) {
15504
+ return false;
15505
+ }
15506
+ return true;
15507
+ }
15508
+ return true;
15444
15509
  }
15445
15510
  isCustomActionDisabled(action) {
15446
15511
  return action.disabled ?? false;
@@ -15451,7 +15516,8 @@ class HeaderComponent {
15451
15516
  }
15452
15517
  }
15453
15518
  getHeaderTitle() {
15454
- return this.headerService.getTitle()();
15519
+ const title = this.headerService.getTitle()();
15520
+ return title;
15455
15521
  }
15456
15522
  getHeaderText() {
15457
15523
  return this.headerService.getText()();
@@ -15599,11 +15665,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
15599
15665
  // Este archivo es generado automáticamente por scripts/update-version.js
15600
15666
  // No edites manualmente este archivo
15601
15667
  const VERSION = {
15602
- full: '2.15.13',
15668
+ full: '2.15.14',
15603
15669
  major: 2,
15604
15670
  minor: 15,
15605
- patch: 13,
15606
- timestamp: '2025-10-13T14:12:52.608Z',
15671
+ patch: 14,
15672
+ timestamp: '2025-10-13T16:35:20.106Z',
15607
15673
  buildDate: '13/10/2025'
15608
15674
  };
15609
15675