@senior-gestao-empresarial/angular-components 7.22.0 → 7.23.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/bundles/senior-gestao-empresarial-angular-components.umd.js +441 -3
  2. package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
  3. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +2 -2
  4. package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
  5. package/components/global-filter/global-filter-modal/global-filter-modal.component.d.ts +41 -0
  6. package/components/global-filter/global-filter.component.d.ts +61 -0
  7. package/components/global-filter/global-filter.module.d.ts +2 -0
  8. package/components/global-filter/global-filter.service.d.ts +54 -0
  9. package/components/global-filter/index.d.ts +3 -0
  10. package/components/lookups/fallback.d.ts +80 -0
  11. package/components/lookups/index.d.ts +1 -0
  12. package/components/storage/filters-storage.service.d.ts +2 -1
  13. package/esm2015/components/global-filter/global-filter-modal/global-filter-modal.component.js +124 -0
  14. package/esm2015/components/global-filter/global-filter.component.js +120 -0
  15. package/esm2015/components/global-filter/global-filter.module.js +29 -0
  16. package/esm2015/components/global-filter/global-filter.service.js +74 -0
  17. package/esm2015/components/global-filter/index.js +4 -0
  18. package/esm2015/components/lookups/fallback.js +81 -0
  19. package/esm2015/components/lookups/index.js +2 -1
  20. package/esm2015/components/storage/filters-storage.service.js +7 -2
  21. package/esm2015/public-api.js +2 -1
  22. package/esm2015/senior-gestao-empresarial-angular-components.js +4 -1
  23. package/esm5/components/global-filter/global-filter-modal/global-filter-modal.component.js +124 -0
  24. package/esm5/components/global-filter/global-filter.component.js +135 -0
  25. package/esm5/components/global-filter/global-filter.module.js +32 -0
  26. package/esm5/components/global-filter/global-filter.service.js +87 -0
  27. package/esm5/components/global-filter/index.js +4 -0
  28. package/esm5/components/lookups/fallback.js +81 -0
  29. package/esm5/components/lookups/index.js +2 -1
  30. package/esm5/components/storage/filters-storage.service.js +12 -5
  31. package/esm5/public-api.js +2 -1
  32. package/esm5/senior-gestao-empresarial-angular-components.js +4 -1
  33. package/fesm2015/senior-gestao-empresarial-angular-components.js +402 -5
  34. package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
  35. package/fesm5/senior-gestao-empresarial-angular-components.js +437 -7
  36. package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
  37. package/package.json +1 -1
  38. package/public-api.d.ts +1 -0
  39. package/senior-gestao-empresarial-angular-components.d.ts +3 -0
  40. package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
@@ -7571,6 +7571,87 @@
7571
7571
  return DfeEventoLookup;
7572
7572
  }(ErpLookups));
7573
7573
 
