@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.
Files changed (21) hide show
  1. package/bundles/senior-gestao-empresarial-angular-components.umd.js +99 -32
  2. package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
  3. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +1 -1
  4. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
  5. package/components/lookups/entities/xt-integration/entity-person-product-lookup.d.ts +8 -0
  6. package/components/websocket/websocket.service.d.ts +5 -9
  7. package/esm2015/components/lookups/entities/xt-integration/entity-person-product-lookup.js +49 -0
  8. package/esm2015/components/lookups/erp-lookups.module.js +4 -2
  9. package/esm2015/components/websocket/websocket.service.js +49 -34
  10. package/esm2015/senior-gestao-empresarial-angular-components.js +4 -3
  11. package/esm5/components/lookups/entities/xt-integration/entity-person-product-lookup.js +52 -0
  12. package/esm5/components/lookups/erp-lookups.module.js +4 -2
  13. package/esm5/components/websocket/websocket.service.js +56 -36
  14. package/esm5/senior-gestao-empresarial-angular-components.js +4 -3
  15. package/fesm2015/senior-gestao-empresarial-angular-components.js +88 -30
  16. package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
  17. package/fesm5/senior-gestao-empresarial-angular-components.js +98 -32
  18. package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
  19. package/package.json +1 -1
  20. package/senior-gestao-empresarial-angular-components.d.ts +3 -2
  21. package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
@@ -6321,6 +6321,51 @@
6321
6321
  return SegmentoLookup;
6322
6322
  }(ErpLookups));
6323
6323
 
6324
+ var EntityPersonProductLookup = /** @class */ (function (_super) {
6325
+ __extends(EntityPersonProductLookup, _super);
6326
+ function EntityPersonProductLookup(lookupService, translate) {
6327
+ var _this = _super.call(this, lookupService, translate, "entityFacade", [
6328
+ {
6329
+ name: "entityCode",
6330
+ type: angularComponents.FieldType.String
6331
+ },
6332
+ {
6333
+ name: "entityDesc",
6334
+ type: angularComponents.FieldType.String
6335
+ },
6336
+ ], [
6337
+ {
6338
+ name: "entityCode",
6339
+ type: angularComponents.FieldType.String
6340
+ },
6341
+ {
6342
+ name: "entityDesc",
6343
+ type: angularComponents.FieldType.String
6344
+ },
6345
+ ], [
6346
+ {
6347
+ name: "entityCode",
6348
+ type: angularComponents.FieldType.String
6349
+ },
6350
+ {
6351
+ name: "entityDesc",
6352
+ type: angularComponents.FieldType.String
6353
+ },
6354
+ ], "erpx_cpl_xt", "integration") || this;
6355
+ _this.lookupService = lookupService;
6356
+ _this.translate = translate;
6357
+ return _this;
6358
+ }
6359
+ EntityPersonProductLookup.ctorParameters = function () { return [
6360
+ { type: ErpLookupsService },
6361
+ { type: core$1.TranslateService }
6362
+ ]; };
6363
+ EntityPersonProductLookup = __decorate([
6364
+ core.Injectable()
6365
+ ], EntityPersonProductLookup);
6366
+ return EntityPersonProductLookup;
6367
+ }(ErpLookups));
6368
+
6324
6369
  var ErpLookupsModule = /** @class */ (function () {
6325
6370
  function ErpLookupsModule() {
6326
6371
  }
@@ -6435,7 +6480,8 @@
6435
6480
  E501TcpLookup,
6436
6481
  AgreementLookup,
6437
6482
  NotaFiscalEntradaLookup,
6438
- SegmentoLookup
6483
+ SegmentoLookup,
6484
+ EntityPersonProductLookup
6439
6485
  ],
6440
6486
  declarations: [],
6441
6487
  exports: [],
@@ -7190,8 +7236,6 @@
7190
7236
  /** @private */
7191
7237
  this.isConnecting = false;
7192
7238
  /** @private */
7193
- this.isReconnecting = false;
7194
- /** @private */
7195
7239
  this.primitiveManagers = new Map();
7196
7240
  /** @private */
7197
7241
  this.connect$ = new rxjs.Subject();
@@ -7238,11 +7282,12 @@
7238
7282
  var domain = _a.domain, service = _a.service, primitive = _a.primitive;
7239
7283
  var key = this.getPrimitiveManagerKey(domain, service, primitive);
7240
7284
  return this.onConnect().pipe(operators.switchMap(function () {
7241
- return _this.primitiveManagers.has(key) && _this.primitiveManagers.get(key).isSubscribed
7285
+ return _this.primitiveManagers.has(key) &&
7286
+ _this.primitiveManagers.get(key).isSubscribed
7242
7287
  ? rxjs.of(void 0).pipe(operators.take(1))
7243
7288
  : _this.subscribe$.pipe(operators.filter(function (primitiveManager) {
7244
7289
  return _this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive) === key;
7245
- }), operators.take(1), (operators.map(function () { return void 0; })));
7290
+ }), operators.take(1), operators.map(function () { return void 0; }));
7246
7291
  }));
