@trismegisto/angular 3.2.0 → 3.3.1
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.
- package/README.md +2 -2
- package/fesm2022/trismegisto-angular-avatar-group.mjs +15 -3
- package/fesm2022/trismegisto-angular-avatar-group.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-bulk-input.mjs +1 -1
- package/fesm2022/trismegisto-angular-bulk-input.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-button.mjs +3 -10
- package/fesm2022/trismegisto-angular-button.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-code-viewer.mjs +0 -1
- package/fesm2022/trismegisto-angular-code-viewer.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-combobox-multi.mjs +4 -11
- package/fesm2022/trismegisto-angular-combobox-multi.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-combobox.mjs +5 -16
- package/fesm2022/trismegisto-angular-combobox.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-command-palette.mjs +28 -4
- package/fesm2022/trismegisto-angular-command-palette.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-data-grid.mjs +4 -4
- package/fesm2022/trismegisto-angular-data-grid.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-date-picker.mjs +6 -64
- package/fesm2022/trismegisto-angular-date-picker.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-dialog.mjs +1 -1
- package/fesm2022/trismegisto-angular-dialog.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-drag-drop.mjs +8 -1
- package/fesm2022/trismegisto-angular-drag-drop.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-event-calendar.mjs +1 -1
- package/fesm2022/trismegisto-angular-event-calendar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-filter-bar.mjs +1 -1
- package/fesm2022/trismegisto-angular-filter-bar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-i18n.mjs +1 -9
- package/fesm2022/trismegisto-angular-i18n.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-icon.mjs +2 -90
- package/fesm2022/trismegisto-angular-icon.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-kanban.mjs +130 -12
- package/fesm2022/trismegisto-angular-kanban.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-list-editor.mjs +1 -1
- package/fesm2022/trismegisto-angular-list-editor.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-message-scroller.mjs +1 -1
- package/fesm2022/trismegisto-angular-message-scroller.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-message.mjs +1 -1
- package/fesm2022/trismegisto-angular-message.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-popover.mjs +3 -3
- package/fesm2022/trismegisto-angular-popover.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-property-view.mjs +1 -1
- package/fesm2022/trismegisto-angular-property-view.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-radio.mjs +4 -11
- package/fesm2022/trismegisto-angular-radio.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-rich-text.mjs +1 -1
- package/fesm2022/trismegisto-angular-rich-text.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-session-recovery.mjs +11 -13
- package/fesm2022/trismegisto-angular-session-recovery.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-settings.mjs +1 -1
- package/fesm2022/trismegisto-angular-settings.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-shortcut-list.mjs +1 -1
- package/fesm2022/trismegisto-angular-shortcut-list.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-sidebar.mjs +0 -4
- package/fesm2022/trismegisto-angular-sidebar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-stat-group.mjs +1 -1
- package/fesm2022/trismegisto-angular-stat-group.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-state-page.mjs +1 -8
- package/fesm2022/trismegisto-angular-state-page.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-state-screen.mjs +1 -1
- package/fesm2022/trismegisto-angular-state-screen.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-stepper.mjs +34 -32
- package/fesm2022/trismegisto-angular-stepper.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-switch.mjs +4 -11
- package/fesm2022/trismegisto-angular-switch.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-tab-bar.mjs +46 -2
- package/fesm2022/trismegisto-angular-tab-bar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-tag.mjs +3 -11
- package/fesm2022/trismegisto-angular-tag.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-textarea.mjs +4 -11
- package/fesm2022/trismegisto-angular-textarea.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-theme-builder.mjs +5 -3
- package/fesm2022/trismegisto-angular-theme-builder.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-theme.mjs +1 -1
- package/fesm2022/trismegisto-angular-theme.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-wizard.mjs +1 -1
- package/fesm2022/trismegisto-angular-wizard.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-workspace.mjs +5 -1
- package/fesm2022/trismegisto-angular-workspace.mjs.map +1 -1
- package/fesm2022/trismegisto-angular.mjs +3 -4
- package/fesm2022/trismegisto-angular.mjs.map +1 -1
- package/package.json +5 -13
- package/types/trismegisto-angular-avatar-group.d.ts +11 -2
- package/types/trismegisto-angular-avatar-group.d.ts.map +1 -1
- package/types/trismegisto-angular-button.d.ts +1 -3
- package/types/trismegisto-angular-button.d.ts.map +1 -1
- package/types/trismegisto-angular-code-viewer.d.ts.map +1 -1
- package/types/trismegisto-angular-combobox-multi.d.ts +2 -4
- package/types/trismegisto-angular-combobox-multi.d.ts.map +1 -1
- package/types/trismegisto-angular-combobox.d.ts +1 -5
- package/types/trismegisto-angular-combobox.d.ts.map +1 -1
- package/types/trismegisto-angular-command-palette.d.ts +10 -1
- package/types/trismegisto-angular-command-palette.d.ts.map +1 -1
- package/types/trismegisto-angular-data-grid.d.ts +0 -9
- package/types/trismegisto-angular-data-grid.d.ts.map +1 -1
- package/types/trismegisto-angular-date-picker.d.ts +2 -17
- package/types/trismegisto-angular-date-picker.d.ts.map +1 -1
- package/types/trismegisto-angular-drag-drop.d.ts +8 -0
- package/types/trismegisto-angular-drag-drop.d.ts.map +1 -1
- package/types/trismegisto-angular-i18n.d.ts +1 -7
- package/types/trismegisto-angular-i18n.d.ts.map +1 -1
- package/types/trismegisto-angular-icon.d.ts +2 -5
- package/types/trismegisto-angular-icon.d.ts.map +1 -1
- package/types/trismegisto-angular-kanban.d.ts +57 -5
- package/types/trismegisto-angular-kanban.d.ts.map +1 -1
- package/types/trismegisto-angular-popover.d.ts +1 -1
- package/types/trismegisto-angular-popover.d.ts.map +1 -1
- package/types/trismegisto-angular-radio.d.ts +1 -3
- package/types/trismegisto-angular-radio.d.ts.map +1 -1
- package/types/trismegisto-angular-reorder-list.d.ts +0 -5
- package/types/trismegisto-angular-reorder-list.d.ts.map +1 -1
- package/types/trismegisto-angular-session-recovery.d.ts +6 -6
- package/types/trismegisto-angular-sidebar.d.ts +0 -2
- package/types/trismegisto-angular-sidebar.d.ts.map +1 -1
- package/types/trismegisto-angular-state-page.d.ts +1 -7
- package/types/trismegisto-angular-state-page.d.ts.map +1 -1
- package/types/trismegisto-angular-stepper.d.ts.map +1 -1
- package/types/trismegisto-angular-switch.d.ts +1 -3
- package/types/trismegisto-angular-switch.d.ts.map +1 -1
- package/types/trismegisto-angular-tab-bar.d.ts +11 -0
- package/types/trismegisto-angular-tab-bar.d.ts.map +1 -1
- package/types/trismegisto-angular-tag.d.ts +2 -4
- package/types/trismegisto-angular-tag.d.ts.map +1 -1
- package/types/trismegisto-angular-textarea.d.ts +1 -3
- package/types/trismegisto-angular-textarea.d.ts.map +1 -1
- package/types/trismegisto-angular-theme-builder.d.ts.map +1 -1
- package/types/trismegisto-angular-theme.d.ts +4 -3
- package/types/trismegisto-angular-theme.d.ts.map +1 -1
- package/types/trismegisto-angular-workspace.d.ts +0 -2
- package/types/trismegisto-angular-workspace.d.ts.map +1 -1
- package/types/trismegisto-angular.d.ts +3 -4
- package/types/trismegisto-angular.d.ts.map +1 -1
- package/fesm2022/trismegisto-angular-deprecation.mjs +0 -26
- package/fesm2022/trismegisto-angular-deprecation.mjs.map +0 -1
- package/fesm2022/trismegisto-angular-field.mjs +0 -35
- package/fesm2022/trismegisto-angular-field.mjs.map +0 -1
- package/types/trismegisto-angular-deprecation.d.ts +0 -11
- package/types/trismegisto-angular-deprecation.d.ts.map +0 -1
- package/types/trismegisto-angular-field.d.ts +0 -18
- package/types/trismegisto-angular-field.d.ts.map +0 -1
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, booleanAttribute, inject, computed, ChangeDetectionStrategy, Component, model, contentChildren, ElementRef, Injector, signal, afterNextRender, forwardRef } from '@angular/core';
|
|
3
3
|
import { ICON_CHECK, ICON_EXCLAMATION_CIRCLE, useHermesIcons, IconComponent } from '@trismegisto/angular/icon';
|
|
4
4
|
import { NgTemplateOutlet } from '@angular/common';
|
|
5
|
-
import { initialStepperState, isFirstStep, isLastStep, nextEnabledStep, stepStatus, canSelectStep, isStepperComplete, hasStepError, isStepCompleted, formatMessage } from '@trismegisto/primitives';
|
|
5
|
+
import { initialStepperState, isFirstStep, isLastStep, nextEnabledStep, stepStatus, canSelectStep, completeAndAdvance, previousStep, selectStep, isStepperComplete, hasStepError, isStepCompleted, formatMessage, completeStep, clearStepError, markStepError } from '@trismegisto/primitives';
|
|
6
6
|
import { HERMES_MESSAGES } from '@trismegisto/angular/i18n';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -219,17 +219,24 @@ class StepperComponent extends HermesStepGroup {
|
|
|
219
219
|
return false;
|
|
220
220
|
if (!valid && this.#blocks(from))
|
|
221
221
|
return false;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
const descriptors = this.#descriptors();
|
|
223
|
+
if (valid) {
|
|
224
|
+
// Conclui a etapa e já calcula a seguinte habilitada (`completeAndAdvance`).
|
|
225
|
+
const advanced = this.#applyProgress((state) => completeAndAdvance(descriptors, state));
|
|
226
|
+
if (advanced.current !== from)
|
|
227
|
+
this.#moveTo(advanced.current);
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
const target = nextEnabledStep(descriptors, from, 1);
|
|
225
231
|
if (target >= 0)
|
|
226
232
|
this.#moveTo(target);
|
|
227
233
|
return true;
|
|
228
234
|
}
|
|
229
235
|
previous() {
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
236
|
+
const state = this.state();
|
|
237
|
+
const target = previousStep(this.#descriptors(), state);
|
|
238
|
+
if (target !== state)
|
|
239
|
+
this.#moveTo(target.current);
|
|
233
240
|
}
|
|
234
241
|
async goTo(index) {
|
|
235
242
|
const from = this.current();
|
|
@@ -248,9 +255,11 @@ class StepperComponent extends HermesStepGroup {
|
|
|
248
255
|
if (valid)
|
|
249
256
|
this.#markCompleted(from);
|
|
250
257
|
}
|
|
251
|
-
|
|
258
|
+
const state = this.state();
|
|
259
|
+
const target = selectStep(this.#descriptors(), state, index, this.linear());
|
|
260
|
+
if (target === state)
|
|
252
261
|
return false;
|
|
253
|
-
this.#moveTo(
|
|
262
|
+
this.#moveTo(target.current);
|
|
254
263
|
return true;
|
|
255
264
|
}
|
|
256
265
|
async complete() {
|
|
@@ -291,28 +300,21 @@ class StepperComponent extends HermesStepGroup {
|
|
|
291
300
|
#blocks(index) {
|
|
292
301
|
return this.linear() && !this.items()[index]?.optional();
|
|
293
302
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
});
|
|
303
|
+
/**
|
|
304
|
+
* Aplica uma transição do primitives (`completeStep`, `markStepError`...) ao estado atual e guarda o
|
|
305
|
+
* progresso (concluídas/erros). A etapa aberta continua sendo o `selectedIndex`: quem chama decide se move
|
|
306
|
+
* (`#moveTo`, que anuncia e leva o foco). Devolve o estado novo (o mesmo objeto se nada mudou).
|
|
307
|
+
*/
|
|
308
|
+
#applyProgress(change) {
|
|
309
|
+
const state = this.state();
|
|
310
|
+
const next = change(state);
|
|
311
|
+
if (next.completed !== state.completed || next.errors !== state.errors) {
|
|
312
|
+
this.#progress.set({ completed: next.completed, errors: next.errors });
|
|
313
|
+
}
|
|
314
|
+
return next;
|
|
307
315
|
}
|
|
308
|
-
#
|
|
309
|
-
|
|
310
|
-
return;
|
|
311
|
-
this.#progress.update(({ completed, errors }) => {
|
|
312
|
-
const nextErrors = new Set(errors);
|
|
313
|
-
nextErrors.delete(index);
|
|
314
|
-
return { completed, errors: nextErrors };
|
|
315
|
-
});
|
|
316
|
+
#markCompleted(index) {
|
|
317
|
+
this.#applyProgress((state) => completeStep(state, index));
|
|
316
318
|
}
|
|
317
319
|
/**
|
|
318
320
|
* Valida a etapa e registra o resultado (erro limpo ou marcado + anúncio). `validating` liga antes da
|
|
@@ -349,10 +351,10 @@ class StepperComponent extends HermesStepGroup {
|
|
|
349
351
|
this.validating.set(false);
|
|
350
352
|
}
|
|
351
353
|
if (valid) {
|
|
352
|
-
this.#
|
|
354
|
+
this.#applyProgress((state) => clearStepError(state, index));
|
|
353
355
|
}
|
|
354
356
|
else {
|
|
355
|
-
this.#
|
|
357
|
+
this.#applyProgress((state) => markStepError(state, index));
|
|
356
358
|
this.announcement.set(formatMessage(this.text.invalid, { label: step.label() }));
|
|
357
359
|
}
|
|
358
360
|
return valid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trismegisto-angular-stepper.mjs","sources":["../../src/stepper/stepper.contract.ts","../../src/stepper/icons.generated.ts","../../src/stepper/step.component.ts","../../src/stepper/stepper.component.ts","../../src/stepper/stepper.component.html","../../src/stepper/index.ts","../../src/stepper/trismegisto-angular-stepper.ts"],"sourcesContent":["import type { TemplateRef } from '@angular/core';\n\n/**\n * O que um `hm-step` consulta no componente que o agrupa. O `hm-stepper` fornece este token, e um\n * componente que o embrulhe (o `hm-wizard`, por exemplo) pode fornecê-lo no lugar dele.\n */\nexport abstract class HermesStepGroup {\n /** A etapa é a que está aberta agora? */\n abstract isActive(step: object): boolean;\n /** `aria-level` do título do painel. */\n abstract readonly headingLevel: () => number;\n /** Título do painel só para leitor de tela. */\n abstract readonly headingHidden: () => boolean;\n}\n\n/** Guarda extra antes de sair adiante de uma etapa. `false`, exceção ou rejeição seguram a etapa. */\nexport type HermesStepGuard = () => boolean | Promise<boolean>;\n\nexport interface HermesStepSummaryEntry {\n readonly term: string;\n /** `null`, `undefined` ou `''` aparecem como vazio. */\n readonly value?: string | number | null;\n}\n\n/** O que a etapa resume na página de revisão do `hm-wizard`: um template ou pares termo/valor. */\nexport type HermesStepSummary = TemplateRef<unknown> | (() => readonly HermesStepSummaryEntry[]);\n","// GERADO por scripts/generate-internal-icons.mjs — não editar à mão.\n// Ícones que esta pasta usa por dentro; cada @Component/@Directive daqui os registra com\n// `readonly #icons = useHermesIcons(STEPPER_ICONS);`.\nimport type { RegisteredIcon } from '@trismegisto/icons';\nimport {\n ICON_CHECK,\n ICON_EXCLAMATION_CIRCLE,\n} from '@trismegisto/angular/icon';\n\nexport const STEPPER_ICONS: readonly RegisteredIcon[] = [ICON_CHECK, ICON_EXCLAMATION_CIRCLE];\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { STEPPER_ICONS } from './icons.generated';\nimport { HermesStepGroup, HermesStepGuard, HermesStepSummary } from './stepper.contract';\n\nlet sequence = 0;\n\n/**\n * Uma etapa de `hm-stepper` (ou de `hm-wizard`). Só a etapa aberta desenha o painel; as outras ficam\n * sem nada no DOM, mas o conteúdo projetado continua vivo — um formulário preenchido numa etapa está lá\n * do mesmo jeito quando a pessoa volta a ela.\n *\n * Quem decide se ela está aberta é o grupo que a contém, obtido por injeção (`HermesStepGroup`).\n */\n@Component({\n selector: 'hm-step',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hm-step' },\n template: `\n @if (active()) {\n <div class=\"hm-step__panel\" role=\"group\" [id]=\"panelId\" [attr.aria-labelledby]=\"headingId\">\n <div\n class=\"hm-step__heading\"\n role=\"heading\"\n tabindex=\"-1\"\n [id]=\"headingId\"\n [attr.aria-level]=\"group.headingLevel()\"\n [class.hm-visually-hidden]=\"group.headingHidden()\"\n >\n {{ label() }}\n </div>\n <div class=\"hm-step__body\"><ng-content /></div>\n </div>\n }\n `,\n})\nexport class StepComponent {\n readonly #icons = useHermesIcons(STEPPER_ICONS);\n\n /** Nome da etapa no indicador e título do painel. */\n readonly label = input('');\n /** Texto curto sob o nome, no indicador. */\n readonly description = input('');\n /** Não segura o avanço no modo linear, nem impede o fluxo de ficar completo. */\n readonly optional = input(false, { transform: booleanAttribute });\n /** Nunca alcançável; Avançar e Voltar passam por cima dela. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Força a situação de erro (soma-se ao erro de validação). */\n readonly error = input(false, { transform: booleanAttribute });\n /** `true`/`false` forçam concluída/pendente; `null` deixa o stepper decidir pelo que a pessoa fez. */\n readonly completed = input<boolean | null>(null);\n /** Controle validado ao sair adiante da etapa (é tocado para mostrar os erros). */\n readonly stepControl = input<AbstractControl | null>(null);\n /** Guarda extra, chamada depois do controle passar. */\n readonly canAdvance = input<HermesStepGuard | null>(null);\n /** O que esta etapa mostra na página de revisão do `hm-wizard`. */\n readonly summary = input<HermesStepSummary | null>(null);\n\n readonly panelId = `hm-step-panel-${++sequence}`;\n readonly headingId = `hm-step-heading-${sequence}`;\n\n protected readonly group = inject(HermesStepGroup);\n protected readonly active = computed(() => this.group.isActive(this));\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n model,\n signal,\n} from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport {\n StepDescriptor,\n StepStatus,\n StepperState,\n canSelectStep,\n formatMessage,\n hasStepError,\n initialStepperState,\n isFirstStep,\n isLastStep,\n isStepCompleted,\n isStepperComplete,\n nextEnabledStep,\n stepStatus,\n} from '@trismegisto/primitives';\nimport { HERMES_MESSAGES } from '@trismegisto/angular/i18n';\nimport { IconComponent, useHermesIcons } from '@trismegisto/angular/icon';\nimport { STEPPER_ICONS } from './icons.generated';\nimport { StepComponent } from './step.component';\nimport { HermesStepGroup } from './stepper.contract';\n\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** O que o indicador desenha para cada etapa. */\ninterface StepMarker {\n readonly step: StepComponent;\n readonly index: number;\n readonly status: StepStatus;\n readonly active: boolean;\n /** O trecho de régua que sai desta etapa em direção à seguinte já foi percorrido. */\n readonly traversed: boolean;\n readonly navigable: boolean;\n readonly glyph: string | null;\n /** Nome completo para leitor de tela (número, rótulo, situação, opcional, descrição). */\n readonly spoken: string;\n}\n\ninterface StepProgress {\n readonly completed: ReadonlySet<number>;\n readonly errors: ReadonlySet<number>;\n}\n\nconst NO_PROGRESS: StepProgress = { completed: new Set(), errors: new Set() };\n\n/** Espera um controle com validação assíncrona sair de PENDING. */\nfunction settled(control: AbstractControl): Promise<void> {\n return new Promise((resolve) => {\n let done = false;\n const finish = () => {\n if (done) return;\n done = true;\n subscription?.unsubscribe();\n resolve();\n };\n const subscription = control.statusChanges.subscribe((status) => {\n if (status !== 'PENDING') finish();\n });\n if (!control.pending) finish();\n });\n}\n\n/**\n * Fluxo em etapas: o indicador (lista ordenada dentro de um `nav`) e o painel da etapa aberta.\n *\n * ```html\n * <hm-stepper linear [(selectedIndex)]=\"etapa\">\n * <hm-step label=\"Dados\" [stepControl]=\"dados\">…</hm-step>\n * <hm-step label=\"Endereço\" optional>…</hm-step>\n * <hm-step label=\"Confirmação\">…</hm-step>\n * </hm-stepper>\n * ```\n *\n * Não é um widget composto: cada etapa alcançável é um botão comum na ordem de Tab. Ao trocar de etapa\n * por ação (`next`, `previous`, `goTo`, `complete`, clique), a etapa nova é anunciada e o foco vai para\n * o título dela; mudar `selectedIndex` por fora só redesenha.\n */\n@Component({\n selector: 'hm-stepper',\n imports: [NgTemplateOutlet, IconComponent],\n templateUrl: './stepper.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hm-stepper-host' },\n providers: [{ provide: HermesStepGroup, useExisting: forwardRef(() => StepperComponent) }],\n})\nexport class StepperComponent extends HermesStepGroup {\n readonly #icons = useHermesIcons(STEPPER_ICONS);\n\n /** Índice (0-based) da etapa aberta. Two-way. */\n readonly selectedIndex = model(0);\n /** Avançar valida a etapa aberta e o indicador não salta adiante sem concluir as anteriores. */\n readonly linear = input(false, { transform: booleanAttribute });\n readonly orientation = input<StepperOrientation>('horizontal');\n /** Indicador só informativo: nenhuma etapa é clicável. */\n readonly readOnly = input(false, { transform: booleanAttribute });\n /** Nome do `nav`. Vazio = catálogo. */\n readonly label = input('');\n /** `aria-level` do título de cada painel. */\n readonly level = input(3);\n /** Título do painel só para leitor de tela (quando a tela já tem um título visível). */\n readonly hideHeading = input(false, { transform: booleanAttribute });\n /**\n * Etapas explícitas no lugar das filhas. Para quem re-projeta `hm-step` (o `hm-wizard`): conteúdo\n * re-projetado não aparece na consulta de conteúdo deste componente.\n */\n readonly steps = input<readonly StepComponent[] | null>(null);\n\n private readonly children = contentChildren(StepComponent);\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #injector = inject(Injector);\n protected readonly text = inject(HERMES_MESSAGES).stepper;\n\n readonly #progress = signal<StepProgress>(NO_PROGRESS);\n\n /** Validação em curso (guarda assíncrona ou controle `pending`). Só leitura para quem usa. */\n readonly validating = signal(false);\n protected readonly announcement = signal('');\n\n readonly items = computed<readonly StepComponent[]>(() => this.steps() ?? this.children());\n\n readonly #descriptors = computed<StepDescriptor[]>(() =>\n this.items().map((step) => ({\n optional: step.optional(),\n disabled: step.disabled(),\n completed: step.completed() ?? undefined,\n error: step.error() || undefined,\n })),\n );\n\n readonly state = computed<StepperState>(() => {\n const progress = this.#progress();\n return {\n current: initialStepperState(this.#descriptors(), this.selectedIndex()).current,\n completed: progress.completed,\n errors: progress.errors,\n };\n });\n\n readonly current = computed(() => this.state().current);\n readonly isFirst = computed(() => isFirstStep(this.#descriptors(), this.state()));\n readonly isLast = computed(() => isLastStep(this.#descriptors(), this.state()));\n\n readonly headingLevel = () => this.level();\n readonly headingHidden = () => this.hideHeading();\n\n protected readonly markers = computed<StepMarker[]>(() => {\n const steps = this.items();\n const descriptors = this.#descriptors();\n const state = this.state();\n const linear = this.linear();\n const readOnly = this.readOnly();\n const following = nextEnabledStep(descriptors, state.current, 1);\n const text = this.text;\n\n return steps.map((step, index) => {\n const status = stepStatus(descriptors, state, index);\n const active = index === state.current;\n const navigable =\n !readOnly &&\n !active &&\n status !== 'disabled' &&\n (index === following || canSelectStep(descriptors, state, index, linear));\n const situation = active && status !== 'error' ? text.current : text[status];\n let spoken = `${this.#stepName(index, steps.length, step.label())}, ${situation}`;\n if (step.optional()) spoken += `, ${text.optional}`;\n if (step.description()) spoken += `. ${step.description()}`;\n return {\n step,\n index,\n status,\n active,\n traversed: index < state.current || status === 'completed',\n navigable,\n glyph: status === 'completed' ? 'check' : status === 'error' ? 'exclamation-circle' : null,\n spoken,\n };\n });\n });\n\n isActive(step: object): boolean {\n return this.items()[this.current()] === step;\n }\n\n async next(): Promise<boolean> {\n if (this.validating()) return false;\n const from = this.current();\n const valid = await this.#validate(from);\n if (this.current() !== from) return false;\n if (!valid && this.#blocks(from)) return false;\n if (valid) this.#markCompleted(from);\n const target = nextEnabledStep(this.#descriptors(), from, 1);\n if (target >= 0) this.#moveTo(target);\n return true;\n }\n\n previous(): void {\n const target = nextEnabledStep(this.#descriptors(), this.current(), -1);\n if (target >= 0) this.#moveTo(target);\n }\n\n async goTo(index: number): Promise<boolean> {\n const from = this.current();\n if (index === from) return true;\n if (!canSelectStep(this.#descriptors(), this.state(), index, false)) return false;\n\n if (this.linear() && index > from) {\n if (this.validating()) return false;\n const valid = await this.#validate(from);\n if (this.current() !== from) return false;\n if (!valid && this.#blocks(from)) return false;\n if (valid) this.#markCompleted(from);\n }\n\n if (!canSelectStep(this.#descriptors(), this.state(), index, this.linear())) return false;\n this.#moveTo(index);\n return true;\n }\n\n async complete(): Promise<boolean> {\n if (this.validating()) return false;\n const from = this.current();\n const valid = await this.#validate(from);\n if (this.current() !== from) return false;\n if (!valid && this.#blocks(from)) return false;\n if (valid) this.#markCompleted(from);\n\n const descriptors = this.#descriptors();\n const state = this.state();\n if (isStepperComplete(descriptors, state)) return true;\n\n // Leva a pessoa ao primeiro ponto que ainda falta: uma etapa com erro ou obrigatória não feita.\n const missing = descriptors.findIndex(\n (step, i) =>\n step.disabled !== true &&\n (hasStepError(descriptors, state, i) || (step.optional !== true && !isStepCompleted(descriptors, state, i))),\n );\n if (missing >= 0 && missing !== from) this.#moveTo(missing);\n return false;\n }\n\n reset(): void {\n this.#progress.set(NO_PROGRESS);\n this.selectedIndex.set(Math.max(nextEnabledStep(this.#descriptors(), -1, 1), 0));\n this.announcement.set('');\n }\n\n protected choose(marker: StepMarker): void {\n if (marker.navigable) void this.goTo(marker.index);\n }\n\n #stepName(index: number, total: number, label: string): string {\n return formatMessage(this.text.stepOf, { index: index + 1, total, label });\n }\n\n /** Só segura no modo linear, e nunca numa etapa opcional. */\n #blocks(index: number): boolean {\n return this.linear() && !this.items()[index]?.optional();\n }\n\n #markCompleted(index: number): void {\n this.#progress.update(({ completed, errors }) => {\n const nextErrors = new Set(errors);\n nextErrors.delete(index);\n return { completed: new Set(completed).add(index), errors: nextErrors };\n });\n }\n\n #markError(index: number): void {\n this.#progress.update(({ completed, errors }) => {\n const nextCompleted = new Set(completed);\n nextCompleted.delete(index);\n return { completed: nextCompleted, errors: new Set(errors).add(index) };\n });\n }\n\n #clearError(index: number): void {\n if (!this.#progress().errors.has(index)) return;\n this.#progress.update(({ completed, errors }) => {\n const nextErrors = new Set(errors);\n nextErrors.delete(index);\n return { completed, errors: nextErrors };\n });\n }\n\n /**\n * Valida a etapa e registra o resultado (erro limpo ou marcado + anúncio). `validating` liga antes da\n * primeira espera, para que um segundo clique logo em seguida já encontre a trava.\n */\n async #validate(index: number): Promise<boolean> {\n const step = this.items()[index];\n const control = step?.stepControl() ?? null;\n const guard = step?.canAdvance() ?? null;\n if (!step || (!control && !guard)) return true;\n\n control?.markAllAsTouched();\n const waits = !!guard || !!control?.pending;\n if (waits) this.validating.set(true);\n let valid = true;\n try {\n if (control) {\n if (control.pending) await settled(control);\n valid = control.status !== 'INVALID';\n }\n if (valid && guard) {\n try {\n valid = Boolean(await guard());\n } catch {\n valid = false;\n }\n }\n } finally {\n if (waits) this.validating.set(false);\n }\n\n if (valid) {\n this.#clearError(index);\n } else {\n this.#markError(index);\n this.announcement.set(formatMessage(this.text.invalid, { label: step.label() }));\n }\n return valid;\n }\n\n #moveTo(index: number): void {\n const step = this.items()[index];\n this.selectedIndex.set(index);\n this.announcement.set(this.#stepName(index, this.items().length, step?.label() ?? ''));\n if (!step) return;\n afterNextRender(\n () => this.#host.nativeElement.querySelector<HTMLElement>(`[id=\"${step.headingId}\"]`)?.focus(),\n { injector: this.#injector },\n );\n }\n}\n","<div class=\"hm-stepper\" [class.hm-stepper--vertical]=\"orientation() === 'vertical'\">\n <nav class=\"hm-stepper__nav\" [attr.aria-label]=\"label() || text.label\">\n <ol class=\"hm-stepper__track\">\n @for (marker of markers(); track marker.step) {\n <li\n [class]=\"'hm-stepper__item hm-stepper__item--' + marker.status\"\n [class.hm-stepper__item--active]=\"marker.active\"\n [class.hm-stepper__item--traversed]=\"marker.traversed\"\n [attr.aria-current]=\"marker.active ? 'step' : null\"\n >\n @if (marker.navigable) {\n <button type=\"button\" class=\"hm-stepper__trigger\" (click)=\"choose(marker)\">\n <ng-container [ngTemplateOutlet]=\"face\" [ngTemplateOutletContext]=\"{ $implicit: marker }\" />\n </button>\n } @else {\n <div class=\"hm-stepper__trigger hm-stepper__trigger--static\">\n <ng-container [ngTemplateOutlet]=\"face\" [ngTemplateOutletContext]=\"{ $implicit: marker }\" />\n </div>\n }\n </li>\n }\n </ol>\n </nav>\n\n <div class=\"hm-stepper__content\">\n <ng-content />\n </div>\n\n <div class=\"hm-visually-hidden\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</div>\n</div>\n\n<ng-template #face let-marker>\n <span class=\"hm-stepper__mark\" aria-hidden=\"true\">\n @if (marker.glyph) {\n <hm-icon class=\"hm-stepper__glyph\" [shape]=\"marker.glyph\" />\n } @else {\n <span class=\"hm-stepper__number\">{{ marker.index + 1 }}</span>\n }\n </span>\n <span class=\"hm-stepper__text\" aria-hidden=\"true\">\n <span class=\"hm-stepper__label\">{{ marker.step.label() }}</span>\n @if (marker.step.description()) {\n <span class=\"hm-stepper__description\">{{ marker.step.description() }}</span>\n }\n @if (marker.step.optional()) {\n <span class=\"hm-stepper__optional\">{{ text.optional }}</span>\n }\n </span>\n <span class=\"hm-visually-hidden\">{{ marker.spoken }}</span>\n</ng-template>\n","// Ponto de import `@trismegisto/angular/stepper` (secundário do ng-packagr). O contrato fica em arquivo\n// próprio para o hm-step e o hm-stepper não se importarem mutuamente.\nexport * from './stepper.contract';\nexport * from './step.component';\nexport * from './stepper.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;;;AAGG;MACmB,eAAe,CAAA;AAOpC;;ACJM,MAAM,aAAa,GAA8B,CAAC,UAAU,EAAE,uBAAuB,CAAC;;ACH7F,IAAI,QAAQ,GAAG,CAAC;AAEhB;;;;;;AAMG;MAuBU,aAAa,CAAA;AACf,IAAA,MAAM,GAAG,cAAc,CAAC,aAAa,CAAC;;AAGtC,IAAA,KAAK,GAAG,KAAK,CAAC,EAAE,4EAAC;;AAEjB,IAA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AA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC3H3D,2gEAkDA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED6CY,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,OAAA,EAAA,OAAA,EAAA,QAAA,EAAA,MAAA,EAAA,SAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAM9B,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAR5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAAA,OAAA,EACb,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAA,eAAA,EAEzB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAA,SAAA,EACvB,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,gBAAiB,CAAC,EAAE,CAAC,EAAA,QAAA,EAAA,2gEAAA,EAAA;o5BAwB9C,aAAa,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3H3D;AACA;;ACDA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"trismegisto-angular-stepper.mjs","sources":["../../src/stepper/stepper.contract.ts","../../src/stepper/icons.generated.ts","../../src/stepper/step.component.ts","../../src/stepper/stepper.component.ts","../../src/stepper/stepper.component.html","../../src/stepper/index.ts","../../src/stepper/trismegisto-angular-stepper.ts"],"sourcesContent":["import type { TemplateRef } from '@angular/core';\n\n/**\n * O que um `hm-step` consulta no componente que o agrupa. O `hm-stepper` fornece este token, e um\n * componente que o embrulhe (o `hm-wizard`, por exemplo) pode fornecê-lo no lugar dele.\n */\nexport abstract class HermesStepGroup {\n /** A etapa é a que está aberta agora? */\n abstract isActive(step: object): boolean;\n /** `aria-level` do título do painel. */\n abstract readonly headingLevel: () => number;\n /** Título do painel só para leitor de tela. */\n abstract readonly headingHidden: () => boolean;\n}\n\n/** Guarda extra antes de sair adiante de uma etapa. `false`, exceção ou rejeição seguram a etapa. */\nexport type HermesStepGuard = () => boolean | Promise<boolean>;\n\nexport interface HermesStepSummaryEntry {\n readonly term: string;\n /** `null`, `undefined` ou `''` aparecem como vazio. */\n readonly value?: string | number | null;\n}\n\n/** O que a etapa resume na página de revisão do `hm-wizard`: um template ou pares termo/valor. */\nexport type HermesStepSummary = TemplateRef<unknown> | (() => readonly HermesStepSummaryEntry[]);\n","// GERADO por scripts/generate-internal-icons.mjs — não editar à mão.\n// Ícones que esta pasta usa por dentro; cada @Component/@Directive daqui os registra com\n// `readonly #icons = useHermesIcons(STEPPER_ICONS);`.\nimport type { RegisteredIcon } from '@trismegisto/icons';\nimport {\n ICON_CHECK,\n ICON_EXCLAMATION_CIRCLE,\n} from '@trismegisto/angular/icon';\n\nexport const STEPPER_ICONS: readonly RegisteredIcon[] = [ICON_CHECK, ICON_EXCLAMATION_CIRCLE];\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { STEPPER_ICONS } from './icons.generated';\nimport { HermesStepGroup, HermesStepGuard, HermesStepSummary } from './stepper.contract';\n\nlet sequence = 0;\n\n/**\n * Uma etapa de `hm-stepper` (ou de `hm-wizard`). Só a etapa aberta desenha o painel; as outras ficam\n * sem nada no DOM, mas o conteúdo projetado continua vivo — um formulário preenchido numa etapa está lá\n * do mesmo jeito quando a pessoa volta a ela.\n *\n * Quem decide se ela está aberta é o grupo que a contém, obtido por injeção (`HermesStepGroup`).\n */\n@Component({\n selector: 'hm-step',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hm-step' },\n template: `\n @if (active()) {\n <div class=\"hm-step__panel\" role=\"group\" [id]=\"panelId\" [attr.aria-labelledby]=\"headingId\">\n <div\n class=\"hm-step__heading\"\n role=\"heading\"\n tabindex=\"-1\"\n [id]=\"headingId\"\n [attr.aria-level]=\"group.headingLevel()\"\n [class.hm-visually-hidden]=\"group.headingHidden()\"\n >\n {{ label() }}\n </div>\n <div class=\"hm-step__body\"><ng-content /></div>\n </div>\n }\n `,\n})\nexport class StepComponent {\n readonly #icons = useHermesIcons(STEPPER_ICONS);\n\n /** Nome da etapa no indicador e título do painel. */\n readonly label = input('');\n /** Texto curto sob o nome, no indicador. */\n readonly description = input('');\n /** Não segura o avanço no modo linear, nem impede o fluxo de ficar completo. */\n readonly optional = input(false, { transform: booleanAttribute });\n /** Nunca alcançável; Avançar e Voltar passam por cima dela. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Força a situação de erro (soma-se ao erro de validação). */\n readonly error = input(false, { transform: booleanAttribute });\n /** `true`/`false` forçam concluída/pendente; `null` deixa o stepper decidir pelo que a pessoa fez. */\n readonly completed = input<boolean | null>(null);\n /** Controle validado ao sair adiante da etapa (é tocado para mostrar os erros). */\n readonly stepControl = input<AbstractControl | null>(null);\n /** Guarda extra, chamada depois do controle passar. */\n readonly canAdvance = input<HermesStepGuard | null>(null);\n /** O que esta etapa mostra na página de revisão do `hm-wizard`. */\n readonly summary = input<HermesStepSummary | null>(null);\n\n readonly panelId = `hm-step-panel-${++sequence}`;\n readonly headingId = `hm-step-heading-${sequence}`;\n\n protected readonly group = inject(HermesStepGroup);\n protected readonly active = computed(() => this.group.isActive(this));\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n model,\n signal,\n} from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport {\n StepDescriptor,\n StepStatus,\n StepperState,\n canSelectStep,\n clearStepError,\n completeAndAdvance,\n completeStep,\n formatMessage,\n hasStepError,\n initialStepperState,\n isFirstStep,\n isLastStep,\n isStepCompleted,\n isStepperComplete,\n markStepError,\n nextEnabledStep,\n previousStep,\n selectStep,\n stepStatus,\n} from '@trismegisto/primitives';\nimport { HERMES_MESSAGES } from '@trismegisto/angular/i18n';\nimport { IconComponent, useHermesIcons } from '@trismegisto/angular/icon';\nimport { STEPPER_ICONS } from './icons.generated';\nimport { StepComponent } from './step.component';\nimport { HermesStepGroup } from './stepper.contract';\n\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** O que o indicador desenha para cada etapa. */\ninterface StepMarker {\n readonly step: StepComponent;\n readonly index: number;\n readonly status: StepStatus;\n readonly active: boolean;\n /** O trecho de régua que sai desta etapa em direção à seguinte já foi percorrido. */\n readonly traversed: boolean;\n readonly navigable: boolean;\n readonly glyph: string | null;\n /** Nome completo para leitor de tela (número, rótulo, situação, opcional, descrição). */\n readonly spoken: string;\n}\n\n/** O que o `StepperState` do primitives guarda além da etapa aberta (que aqui é o `selectedIndex`). */\ntype StepProgress = Omit<StepperState, 'current'>;\n\nconst NO_PROGRESS: StepProgress = { completed: new Set(), errors: new Set() };\n\n/** Espera um controle com validação assíncrona sair de PENDING. */\nfunction settled(control: AbstractControl): Promise<void> {\n return new Promise((resolve) => {\n let done = false;\n const finish = () => {\n if (done) return;\n done = true;\n subscription?.unsubscribe();\n resolve();\n };\n const subscription = control.statusChanges.subscribe((status) => {\n if (status !== 'PENDING') finish();\n });\n if (!control.pending) finish();\n });\n}\n\n/**\n * Fluxo em etapas: o indicador (lista ordenada dentro de um `nav`) e o painel da etapa aberta.\n *\n * ```html\n * <hm-stepper linear [(selectedIndex)]=\"etapa\">\n * <hm-step label=\"Dados\" [stepControl]=\"dados\">…</hm-step>\n * <hm-step label=\"Endereço\" optional>…</hm-step>\n * <hm-step label=\"Confirmação\">…</hm-step>\n * </hm-stepper>\n * ```\n *\n * Não é um widget composto: cada etapa alcançável é um botão comum na ordem de Tab. Ao trocar de etapa\n * por ação (`next`, `previous`, `goTo`, `complete`, clique), a etapa nova é anunciada e o foco vai para\n * o título dela; mudar `selectedIndex` por fora só redesenha.\n */\n@Component({\n selector: 'hm-stepper',\n imports: [NgTemplateOutlet, IconComponent],\n templateUrl: './stepper.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hm-stepper-host' },\n providers: [{ provide: HermesStepGroup, useExisting: forwardRef(() => StepperComponent) }],\n})\nexport class StepperComponent extends HermesStepGroup {\n readonly #icons = useHermesIcons(STEPPER_ICONS);\n\n /** Índice (0-based) da etapa aberta. Two-way. */\n readonly selectedIndex = model(0);\n /** Avançar valida a etapa aberta e o indicador não salta adiante sem concluir as anteriores. */\n readonly linear = input(false, { transform: booleanAttribute });\n readonly orientation = input<StepperOrientation>('horizontal');\n /** Indicador só informativo: nenhuma etapa é clicável. */\n readonly readOnly = input(false, { transform: booleanAttribute });\n /** Nome do `nav`. Vazio = catálogo. */\n readonly label = input('');\n /** `aria-level` do título de cada painel. */\n readonly level = input(3);\n /** Título do painel só para leitor de tela (quando a tela já tem um título visível). */\n readonly hideHeading = input(false, { transform: booleanAttribute });\n /**\n * Etapas explícitas no lugar das filhas. Para quem re-projeta `hm-step` (o `hm-wizard`): conteúdo\n * re-projetado não aparece na consulta de conteúdo deste componente.\n */\n readonly steps = input<readonly StepComponent[] | null>(null);\n\n private readonly children = contentChildren(StepComponent);\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #injector = inject(Injector);\n protected readonly text = inject(HERMES_MESSAGES).stepper;\n\n readonly #progress = signal<StepProgress>(NO_PROGRESS);\n\n /** Validação em curso (guarda assíncrona ou controle `pending`). Só leitura para quem usa. */\n readonly validating = signal(false);\n protected readonly announcement = signal('');\n\n readonly items = computed<readonly StepComponent[]>(() => this.steps() ?? this.children());\n\n readonly #descriptors = computed<StepDescriptor[]>(() =>\n this.items().map((step) => ({\n optional: step.optional(),\n disabled: step.disabled(),\n completed: step.completed() ?? undefined,\n error: step.error() || undefined,\n })),\n );\n\n readonly state = computed<StepperState>(() => {\n const progress = this.#progress();\n return {\n current: initialStepperState(this.#descriptors(), this.selectedIndex()).current,\n completed: progress.completed,\n errors: progress.errors,\n };\n });\n\n readonly current = computed(() => this.state().current);\n readonly isFirst = computed(() => isFirstStep(this.#descriptors(), this.state()));\n readonly isLast = computed(() => isLastStep(this.#descriptors(), this.state()));\n\n readonly headingLevel = () => this.level();\n readonly headingHidden = () => this.hideHeading();\n\n protected readonly markers = computed<StepMarker[]>(() => {\n const steps = this.items();\n const descriptors = this.#descriptors();\n const state = this.state();\n const linear = this.linear();\n const readOnly = this.readOnly();\n const following = nextEnabledStep(descriptors, state.current, 1);\n const text = this.text;\n\n return steps.map((step, index) => {\n const status = stepStatus(descriptors, state, index);\n const active = index === state.current;\n const navigable =\n !readOnly &&\n !active &&\n status !== 'disabled' &&\n (index === following || canSelectStep(descriptors, state, index, linear));\n const situation = active && status !== 'error' ? text.current : text[status];\n let spoken = `${this.#stepName(index, steps.length, step.label())}, ${situation}`;\n if (step.optional()) spoken += `, ${text.optional}`;\n if (step.description()) spoken += `. ${step.description()}`;\n return {\n step,\n index,\n status,\n active,\n traversed: index < state.current || status === 'completed',\n navigable,\n glyph: status === 'completed' ? 'check' : status === 'error' ? 'exclamation-circle' : null,\n spoken,\n };\n });\n });\n\n isActive(step: object): boolean {\n return this.items()[this.current()] === step;\n }\n\n async next(): Promise<boolean> {\n if (this.validating()) return false;\n const from = this.current();\n const valid = await this.#validate(from);\n if (this.current() !== from) return false;\n if (!valid && this.#blocks(from)) return false;\n const descriptors = this.#descriptors();\n if (valid) {\n // Conclui a etapa e já calcula a seguinte habilitada (`completeAndAdvance`).\n const advanced = this.#applyProgress((state) => completeAndAdvance(descriptors, state));\n if (advanced.current !== from) this.#moveTo(advanced.current);\n return true;\n }\n const target = nextEnabledStep(descriptors, from, 1);\n if (target >= 0) this.#moveTo(target);\n return true;\n }\n\n previous(): void {\n const state = this.state();\n const target = previousStep(this.#descriptors(), state);\n if (target !== state) this.#moveTo(target.current);\n }\n\n async goTo(index: number): Promise<boolean> {\n const from = this.current();\n if (index === from) return true;\n if (!canSelectStep(this.#descriptors(), this.state(), index, false)) return false;\n\n if (this.linear() && index > from) {\n if (this.validating()) return false;\n const valid = await this.#validate(from);\n if (this.current() !== from) return false;\n if (!valid && this.#blocks(from)) return false;\n if (valid) this.#markCompleted(from);\n }\n\n const state = this.state();\n const target = selectStep(this.#descriptors(), state, index, this.linear());\n if (target === state) return false;\n this.#moveTo(target.current);\n return true;\n }\n\n async complete(): Promise<boolean> {\n if (this.validating()) return false;\n const from = this.current();\n const valid = await this.#validate(from);\n if (this.current() !== from) return false;\n if (!valid && this.#blocks(from)) return false;\n if (valid) this.#markCompleted(from);\n\n const descriptors = this.#descriptors();\n const state = this.state();\n if (isStepperComplete(descriptors, state)) return true;\n\n // Leva a pessoa ao primeiro ponto que ainda falta: uma etapa com erro ou obrigatória não feita.\n const missing = descriptors.findIndex(\n (step, i) =>\n step.disabled !== true &&\n (hasStepError(descriptors, state, i) || (step.optional !== true && !isStepCompleted(descriptors, state, i))),\n );\n if (missing >= 0 && missing !== from) this.#moveTo(missing);\n return false;\n }\n\n reset(): void {\n this.#progress.set(NO_PROGRESS);\n this.selectedIndex.set(Math.max(nextEnabledStep(this.#descriptors(), -1, 1), 0));\n this.announcement.set('');\n }\n\n protected choose(marker: StepMarker): void {\n if (marker.navigable) void this.goTo(marker.index);\n }\n\n #stepName(index: number, total: number, label: string): string {\n return formatMessage(this.text.stepOf, { index: index + 1, total, label });\n }\n\n /** Só segura no modo linear, e nunca numa etapa opcional. */\n #blocks(index: number): boolean {\n return this.linear() && !this.items()[index]?.optional();\n }\n\n /**\n * Aplica uma transição do primitives (`completeStep`, `markStepError`...) ao estado atual e guarda o\n * progresso (concluídas/erros). A etapa aberta continua sendo o `selectedIndex`: quem chama decide se move\n * (`#moveTo`, que anuncia e leva o foco). Devolve o estado novo (o mesmo objeto se nada mudou).\n */\n #applyProgress(change: (state: StepperState) => StepperState): StepperState {\n const state = this.state();\n const next = change(state);\n if (next.completed !== state.completed || next.errors !== state.errors) {\n this.#progress.set({ completed: next.completed, errors: next.errors });\n }\n return next;\n }\n\n #markCompleted(index: number): void {\n this.#applyProgress((state) => completeStep(state, index));\n }\n\n /**\n * Valida a etapa e registra o resultado (erro limpo ou marcado + anúncio). `validating` liga antes da\n * primeira espera, para que um segundo clique logo em seguida já encontre a trava.\n */\n async #validate(index: number): Promise<boolean> {\n const step = this.items()[index];\n const control = step?.stepControl() ?? null;\n const guard = step?.canAdvance() ?? null;\n if (!step || (!control && !guard)) return true;\n\n control?.markAllAsTouched();\n const waits = !!guard || !!control?.pending;\n if (waits) this.validating.set(true);\n let valid = true;\n try {\n if (control) {\n if (control.pending) await settled(control);\n valid = control.status !== 'INVALID';\n }\n if (valid && guard) {\n try {\n valid = Boolean(await guard());\n } catch {\n valid = false;\n }\n }\n } finally {\n if (waits) this.validating.set(false);\n }\n\n if (valid) {\n this.#applyProgress((state) => clearStepError(state, index));\n } else {\n this.#applyProgress((state) => markStepError(state, index));\n this.announcement.set(formatMessage(this.text.invalid, { label: step.label() }));\n }\n return valid;\n }\n\n #moveTo(index: number): void {\n const step = this.items()[index];\n this.selectedIndex.set(index);\n this.announcement.set(this.#stepName(index, this.items().length, step?.label() ?? ''));\n if (!step) return;\n afterNextRender(\n () => this.#host.nativeElement.querySelector<HTMLElement>(`[id=\"${step.headingId}\"]`)?.focus(),\n { injector: this.#injector },\n );\n }\n}\n","<div class=\"hm-stepper\" [class.hm-stepper--vertical]=\"orientation() === 'vertical'\">\n <nav class=\"hm-stepper__nav\" [attr.aria-label]=\"label() || text.label\">\n <ol class=\"hm-stepper__track\">\n @for (marker of markers(); track marker.step) {\n <li\n [class]=\"'hm-stepper__item hm-stepper__item--' + marker.status\"\n [class.hm-stepper__item--active]=\"marker.active\"\n [class.hm-stepper__item--traversed]=\"marker.traversed\"\n [attr.aria-current]=\"marker.active ? 'step' : null\"\n >\n @if (marker.navigable) {\n <button type=\"button\" class=\"hm-stepper__trigger\" (click)=\"choose(marker)\">\n <ng-container [ngTemplateOutlet]=\"face\" [ngTemplateOutletContext]=\"{ $implicit: marker }\" />\n </button>\n } @else {\n <div class=\"hm-stepper__trigger hm-stepper__trigger--static\">\n <ng-container [ngTemplateOutlet]=\"face\" [ngTemplateOutletContext]=\"{ $implicit: marker }\" />\n </div>\n }\n </li>\n }\n </ol>\n </nav>\n\n <div class=\"hm-stepper__content\">\n <ng-content />\n </div>\n\n <div class=\"hm-visually-hidden\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</div>\n</div>\n\n<ng-template #face let-marker>\n <span class=\"hm-stepper__mark\" aria-hidden=\"true\">\n @if (marker.glyph) {\n <hm-icon class=\"hm-stepper__glyph\" [shape]=\"marker.glyph\" />\n } @else {\n <span class=\"hm-stepper__number\">{{ marker.index + 1 }}</span>\n }\n </span>\n <span class=\"hm-stepper__text\" aria-hidden=\"true\">\n <span class=\"hm-stepper__label\">{{ marker.step.label() }}</span>\n @if (marker.step.description()) {\n <span class=\"hm-stepper__description\">{{ marker.step.description() }}</span>\n }\n @if (marker.step.optional()) {\n <span class=\"hm-stepper__optional\">{{ text.optional }}</span>\n }\n </span>\n <span class=\"hm-visually-hidden\">{{ marker.spoken }}</span>\n</ng-template>\n","// Ponto de import `@trismegisto/angular/stepper` (secundário do ng-packagr). O contrato fica em arquivo\n// próprio para o hm-step e o hm-stepper não se importarem mutuamente.\nexport * from './stepper.contract';\nexport * from './step.component';\nexport * from './stepper.component';\n","/**\n * Generated bundle index. Do not edit.\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AEG;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, input, booleanAttribute, computed, viewChild, afterRenderEffect,
|
|
2
|
+
import { model, input, booleanAttribute, computed, viewChild, afterRenderEffect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { formatMessage } from '@trismegisto/primitives';
|
|
4
|
-
import { warnDeprecated } from '@trismegisto/angular/deprecation';
|
|
5
4
|
import { HermesFormFieldBase } from '@trismegisto/angular/forms';
|
|
6
5
|
|
|
7
6
|
let nextId = 0;
|
|
@@ -18,8 +17,6 @@ class SwitchComponent extends HermesFormFieldBase {
|
|
|
18
17
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
19
18
|
/** Texto de apoio embaixo do rótulo. */
|
|
20
19
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
21
|
-
/** @deprecated desde 0.2.0 — use `hint`. */
|
|
22
|
-
help = input('', ...(ngDevMode ? [{ debugName: "help" }] : /* istanbul ignore next */ []));
|
|
23
20
|
/** Lado do rótulo. A ordem de leitura e de foco não muda. */
|
|
24
21
|
labelPosition = input('after', ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
25
22
|
/** Silhueta no lugar do controle enquanto o valor real não chega. */
|
|
@@ -29,7 +26,7 @@ class SwitchComponent extends HermesFormFieldBase {
|
|
|
29
26
|
loadingLabel = computed(() => formatMessage(this.text.loading, { label: this.label() }), ...(ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []));
|
|
30
27
|
id = `hm-switch-${++nextId}`;
|
|
31
28
|
helpId = `${this.id}-hint`;
|
|
32
|
-
hintText = computed(() => this.hint()
|
|
29
|
+
hintText = computed(() => this.hint(), ...(ngDevMode ? [{ debugName: "hintText" }] : /* istanbul ignore next */ []));
|
|
33
30
|
controlEl = viewChild('control', ...(ngDevMode ? [{ debugName: "controlEl" }] : /* istanbul ignore next */ []));
|
|
34
31
|
constructor() {
|
|
35
32
|
super();
|
|
@@ -41,21 +38,17 @@ class SwitchComponent extends HermesFormFieldBase {
|
|
|
41
38
|
if (element && element.checked !== on)
|
|
42
39
|
element.checked = on;
|
|
43
40
|
});
|
|
44
|
-
effect(() => {
|
|
45
|
-
if (this.help())
|
|
46
|
-
untracked(() => warnDeprecated('`help` em <hm-switch>', '`hint`'));
|
|
47
|
-
});
|
|
48
41
|
}
|
|
49
42
|
onChange(event) {
|
|
50
43
|
this.commit(event.target.checked);
|
|
51
44
|
}
|
|
52
45
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
53
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: SwitchComponent, isStandalone: true, selector: "hm-switch", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null },
|
|
46
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: SwitchComponent, isStandalone: true, selector: "hm-switch", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, viewQueries: [{ propertyName: "controlEl", first: true, predicate: ["control"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (loading()) {\n <div class=\"hm-switch hm-switch--loading\" role=\"status\" aria-busy=\"true\" [attr.aria-label]=\"loadingLabel()\">\n <span class=\"hm-switch__ghost-track\" aria-hidden=\"true\"></span>\n <span class=\"hm-switch__ghost-label\" aria-hidden=\"true\"></span>\n </div>\n} @else {\n <div\n class=\"hm-switch\"\n [class.hm-switch--before]=\"labelPosition() === 'before'\"\n [class.hm-switch--disabled]=\"isDisabled()\"\n >\n <span class=\"hm-switch__toggle\">\n <input\n #control\n type=\"checkbox\"\n role=\"switch\"\n class=\"hm-switch__control\"\n [id]=\"id\"\n [checked]=\"!!value()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-describedby]=\"hintText() ? helpId : null\"\n (change)=\"onChange($event)\"\n (blur)=\"markTouched()\"\n />\n <span class=\"hm-switch__track\" aria-hidden=\"true\"><span class=\"hm-switch__thumb\"></span></span>\n </span>\n <label class=\"hm-switch__label\" [for]=\"id\">{{ label() }}</label>\n @if (hintText()) {\n <p class=\"hm-switch__help\" [id]=\"helpId\">{{ hintText() }}</p>\n }\n </div>\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
54
47
|
}
|
|
55
48
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
56
49
|
type: Component,
|
|
57
50
|
args: [{ selector: 'hm-switch', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (loading()) {\n <div class=\"hm-switch hm-switch--loading\" role=\"status\" aria-busy=\"true\" [attr.aria-label]=\"loadingLabel()\">\n <span class=\"hm-switch__ghost-track\" aria-hidden=\"true\"></span>\n <span class=\"hm-switch__ghost-label\" aria-hidden=\"true\"></span>\n </div>\n} @else {\n <div\n class=\"hm-switch\"\n [class.hm-switch--before]=\"labelPosition() === 'before'\"\n [class.hm-switch--disabled]=\"isDisabled()\"\n >\n <span class=\"hm-switch__toggle\">\n <input\n #control\n type=\"checkbox\"\n role=\"switch\"\n class=\"hm-switch__control\"\n [id]=\"id\"\n [checked]=\"!!value()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-describedby]=\"hintText() ? helpId : null\"\n (change)=\"onChange($event)\"\n (blur)=\"markTouched()\"\n />\n <span class=\"hm-switch__track\" aria-hidden=\"true\"><span class=\"hm-switch__thumb\"></span></span>\n </span>\n <label class=\"hm-switch__label\" [for]=\"id\">{{ label() }}</label>\n @if (hintText()) {\n <p class=\"hm-switch__help\" [id]=\"helpId\">{{ hintText() }}</p>\n }\n </div>\n}\n" }]
|
|
58
|
-
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }],
|
|
51
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], controlEl: [{ type: i0.ViewChild, args: ['control', { isSignal: true }] }] } });
|
|
59
52
|
|
|
60
53
|
// Ponto de import `@trismegisto/angular/switch` (secundário do ng-packagr).
|
|
61
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trismegisto-angular-switch.mjs","sources":["../../src/switch/switch.component.ts","../../src/switch/switch.component.html","../../src/switch/index.ts","../../src/switch/trismegisto-angular-switch.ts"],"sourcesContent":["import {\n afterRenderEffect,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n
|
|
1
|
+
{"version":3,"file":"trismegisto-angular-switch.mjs","sources":["../../src/switch/switch.component.ts","../../src/switch/switch.component.html","../../src/switch/index.ts","../../src/switch/trismegisto-angular-switch.ts"],"sourcesContent":["import {\n afterRenderEffect,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { formatMessage } from '@trismegisto/primitives';\nimport { HermesFormFieldBase } from '@trismegisto/angular/forms';\n\nexport type SwitchLabelPosition = 'before' | 'after';\n\nlet nextId = 0;\n\n/**\n * Interruptor de efeito imediato (ligar/desligar uma preferência). É um checkbox nativo com\n * `role=\"switch\"`: Espaço alterna e o leitor anuncia \"ligado/desligado\". Para escolha que só vale ao\n * enviar um formulário, prefira `hm-checkbox`.\n *\n * Não exibe mensagem de erro: um interruptor não fica \"inválido\" — se a escolha é obrigatória, explique\n * no `hint`. Funciona com Reactive Forms, `[(ngModel)]` ou `[(value)]` (ver `HermesFormFieldBase`).\n */\n@Component({\n selector: 'hm-switch',\n templateUrl: './switch.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SwitchComponent extends HermesFormFieldBase<boolean> {\n readonly value = model(false);\n readonly label = input.required<string>();\n /** Texto de apoio embaixo do rótulo. */\n readonly hint = input('');\n /** Lado do rótulo. A ordem de leitura e de foco não muda. */\n readonly labelPosition = input<SwitchLabelPosition>('after');\n /** Silhueta no lugar do controle enquanto o valor real não chega. */\n readonly loading = input(false, { transform: booleanAttribute });\n\n protected readonly valueModel = this.value;\n protected readonly text = this.fieldText;\n protected readonly loadingLabel = computed(() => formatMessage(this.text.loading, { label: this.label() }));\n\n protected readonly id = `hm-switch-${++nextId}`;\n protected readonly helpId = `${this.id}-hint`;\n protected readonly hintText = computed(() => this.hint());\n\n private readonly controlEl = viewChild<ElementRef<HTMLInputElement>>('control');\n\n constructor() {\n super();\n // O clique muda o `checked` nativo antes do modelo; se o app desfizer o valor no mesmo ciclo, o\n // binding não percebe diferença e o DOM ficaria marcado. Reafirma o estado depois de cada render.\n afterRenderEffect(() => {\n const element = this.controlEl()?.nativeElement;\n const on = !!this.value();\n if (element && element.checked !== on) element.checked = on;\n });\n }\n\n protected onChange(event: Event): void {\n this.commit((event.target as HTMLInputElement).checked);\n }\n}\n","@if (loading()) {\n <div class=\"hm-switch hm-switch--loading\" role=\"status\" aria-busy=\"true\" [attr.aria-label]=\"loadingLabel()\">\n <span class=\"hm-switch__ghost-track\" aria-hidden=\"true\"></span>\n <span class=\"hm-switch__ghost-label\" aria-hidden=\"true\"></span>\n </div>\n} @else {\n <div\n class=\"hm-switch\"\n [class.hm-switch--before]=\"labelPosition() === 'before'\"\n [class.hm-switch--disabled]=\"isDisabled()\"\n >\n <span class=\"hm-switch__toggle\">\n <input\n #control\n type=\"checkbox\"\n role=\"switch\"\n class=\"hm-switch__control\"\n [id]=\"id\"\n [checked]=\"!!value()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-describedby]=\"hintText() ? helpId : null\"\n (change)=\"onChange($event)\"\n (blur)=\"markTouched()\"\n />\n <span class=\"hm-switch__track\" aria-hidden=\"true\"><span class=\"hm-switch__thumb\"></span></span>\n </span>\n <label class=\"hm-switch__label\" [for]=\"id\">{{ label() }}</label>\n @if (hintText()) {\n <p class=\"hm-switch__help\" [id]=\"helpId\">{{ hintText() }}</p>\n }\n </div>\n}\n","// Ponto de import `@trismegisto/angular/switch` (secundário do ng-packagr).\nexport * from './switch.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAgBA,IAAI,MAAM,GAAG,CAAC;AAEd;;;;;;;AAOG;AAMG,MAAO,eAAgB,SAAQ,mBAA4B,CAAA;AACtD,IAAA,KAAK,GAAG,KAAK,CAAC,KAAK,4EAAC;AACpB,IAAA,KAAK,GAAG,KAAK,CA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C,MAAM,CAAE,KAAK,CAAC,MAA2B,CAAC,OAAO,CAAC;IACzD;wGAjCW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,eAAe,m3BC/B5B,otCAiCA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDFa,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,SAAS;+BACE,WAAW,EAAA,eAAA,EAEJ,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,otCAAA,EAAA;gmBAoBsB,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjDhF;;ACAA;;AAEG;;"}
|
|
@@ -9,6 +9,11 @@ import { isRtl } from '@trismegisto/angular/direction';
|
|
|
9
9
|
|
|
10
10
|
const TAB_BAR_ICONS = [ICON_KEYBOARD, ICON_PLUS, ICON_TIMES];
|
|
11
11
|
|
|
12
|
+
/** Cartão de hover (como no navegador): espera do ponteiro parado, tempo que ele resiste ao sair da aba e vão sob a aba. */
|
|
13
|
+
const PREVIEW_DELAY_MS = 500;
|
|
14
|
+
const PREVIEW_LINGER_MS = 120;
|
|
15
|
+
const PREVIEW_GAP = 4;
|
|
16
|
+
const PREVIEW_MAX_WIDTH = 320;
|
|
12
17
|
let uid = 0;
|
|
13
18
|
/**
|
|
14
19
|
* Fileira de abas "de navegador" (páginas abertas), **controlada**: desenha `tabs`/`active` e só emite
|
|
@@ -89,6 +94,42 @@ class TabBarComponent {
|
|
|
89
94
|
service.unregisterTarget(this.dropTarget);
|
|
90
95
|
});
|
|
91
96
|
}
|
|
97
|
+
// ---------------------------------------------------------------- cartão de hover
|
|
98
|
+
/** Cartão com o nome inteiro da aba e a `description`, sob a aba apontada (só mouse). */
|
|
99
|
+
preview = signal(null, ...(ngDevMode ? [{ debugName: "preview" }] : /* istanbul ignore next */ []));
|
|
100
|
+
previewTimer = null;
|
|
101
|
+
#previewCleanup = inject(DestroyRef).onDestroy(() => this.clearPreviewTimer());
|
|
102
|
+
onTabPointerEnter(event, tab) {
|
|
103
|
+
if (!this.browser || (event.pointerType || 'mouse') !== 'mouse' || this.draggingId())
|
|
104
|
+
return;
|
|
105
|
+
const element = event.currentTarget;
|
|
106
|
+
const show = () => {
|
|
107
|
+
const rect = element.getBoundingClientRect();
|
|
108
|
+
const maxLeft = (this.document.defaultView?.innerWidth ?? rect.right) - PREVIEW_MAX_WIDTH - PREVIEW_GAP;
|
|
109
|
+
this.preview.set({ tab, left: Math.max(PREVIEW_GAP, Math.min(rect.left, maxLeft)), top: rect.bottom + PREVIEW_GAP });
|
|
110
|
+
};
|
|
111
|
+
// Com o cartão aberto, passar para a aba vizinha troca na hora (como no navegador).
|
|
112
|
+
const open = this.preview() !== null;
|
|
113
|
+
this.clearPreviewTimer();
|
|
114
|
+
if (open)
|
|
115
|
+
show();
|
|
116
|
+
else
|
|
117
|
+
this.previewTimer = setTimeout(show, PREVIEW_DELAY_MS);
|
|
118
|
+
}
|
|
119
|
+
onTabPointerLeave() {
|
|
120
|
+
this.clearPreviewTimer();
|
|
121
|
+
if (this.preview())
|
|
122
|
+
this.previewTimer = setTimeout(() => this.preview.set(null), PREVIEW_LINGER_MS);
|
|
123
|
+
}
|
|
124
|
+
hidePreview() {
|
|
125
|
+
this.clearPreviewTimer();
|
|
126
|
+
this.preview.set(null);
|
|
127
|
+
}
|
|
128
|
+
clearPreviewTimer() {
|
|
129
|
+
if (this.previewTimer !== null)
|
|
130
|
+
clearTimeout(this.previewTimer);
|
|
131
|
+
this.previewTimer = null;
|
|
132
|
+
}
|
|
92
133
|
// ---------------------------------------------------------------- mouse e teclado
|
|
93
134
|
isMarked(id, edge) {
|
|
94
135
|
const marker = this.marker();
|
|
@@ -223,6 +264,7 @@ class TabBarComponent {
|
|
|
223
264
|
onTabPointerDown(event, tab) {
|
|
224
265
|
if (!this.browser)
|
|
225
266
|
return;
|
|
267
|
+
this.hidePreview();
|
|
226
268
|
if (event.target?.closest?.('.hm-tab-bar__close'))
|
|
227
269
|
return;
|
|
228
270
|
if ((event.pointerType || 'mouse') === 'mouse' && event.button !== 0)
|
|
@@ -282,6 +324,8 @@ class TabBarComponent {
|
|
|
282
324
|
contained: () => false,
|
|
283
325
|
focusTarget: () => hit,
|
|
284
326
|
previewTemplate: () => null,
|
|
327
|
+
// Presa à faixa enquanto reordena; puxada para longe (mais que a altura da aba), solta-se para dividir a tela.
|
|
328
|
+
axisLock: () => ({ release: box.getBoundingClientRect().height }),
|
|
285
329
|
setDragging: (via) => this.draggingId.set(via ? tab.id : ''),
|
|
286
330
|
started: (via) => {
|
|
287
331
|
gesture.moving = true;
|
|
@@ -446,11 +490,11 @@ class TabBarComponent {
|
|
|
446
490
|
};
|
|
447
491
|
}
|
|
448
492
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: TabBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
449
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: TabBarComponent, isStandalone: true, selector: "hm-tab-bar", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: true, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, allowNewTab: { classPropertyName: "allowNewTab", publicName: "allowNewTab", isSignal: true, isRequired: false, transformFunction: null }, contentId: { classPropertyName: "contentId", publicName: "contentId", isSignal: true, isRequired: false, transformFunction: null }, tabGroup: { classPropertyName: "tabGroup", publicName: "tabGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activated: "activated", closed: "closed", reordered: "reordered", newTabRequested: "newTabRequested", contextMenuRequested: "contextMenuRequested", tabReceived: "tabReceived" }, viewQueries: [{ propertyName: "bar", first: true, predicate: ["bar"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #bar class=\"hm-tab-bar\">\n <div class=\"hm-tab-bar__list\" role=\"tablist\" [attr.aria-label]=\"text().label\">\n @for (tab of tabs(); track tab.id; let index = $index) {\n <div\n class=\"hm-tab-bar__tab\"\n role=\"presentation\"\n [class.hm-tab-bar__tab--active]=\"tab.id === active()\"\n [class.hm-tab-bar__tab--dragging]=\"draggingId() === tab.id\"\n [class.hm-tab-bar__tab--pinned]=\"tab.pinned\"\n [class.hm-tab-bar__tab--drop-before]=\"isMarked(tab.id, 'before')\"\n [class.hm-tab-bar__tab--drop-after]=\"isMarked(tab.id, 'after')\"\n [attr.data-tab-id]=\"tab.id\"\n (pointerdown)=\"onTabPointerDown($event, tab)\"\n (mousedown)=\"onMouseDown($event)\"\n (auxclick)=\"onAuxClick($event, tab.id)\"\n (contextmenu)=\"openContextMenu($event, tab.id)\"\n >\n <div\n class=\"hm-tab-bar__hit\"\n role=\"tab\"\n [id]=\"'hm-tab-' + tab.id\"\n [attr.aria-selected]=\"tab.id === active()\"\n [attr.tabindex]=\"index === tabStop() ? 0 : -1\"\n [attr.aria-controls]=\"contentId() || null\"\n [attr.aria-describedby]=\"instructionsId\"\n (click)=\"activate(tab.id)\"\n (keydown)=\"onKeydown($event, tab)\"\n (focusout)=\"onFocusOut($event)\"\n >\n @if (tab.icon) {\n <hm-icon class=\"hm-tab-bar__icon\" [shape]=\"tab.icon\" />\n }\n <span class=\"hm-tab-bar__label\">{{ tab.label }}</span>\n </div>\n @if (!tab.pinned) {\n <button type=\"button\" class=\"hm-tab-bar__close\" tabindex=\"-1\" aria-hidden=\"true\" (click)=\"close($event, tab.id)\">\n <hm-icon shape=\"times\" />\n </button>\n }\n </div>\n }\n </div>\n\n @if (allowNewTab()) {\n <button type=\"button\" class=\"hm-tab-bar__new\" [attr.aria-label]=\"text().newTab\" (click)=\"newTabRequested.emit()\">\n <hm-icon shape=\"plus\" />\n </button>\n }\n\n <div hidden [id]=\"instructionsId\">{{ text().dragInstructions }}</div>\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
493
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: TabBarComponent, isStandalone: true, selector: "hm-tab-bar", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: true, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, allowNewTab: { classPropertyName: "allowNewTab", publicName: "allowNewTab", isSignal: true, isRequired: false, transformFunction: null }, contentId: { classPropertyName: "contentId", publicName: "contentId", isSignal: true, isRequired: false, transformFunction: null }, tabGroup: { classPropertyName: "tabGroup", publicName: "tabGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activated: "activated", closed: "closed", reordered: "reordered", newTabRequested: "newTabRequested", contextMenuRequested: "contextMenuRequested", tabReceived: "tabReceived" }, viewQueries: [{ propertyName: "bar", first: true, predicate: ["bar"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #bar class=\"hm-tab-bar\">\n <div class=\"hm-tab-bar__list\" role=\"tablist\" [attr.aria-label]=\"text().label\" (scroll)=\"hidePreview()\">\n @for (tab of tabs(); track tab.id; let index = $index) {\n <div\n class=\"hm-tab-bar__tab\"\n role=\"presentation\"\n [class.hm-tab-bar__tab--active]=\"tab.id === active()\"\n [class.hm-tab-bar__tab--dragging]=\"draggingId() === tab.id\"\n [class.hm-tab-bar__tab--pinned]=\"tab.pinned\"\n [class.hm-tab-bar__tab--drop-before]=\"isMarked(tab.id, 'before')\"\n [class.hm-tab-bar__tab--drop-after]=\"isMarked(tab.id, 'after')\"\n [attr.data-tab-id]=\"tab.id\"\n (pointerdown)=\"onTabPointerDown($event, tab)\"\n (pointerenter)=\"onTabPointerEnter($event, tab)\"\n (pointerleave)=\"onTabPointerLeave()\"\n (mousedown)=\"onMouseDown($event)\"\n (auxclick)=\"onAuxClick($event, tab.id)\"\n (contextmenu)=\"openContextMenu($event, tab.id)\"\n >\n <div\n class=\"hm-tab-bar__hit\"\n role=\"tab\"\n [id]=\"'hm-tab-' + tab.id\"\n [attr.aria-selected]=\"tab.id === active()\"\n [attr.tabindex]=\"index === tabStop() ? 0 : -1\"\n [attr.aria-controls]=\"contentId() || null\"\n [attr.aria-describedby]=\"instructionsId\"\n (click)=\"activate(tab.id)\"\n (keydown)=\"onKeydown($event, tab)\"\n (focusout)=\"onFocusOut($event)\"\n >\n @if (tab.icon) {\n <hm-icon class=\"hm-tab-bar__icon\" [shape]=\"tab.icon\" />\n }\n <span class=\"hm-tab-bar__label\">{{ tab.label }}</span>\n </div>\n @if (!tab.pinned) {\n <button type=\"button\" class=\"hm-tab-bar__close\" tabindex=\"-1\" aria-hidden=\"true\" (click)=\"close($event, tab.id)\">\n <hm-icon shape=\"times\" />\n </button>\n }\n </div>\n }\n </div>\n\n @if (allowNewTab()) {\n <button type=\"button\" class=\"hm-tab-bar__new\" [attr.aria-label]=\"text().newTab\" (click)=\"newTabRequested.emit()\">\n <hm-icon shape=\"plus\" />\n </button>\n }\n\n <div hidden [id]=\"instructionsId\">{{ text().dragInstructions }}</div>\n\n <!-- Repete o nome da aba (j\u00E1 anunciado por ela): s\u00F3 visual. -->\n @if (preview(); as card) {\n <div class=\"hm-tab-bar__preview\" aria-hidden=\"true\" [style.left.px]=\"card.left\" [style.top.px]=\"card.top\">\n <span class=\"hm-tab-bar__preview-title\">{{ card.tab.label }}</span>\n @if (card.tab.description) {\n <span class=\"hm-tab-bar__preview-description\">{{ card.tab.description }}</span>\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
450
494
|
}
|
|
451
495
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: TabBarComponent, decorators: [{
|
|
452
496
|
type: Component,
|
|
453
|
-
args: [{ selector: 'hm-tab-bar', imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #bar class=\"hm-tab-bar\">\n <div class=\"hm-tab-bar__list\" role=\"tablist\" [attr.aria-label]=\"text().label\">\n @for (tab of tabs(); track tab.id; let index = $index) {\n <div\n class=\"hm-tab-bar__tab\"\n role=\"presentation\"\n [class.hm-tab-bar__tab--active]=\"tab.id === active()\"\n [class.hm-tab-bar__tab--dragging]=\"draggingId() === tab.id\"\n [class.hm-tab-bar__tab--pinned]=\"tab.pinned\"\n [class.hm-tab-bar__tab--drop-before]=\"isMarked(tab.id, 'before')\"\n [class.hm-tab-bar__tab--drop-after]=\"isMarked(tab.id, 'after')\"\n [attr.data-tab-id]=\"tab.id\"\n (pointerdown)=\"onTabPointerDown($event, tab)\"\n (mousedown)=\"onMouseDown($event)\"\n (auxclick)=\"onAuxClick($event, tab.id)\"\n (contextmenu)=\"openContextMenu($event, tab.id)\"\n >\n <div\n class=\"hm-tab-bar__hit\"\n role=\"tab\"\n [id]=\"'hm-tab-' + tab.id\"\n [attr.aria-selected]=\"tab.id === active()\"\n [attr.tabindex]=\"index === tabStop() ? 0 : -1\"\n [attr.aria-controls]=\"contentId() || null\"\n [attr.aria-describedby]=\"instructionsId\"\n (click)=\"activate(tab.id)\"\n (keydown)=\"onKeydown($event, tab)\"\n (focusout)=\"onFocusOut($event)\"\n >\n @if (tab.icon) {\n <hm-icon class=\"hm-tab-bar__icon\" [shape]=\"tab.icon\" />\n }\n <span class=\"hm-tab-bar__label\">{{ tab.label }}</span>\n </div>\n @if (!tab.pinned) {\n <button type=\"button\" class=\"hm-tab-bar__close\" tabindex=\"-1\" aria-hidden=\"true\" (click)=\"close($event, tab.id)\">\n <hm-icon shape=\"times\" />\n </button>\n }\n </div>\n }\n </div>\n\n @if (allowNewTab()) {\n <button type=\"button\" class=\"hm-tab-bar__new\" [attr.aria-label]=\"text().newTab\" (click)=\"newTabRequested.emit()\">\n <hm-icon shape=\"plus\" />\n </button>\n }\n\n <div hidden [id]=\"instructionsId\">{{ text().dragInstructions }}</div>\n</div>\n" }]
|
|
497
|
+
args: [{ selector: 'hm-tab-bar', imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #bar class=\"hm-tab-bar\">\n <div class=\"hm-tab-bar__list\" role=\"tablist\" [attr.aria-label]=\"text().label\" (scroll)=\"hidePreview()\">\n @for (tab of tabs(); track tab.id; let index = $index) {\n <div\n class=\"hm-tab-bar__tab\"\n role=\"presentation\"\n [class.hm-tab-bar__tab--active]=\"tab.id === active()\"\n [class.hm-tab-bar__tab--dragging]=\"draggingId() === tab.id\"\n [class.hm-tab-bar__tab--pinned]=\"tab.pinned\"\n [class.hm-tab-bar__tab--drop-before]=\"isMarked(tab.id, 'before')\"\n [class.hm-tab-bar__tab--drop-after]=\"isMarked(tab.id, 'after')\"\n [attr.data-tab-id]=\"tab.id\"\n (pointerdown)=\"onTabPointerDown($event, tab)\"\n (pointerenter)=\"onTabPointerEnter($event, tab)\"\n (pointerleave)=\"onTabPointerLeave()\"\n (mousedown)=\"onMouseDown($event)\"\n (auxclick)=\"onAuxClick($event, tab.id)\"\n (contextmenu)=\"openContextMenu($event, tab.id)\"\n >\n <div\n class=\"hm-tab-bar__hit\"\n role=\"tab\"\n [id]=\"'hm-tab-' + tab.id\"\n [attr.aria-selected]=\"tab.id === active()\"\n [attr.tabindex]=\"index === tabStop() ? 0 : -1\"\n [attr.aria-controls]=\"contentId() || null\"\n [attr.aria-describedby]=\"instructionsId\"\n (click)=\"activate(tab.id)\"\n (keydown)=\"onKeydown($event, tab)\"\n (focusout)=\"onFocusOut($event)\"\n >\n @if (tab.icon) {\n <hm-icon class=\"hm-tab-bar__icon\" [shape]=\"tab.icon\" />\n }\n <span class=\"hm-tab-bar__label\">{{ tab.label }}</span>\n </div>\n @if (!tab.pinned) {\n <button type=\"button\" class=\"hm-tab-bar__close\" tabindex=\"-1\" aria-hidden=\"true\" (click)=\"close($event, tab.id)\">\n <hm-icon shape=\"times\" />\n </button>\n }\n </div>\n }\n </div>\n\n @if (allowNewTab()) {\n <button type=\"button\" class=\"hm-tab-bar__new\" [attr.aria-label]=\"text().newTab\" (click)=\"newTabRequested.emit()\">\n <hm-icon shape=\"plus\" />\n </button>\n }\n\n <div hidden [id]=\"instructionsId\">{{ text().dragInstructions }}</div>\n\n <!-- Repete o nome da aba (j\u00E1 anunciado por ela): s\u00F3 visual. -->\n @if (preview(); as card) {\n <div class=\"hm-tab-bar__preview\" aria-hidden=\"true\" [style.left.px]=\"card.left\" [style.top.px]=\"card.top\">\n <span class=\"hm-tab-bar__preview-title\">{{ card.tab.label }}</span>\n @if (card.tab.description) {\n <span class=\"hm-tab-bar__preview-description\">{{ card.tab.description }}</span>\n }\n </div>\n }\n</div>\n" }]
|
|
454
498
|
}], ctorParameters: () => [], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: true }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], allowNewTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowNewTab", required: false }] }], contentId: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentId", required: false }] }], tabGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabGroup", required: false }] }], activated: [{ type: i0.Output, args: ["activated"] }], closed: [{ type: i0.Output, args: ["closed"] }], reordered: [{ type: i0.Output, args: ["reordered"] }], newTabRequested: [{ type: i0.Output, args: ["newTabRequested"] }], contextMenuRequested: [{ type: i0.Output, args: ["contextMenuRequested"] }], tabReceived: [{ type: i0.Output, args: ["tabReceived"] }], bar: [{ type: i0.ViewChild, args: ['bar', { isSignal: true }] }] } });
|
|
455
499
|
|
|
456
500
|
// Ponto de import `@trismegisto/angular/tab-bar` (secundário do ng-packagr): o que o public-api e as outras pastas usam
|