7574
+ var fallback = {
7575
+ "Entidades": "",
7576
+ "erpx_fnd.empresa.lookup_e070emp": "Empresa",
7577
+ "erpx_fnd.empresa.lookup_e070emp_search_title": "Consultar empresa",
7578
+ "erpx_fnd.empresa.lookup_e070emp_cod_emp": "Código",
7579
+ "erpx_fnd.empresa.lookup_e070emp_nom_emp": "Nome",
7580
+ "erpx_fnd.empresa.lookup_e070fil": "Filial",
7581
+ "erpx_fnd.empresa.lookup_e070fil_search_title": "Consultar filial",
7582
+ "erpx_fnd.empresa.lookup_e070fil_cod_fil": "Código",
7583
+ "erpx_fnd.empresa.lookup_e070fil_nom_fil": "Nome",
7584
+ "erpx_fnd.empresa.lookup_e070fil_sig_fil": "Sigla",
7585
+ "erpx_fnd.empresa.lookup_e070fil_num_cgc": "CNPJ/CPF",
7586
+ "erpx_fnd.empresa.lookup_e070fil_e007ufs.sig_ufs": "Estado",
7587
+ "erpx_fnd.empresa.lookup_e070fil_e008rai.nom_cid": "Cidade",
7588
+ "erpx_fnd.empresa.lookup_e070fil_ins_est": "Inscrição estadual",
7589
+ "erpx_fnd.empresa.lookup_e070fil_e007ufs_sig_ufs.sig_ufs": "Estado",
7590
+ "erpx_fnd.empresa.lookup_e070fil_bai_fil": "Bairro",
7591
+ "erpx_fnd.empresa.lookup_e070fil_fil_mat": "Matriz",
7592
+ "erpx_fnd.empresa.nothing_found": "Nenhum registro foi encontrado",
7593
+ "erpx_fnd.empresa.filter": "Filtrar",
7594
+ "erpx_fnd.empresa.clear": "Limpar",
7595
+ "erpx_fnd.empresa.cancel": "Cancelar",
7596
+ "erpx_fnd.empresa.select": "Selecionar",
7597
+ "erpx_fnd.empresa.yes": "Sim",
7598
+ "erpx_fnd.empresa.no": "Não",
7599
+ "erpx_fnd.empresa.click_to_select": "Clique para selecionar",
7600
+ "erpx_fnd.empresa.company_and_branch": "Empresa/Filial",
7601
+ "erpx_fnd.empresa.global_filter_header": "Filtros para preenchimento automático",
7602
+ "erpx_fnd.empresa.global_filter_description": "Escolha a empresa e filial que serão aplicadas automaticamente nos filtros, reduzindo preenchimentos repetitivos.",
7603
+ "erpx_cpl_ctb.movimentacao_contabil.lookup_e070fil_e070emp.cod_emp": "Código",
7604
+ "erpx_cpl_ctb.movimentacao_contabil.lookup_e070fil_e070emp.sig_emp": "Sigla",
7605
+ "erpx_fnd.financeiro.lookup_e030age": "Agência",
7606
+ "erpx_fnd.financeiro.lookup_e030age_search_title": "Consultar banco",
7607
+ "erpx_fnd.financeiro.lookup_e030age_cod_age": "Código",
7608
+ "erpx_fnd.financeiro.lookup_e030age_nom_age": "Nome",
7609
+ "erpx_fnd.financeiro.nothing_found": "Nenhum registro foi encontrado",
7610
+ "erpx_fnd.financeiro.filter": "Filtrar",
7611
+ "erpx_fnd.financeiro.clear": "Limpar",
7612
+ "erpx_fnd.financeiro.cancel": "Cancelar",
7613
+ "erpx_fnd.financeiro.select": "Selecionar",
7614
+ "erpx_fnd.financeiro.yes": "Sim",
7615
+ "erpx_fnd.financeiro.no": "Não",
7616
+ "erpx_fin.foundation.lookup_e030ban": "Banco",
7617
+ "erpx_fin.foundation.lookup_e030ban_search_title": "Consultar banco",
7618
+ "erpx_fin.foundation.lookup_e030ban_cod_ban": "Código",
7619
+ "erpx_fin.foundation.lookup_e030ban_nom_ban": "Nome",
7620
+ "erpx_fin.foundation.lookup_e600cco": "Conta interna",
7621
+ "erpx_fin.foundation.lookup_e600cco_search_title": "Consultar conta interna",
7622
+ "erpx_fin.foundation.lookup_e600cco_num_cco": "Número",
7623
+ "erpx_fin.foundation.lookup_e600cco_des_cco": "Descrição",
7624
+ "erpx_fin.foundation.nothing_found": "Nenhum registro foi encontrado",
7625
+ "erpx_fin.foundation.filter": "Filtrar",
7626
+ "erpx_fin.foundation.clear": "Limpar",
7627
+ "erpx_fin.foundation.cancel": "Cancelar",
7628
+ "erpx_fin.foundation.select": "Selecionar",
7629
+ "erpx_fin.foundation.yes": "Sim",
7630
+ "erpx_fin.foundation.no": "Não",
7631
+ "erpx_fnd.transacao.lookup_e001tns": "Transação",
7632
+ "erpx_fnd.transacao.lookup_e001tns_search_title": "Consultar transação",
7633
+ "erpx_fnd.transacao.lookup_e001tns_cod_tns": "Código",
7634
+ "erpx_fnd.transacao.lookup_e001tns_des_tns": "Descrição",
7635
+ "erpx_fnd.transacao.nothing_found": "Nenhum registro foi encontrado",
7636
+ "erpx_fnd.transacao.filter": "Filtrar",
7637
+ "erpx_fnd.transacao.clear": "Limpar",
7638
+ "erpx_fnd.transacao.cancel": "Cancelar",
7639
+ "erpx_fnd.transacao.select": "Selecionar",
7640
+ "erpx_fnd.transacao.yes": "Sim",
7641
+ "erpx_fnd.transacao.no": "Não",
7642
+ "Enums": "",
7643
+ "erpx_fin.tesouraria.enum_tip_tcc_v_1": "Conta Corrente",
7644
+ "erpx_fin.tesouraria.enum_tip_tcc_v_2": "Conta Poupança",
7645
+ "erpx_fin.tesouraria.enum_tip_tcc_v_3": "Conta Investimento",
7646
+ "erpx_fin.tesouraria.enum_tip_tcc_v_4": "Conta Aplicação Financeira",
7647
+ "erpx_fin.tesouraria.enum_tip_tcc_v_5": "Conta Empréstimo",
7648
+ "erpx_fin.tesouraria.enum_tip_tcc_v_6": "Cota Capital",
7649
+ "erpx_fin.tesouraria.enum_tip_tcc_v_7": "Conta de Retenção",
7650
+ "erpx_fin.tesouraria.enum_tip_tcc_v_8": "Conta da Loja",
7651
+ "erpx_fin.tesouraria.enum_tip_tcc_v_9": "Conta Salário",
7652
+ "erpx_fin.tesouraria.enum_tip_tcc_v_10": "Outros"
7653
+ };
7654
+
7574
7655
  var ErpLookupsModule = /** @class */ (function () {
7575
7656
  function ErpLookupsModule() {
7576
7657
  }
@@ -8814,6 +8895,7 @@
8814
8895
  }());
