@edm-sdui/sdui 1.0.26 → 1.0.28

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.
Files changed (42) hide show
  1. package/edm-sdui-sdui-1.0.28.tgz +0 -0
  2. package/esm2022/lib/components/uicomponent/profile-button/profile-button.component.mjs +30 -20
  3. package/esm2022/lib/components/uiscreen/uiscreen.component.mjs +9 -3
  4. package/esm2022/lib/core/services/ui-action.service.mjs +29 -1
  5. package/esm2022/lib/core/services/uiscreen.service.mjs +22 -2
  6. package/esm2022/lib/core/uicomposition/enums/uiscreen-container-type.mjs +6 -0
  7. package/esm2022/lib/core/uicomposition/models/uiscreen-config.mjs +2 -0
  8. package/esm2022/lib/core/uicomposition/models/uiscreen.mjs +1 -1
  9. package/esm2022/lib/core/uicomposition/models/uiview.mjs +1 -1
  10. package/esm2022/lib/core/uitheme/enums/uiaction-type.mjs +2 -1
  11. package/esm2022/lib/core/uitheme/enums/uiasset.mjs +5 -1
  12. package/esm2022/lib/core/uitheme/enums/uisize.mjs +3 -1
  13. package/esm2022/lib/core/uitheme/mapping/asset-mapping.mjs +5 -1
  14. package/esm2022/lib/core/uitheme/mapping/size-mapping.mjs +5 -1
  15. package/esm2022/lib/directives/uiview.directive.mjs +4 -1
  16. package/fesm2022/edm-sdui-sdui.mjs +104 -22
  17. package/fesm2022/edm-sdui-sdui.mjs.map +1 -1
  18. package/lib/components/uicomponent/profile-button/profile-button.component.d.ts.map +1 -1
  19. package/lib/components/uiscreen/uiscreen.component.d.ts +2 -0
  20. package/lib/components/uiscreen/uiscreen.component.d.ts.map +1 -1
  21. package/lib/core/services/ui-action.service.d.ts +1 -0
  22. package/lib/core/services/ui-action.service.d.ts.map +1 -1
  23. package/lib/core/services/uiscreen.service.d.ts +1 -0
  24. package/lib/core/services/uiscreen.service.d.ts.map +1 -1
  25. package/lib/core/uicomposition/enums/uiscreen-container-type.d.ts +5 -0
  26. package/lib/core/uicomposition/enums/uiscreen-container-type.d.ts.map +1 -0
  27. package/lib/core/uicomposition/models/uiscreen-config.d.ts +6 -0
  28. package/lib/core/uicomposition/models/uiscreen-config.d.ts.map +1 -0
  29. package/lib/core/uicomposition/models/uiscreen.d.ts +2 -0
  30. package/lib/core/uicomposition/models/uiscreen.d.ts.map +1 -1
  31. package/lib/core/uicomposition/models/uiview.d.ts +1 -0
  32. package/lib/core/uicomposition/models/uiview.d.ts.map +1 -1
  33. package/lib/core/uitheme/enums/uiaction-type.d.ts +1 -0
  34. package/lib/core/uitheme/enums/uiaction-type.d.ts.map +1 -1
  35. package/lib/core/uitheme/enums/uiasset.d.ts +5 -1
  36. package/lib/core/uitheme/enums/uiasset.d.ts.map +1 -1
  37. package/lib/core/uitheme/enums/uisize.d.ts +2 -0
  38. package/lib/core/uitheme/enums/uisize.d.ts.map +1 -1
  39. package/lib/core/uitheme/mapping/asset-mapping.d.ts.map +1 -1
  40. package/lib/core/uitheme/mapping/size-mapping.d.ts.map +1 -1
  41. package/lib/directives/uiview.directive.d.ts.map +1 -1
  42. package/package.json +1 -1
@@ -90,14 +90,19 @@ class UIScreenService {
90
90
  .pipe(map((json) => this.mapToUIScreen(json)));
91
91
  }
