@ngx-smz/ui-kit 21.10.0-next.1 → 21.10.0-next.11

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.
@@ -1944,7 +1944,9 @@ class SmzDialogComponent {
1944
1944
  hidden = output();
1945
1945
  panel = viewChild.required('panel');
1946
1946
  templates = contentChildren(SmzTemplateDirective, ...(ngDevMode ? [{ debugName: "templates" }] : []));
1947
+ /** `header`: acoes extras na barra padrao (titulo, maximizar e fechar permanecem). `headerFull`: substitui a barra inteira. */
1947
1948
  headerTemplate = computed(() => smzFindTemplate(this.templates(), 'header'), ...(ngDevMode ? [{ debugName: "headerTemplate" }] : []));
1949
+ headerFullTemplate = computed(() => smzFindTemplate(this.templates(), 'headerFull'), ...(ngDevMode ? [{ debugName: "headerFullTemplate" }] : []));
1948
1950
  footerTemplate = computed(() => smzFindTemplate(this.templates(), 'footer'), ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
1949
1951
  overlay = inject(Overlay);
1950
1952
  viewContainer = inject(ViewContainerRef);
@@ -2076,15 +2078,24 @@ class SmzDialogComponent {
2076
2078
  [style.height]="!maximized() && sizing().pane.height ? '100%' : null"
2077
2079
  [style.transform]="maximized() || (dx() === 0 && dy() === 0) ? null : 'translate(' + dx() + 'px, ' + dy() + 'px)'"
2078
2080
  >
2079
- @if (headerTemplate(); as headerTpl) {
2081
+ @if (headerFullTemplate(); as fullTpl) {
2080
2082
  <div class="border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
2081
- <ng-container [ngTemplateOutlet]="headerTpl" />
2083
+ <ng-container [ngTemplateOutlet]="fullTpl" />
2082
2084
  </div>
2083
2085
  }
2084
- @else if (header() || closable()) {
2086
+ @else if (header() || headerTemplate() || closable() || maximizable()) {
2085
2087
  <div class="flex items-center justify-between gap-4 border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
2086
- <span class="text-ui-lg font-medium">{{ header() }}</span>
2087
- <div class="flex items-center gap-1">
2088
+ @if (header()) {
2089
+ <span class="min-w-0 text-ui-lg font-medium">{{ header() }}</span>
2090
+ }
2091
+ <!-- smzTemplate="header": acoes extras ao lado do titulo; maximizar/restaurar e fechar continuam na barra.
2092
+ O titulo pode encolher/quebrar (min-w-0): com shrink-0 ele empurrava os botoes para fora do dialog em 375px (#53 follow-up). -->
2093
+ <div class="flex min-w-0 flex-1 items-center gap-2" [class.hidden]="!headerTemplate()">
2094
+ @if (headerTemplate(); as headerTpl) {
2095
+ <ng-container [ngTemplateOutlet]="headerTpl" />
2096
+ }
2097
+ </div>
2098
+ <div class="flex shrink-0 items-center gap-1">
2088
2099
  @if (maximizable()) {
2089
2100
  <button type="button" class="inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [attr.aria-label]="maximized() ? 'Restaurar' : 'Maximizar'" (click)="maximize()">
2090
2101
  <svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true">
@@ -2136,15 +2147,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
2136
2147
  [style.height]="!maximized() && sizing().pane.height ? '100%' : null"
2137
2148
  [style.transform]="maximized() || (dx() === 0 && dy() === 0) ? null : 'translate(' + dx() + 'px, ' + dy() + 'px)'"
2138
2149
  >
2139
- @if (headerTemplate(); as headerTpl) {
2150
+ @if (headerFullTemplate(); as fullTpl) {
2140
2151
  <div class="border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
2141
- <ng-container [ngTemplateOutlet]="headerTpl" />
2152
+ <ng-container [ngTemplateOutlet]="fullTpl" />
2142
2153
  </div>
2143
2154
  }
2144
- @else if (header() || closable()) {
2155
+ @else if (header() || headerTemplate() || closable() || maximizable()) {
2145
2156
  <div class="flex items-center justify-between gap-4 border-b border-ui-line px-4 py-3" [class.cursor-move]="draggable() && !maximized()" (pointerdown)="startDrag($event)">
2146
- <span class="text-ui-lg font-medium">{{ header() }}</span>
2147
- <div class="flex items-center gap-1">
2157
+ @if (header()) {
2158
+ <span class="min-w-0 text-ui-lg font-medium">{{ header() }}</span>
2159
+ }
2160
+ <!-- smzTemplate="header": acoes extras ao lado do titulo; maximizar/restaurar e fechar continuam na barra.
2161
+ O titulo pode encolher/quebrar (min-w-0): com shrink-0 ele empurrava os botoes para fora do dialog em 375px (#53 follow-up). -->
2162
+ <div class="flex min-w-0 flex-1 items-center gap-2" [class.hidden]="!headerTemplate()">
2163
+ @if (headerTemplate(); as headerTpl) {
2164
+ <ng-container [ngTemplateOutlet]="headerTpl" />
2165
+ }
2166
+ </div>
2167
+ <div class="flex shrink-0 items-center gap-1">
2148
2168
  @if (maximizable()) {
2149
2169
  <button type="button" class="inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-ui-fg-muted transition-colors duration-ui hover:bg-ui-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ui-focus" [attr.aria-label]="maximized() ? 'Restaurar' : 'Maximizar'" (click)="maximize()">
2150
2170
  <svg viewBox="0 0 16 16" class="h-4 w-4" fill="none" aria-hidden="true">