8815
8896
 
8816
8897
  var moment$1 = moment$2; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
8898
+ var ERPX_GLOBAL_FILTER_KEY = 'ERPX_GLOBAL_FILTER';
8817
8899
  var FiltersStorageService = /** @class */ (function (_super) {
8818
8900
  __extends(FiltersStorageService, _super);
8819
8901
  function FiltersStorageService() {
@@ -8839,15 +8921,21 @@
8839
8921
  });
8840
8922
  });
8841
8923
  };
8842
- FiltersStorageService.prototype.getFilters = function (key) {
8924
+ FiltersStorageService.prototype.getFilters = function (key, includeGlobalFilter) {
8925
+ if (includeGlobalFilter === void 0) { includeGlobalFilter = false; }
8843
8926
  return __awaiter(this, void 0, void 0, function () {
8844
- var store;
8927
+ var store, globalStore;
8845
8928
  return __generator(this, function (_a) {
8846
8929
  switch (_a.label) {
8847
8930
  case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
8848
8931
  case 1:
8849
8932
  store = (_a.sent()) || {};
8850
- return [2 /*return*/, store[key] || {}];
8933
+ if (!includeGlobalFilter) return [3 /*break*/, 3];
8934
+ return [4 /*yield*/, _super.prototype.get.call(this, ERPX_GLOBAL_FILTER_KEY)];
8935
+ case 2:
8936
+ globalStore = (_a.sent()) || {};
8937
+ return [2 /*return*/, __assign(__assign({}, globalStore), store[key])];
8938
+ case 3: return [2 /*return*/, store[key] || {}];
8851
8939
  }
8852
8940
  });
8853
8941
  });
@@ -9762,6 +9850,348 @@
9762
9850
  ModulesEnum["CONTROLADORIA_GERENCIAL"] = "CONTROLADORIA_GERENCIAL";
9763
9851
  })(exports.ModulesEnum || (exports.ModulesEnum = {}));
9764
9852
 
