tuain-ng-forms-lib 17.3.7 → 17.4.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.
- package/README.md +280 -335
- package/esm2022/lib/classes/forms/action.mjs +3 -3
- package/esm2022/lib/classes/forms/element.mjs +2 -2
- package/esm2022/lib/classes/forms/field.mjs +2 -5
- package/esm2022/lib/classes/forms/form.mjs +4 -6
- package/esm2022/lib/classes/forms/piece-propagate.mjs +1 -1
- package/esm2022/lib/classes/forms/piece.mjs +2 -2
- package/esm2022/lib/classes/forms/section.mjs +2 -2
- package/esm2022/lib/classes/forms/subsection.mjs +1 -1
- package/esm2022/lib/classes/forms/table/action.mjs +1 -1
- package/esm2022/lib/classes/forms/table/column.mjs +1 -1
- package/esm2022/lib/classes/forms/table/row-data.mjs +3 -5
- package/esm2022/lib/classes/forms/table/table.mjs +2 -2
- package/esm2022/lib/components/elements/layout/piece.component.mjs +3 -3
- package/esm2022/lib/components/elements/tables/table-record-action.component.mjs +1 -1
- package/esm2022/lib/components/elements/tables/table-record-field.component.mjs +1 -1
- package/esm2022/lib/components/forms/basic-form.mjs +23 -24
- package/esm2022/lib/interfaces/action.interface.mjs +2 -0
- package/esm2022/lib/interfaces/field.interface.mjs +2 -0
- package/esm2022/lib/interfaces/form-config.interface.mjs +1 -1
- package/esm2022/lib/interfaces/form.interface.mjs +2 -0
- package/esm2022/lib/interfaces/index.mjs +9 -1
- package/esm2022/lib/interfaces/piece.interface.mjs +2 -0
- package/esm2022/lib/interfaces/section.interface.mjs +2 -0
- package/esm2022/lib/interfaces/sse-live-connection.interface.mjs +2 -0
- package/esm2022/lib/interfaces/table.interface.mjs +2 -0
- package/esm2022/lib/services/file-manager.service.mjs +5 -5
- package/esm2022/lib/services/form-manager.service.mjs +5 -5
- package/esm2022/lib/services/icon-dictionary.service.mjs +1 -1
- package/esm2022/lib/services/sse-live-connection.service.mjs +165 -0
- package/esm2022/lib/tokens/sse-live-connection.token.mjs +7 -0
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/tuain-ng-forms-lib.mjs +213 -53
- package/fesm2022/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/action.d.ts +3 -2
- package/lib/classes/forms/element.d.ts +2 -1
- package/lib/classes/forms/field.d.ts +5 -4
- package/lib/classes/forms/form.d.ts +4 -2
- package/lib/classes/forms/piece-propagate.d.ts +2 -1
- package/lib/classes/forms/piece.d.ts +4 -3
- package/lib/classes/forms/section.d.ts +3 -2
- package/lib/classes/forms/subsection.d.ts +2 -1
- package/lib/classes/forms/table/action.d.ts +2 -1
- package/lib/classes/forms/table/column.d.ts +2 -1
- package/lib/classes/forms/table/row-data.d.ts +3 -2
- package/lib/classes/forms/table/table.d.ts +3 -1
- package/lib/components/elements/layout/piece.component.d.ts +2 -2
- package/lib/components/forms/basic-form.d.ts +4 -4
- package/lib/interfaces/action.interface.d.ts +23 -0
- package/lib/interfaces/field.interface.d.ts +70 -0
- package/lib/interfaces/form-config.interface.d.ts +24 -16
- package/lib/interfaces/form.interface.d.ts +106 -0
- package/lib/interfaces/index.d.ts +7 -0
- package/lib/interfaces/piece.interface.d.ts +67 -0
- package/lib/interfaces/section.interface.d.ts +56 -0
- package/lib/interfaces/sse-live-connection.interface.d.ts +59 -0
- package/lib/interfaces/table.interface.d.ts +139 -0
- package/lib/services/file-manager.service.d.ts +4 -4
- package/lib/services/form-manager.service.d.ts +3 -3
- package/lib/services/icon-dictionary.service.d.ts +1 -1
- package/lib/services/sse-live-connection.service.d.ts +48 -0
- package/lib/tokens/sse-live-connection.token.d.ts +7 -0
- package/package.json +2 -1
- package/public-api.d.ts +2 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Observable } from 'rxjs';
|
|
2
|
+
import type { IFormPropagate, IFormElement } from './piece.interface';
|
|
3
|
+
import type { IField } from './field.interface';
|
|
4
|
+
import type { IAction } from './action.interface';
|
|
5
|
+
import type { ITable } from './table.interface';
|
|
6
|
+
/**
|
|
7
|
+
* Contrato público de una subsección de formulario, que agrupa los elementos
|
|
8
|
+
* (campos, tablas, acciones) que se renderizan juntos.
|
|
9
|
+
* Implementado por {@link RecordFormSubSection}.
|
|
10
|
+
*/
|
|
11
|
+
export interface ISubSection extends IFormPropagate {
|
|
12
|
+
customRender: string | null;
|
|
13
|
+
subsectionId: string | null;
|
|
14
|
+
subsectionCode: string | null;
|
|
15
|
+
subsectionTitle: string | null;
|
|
16
|
+
readonly subSectionElements: IFormElement[];
|
|
17
|
+
readonly subSectionFields: IField[];
|
|
18
|
+
readonly subSectionTables: ITable[];
|
|
19
|
+
readonly subSectionActions: IAction[];
|
|
20
|
+
readonly elementsArray: Record<string, IFormElement>;
|
|
21
|
+
active: boolean;
|
|
22
|
+
getField(name: string): IField | undefined;
|
|
23
|
+
getFields(): IField[];
|
|
24
|
+
getFieldNames(): string[];
|
|
25
|
+
getActions(): IAction[];
|
|
26
|
+
getActionNames(): string[];
|
|
27
|
+
activate(): void;
|
|
28
|
+
inactivate(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Contrato público de una sección de formulario, contenedora de subsecciones
|
|
32
|
+
* y con gestión de activación/inactivación (navegación entre secciones).
|
|
33
|
+
* Implementado por {@link RecordFormSection}.
|
|
34
|
+
*/
|
|
35
|
+
export interface ISection extends IFormPropagate {
|
|
36
|
+
readonly code: string | null;
|
|
37
|
+
readonly activation: Observable<string>;
|
|
38
|
+
readonly inactivation: Observable<string>;
|
|
39
|
+
active: boolean;
|
|
40
|
+
sectionId: string | null;
|
|
41
|
+
sectionCode: string | null;
|
|
42
|
+
sectionTitle: string | null;
|
|
43
|
+
title: string | null;
|
|
44
|
+
readonly subSections: ISubSection[];
|
|
45
|
+
readonly subSectionsObj: Record<string, ISubSection>;
|
|
46
|
+
activate(): void;
|
|
47
|
+
inactivate(): void;
|
|
48
|
+
getVisibleSubsections(state?: string): ISubSection[];
|
|
49
|
+
getSubsection(subSectionCode: string): ISubSection | null;
|
|
50
|
+
activateSubSection(subSectionCode: string): void;
|
|
51
|
+
getFields(): IField[];
|
|
52
|
+
getActions(): IAction[];
|
|
53
|
+
getActionNames(): string[];
|
|
54
|
+
getFieldNames(): string[];
|
|
55
|
+
getField(name: string): IField | null;
|
|
56
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evento recibido del servidor a través del stream SSE.
|
|
3
|
+
* El backend envía un objeto JSON por mensaje; `eventClass` identifica el tipo.
|
|
4
|
+
*/
|
|
5
|
+
export interface SseServerEvent {
|
|
6
|
+
eventClass?: string;
|
|
7
|
+
eventType?: string;
|
|
8
|
+
eventDetail?: any;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
/** Logger mínimo opcional; cada app puede inyectar el suyo. */
|
|
12
|
+
export interface SseLogger {
|
|
13
|
+
debug?(message: string, ...args: any[]): void;
|
|
14
|
+
warn?(message: string, ...args: any[]): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Configuración que cada app provee mediante el token `SSE_LIVE_CONNECTION_CONFIG`.
|
|
18
|
+
*
|
|
19
|
+
* Desacopla el servicio de la librería del `EventManager`, el logger y la
|
|
20
|
+
* configuración concretos de cada app (la lib no puede importar el
|
|
21
|
+
* `defaultConfig`, `AppLoggerService` ni el `EventManagerService` de cada app).
|
|
22
|
+
*/
|
|
23
|
+
export interface SseLiveConnectionConfig {
|
|
24
|
+
/** URL base del gateway, p. ej. `"https://host:puerto"`. */
|
|
25
|
+
buildUrl(): string;
|
|
26
|
+
/** Path del endpoint del stream. Default: `"/liveconnect/stream"`. */
|
|
27
|
+
streamPath?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Credencial a enviar en el header `Authorization` al abrir el stream.
|
|
30
|
+
* Normalmente el `sessionId`; el gateway resuelve `userId`/grupos server-side
|
|
31
|
+
* (a diferencia del Socket.IO anterior, el cliente ya no auto-asigna esos campos).
|
|
32
|
+
* Puede ser asíncrona por si hay que refrescar un token.
|
|
33
|
+
*/
|
|
34
|
+
getAuthToken(sessionData: any): string | Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Esquema del header de autenticación. Default: `"Bearer"`.
|
|
37
|
+
* Se envía como `Authorization: <scheme> <token>`. Si es `""`, se envía el token crudo.
|
|
38
|
+
*/
|
|
39
|
+
authScheme?: string;
|
|
40
|
+
/** Allow-list de `eventClass` que pueden re-emitirse al bus de eventos. */
|
|
41
|
+
allowedEvents: ReadonlySet<string> | string[];
|
|
42
|
+
/** Re-emite al bus de la app un evento ya validado (o el evento de fin de sesión). */
|
|
43
|
+
emit(eventClass: string, eventData: SseServerEvent | null): void;
|
|
44
|
+
/**
|
|
45
|
+
* Nombre del evento de fin de sesión, emitido ante un `sessionReplaced` ajeno.
|
|
46
|
+
* Default: `"sessionEnded"`.
|
|
47
|
+
*/
|
|
48
|
+
sessionEndedEventName?: string;
|
|
49
|
+
/** Habilita el manejo del evento de lifecycle `sessionReplaced`. Default: `true`. */
|
|
50
|
+
handleSessionReplaced?: boolean;
|
|
51
|
+
/** Logger opcional. */
|
|
52
|
+
logger?: SseLogger;
|
|
53
|
+
/**
|
|
54
|
+
* Mantener el stream abierto aunque el documento esté oculto. Default: `true`
|
|
55
|
+
* (la app controla el ciclo de vida explícitamente; en móvil vía `appStateChange`).
|
|
56
|
+
* Si es `false`, el stream se cierra al ocultarse la vista y se reabre al volver.
|
|
57
|
+
*/
|
|
58
|
+
keepOpenWhenHidden?: boolean;
|
|
59
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Observable } from 'rxjs';
|
|
2
|
+
import type { IFormPiece, IFormElement } from './piece.interface';
|
|
3
|
+
import type { TableSorting } from './form-config.interface';
|
|
4
|
+
import type { FilterDef, FilterSetup } from '../classes/forms/table/column';
|
|
5
|
+
import type { TableEvent, TableActionEvent } from '../classes/forms/table/table';
|
|
6
|
+
/**
|
|
7
|
+
* Contrato público de una columna de tabla.
|
|
8
|
+
* Implementado por {@link RecordTableColumn}.
|
|
9
|
+
*/
|
|
10
|
+
export interface ITableColumn extends IFormPiece {
|
|
11
|
+
fieldCode: string;
|
|
12
|
+
fieldTitle: string;
|
|
13
|
+
fieldType: string;
|
|
14
|
+
fieldAlignment: string;
|
|
15
|
+
fieldFormat: string;
|
|
16
|
+
sortable: boolean;
|
|
17
|
+
searchable: boolean;
|
|
18
|
+
sortDirections: string[];
|
|
19
|
+
filterVisible: boolean;
|
|
20
|
+
filterDef: FilterDef | null;
|
|
21
|
+
filterSetup: FilterSetup | null;
|
|
22
|
+
readonly filterDefinition: FilterDef | null;
|
|
23
|
+
readonly filter: FilterSetup | null;
|
|
24
|
+
readonly options: any[] | null;
|
|
25
|
+
setSearchable(searchable?: boolean): void;
|
|
26
|
+
hideFilter(): void;
|
|
27
|
+
addFilterDefinition(filterDefinition: any): void;
|
|
28
|
+
addFilter(columnValues: any, operator: string | null): void;
|
|
29
|
+
removeFilter(): void;
|
|
30
|
+
setSortDirections(ascend: boolean, descend: boolean): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Contrato público de una acción de tabla (inline, global o de selección).
|
|
34
|
+
* Implementado por {@link TableAction}.
|
|
35
|
+
*/
|
|
36
|
+
export interface ITableAction extends IFormPiece {
|
|
37
|
+
readonly actionCode: string;
|
|
38
|
+
readonly actionTitle: string;
|
|
39
|
+
readonly iconName: string;
|
|
40
|
+
readonly actionType: string;
|
|
41
|
+
readonly actionClass: string;
|
|
42
|
+
readonly stateField: string;
|
|
43
|
+
readonly newState: string;
|
|
44
|
+
readonly backend: boolean;
|
|
45
|
+
readonly restrictedOnField: string | null;
|
|
46
|
+
readonly restrictedOnValue: string | null;
|
|
47
|
+
readonly restrictedOnOperator: string | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Contrato público de un registro de tabla.
|
|
51
|
+
* Implementado por {@link TableRecordData}.
|
|
52
|
+
*/
|
|
53
|
+
export interface ITableRecord {
|
|
54
|
+
recordId: string | null;
|
|
55
|
+
selected: boolean;
|
|
56
|
+
recordData: Record<string, any>;
|
|
57
|
+
readonly recordIdKey: string | null;
|
|
58
|
+
toggleSelect(): void;
|
|
59
|
+
select(): void;
|
|
60
|
+
unselect(): void;
|
|
61
|
+
getFieldValue(fieldCode: string): any;
|
|
62
|
+
hasPattern(words: string[], columnObj: any): boolean;
|
|
63
|
+
hasCondition(columnFilters: any[]): boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Contrato público de una tabla de registros, con acceso a sus columnas,
|
|
67
|
+
* acciones de tabla y registros.
|
|
68
|
+
* Implementado por {@link RecordTable}.
|
|
69
|
+
*/
|
|
70
|
+
export interface ITable extends IFormElement {
|
|
71
|
+
readonly tableCode: string;
|
|
72
|
+
readonly code: string;
|
|
73
|
+
tableTitle: string;
|
|
74
|
+
readonly columns: ITableColumn[];
|
|
75
|
+
readonly columnNames: string[];
|
|
76
|
+
readonly tableRecords: ITableRecord[];
|
|
77
|
+
readonly visibleRecords: ITableRecord[];
|
|
78
|
+
readonly tableRecordObj: Record<string, ITableRecord>;
|
|
79
|
+
selectable: boolean;
|
|
80
|
+
selectionBackend: boolean;
|
|
81
|
+
selectionField: string;
|
|
82
|
+
allSelected: boolean;
|
|
83
|
+
currentPage: number;
|
|
84
|
+
totalPages: number;
|
|
85
|
+
requestedPage: number;
|
|
86
|
+
recordsPerPage: number;
|
|
87
|
+
totalRecordsNumber: number;
|
|
88
|
+
recordsNumber: number;
|
|
89
|
+
sorting: TableSorting;
|
|
90
|
+
waiting: boolean;
|
|
91
|
+
clientPaging: boolean;
|
|
92
|
+
sortable: boolean;
|
|
93
|
+
globalSearch: boolean;
|
|
94
|
+
globalFilterString: string;
|
|
95
|
+
restrictedId: any;
|
|
96
|
+
readonly currentFilter: any;
|
|
97
|
+
readonly inlineActionTrigger: Observable<TableEvent>;
|
|
98
|
+
readonly globalActionTrigger: Observable<TableEvent>;
|
|
99
|
+
readonly selectionActionTrigger: Observable<TableEvent>;
|
|
100
|
+
readonly recordSelectionTrigger: Observable<TableEvent>;
|
|
101
|
+
readonly getDataTrigger: Observable<TableEvent>;
|
|
102
|
+
getLayout(): string | null;
|
|
103
|
+
setLayout(layout: string): void;
|
|
104
|
+
hasActions(): boolean;
|
|
105
|
+
getSelectedRecords(): (string | null)[];
|
|
106
|
+
activateGlobalSearch(): void;
|
|
107
|
+
inactivateGlobalSearch(): void;
|
|
108
|
+
columnDefinition(fieldCode: string): ITableColumn;
|
|
109
|
+
putOnWait(): void;
|
|
110
|
+
freeWaiting(): void;
|
|
111
|
+
setWidget(widget: any): void;
|
|
112
|
+
notifyGlobalAction(actionCode: string): void;
|
|
113
|
+
notifyInlineAction(tableActionEvent: TableActionEvent): void;
|
|
114
|
+
notifyRecordSelection(recordId: any): void;
|
|
115
|
+
notifySelectionAction(actionCode: string): void;
|
|
116
|
+
notifyGetDataAction(requestedPage?: number | null): null;
|
|
117
|
+
clean(): void;
|
|
118
|
+
selectAll(): boolean;
|
|
119
|
+
unSelectAll(): boolean;
|
|
120
|
+
setTableRecords(tableRecords: any[], append?: boolean, prepend?: boolean): void;
|
|
121
|
+
appendRecords(records: any[]): void;
|
|
122
|
+
prependRecords(records: any[]): void;
|
|
123
|
+
replaceRecords(records: any[]): void;
|
|
124
|
+
setTableAppend(append: boolean): void;
|
|
125
|
+
changePage(requestedPage: number): void;
|
|
126
|
+
updateFromServer(tableReceived: any): void;
|
|
127
|
+
getTableRecord(recordId: any): ITableRecord | null;
|
|
128
|
+
getAction(actionCode: string): ITableAction | null;
|
|
129
|
+
getActions(actionClass?: string, actionTypes?: string[] | null): ITableAction[];
|
|
130
|
+
setFilterById(id: any): void;
|
|
131
|
+
cleanIdFilter(): void;
|
|
132
|
+
setGlobalFilterString(text: string, notifyComponent?: boolean): void;
|
|
133
|
+
addFilterDefinition(columnName: string, filterDefinition: any): void;
|
|
134
|
+
getFilteredRecords(): ITableRecord[];
|
|
135
|
+
getColumnFilter(columnName: string): FilterSetup | null;
|
|
136
|
+
addColumnFilter(columnName: string, columnValues: any | any[], operator?: string | null): void;
|
|
137
|
+
removeColumnFilter(columnName: string): void;
|
|
138
|
+
sort(columnName: string, direction: string): void;
|
|
139
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class LibFileManagementService {
|
|
3
|
-
openFile(
|
|
4
|
-
saveFileFromURL(
|
|
5
|
-
saveFile(
|
|
6
|
-
printPdfFile(
|
|
3
|
+
openFile(_fileBase64Data: string, _fileName: string, _fileType: string): void;
|
|
4
|
+
saveFileFromURL(_fileUrl: string, _fileName?: string | null, _fileType?: string | null): void;
|
|
5
|
+
saveFile(_fileBase64Data: string | Blob, _fileName: string, _fileType: string): void;
|
|
6
|
+
printPdfFile(_pdfBufferData: ArrayBuffer | Blob): void;
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<LibFileManagementService, never>;
|
|
8
8
|
static ɵprov: i0.ɵɵInjectableDeclaration<LibFileManagementService>;
|
|
9
9
|
}
|
|
@@ -12,9 +12,9 @@ export interface FormStackItem {
|
|
|
12
12
|
export declare class LibFormManagerService {
|
|
13
13
|
pageStack: FormStackItem[];
|
|
14
14
|
constructor();
|
|
15
|
-
getFormDefinition(
|
|
16
|
-
execServerAction(
|
|
17
|
-
goToForm(
|
|
15
|
+
getFormDefinition(_formCode: string): any;
|
|
16
|
+
execServerAction(_actionDetail: any): any;
|
|
17
|
+
goToForm(_formCode: string, _token: string, _subject: string | null): void;
|
|
18
18
|
loadStack(): Promise<void>;
|
|
19
19
|
saveStack(): void;
|
|
20
20
|
cleanStack(): void;
|
|
@@ -156,5 +156,5 @@ export declare const iconDictionary: {
|
|
|
156
156
|
* @deprecated Since v17. Use BaseIconResolverService with ICON_RESOLVER token instead. Will be removed in v19.
|
|
157
157
|
*/
|
|
158
158
|
export declare class IconDictionaryService {
|
|
159
|
-
mapIcon: (iconName: string) => string;
|
|
159
|
+
mapIcon: (iconName: string) => string | null;
|
|
160
160
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { fetchEventSource } from '@microsoft/fetch-event-source';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Canal de eventos servidor→cliente sobre Server-Sent Events (SSE).
|
|
5
|
+
*
|
|
6
|
+
* Reemplaza al `LiveConnectionService` basado en Socket.IO que vivía duplicado
|
|
7
|
+
* en cada app. El uso siempre fue unidireccional (un único handshake y luego
|
|
8
|
+
* solo recepción), así que SSE encaja sin perder funcionalidad y además gana
|
|
9
|
+
* reconexión automática nativa.
|
|
10
|
+
*
|
|
11
|
+
* El servicio es agnóstico de la app: toda la integración (URL, token de auth,
|
|
12
|
+
* allow-list, re-emisión al bus, logger) llega por `SSE_LIVE_CONNECTION_CONFIG`.
|
|
13
|
+
* El ciclo de vida (cuándo abrir/cerrar) lo controla cada app llamando
|
|
14
|
+
* `open()`/`close()` — típicamente atado a `sessionEstablished`/`sessionEnded`,
|
|
15
|
+
* y en móvil además al `appStateChange` de Capacitor.
|
|
16
|
+
*/
|
|
17
|
+
export declare class SseLiveConnectionService {
|
|
18
|
+
private readonly _config;
|
|
19
|
+
private _abort;
|
|
20
|
+
private _currentSessionId;
|
|
21
|
+
private _connected;
|
|
22
|
+
isConnected(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Abre el stream SSE para la sesión dada (cierra cualquier stream anterior).
|
|
25
|
+
* El handshake viaja en el header `Authorization`, no en la URL.
|
|
26
|
+
*/
|
|
27
|
+
open(sessionData: any): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Punto de indirección (seam) sobre `fetchEventSource`: permite sustituirlo en
|
|
30
|
+
* tests (`fetchEventSource` es un binding ESM de solo lectura, no espiable).
|
|
31
|
+
* En producción delega directamente en la librería.
|
|
32
|
+
*/
|
|
33
|
+
protected openEventSource(url: Parameters<typeof fetchEventSource>[0], options: Parameters<typeof fetchEventSource>[1]): Promise<void>;
|
|
34
|
+
/** Cierra el stream actual (idempotente). */
|
|
35
|
+
close(): void;
|
|
36
|
+
private _buildStreamUrl;
|
|
37
|
+
private _allowedSet;
|
|
38
|
+
/**
|
|
39
|
+
* Maneja el evento de lifecycle `sessionReplaced` (otra apertura de sesión
|
|
40
|
+
* para el mismo usuario). Si el `newSessionId` difiere de la sesión local,
|
|
41
|
+
* emite el evento de fin de sesión para forzar logout. Se ejecuta antes del
|
|
42
|
+
* filtro de allow-list porque no se re-emite al bus genérico.
|
|
43
|
+
* Devuelve `true` cuando consume el evento.
|
|
44
|
+
*/
|
|
45
|
+
private _handleSessionReplaced;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SseLiveConnectionService, never>;
|
|
47
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SseLiveConnectionService>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { SseLiveConnectionConfig } from '../interfaces/sse-live-connection.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Token con el que cada app provee su configuración del stream SSE.
|
|
5
|
+
* Sigue el mismo patrón que `ICON_RESOLVER`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SSE_LIVE_CONNECTION_CONFIG: InjectionToken<SseLiveConnectionConfig>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tuain-ng-forms-lib",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.4.0",
|
|
4
4
|
"description": "Componentes y Clases Angular para la gestión de formularios TUAIN",
|
|
5
5
|
"author": "Mauricio Méndez, Imix Consulting",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"rxjs": "^7.5.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
25
26
|
"nanoid": "^4.0.0",
|
|
26
27
|
"tslib": "^2.4.0",
|
|
27
28
|
"yn": "^5.0.0"
|
package/public-api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './lib/interfaces/index';
|
|
2
2
|
export * from './lib/tokens/icon-resolver.token';
|
|
3
|
+
export * from './lib/tokens/sse-live-connection.token';
|
|
3
4
|
export * from './lib/classes/forms/piece';
|
|
4
5
|
export * from './lib/classes/forms/piece-propagate';
|
|
5
6
|
export * from './lib/classes/forms/element';
|
|
@@ -30,4 +31,5 @@ export * from './lib/services/form-manager.service';
|
|
|
30
31
|
export * from './lib/services/file-manager.service';
|
|
31
32
|
export * from './lib/services/icon-dictionary.service';
|
|
32
33
|
export * from './lib/services/base-icon-resolver.service';
|
|
34
|
+
export * from './lib/services/sse-live-connection.service';
|
|
33
35
|
export * from './lib/tuain-ng-forms-lib.module';
|