@seniorsistemas/components-ai 1.2.0 → 1.3.0

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.
@@ -0,0 +1,20 @@
1
+ import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
2
+ import { TranslationService } from '../../../services/translation.service';
3
+ import { LocaleService } from '../../../services/locale.service';
4
+ import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class DynamicFieldDatetimeComponent extends DynamicFieldBaseComponent implements OnInit, OnDestroy {
7
+ private localeService;
8
+ private cdr;
9
+ currentDateFormat: string;
10
+ calendarVisible: boolean;
11
+ private langSub?;
12
+ constructor(translationService: TranslationService, localeService: LocaleService, cdr: ChangeDetectorRef);
13
+ ngOnInit(): void;
14
+ ngOnDestroy(): void;
15
+ private refreshCalendar;
16
+ private updateDateFormat;
17
+ getPlaceholder(): string;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldDatetimeComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldDatetimeComponent, "sia-dynamic-field-datetime", never, {}, {}, never, never, true, never>;
20
+ }
@@ -1,4 +1,4 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, ChangeDetectorRef } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
3
  import { DynamicFormFieldConfig } from '../models/dynamic-form.models';
4
4
  import { TranslationService } from '../../../services/translation.service';
@@ -6,6 +6,7 @@ import { LookupColumn } from '../../../models/entity-list.config';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class DynamicFieldLookupComponent implements OnInit {
8
8
  private translationService;
9
+ private cdr;
9
10
  field: DynamicFormFieldConfig;
10
11
  form: FormGroup;
11
12
  formGroup: FormGroup;
@@ -20,11 +21,12 @@ export declare class DynamicFieldLookupComponent implements OnInit {
20
21
  currentPage: number;
21
22
  pageSize: number;
22
23
  selectedItem: any;
24
+ private skipNextLazyLoad;
23
25
  columns: LookupColumn[];
24
26
  displayField: string;
25
27
  valueField: string;
26
28
  searchFields: string[];
27
- constructor(translationService: TranslationService);
29
+ constructor(translationService: TranslationService, cdr: ChangeDetectorRef);
28
30
  ngOnInit(): void;
29
31
  private watchValueChanges;
30
32
  /**
@@ -25,7 +25,7 @@ export interface DynamicFormFieldSize {
25
25
  export interface DynamicFormFieldConfig {
26
26
  field: string;
27
27
  label: string;
28
- type: 'text' | 'number' | 'dropdown' | 'lookup' | 'textarea' | 'enum' | 'date';
28
+ type: 'text' | 'number' | 'dropdown' | 'lookup' | 'textarea' | 'enum' | 'date' | 'datetime';
29
29
  validators?: ValidatorFn[];
30
30
  required?: boolean;
31
31
  placeholder?: string;
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ export type LoadingVariant = 'dots' | 'pulse' | 'bars' | 'orbit' | 'morph' | 'wave' | 'skeleton' | 'senior-draw' | 'senior-pulse' | 'senior-glow' | 'senior-flip' | 'senior-bounce' | 'senior-reveal';
3
+ export type LoadingColor = 'primary' | 'secondary' | 'success' | 'warn' | 'danger' | 'info' | 'senior';
4
+ export declare class LoadingComponent {
5
+ variant: LoadingVariant;
6
+ color: LoadingColor;
7
+ size: number;
8
+ text: string;
9
+ padding: string;
10
+ get colorBase(): string;
11
+ get colorLight(): string;
12
+ pathRight: string;
13
+ pathLeft: string;
14
+ pathFull: string;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoadingComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<LoadingComponent, "sia-loading", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "text": { "alias": "text"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; }, {}, never, never, true, never>;
17
+ }
@@ -0,0 +1,34 @@
1
+ import { OnChanges, SimpleChanges, ElementRef, Renderer2, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
2
+ import { LoadingVariant, LoadingColor } from '../../components/loading/loading.component';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Directive that replaces PrimeNG p-table's default loading spinner
6
+ * with the sia-loading component injected as a table row in the tbody.
7
+ *
8
+ * Usage:
9
+ * <p-table [loading]="loading" siaTableLoading>
10
+ */
11
+ export declare class TableLoadingDirective implements OnChanges, AfterViewInit, OnDestroy {
12
+ private el;
13
+ private renderer;
14
+ private vcr;
15
+ loading: boolean;
16
+ siaLoadingVariant: LoadingVariant;
17
+ siaLoadingColor: LoadingColor;
18
+ siaLoadingSize: number;
19
+ private loadingRow;
20
+ private loadingRef;
21
+ private observer;
22
+ private styleEl;
23
+ constructor(el: ElementRef, renderer: Renderer2, vcr: ViewContainerRef);
24
+ ngAfterViewInit(): void;
25
+ ngOnChanges(changes: SimpleChanges): void;
26
+ ngOnDestroy(): void;
27
+ private injectHideStyles;
28
+ private setupObserver;
29
+ private showLoading;
30
+ private removeLoading;
31
+ private getColumnCount;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableLoadingDirective, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TableLoadingDirective, "p-table[siaTableLoading]", never, { "loading": { "alias": "loading"; "required": false; }; "siaLoadingVariant": { "alias": "siaLoadingVariant"; "required": false; }; "siaLoadingColor": { "alias": "siaLoadingColor"; "required": false; }; "siaLoadingSize": { "alias": "siaLoadingSize"; "required": false; }; }, {}, never, never, true, never>;
34
+ }
@@ -65,11 +65,20 @@ export declare abstract class EntityService<T> {
65
65
  */
66
66
  get(id: any): Observable<T>;
67
67
  /**
68
- * Sanitiza uma entidade antes de enviar para a API.
69
- * Objetos aninhados com `id` são reduzidos a `{ id }` para evitar
70
- * problemas com referências circulares ($ref) e dados desnecessários.
68
+ * Sanitiza a entidade/resposta removendo propriedades $ref que vêm do
69
+ * backend (Jackson @JsonIdentityInfo), substituindo-as pelo objeto real
70
+ * referenciado no payload original.
71
71
  */
72
72
  protected sanitizeEntity(entity: any): any;
73
+ /**
74
+ * Percorre recursivamente o objeto e resolve qualquer { $ref: "..." }
75
+ * buscando o valor real no root do payload usando o path JSON.
76
+ */
77
+ private resolveRefs;
78
+ /**
79
+ * Resolve um path JSON no formato $["key"][index]["key"] ou $.key.key[index]
80
+ */
81
+ private resolveJsonPath;
73
82
  /**
74
83
  * Create new entity
75
84
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seniorsistemas/components-ai",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Biblioteca de componentes reutilizáveis com IA para aplicações Angular da Senior Sistemas",
5
5
  "keywords": [
6
6
  "angular",
package/public-api.d.ts CHANGED
@@ -11,6 +11,7 @@ export { LocaleService } from './lib/services/locale.service';
11
11
  export { ExportDialogComponent, type ColumnOption } from './lib/components/export-dialog/export-dialog.component';
12
12
  export { BulkDeleteDialogComponent } from './lib/components/bulk-delete-dialog/bulk-delete-dialog.component';
13
13
  export { BreadcrumbComponent } from './lib/components/breadcrumb/breadcrumb.component';
14
+ export { LoadingComponent } from './lib/components/loading/loading.component';
14
15
  export { EntityListBaseComponent } from './lib/components/base/entity-list-base.component';
15
16
  export { DynamicFormComponent } from './lib/components/dynamic-form/dynamic-form.component';
16
17
  export * from './lib/components/dynamic-form/models/dynamic-form.models';
@@ -25,6 +26,7 @@ export { PostalCodeMaskDirective } from './lib/directives/postal-code-mask.direc
25
26
  export { DocumentMaskDirective } from './lib/directives/document-mask.directive';
26
27
  export { PhoneMaskDirective } from './lib/directives/phone-mask.directive';
27
28
  export { MoneyMaskDirective } from './lib/directives/money-mask.directive';
29
+ export { TableLoadingDirective } from './lib/directives/table-loading/table-loading.directive';
28
30
  export { TranslatePipe } from './lib/pipes/translate.pipe';
29
31
  export { CpfPipe } from './lib/pipes/cpf.pipe';
30
32
  export { CnpjPipe } from './lib/pipes/cnpj.pipe';