7247
7292
  };
7248
7293
  /**
@@ -7273,21 +7318,29 @@
7273
7318
  primitive: primitive,
7274
7319
  stompSubscriptions: [],
7275
7320
  event$: new rxjs.Subject(),
7276
- isSubscribed: false,
7321
+ isSubscribed: false
7277
7322
  };
7278
7323
  this.primitiveManagers.set(key, primitiveManager);
7279
7324
  if (this.isConnected) {
7280
7325
  this.createStompSubscriptions(primitiveManager);
7281
- return primitiveManager.event$.asObservable().pipe(operators.finalize(function () { return _this.disconnectPrimitiveOnFinalize(primitiveManager); }));
7326
+ return primitiveManager.event$
7327
+ .asObservable()
7328
+ .pipe(operators.finalize(function () {
7329
+ return _this.disconnectPrimitiveOnFinalize(primitiveManager);
7330
+ }));
7282
7331
  }
7283
7332
  else {
7284
- if (!this.isReconnecting && !this.isConnecting) {
7333
+ if (!this.isConnecting) {
7285
7334
  this.connect();
7286
7335
  }
7287
7336
  this.connect$.pipe(operators.first()).subscribe(function () {
7288
7337
  _this.createStompSubscriptions(primitiveManager);
7289
7338
  });
7290
- return primitiveManager.event$.asObservable().pipe(operators.finalize(function () { return _this.disconnectPrimitiveOnFinalize(primitiveManager); }));
7339
+ return primitiveManager.event$
7340
+ .asObservable()
7341
+ .pipe(operators.finalize(function () {
7342
+ return _this.disconnectPrimitiveOnFinalize(primitiveManager);
7343
+ }));
7291
7344
  }
7292
7345
  };
7293
7346
  /** @private */
@@ -7296,7 +7349,10 @@
7296
7349
  var stompSubscriptionWithToken = this.createStompSubscription(withTokenUrl, primitiveManager);
7297
7350
  var withoutTokenUrl = this.getSubscriptionUrlWithoutToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
7298
7351
  var stompSubscriptionWithoutToken = this.createStompSubscription(withoutTokenUrl, primitiveManager);
7299
- primitiveManager.stompSubscriptions = [stompSubscriptionWithToken, stompSubscriptionWithoutToken];
7352
+ primitiveManager.stompSubscriptions = [
7353
+ stompSubscriptionWithToken,
7354
+ stompSubscriptionWithoutToken
7355
+ ];
7300
7356
  primitiveManager.isSubscribed = true;
7301
7357
  this.subscribe$.next(primitiveManager);
7302
7358
  };
@@ -7307,7 +7363,6 @@
7307
7363
  this.isConnecting = true;
7308
7364
  this._stompClient.connect({}, function () {
7309
7365
  _this.isConnecting = false;
7310
- _this.isReconnecting = false;
7311
7366
  _this.isConnected = true;
7312
7367
  if (_this.wasConnected) {
7313
7368
  _this.reconnectPrimitives();
@@ -7321,19 +7376,26 @@
7321
7376
  }, function (error) {
7322
7377
  _this.isConnected = false;
7323
7378
  _this.error$.next(error);
7324
- _this.isReconnecting = true;
7325
- rxjs.timer(WebsocketService_1.RECONNECT_INTERVAL)
7326
- .pipe(operators.switchMap(function () {
7327
- return rxjs.iif(function () { return document.hidden; }, rxjs.fromEvent(document, "visibilitychange").pipe(operators.first()), rxjs.EMPTY);
7328
- }))
7329
- .subscribe({ complete: function () { return _this.connect(); } });
7379
+ rxjs.race(_this.disconnect$.pipe(operators.take(1), operators.map(function () { return ({ wasDisconnected: true }); })), rxjs.timer(WebsocketService_1.RECONNECT_INTERVAL).pipe(operators.take(1), operators.switchMap(function () {
7380
+ return rxjs.iif(function () { return document.hidden; }, rxjs.fromEvent(document, 'visibilitychange').pipe(operators.first()), rxjs.of(void 0));
7381
+ }), operators.map(function () { return ({ wasDisconnected: false }); })))
7382
+ .pipe(operators.take(1))
7383
+ .subscribe({
7384
+ next: function (_a) {
7385
+ var wasDisconnected = _a.wasDisconnected;
7386
+ if (!wasDisconnected &&
7387
+ !(_this.isConnected || _this.isConnecting)) {
7388
+ _this.connect();
7389
+ }
7390
+ }
7391
+ });
7330
7392
  });
7331
7393
  };