9853
+ var GlobalFilterService = /** @class */ (function () {
9854
+ function GlobalFilterService() {
9855
+ this._showComponent = true;
9856
+ this._excludedRoutes = [];
9857
+ this.filterChangeSubject = new rxjs.Subject();
9858
+ }
9859
+ /**
9860
+ * Emits a filter change event to all subscribers.
9861
+ * This method should be called whenever the global filter values change
9862
+ * to notify all components listening for filter updates.
9863
+ *
9864
+ * @param event - The filter fields object containing e070emp and e070fil information
9865
+ * @param event.e070emp - e070emp (company) filter value
9866
+ * @param event.e070fil - e070fil (branch) filter value
9867
+ */
9868
+ GlobalFilterService.prototype.onFilterChange = function (event) {
9869
+ this.filterChangeSubject.next(event);
9870
+ };
9871
+ Object.defineProperty(GlobalFilterService.prototype, "filterChange", {
9872
+ /**
9873
+ * Observable stream of filter changes.
9874
+ * Subscribe to this to receive notifications when the filter changes.
9875
+ *
9876
+ * @returns Observable that emits objects containing e070emp and e070fil filter values
9877
+ */
9878
+ get: function () {
9879
+ return this.filterChangeSubject.asObservable();
9880
+ },
9881
+ enumerable: true,
9882
+ configurable: true
9883
+ });
9884
+ Object.defineProperty(GlobalFilterService.prototype, "showComponent", {
9885
+ /**
9886
+ * Gets the visibility state of the global filter component.
9887
+ * Use this to determine whether the global filter should be displayed.
9888
+ *
9889
+ * @returns true if the component should be shown, false otherwise
9890
+ */
9891
+ get: function () {
9892
+ return this._showComponent;
9893
+ },
9894
+ /**
9895
+ * Sets the visibility state of the global filter component.
9896
+ * Use this to programmatically show or hide the global filter.
9897
+ *
9898
+ * @param value - true to show the component, false to hide it
9899
+ */
9900
+ set: function (value) {
9901
+ this._showComponent = value;
9902
+ },
9903
+ enumerable: true,
9904
+ configurable: true
9905
+ });
9906
+ Object.defineProperty(GlobalFilterService.prototype, "excludedRoutes", {
9907
+ /**
9908
+ * Gets the list of routes where the global filter component should not be displayed.
9909
+ * These routes will automatically hide the global filter component.
9910
+ *
9911
+ * @returns Array of route paths to exclude from displaying the global filter
9912
+ */
9913
+ get: function () {
9914
+ return this._excludedRoutes;
9915
+ },
9916
+ /**
9917
+ * Sets the routes where the global filter component should not be displayed.
9918
+ * Use this to configure which pages should not show the global filter.
9919
+ *
9920
+ * @param value - Array of route paths to exclude from displaying the global filter
9921
+ */
9922
+ set: function (value) {
9923
+ this._excludedRoutes = value;
9924
+ },
9925
+ enumerable: true,
9926
+ configurable: true
9927
+ });
9928
+ GlobalFilterService.ɵprov = core.ɵɵdefineInjectable({ factory: function GlobalFilterService_Factory() { return new GlobalFilterService(); }, token: GlobalFilterService, providedIn: "root" });
9929
+ GlobalFilterService = __decorate([
9930
+ core.Injectable({ providedIn: 'root' })
9931
+ ], GlobalFilterService);
9932
+ return GlobalFilterService;
9933
+ }());
9934
+
9935
+ var GlobalFilterComponent = /** @class */ (function () {
9936
+ function GlobalFilterComponent(storageService, globalFilterService, router, translate) {
9937
+ this.storageService = storageService;
9938
+ this.globalFilterService = globalFilterService;
9939
+ this.router = router;
9940
+ this.translate = translate;
9941
+ /**
9942
+ * Routes that are excluded from the global filter by default.
9943
+ * These routes will not have the global filter applied to them.
9944
+ */
9945
+ this.defaultExcludedRoutes = ['forbidden', 'main', 'not-found'];
9946
+ this._showComponent = true;
9947
+ this.showModal = false;
9948
+ this.ngUnsubscribe = new rxjs.Subject();
9949
+ }
9950
+ Object.defineProperty(GlobalFilterComponent.prototype, "mobileTooltip", {
9951
+ /**
9952
+ * Gets a formatted tooltip string for mobile devices.
9953
+ * Concatenates all active field labels and values separated by newlines.
9954
+ */
9955
+ get: function () {
9956
+ var lines = this.fields
9957
+ .filter(function (filterItem) { return filterItem.value; })
9958
+ .map(function (filterItem) { return filterItem.label + ": " + filterItem.displayText; });
9959
+ return lines.length > 0 ? lines.join('\n') : null;
9960
+ },
9961
+ enumerable: true,
9962
+ configurable: true
9963
+ });
9964
+ Object.defineProperty(GlobalFilterComponent.prototype, "fields", {
9965
+ /**
9966
+ * Gets the current filter field configuration array.
9967
+ */
9968
+ get: function () {
9969
+ return [
9970
+ {
9971
+ label: this.translate.instant('erpx_fnd.empresa.e_070_emp'),
9972
+ value: this.e070emp,
9973
+ displayText: this.e070emp ? "" + this.e070emp.label : null
9974
+ },
9975
+ {
9976
+ label: this.translate.instant('erpx_fnd.empresa.e_070_fil'),
9977
+ value: this.e070fil,
9978
+ displayText: this.e070fil ? "" + this.e070fil.label : null
9979
+ }
9980
+ ];
9981
+ },
9982
+ enumerable: true,
9983
+ configurable: true
9984
+ });
9985
+ Object.defineProperty(GlobalFilterComponent.prototype, "showComponent", {
9986
+ /**
9987
+ * Gets the visibility state of the global filter component.
9988
+ * Considers both the service-level visibility setting and the current route.
9989
+ */
9990
+ get: function () {
9991
+ return this.globalFilterService.showComponent && this._showComponent;
9992
+ },
9993
+ enumerable: true,
9994
+ configurable: true
9995
+ });
9996
+ GlobalFilterComponent.prototype.ngOnInit = function () {
9997
+ this.loadFiltersFromStorage();
9998
+ this.initializeRouteListener();
9999
+ };
10000
+ GlobalFilterComponent.prototype.ngOnDestroy = function () {
10001
+ this.ngUnsubscribe.next();
10002
+ this.ngUnsubscribe.complete();
10003
+ };
10004
+ /**
10005
+ * Handles the closing of the filter modal and updates field values.
10006
+ * When fields are provided, updates the component state and notifies the GlobalFilterService.
10007
+ *
10008
+ * @param event - Optional filter field values from the modal
10009
+ */
10010
+ GlobalFilterComponent.prototype.onHide = function (event) {
10011
+ this.showModal = false;
10012
+ if (event) {
10013
+ this.e070emp = event.e070emp;
10014
+ this.e070fil = event.e070fil;
10015
+ this.globalFilterService.onFilterChange(event);
10016
+ }
10017
+ };
10018
+ /**
10019
+ * Loads the previously saved filter values from local storage.
10020
+ * Retrieves the filter data using the ERPX_GLOBAL_FILTER_KEY and applies it
10021
+ * to the component's e070emp and e070fil properties if available.
10022
+ */
10023
+ GlobalFilterComponent.prototype.loadFiltersFromStorage = function () {
10024
+ var _this = this;
10025
+ this.storageService.get(ERPX_GLOBAL_FILTER_KEY).then(function (filterData) {
10026
+ if (filterData && Object.keys(filterData).length > 0) {
10027
+ _this.e070emp = filterData.e070emp;
10028
+ _this.e070fil = filterData.e070fil;
10029
+ }
10030
+ });
10031
+ };
10032
+ /**
10033
+ * Initializes the route change listener to manage component visibility.
10034
+ * Subscribes to router navigation events and sets the component visibility
10035
+ * based on the current route against excluded routes (default and service-configured).
10036
+ */
10037
+ GlobalFilterComponent.prototype.initializeRouteListener = function () {
10038
+ var _this = this;
10039
+ this.router.events.pipe(operators.takeUntil(this.ngUnsubscribe), operators.filter(function (event) { return event instanceof router.NavigationEnd; })).subscribe(function (event) {
10040
+ var excludedRoutes = new RegExp("^/(" + __spread(_this.defaultExcludedRoutes, _this.globalFilterService.excludedRoutes).join('|') + ")(/|$)");
10041
+ var currentRoute = event.urlAfterRedirects;
10042
+ _this._showComponent = !excludedRoutes.test(currentRoute);
10043
+ });
10044
+ };
10045
+ GlobalFilterComponent.ctorParameters = function () { return [
10046
+ { type: FiltersStorageService },
10047
+ { type: GlobalFilterService },
10048
+ { type: router.Router },
10049
+ { type: core$1.TranslateService }
10050
+ ]; };
10051
+ GlobalFilterComponent = __decorate([
10052
+ core.Component({
10053
+ selector: 'erpx-global-filter',
10054
+ template: "<ng-container *ngIf=\"showComponent\">\n <div class=\"global-filter-mobile\">\n <small class=\"label-title\">\n {{ 'erpx_fnd.empresa.filters' | translate }}\n </small>\n <div>\n <a (click)=\"showModal = true\" class=\"mobile-trigger\" [attr.title]=\"mobileTooltip\">\n <em class=\"fa fa-pencil-square-o\"></em>\n {{ 'erpx_fnd.empresa.company_and_branch' | translate }}\n </a>\n </div>\n </div>\n <div class=\"global-filter-desktop\">\n <div class=\"ui-g\">\n <div class=\"ui-g-6\" *ngFor=\"let field of fields\">\n <small class=\"label-title\">\n {{ field.label }}\n </small>\n <div>\n <a (click)=\"showModal = true\">\n <ng-container *ngIf=\"field.value; else emptyField\">\n <em class=\"fa fa-pencil-square-o\"></em>\n {{ field.displayText }}\n </ng-container>\n </a>\n </div>\n </div>\n </div>\n </div>\n <ng-template #emptyField>\n <em class=\"fa fa-search\"></em>\n {{ 'erpx_fnd.empresa.click_to_select' | translate }}\n </ng-template>\n\n <global-filter-modal *ngIf=\"showModal\"\n [e070emp]=\"e070emp\"\n [e070fil]=\"e070fil\"\n (hideModal)=\"onHide($event)\"\n ></global-filter-modal>\n</ng-container>",
10055
+ styles: [".label-title{color:#999}.global-filter-desktop,.global-filter-mobile{display:block;padding:8px 0}.global-filter-desktop a:hover,.global-filter-mobile a:hover{text-decoration:underline}.global-filter-desktop a .fa,.global-filter-mobile a .fa{margin-right:4px}.global-filter-desktop{display:none}@media (min-width:768px){.global-filter-mobile{display:none}.global-filter-desktop{display:block;width:480px}.global-filter-desktop a{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}"]
10056
+ })
10057
+ ], GlobalFilterComponent);
10058
+ return GlobalFilterComponent;
10059
+ }());
10060
+
10061
+ var GlobalFilterModalComponent = /** @class */ (function () {
10062
+ function GlobalFilterModalComponent(formBuilder, translate, e070empLookup, e070filLookup, storageService) {
10063
+ this.formBuilder = formBuilder;
10064
+ this.translate = translate;
10065
+ this.e070empLookup = e070empLookup;
10066
+ this.e070filLookup = e070filLookup;
10067
+ this.storageService = storageService;
10068
+ this.hideModal = new core.EventEmitter();
10069
+ this.isVisible = true;
10070
+ this.ngUnsubscribe = new rxjs.Subject();
10071
+ }
10072
+ GlobalFilterModalComponent.prototype.ngOnInit = function () {
10073
+ this.createFormGroup();
10074
+ this.createFormField();
10075
+ this.handleFormChanges();
10076
+ };
10077
+ GlobalFilterModalComponent.prototype.ngOnDestroy = function () {
10078
+ this.ngUnsubscribe.next();
10079
+ this.ngUnsubscribe.complete();
10080
+ };
10081
+ /**
10082
+ * Handles the modal closing event.
10083
+ * Hides the modal and emits the optionally provided filter values to the parent component.
10084
+ *
10085
+ * @param value - Optional filter field values to emit when closing the modal
10086
+ */
10087
+ GlobalFilterModalComponent.prototype.onHide = function (value) {
10088
+ this.isVisible = false;
10089
+ this.hideModal.emit(value);
10090
+ };
10091
+ /**
10092
+ * Saves the current form values and closes the modal.
10093
+ * Stores the filter values in local storage and then triggers the hide event
10094
+ * with the saved values.
10095
+ */
10096
+ GlobalFilterModalComponent.prototype.onSave = function () {
10097
+ var _this = this;
10098
+ var value = this.formGroup.getRawValue();
10099
+ this.storageService.store(ERPX_GLOBAL_FILTER_KEY, value).then(function () { return _this.onHide(value); });
10100
+ };
10101
+ GlobalFilterModalComponent.prototype.createFormGroup = function () {
10102
+ this.formGroup = this.formBuilder.group({
10103
+ e070emp: [{ value: this.e070emp, disabled: false }],
10104
+ e070fil: [{ value: this.e070fil, disabled: !this.e070emp }],
10105
+ });
10106
+ };
10107
+ GlobalFilterModalComponent.prototype.createFormField = function () {
10108
+ var _this = this;
10109
+ this.formFields = [
10110
+ new angularComponents.FormField(__assign(__assign({}, this.e070empLookup.mountOptions({
10111
+ multiple: false,
10112
+ queryFields: ['e031moe.sigMoe']
10113
+ })), { appendTo: "body", emptyMessage: this.translate.instant('erpx_fnd.empresa.nothing_found') })),
10114
+ new angularComponents.FormField(__assign(__assign({}, this.e070filLookup.mountOptions({
10115
+ multiple: false,
10116
+ lookupFields: [
10117
+ { name: "codFil", type: angularComponents.FieldType.Integer },
10118
+ { name: "nomFil", type: angularComponents.FieldType.String },
10119
+ ],
10120
+ searchFields: [
10121
+ { name: "codFil", type: angularComponents.FieldType.Integer },
10122
+ { name: "nomFil", type: angularComponents.FieldType.String },
10123
+ ],
10124
+ searchGridFields: [
10125
+ { name: "codFil", type: angularComponents.FieldType.Integer },
10126
+ { name: "nomFil", type: angularComponents.FieldType.String },
10127
+ ],
10128
+ entityDependency: [
10129
+ {
10130
+ name: "e070emp",
10131
+ field: "id",
10132
+ value: function () { return _this.formGroup.get("e070emp").value; }
10133
+ },
10134
+ ],
10135
+ })), { emptyMessage: this.translate.instant('erpx_fnd.empresa.nothing_found'), appendTo: "body" })),
10136
+ ];
10137
+ };
10138
+ GlobalFilterModalComponent.prototype.handleFormChanges = function () {
10139
+ var _this = this;
10140
+ this.formGroup.controls.e070emp.valueChanges
10141
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
10142
+ .subscribe(function (value) {
10143
+ var control = _this.formGroup.get('e070fil');
10144
+ value ? control.enable() : control.disable();
10145
+ control.reset();
10146
+ });
10147
+ };
10148
+ GlobalFilterModalComponent.ctorParameters = function () { return [
10149
+ { type: forms.FormBuilder },
10150
+ { type: core$1.TranslateService },
10151
+ { type: E070EmpLookup },
10152
+ { type: E070FilLookup },
10153
+ { type: FiltersStorageService }
10154
+ ]; };
10155
+ __decorate([
10156
+ core.Input()
10157
+ ], GlobalFilterModalComponent.prototype, "e070emp", void 0);
10158
+ __decorate([
10159
+ core.Input()
10160
+ ], GlobalFilterModalComponent.prototype, "e070fil", void 0);
10161
+ __decorate([
10162
+ core.Output()
10163
+ ], GlobalFilterModalComponent.prototype, "hideModal", void 0);
10164
+ GlobalFilterModalComponent = __decorate([
10165
+ core.Component({
10166
+ selector: 'global-filter-modal',
10167
+ template: "<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n (onHide)=\"onHide()\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [focusOnShow]=\"false\"\n>\n <p-header>\n {{ 'erpx_fnd.empresa.global_filter_header' | translate }}\n </p-header>\n <p class=\"description\">\n {{ 'erpx_fnd.empresa.global_filter_description' | translate }}\n </p>\n <br>\n <s-dynamic-form\n [fields]=\"formFields\" [form]=\"formGroup\"\n ></s-dynamic-form>\n <p-footer>\n <s-button\n [label]=\"'erpx_fnd.empresa.save' | translate\"\n priority=\"primary\"\n (onClick)=\"onSave()\"\n ></s-button>\n <s-button\n [label]=\"'erpx_fnd.empresa.cancel' | translate\"\n priority=\"link\"\n (onClick)=\"onHide()\"\n ></s-button>\n </p-footer>\n</p-dialog>\n",
10168
+ styles: ["\n .description {\n padding: 0px 7px;\n }\n "]
10169
+ })
10170
+ ], GlobalFilterModalComponent);
10171
+ return GlobalFilterModalComponent;
10172
+ }());
10173
+
10174
+ var GlobalFilterModule = /** @class */ (function () {
10175
+ function GlobalFilterModule() {
10176
+ }
10177
+ GlobalFilterModule = __decorate([
10178
+ core.NgModule({
10179
+ imports: [
10180
+ common.CommonModule,
10181
+ angularComponents.DynamicFormModule,
10182
+ dialog.DialogModule,
10183
+ angularComponents.ButtonModule,
10184
+ core$1.TranslateModule,
10185
+ ErpLookupsModule,
10186
+ ],
10187
+ providers: [FiltersStorageService],
10188
+ declarations: [GlobalFilterComponent, GlobalFilterModalComponent],
10189
+ exports: [GlobalFilterComponent],
10190
+ })
10191
+ ], GlobalFilterModule);
10192
+ return GlobalFilterModule;
10193
+ }());
10194
+
9765
10195
  exports.AgreementLookup = AgreementLookup;