92
92
  mapToUIScreen(json) {
93
- const { identifier, content } = json;
93
+ const { identifier, content, config } = json;
94
94
  if (!identifier) {
95
95
  throw new Error(`Identificador da tela ausente no JSON recebido.`);
96
96
  }
97
97
  const layout = this.getLayout(identifier, content);
98
+ const normalizedConfig = config ??
99
+ (json.container
100
+ ? { container: json.container }
101
+ : null);
98
102
  return {
99
103
  identifier: identifier,
100
104
  content: layout,
105
+ config: this.mapToUIScreenConfig(normalizedConfig),
101
106
  ...this.mapToUIView(json),
102
107
  };
103
108
  }
@@ -173,6 +178,7 @@ class UIScreenService {
173
178
  }
174
179
  mapToUIView(json) {
175
180
  return {
181
+ id: json.id ?? null,
176
182
  padding: json.padding,
177
183
  background: json.background ? this.mapBackground(json.background) : null,
178
184
  action: json.action ? this.mapAction(json.action) : null,
@@ -191,6 +197,19 @@ class UIScreenService {
191
197
  justify: json.justify ? json.justify : null,
192
198
  };
193
199
  }
200
+ mapToUIScreenConfig(config) {
201
+ if (!config) {
202
+ return null;
203
+ }
204
+ const containerValue = config.container;
205
+ const containerNormalized = containerValue
206
+ ? String(containerValue).toLowerCase()
207
+ : null;
208
+ return {
209
+ alwaysReload: config.always_reload ?? config.alwaysReload ?? null,
210
+ container: containerNormalized,
211
+ };
212
+ }
194
213
  mapBackground(json) {
195
214
  return {
196
215
  backgroundColor: json.background_color ? json.background_color : null,
@@ -203,6 +222,7 @@ class UIScreenService {
203
222
  canAccess: json.can_acces ?? null,
204
223
  type: json.type ? json.type : null,
205
224
  url: json.url ?? null,
225
+ param: json.param ?? null,
206
226
  };
207
227
  }
208
228
  mapRadius(json) {
@@ -422,6 +442,7 @@ var UIActionType;
422
442
  UIActionType["DISMISS_TO_SCENE"] = "DISMISS_TO_SCENE";
423
443
  UIActionType["EXTERNAL_URL"] = "EXTERNAL_URL";
424
444
  UIActionType["WEBVIEW_URL"] = "WEBVIEW_URL";
445
+ UIActionType["ANCHOR"] = "ANCHOR";
425
446
  // paywall
426
447
  UIActionType["PAYWALL"] = "PAYWALL";
427
448
  UIActionType["REGISTER"] = "REGISTER";
@@ -547,9 +568,37 @@ class UIActionService {
547
568
  const modal = this.modalService.open(action.url);
548
569
  }
549
570
  break;
571
+ case UIActionType.ANCHOR:
572
+ this.scrollToAnchor(action);
573
+ break;
550
574
  // Outros tipos de ação podem ser adicionados aqui
551
575
  }
552
576
  }
577
+ scrollToAnchor(action) {
578
+ // Confluence: param = string para uso geral; aqui priorizamos param como id do elemento
579
+ const raw = action.param || action.url || '';
580
+ const targetId = String(raw).replace(/^#/, '').trim();
581
+ if (!targetId) {
582
+ console.warn('[UIActionService] ANCHOR sem destino informado');
583
+ return;
584
+ }
585
+ const el = document.getElementById(targetId);
586
+ if (!el) {
587
+ console.warn('[UIActionService] ANCHOR não encontrou elemento com id:', targetId);
588
+ return;
589
+ }
590
+ try {
591
+ el.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
592
+ }
593
+ catch {
594
+ el.scrollIntoView();
595
+ }
596
+ // guarda o último anchor acessado (usado pelo app host para restaurar)
597
+ try {
598
+ sessionStorage.setItem('exploreLastAnchor', targetId);
599
+ }
600
+ catch { }
601
+ }
553
602
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UIActionService, deps: [{ token: i1$3.Router }, { token: ModalService }, { token: UIActionHandlersService }], target: i0.ɵɵFactoryTarget.Injectable }); }
554
603
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UIActionService, providedIn: 'root' }); }
555
604
  }
