@seniorsistemas/components-ai 1.3.0 → 2.0.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.
Files changed (40) hide show
  1. package/esm2022/lib/components/dynamic-form/dynamic-form.component.mjs +263 -368
  2. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-checkbox.component.mjs +53 -0
  3. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-date.component.mjs +5 -3
  4. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-datetime.component.mjs +5 -3
  5. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-dropdown.component.mjs +5 -3
  6. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-image.component.mjs +162 -0
  7. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-lookup.component.mjs +203 -49
  8. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-multiselect.component.mjs +90 -0
  9. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-number.component.mjs +3 -3
  10. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-text.component.mjs +7 -7
  11. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-time.component.mjs +66 -0
  12. package/esm2022/lib/components/dynamic-form/fields/index.mjs +5 -1
  13. package/esm2022/lib/components/dynamic-form/models/dynamic-form.models.mjs +1 -1
  14. package/esm2022/lib/components/loading/iassist-icon.component.mjs +14 -0
  15. package/esm2022/lib/components/loading/loading.component.mjs +47 -4
  16. package/esm2022/lib/i18n/en-US.json +4 -1
  17. package/esm2022/lib/i18n/es-ES.json +4 -1
  18. package/esm2022/lib/i18n/pt-BR.json +4 -1
  19. package/esm2022/lib/models/entity-list.config.mjs +1 -1
  20. package/esm2022/lib/services/websocket.service.mjs +184 -0
  21. package/esm2022/public-api.mjs +3 -1
  22. package/fesm2022/seniorsistemas-components-ai.mjs +1283 -661
  23. package/fesm2022/seniorsistemas-components-ai.mjs.map +1 -1
  24. package/lib/components/dynamic-form/dynamic-form.component.d.ts +8 -17
  25. package/lib/components/dynamic-form/fields/dynamic-field-checkbox.component.d.ts +8 -0
  26. package/lib/components/dynamic-form/fields/dynamic-field-image.component.d.ts +21 -0
  27. package/lib/components/dynamic-form/fields/dynamic-field-lookup.component.d.ts +19 -6
  28. package/lib/components/dynamic-form/fields/dynamic-field-multiselect.component.d.ts +10 -0
  29. package/lib/components/dynamic-form/fields/dynamic-field-time.component.d.ts +9 -0
  30. package/lib/components/dynamic-form/fields/index.d.ts +4 -0
  31. package/lib/components/dynamic-form/models/dynamic-form.models.d.ts +30 -84
  32. package/lib/components/loading/iassist-icon.component.d.ts +6 -0
  33. package/lib/components/loading/loading.component.d.ts +1 -1
  34. package/lib/models/entity-list.config.d.ts +12 -132
  35. package/lib/services/websocket.service.d.ts +63 -0
  36. package/package.json +3 -2
  37. package/public-api.d.ts +2 -0
  38. package/src/lib/i18n/en-US.json +4 -1
  39. package/src/lib/i18n/es-ES.json +4 -1
  40. package/src/lib/i18n/pt-BR.json +4 -1
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { FormBuilder, FormGroup } from '@angular/forms';
3
- import { DynamicFormFieldConfig, DynamicFormSection, DynamicFormDisplayMode, DynamicFormDialogConfig, DynamicFormDrawerConfig } from './models/dynamic-form.models';
3
+ import { DynamicFormFieldConfig, DynamicFormSection, DynamicFormDialogConfig, DynamicFormDrawerConfig } from './models/dynamic-form.models';
4
4
  import { TranslationService } from '../../services/translation.service';
5
5
  import { MaskService } from '../../services/mask.service';
6
6
  import { LocaleService } from '../../services/locale.service';
