valtech-components 4.0.187 → 4.0.189

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.
@@ -2,5 +2,5 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export const VERSION = '4.0.187';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC4xODcnO1xuIl19
5
+ export const VERSION = '4.0.189';
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC4xODknO1xuIl19
@@ -56,7 +56,7 @@ import { BrowserMultiFormatReader } from '@zxing/browser';
56
56
  * Current version of valtech-components.
57
57
  * This is automatically updated during the publish process.
58
58
  */
59
- const VERSION = '4.0.187';
59
+ const VERSION = '4.0.189';
60
60
 
61
61
  // Control de estado de refresco (singleton a nivel de módulo)
62
62
  let isRefreshing = false;
@@ -8284,6 +8284,19 @@ class AuthService {
8284
8284
  if (claims.org) {
8285
8285
  this.stateService.updateActiveOrg(claims.org);
8286
8286
  }
8287
+ // Sync isSuperAdmin from JWT in case IsPlatformAdmin changed since last login
8288
+ const jwtAdmin = claims.admin === true;
8289
+ if (jwtAdmin !== (storedState.isSuperAdmin ?? false)) {
8290
+ const roles = storedState.roles ?? [];
8291
+ const perms = storedState.permissions ?? [];
8292
+ this.stateService.updatePermissions(roles, perms, jwtAdmin);
8293
+ this.storageService.savePermissions({
8294
+ operationId: '',
8295
+ roles,
8296
+ permissions: perms,
8297
+ isSuperAdmin: jwtAdmin,
8298
+ });
8299
+ }
8287
8300
  }
8288
8301
  // 3. Iniciar timer de refresco proactivo
8289
8302
  this.startRefreshTimer();
@@ -8670,6 +8683,19 @@ class AuthService {
8670
8683
  this.stateService.updateRefreshToken(response.refreshToken);
8671
8684
  this.storageService.saveAccessToken(response.accessToken, expiresAt);
8672
8685
  this.storageService.saveRefreshToken(response.refreshToken); // self-gate: no-op en cookieOnly
8686
+ // Sync isSuperAdmin from refreshed JWT so platform admin promotion/revocation
8687
+ // takes effect without requiring a full re-login.
8688
+ const parsedToken = this.tokenService.parseToken(response.accessToken);
8689
+ const newIsSuperAdmin = response.permissions?.includes('*:*') || parsedToken?.admin === true || false;
8690
+ const newRoles = response.roles ?? this.state().roles;
8691
+ const newPerms = response.permissions ?? this.state().permissions;
8692
+ this.stateService.updatePermissions(newRoles, newPerms, newIsSuperAdmin);
8693
+ this.storageService.savePermissions({
8694
+ operationId: '',
8695
+ roles: newRoles,
8696
+ permissions: newPerms,
8697
+ isSuperAdmin: newIsSuperAdmin,
8698
+ });
8673
8699
  if (this.config?.enableFirebaseIntegration && response.firebaseToken) {
8674
8700
  this.signInWithFirebase(response.firebaseToken);
8675
8701
  }
@@ -29621,11 +29647,12 @@ class SectionHeaderComponent {
29621
29647
  title: '',
29622
29648
  ...this.props(),
29623
29649
  }));
29650
+ this.titleClass = computed(() => (this.config().titleSize === 'page' ? 'sh-title sh-title--page' : 'sh-title'));
29624
29651
  }