@@ -751,6 +800,9 @@ var UIAsset;
751
800
  UIAsset["IC_LINK_LIST"] = "ic_link_list";
752
801
  UIAsset["IC_LINK_LIST_DISABLED"] = "ic_link_list_disabled";
753
802
  UIAsset["IC_LIVE_WAITING"] = "ic_live_waiting";
803
+ UIAsset["IC_PLAY_VIEW_EXPLORER"] = "ic_play_view_explorer";
804
+ UIAsset["IC_RATING_EXPLORER"] = "ic_rating_explorer";
805
+ UIAsset["IC_CHECK_EXPLORER"] = "ic_check_explorer";
754
806
  UIAsset["IC_LOCK"] = "ic_lock";
755
807
  UIAsset["IC_LOCK_CHECK"] = "ic_lock_check";
756
808
  UIAsset["IC_LOCK_LESSON"] = "ic_lock_lesson";
@@ -927,6 +979,7 @@ var UIAsset;
927
979
  UIAsset["BT_NEXT_PROFILE"] = "bt_next_profile";
928
980
  UIAsset["IC_SUPPORT_PROFILE"] = "ic_support_profile";
929
981
  UIAsset["BT_BACK_SEC"] = "bt_back_sec";
982
+ UIAsset["IC_EXPLORER_EMPTY"] = "ic_explorer_empty";
930
983
  })(UIAsset || (UIAsset = {}));
931
984
 