@@ -10,13 +10,10 @@ export declare class DynamicFormComponent implements OnInit, OnChanges {
10
10
  private translationService;
11
11
  private maskService;
12
12
  private localeService;
13
- formFields: DynamicFormFieldConfig[];
14
- formSections: DynamicFormSection[];
15
- fixedFilters: DynamicFormFieldConfig[];
16
- filterSections: DynamicFormSection[];
13
+ sections: DynamicFormSection[];
17
14
  entityData: any;
18
- mode: 'form' | 'filter' | 'inline-edit';
19
- displayMode: DynamicFormDisplayMode;
15
+ mode: 'form' | 'inline-edit';
16
+ displayMode?: 'dialog' | 'drawer';
20
17
  visible: boolean;
21
18
  dialogConfig: DynamicFormDialogConfig;
22
19
  drawerConfig: DynamicFormDrawerConfig;
@@ -38,16 +35,11 @@ export declare class DynamicFormComponent implements OnInit, OnChanges {
38
35
  loading: boolean;
39
36
  editingField: string | null;
40
37
  savingField: boolean;
41
- get hasFields(): boolean;
42
- get hasSections(): boolean;
43
- get hasFixedFilters(): boolean;
44
- get hasFilterSections(): boolean;
45
38
  get allFields(): DynamicFormFieldConfig[];
46
- get isInlineMode(): boolean;
47
39
  get isInlineEditMode(): boolean;
48
- get fieldMode(): 'form' | 'filter';
49
40
  get isDialogMode(): boolean;
50
41
  get isDrawerMode(): boolean;
42
+ get isInlineMode(): boolean;
51
43
  get dialogHeader(): string;
52
44
  get dialogWidth(): string;
53
45
  get dialogDraggable(): boolean;
@@ -75,7 +67,6 @@ export declare class DynamicFormComponent implements OnInit, OnChanges {
75
67
  private processEntityData;
76
68
  private getNestedValue;
77
69
  resetForm(): void;
78
- private processFilterValue;
79
70
  private processFormValue;
80
71
  getFieldGridClass(field: DynamicFormFieldConfig): string;
81
72
  isFieldVisible(field: DynamicFormFieldConfig): boolean;
@@ -84,12 +75,12 @@ export declare class DynamicFormComponent implements OnInit, OnChanges {
84
75
  updateDisabledFields(): void;
85
76
  clearHiddenFields(): void;
86
77
  getForm(): FormGroup;
87
- clearFilters(): void;
88
- getTypePersonValue(): 'NATURAL_PERSON' | 'JURIDICAL_PERSON';
89
78
  open(entity?: any): void;
90
79
  close(): void;
91
80
  handleCancel(): void;
92
81
  handleSubmit(): void;
82
+ onFormKeydown(event: KeyboardEvent): void;
83
+ getSectionStyle(section: DynamicFormSection): string;
93
84
  startEditField(fieldName: string): void;
94
85
  isFieldEditing(fieldName: string): boolean;
95
86
  saveInlineField(fieldName: string): void;
@@ -97,5 +88,5 @@ export declare class DynamicFormComponent implements OnInit, OnChanges {
97
88
  completeInlineEdit(): void;
98
89
  getFieldDisplayValue(fieldName: string): string;
99
90
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormComponent, never>;
100
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "sia-dynamic-form", never, { "formFields": { "alias": "formFields"; "required": false; }; "formSections": { "alias": "formSections"; "required": false; }; "fixedFilters": { "alias": "fixedFilters"; "required": false; }; "filterSections": { "alias": "filterSections"; "required": false; }; "entityData": { "alias": "entityData"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "dialogConfig": { "alias": "dialogConfig"; "required": false; }; "drawerConfig": { "alias": "drawerConfig"; "required": false; }; "showSubmitButton": { "alias": "showSubmitButton"; "required": false; }; "showCancelButton": { "alias": "showCancelButton"; "required": false; }; "submitButtonLabel": { "alias": "submitButtonLabel"; "required": false; }; "cancelButtonLabel": { "alias": "cancelButtonLabel"; "required": false; }; "submitButtonIcon": { "alias": "submitButtonIcon"; "required": false; }; "cancelButtonIcon": { "alias": "cancelButtonIcon"; "required": false; }; }, { "formReady": "formReady"; "formSubmit": "formSubmit"; "visibleChange": "visibleChange"; "onCancel": "onCancel"; "fieldSave": "fieldSave"; }, never, never, true, never>;
91
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "sia-dynamic-form", never, { "sections": { "alias": "sections"; "required": false; }; "entityData": { "alias": "entityData"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "dialogConfig": { "alias": "dialogConfig"; "required": false; }; "drawerConfig": { "alias": "drawerConfig"; "required": false; }; "showSubmitButton": { "alias": "showSubmitButton"; "required": false; }; "showCancelButton": { "alias": "showCancelButton"; "required": false; }; "submitButtonLabel": { "alias": "submitButtonLabel"; "required": false; }; "cancelButtonLabel": { "alias": "cancelButtonLabel"; "required": false; }; "submitButtonIcon": { "alias": "submitButtonIcon"; "required": false; }; "cancelButtonIcon": { "alias": "cancelButtonIcon"; "required": false; }; }, { "formReady": "formReady"; "formSubmit": "formSubmit"; "visibleChange": "visibleChange"; "onCancel": "onCancel"; "fieldSave": "fieldSave"; }, never, ["*"], true, never>;
101
92
  }
@@ -0,0 +1,8 @@
1
+ import { TranslationService } from '../../../services/translation.service';
2
+ import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DynamicFieldCheckboxComponent extends DynamicFieldBaseComponent {
5
+ constructor(translationService: TranslationService);
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldCheckboxComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldCheckboxComponent, "sia-dynamic-field-checkbox", never, {}, {}, never, never, true, never>;
8
+ }
@@ -0,0 +1,21 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { TranslationService } from '../../../services/translation.service';
3
+ import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
4
+ import * as i0 from "@angular/core";
5
+ export declare class DynamicFieldImageComponent extends DynamicFieldBaseComponent {
6
+ fileInput: ElementRef<HTMLInputElement>;
7
+ previewUrl: string | null;
8
+ isDragOver: boolean;
9
+ constructor(translationService: TranslationService);
10
+ ngOnInit(): void;
11
+ triggerFileInput(): void;
12
+ onFileSelected(event: Event): void;
13
+ onDragOver(event: DragEvent): void;
14
+ onDragLeave(event: DragEvent): void;
15
+ onDrop(event: DragEvent): void;
16
+ removeImage(): void;
17
+ getAcceptHint(): string;
18
+ private handleFile;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldImageComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldImageComponent, "sia-dynamic-field-image", never, {}, {}, never, never, true, never>;
21
+ }
@@ -1,12 +1,11 @@
1
- import { OnInit, ChangeDetectorRef } from '@angular/core';
1
+ import { OnInit, OnDestroy } 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';
5
5
  import { LookupColumn } from '../../../models/entity-list.config';
6
6
  import * as i0 from "@angular/core";
7
- export declare class DynamicFieldLookupComponent implements OnInit {
7
+ export declare class DynamicFieldLookupComponent implements OnInit, OnDestroy {
8
8
  private translationService;
9
- private cdr;
10
9
  field: DynamicFormFieldConfig;
11
10
  form: FormGroup;
12
11
  formGroup: FormGroup;
@@ -21,13 +20,27 @@ export declare class DynamicFieldLookupComponent implements OnInit {
21
20
  currentPage: number;
22
21
  pageSize: number;
23
22
  selectedItem: any;
24
- private skipNextLazyLoad;
25
23
  columns: LookupColumn[];
26
24
  displayField: string;
27
25
  valueField: string;
28
26
  searchFields: string[];
29
- constructor(translationService: TranslationService, cdr: ChangeDetectorRef);
27
+ autocompleteText: string;
28
+ suggestions: any[];
29
+ showSuggestions: boolean;
30
+ autocompleteLoading: boolean;
31
+ private autocompleteSubject;
32
+ private autocompleteSub?;
33
+ get isAutocomplete(): boolean;
34
+ private get minLength();
35
+ constructor(translationService: TranslationService);
30
36
  ngOnInit(): void;
37
+ ngOnDestroy(): void;
38
+ private setupAutocomplete;
39
+ onAutocompleteInput(event: Event): void;
40
+ onAutocompleteFocus(): void;
41
+ onAutocompleteBlur(): void;
42
+ selectSuggestion(item: any): void;
43
+ private searchSuggestions;
31
44
  private watchValueChanges;
32
45
  /**
33
46
  * Obtém o FormControl, lidando com campos aninhados (com ponto no nome)
@@ -38,7 +51,7 @@ export declare class DynamicFieldLookupComponent implements OnInit {
38
51
  private setValue;
39
52
  private setupLookupConfig;
40
53
  private handleValueDisplay;
41
- private formatDisplayValue;
54
+ formatDisplayValue(item: any): string;
42
55
  isFieldInvalid(): boolean;
43
56
  isFieldDisabled(): boolean;
44
57
  getPlaceholder(): string;
@@ -0,0 +1,10 @@
1
+ import { TranslationService } from '../../../services/translation.service';
2
+ import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DynamicFieldMultiselectComponent extends DynamicFieldBaseComponent {
5
+ constructor(translationService: TranslationService);
6
+ getPlaceholder(): string;
7
+ getOptions(): any[];
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldMultiselectComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldMultiselectComponent, "sia-dynamic-field-multiselect", never, {}, {}, never, never, true, never>;
10
+ }
@@ -0,0 +1,9 @@
1
+ import { TranslationService } from '../../../services/translation.service';
2
+ import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DynamicFieldTimeComponent extends DynamicFieldBaseComponent {
5
+ constructor(translationService: TranslationService);
6
+ getPlaceholder(): string;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldTimeComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFieldTimeComponent, "sia-dynamic-field-time", never, {}, {}, never, never, true, never>;
9
+ }
@@ -5,3 +5,7 @@ export * from './dynamic-field-date.component';
5
5
  export * from './dynamic-field-dropdown.component';
6
6
  export * from './dynamic-field-lookup.component';
7
7
  export * from './dynamic-field-wrapper.component';
8
+ export * from './dynamic-field-time.component';
9
+ export * from './dynamic-field-checkbox.component';
10
+ export * from './dynamic-field-multiselect.component';
11
+ export * from './dynamic-field-image.component';
@@ -1,6 +1,6 @@
1
1
  import { ValidatorFn } from '@angular/forms';
2
2
  /**
3
- * Lookup column configuration for dynamic form lookup fields
3
+ * Lookup column configuration
4
4
  */
5
5
  export interface DynamicFormLookupColumn {
6
6
  field: string;
@@ -9,7 +9,7 @@ export interface DynamicFormLookupColumn {
9
9
  type?: 'text' | 'number';
10
10
  }
11
11
  /**
12
- * Responsive size configuration for form fields
12
+ * Responsive size configuration for form fields (grid 12 columns)
13
13
  */
14
14
  export interface DynamicFormFieldSize {
15
15
  xs?: number;
@@ -20,37 +20,19 @@ export interface DynamicFormFieldSize {
20
20
  }
21
21
  /**
22
22
  * Dynamic Form Field Configuration
23
- * Complete configuration interface for all field types in dynamic forms
24
23
  */
25
24
  export interface DynamicFormFieldConfig {
26
25
  field: string;
27
26
  label: string;
28
- type: 'text' | 'number' | 'dropdown' | 'lookup' | 'textarea' | 'enum' | 'date' | 'datetime';
27
+ type: 'text' | 'number' | 'currency' | 'dropdown' | 'lookup' | 'textarea' | 'enum' | 'date' | 'datetime' | 'time' | 'checkbox' | 'multiselect' | 'image';
29
28
  validators?: ValidatorFn[];
30
29
  required?: boolean;
31
30
  placeholder?: string;
32
31
  defaultValue?: any;
33
32
  disabled?: boolean;
34
- colspan?: number;
35
- size?: DynamicFormFieldSize;
36
- colspanXs?: number;
37
- colspanSm?: number;
38
- colspanMd?: number;
39
- colspanLg?: number;
40
- colspanXl?: number;
41
- colspanWhen?: {
42
- field: string;
43
- value: any;
44
- colspan: number;
45
- }[];
46
- visibleWhen?: {
47
- field: string;
48
- value: any;
49
- };
50
- disabledWhen?: {
51
- field: string;
52
- value: any;
53
- };
33
+ size?: DynamicFormFieldSize | ((formValues: any) => DynamicFormFieldSize);
34
+ visibleWhen?: (formValues: any) => boolean;
35
+ disabledWhen?: (formValues: any) => boolean;
54
36
  minLength?: number;
55
37
  maxLength?: number;
56
38
  mask?: 'cep' | 'postalCode' | 'phone' | 'document' | 'cpf' | 'cnpj' | 'dynamic';
@@ -58,18 +40,15 @@ export interface DynamicFormFieldConfig {
58
40
  maskMapping?: {
59
41
  [key: string]: 'NATURAL_PERSON' | 'JURIDICAL_PERSON';
60
42
  };
61
- usePostalCodeMask?: boolean;
62
- usePhoneMask?: boolean;
63
43
  rows?: number;
64
44
  fullSize?: boolean;
65
45
  min?: number;
66
46
  max?: number;
67
47
  minFractionDigits?: number;
68
48
  maxFractionDigits?: number;
69
- numberMode?: 'decimal' | 'currency';
49
+ useGrouping?: boolean;
70
50
  currency?: string;
71
51
  locale?: string;
72
- useGrouping?: boolean;
73
52
  dateFormat?: string;
74
53
  options?: any[];
75
54
  optionLabel?: string;
@@ -77,6 +56,8 @@ export interface DynamicFormFieldConfig {
77
56
  showClear?: boolean;
78
57
  filter?: boolean;
79
58
  filterBy?: string;
59
+ maxSelectedLabels?: number;
60
+ selectedItemsLabel?: string;
80
61
  enumValues?: string[];
81
62
  enumLabels?: {
82
63
  [key: string]: string;
@@ -92,25 +73,33 @@ export interface DynamicFormFieldConfig {
92
73
  lookupValueField?: string;
93
74
  lookupSearchFields?: string[];
94
75
  lookupColumns?: DynamicFormLookupColumn[];
95
- lookupFilters?: {
96
- [key: string]: any;
97
- };
76
+ lookupFilters?: string | ((formValues: any) => string);
98
77
  lookupSort?: {
99
78
  field: string;
100
79
  order: number;
101
80
  }[];
102
- lookupDynamicFilters?: (formValues: any) => {
103
- [key: string]: any;
104
- };
81
+ lookupAutocomplete?: boolean;
82
+ lookupAutocompleteMinLength?: number;
83
+ imageAccept?: string;
84
+ imageMaxSize?: number;
85
+ imagePreviewHeight?: string;
105
86
  }
106
87
  /**
107
- * Dynamic Form Display Mode
108
- * Define como o formulário será exibido
88
+ * Section style for visual grouping
109
89
  */
110
- export type DynamicFormDisplayMode = 'inline' | 'dialog' | 'drawer' | 'inline-edit';
90
+ export type DynamicFormSectionStyle = 'panel' | 'bordered' | 'none';
91
+ /**
92
+ * Dynamic Form Section — groups fields with optional visual container
93
+ */
94
+ export interface DynamicFormSection {
95
+ fields: DynamicFormFieldConfig[];
96
+ title?: string;
97
+ style?: DynamicFormSectionStyle;
98
+ collapsed?: boolean;
99
+ icon?: string;
100
+ }
111
101
  /**
112
- * Dynamic Form Dialog Configuration
113
- * Configurações específicas para o modo dialog
102
+ * Dialog configuration
114
103
  */
115
104
  export interface DynamicFormDialogConfig {
116
105
  header?: string;
@@ -122,13 +111,11 @@ export interface DynamicFormDialogConfig {
122
111
  dismissableMask?: boolean;
123
112
  }
124
113
  /**
125
- * Dynamic Form Drawer Size
126
- * Tamanhos padronizados para o drawer
114
+ * Drawer size presets
127
115
  */
128
116
  export type DynamicFormDrawerSize = 'small' | 'medium' | 'large' | 'xlarge' | 'full';
129
117
  /**
130
- * Dynamic Form Drawer Configuration
131
- * Configurações específicas para o modo drawer
118
+ * Drawer configuration
132
119
  */
133
120
  export interface DynamicFormDrawerConfig {
134
121
  header?: string;
@@ -140,47 +127,6 @@ export interface DynamicFormDrawerConfig {
140
127
  dismissable?: boolean;
141
128
  }
142
129
  /**
143
- * Dynamic Form Section
144
- * Agrupa campos em seções colapsáveis
145
- */
146
- export interface DynamicFormSection {
147
- title: string;
148
- fields: DynamicFormFieldConfig[];
149
- collapsed?: boolean;
150
- toggleable?: boolean;
151
- icon?: string;
152
- }
153
- /**
154
- * Dynamic Form Configuration
155
- * Main configuration interface for the dynamic form component
156
- */
157
- export interface DynamicFormConfig {
158
- fields: DynamicFormFieldConfig[];
159
- sections?: DynamicFormSection[];
160
- fixedFilters?: DynamicFormFieldConfig[];
161
- filterSections?: DynamicFormSection[];
162
- mode?: 'form' | 'filter';
163
- displayMode?: DynamicFormDisplayMode;
164
- dialogConfig?: DynamicFormDialogConfig;
165
- drawerConfig?: DynamicFormDrawerConfig;
166
- initialData?: any;
167
- submitOnEnter?: boolean;
168
- showSubmitButton?: boolean;
169
- submitButtonLabel?: string;
170
- showCancelButton?: boolean;
171
- cancelButtonLabel?: string;
172
- }
173
- /**
174
- * Dynamic Form Submit Event
175
- */
176
- export interface DynamicFormSubmitEvent {
177
- value: any;
178
- valid: boolean;
179
- dirty: boolean;
180
- touched: boolean;
181
- }
182
- /**
183
- * Type alias for backward compatibility with FormFieldConfig
184
130
  * @deprecated Use DynamicFormFieldConfig instead
185
131
  */
186
132
  export type FormFieldConfig = DynamicFormFieldConfig;
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class IassistIconComponent {
3
+ size: number;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<IassistIconComponent, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<IassistIconComponent, "sia-iassist-icon", never, { "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
6
+ }
@@ -1,5 +1,5 @@
1
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';
2
+ export type LoadingVariant = 'dots' | 'pulse' | 'bars' | 'orbit' | 'morph' | 'wave' | 'skeleton' | 'senior-draw' | 'senior-pulse' | 'senior-glow' | 'senior-flip' | 'senior-bounce' | 'senior-reveal' | 'iassist' | 'iassist-pulse' | 'iassist-orbit';
3
3
  export type LoadingColor = 'primary' | 'secondary' | 'success' | 'warn' | 'danger' | 'info' | 'senior';
4
4
  export declare class LoadingComponent {
5
5
  variant: LoadingVariant;
@@ -1,5 +1,5 @@
1
1
  import { TemplateRef } from '@angular/core';
2
- import { ValidatorFn } from '@angular/forms';
2
+ import { DynamicFormFieldConfig, DynamicFormFieldSize, DynamicFormSection } from '../components/dynamic-form/models/dynamic-form.models';
3
3
  /**
4
4
  * Column configuration for entity list table
5
5
  */
@@ -21,140 +21,21 @@ export interface LookupColumn {
21
21
  type?: 'text' | 'number';
22
22
  }
23
23
  /**
24
- * Responsive size configuration for filter fields
24
+ * @deprecated Use DynamicFormFieldConfig instead
25
25
  */
26
- export interface FilterFieldSize {
27
- xs?: number;
28
- sm?: number;
29
- md?: number;
30
- lg?: number;
31
- xl?: number;
32
- }
26
+ export type FilterConfig = DynamicFormFieldConfig;
33
27
  /**
34
- * Filter section configuration for grouping filters
28
+ * @deprecated Use DynamicFormFieldSize instead
35
29
  */
36
- export interface FilterSection {
37
- title: string;
38
- filters: FilterConfig[];
39
- }
30
+ export type FilterFieldSize = DynamicFormFieldSize;
40
31
  /**
41
- * Filter configuration for entity list
32
+ * @deprecated Use DynamicFormSection instead
42
33
  */
43
- export interface FilterConfig {
44
- field: string;
45
- label: string;
46
- type: 'text' | 'number' | 'dropdown' | 'lookup' | 'date';
47
- options?: any[];
48
- placeholder?: string;
49
- optionLabel?: string;
50
- optionValue?: string;
51
- defaultValue?: any;
52
- disabled?: boolean;
53
- min?: number;
54
- max?: number;
55
- disabledWhen?: {
56
- field: string;
57
- value: any;
58
- };
59
- colspan?: number;
60
- size?: FilterFieldSize;
61
- colspanXs?: number;
62
- colspanSm?: number;
63
- colspanMd?: number;
64
- colspanLg?: number;
65
- colspanXl?: number;
66
- lookupService?: any;
67
- lookupDisplayField?: string;
68
- lookupDisplayFields?: string[];
69
- lookupValueField?: string;
70
- lookupSearchFields?: string[];
71
- lookupColumns?: LookupColumn[];
72
- lookupSort?: {
73
- field: string;
74
- order: number;
75
- }[];
76
- lookupDynamicFilters?: (formValues: any) => {
77
- [key: string]: any;
78
- };
79
- }
34
+ export type FilterSection = DynamicFormSection;
80
35
  /**
81
- * Form field configuration for entity form
36
+ * @deprecated Use DynamicFormFieldConfig instead
82
37
  */
83
- export interface FormFieldConfig {
84
- field: string;
85
- label: string;
86
- type: 'text' | 'number' | 'dropdown' | 'lookup' | 'textarea' | 'enum' | 'date';
87
- validators?: ValidatorFn[];
88
- options?: any[];
89
- required?: boolean;
90
- placeholder?: string;
91
- optionLabel?: string;
92
- optionValue?: string;
93
- min?: number;
94
- max?: number;
95
- minLength?: number;
96
- maxLength?: number;
97
- useGrouping?: boolean;
98
- rows?: number;
99
- fullSize?: boolean;
100
- colspan?: number;
101
- colspanWhen?: {
102
- field: string;
103
- value: any;
104
- colspan: number;
105
- }[];
106
- visibleWhen?: {
107
- field: string;
108
- value: any;
109
- };
110
- disabledWhen?: {
111
- field: string;
112
- value: any;
113
- };
114
- defaultValue?: any;
115
- lookupService?: any;
116
- lookupDisplayField?: string;
117
- lookupDisplayFields?: string[];
118
- lookupValueField?: string;
119
- lookupSearchFields?: string[];
120
- lookupColumns?: LookupColumn[];
121
- lookupFilters?: {
122
- [key: string]: any;
123
- };
124
- lookupSort?: {
125
- field: string;
126
- order: number;
127
- }[];
128
- lookupDynamicFilters?: (formValues: any) => {
129
- [key: string]: any;
130
- };
131
- enumOptions?: {
132
- value: any;
133
- label: string;
134
- }[];
135
- enumValues?: string[];
136
- enumLabels?: {
137
- [key: string]: string;
138
- };
139
- useCepMask?: boolean;
140
- usePhoneMask?: boolean;
141
- mask?: 'dynamic' | 'cpf' | 'cnpj' | 'cep' | 'phone' | 'document';
142
- maskDependsOn?: string;
143
- maskMapping?: {
144
- [key: string]: 'NATURAL_PERSON' | 'JURIDICAL_PERSON';
145
- };
146
- disabled?: boolean;
147
- dateFormat?: string;
148
- minFractionDigits?: number;
149
- maxFractionDigits?: number;
150
- numberMode?: 'decimal' | 'currency';
151
- currency?: string;
152
- locale?: string;
153
- showClear?: boolean;
154
- filter?: boolean;
155
- filterBy?: string;
156
- lookupEntity?: string;
157
- }
38
+ export type FormFieldConfig = DynamicFormFieldConfig;
158
39
  /**
159
40
  * Entity list configuration
160
41
  */
@@ -163,10 +44,9 @@ export interface EntityListConfig {
163
44
  entityIcon: string;
164
45
  subtitle: string;
165
46
  columns: ColumnConfig[];
166
- filters: FilterConfig[];
167
- fixedFilters?: FilterConfig[];
168
- filterSections?: FilterSection[];
169
- formFields: FormFieldConfig[];
47
+ filters: DynamicFormFieldConfig[];
48
+ filterFields?: DynamicFormSection[];
49
+ formFields: DynamicFormFieldConfig[];
170
50
  exportEnabled?: boolean;
171
51
  bulkDeleteEnabled?: boolean;
172
52
  addButtonLabel?: string;
@@ -0,0 +1,63 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { AuthService } from './auth.service';
3
+ import { CookieService } from './cookie.service';
4
+ import { SeniorTokenService } from './senior-token.service';
5
+ import { Observable } from 'rxjs';
6
+ import * as i0 from "@angular/core";
7
+ export interface WebSocketConfig {
8
+ /** Domínio do serviço (ex: 'crmx') */
9
+ domain: string;
10
+ /** Nome do serviço (ex: 'schedule') */
11
+ service: string;
12
+ /** Primitiva/entidade (ex: 'appointment') */
13
+ primitive: string;
14
+ /** Se true, inclui o token do usuário no bind para receber mensagens específicas do usuário */
15
+ userScoped?: boolean;
16
+ }
17
+ export interface StompMessage<T = any> {
18
+ /** Destino/tópico da mensagem */
19
+ destination: string;
20
+ /** Corpo da mensagem parseado */
21
+ body: T;
22
+ /** Headers da mensagem STOMP */
23
+ headers: Record<string, string>;
24
+ }
25
+ type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
26
+ export declare class WebSocketService implements OnDestroy {
27
+ private authService;
28
+ private cookieService;
29
+ private seniorTokenService;
30
+ private client;
31
+ private readonly destroy$;
32
+ private readonly messages$;
33
+ private readonly connectionState$;
34
+ private stompSubscriptions;
35
+ private pendingSubscriptions;
36
+ private subscriptionCounter;
37
+ private reconnectAttempts;
38
+ private readonly maxReconnectAttempts;
39
+ constructor(authService: AuthService, cookieService: CookieService, seniorTokenService: SeniorTokenService);
40
+ /** Estado atual da conexão */
41
+ get state$(): Observable<ConnectionState>;
42
+ /** Conecta ao WebSocket usando a URL base do cookie */
43
+ connect(): void;
44
+ /** Desconecta do WebSocket */
45
+ disconnect(): void;
46
+ /**
47
+ * Inscreve-se em um tópico baseado na configuração.
48
+ * Padrão do bind: /topic/{tenantDomain}/{token}/{domain}/{service}/{primitive}
49
+ */
50
+ subscribe<T = any>(config: WebSocketConfig): Observable<StompMessage<T>>;
51
+ /** Remove a inscrição de um tópico */
52
+ unsubscribe(config: WebSocketConfig): void;
53
+ ngOnDestroy(): void;
54
+ private buildConnectHeaders;
55
+ private buildWebSocketUrl;
56
+ private buildDestination;
57
+ private onConnected;
58
+ private onDisconnected;
59
+ private doSubscribe;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebSocketService, never>;
61
+ static ɵprov: i0.ɵɵInjectableDeclaration<WebSocketService>;
62
+ }
63
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seniorsistemas/components-ai",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "Biblioteca de componentes reutilizáveis com IA para aplicações Angular da Senior Sistemas",
5
5
  "keywords": [
6
6
  "angular",
@@ -28,7 +28,8 @@
28
28
  "primeng": "^18.0.0",
29
29
  "primeicons": "^7.0.0",
30
30
  "@primeuix/themes": "^2.0.0",
31
- "rxjs": "~7.8.0"
31
+ "rxjs": "~7.8.0",
32
+ "@stomp/stompjs": "^7.0.0"
32
33
  },
33
34
  "dependencies": {
34
35
  "tslib": "^2.3.0",
package/public-api.d.ts CHANGED
@@ -8,10 +8,12 @@ export { ThemeService } from './lib/services/theme.service';
8
8
  export { TranslationService, type SupportedLanguage, type TranslationLoader } from './lib/services/translation.service';
9
9
  export { MaskService } from './lib/services/mask.service';
10
10
  export { LocaleService } from './lib/services/locale.service';
11
+ export { WebSocketService, type WebSocketConfig, type StompMessage } from './lib/services/websocket.service';
11
12
  export { ExportDialogComponent, type ColumnOption } from './lib/components/export-dialog/export-dialog.component';
12
13
  export { BulkDeleteDialogComponent } from './lib/components/bulk-delete-dialog/bulk-delete-dialog.component';
13
14
  export { BreadcrumbComponent } from './lib/components/breadcrumb/breadcrumb.component';
14
15
  export { LoadingComponent } from './lib/components/loading/loading.component';
16
+ export { IassistIconComponent } from './lib/components/loading/iassist-icon.component';
15
17
  export { EntityListBaseComponent } from './lib/components/base/entity-list-base.component';
16
18
  export { DynamicFormComponent } from './lib/components/dynamic-form/dynamic-form.component';
17
19
  export * from './lib/components/dynamic-form/models/dynamic-form.models';