@senior-gestao-empresarial/angular-components 6.9.3 → 6.10.1-45e0f1e8-c91b-4e67-be7f-f41b67b65e9b

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 (24) hide show
  1. package/bundles/senior-gestao-empresarial-angular-components.umd.js +106 -41
  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/conta-interna-filial-lookup.d.ts +8 -0
  6. package/components/lookups/entities/e-089-doc-lookup.d.ts +8 -0
  7. package/components/lookups/index.d.ts +2 -0
  8. package/components/websocket/websocket.service.d.ts +2 -3
  9. package/esm2015/components/lookups/entities/conta-interna-filial-lookup.js +54 -0
  10. package/esm2015/components/lookups/entities/e-089-doc-lookup.js +26 -0
  11. package/esm2015/components/lookups/erp-lookups.module.js +6 -2
  12. package/esm2015/components/lookups/index.js +3 -1
  13. package/esm2015/components/websocket/websocket.service.js +32 -35
  14. package/esm5/components/lookups/entities/conta-interna-filial-lookup.js +55 -0
  15. package/esm5/components/lookups/entities/e-089-doc-lookup.js +29 -0
  16. package/esm5/components/lookups/erp-lookups.module.js +6 -2
  17. package/esm5/components/lookups/index.js +3 -1
  18. package/esm5/components/websocket/websocket.service.js +33 -42
  19. package/fesm2015/senior-gestao-empresarial-angular-components.js +101 -36
  20. package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
  21. package/fesm5/senior-gestao-empresarial-angular-components.js +106 -43
  22. package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
  23. package/package.json +1 -1
  24. package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
@@ -6366,6 +6366,76 @@
6366
6366
  return EntityPersonProductLookup;
6367
6367
  }(ErpLookups));
6368
6368
 
6369
+ var defaultFields$2 = [
6370
+ { name: "numCco", type: angularComponents.FieldType.String },
6371
+ { name: "desCco", type: angularComponents.FieldType.String }
6372
+ ];
6373
+ var ContaInternaFilialLookup = /** @class */ (function (_super) {
6374
+ __extends(ContaInternaFilialLookup, _super);
6375
+ function ContaInternaFilialLookup(lookupService, translate) {
6376
+ var _this = _super.call(this, lookupService, translate, "contaInternaFilial", defaultFields$2, __spread(defaultFields$2, [
6377
+ {
6378
+ name: "e034tcc.aplTcc",
6379
+ type: angularComponents.FieldType.Enum,
6380
+ options: [
6381
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_1"), value: "V1" },
6382
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_2"), value: "V2" },
6383
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_9"), value: "V9" },
6384
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_10"), value: "V10" }
6385
+ ]
6386
+ }
6387
+ ]), __spread(defaultFields$2, [
6388
+ {
6389
+ name: "e034tcc.desTcc",
6390
+ type: angularComponents.FieldType.String
6391
+ },
6392
+ {
6393
+ name: "e034tcc.aplTcc",
6394
+ type: angularComponents.FieldType.Enum,
6395
+ options: [
6396
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_1"), value: "V1" },
6397
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_2"), value: "V2" },
6398
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_9"), value: "V9" },
6399
+ { label: translate.instant("erpx_fin.foundation.enum_tip_tcc_v_10"), value: "V10" }
6400
+ ]
6401
+ }
6402
+ ]), "erpx_fin", "foundation") || this;
6403
+ _this.lookupService = lookupService;
6404
+ _this.translate = translate;
6405
+ return _this;
6406
+ }
6407
+ ContaInternaFilialLookup.ctorParameters = function () { return [
6408
+ { type: ErpLookupsService },
6409
+ { type: core$1.TranslateService }
6410
+ ]; };
6411
+ ContaInternaFilialLookup = __decorate([
6412
+ core.Injectable()
6413
+ ], ContaInternaFilialLookup);
6414
+ return ContaInternaFilialLookup;
6415
+ }(ErpLookups));
6416
+
6417
+ var defaultFields$3 = [
6418
+ { name: "codDoc", type: angularComponents.FieldType.String },
6419
+ { name: "desDoc", type: angularComponents.FieldType.String }
6420
+ ];
6421
+ var E089DocLookup = /** @class */ (function (_super) {
6422
+ __extends(E089DocLookup, _super);
6423
+ function E089DocLookup(lookupService, translate) {
6424
+ var _this = _super.call(this, lookupService, translate, "e089doc", defaultFields$3, defaultFields$3, defaultFields$3, "erpx_fin", "foundation") || this;
6425
+ _this.lookupService = lookupService;
6426
+ _this.translate = translate;
6427
+ return _this;
6428
+ }
6429
+ E089DocLookup.ctorParameters = function () { return [
6430
+ { type: ErpLookupsService },
6431
+ { type: core$1.TranslateService }
6432
+ ]; };
6433
+ E089DocLookup = __decorate([
6434
+ core.Injectable()
6435
+ ], E089DocLookup);
6436
+ return E089DocLookup;
6437
+ }(ErpLookups));
6438
+
6369
6439
  var ErpLookupsModule = /** @class */ (function () {
6370
6440
  function ErpLookupsModule() {
6371
6441
  }
@@ -6481,7 +6551,9 @@
6481
6551
  AgreementLookup,
6482
6552
  NotaFiscalEntradaLookup,
6483
6553
  SegmentoLookup,
6484
- EntityPersonProductLookup
6554
+ EntityPersonProductLookup,
6555
+ ContaInternaFilialLookup,
6556
+ E089DocLookup
6485
6557
  ],
6486
6558
  declarations: [],
6487
6559
  exports: [],
@@ -7238,15 +7310,14 @@
7238
7310
  /** @private */
7239
7311
  this.primitiveManagers = new Map();
7240
7312
  /** @private */
7241
- this.connect$ = new rxjs.Subject();
7313
+ this.connected$ = new rxjs.BehaviorSubject(false);
7242
7314
  /** @private */
7243
7315
  this.disconnect$ = new rxjs.Subject();
7244
7316
  /** @private */
7245
7317
  this.reconnect$ = new rxjs.Subject();
7246
7318
  /** @private */
7247
7319
  this.error$ = new rxjs.Subject();
7248
- this.subscribe$ = new rxjs.Subject();
7249
- this.connect();
7320
+ this.subscribed$ = new rxjs.Subject();
7250
7321
  }
