@seniorsistemas/angular-components 19.2.0 → 19.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/dynamic-form/dynamic-form/dynamic-form.directive.d.ts +3 -0
- package/dynamic-form/dynamic-form/form-field/configurations/fields/field.d.ts +7 -0
- package/dynamic-form/public-api.d.ts +2 -3
- package/esm2022/dynamic-form/dynamic-form/dynamic-form.directive.mjs +17 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/field.mjs +1 -1
- package/esm2022/dynamic-form/public-api.mjs +3 -4
- package/esm2022/lib/locale/fallback.mjs +10 -2
- package/esm2022/spotlight/lib/spotlight/spotlight-overlay/spotlight-overlay.component.mjs +460 -0
- package/esm2022/spotlight/lib/spotlight/spotlight-step.directive.mjs +50 -0
- package/esm2022/spotlight/lib/spotlight/spotlight-tour.service.mjs +251 -0
- package/esm2022/spotlight/lib/spotlight/spotlight.component.mjs +193 -0
- package/esm2022/spotlight/lib/spotlight/types/spotlight-position.mjs +2 -0
- package/esm2022/spotlight/lib/spotlight/types/spotlight-step.mjs +2 -0
- package/esm2022/spotlight/lib/spotlight/types/spotlight-stop-event.mjs +2 -0
- package/esm2022/spotlight/public-api.mjs +4 -0
- package/esm2022/spotlight/seniorsistemas-angular-components-spotlight.mjs +5 -0
- package/esm2022/table/lib/table/table-column/table-columns.component.mjs +3 -3
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +16 -0
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-spotlight.mjs +947 -0
- package/fesm2022/seniorsistemas-angular-components-spotlight.mjs.map +1 -0
- package/fesm2022/seniorsistemas-angular-components-table.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components.mjs +9 -1
- package/fesm2022/seniorsistemas-angular-components.mjs.map +1 -1
- package/package.json +7 -1
- package/spotlight/README.md +311 -0
- package/spotlight/index.d.ts +5 -0
- package/spotlight/lib/spotlight/spotlight-overlay/spotlight-overlay.component.d.ts +70 -0
- package/spotlight/lib/spotlight/spotlight-step.directive.d.ts +28 -0
- package/spotlight/lib/spotlight/spotlight-tour.service.d.ts +146 -0
- package/spotlight/lib/spotlight/spotlight.component.d.ts +82 -0
- package/spotlight/lib/spotlight/types/spotlight-position.d.ts +1 -0
- package/spotlight/lib/spotlight/types/spotlight-step.d.ts +21 -0
- package/spotlight/lib/spotlight/types/spotlight-stop-event.d.ts +13 -0
- package/spotlight/public-api.d.ts +6 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { SpotlightConfig, SpotlightStep } from './types/spotlight-step';
|
|
4
|
+
import { SpotlightStepChangedEvent, SpotlightStopEvent } from './types/spotlight-stop-event';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/** @internal */
|
|
7
|
+
type SpotlightStepInternal = SpotlightStep & {
|
|
8
|
+
showDoNotShowAgain?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Serviço central do Spotlight Tour.
|
|
12
|
+
*
|
|
13
|
+
* Gerencia o estado do tour (passos, índice atual, ativo/inativo), a navegação entre
|
|
14
|
+
* passos e o registro de elementos do DOM associados a cada `stepId`.
|
|
15
|
+
*
|
|
16
|
+
* Use `start()` para iniciar um tour com múltiplos passos ou `spotlight()` para
|
|
17
|
+
* exibir um destaque simples em um único elemento.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* // Tour com múltiplos passos
|
|
22
|
+
* this.tourService.start([
|
|
23
|
+
* { stepId: 'passo-1', title: 'Título', message: 'Mensagem' },
|
|
24
|
+
* { stepId: 'passo-2', title: 'Título', message: 'Mensagem' },
|
|
25
|
+
* ]);
|
|
26
|
+
*
|
|
27
|
+
* // Destaque simples
|
|
28
|
+
* this.tourService.spotlight('meu-elemento', { title: 'Dica', message: 'Detalhes' });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class SpotlightTourService {
|
|
32
|
+
private readonly overlay;
|
|
33
|
+
private readonly environmentInjector;
|
|
34
|
+
private overlayRef;
|
|
35
|
+
private readonly _steps;
|
|
36
|
+
private readonly _currentIndex;
|
|
37
|
+
private readonly _isActive;
|
|
38
|
+
private readonly _registrationVersion;
|
|
39
|
+
private readonly _registeredElements;
|
|
40
|
+
private _pendingDoNotShowAgain;
|
|
41
|
+
private readonly _stopped$;
|
|
42
|
+
private readonly _stepChanged$;
|
|
43
|
+
/** Signal somente-leitura que indica se o tour está ativo no momento. */
|
|
44
|
+
readonly isActive: import("@angular/core").Signal<boolean>;
|
|
45
|
+
/** Signal somente-leitura com o índice (0-based) do passo exibido atualmente. */
|
|
46
|
+
readonly currentIndex: import("@angular/core").Signal<number>;
|
|
47
|
+
/** Signal computado com o total de passos do tour em andamento. */
|
|
48
|
+
readonly totalSteps: import("@angular/core").Signal<number>;
|
|
49
|
+
/** Signal computado com os dados do passo atualmente exibido. */
|
|
50
|
+
readonly currentStep: import("@angular/core").Signal<SpotlightStepInternal | undefined>;
|
|
51
|
+
/**
|
|
52
|
+
* Observable emitido quando o tour é encerrado, seja por conclusão, interrupção
|
|
53
|
+
* ou descarte. Carrega um `SpotlightStopEvent` com o motivo e o estado final.
|
|
54
|
+
*/
|
|
55
|
+
readonly stopped$: Observable<SpotlightStopEvent>;
|
|
56
|
+
/**
|
|
57
|
+
* Observable emitido sempre que o passo exibido muda, incluindo o início do tour.
|
|
58
|
+
* Carrega um `SpotlightStepChangedEvent` com o `stepId` e o índice do novo passo.
|
|
59
|
+
*/
|
|
60
|
+
readonly stepChanged$: Observable<SpotlightStepChangedEvent>;
|
|
61
|
+
/**
|
|
62
|
+
* Signal somente-leitura incrementado a cada chamada de `registerElement` ou
|
|
63
|
+
* `unregisterElement`. Permite que outros componentes reajam a mudanças no
|
|
64
|
+
* registro de elementos sem polling.
|
|
65
|
+
*/
|
|
66
|
+
readonly registrationVersion: import("@angular/core").Signal<number>;
|
|
67
|
+
/**
|
|
68
|
+
* Inicia um tour com a lista de passos fornecida.
|
|
69
|
+
*
|
|
70
|
+
* O tour começa pelo primeiro passo da lista. Emite `stepChanged$` para o passo inicial.
|
|
71
|
+
* Se `steps` for um array vazio, o método não faz nada.
|
|
72
|
+
* Se já houver um tour ativo, ele é encerrado (emitindo `stopped$` com `reason: 'interrupted'`)
|
|
73
|
+
* antes de o novo tour começar.
|
|
74
|
+
*
|
|
75
|
+
* @param steps Lista de passos a percorrer em ordem.
|
|
76
|
+
*/
|
|
77
|
+
start(steps: SpotlightStep[]): void;
|
|
78
|
+
/**
|
|
79
|
+
* Exibe um destaque simples (passo único) no elemento identificado por `stepId`.
|
|
80
|
+
*
|
|
81
|
+
* Equivalente a chamar `start()` com um array de um único passo.
|
|
82
|
+
* O checkbox "Não mostrar novamente" é exibido por padrão (`showDoNotShowAgain: true`);
|
|
83
|
+
* passe `showDoNotShowAgain: false` em `config` para suprimi-lo.
|
|
84
|
+
*
|
|
85
|
+
* @param stepId ID do elemento registrado via `sSpotlightStep` ou `registerElement`.
|
|
86
|
+
* @param config Configuração visual e comportamental do destaque.
|
|
87
|
+
*/
|
|
88
|
+
spotlight(stepId: string, config: SpotlightConfig): void;
|
|
89
|
+
/**
|
|
90
|
+
* Avança para o próximo passo do tour.
|
|
91
|
+
*
|
|
92
|
+
* Se o passo atual definir `beforeNext`, aguarda sua resolução antes de avançar.
|
|
93
|
+
* No último passo, encerra o tour com `reason: 'completed'`.
|
|
94
|
+
*
|
|
95
|
+
* @param doNotShowAgain Quando `true`, o evento `stopped$` será emitido com
|
|
96
|
+
* `doNotShowAgain: true` ao concluir o tour. Relevante apenas no último passo.
|
|
97
|
+
*/
|
|
98
|
+
next(doNotShowAgain?: boolean): void;
|
|
99
|
+
/**
|
|
100
|
+
* Retorna ao passo anterior do tour.
|
|
101
|
+
*
|
|
102
|
+
* Se o passo atual definir `beforePrevious`, aguarda sua resolução antes de voltar.
|
|
103
|
+
* Não faz nada se o tour estiver no primeiro passo.
|
|
104
|
+
*/
|
|
105
|
+
previous(): void;
|
|
106
|
+
/**
|
|
107
|
+
* Encerra o tour imediatamente e emite o evento `stopped$`.
|
|
108
|
+
*
|
|
109
|
+
* @param event Dados parciais do evento de parada. Valores não fornecidos são
|
|
110
|
+
* preenchidos com os defaults: `reason: 'interrupted'`, `doNotShowAgain: false`
|
|
111
|
+
* e o `stepId`/`stepIndex`/`totalSteps` do momento atual.
|
|
112
|
+
*/
|
|
113
|
+
stop(event?: Partial<SpotlightStopEvent>): void;
|
|
114
|
+
/**
|
|
115
|
+
* Registra um elemento do DOM como alvo do passo identificado por `stepId`.
|
|
116
|
+
*
|
|
117
|
+
* Normalmente chamado pela diretiva `sSpotlightStep`. Use diretamente apenas
|
|
118
|
+
* quando precisar registrar elementos criados programaticamente.
|
|
119
|
+
*
|
|
120
|
+
* @param stepId ID único do passo ao qual o elemento pertence.
|
|
121
|
+
* @param el Referência ao elemento do DOM.
|
|
122
|
+
*/
|
|
123
|
+
registerElement(stepId: string, el: ElementRef): void;
|
|
124
|
+
/**
|
|
125
|
+
* Remove o registro do elemento associado a `stepId`.
|
|
126
|
+
*
|
|
127
|
+
* Normalmente chamado pela diretiva `sSpotlightStep` no `ngOnDestroy`.
|
|
128
|
+
*
|
|
129
|
+
* @param stepId ID do passo cujo elemento deve ser removido.
|
|
130
|
+
*/
|
|
131
|
+
unregisterElement(stepId: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* Retorna o `ElementRef` registrado para o `stepId` informado,
|
|
134
|
+
* ou `undefined` se nenhum elemento estiver registrado.
|
|
135
|
+
*
|
|
136
|
+
* @param stepId ID do passo a buscar.
|
|
137
|
+
*/
|
|
138
|
+
getElement(stepId: string): ElementRef | undefined;
|
|
139
|
+
private advance;
|
|
140
|
+
private retreat;
|
|
141
|
+
private attachOverlay;
|
|
142
|
+
private detachOverlay;
|
|
143
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SpotlightTourService, never>;
|
|
144
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SpotlightTourService>;
|
|
145
|
+
}
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { SpotlightPosition } from './types/spotlight-position';
|
|
3
|
+
import { SpotlightStepAction } from './types/spotlight-step';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Componente de popover do Spotlight.
|
|
7
|
+
*
|
|
8
|
+
* Exibe o card de destaque com título, mensagem, seta direcional, contador de passos,
|
|
9
|
+
* botões de navegação e, em modo simples (passo único), o checkbox "não mostrar novamente".
|
|
10
|
+
*
|
|
11
|
+
* Este componente é instanciado programaticamente pelo `SpotlightOverlayComponent`
|
|
12
|
+
* via CDK Overlay. Normalmente não é usado diretamente no template.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SpotlightComponent {
|
|
15
|
+
/** Título do popover. Aceita string ou `TemplateRef` para conteúdo dinâmico. */
|
|
16
|
+
title: import("@angular/core").InputSignal<string | TemplateRef<any>>;
|
|
17
|
+
/** Mensagem principal do popover. Aceita string ou `TemplateRef` para conteúdo dinâmico. */
|
|
18
|
+
message: import("@angular/core").InputSignal<string | TemplateRef<any> | undefined>;
|
|
19
|
+
/** Template opcional para área de mídia/conteúdo customizado acima da mensagem. */
|
|
20
|
+
content: import("@angular/core").InputSignal<TemplateRef<any> | null>;
|
|
21
|
+
/** Posição do popover em relação ao elemento alvo. @default 'bottom-center' */
|
|
22
|
+
position: import("@angular/core").InputSignal<SpotlightPosition>;
|
|
23
|
+
/** Número do passo atual (1-based) exibido no contador. @default 1 */
|
|
24
|
+
currentStep: import("@angular/core").InputSignal<number>;
|
|
25
|
+
/** Total de passos do tour, usado no contador e para controle de botões. @default 1 */
|
|
26
|
+
totalSteps: import("@angular/core").InputSignal<number>;
|
|
27
|
+
/**
|
|
28
|
+
* Exibe o checkbox "não mostrar novamente" (apenas em passo único).
|
|
29
|
+
* Passe `false` para suprimir o checkbox quando não for necessário persistir a preferência.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
showDoNotShowAgain: import("@angular/core").InputSignal<boolean>;
|
|
33
|
+
/** Lista de botões de ação adicionais exibidos na área de rodapé. */
|
|
34
|
+
actions: import("@angular/core").InputSignal<SpotlightStepAction[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Deslocamento em pixels para posicionar a seta manualmente no eixo principal.
|
|
37
|
+
* Quando `null`, o alinhamento é controlado pela `position`. @default null
|
|
38
|
+
*/
|
|
39
|
+
arrowOffsetPx: import("@angular/core").InputSignal<number | null>;
|
|
40
|
+
/** Emitido ao clicar no botão de fechar (X). */
|
|
41
|
+
closed: import("@angular/core").OutputEmitterRef<void>;
|
|
42
|
+
/** Emitido ao clicar em "Próximo". */
|
|
43
|
+
next: import("@angular/core").OutputEmitterRef<void>;
|
|
44
|
+
/** Emitido ao clicar em "Voltar". */
|
|
45
|
+
previous: import("@angular/core").OutputEmitterRef<void>;
|
|
46
|
+
/** Emitido ao clicar em "Entendido" (modo simples, passo único). */
|
|
47
|
+
understand: import("@angular/core").OutputEmitterRef<void>;
|
|
48
|
+
/** Estado atual do checkbox "não mostrar novamente". */
|
|
49
|
+
isDoNotShowAgainChecked: import("@angular/core").WritableSignal<boolean>;
|
|
50
|
+
private static instanceCount;
|
|
51
|
+
/** @internal */
|
|
52
|
+
protected readonly instanceId: string;
|
|
53
|
+
/** @internal */
|
|
54
|
+
readonly titleId: string;
|
|
55
|
+
/** @internal */
|
|
56
|
+
readonly descId: string;
|
|
57
|
+
get titleTemplate(): TemplateRef<any> | null;
|
|
58
|
+
get titleString(): string;
|
|
59
|
+
get messageTemplate(): TemplateRef<any> | null;
|
|
60
|
+
get messageString(): string;
|
|
61
|
+
get arrowPosition(): SpotlightPosition;
|
|
62
|
+
get isArrowTop(): boolean;
|
|
63
|
+
get isArrowBottom(): boolean;
|
|
64
|
+
get isArrowLeft(): boolean;
|
|
65
|
+
get isArrowRight(): boolean;
|
|
66
|
+
get arrowRotation(): string;
|
|
67
|
+
get arrowAlignmentClass(): string;
|
|
68
|
+
get arrowPaddingStyle(): Record<string, string>;
|
|
69
|
+
/** Emite o evento `closed`. Chamado pelo botão de fechar no template. */
|
|
70
|
+
onClose(): void;
|
|
71
|
+
/** Emite o evento `next`. Chamado pelo botão "Próximo" no template. */
|
|
72
|
+
onNext(): void;
|
|
73
|
+
/** Emite o evento `previous`. Chamado pelo botão "Voltar" no template. */
|
|
74
|
+
onPrevious(): void;
|
|
75
|
+
/** Emite o evento `understand`. Chamado pelo botão "Entendido" no template. */
|
|
76
|
+
onUnderstand(): void;
|
|
77
|
+
/** Alterna o estado de `isDoNotShowAgainChecked`. */
|
|
78
|
+
toggleDoNotShowAgain(): void;
|
|
79
|
+
private getOppositeDirection;
|
|
80
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SpotlightComponent, never>;
|
|
81
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SpotlightComponent, "s-spotlight", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "currentStep": { "alias": "currentStep"; "required": false; "isSignal": true; }; "totalSteps": { "alias": "totalSteps"; "required": false; "isSignal": true; }; "showDoNotShowAgain": { "alias": "showDoNotShowAgain"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "arrowOffsetPx": { "alias": "arrowOffsetPx"; "required": false; "isSignal": true; }; }, { "closed": "closed"; "next": "next"; "previous": "previous"; "understand": "understand"; }, never, never, true, never>;
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type SpotlightPosition = 'top-start' | 'top-center' | 'top-end' | 'right-start' | 'right-center' | 'right-end' | 'bottom-start' | 'bottom-center' | 'bottom-end' | 'left-start' | 'left-center' | 'left-end';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { SpotlightPosition } from './spotlight-position';
|
|
3
|
+
export interface SpotlightStepAction {
|
|
4
|
+
label: string;
|
|
5
|
+
handler: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface SpotlightStep {
|
|
8
|
+
stepId: string;
|
|
9
|
+
title: string | TemplateRef<any>;
|
|
10
|
+
message: string | TemplateRef<any>;
|
|
11
|
+
position?: SpotlightPosition;
|
|
12
|
+
content?: TemplateRef<any> | null;
|
|
13
|
+
actions?: SpotlightStepAction[];
|
|
14
|
+
showBackdrop?: boolean;
|
|
15
|
+
dismissible?: boolean;
|
|
16
|
+
beforeNext?: () => void | Promise<void>;
|
|
17
|
+
beforePrevious?: () => void | Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export type SpotlightConfig = Omit<SpotlightStep, 'stepId' | 'beforeNext' | 'beforePrevious'> & {
|
|
20
|
+
showDoNotShowAgain?: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SpotlightStopReason = 'completed' | 'interrupted' | 'dismissed';
|
|
2
|
+
export interface SpotlightStopEvent {
|
|
3
|
+
reason: SpotlightStopReason;
|
|
4
|
+
doNotShowAgain: boolean;
|
|
5
|
+
stepId: string;
|
|
6
|
+
stepIndex: number;
|
|
7
|
+
totalSteps: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SpotlightStepChangedEvent {
|
|
10
|
+
stepId: string;
|
|
11
|
+
stepIndex: number;
|
|
12
|
+
totalSteps: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SpotlightStepDirective } from './lib/spotlight/spotlight-step.directive';
|
|
2
|
+
export { SpotlightTourService } from './lib/spotlight/spotlight-tour.service';
|
|
3
|
+
export { SpotlightComponent } from './lib/spotlight/spotlight.component';
|
|
4
|
+
export type { SpotlightPosition } from './lib/spotlight/types/spotlight-position';
|
|
5
|
+
export type { SpotlightConfig, SpotlightStep, SpotlightStepAction } from './lib/spotlight/types/spotlight-step';
|
|
6
|
+
export type { SpotlightStepChangedEvent, SpotlightStopEvent, SpotlightStopReason, } from './lib/spotlight/types/spotlight-stop-event';
|