932
985
  const assetMapping = {
@@ -1118,6 +1171,9 @@ const assetMapping = {
1118
1171
  [UIAsset.IC_LINK_LIST]: 'assets/images/ic-link-list.svg',
1119
1172
  [UIAsset.IC_LINK_LIST_DISABLED]: 'assets/images/ic-link-list-disabled.svg',
1120
1173
  [UIAsset.IC_LIVE_WAITING]: 'assets/images/ic-live-waiting.svg',
1174
+ [UIAsset.IC_PLAY_VIEW_EXPLORER]: 'assets/images/ic-play-view-explorer.svg',
1175
+ [UIAsset.IC_RATING_EXPLORER]: 'assets/images/ic-rating-explorer.svg',
1176
+ [UIAsset.IC_CHECK_EXPLORER]: 'assets/images/ic-check-explorer.svg',
1121
1177
  [UIAsset.IC_LOCK]: 'assets/images/ic-lock.svg',
1122
1178
  [UIAsset.IC_LOCK_CHECK]: 'assets/images/ic-lock-check.svg',
1123
1179
  [UIAsset.IC_LOCK_LESSON]: 'assets/images/ic-lock-lesson.svg',
@@ -1297,6 +1353,7 @@ const assetMapping = {
1297
1353
  [UIAsset.BT_NEXT_PROFILE]: 'assets/images/bt-next-profile.svg',
1298
1354
  [UIAsset.IC_SUPPORT_PROFILE]: 'assets/images/ic-support-profile.svg',
1299
1355
  [UIAsset.BT_BACK_SEC]: 'assets/images/bt-back-sec.svg',
1356
+ [UIAsset.IC_EXPLORER_EMPTY]: 'assets/images/ic-explorer-empty.svg'
1300
1357
  };
1301
1358
 
1302
1359
  var UISpacingLevel;
@@ -1778,6 +1835,9 @@ class UIViewDirective {
1778
1835
  }
1779
1836
  }
1780
1837
  applyStyles(uiView) {
1838
+ if (uiView.id) {
1839
+ this.renderer.setAttribute(this.elementRef.nativeElement, 'id', String(uiView.id));
1840
+ }
1781
1841
  if (uiView.padding) {
1782
1842
  this.applyPadding(uiView.padding);
1783
1843
  }
@@ -2054,12 +2114,18 @@ class UIScreenComponent {
2054
2114
  this.viewModel = viewModel;
2055
2115
  this.UIScreenIdentifier = UIScreenIdentifier;
2056
2116
  }
2117
+ containerClass(config) {
2118
+ const container = (config?.container || 'fluid').toString().toLowerCase();
2119
+ return container === 'contained'
2120
+ ? 'ui-screen--contained'
2121
+ : 'ui-screen--fluid';
2122
+ }
2057
2123
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UIScreenComponent, deps: [{ token: UIScreenViewModel }], target: i0.ɵɵFactoryTarget.Component }); }
2058
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UIScreenComponent, isStandalone: false, selector: "edm-sdui-uiscreen", ngImport: i0, template: "<ng-container *ngIf=\"viewModel.isLoading$ | async; else loaded\">\n <div class=\"loading-spinner\">\n <div class=\"spinner\"></div>\n </div>\n</ng-container>\n\n<ng-template #loaded>\n <ng-container\n *ngIf=\"viewModel.error$ | async as errorMessage; else renderScreen\"\n >\n <div class=\"error-label\">\n Erro ao carregar a tela:\n <pre>{{ errorMessage }}</pre>\n </div>\n </ng-container>\n\n <ng-template #renderScreen>\n <div\n class=\"ui-screen\"\n *ngIf=\"viewModel.uiScreen$ | async as uiScreen\"\n [edmSduiView]=\"uiScreen\"\n >\n <edm-sdui-navigation-controls\n [edmSduiView]=\"uiScreen\"\n ></edm-sdui-navigation-controls>\n\n <ng-container [ngSwitch]=\"uiScreen.identifier\">\n <edm-sdui-single-column-layout\n *ngSwitchCase=\"UIScreenIdentifier.SINGLE_COLUMN\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-single-column-layout>\n\n <edm-sdui-centered-content-layout\n *ngSwitchCase=\"UIScreenIdentifier.CENTERED_CONTENT\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-centered-content-layout>\n </ng-container>\n </div>\n </ng-template>\n</ng-template>\n", styles: [":host{display:contents}.ui-screen{width:100vw;min-height:100vh}.error-label{color:var(--input-error)}.loading-spinner{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw;box-sizing:border-box;position:relative}.spinner{width:48px;height:48px;border:5px solid var(--actindcolor);border-top-color:#333;border-radius:50%;animation:spin 1s linear infinite;top:50%;left:50%}@keyframes spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: SingleColumnLayoutComponent, selector: "edm-sdui-single-column-layout", inputs: ["uiLayout"] }, { kind: "component", type: CenteredContentLayoutComponent, selector: "edm-sdui-centered-content-layout", inputs: ["uiLayout"] }, { kind: "directive", type: UIViewDirective, selector: "[edmSduiView]", inputs: ["edmSduiView", "disableClick"] }, { kind: "component", type: NavigationControlsComponent, selector: "edm-sdui-navigation-controls" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
2124
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UIScreenComponent, isStandalone: false, selector: "edm-sdui-uiscreen", ngImport: i0, template: "<ng-container *ngIf=\"viewModel.isLoading$ | async; else loaded\">\n <div class=\"loading-spinner\">\n <div class=\"spinner\"></div>\n </div>\n</ng-container>\n\n<ng-template #loaded>\n <ng-container\n *ngIf=\"viewModel.error$ | async as errorMessage; else renderScreen\"\n >\n <div class=\"error-label\">\n Erro ao carregar a tela:\n <pre>{{ errorMessage }}</pre>\n </div>\n </ng-container>\n\n <ng-template #renderScreen>\n <div\n class=\"ui-screen\"\n *ngIf=\"viewModel.uiScreen$ | async as uiScreen\"\n [ngClass]=\"containerClass(uiScreen.config)\"\n [edmSduiView]=\"uiScreen\"\n >\n <edm-sdui-navigation-controls\n [edmSduiView]=\"uiScreen\"\n ></edm-sdui-navigation-controls>\n\n <ng-container [ngSwitch]=\"uiScreen.identifier\">\n <edm-sdui-single-column-layout\n *ngSwitchCase=\"UIScreenIdentifier.SINGLE_COLUMN\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-single-column-layout>\n\n <edm-sdui-centered-content-layout\n *ngSwitchCase=\"UIScreenIdentifier.CENTERED_CONTENT\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-centered-content-layout>\n </ng-container>\n </div>\n </ng-template>\n</ng-template>\n", styles: [":host{display:contents}.ui-screen{width:100%;min-height:100vh}.ui-screen--fluid{width:100vw}.ui-screen--contained{width:100%;max-width:1200px;margin:0 auto;padding:16px;box-sizing:border-box}.error-label{color:var(--input-error)}.loading-spinner{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw;box-sizing:border-box;position:relative}.spinner{width:48px;height:48px;border:5px solid var(--actindcolor);border-top-color:#333;border-radius:50%;animation:spin 1s linear infinite;top:50%;left:50%}@keyframes spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: SingleColumnLayoutComponent, selector: "edm-sdui-single-column-layout", inputs: ["uiLayout"] }, { kind: "component", type: CenteredContentLayoutComponent, selector: "edm-sdui-centered-content-layout", inputs: ["uiLayout"] }, { kind: "directive", type: UIViewDirective, selector: "[edmSduiView]", inputs: ["edmSduiView", "disableClick"] }, { kind: "component", type: NavigationControlsComponent, selector: "edm-sdui-navigation-controls" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
2059
2125
  }
2060
2126
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UIScreenComponent, decorators: [{
2061
2127
  type: Component,
2062
- args: [{ selector: 'edm-sdui-uiscreen', standalone: false, template: "<ng-container *ngIf=\"viewModel.isLoading$ | async; else loaded\">\n <div class=\"loading-spinner\">\n <div class=\"spinner\"></div>\n </div>\n</ng-container>\n\n<ng-template #loaded>\n <ng-container\n *ngIf=\"viewModel.error$ | async as errorMessage; else renderScreen\"\n >\n <div class=\"error-label\">\n Erro ao carregar a tela:\n <pre>{{ errorMessage }}</pre>\n </div>\n </ng-container>\n\n <ng-template #renderScreen>\n <div\n class=\"ui-screen\"\n *ngIf=\"viewModel.uiScreen$ | async as uiScreen\"\n [edmSduiView]=\"uiScreen\"\n >\n <edm-sdui-navigation-controls\n [edmSduiView]=\"uiScreen\"\n ></edm-sdui-navigation-controls>\n\n <ng-container [ngSwitch]=\"uiScreen.identifier\">\n <edm-sdui-single-column-layout\n *ngSwitchCase=\"UIScreenIdentifier.SINGLE_COLUMN\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-single-column-layout>\n\n <edm-sdui-centered-content-layout\n *ngSwitchCase=\"UIScreenIdentifier.CENTERED_CONTENT\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-centered-content-layout>\n </ng-container>\n </div>\n </ng-template>\n</ng-template>\n", styles: [":host{display:contents}.ui-screen{width:100vw;min-height:100vh}.error-label{color:var(--input-error)}.loading-spinner{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw;box-sizing:border-box;position:relative}.spinner{width:48px;height:48px;border:5px solid var(--actindcolor);border-top-color:#333;border-radius:50%;animation:spin 1s linear infinite;top:50%;left:50%}@keyframes spin{to{transform:rotate(360deg)}}\n"] }]
2128
+ args: [{ selector: 'edm-sdui-uiscreen', standalone: false, template: "<ng-container *ngIf=\"viewModel.isLoading$ | async; else loaded\">\n <div class=\"loading-spinner\">\n <div class=\"spinner\"></div>\n </div>\n</ng-container>\n\n<ng-template #loaded>\n <ng-container\n *ngIf=\"viewModel.error$ | async as errorMessage; else renderScreen\"\n >\n <div class=\"error-label\">\n Erro ao carregar a tela:\n <pre>{{ errorMessage }}</pre>\n </div>\n </ng-container>\n\n <ng-template #renderScreen>\n <div\n class=\"ui-screen\"\n *ngIf=\"viewModel.uiScreen$ | async as uiScreen\"\n [ngClass]=\"containerClass(uiScreen.config)\"\n [edmSduiView]=\"uiScreen\"\n >\n <edm-sdui-navigation-controls\n [edmSduiView]=\"uiScreen\"\n ></edm-sdui-navigation-controls>\n\n <ng-container [ngSwitch]=\"uiScreen.identifier\">\n <edm-sdui-single-column-layout\n *ngSwitchCase=\"UIScreenIdentifier.SINGLE_COLUMN\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-single-column-layout>\n\n <edm-sdui-centered-content-layout\n *ngSwitchCase=\"UIScreenIdentifier.CENTERED_CONTENT\"\n [uiLayout]=\"uiScreen.content\"\n ></edm-sdui-centered-content-layout>\n </ng-container>\n </div>\n </ng-template>\n</ng-template>\n", styles: [":host{display:contents}.ui-screen{width:100%;min-height:100vh}.ui-screen--fluid{width:100vw}.ui-screen--contained{width:100%;max-width:1200px;margin:0 auto;padding:16px;box-sizing:border-box}.error-label{color:var(--input-error)}.loading-spinner{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw;box-sizing:border-box;position:relative}.spinner{width:48px;height:48px;border:5px solid var(--actindcolor);border-top-color:#333;border-radius:50%;animation:spin 1s linear infinite;top:50%;left:50%}@keyframes spin{to{transform:rotate(360deg)}}\n"] }]
2063
2129
  }], ctorParameters: () => [{ type: UIScreenViewModel }] });
