oxpi-nglib 0.0.5 → 0.0.9
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/esm2020/lib/controls/item-card/item-card.component.mjs +16 -0
- package/esm2020/lib/models/entidades/login-item.mjs +2 -0
- package/esm2020/lib/models/entidades/login-result.mjs +2 -0
- package/esm2020/lib/models/entidades/permissoes.mjs +2 -0
- package/esm2020/lib/models/entidades/sensores-def.mjs +2 -0
- package/esm2020/lib/models/entidades/usuario.mjs +2 -0
- package/esm2020/lib/models/infra/busy-state.mjs +18 -0
- package/esm2020/lib/models/infra/lazy-trigger.mjs +13 -0
- package/esm2020/lib/models/infra/number-parser.mjs +62 -0
- package/esm2020/lib/models/infra/ordem.mjs +17 -0
- package/esm2020/lib/models/infra/paging-result.mjs +2 -0
- package/esm2020/lib/models/infra/utils-methods.mjs +15 -0
- package/esm2020/lib/models/infra/validations.mjs +14 -0
- package/esm2020/lib/models/settings/PagamentoRecebimentoSearchSetting.mjs +9 -0
- package/esm2020/lib/models/settings/consumo-produto-search-setting.mjs +15 -0
- package/esm2020/lib/models/settings/duplicata-search-setting.mjs +13 -0
- package/esm2020/lib/models/settings/ocupacao-filter-setting.mjs +14 -0
- package/esm2020/lib/models/settings/ocupacao-search-setting.mjs +26 -0
- package/esm2020/lib/models/settings/search-setting.mjs +67 -0
- package/esm2020/lib/models/settings/suites-intervencoes-setting.mjs +4 -0
- package/esm2020/lib/oxpi-nglib.module.mjs +14 -4
- package/esm2020/lib/providers/export.file.service.mjs +28 -0
- package/esm2020/lib/providers/focus.service.mjs +70 -0
- package/esm2020/lib/providers/preference.service.mjs +42 -0
- package/esm2020/lib/providers/safe-html.pipe.mjs +20 -0
- package/esm2020/lib/providers/screen-helper.service.mjs +54 -0
- package/esm2020/public-api.mjs +26 -1
- package/fesm2015/oxpi-nglib.mjs +513 -5
- package/fesm2015/oxpi-nglib.mjs.map +1 -1
- package/fesm2020/oxpi-nglib.mjs +513 -5
- package/fesm2020/oxpi-nglib.mjs.map +1 -1
- package/lib/controls/item-card/item-card.component.d.ts +9 -0
- package/lib/models/entidades/login-item.d.ts +6 -0
- package/lib/models/entidades/login-result.d.ts +13 -0
- package/lib/models/entidades/permissoes.d.ts +181 -0
- package/lib/models/entidades/sensores-def.d.ts +6 -0
- package/lib/models/entidades/usuario.d.ts +27 -0
- package/lib/models/infra/busy-state.d.ts +6 -0
- package/lib/models/infra/lazy-trigger.d.ts +7 -0
- package/lib/models/infra/number-parser.d.ts +14 -0
- package/lib/models/infra/ordem.d.ts +13 -0
- package/lib/models/infra/paging-result.d.ts +7 -0
- package/lib/models/infra/utils-methods.d.ts +3 -0
- package/lib/models/infra/validations.d.ts +3 -0
- package/lib/models/settings/PagamentoRecebimentoSearchSetting.d.ts +6 -0
- package/lib/models/settings/consumo-produto-search-setting.d.ts +14 -0
- package/lib/models/settings/duplicata-search-setting.d.ts +12 -0
- package/lib/models/settings/ocupacao-filter-setting.d.ts +13 -0
- package/lib/models/settings/ocupacao-search-setting.d.ts +45 -0
- package/lib/models/settings/search-setting.d.ts +27 -0
- package/lib/models/settings/suites-intervencoes-setting.d.ts +6 -0
- package/lib/oxpi-nglib.module.d.ts +10 -6
- package/lib/providers/export.file.service.d.ts +10 -0
- package/lib/providers/focus.service.d.ts +14 -0
- package/lib/providers/preference.service.d.ts +11 -0
- package/lib/providers/safe-html.pipe.d.ts +10 -0
- package/lib/providers/screen-helper.service.d.ts +16 -0
- package/package.json +1 -1
- package/public-api.d.ts +25 -0
package/fesm2015/oxpi-nglib.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, EventEmitter, Output, HostListener, NgModule } from '@angular/core';
|
|
2
|
+
import { Component, Input, EventEmitter, Output, HostListener, NgModule, Injectable, Pipe } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import * as i1$1 from '@angular/material/button';
|
|
5
5
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -8,7 +8,9 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
8
8
|
import * as i3 from '@angular/forms';
|
|
9
9
|
import { FormsModule } from '@angular/forms';
|
|
10
10
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
11
|
+
import * as i1$2 from '@angular/platform-browser';
|
|
11
12
|
import { BrowserModule } from '@angular/platform-browser';
|
|
13
|
+
import * as FileSaver from 'file-saver';
|
|
12
14
|
|
|
13
15
|
class BusyIndicatorComponent {
|
|
14
16
|
constructor() {
|
|
@@ -447,11 +449,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
447
449
|
type: Input
|
|
448
450
|
}] } });
|
|
449
451
|
|
|
452
|
+
class ItemCardComponent {
|
|
453
|
+
constructor() { }
|
|
454
|
+
ngOnInit() {
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
ItemCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ItemCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
458
|
+
ItemCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: ItemCardComponent, selector: "app-item-card", inputs: { nome: "nome" }, ngImport: i0, template: "{{nome}}\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:8px 16px;background:#fff;cursor:pointer;height:30px;align-items:center;transition:border-left-color 1s}:host:hover{box-shadow:0 8px 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:--app-color}\n"] });
|
|
459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ItemCardComponent, decorators: [{
|
|
460
|
+
type: Component,
|
|
461
|
+
args: [{ selector: 'app-item-card', template: "{{nome}}\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:8px 16px;background:#fff;cursor:pointer;height:30px;align-items:center;transition:border-left-color 1s}:host:hover{box-shadow:0 8px 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:--app-color}\n"] }]
|
|
462
|
+
}], ctorParameters: function () { return []; }, propDecorators: { nome: [{
|
|
463
|
+
type: Input
|
|
464
|
+
}] } });
|
|
465
|
+
|
|
450
466
|
Array.prototype.firstOrNull = function () {
|
|
451
467
|
if (this.length > 0)
|
|
452
468
|
return this[0];
|
|
453
469
|
return null;
|
|
454
470
|
};
|
|
471
|
+
Date.prototype.addDays = function (days) {
|
|
472
|
+
var result = new Date(this);
|
|
473
|
+
result.setDate(result.getDate() + days);
|
|
474
|
+
return result;
|
|
475
|
+
};
|
|
455
476
|
class OxpiNglibModule {
|
|
456
477
|
}
|
|
457
478
|
OxpiNglibModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: OxpiNglibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -461,7 +482,8 @@ OxpiNglibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
461
482
|
NumericPickerComponent,
|
|
462
483
|
PaginatorComponent,
|
|
463
484
|
CheckButtonComponent,
|
|
464
|
-
RadioButtonGroupComponent
|
|
485
|
+
RadioButtonGroupComponent,
|
|
486
|
+
ItemCardComponent], imports: [BrowserModule,
|
|
465
487
|
BrowserAnimationsModule,
|
|
466
488
|
FormsModule,
|
|
467
489
|
MatButtonModule,
|
|
@@ -471,7 +493,8 @@ OxpiNglibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
471
493
|
NumericPickerComponent,
|
|
472
494
|
PaginatorComponent,
|
|
473
495
|
CheckButtonComponent,
|
|
474
|
-
RadioButtonGroupComponent
|
|
496
|
+
RadioButtonGroupComponent,
|
|
497
|
+
ItemCardComponent] });
|
|
475
498
|
OxpiNglibModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: OxpiNglibModule, imports: [[
|
|
476
499
|
BrowserModule,
|
|
477
500
|
BrowserAnimationsModule,
|
|
@@ -490,6 +513,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
490
513
|
PaginatorComponent,
|
|
491
514
|
CheckButtonComponent,
|
|
492
515
|
RadioButtonGroupComponent,
|
|
516
|
+
ItemCardComponent,
|
|
493
517
|
],
|
|
494
518
|
imports: [
|
|
495
519
|
BrowserModule,
|
|
@@ -505,11 +529,495 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
505
529
|
NumericPickerComponent,
|
|
506
530
|
PaginatorComponent,
|
|
507
531
|
CheckButtonComponent,
|
|
508
|
-
RadioButtonGroupComponent
|
|
532
|
+
RadioButtonGroupComponent,
|
|
533
|
+
ItemCardComponent,
|
|
509
534
|
]
|
|
510
535
|
}]
|
|
511
536
|
}] });
|
|
512
537
|
|
|
538
|
+
class BusyState {
|
|
539
|
+
constructor() {
|
|
540
|
+
this.isBusy = false;
|
|
541
|
+
this.counter = 0;
|
|
542
|
+
}
|
|
543
|
+
show() {
|
|
544
|
+
this.counter++;
|
|
545
|
+
this.isBusy = true;
|
|
546
|
+
}
|
|
547
|
+
hide() {
|
|
548
|
+
this.counter--;
|
|
549
|
+
if (this.counter < 0)
|
|
550
|
+
this.counter = 0;
|
|
551
|
+
if (this.counter == 0)
|
|
552
|
+
this.isBusy = false;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
class LazyTrigger {
|
|
557
|
+
constructor(doFunc, timeout = 800) {
|
|
558
|
+
this.doFunc = doFunc;
|
|
559
|
+
this.timeout = timeout;
|
|
560
|
+
}
|
|
561
|
+
fire() {
|
|
562
|
+
console.debug("lazyTimeoutId");
|
|
563
|
+
if (this.lazyTimeoutId != undefined)
|
|
564
|
+
clearTimeout(this.lazyTimeoutId);
|
|
565
|
+
this.lazyTimeoutId = window.setTimeout(() => { this.doFunc(); }, this.timeout);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
class NumberParser {
|
|
570
|
+
constructor(setPropFunc, getPropFunc, min, max) {
|
|
571
|
+
this.setPropFunc = setPropFunc;
|
|
572
|
+
this.getPropFunc = getPropFunc;
|
|
573
|
+
this.min = min;
|
|
574
|
+
this.max = max;
|
|
575
|
+
this.parsed = false;
|
|
576
|
+
this._parseTrigger = new LazyTrigger(() => this.parseValor());
|
|
577
|
+
}
|
|
578
|
+
parse(vlr) {
|
|
579
|
+
this.valor = vlr;
|
|
580
|
+
this.parsed = false;
|
|
581
|
+
this._parseTrigger.fire();
|
|
582
|
+
}
|
|
583
|
+
checkout() {
|
|
584
|
+
if (this.parsed || !this.valor)
|
|
585
|
+
return;
|
|
586
|
+
this.parseValor();
|
|
587
|
+
}
|
|
588
|
+
parseValor() {
|
|
589
|
+
if (this.valor === undefined)
|
|
590
|
+
return;
|
|
591
|
+
this.parsed = true;
|
|
592
|
+
const vlrTxt = this.valor.split(",").join(".");
|
|
593
|
+
;
|
|
594
|
+
const spTxt = vlrTxt.split(".");
|
|
595
|
+
let toParseTxt = "";
|
|
596
|
+
if (spTxt.length > 2) {
|
|
597
|
+
const chars = vlrTxt.split("");
|
|
598
|
+
const lastIndex = vlrTxt.lastIndexOf(".");
|
|
599
|
+
for (let i = 0; i < chars.length; i++) {
|
|
600
|
+
const c = chars[i];
|
|
601
|
+
if (c === "." && i != lastIndex)
|
|
602
|
+
continue;
|
|
603
|
+
toParseTxt = toParseTxt.concat(c);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
toParseTxt = vlrTxt;
|
|
608
|
+
}
|
|
609
|
+
const vlr = parseFloat(toParseTxt);
|
|
610
|
+
if (isNaN(vlr) || !this.validaMinMax(vlr)) {
|
|
611
|
+
const original = this.getPropFunc();
|
|
612
|
+
this.setPropFunc(0);
|
|
613
|
+
setTimeout(() => this.setPropFunc(original));
|
|
614
|
+
}
|
|
615
|
+
else {
|
|
616
|
+
this.setPropFunc(vlr);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
validaMinMax(value) {
|
|
620
|
+
if ((this.min === undefined) && this.max === undefined)
|
|
621
|
+
return true;
|
|
622
|
+
if (!(this.min === undefined) && value < this.min)
|
|
623
|
+
return false;
|
|
624
|
+
if (!(this.max === undefined) && value > this.max)
|
|
625
|
+
return false;
|
|
626
|
+
return true;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
class Ordem {
|
|
631
|
+
constructor(ordens, isCrescente, onToggle) {
|
|
632
|
+
const d = ordens.filter(x => x.default === true).firstOrNull();
|
|
633
|
+
this.colName = d === null ? ordens[0].value : d.value;
|
|
634
|
+
this.isCrescente = isCrescente;
|
|
635
|
+
this.onToggle = onToggle;
|
|
636
|
+
}
|
|
637
|
+
toggle() {
|
|
638
|
+
this.isCrescente = !this.isCrescente;
|
|
639
|
+
if (this.onToggle !== undefined)
|
|
640
|
+
this.onToggle();
|
|
641
|
+
}
|
|
642
|
+
toString() {
|
|
643
|
+
return this.colName + (!this.isCrescente ? " desc" : "");
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
function printTxt(txt) {
|
|
648
|
+
const r = "<!doctype html><head><meta charset=\"utf-8\"></head><body><div style='font-family: \"Courier New\", Courier, monospace; white-space: pre-wrap;color: black;font-weight: bold;word-wrap: break-word;word-break: break-all;overflow-wrap: break-word;'>" + txt + '</div></body>';
|
|
649
|
+
printHtml(r);
|
|
650
|
+
}
|
|
651
|
+
function printHtml(r) {
|
|
652
|
+
const blob = new Blob([r], { type: 'text/html' });
|
|
653
|
+
const url = window.URL.createObjectURL(blob);
|
|
654
|
+
const w = window.open(url, '_blank');
|
|
655
|
+
if (w != null)
|
|
656
|
+
w.print();
|
|
657
|
+
}
|
|
658
|
+
function selectText(ev) {
|
|
659
|
+
ev.target.select();
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
function valTextEmpty(v) {
|
|
663
|
+
return v === null ||
|
|
664
|
+
v === undefined ||
|
|
665
|
+
v.trim() === '';
|
|
666
|
+
}
|
|
667
|
+
function valTextMax(v, max) {
|
|
668
|
+
return v.length > max;
|
|
669
|
+
}
|
|
670
|
+
function valNumberMin(v, min) {
|
|
671
|
+
if (v === null || v === undefined)
|
|
672
|
+
return true;
|
|
673
|
+
return v <= min;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
class SearchSetting {
|
|
677
|
+
constructor(propChanged) {
|
|
678
|
+
this.propChanged = propChanged;
|
|
679
|
+
this._meses = ["JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"];
|
|
680
|
+
this._mesesShort = ["JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ"];
|
|
681
|
+
const now = new Date();
|
|
682
|
+
const hj = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
|
|
683
|
+
console.info(hj);
|
|
684
|
+
this.modo = SearchMode.Mensal;
|
|
685
|
+
this.mes = hj.getMonth() + 1;
|
|
686
|
+
this.ano = hj.getFullYear();
|
|
687
|
+
this.inicial = hj.addDays(-30);
|
|
688
|
+
this.final = hj;
|
|
689
|
+
}
|
|
690
|
+
set(prop, value) {
|
|
691
|
+
const me = this;
|
|
692
|
+
me[prop] = value;
|
|
693
|
+
if (this.propChanged !== undefined)
|
|
694
|
+
this.propChanged();
|
|
695
|
+
}
|
|
696
|
+
toStringArquivo() {
|
|
697
|
+
const ini = this.inicial;
|
|
698
|
+
const fim = this.final;
|
|
699
|
+
if (this.modo === SearchMode.Mensal)
|
|
700
|
+
return this.ano + "_" + this.mes;
|
|
701
|
+
if (this.modo === SearchMode.Anual)
|
|
702
|
+
return "" + this.ano;
|
|
703
|
+
if (this.modo === SearchMode.Diario)
|
|
704
|
+
return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}`;
|
|
705
|
+
return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}_ate_${fim.getDate()}_${fim.getMonth() + 1}_${fim.getFullYear()}`;
|
|
706
|
+
}
|
|
707
|
+
getDatasTexto(short = false) {
|
|
708
|
+
const ini = this.inicial;
|
|
709
|
+
const fim = this.final;
|
|
710
|
+
if (this.modo === SearchMode.Mensal && short)
|
|
711
|
+
return this._mesesShort[this.mes - 1] + " DE " + this.ano;
|
|
712
|
+
if (this.modo === SearchMode.Mensal)
|
|
713
|
+
return this._meses[this.mes - 1] + " DE " + this.ano;
|
|
714
|
+
if (this.modo === SearchMode.Anual)
|
|
715
|
+
return "" + this.ano;
|
|
716
|
+
if (this.modo === SearchMode.Diario)
|
|
717
|
+
return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()}`;
|
|
718
|
+
return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()} ATÉ ${fim.getDate()}/${fim.getMonth() + 1}/${fim.getFullYear()}`;
|
|
719
|
+
}
|
|
720
|
+
goNextMonth() {
|
|
721
|
+
this.mes++;
|
|
722
|
+
if (this.mes > 12) {
|
|
723
|
+
this.mes = 1;
|
|
724
|
+
this.ano += 1;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
goBackMonth() {
|
|
728
|
+
this.mes--;
|
|
729
|
+
if (this.mes < 1) {
|
|
730
|
+
this.mes = 12;
|
|
731
|
+
this.ano -= 1;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
var SearchMode;
|
|
736
|
+
(function (SearchMode) {
|
|
737
|
+
SearchMode[SearchMode["Mensal"] = 0] = "Mensal";
|
|
738
|
+
SearchMode[SearchMode["Anual"] = 1] = "Anual";
|
|
739
|
+
SearchMode[SearchMode["Periodo"] = 2] = "Periodo";
|
|
740
|
+
SearchMode[SearchMode["Diario"] = 3] = "Diario";
|
|
741
|
+
})(SearchMode || (SearchMode = {}));
|
|
742
|
+
|
|
743
|
+
class PagamentoRecebimentoSearchSetting extends SearchSetting {
|
|
744
|
+
constructor() {
|
|
745
|
+
super();
|
|
746
|
+
this.exibirPagamentos = true;
|
|
747
|
+
this.exibirRecebimentos = true;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
class OcupacaoFilterSetting extends SearchSetting {
|
|
752
|
+
constructor() {
|
|
753
|
+
super();
|
|
754
|
+
this.dom = false;
|
|
755
|
+
this.seg = false;
|
|
756
|
+
this.ter = false;
|
|
757
|
+
this.qua = false;
|
|
758
|
+
this.qui = false;
|
|
759
|
+
this.sex = false;
|
|
760
|
+
this.sab = false;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
class OcupacaoSearchSetting extends OcupacaoFilterSetting {
|
|
765
|
+
constructor() {
|
|
766
|
+
super();
|
|
767
|
+
this.dateFieldEnum = OcupacaoSearchDateField.DataBaseCaixa;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
var PorOcupacaoTipo;
|
|
771
|
+
(function (PorOcupacaoTipo) {
|
|
772
|
+
PorOcupacaoTipo[PorOcupacaoTipo["PorSuite"] = 0] = "PorSuite";
|
|
773
|
+
PorOcupacaoTipo[PorOcupacaoTipo["PorClasse"] = 1] = "PorClasse";
|
|
774
|
+
PorOcupacaoTipo[PorOcupacaoTipo["PorPermanencia"] = 2] = "PorPermanencia";
|
|
775
|
+
})(PorOcupacaoTipo || (PorOcupacaoTipo = {}));
|
|
776
|
+
var OcupacaoSearchDateField;
|
|
777
|
+
(function (OcupacaoSearchDateField) {
|
|
778
|
+
OcupacaoSearchDateField[OcupacaoSearchDateField["DataBaseCaixa"] = 0] = "DataBaseCaixa";
|
|
779
|
+
OcupacaoSearchDateField[OcupacaoSearchDateField["Entrada"] = 1] = "Entrada";
|
|
780
|
+
OcupacaoSearchDateField[OcupacaoSearchDateField["Saida"] = 2] = "Saida";
|
|
781
|
+
})(OcupacaoSearchDateField || (OcupacaoSearchDateField = {}));
|
|
782
|
+
var OcupacaoSearchTipoEntrada;
|
|
783
|
+
(function (OcupacaoSearchTipoEntrada) {
|
|
784
|
+
OcupacaoSearchTipoEntrada[OcupacaoSearchTipoEntrada["Todas"] = 0] = "Todas";
|
|
785
|
+
OcupacaoSearchTipoEntrada[OcupacaoSearchTipoEntrada["Auto"] = 1] = "Auto";
|
|
786
|
+
OcupacaoSearchTipoEntrada[OcupacaoSearchTipoEntrada["Manual"] = 2] = "Manual";
|
|
787
|
+
})(OcupacaoSearchTipoEntrada || (OcupacaoSearchTipoEntrada = {}));
|
|
788
|
+
|
|
789
|
+
class ConsumoProdutoSearchSetting extends SearchSetting {
|
|
790
|
+
constructor() {
|
|
791
|
+
super();
|
|
792
|
+
this.dateFieldEnum = OcupacaoSearchDateField.DataBaseCaixa;
|
|
793
|
+
this.exibeVendas = true;
|
|
794
|
+
this.exibeConsumoInterno = true;
|
|
795
|
+
this.horaInicial = 0;
|
|
796
|
+
this.minutoInicial = 0;
|
|
797
|
+
this.horaFinal = 23;
|
|
798
|
+
this.minutoFinal = 59;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
class DuplicataSearchSetting extends SearchSetting {
|
|
803
|
+
constructor(isDespesa, propChanged) {
|
|
804
|
+
super(propChanged);
|
|
805
|
+
this.isDespesa = isDespesa;
|
|
806
|
+
this.ultimosCadastrados = false;
|
|
807
|
+
this.exibeQuitado = false;
|
|
808
|
+
this.exibeParcial = false;
|
|
809
|
+
this.exibeEmAberto = false;
|
|
810
|
+
this.ordem = "Vencimento";
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
class SuitesIntervencoesSetting extends SearchSetting {
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
class ExportFileService {
|
|
818
|
+
constructor() { }
|
|
819
|
+
start(empresaNomeFile) {
|
|
820
|
+
this.empresaNomeFile = empresaNomeFile;
|
|
821
|
+
}
|
|
822
|
+
exportarExcel(r, fileName) {
|
|
823
|
+
const blob = new Blob([r], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
824
|
+
FileSaver.saveAs(blob, `${fileName}.${this.empresaNomeFile}.xlsx`);
|
|
825
|
+
}
|
|
826
|
+
printHtml(r) {
|
|
827
|
+
const blob = new Blob([r], { type: 'text/html' });
|
|
828
|
+
const url = window.URL.createObjectURL(blob);
|
|
829
|
+
const w = window.open(url, '_blank', 'noreferrer');
|
|
830
|
+
w === null || w === void 0 ? void 0 : w.print();
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
ExportFileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ExportFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
834
|
+
ExportFileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ExportFileService, providedIn: 'root' });
|
|
835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ExportFileService, decorators: [{
|
|
836
|
+
type: Injectable,
|
|
837
|
+
args: [{
|
|
838
|
+
providedIn: 'root'
|
|
839
|
+
}]
|
|
840
|
+
}], ctorParameters: function () { return []; } });
|
|
841
|
+
|
|
842
|
+
class FocusService {
|
|
843
|
+
constructor() {
|
|
844
|
+
}
|
|
845
|
+
hasInit() {
|
|
846
|
+
return this._element !== undefined;
|
|
847
|
+
}
|
|
848
|
+
registerElementById(name) {
|
|
849
|
+
this.registerElement(document.getElementById(name));
|
|
850
|
+
}
|
|
851
|
+
registerElement(element) {
|
|
852
|
+
if (element === null || element === undefined)
|
|
853
|
+
return;
|
|
854
|
+
this._element = element;
|
|
855
|
+
//this._items = this.getItems();
|
|
856
|
+
console.info(element);
|
|
857
|
+
element.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
858
|
+
}
|
|
859
|
+
registerWindow() {
|
|
860
|
+
this._element = null;
|
|
861
|
+
//this._items = this.getItems();
|
|
862
|
+
window.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
863
|
+
}
|
|
864
|
+
unregisterElementById(name) {
|
|
865
|
+
this.unregisterElement(document.getElementById(name));
|
|
866
|
+
}
|
|
867
|
+
unregisterElement(element) {
|
|
868
|
+
if (element === null || element === undefined)
|
|
869
|
+
return;
|
|
870
|
+
element.removeEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
871
|
+
}
|
|
872
|
+
handleKeyboardEvent(event) {
|
|
873
|
+
if (event.keyCode !== 13)
|
|
874
|
+
return;
|
|
875
|
+
if (event.target.nodeName === "BUTTON")
|
|
876
|
+
return;
|
|
877
|
+
const items = this.getItems();
|
|
878
|
+
const index = Array.prototype.indexOf.call(items, event.target);
|
|
879
|
+
const nextIndex = index + 1;
|
|
880
|
+
if (nextIndex > items.length - 1)
|
|
881
|
+
return;
|
|
882
|
+
const i = items[index + 1];
|
|
883
|
+
if (i.tabIndex > -1)
|
|
884
|
+
i.focus();
|
|
885
|
+
event.preventDefault();
|
|
886
|
+
}
|
|
887
|
+
setFirst() {
|
|
888
|
+
const el = this.getItems()[0]; //[0];
|
|
889
|
+
if (el !== undefined)
|
|
890
|
+
el.focus();
|
|
891
|
+
}
|
|
892
|
+
getItems() {
|
|
893
|
+
const query = this._element !== null && this._element !== undefined ?
|
|
894
|
+
this._element.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])') :
|
|
895
|
+
document.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])');
|
|
896
|
+
const items = [];
|
|
897
|
+
for (let index = 0; index < query.length; index++) {
|
|
898
|
+
const el = query[index];
|
|
899
|
+
if (el.tabIndex > 0)
|
|
900
|
+
items.push(el);
|
|
901
|
+
}
|
|
902
|
+
return items;
|
|
903
|
+
}
|
|
904
|
+
set(id) {
|
|
905
|
+
const el = document.getElementById(id);
|
|
906
|
+
if (el === null)
|
|
907
|
+
return;
|
|
908
|
+
el.focus();
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
class Preferences {
|
|
913
|
+
constructor() {
|
|
914
|
+
}
|
|
915
|
+
loadGroup(key, list, defaultValue) {
|
|
916
|
+
const t = localStorage.getItem(key);
|
|
917
|
+
if (t === null)
|
|
918
|
+
return defaultValue;
|
|
919
|
+
let defValue;
|
|
920
|
+
for (let i = 0; i < list.length; i++) {
|
|
921
|
+
const item = list[i];
|
|
922
|
+
const isDefault = (item.value + '') === t;
|
|
923
|
+
item.default = isDefault;
|
|
924
|
+
if (isDefault)
|
|
925
|
+
defValue = item.value;
|
|
926
|
+
}
|
|
927
|
+
return defValue;
|
|
928
|
+
}
|
|
929
|
+
load(key, defaultValue) {
|
|
930
|
+
const json = localStorage.getItem(key);
|
|
931
|
+
if (json === null)
|
|
932
|
+
return defaultValue;
|
|
933
|
+
return JSON.parse(json);
|
|
934
|
+
}
|
|
935
|
+
saveGroup(key, data) {
|
|
936
|
+
localStorage.setItem(key, data.value);
|
|
937
|
+
}
|
|
938
|
+
save(key, obj) {
|
|
939
|
+
const json = JSON.stringify(obj);
|
|
940
|
+
localStorage.setItem(key, json);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
Preferences.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: Preferences, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
944
|
+
Preferences.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: Preferences, providedIn: 'root' });
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: Preferences, decorators: [{
|
|
946
|
+
type: Injectable,
|
|
947
|
+
args: [{
|
|
948
|
+
providedIn: 'root'
|
|
949
|
+
}]
|
|
950
|
+
}], ctorParameters: function () { return []; } });
|
|
951
|
+
|
|
952
|
+
class SafeHtmlPipe {
|
|
953
|
+
constructor(sanitizer) {
|
|
954
|
+
this.sanitizer = sanitizer;
|
|
955
|
+
}
|
|
956
|
+
transform(html) {
|
|
957
|
+
return this.sanitizer.bypassSecurityTrustHtml(html);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
961
|
+
SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
|
|
962
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: SafeHtmlPipe, decorators: [{
|
|
963
|
+
type: Pipe,
|
|
964
|
+
args: [{
|
|
965
|
+
name: 'safeHtml'
|
|
966
|
+
}]
|
|
967
|
+
}], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
|
|
968
|
+
|
|
969
|
+
const SM_WIDTH = 576;
|
|
970
|
+
const MD_WIDTH = 768;
|
|
971
|
+
const LG_WIDTH = 992;
|
|
972
|
+
const XL_WIDTH = 1200;
|
|
973
|
+
class ScreenHelperService {
|
|
974
|
+
constructor() {
|
|
975
|
+
this.changedMobileScreen = new EventEmitter();
|
|
976
|
+
this.changedMediumScreen = new EventEmitter();
|
|
977
|
+
this.changedLargeScreen = new EventEmitter();
|
|
978
|
+
this.changedXLargeScreen = new EventEmitter();
|
|
979
|
+
this.mobileScreen = false;
|
|
980
|
+
this.isMedium = false;
|
|
981
|
+
this.isLarge = false;
|
|
982
|
+
this.isXLarge = false;
|
|
983
|
+
this.determinaMobileScreen();
|
|
984
|
+
window.addEventListener('resize', (event) => {
|
|
985
|
+
this.determinaMobileScreen();
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
determinaMobileScreen() {
|
|
989
|
+
const width = window.innerWidth;
|
|
990
|
+
const isSmall = width <= SM_WIDTH;
|
|
991
|
+
const isMedium = width <= MD_WIDTH;
|
|
992
|
+
const isLarge = width <= LG_WIDTH;
|
|
993
|
+
const isXLarge = width <= XL_WIDTH;
|
|
994
|
+
if (isSmall !== this.mobileScreen) {
|
|
995
|
+
this.changedMobileScreen.emit(isSmall);
|
|
996
|
+
this.mobileScreen = isSmall;
|
|
997
|
+
}
|
|
998
|
+
if (isMedium !== this.isMedium) {
|
|
999
|
+
this.changedMediumScreen.emit(isMedium);
|
|
1000
|
+
this.isMedium = isMedium;
|
|
1001
|
+
}
|
|
1002
|
+
if (isLarge !== this.isLarge) {
|
|
1003
|
+
this.changedLargeScreen.emit(isLarge);
|
|
1004
|
+
this.isLarge = isLarge;
|
|
1005
|
+
}
|
|
1006
|
+
if (isXLarge !== this.isXLarge) {
|
|
1007
|
+
this.changedXLargeScreen.emit(isXLarge);
|
|
1008
|
+
this.isXLarge = isXLarge;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
ScreenHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ScreenHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1013
|
+
ScreenHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ScreenHelperService, providedIn: 'root' });
|
|
1014
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ScreenHelperService, decorators: [{
|
|
1015
|
+
type: Injectable,
|
|
1016
|
+
args: [{
|
|
1017
|
+
providedIn: 'root'
|
|
1018
|
+
}]
|
|
1019
|
+
}], ctorParameters: function () { return []; } });
|
|
1020
|
+
|
|
513
1021
|
/*
|
|
514
1022
|
* Public API Surface of oxpi-nglib
|
|
515
1023
|
*/
|
|
@@ -518,5 +1026,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
518
1026
|
* Generated bundle index. Do not edit.
|
|
519
1027
|
*/
|
|
520
1028
|
|
|
521
|
-
export { BusyIndicatorComponent, CheckButtonComponent, ImageViewerComponent, MonthYearPickerComponent, NumericPickerComponent, OxpiNglibModule, PaginatorComponent, RadioButtonGroupComponent };
|
|
1029
|
+
export { BusyIndicatorComponent, BusyState, CheckButtonComponent, ConsumoProdutoSearchSetting, DuplicataSearchSetting, ExportFileService, FocusService, ImageViewerComponent, ItemCardComponent, LazyTrigger, MonthYearPickerComponent, NumberParser, NumericPickerComponent, OcupacaoFilterSetting, OcupacaoSearchDateField, OcupacaoSearchSetting, OcupacaoSearchTipoEntrada, Ordem, OxpiNglibModule, PagamentoRecebimentoSearchSetting, PaginatorComponent, PorOcupacaoTipo, Preferences, RadioButtonGroupComponent, SafeHtmlPipe, ScreenHelperService, SearchMode, SearchSetting, SuitesIntervencoesSetting, printHtml, printTxt, selectText, valNumberMin, valTextEmpty, valTextMax };
|
|
522
1030
|
//# sourceMappingURL=oxpi-nglib.mjs.map
|