9766
10196
  exports.BankLookup = BankLookup;
9767
10197
  exports.BeneficioFiscalLookup = BeneficioFiscalLookup;
@@ -9869,6 +10299,7 @@
9869
10299
  exports.E501TcpLookup = E501TcpLookup;
9870
10300
  exports.E600CcoLookup = E600CcoLookup;
9871
10301
  exports.E640LotLookup = E640LotLookup;
10302
+ exports.ERPX_GLOBAL_FILTER_KEY = ERPX_GLOBAL_FILTER_KEY;
9872
10303
  exports.EntityPersonProductLookup = EntityPersonProductLookup;
9873
10304
  exports.EquipmentLookup = EquipmentLookup;
9874
10305
  exports.ErpLookups = ErpLookups;
@@ -9880,6 +10311,9 @@
9880
10311
  exports.ExportUtils = ExportUtils;
9881
10312
  exports.FiltersStorageService = FiltersStorageService;
9882
10313
  exports.FormUtilsService = FormUtilsService;
10314
+ exports.GlobalFilterComponent = GlobalFilterComponent;
10315
+ exports.GlobalFilterModule = GlobalFilterModule;
10316
+ exports.GlobalFilterService = GlobalFilterService;
9883
10317
  exports.HTTP_STATUS_CODE = HTTP_STATUS_CODE;