2064
2130
 
2065
2131
  class RowComponent {
@@ -2377,6 +2443,8 @@ var UISize;
2377
2443
  (function (UISize) {
2378
2444
  UISize["THUMB_1"] = "thumb_1";
2379
2445
  UISize["THUMB_2"] = "thumb_2";
2446
+ UISize["THUMB_3"] = "thumb_3";
2447
+ UISize["THUMB_4"] = "thumb_4";
2380
2448
  UISize["ASSET_1"] = "asset_1";
2381
2449
  UISize["ASSET_2"] = "asset_2";
2382
2450
  UISize["ASSET_3"] = "asset_3";
@@ -2390,6 +2458,8 @@ var UISize;
2390
2458
  const sizeMappingHeight = {
2391
2459
  [UISize.THUMB_1]: '56px',
2392
2460
  [UISize.THUMB_2]: '40px',
2461
+ [UISize.THUMB_3]: '180px',
2462
+ [UISize.THUMB_4]: '380px',
2393
2463
  [UISize.ASSET_1]: '26px',
2394
2464
  [UISize.ASSET_2]: '16px',
2395
2465
  [UISize.ASSET_3]: '80px',
@@ -2402,6 +2472,8 @@ const sizeMappingHeight = {
2402
2472
  const sizeMappingWidth = {
2403
2473
  [UISize.THUMB_1]: '100px',
2404
2474
  [UISize.THUMB_2]: '105px',
2475
+ [UISize.THUMB_3]: '320px',
2476
+ [UISize.THUMB_4]: '262px',
2405
2477
  [UISize.ASSET_1]: '26px',
2406
2478
  [UISize.ASSET_2]: '16px',
2407
2479
  [UISize.ASSET_3]: '80px',
@@ -3184,39 +3256,49 @@ class ProfileButtonComponent {
3184
3256
  return;
3185
3257
  }
3186
3258
  const lineHeightRatio = lineHeight / fontSize;
3187
- const updateMetrics = (forceHeight) => {
3188
- const targetHeight = lineHeightRatio * fontSize * maxLines;
3189
- this.renderer.setStyle(labelElement, 'line-height', `${lineHeightRatio * fontSize}px`);
3190
- this.renderer.setStyle(labelElement, 'max-height', `${targetHeight}px`);
3191
- if (forceHeight) {
3192
- this.renderer.setStyle(labelElement, 'height', `${targetHeight}px`);
3193
- }
3194
- else {
3195
- this.renderer.removeStyle(labelElement, 'height');
3259
+ const applyMetrics = () => {
3260
+ const currentLineHeight = lineHeightRatio * fontSize;
3261
+ const allowedHeight = currentLineHeight * maxLines;
3262
+ this.renderer.setStyle(labelElement, 'line-height', `${currentLineHeight}px`);
3263
+ this.renderer.setStyle(labelElement, 'max-height', `${allowedHeight}px`);
3264
+ return allowedHeight;
3265
+ };
3266
+ const fits = (allowedHeight) => {
3267
+ const EPSILON = 0.5;
3268
+ const availableWidth = labelElement.clientWidth;
3269
+ if (availableWidth <= 0) {
3270
+ return true;
3196
3271
  }
3197
- return targetHeight;
3272
+ return (labelElement.scrollHeight <= allowedHeight + EPSILON &&
3273
+ labelElement.scrollWidth <= availableWidth + EPSILON);
3198
3274
  };
3199
- let targetHeight = updateMetrics(false);
3200
- let constrained = false;
3201
- while (labelElement.scrollHeight > targetHeight && fontSize > minFontSizePx) {
3275
+ this.renderer.removeClass(labelElement, 'truncate');
3276
+ this.renderer.removeStyle(labelElement, 'height');
3277
+ let allowedHeight = applyMetrics();
3278
+ let contentFits = fits(allowedHeight);
3279
+ while (!contentFits && fontSize > minFontSizePx) {
3202
3280
  fontSize -= 1;
3203
3281
  this.renderer.setStyle(labelElement, 'font-size', `${fontSize}px`);
3204
- targetHeight = updateMetrics(true);
3205
- constrained = true;
3282
+ allowedHeight = applyMetrics();
3283
+ contentFits = fits(allowedHeight);
3206
3284
  }
3207
- if (!constrained) {
3208
- this.renderer.removeStyle(labelElement, 'height');
3285
+ if (!contentFits) {
3286
+ this.renderer.addClass(labelElement, 'truncate');
3287
+ }
3288
+ else {
3289
+ this.renderer.removeClass(labelElement, 'truncate');
3290
+ this.renderer.removeStyle(labelElement, 'max-height');
3209
3291
  }
3210
3292
  }
3211
3293
  getAssetPath(asset) {
3212
3294
  return assetMapping[asset];
3213
3295
  }
3214
3296
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProfileButtonComponent, deps: [{ token: 'uiComponent' }, { token: i0.Renderer2 }, { token: FontSizeMappingService }], target: i0.ɵɵFactoryTarget.Component }); }
3215
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ProfileButtonComponent, isStandalone: false, selector: "edm-sdui-profile-button", viewQueries: [{ propertyName: "profileButtonElementRef", first: true, predicate: ["profileButtonElement"], descendants: true }, { propertyName: "profileButtonLabelElementRef", first: true, predicate: ["profileButtonLabelElement"], descendants: true }, { propertyName: "profileButtonImageElementRef", first: true, predicate: ["profileButtonImageElement"], descendants: true }], ngImport: i0, template: "<button #profileButtonElement [edmSduiView]=\"uiComponent.element\" class=\"profile-button\" *ngIf=\"uiComponent\">\n <img #profileButtonImageElement *ngIf=\"uiComponent.element.asset\" [src]=\"getAssetPath(uiComponent.element.asset)\" alt=\"Profile\" class=\"profile-image\">\n <span #profileButtonLabelElement class=\"profile-label\">{{ uiComponent.element.label }}</span>\n</button>\n", styles: [":host{display:contents}.profile-button{display:flex;padding:16px 16px 0;border-radius:20px;background-color:var(--bt-profile);border:none;cursor:pointer;flex-direction:column;height:108px;width:108px;align-items:start;justify-content:start;gap:24px}.profile-button:hover{background-color:#0000000d;cursor:pointer}.profile-button .profile-image{width:24px;height:24px}.profile-button .profile-label{max-width:100%;white-space:normal;word-break:keep-all;overflow-wrap:normal;text-align:left;line-height:1.25;max-height:2.5em;overflow:hidden;text-overflow:ellipsis;display:block;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;-webkit-hyphens:none;hyphens:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: UIViewDirective, selector: "[edmSduiView]", inputs: ["edmSduiView", "disableClick"] }] }); }
3297
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ProfileButtonComponent, isStandalone: false, selector: "edm-sdui-profile-button", viewQueries: [{ propertyName: "profileButtonElementRef", first: true, predicate: ["profileButtonElement"], descendants: true }, { propertyName: "profileButtonLabelElementRef", first: true, predicate: ["profileButtonLabelElement"], descendants: true }, { propertyName: "profileButtonImageElementRef", first: true, predicate: ["profileButtonImageElement"], descendants: true }], ngImport: i0, template: "<button #profileButtonElement [edmSduiView]=\"uiComponent.element\" class=\"profile-button\" *ngIf=\"uiComponent\">\n <img #profileButtonImageElement *ngIf=\"uiComponent.element.asset\" [src]=\"getAssetPath(uiComponent.element.asset)\" alt=\"Profile\" class=\"profile-image\">\n <span #profileButtonLabelElement class=\"profile-label\">{{ uiComponent.element.label }}</span>\n</button>\n", styles: [":host{display:contents}.profile-button{display:flex;padding:16px 16px 0;border-radius:20px;background-color:var(--bt-profile);border:none;cursor:pointer;flex-direction:column;height:108px;width:108px;align-items:start;justify-content:start;gap:24px}.profile-button:hover{background-color:#0000000d;cursor:pointer}.profile-button .profile-image{width:24px;height:24px}.profile-button .profile-label{max-width:100%;white-space:normal;word-break:keep-all;overflow-wrap:normal;text-align:left;overflow:hidden;display:block}.profile-button .profile-label.truncate{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: UIViewDirective, selector: "[edmSduiView]", inputs: ["edmSduiView", "disableClick"] }] }); }
3216
3298
  }
3217
3299
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProfileButtonComponent, decorators: [{
3218
3300
  type: Component,
3219
- args: [{ selector: 'edm-sdui-profile-button', standalone: false, template: "<button #profileButtonElement [edmSduiView]=\"uiComponent.element\" class=\"profile-button\" *ngIf=\"uiComponent\">\n <img #profileButtonImageElement *ngIf=\"uiComponent.element.asset\" [src]=\"getAssetPath(uiComponent.element.asset)\" alt=\"Profile\" class=\"profile-image\">\n <span #profileButtonLabelElement class=\"profile-label\">{{ uiComponent.element.label }}</span>\n</button>\n", styles: [":host{display:contents}.profile-button{display:flex;padding:16px 16px 0;border-radius:20px;background-color:var(--bt-profile);border:none;cursor:pointer;flex-direction:column;height:108px;width:108px;align-items:start;justify-content:start;gap:24px}.profile-button:hover{background-color:#0000000d;cursor:pointer}.profile-button .profile-image{width:24px;height:24px}.profile-button .profile-label{max-width:100%;white-space:normal;word-break:keep-all;overflow-wrap:normal;text-align:left;line-height:1.25;max-height:2.5em;overflow:hidden;text-overflow:ellipsis;display:block;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;-webkit-hyphens:none;hyphens:none}\n"] }]
3301
+ args: [{ selector: 'edm-sdui-profile-button', standalone: false, template: "<button #profileButtonElement [edmSduiView]=\"uiComponent.element\" class=\"profile-button\" *ngIf=\"uiComponent\">\n <img #profileButtonImageElement *ngIf=\"uiComponent.element.asset\" [src]=\"getAssetPath(uiComponent.element.asset)\" alt=\"Profile\" class=\"profile-image\">\n <span #profileButtonLabelElement class=\"profile-label\">{{ uiComponent.element.label }}</span>\n</button>\n", styles: [":host{display:contents}.profile-button{display:flex;padding:16px 16px 0;border-radius:20px;background-color:var(--bt-profile);border:none;cursor:pointer;flex-direction:column;height:108px;width:108px;align-items:start;justify-content:start;gap:24px}.profile-button:hover{background-color:#0000000d;cursor:pointer}.profile-button .profile-image{width:24px;height:24px}.profile-button .profile-label{max-width:100%;white-space:normal;word-break:keep-all;overflow-wrap:normal;text-align:left;overflow:hidden;display:block}.profile-button .profile-label.truncate{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;text-overflow:ellipsis}\n"] }]
3220
3302
  }], ctorParameters: () => [{ type: undefined, decorators: [{
3221
3303
  type: Inject,
3222
3304
  args: ['uiComponent']