7332
7394
  WebsocketService.prototype.disconnect = function () {
7333
7395
  var e_1, _a, e_2, _b, e_3, _c;
7334
- var observersCount = this.getObserversCount();
7335
- if (observersCount > 0)
7396
+ if (this.getObserversCount() > 0) {
7336
7397
  return;
7398
+ }
7337
7399
  try {
7338
7400
  for (var _d = __values(this.primitiveManagers.values()), _e = _d.next(); !_e.done; _e = _d.next()) {
7339
7401
  var primitiveManager = _e.value;
@@ -7382,19 +7444,25 @@
7382
7444
  };
7383
7445
  /** @private */
7384
7446
  WebsocketService.prototype.getSubscriptionUrlWithToken = function (domain, service, primitive) {
7385
- var tenant = WebsocketService_1.TOKEN ? WebsocketService_1.TOKEN.username.split("@")[1] : null;
7386
- var token = WebsocketService_1.TOKEN ? WebsocketService_1.TOKEN.access_token : null;
7447
+ var tenant = WebsocketService_1.TOKEN
7448
+ ? WebsocketService_1.TOKEN.username.split('@')[1]
7449
+ : null;
7450
+ var token = WebsocketService_1.TOKEN
7451
+ ? WebsocketService_1.TOKEN.access_token
7452
+ : null;
7387
7453
  return "/topic/" + tenant + "/" + token + "/" + domain + "/" + service + "/" + primitive;
7388
7454
  };
7389
7455
  /** @private */
7390
7456
  WebsocketService.prototype.getSubscriptionUrlWithoutToken = function (domain, service, primitive) {
7391
- var tenant = WebsocketService_1.TOKEN ? WebsocketService_1.TOKEN.username.split("@")[1] : null;
7457
+ var tenant = WebsocketService_1.TOKEN
7458
+ ? WebsocketService_1.TOKEN.username.split('@')[1]
7459
+ : null;
7392
7460
  return "/topic/" + tenant + "/" + domain + "/" + service + "/" + primitive;
7393
7461
  };
7394
7462
  /** @private */
7395
7463
  WebsocketService.prototype.createStompSubscription = function (destination, primitiveManager) {
7396
7464
  return this._stompClient.subscribe(destination, function (message) {
7397
- var event = JSON.parse(message.body || "{}");
7465
+ var event = JSON.parse(message.body || '{}');
7398
7466
  primitiveManager.event$.next(event);
7399
7467
  });
7400
7468
  };
@@ -7470,22 +7538,20 @@
7470
7538
  return domain + "/" + service + "/" + primitive;
7471
7539
  };
7472
7540
  var WebsocketService_1;
7473
- /** @private */
7474
7541
  WebsocketService.RECONNECT_INTERVAL = 3000;
7475
- /** @private */
7476
7542
  WebsocketService.CONNECTION_TIMEOUT = 15000;
7477
7543
  /** @private */
7478
- WebsocketService.BASE_URL_COOKIE = "com.senior.base.url";
7544
+ WebsocketService.BASE_URL_COOKIE = 'com.senior.base.url';
7479
7545
  /** @private */
7480
- WebsocketService.TOKEN_COOKIE = "com.senior.token";
7546
+ WebsocketService.TOKEN_COOKIE = 'com.senior.token';
7481
7547
  /** @private */
7482
- WebsocketService.TOKEN = JSON.parse(jsCookie.get(WebsocketService_1.TOKEN_COOKIE) || "{}");
7548
+ WebsocketService.TOKEN = JSON.parse(jsCookie.get(WebsocketService_1.TOKEN_COOKIE) || '{}');
7483
7549
  /** @private */
7484
- WebsocketService.WEBSOCKET_URL = jsCookie.get(WebsocketService_1.BASE_URL_COOKIE) + "/websocket/";
7550
+ WebsocketService.WEBSOCKET_URL = jsCookie.get(WebsocketService_1.BASE_URL_COOKIE) + '/websocket/';
7485
7551
  WebsocketService.ɵprov = core.ɵɵdefineInjectable({ factory: function WebsocketService_Factory() { return new WebsocketService(); }, token: WebsocketService, providedIn: "root" });
7486
7552
  WebsocketService = WebsocketService_1 = __decorate([
7487
7553
  core.Injectable({
7488
- providedIn: "root",
7554
+ providedIn: 'root'
7489
7555
  })
7490
7556
  ], WebsocketService);
7491
7557
  return WebsocketService;
@@ -7686,8 +7752,9 @@
7686
7752
  exports.naturezaReceitaPisCofins = naturezaReceitaPisCofins;
7687
7753
  exports.ɵ0 = ɵ0;
7688
7754
  exports.ɵa = ErpLookupsService;
7689
- exports.ɵb = StorageService;
7690
- exports.ɵc = VerifyModulePermissionService;
7755
+ exports.ɵb = EntityPersonProductLookup;
7756
+ exports.ɵc = StorageService;
7757
+ exports.ɵd = VerifyModulePermissionService;
7691
7758
 
7692
7759
  Object.defineProperty(exports, '__esModule', { value: true });
7693
7760