9884
10318
  exports.IndOperacaoFornecimentoLookup = IndOperacaoFornecimentoLookup;
9885
10319
  exports.LeiComplementar1162003Lookup = LeiComplementar1162003Lookup;
@@ -9910,6 +10344,7 @@
9910
10344
  exports.VerifyModulePermission = VerifyModulePermission;
9911
10345
  exports.VerifyModulePermissions = VerifyModulePermissions;
9912
10346
  exports.WebsocketService = WebsocketService;
10347
+ exports.fallback = fallback;
9913
10348
  exports.naturezaReceitaPisCofins = naturezaReceitaPisCofins;
9914
10349
  exports.ɵ0 = ɵ0;
9915
10350
  exports.ɵ1 = ɵ1;
@@ -9921,6 +10356,9 @@
9921
10356
  exports.ɵg = UserInformationService;
9922
10357
  exports.ɵh = VerifyModulePermissionService;
9923
10358
  exports.ɵi = VerifyModulePermissionsService;
10359
+ exports.ɵj = FiltersStorageService;
10360
+ exports.ɵk = ErpLookupsModule;
10361
+ exports.ɵl = GlobalFilterModalComponent;
9924
10362
 
9925
10363
  Object.defineProperty(exports, '__esModule', { value: true });
9926
10364