@seniorsistemas/components-ai 2.3.0 → 2.4.0-master-bdd92d4e
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/esm2022/lib/components/dynamic-form/dynamic-form.component.mjs +32 -85
- package/esm2022/lib/components/dynamic-form/fields/dynamic-field-date.component.mjs +169 -48
- package/esm2022/lib/components/dynamic-form/fields/dynamic-field-datetime.component.mjs +162 -47
- package/esm2022/lib/components/dynamic-form/fields/dynamic-field-time.component.mjs +144 -23
- package/esm2022/lib/components/steps/steps.component.mjs +225 -0
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/seniorsistemas-components-ai.mjs +723 -200
- package/fesm2022/seniorsistemas-components-ai.mjs.map +1 -1
- package/lib/components/dynamic-form/fields/dynamic-field-date.component.d.ts +34 -4
- package/lib/components/dynamic-form/fields/dynamic-field-datetime.component.d.ts +32 -4
- package/lib/components/dynamic-form/fields/dynamic-field-time.component.d.ts +30 -2
- package/lib/components/steps/steps.component.d.ts +63 -0
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
|
@@ -4,6 +4,13 @@ import { TranslationService } from '../../../services/translation.service';
|
|
|
4
4
|
import { LocaleService } from '../../../services/locale.service';
|
|
5
5
|
import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* DynamicFieldDateComponent
|
|
9
|
+
*
|
|
10
|
+
* O FormControl.value SEMPRE armazena a data no formato ISO: "yyyy-MM-dd" (ex: "2026-05-18").
|
|
11
|
+
* A variável `displayValue` mantém o valor formatado no locale do usuário para exibição no input.
|
|
12
|
+
* Isso garante que qualquer componente que acesse form.value receba o valor pronto para o backend.
|
|
13
|
+
*/
|
|
7
14
|
export declare class DynamicFieldDateComponent extends DynamicFieldBaseComponent implements OnInit, OnDestroy {
|
|
8
15
|
private localeService;
|
|
9
16
|
private cdr;
|
|
@@ -11,20 +18,43 @@ export declare class DynamicFieldDateComponent extends DynamicFieldBaseComponent
|
|
|
11
18
|
currentDateFormat: string;
|
|
12
19
|
dateMask: string;
|
|
13
20
|
calendarValue: Date | null;
|
|
21
|
+
/** Valor de exibição no formato locale (ex: "18/05/2026" para pt-BR) */
|
|
22
|
+
displayValue: string | null;
|
|
14
23
|
private langSub?;
|
|
15
24
|
private valueSub?;
|
|
16
25
|
private currentLocale;
|
|
26
|
+
private updatingFromControl;
|
|
17
27
|
constructor(translationService: TranslationService, localeService: LocaleService, cdr: ChangeDetectorRef);
|
|
18
28
|
ngOnInit(): void;
|
|
19
29
|
ngOnDestroy(): void;
|
|
20
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Sincroniza o displayValue a partir do valor ISO do FormControl.
|
|
32
|
+
* Aceita: "yyyy-MM-dd", Date, locale string "dd/MM/yyyy", ou null.
|
|
33
|
+
*/
|
|
34
|
+
private syncDisplayFromControl;
|
|
35
|
+
/** Chamado quando o usuário completa a digitação da máscara */
|
|
36
|
+
onDisplayValueComplete(): void;
|
|
37
|
+
/** Chamado quando o input perde foco */
|
|
38
|
+
onDisplayValueBlur(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Converte o displayValue (locale) para ISO e seta no FormControl.
|
|
41
|
+
*/
|
|
42
|
+
private syncControlFromDisplay;
|
|
43
|
+
/** Seta o valor no control sem disparar o subscriber interno */
|
|
44
|
+
private setControlValue;
|
|
45
|
+
/** Converte ISO "yyyy-MM-dd" para locale string */
|
|
46
|
+
private isoToLocale;
|
|
47
|
+
/** Converte locale string para ISO "yyyy-MM-dd" */
|
|
48
|
+
private localeToIso;
|
|
49
|
+
/** Converte Date para ISO "yyyy-MM-dd" */
|
|
50
|
+
private dateToIso;
|
|
51
|
+
/** Converte locale string para Date */
|
|
52
|
+
private localeToDate;
|
|
21
53
|
private updateDateFormat;
|
|
22
|
-
private convertValueToNewLocale;
|
|
23
|
-
private dateToString;
|
|
24
|
-
private stringToDate;
|
|
25
54
|
toggleCalendar(event: Event): void;
|
|
26
55
|
onCalendarSelect(date: Date): void;
|
|
27
56
|
onCalendarClear(): void;
|
|
57
|
+
isControlDisabled(): boolean;
|
|
28
58
|
getPlaceholder(): string;
|
|
29
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldDateComponent, never>;
|
|
30
60
|
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldDateComponent, "sia-dynamic-field-date", never, {}, {}, never, never, true, never>;
|
|
@@ -4,6 +4,13 @@ import { TranslationService } from '../../../services/translation.service';
|
|
|
4
4
|
import { LocaleService } from '../../../services/locale.service';
|
|
5
5
|
import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* DynamicFieldDatetimeComponent
|
|
9
|
+
*
|
|
10
|
+
* O FormControl.value SEMPRE armazena o datetime no formato ISO: "yyyy-MM-ddTHH:mm:ss.sssZ".
|
|
11
|
+
* A variável `displayValue` mantém o valor formatado no locale do usuário para exibição no input.
|
|
12
|
+
* Isso garante que qualquer componente que acesse form.value receba o valor pronto para o backend.
|
|
13
|
+
*/
|
|
7
14
|
export declare class DynamicFieldDatetimeComponent extends DynamicFieldBaseComponent implements OnInit, OnDestroy {
|
|
8
15
|
private localeService;
|
|
9
16
|
private cdr;
|
|
@@ -11,20 +18,41 @@ export declare class DynamicFieldDatetimeComponent extends DynamicFieldBaseCompo
|
|
|
11
18
|
currentDateFormat: string;
|
|
12
19
|
datetimeMask: string;
|
|
13
20
|
calendarValue: Date | null;
|
|
21
|
+
/** Valor de exibição no formato locale (ex: "18/05/2026 14:30" para pt-BR) */
|
|
22
|
+
displayValue: string | null;
|
|
14
23
|
private langSub?;
|
|
15
24
|
private valueSub?;
|
|
16
25
|
private currentLocale;
|
|
26
|
+
private updatingFromControl;
|
|
17
27
|
constructor(translationService: TranslationService, localeService: LocaleService, cdr: ChangeDetectorRef);
|
|
18
28
|
ngOnInit(): void;
|
|
19
29
|
ngOnDestroy(): void;
|
|
20
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Sincroniza o displayValue a partir do valor ISO do FormControl.
|
|
32
|
+
* Aceita: ISO string, Date, locale string, ou null.
|
|
33
|
+
*/
|
|
34
|
+
private syncDisplayFromControl;
|
|
35
|
+
/** Chamado quando o usuário completa a digitação da máscara */
|
|
36
|
+
onDisplayValueComplete(): void;
|
|
37
|
+
/** Chamado quando o input perde foco */
|
|
38
|
+
onDisplayValueBlur(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Converte o displayValue (locale) para ISO e seta no FormControl.
|
|
41
|
+
*/
|
|
42
|
+
private syncControlFromDisplay;
|
|
43
|
+
/** Seta o valor no control sem disparar o subscriber interno */
|
|
44
|
+
private setControlValue;
|
|
45
|
+
/** Converte Date para locale display string */
|
|
46
|
+
private isoToLocale;
|
|
47
|
+
/** Converte locale string para ISO datetime string */
|
|
48
|
+
private localeToIso;
|
|
49
|
+
/** Converte locale string para Date */
|
|
50
|
+
private localeToDate;
|
|
21
51
|
private updateDatetimeFormat;
|
|
22
|
-
private convertValueToNewLocale;
|
|
23
|
-
private dateToString;
|
|
24
|
-
private stringToDate;
|
|
25
52
|
toggleCalendar(event: Event): void;
|
|
26
53
|
onCalendarSelect(date: Date): void;
|
|
27
54
|
onCalendarClear(): void;
|
|
55
|
+
isControlDisabled(): boolean;
|
|
28
56
|
getPlaceholder(): string;
|
|
29
57
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldDatetimeComponent, never>;
|
|
30
58
|
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldDatetimeComponent, "sia-dynamic-field-datetime", never, {}, {}, never, never, true, never>;
|
|
@@ -3,17 +3,45 @@ import { Calendar } from 'primeng/calendar';
|
|
|
3
3
|
import { TranslationService } from '../../../services/translation.service';
|
|
4
4
|
import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* DynamicFieldTimeComponent
|
|
8
|
+
*
|
|
9
|
+
* O FormControl.value SEMPRE armazena o horário no formato ISO: "HH:mm:ss" (ex: "14:30:00").
|
|
10
|
+
* A variável `displayValue` mantém o valor formatado "HH:mm" para exibição no input.
|
|
11
|
+
* Isso garante que qualquer componente que acesse form.value receba o valor pronto para o backend.
|
|
12
|
+
*/
|
|
6
13
|
export declare class DynamicFieldTimeComponent extends DynamicFieldBaseComponent implements OnInit, OnDestroy {
|
|
7
14
|
timePicker: Calendar;
|
|
8
15
|
timeValue: Date | null;
|
|
16
|
+
/** Valor de exibição no formato "HH:mm" */
|
|
17
|
+
displayValue: string | null;
|
|
9
18
|
private valueSub?;
|
|
19
|
+
private updatingFromControl;
|
|
10
20
|
constructor(translationService: TranslationService);
|
|
11
21
|
ngOnInit(): void;
|
|
12
22
|
ngOnDestroy(): void;
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Sincroniza o displayValue a partir do valor ISO do FormControl.
|
|
25
|
+
* Aceita: "HH:mm:ss", "HH:mm", Date, ou null.
|
|
26
|
+
*/
|
|
27
|
+
private syncDisplayFromControl;
|
|
28
|
+
/** Chamado quando o usuário completa a digitação da máscara */
|
|
29
|
+
onDisplayValueComplete(): void;
|
|
30
|
+
/** Chamado quando o input perde foco */
|
|
31
|
+
onDisplayValueBlur(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Converte o displayValue ("HH:mm") para ISO ("HH:mm:ss") e seta no FormControl.
|
|
34
|
+
*/
|
|
35
|
+
private syncControlFromDisplay;
|
|
36
|
+
/** Seta o valor no control sem disparar o subscriber interno */
|
|
37
|
+
private setControlValue;
|
|
38
|
+
/** Converte Date para ISO "HH:mm:ss" */
|
|
39
|
+
private dateToIso;
|
|
40
|
+
/** Converte display "HH:mm" para Date */
|
|
41
|
+
private displayToDate;
|
|
15
42
|
toggleTimePicker(event: Event): void;
|
|
16
43
|
onTimeSelect(date: Date): void;
|
|
44
|
+
isControlDisabled(): boolean;
|
|
17
45
|
getPlaceholder(): string;
|
|
18
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldTimeComponent, never>;
|
|
19
47
|
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldTimeComponent, "sia-dynamic-field-time", never, {}, {}, never, never, true, never>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges, ElementRef, AfterViewInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface StepItem {
|
|
4
|
+
id?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
styleClass?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export declare class StepsComponent implements OnChanges, AfterViewInit, OnDestroy {
|
|
12
|
+
private cdr;
|
|
13
|
+
/** Lista de steps a serem exibidos */
|
|
14
|
+
steps: StepItem[];
|
|
15
|
+
/** Índice do step ativo */
|
|
16
|
+
activeIndex: number;
|
|
17
|
+
/** Se permite clicar nos steps para navegar */
|
|
18
|
+
readonly: boolean;
|
|
19
|
+
/** Quantidade máxima de steps visíveis. 'auto' calcula com base no container */
|
|
20
|
+
maxVisible: number | 'auto';
|
|
21
|
+
/** Largura mínima de cada step em pixels (usado no cálculo automático) */
|
|
22
|
+
stepMinWidth: number;
|
|
23
|
+
/** Se mostra animação de transição ao navegar */
|
|
24
|
+
animated: boolean;
|
|
25
|
+
/** Modo de navegação das setas: 'step' altera o activeIndex, 'scroll' apenas desloca a janela visível */
|
|
26
|
+
navigationMode: 'step' | 'scroll';
|
|
27
|
+
/** Esquema de cores aplicado aos steps. Altera as cores do ativo e completados */
|
|
28
|
+
colorScheme: 'default' | 'success' | 'danger' | 'warning' | 'info';
|
|
29
|
+
/** Classe CSS customizada para o wrapper */
|
|
30
|
+
styleClass: string;
|
|
31
|
+
/** Emite quando o activeIndex muda por clique */
|
|
32
|
+
activeIndexChange: EventEmitter<number>;
|
|
33
|
+
/** Emite o StepItem clicado */
|
|
34
|
+
stepClick: EventEmitter<StepItem>;
|
|
35
|
+
stepsContainer: ElementRef<HTMLElement>;
|
|
36
|
+
visibleSteps: StepItem[];
|
|
37
|
+
visibleStartIndex: number;
|
|
38
|
+
visibleEndIndex: number;
|
|
39
|
+
hasOverflowLeft: boolean;
|
|
40
|
+
hasOverflowRight: boolean;
|
|
41
|
+
calculatedMaxVisible: number;
|
|
42
|
+
private resizeObserver;
|
|
43
|
+
constructor(cdr: ChangeDetectorRef);
|
|
44
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
45
|
+
ngAfterViewInit(): void;
|
|
46
|
+
ngOnDestroy(): void;
|
|
47
|
+
onStepClick(step: StepItem, visibleIndex: number): void;
|
|
48
|
+
navigateLeft(): void;
|
|
49
|
+
navigateRight(): void;
|
|
50
|
+
/** Desloca a janela visível para um novo startIndex sem alterar o activeIndex */
|
|
51
|
+
private scrollWindow;
|
|
52
|
+
getStepState(visibleIndex: number): 'completed' | 'active' | 'pending';
|
|
53
|
+
getRealIndex(visibleIndex: number): number;
|
|
54
|
+
get hiddenLeftCount(): number;
|
|
55
|
+
get hiddenRightCount(): number;
|
|
56
|
+
trackByIndex(index: number): number;
|
|
57
|
+
private setupResizeObserver;
|
|
58
|
+
private recalculate;
|
|
59
|
+
private getMaxVisible;
|
|
60
|
+
private calculateVisibleWindow;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StepsComponent, never>;
|
|
62
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StepsComponent, "sia-steps", never, { "steps": { "alias": "steps"; "required": false; }; "activeIndex": { "alias": "activeIndex"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "maxVisible": { "alias": "maxVisible"; "required": false; }; "stepMinWidth": { "alias": "stepMinWidth"; "required": false; }; "animated": { "alias": "animated"; "required": false; }; "navigationMode": { "alias": "navigationMode"; "required": false; }; "colorScheme": { "alias": "colorScheme"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; }, { "activeIndexChange": "activeIndexChange"; "stepClick": "stepClick"; }, never, never, true, never>;
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seniorsistemas/components-ai",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0-master-bdd92d4e",
|
|
4
4
|
"description": "Biblioteca de componentes reutilizáveis com IA para aplicações Angular da Senior Sistemas",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
"default": "./fesm2022/seniorsistemas-components-ai.mjs"
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
}
|
|
54
|
+
}
|
package/public-api.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { LoadingComponent } from './lib/components/loading/loading.component';
|
|
|
16
16
|
export { IassistIconComponent } from './lib/components/loading/iassist-icon.component';
|
|
17
17
|
export { EntityListBaseComponent } from './lib/components/base/entity-list-base.component';
|
|
18
18
|
export { KanbanBoardComponent, type KanbanColumn, type KanbanItem, type KanbanTag, type KanbanDropEvent } from './lib/components/kanban-board/kanban-board.component';
|
|
19
|
+
export { StepsComponent, type StepItem } from './lib/components/steps/steps.component';
|
|
19
20
|
export { DynamicFormComponent } from './lib/components/dynamic-form/dynamic-form.component';
|
|
20
21
|
export * from './lib/components/dynamic-form/models/dynamic-form.models';
|
|
21
22
|
export * from './lib/components/dynamic-form/fields';
|