7251
7322
  WebsocketService_1 = WebsocketService;
7252
7323
  /**
@@ -7254,10 +7325,7 @@
7254
7325
  * @return Um `Observable<void>` que emite uma notificação quando a conexão websocket é estabelecida pela primeira vez.
7255
7326
  */
7256
7327
  WebsocketService.prototype.onConnect = function () {
7257
- if (this.isConnected || this.wasConnected) {
7258
- return rxjs.of(undefined).pipe(operators.take(1));
7259
- }
7260
- return this.connect$.asObservable().pipe(operators.take(1));
7328
+ return this.connected$.asObservable().pipe(operators.filter(Boolean), operators.map(function () { return undefined; }), operators.take(1));
7261
7329
  };
7262
7330
  /**
7263
7331
  * Observable responsável por emitir uma notificação quando a conexão é desconectada.
@@ -7282,12 +7350,14 @@
7282
7350
  var domain = _a.domain, service = _a.service, primitive = _a.primitive;
7283
7351
  var key = this.getPrimitiveManagerKey(domain, service, primitive);
7284
7352
  return this.onConnect().pipe(operators.switchMap(function () {
7285
- return _this.primitiveManagers.has(key) &&
7286
- _this.primitiveManagers.get(key).isSubscribed
7287
- ? rxjs.of(void 0).pipe(operators.take(1))
7288
- : _this.subscribe$.pipe(operators.filter(function (primitiveManager) {
7289
- return _this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive) === key;
7290
- }), operators.take(1), operators.map(function () { return void 0; }));
7353
+ if (_this.primitiveManagers.has(key))
7354
+ return _this.primitiveManagers
7355
+ .get(key)
7356
+ .subscribed$.asObservable()
7357
+ .pipe(operators.map(function () { return undefined; }), operators.take(1));
7358
+ return _this.subscribed$.asObservable().pipe(operators.filter(function (primitiveManager) {
7359
+ return _this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive) === key;
7360
+ }), operators.map(function () { return undefined; }), operators.take(1));
7291
7361
  }));
7292
7362
  };
7293
7363
  /**
@@ -7307,6 +7377,7 @@
7307
7377
  */
7308
7378
  WebsocketService.prototype.onEvent = function (options) {
7309
7379
  var _this = this;
7380
+ this.connect();
7310
7381
  var domain = options.domain, service = options.service, primitive = options.primitive;
7311
7382
  var key = this.getPrimitiveManagerKey(domain, service, primitive);
7312
7383
  if (this.primitiveManagers.has(key)) {
@@ -7318,30 +7389,17 @@
7318
7389
  primitive: primitive,
7319
7390
  stompSubscriptions: [],
7320
7391
  event$: new rxjs.Subject(),
7321
- isSubscribed: false
7392
+ subscribed$: new rxjs.BehaviorSubject(false)
7322
7393
  };
7323
7394
  this.primitiveManagers.set(key, primitiveManager);
7324
- if (this.isConnected) {
7325
- this.createStompSubscriptions(primitiveManager);
7326
- return primitiveManager.event$
7327
- .asObservable()
7328
- .pipe(operators.finalize(function () {
7329
- return _this.disconnectPrimitiveOnFinalize(primitiveManager);
7330
- }));
7331
- }
7332
- else {
7333
- if (!this.isConnecting) {
7334
- this.connect();
7335
- }
7336
- this.connect$.pipe(operators.first()).subscribe(function () {
7337
- _this.createStompSubscriptions(primitiveManager);
7338
- });
7339
- return primitiveManager.event$
7340
- .asObservable()
7341
- .pipe(operators.finalize(function () {
7342
- return _this.disconnectPrimitiveOnFinalize(primitiveManager);
7343
- }));
7344
- }
7395
+ this.onConnect()
7396
+ .pipe(operators.take(1))
7397
+ .subscribe(function () {
7398
+ _this.createStompSubscriptions(primitiveManager);
7399
+ });
7400
+ return primitiveManager.event$
7401
+ .asObservable()
7402
+ .pipe(operators.finalize(function () { return _this.disconnectPrimitiveOnFinalize(primitiveManager); }));
7345
7403
  };
