@senior-gestao-empresarial/angular-components 6.9.0 → 6.9.2
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/bundles/senior-gestao-empresarial-angular-components.umd.js +99 -32
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/lookups/entities/xt-integration/entity-person-product-lookup.d.ts +8 -0
- package/components/websocket/websocket.service.d.ts +5 -9
- package/esm2015/components/lookups/entities/xt-integration/entity-person-product-lookup.js +49 -0
- package/esm2015/components/lookups/erp-lookups.module.js +4 -2
- package/esm2015/components/websocket/websocket.service.js +49 -34
- package/esm2015/senior-gestao-empresarial-angular-components.js +4 -3
- package/esm5/components/lookups/entities/xt-integration/entity-person-product-lookup.js +52 -0
- package/esm5/components/lookups/erp-lookups.module.js +4 -2
- package/esm5/components/websocket/websocket.service.js +56 -36
- package/esm5/senior-gestao-empresarial-angular-components.js +4 -3
- package/fesm2015/senior-gestao-empresarial-angular-components.js +88 -30
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +98 -32
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-angular-components.d.ts +3 -2
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -3,7 +3,7 @@ import { Input, Component, NgModule, Injectable, Inject, ɵɵdefineInjectable,
|
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
5
5
|
import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
|
-
import { Subject, throwError, interval, of, timer, iif, fromEvent,
|
|
6
|
+
import { Subject, throwError, interval, of, race, timer, iif, fromEvent, ReplaySubject } from 'rxjs';
|
|
7
7
|
import { takeUntil, filter, catchError, map, takeWhile, switchMap, take, finalize, first } from 'rxjs/operators';
|
|
8
8
|
import * as moment_ from 'moment';
|
|
9
9
|
import { FormField, FieldType } from '@seniorsistemas/angular-components';
|
|
@@ -6115,6 +6115,51 @@ var SegmentoLookup = /** @class */ (function (_super) {
|
|
|
6115
6115
|
return SegmentoLookup;
|
|
6116
6116
|
}(ErpLookups));
|
|
6117
6117
|
|
|
6118
|
+
var EntityPersonProductLookup = /** @class */ (function (_super) {
|
|
6119
|
+
__extends(EntityPersonProductLookup, _super);
|
|
6120
|
+
function EntityPersonProductLookup(lookupService, translate) {
|
|
6121
|
+
var _this = _super.call(this, lookupService, translate, "entityFacade", [
|
|
6122
|
+
{
|
|
6123
|
+
name: "entityCode",
|
|
6124
|
+
type: FieldType.String
|
|
6125
|
+
},
|
|
6126
|
+
{
|
|
6127
|
+
name: "entityDesc",
|
|
6128
|
+
type: FieldType.String
|
|
6129
|
+
},
|
|
6130
|
+
], [
|
|
6131
|
+
{
|
|
6132
|
+
name: "entityCode",
|
|
6133
|
+
type: FieldType.String
|
|
6134
|
+
},
|
|
6135
|
+
{
|
|
6136
|
+
name: "entityDesc",
|
|
6137
|
+
type: FieldType.String
|
|
6138
|
+
},
|
|
6139
|
+
], [
|
|
6140
|
+
{
|
|
6141
|
+
name: "entityCode",
|
|
6142
|
+
type: FieldType.String
|
|
6143
|
+
},
|
|
6144
|
+
{
|
|
6145
|
+
name: "entityDesc",
|
|
6146
|
+
type: FieldType.String
|
|
6147
|
+
},
|
|
6148
|
+
], "erpx_cpl_xt", "integration") || this;
|
|
6149
|
+
_this.lookupService = lookupService;
|
|
6150
|
+
_this.translate = translate;
|
|
6151
|
+
return _this;
|
|
6152
|
+
}
|
|
6153
|
+
EntityPersonProductLookup.ctorParameters = function () { return [
|
|
6154
|
+
{ type: ErpLookupsService },
|
|
6155
|
+
{ type: TranslateService }
|
|
6156
|
+
]; };
|
|
6157
|
+
EntityPersonProductLookup = __decorate([
|
|
6158
|
+
Injectable()
|
|
6159
|
+
], EntityPersonProductLookup);
|
|
6160
|
+
return EntityPersonProductLookup;
|
|
6161
|
+
}(ErpLookups));
|
|
6162
|
+
|
|
6118
6163
|
var ErpLookupsModule = /** @class */ (function () {
|
|
6119
6164
|
function ErpLookupsModule() {
|
|
6120
6165
|
}
|
|
@@ -6229,7 +6274,8 @@ var ErpLookupsModule = /** @class */ (function () {
|
|
|
6229
6274
|
E501TcpLookup,
|
|
6230
6275
|
AgreementLookup,
|
|
6231
6276
|
NotaFiscalEntradaLookup,
|
|
6232
|
-
SegmentoLookup
|
|
6277
|
+
SegmentoLookup,
|
|
6278
|
+
EntityPersonProductLookup
|
|
6233
6279
|
],
|
|
6234
6280
|
declarations: [],
|
|
6235
6281
|
exports: [],
|
|
@@ -6984,8 +7030,6 @@ var WebsocketService = /** @class */ (function () {
|
|
|
6984
7030
|
/** @private */
|
|
6985
7031
|
this.isConnecting = false;
|
|
6986
7032
|
/** @private */
|
|
6987
|
-
this.isReconnecting = false;
|
|
6988
|
-
/** @private */
|
|
6989
7033
|
this.primitiveManagers = new Map();
|
|
6990
7034
|
/** @private */
|
|
6991
7035
|
this.connect$ = new Subject();
|
|
@@ -7032,11 +7076,12 @@ var WebsocketService = /** @class */ (function () {
|
|
|
7032
7076
|
var domain = _a.domain, service = _a.service, primitive = _a.primitive;
|
|
7033
7077
|
var key = this.getPrimitiveManagerKey(domain, service, primitive);
|
|
7034
7078
|
return this.onConnect().pipe(switchMap(function () {
|
|
7035
|
-
return _this.primitiveManagers.has(key) &&
|
|
7079
|
+
return _this.primitiveManagers.has(key) &&
|
|
7080
|
+
_this.primitiveManagers.get(key).isSubscribed
|
|
7036
7081
|
? of(void 0).pipe(take(1))
|
|
7037
7082
|
: _this.subscribe$.pipe(filter(function (primitiveManager) {
|
|
7038
7083
|
return _this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive) === key;
|
|
7039
|
-
}), take(1),
|
|
7084
|
+
}), take(1), map(function () { return void 0; }));
|
|
7040
7085
|
}));
|
|
7041
7086
|
};
|
|
7042
7087
|
/**
|
|
@@ -7067,21 +7112,29 @@ var WebsocketService = /** @class */ (function () {
|
|
|
7067
7112
|
primitive: primitive,
|
|
7068
7113
|
stompSubscriptions: [],
|
|
7069
7114
|
event$: new Subject(),
|
|
7070
|
-
isSubscribed: false
|
|
7115
|
+
isSubscribed: false
|
|
7071
7116
|
};
|
|
7072
7117
|
this.primitiveManagers.set(key, primitiveManager);
|
|
7073
7118
|
if (this.isConnected) {
|
|
7074
7119
|
this.createStompSubscriptions(primitiveManager);
|
|
7075
|
-
return primitiveManager.event
|
|
7120
|
+
return primitiveManager.event$
|
|
7121
|
+
.asObservable()
|
|
7122
|
+
.pipe(finalize(function () {
|
|
7123
|
+
return _this.disconnectPrimitiveOnFinalize(primitiveManager);
|
|
7124
|
+
}));
|
|
7076
7125
|
}
|
|
7077
7126
|
else {
|
|
7078
|
-
if (!this.
|
|
7127
|
+
if (!this.isConnecting) {
|
|
7079
7128
|
this.connect();
|
|
7080
7129
|
}
|
|
7081
7130
|
this.connect$.pipe(first()).subscribe(function () {
|
|
7082
7131
|
_this.createStompSubscriptions(primitiveManager);
|
|
7083
7132
|
});
|
|
7084
|
-
return primitiveManager.event
|
|
7133
|
+
return primitiveManager.event$
|
|
7134
|
+
.asObservable()
|
|
7135
|
+
.pipe(finalize(function () {
|
|
7136
|
+
return _this.disconnectPrimitiveOnFinalize(primitiveManager);
|
|
7137
|
+
}));
|
|
7085
7138
|
}
|
|
7086
7139
|
};
|
|
7087
7140
|
/** @private */
|
|
@@ -7090,7 +7143,10 @@ var WebsocketService = /** @class */ (function () {
|
|
|
7090
7143
|
var stompSubscriptionWithToken = this.createStompSubscription(withTokenUrl, primitiveManager);
|
|
7091
7144
|
var withoutTokenUrl = this.getSubscriptionUrlWithoutToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7092
7145
|
var stompSubscriptionWithoutToken = this.createStompSubscription(withoutTokenUrl, primitiveManager);
|
|
7093
|
-
primitiveManager.stompSubscriptions = [
|
|
7146
|
+
primitiveManager.stompSubscriptions = [
|
|
7147
|
+
stompSubscriptionWithToken,
|
|
7148
|
+
stompSubscriptionWithoutToken
|
|
7149
|
+
];
|
|
7094
7150
|
primitiveManager.isSubscribed = true;
|
|
7095
7151
|
this.subscribe$.next(primitiveManager);
|
|
7096
7152
|
};
|
|
@@ -7101,7 +7157,6 @@ var WebsocketService = /** @class */ (function () {
|
|
|
7101
7157
|
this.isConnecting = true;
|
|
7102
7158
|
this._stompClient.connect({}, function () {
|
|
7103
7159
|
_this.isConnecting = false;
|
|
7104
|
-
_this.isReconnecting = false;
|
|
7105
7160
|
_this.isConnected = true;
|
|
7106
7161
|
if (_this.wasConnected) {
|
|
7107
7162
|
_this.reconnectPrimitives();
|
|
@@ -7115,19 +7170,26 @@ var WebsocketService = /** @class */ (function () {
|
|
|
7115
7170
|
}, function (error) {
|
|
7116
7171
|
_this.isConnected = false;
|
|
7117
7172
|
_this.error$.next(error);
|
|
7118
|
-
_this.
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7173
|
+
race(_this.disconnect$.pipe(take(1), map(function () { return ({ wasDisconnected: true }); })), timer(WebsocketService_1.RECONNECT_INTERVAL).pipe(take(1), switchMap(function () {
|
|
7174
|
+
return iif(function () { return document.hidden; }, fromEvent(document, 'visibilitychange').pipe(first()), of(void 0));
|
|
7175
|
+
}), map(function () { return ({ wasDisconnected: false }); })))
|
|
7176
|
+
.pipe(take(1))
|
|
7177
|
+
.subscribe({
|
|
7178
|
+
next: function (_a) {
|
|
7179
|
+
var wasDisconnected = _a.wasDisconnected;
|
|
7180
|
+
if (!wasDisconnected &&
|
|
7181
|
+
!(_this.isConnected || _this.isConnecting)) {
|
|
7182
|
+
_this.connect();
|
|
7183
|
+
}
|
|
7184
|
+
}
|
|
7185
|
+
});
|
|
7124
7186
|
});
|
|
7125
7187
|
};
|
|
7126
7188
|
WebsocketService.prototype.disconnect = function () {
|
|
7127
7189
|
var e_1, _a, e_2, _b, e_3, _c;
|
|
7128
|
-
|
|
7129
|
-
if (observersCount > 0)
|
|
7190
|
+
if (this.getObserversCount() > 0) {
|
|
7130
7191
|
return;
|
|
7192
|
+
}
|
|
7131
7193
|
try {
|
|
7132
7194
|
for (var _d = __values(this.primitiveManagers.values()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
7133
7195
|
var primitiveManager = _e.value;
|
|
@@ -7176,19 +7238,25 @@ var WebsocketService = /** @class */ (function () {
|
|
|
7176
7238
|
};
|
|
7177
7239
|
/** @private */
|
|
7178
7240
|
WebsocketService.prototype.getSubscriptionUrlWithToken = function (domain, service, primitive) {
|
|
7179
|
-
var tenant = WebsocketService_1.TOKEN
|
|
7180
|
-
|
|
7241
|
+
var tenant = WebsocketService_1.TOKEN
|
|
7242
|
+
? WebsocketService_1.TOKEN.username.split('@')[1]
|
|
7243
|
+
: null;
|
|
7244
|
+
var token = WebsocketService_1.TOKEN
|
|
7245
|
+
? WebsocketService_1.TOKEN.access_token
|
|
7246
|
+
: null;
|
|
7181
7247
|
return "/topic/" + tenant + "/" + token + "/" + domain + "/" + service + "/" + primitive;
|
|
7182
7248
|
};
|
|
7183
7249
|
/** @private */
|
|
7184
7250
|
WebsocketService.prototype.getSubscriptionUrlWithoutToken = function (domain, service, primitive) {
|
|
7185
|
-
var tenant = WebsocketService_1.TOKEN
|
|
7251
|
+
var tenant = WebsocketService_1.TOKEN
|
|
7252
|
+
? WebsocketService_1.TOKEN.username.split('@')[1]
|
|
7253
|
+
: null;
|
|
7186
7254
|
return "/topic/" + tenant + "/" + domain + "/" + service + "/" + primitive;
|
|
7187
7255
|
};
|
|
7188
7256
|
/** @private */
|
|
7189
7257
|
WebsocketService.prototype.createStompSubscription = function (destination, primitiveManager) {
|
|
7190
7258
|
return this._stompClient.subscribe(destination, function (message) {
|
|
7191
|
-
var event = JSON.parse(message.body ||
|
|
7259
|
+
var event = JSON.parse(message.body || '{}');
|
|
7192
7260
|
primitiveManager.event$.next(event);
|
|
7193
7261
|
});
|
|
7194
7262
|
};
|
|
@@ -7264,22 +7332,20 @@ var WebsocketService = /** @class */ (function () {
|
|
|
7264
7332
|
return domain + "/" + service + "/" + primitive;
|
|
7265
7333
|
};
|
|
7266
7334
|
var WebsocketService_1;
|
|
7267
|
-
/** @private */
|
|
7268
7335
|
WebsocketService.RECONNECT_INTERVAL = 3000;
|
|
7269
|
-
/** @private */
|
|
7270
7336
|
WebsocketService.CONNECTION_TIMEOUT = 15000;
|
|
7271
7337
|
/** @private */
|
|
7272
|
-
WebsocketService.BASE_URL_COOKIE =
|
|
7338
|
+
WebsocketService.BASE_URL_COOKIE = 'com.senior.base.url';
|
|
7273
7339
|
/** @private */
|
|
7274
|
-
WebsocketService.TOKEN_COOKIE =
|
|
7340
|
+
WebsocketService.TOKEN_COOKIE = 'com.senior.token';
|
|
7275
7341
|
/** @private */
|
|
7276
|
-
WebsocketService.TOKEN = JSON.parse(get(WebsocketService_1.TOKEN_COOKIE) ||
|
|
7342
|
+
WebsocketService.TOKEN = JSON.parse(get(WebsocketService_1.TOKEN_COOKIE) || '{}');
|
|
7277
7343
|
/** @private */
|
|
7278
|
-
WebsocketService.WEBSOCKET_URL = get(WebsocketService_1.BASE_URL_COOKIE) +
|
|
7344
|
+
WebsocketService.WEBSOCKET_URL = get(WebsocketService_1.BASE_URL_COOKIE) + '/websocket/';
|
|
7279
7345
|
WebsocketService.ɵprov = ɵɵdefineInjectable({ factory: function WebsocketService_Factory() { return new WebsocketService(); }, token: WebsocketService, providedIn: "root" });
|
|
7280
7346
|
WebsocketService = WebsocketService_1 = __decorate([
|
|
7281
7347
|
Injectable({
|
|
7282
|
-
providedIn:
|
|
7348
|
+
providedIn: 'root'
|
|
7283
7349
|
})
|
|
7284
7350
|
], WebsocketService);
|
|
7285
7351
|
return WebsocketService;
|
|
@@ -7363,5 +7429,5 @@ var ModulesEnum;
|
|
|
7363
7429
|
* Generated bundle index. Do not edit.
|
|
7364
7430
|
*/
|
|
7365
7431
|
|
|
7366
|
-
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa,
|
|
7432
|
+
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa, EntityPersonProductLookup as ɵb, StorageService as ɵc, VerifyModulePermissionService as ɵd };
|
|
7367
7433
|
//# sourceMappingURL=senior-gestao-empresarial-angular-components.js.map
|