29625
29652
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SectionHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
29626
29653
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SectionHeaderComponent, isStandalone: true, selector: "val-section-header", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionClick: "actionClick" }, ngImport: i0, template: `
29627
29654
  <div class="sh-row">
29628
- <span class="sh-title">{{ config().title }}</span>
29655
+ <span class="sh-title" [ngClass]="titleClass()">{{ config().title }}</span>
29629
29656
  @if (config().action; as act) {
29630
29657
  <val-button [props]="act" (onClick)="actionClick.emit($event)" />
29631
29658
  }
@@ -29638,13 +29665,13 @@ class SectionHeaderComponent {
29638
29665
  @if (config().subtitle) {
29639
29666
  <p class="sh-subtitle">{{ config().subtitle }}</p>
29640
29667
  }
29641
- `, isInline: true, styles: [":host{display:block}.sh-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sh-title{font-size:1.125rem;font-weight:800;color:var(--val-ink, var(--ion-color-dark, #2f2a36));letter-spacing:-.01em;line-height:1.25;margin:0}.sh-info-link{display:inline-block;margin:4px 0 0;padding:0;background:none;border:none;cursor:pointer;font-size:.8125rem;font-family:inherit;font-weight:600;color:var(--val-section-header-cta-color, var(--ion-color-primary, #3880ff));line-height:1.4;text-align:start}.sh-subtitle{display:block;margin:4px 0 0;font-size:.8125rem;color:var(--val-ink-soft, var(--ion-color-medium, #92949c));line-height:1.4}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "val-button", inputs: ["preset", "props"], outputs: ["onClick"] }] }); }
29668
+ `, isInline: true, styles: [":host{display:block}.sh-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sh-title{font-size:1.125rem;font-weight:800;color:var(--val-ink, var(--ion-color-dark, #2f2a36));letter-spacing:-.01em;line-height:1.25;margin:0}.sh-title--page{font-size:1.5rem;line-height:2rem}@media (min-width: 768px){.sh-title--page{font-size:2rem;line-height:2.5rem}}.sh-info-link{display:inline-block;margin:4px 0 0;padding:0;background:none;border:none;cursor:pointer;font-size:.8125rem;font-family:inherit;font-weight:600;color:var(--val-section-header-cta-color, var(--ion-color-primary, #3880ff));line-height:1.4;text-align:start}.sh-subtitle{display:block;margin:4px 0 0;font-size:.8125rem;color:var(--val-ink-soft, var(--ion-color-medium, #92949c));line-height:1.4}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "val-button", inputs: ["preset", "props"], outputs: ["onClick"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
29642
29669
  }
29643
29670
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SectionHeaderComponent, decorators: [{
29644
29671
  type: Component,
29645
- args: [{ selector: 'val-section-header', standalone: true, imports: [ButtonComponent], template: `
29672
+ args: [{ selector: 'val-section-header', standalone: true, imports: [ButtonComponent, NgClass], template: `
29646
29673
  <div class="sh-row">
29647
- <span class="sh-title">{{ config().title }}</span>
29674
+ <span class="sh-title" [ngClass]="titleClass()">{{ config().title }}</span>
29648
29675
  @if (config().action; as act) {
29649
29676
  <val-button [props]="act" (onClick)="actionClick.emit($event)" />
29650
29677
  }
@@ -29657,7 +29684,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
29657
29684
  @if (config().subtitle) {
29658
29685
  <p class="sh-subtitle">{{ config().subtitle }}</p>
29659
29686
  }
29660
- `, styles: [":host{display:block}.sh-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sh-title{font-size:1.125rem;font-weight:800;color:var(--val-ink, var(--ion-color-dark, #2f2a36));letter-spacing:-.01em;line-height:1.25;margin:0}.sh-info-link{display:inline-block;margin:4px 0 0;padding:0;background:none;border:none;cursor:pointer;font-size:.8125rem;font-family:inherit;font-weight:600;color:var(--val-section-header-cta-color, var(--ion-color-primary, #3880ff));line-height:1.4;text-align:start}.sh-subtitle{display:block;margin:4px 0 0;font-size:.8125rem;color:var(--val-ink-soft, var(--ion-color-medium, #92949c));line-height:1.4}\n"] }]
29687
+ `, styles: [":host{display:block}.sh-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sh-title{font-size:1.125rem;font-weight:800;color:var(--val-ink, var(--ion-color-dark, #2f2a36));letter-spacing:-.01em;line-height:1.25;margin:0}.sh-title--page{font-size:1.5rem;line-height:2rem}@media (min-width: 768px){.sh-title--page{font-size:2rem;line-height:2.5rem}}.sh-info-link{display:inline-block;margin:4px 0 0;padding:0;background:none;border:none;cursor:pointer;font-size:.8125rem;font-family:inherit;font-weight:600;color:var(--val-section-header-cta-color, var(--ion-color-primary, #3880ff));line-height:1.4;text-align:start}.sh-subtitle{display:block;margin:4px 0 0;font-size:.8125rem;color:var(--val-ink-soft, var(--ion-color-medium, #92949c));line-height:1.4}\n"] }]
29661
29688
  }], propDecorators: { actionClick: [{
29662
29689
  type: Output
29663
29690
  }] } });
@@ -54584,6 +54611,7 @@ class OrganizationViewComponent {
54584
54611
  });
54585
54612
  this.switchOrgSectionProps = computed(() => ({
54586
54613
  title: this.pageTitle(),
54614
+ titleSize: 'page',
54587
54615
  action: {
54588
54616
  text: this.tt('switchOrgCta'),
54589
54617
  icon: { name: 'swap-horizontal-outline', slot: 'start' },