7346
7404
  /** @private */
7347
7405
  WebsocketService.prototype.createStompSubscriptions = function (primitiveManager) {
@@ -7353,12 +7411,14 @@
7353
7411
  stompSubscriptionWithToken,
7354
7412
  stompSubscriptionWithoutToken
7355
7413
  ];
7356
- primitiveManager.isSubscribed = true;
7357
- this.subscribe$.next(primitiveManager);
7414
+ primitiveManager.subscribed$.next(true);
7415
+ this.subscribed$.next(primitiveManager);
7358
7416
  };
7359
7417
  /** @private */
7360
7418
  WebsocketService.prototype.connect = function () {
7361
7419
  var _this = this;
7420
+ if (this.isConnected || this.isConnecting)
7421
+ return;
7362
7422
  this.createStompClient();
7363
7423
  this.isConnecting = true;
7364
7424
  this._stompClient.connect({}, function () {
@@ -7366,15 +7426,16 @@
7366
7426
  _this.isConnected = true;
7367
7427
  if (_this.wasConnected) {
7368
7428
  _this.reconnectPrimitives();
7369
- _this.connect$.next();
7429
+ _this.connected$.next(true);
7370
7430
  _this.reconnect$.next();
7371
7431
  }
7372
7432
  else {
7373
7433
  _this.wasConnected = true;
7374
- _this.connect$.next();
7434
+ _this.connected$.next(true);
7375
7435
  }
7376
7436
  }, function (error) {
7377
7437
  _this.isConnected = false;
7438
+ _this.connected$.next(false);
7378
7439
  _this.error$.next(error);
7379
7440
  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
7441
  return rxjs.iif(function () { return document.hidden; }, rxjs.fromEvent(document, 'visibilitychange').pipe(operators.first()), rxjs.of(void 0));
@@ -7393,7 +7454,7 @@
7393
7454
  };
7394
7455
  WebsocketService.prototype.disconnect = function () {
7395
7456
  var e_1, _a, e_2, _b, e_3, _c;
7396
- if (this.getObserversCount() > 0) {
7457
+ if (!this.isConnected || this.getObserversCount() > 0) {
7397
7458
  return;
7398
7459
  }
7399
7460
  try {
@@ -7440,6 +7501,7 @@
7440
7501
  this.isConnected = false;
7441
7502
  this.isConnecting = false;
7442
7503
  this.wasConnected = false;
7504
+ this.connected$.next(false);
7443
7505
  this.disconnect$.next();
7444
7506
  };
7445
7507
  /** @private */
@@ -7529,6 +7591,7 @@
7529
7591
  }
7530
7592
  finally { if (e_6) throw e_6.error; }
7531
7593
  }
7594
+ primitiveManager.subscribed$.complete();
7532
7595
  var key = this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
7533
7596
  this.primitiveManagers.delete(key);
7534
7597
  this.disconnect();
@@ -7637,6 +7700,7 @@
7637
7700
  exports.BreadcrumbComponent = BreadcrumbComponent;
7638
7701
  exports.BreadcrumbModule = BreadcrumbModule;
7639
7702
  exports.Breakpoints = Breakpoints;
7703
+ exports.ContaInternaFilialLookup = ContaInternaFilialLookup;
7640
7704
  exports.CountryLookup = CountryLookup;
7641
7705
  exports.CplTriNotaSaidaE001EndLookup = CplTriNotaSaidaE001EndLookup;
7642
7706
  exports.CplTriNotaSaidaE001PesLookup = CplTriNotaSaidaE001PesLookup;
@@ -7705,6 +7769,7 @@
7705
7769
  exports.E081TabLookup = E081TabLookup;
7706
7770
  exports.E082TprLookup = E082TprLookup;
7707
7771
  exports.E085PesLookup = E085PesLookup;
7772
+ exports.E089DocLookup = E089DocLookup;
7708
7773
  exports.E090HrpComGerLookup = E090HrpComGerLookup;
7709
7774
  exports.E090PesLookup = E090PesLookup;
7710
7775
  exports.E091PlfFinRatLookup = E091PlfFinRatLookup;