@masterkeymaterial/ui 0.0.1 → 0.0.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/README.md +9 -59
- package/ng-package.json +10 -0
- package/package.json +5 -14
- package/src/elements/ui-button/ui-button.css +229 -0
- package/src/elements/ui-button/ui-button.html +12 -0
- package/src/elements/ui-button/ui-button.ts +133 -0
- package/src/elements/ui-check-box/ui-check-box.css +66 -0
- package/src/elements/ui-check-box/ui-check-box.html +5 -0
- package/src/elements/ui-check-box/ui-check-box.ts +65 -0
- package/src/elements/ui-chip/ui-chip.css +24 -0
- package/src/elements/ui-chip/ui-chip.html +3 -0
- package/src/elements/ui-chip/ui-chip.ts +25 -0
- package/src/elements/ui-drop-zone/ui-drop-zone.css +91 -0
- package/src/elements/ui-drop-zone/ui-drop-zone.html +8 -0
- package/src/elements/ui-drop-zone/ui-drop-zone.ts +153 -0
- package/src/elements/ui-file-list/ui-file-list.css +43 -0
- package/src/elements/ui-file-list/ui-file-list.html +17 -0
- package/src/elements/ui-file-list/ui-file-list.ts +22 -0
- package/src/elements/ui-list-errors/ui-list-errors.css +30 -0
- package/src/elements/ui-list-errors/ui-list-errors.html +10 -0
- package/src/elements/ui-list-errors/ui-list-errors.ts +14 -0
- package/src/elements/ui-loading/ui-loading.css +13 -0
- package/src/elements/ui-loading/ui-loading.html +1 -0
- package/src/elements/ui-loading/ui-loading.ts +10 -0
- package/src/elements/ui-menu/ui-menu.css +69 -0
- package/src/elements/ui-menu/ui-menu.html +20 -0
- package/src/elements/ui-menu/ui-menu.ts +267 -0
- package/src/elements/ui-procurar/ui-procurar.css +48 -0
- package/src/elements/ui-procurar/ui-procurar.html +14 -0
- package/src/elements/ui-procurar/ui-procurar.ts +82 -0
- package/src/elements/ui-progress/ui-progress.css +0 -0
- package/src/elements/ui-progress/ui-progress.html +1 -0
- package/src/elements/ui-progress/ui-progress.ts +15 -0
- package/src/elements/ui-select/ui-select.css +211 -0
- package/src/elements/ui-select/ui-select.html +46 -0
- package/src/elements/ui-select/ui-select.ts +482 -0
- package/src/elements/ui-slide/ui-slide.css +75 -0
- package/src/elements/ui-slide/ui-slide.html +7 -0
- package/src/elements/ui-slide/ui-slide.ts +61 -0
- package/src/fields/Base/BaseFieldsForm/BaseFieldsForm.component.ts +113 -0
- package/src/fields/Base/BaseFieldsValues/BaseFieldsValues.ts +112 -0
- package/src/fields/Formulario/Formulario.ts +1056 -0
- package/src/fields/Formulario/form-action/form-action.css +98 -0
- package/src/fields/Formulario/form-action/form-action.html +75 -0
- package/src/fields/Formulario/form-action/form-action.ts +187 -0
- package/src/fields/Formulario/form-controls/form-controls.css +108 -0
- package/src/fields/Formulario/form-controls/form-controls.html +105 -0
- package/src/fields/Formulario/form-controls/form-controls.ts +122 -0
- package/src/fields/Formulario/form-fase/form-fase.css +84 -0
- package/src/fields/Formulario/form-fase/form-fase.html +24 -0
- package/src/fields/Formulario/form-fase/form-fase.ts +157 -0
- package/src/fields/Formulario/form-filter/form-filter.css +50 -0
- package/src/fields/Formulario/form-filter/form-filter.html +25 -0
- package/src/fields/Formulario/form-filter/form-filter.ts +53 -0
- package/src/fields/Formulario/form-no-action/form-no-action.css +32 -0
- package/src/fields/Formulario/form-no-action/form-no-action.html +12 -0
- package/src/fields/Formulario/form-no-action/form-no-action.ts +21 -0
- package/src/fields/Formulario/formated-values/formated-values.css +104 -0
- package/src/fields/Formulario/formated-values/formated-values.html +15 -0
- package/src/fields/Formulario/formated-values/formated-values.ts +186 -0
- package/src/fields/Formulario/single-values/single-values.css +88 -0
- package/src/fields/Formulario/single-values/single-values.html +11 -0
- package/src/fields/Formulario/single-values/single-values.ts +65 -0
- package/src/fields/autocomplete/autocomplete.css +94 -0
- package/src/fields/autocomplete/autocomplete.html +38 -0
- package/src/fields/autocomplete/autocomplete.ts +294 -0
- package/src/fields/button/button.css +7 -0
- package/src/fields/button/button.html +19 -0
- package/src/fields/button/button.ts +38 -0
- package/src/fields/checkbox/checkbox.css +27 -0
- package/src/fields/checkbox/checkbox.html +20 -0
- package/src/fields/checkbox/checkbox.ts +44 -0
- package/src/fields/color/CirculoColorido/circulocolorido.css +50 -0
- package/src/fields/color/CirculoColorido/circulocolorido.html +8 -0
- package/src/fields/color/CirculoColorido/circulocolorido.ts +24 -0
- package/src/fields/color/color.css +15 -0
- package/src/fields/color/color.html +24 -0
- package/src/fields/color/color.ts +47 -0
- package/src/fields/date/date.html +19 -0
- package/src/fields/date/date.ts +29 -0
- package/src/fields/datetime/datetime.html +19 -0
- package/src/fields/datetime/datetime.ts +29 -0
- package/src/fields/display/display.css +7 -0
- package/src/fields/display/display.html +20 -0
- package/src/fields/display/display.ts +43 -0
- package/src/fields/editor/editor.css +51 -0
- package/src/fields/editor/editor.html +37 -0
- package/src/fields/editor/editor.ts +218 -0
- package/src/fields/email/email.html +19 -0
- package/src/fields/email/email.ts +29 -0
- package/src/fields/fields.css +180 -0
- package/src/fields/generic/generic.html +3 -0
- package/src/fields/generic/generic.ts +91 -0
- package/src/fields/hidden/hidden.html +3 -0
- package/src/fields/hidden/hidden.ts +20 -0
- package/src/fields/icon/icon.css +19 -0
- package/src/fields/icon/icon.html +27 -0
- package/src/fields/icon/icon.ts +31 -0
- package/src/fields/multifactor/multifactor.css +21 -0
- package/src/fields/multifactor/multifactor.html +39 -0
- package/src/fields/multifactor/multifactor.ts +106 -0
- package/src/fields/multikv/multikv.css +43 -0
- package/src/fields/multikv/multikv.html +47 -0
- package/src/fields/multikv/multikv.ts +88 -0
- package/src/fields/multitext/multitext.css +36 -0
- package/src/fields/multitext/multitext.html +38 -0
- package/src/fields/multitext/multitext.ts +75 -0
- package/src/fields/number/number.html +20 -0
- package/src/fields/number/number.ts +35 -0
- package/src/fields/password/password.html +23 -0
- package/src/fields/password/password.ts +37 -0
- package/src/fields/search/search.css +0 -0
- package/src/fields/search/search.html +19 -0
- package/src/fields/search/search.ts +54 -0
- package/src/fields/select/select.css +15 -0
- package/src/fields/select/select.html +18 -0
- package/src/fields/select/select.ts +52 -0
- package/src/fields/slide/slide.css +27 -0
- package/src/fields/slide/slide.html +20 -0
- package/src/fields/slide/slide.ts +45 -0
- package/src/fields/text/text.html +19 -0
- package/src/fields/text/text.ts +30 -0
- package/src/fields/textarea/textarea.css +4 -0
- package/src/fields/textarea/textarea.html +20 -0
- package/src/fields/textarea/textarea.ts +31 -0
- package/src/fields/time/time.html +19 -0
- package/src/fields/time/time.ts +29 -0
- package/src/fields/upload/upload.css +24 -0
- package/src/fields/upload/upload.html +41 -0
- package/src/fields/upload/upload.ts +137 -0
- package/src/interfaces/interfaces.ts +61 -0
- package/src/public-api.ts +38 -0
- package/src/util/ClassOf.pipe.ts +11 -0
- package/src/util/JsonColorido.pipe.ts +11 -0
- package/src/util/util.ts +2151 -0
- package/tsconfig.lib.json +16 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +13 -0
- package/fesm2022/masterkeymaterial-ui.mjs +0 -6457
- package/fesm2022/masterkeymaterial-ui.mjs.map +0 -1
- package/types/masterkeymaterial-ui.d.ts +0 -928
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* FASES */
|
|
2
|
+
.faseButtons {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
height: 45px;
|
|
8
|
+
flex: 1;
|
|
9
|
+
gap: 1px;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.faseUnderline {
|
|
14
|
+
height: 1px;
|
|
15
|
+
background-color: var(--sys-outline);
|
|
16
|
+
margin-top: 0px;
|
|
17
|
+
margin-bottom: var(--MasterGap);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.faseUnderline.underline-linear {
|
|
21
|
+
margin-top: 5px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.fase-linha-entre-botoes {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: stretch;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0px;
|
|
31
|
+
left: 0px;
|
|
32
|
+
right: 0px;
|
|
33
|
+
bottom: 0px;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.fase-linha-central {
|
|
38
|
+
width: 99%;
|
|
39
|
+
height: 1px;
|
|
40
|
+
background-color: var(--sys-outline);
|
|
41
|
+
align-self: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.faseButtons .todosBotoes {
|
|
45
|
+
--ui-align-items: center;
|
|
46
|
+
--ui-height: 45px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.faseBotao {
|
|
50
|
+
background-color: var(--sys-card);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.faseButtons .faseBotao.ativo {
|
|
54
|
+
--ui-background: color-mix(in srgb, var(--sys-background) 50%, transparent 50%);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.faseButtons .faseBotao:not(.ativo) {
|
|
58
|
+
--ui-outline-color: color-mix(in srgb, var(--sys-background) 50%, transparent 50%);
|
|
59
|
+
--ui-opacity: 0.1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.faseButtons .faseBotao {
|
|
63
|
+
flex: 1;
|
|
64
|
+
position: relative;
|
|
65
|
+
min-width: 120px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.faseHeader {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: row;
|
|
71
|
+
justify-content: flex-start;
|
|
72
|
+
align-items: center;
|
|
73
|
+
position: relative;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.faseHeader.hasGap {
|
|
77
|
+
gap: 15px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.faseHeaderText {
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
flex: 1;
|
|
84
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@if(isFaseado()){
|
|
2
|
+
<div class="faseButtons">
|
|
3
|
+
<ui-button tipo="icon" tema="primary" (clicked)="faseVoltar()" class="todosBotoes" [disabled]="isDisabledVoltar()"
|
|
4
|
+
icone="fa fa-arrow-left" title="Voltar" [radiusTabFormat]="!isLinear()"></ui-button>
|
|
5
|
+
<div class="faseButtons faseHeader" [class.hasGap]="isLinear()">
|
|
6
|
+
@if(isLinear()){
|
|
7
|
+
<div class="fase-linha-entre-botoes">
|
|
8
|
+
<div class="fase-linha-central"></div>
|
|
9
|
+
</div>
|
|
10
|
+
}
|
|
11
|
+
@for (fase of fasesList(); track $index) {
|
|
12
|
+
<ui-button tipo="nofill" tema="primary" class="todosBotoes faseBotao" (clicked)="faseAvancar($index)"
|
|
13
|
+
[class.ativo]="faseIndex() == $index" [disabled]="fase.disabled" [icone]="fase.icone" [title]="fase.nome"
|
|
14
|
+
[radiusTabFormat]="!isLinear()">
|
|
15
|
+
<div class="faseHeaderText" [innerHTML]="fase.nome"></div>
|
|
16
|
+
</ui-button>
|
|
17
|
+
}
|
|
18
|
+
</div>
|
|
19
|
+
<ui-button tipo="nofill" tema="primary" (clicked)="faseAvancar()" class="todosBotoes" [disabled]="isDisabledAvancar()"
|
|
20
|
+
icone="fa fa-arrow-right" [iconeAntes]="false" [iconeDepois]="true" title="Proximo"
|
|
21
|
+
[radiusTabFormat]="!isLinear()"></ui-button>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="faseUnderline" [class.underline-linear]="isLinear()"></div>
|
|
24
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Component, computed, effect, input, model, OnInit, signal } from '@angular/core';
|
|
2
|
+
import { UiButton } from "../../../elements/ui-button/ui-button";
|
|
3
|
+
import { IFaseCampos, IFases, IFieldComponent } from '../Formulario';
|
|
4
|
+
import { LOG } from '../../../util/util';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'ui-form-fase',
|
|
8
|
+
templateUrl: './form-fase.html',
|
|
9
|
+
styleUrls: ['./form-fase.css'],
|
|
10
|
+
imports: [UiButton],
|
|
11
|
+
})
|
|
12
|
+
export class FormFase implements OnInit {
|
|
13
|
+
|
|
14
|
+
fases = model<IFases<any>>();
|
|
15
|
+
campos = input<IFieldComponent<any>[]>();
|
|
16
|
+
|
|
17
|
+
isDisabledVoltar = signal(true);
|
|
18
|
+
isDisabledAvancar = signal(true);
|
|
19
|
+
isFaseado = computed(() => {
|
|
20
|
+
let fases = this.fases()?.fases;
|
|
21
|
+
return fases !== undefined && fases.length > 1; // 1 é faseado mas não tem navegação, mais de 1 é faseado com navegação
|
|
22
|
+
});
|
|
23
|
+
fasesList = computed(() => {
|
|
24
|
+
return this.fases()?.fases ?? [];
|
|
25
|
+
});
|
|
26
|
+
faseIndex = model<number>(0);
|
|
27
|
+
fase_historico = signal<number[]>([0]);
|
|
28
|
+
isLinear = computed(() => this.fases()?.isLinear ?? false);
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
effect(() => {
|
|
32
|
+
let fases = this.fases()?.fases;
|
|
33
|
+
if (fases == null) {
|
|
34
|
+
this.isDisabledAvancar.set(true);
|
|
35
|
+
this.isDisabledVoltar.set(true);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.isDisabledVoltar.set(this.faseIndex() <= 0);
|
|
39
|
+
this.isDisabledAvancar.set(this.faseIndex() >= (fases.length - 1));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
ngOnInit(): void {
|
|
43
|
+
let campos = this.campos();
|
|
44
|
+
let fases = this.fases();
|
|
45
|
+
|
|
46
|
+
if (campos == null || fases == null) return;
|
|
47
|
+
let semFase = this.checkCamposInFase(campos, fases);
|
|
48
|
+
if (semFase.length > 0) {
|
|
49
|
+
semFase.forEach(prop => {
|
|
50
|
+
this.fases.update(f => {
|
|
51
|
+
if (f) {
|
|
52
|
+
// Adiciona os campos sem fase a primeira fase, se ela existir.
|
|
53
|
+
if (f.fases.length > 0) {
|
|
54
|
+
let primeiraFase = f.fases[0];
|
|
55
|
+
if (!primeiraFase.campos.includes(prop)) {
|
|
56
|
+
primeiraFase.campos.push(prop);
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
// Se não houver fase, cria uma nova fase e adiciona os campos sem fase nela.
|
|
60
|
+
f.fases.push({
|
|
61
|
+
nome: "Geral",
|
|
62
|
+
campos: [prop],
|
|
63
|
+
} as IFaseCampos<any>);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return f;
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// LOG(1, "Fases configuradas:", this.fases());
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
faseAvancar(faseIndex?: number): void {
|
|
74
|
+
let fases = this.fases()?.fases;
|
|
75
|
+
if (fases == null) return;
|
|
76
|
+
|
|
77
|
+
if (faseIndex != null) {
|
|
78
|
+
let proximaFaseIndex = fases.indexOf(fases[faseIndex]);
|
|
79
|
+
if (proximaFaseIndex !== -1) {
|
|
80
|
+
if (proximaFaseIndex !== this.faseIndex()) {
|
|
81
|
+
this.faseIndex.set(faseIndex);
|
|
82
|
+
this.fase_historico.update(h => { h = [...h, faseIndex]; return h; });
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
LOG(1, "Fase informada não existe.");
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
let proximaFaseIndex = fases.indexOf(fases[this.faseIndex() + 1]);
|
|
89
|
+
if (proximaFaseIndex !== -1) {
|
|
90
|
+
if (proximaFaseIndex !== this.faseIndex()) {
|
|
91
|
+
this.faseIndex.set(proximaFaseIndex);
|
|
92
|
+
this.fase_historico.update(h => { h = [...h, proximaFaseIndex]; return h; });
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
LOG(1, "Não há próxima fase para avançar.");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
faseVoltar(): void {
|
|
100
|
+
let fases = this.fases()?.fases;
|
|
101
|
+
if (fases == null) return;
|
|
102
|
+
|
|
103
|
+
if (this.faseIndex() > 0) {
|
|
104
|
+
this.fase_historico.update(h => { h.pop(); return h; });
|
|
105
|
+
let ultimaFaseDoHistorico = this.fase_historico()[this.fase_historico().length - 1];
|
|
106
|
+
if (ultimaFaseDoHistorico != null) {
|
|
107
|
+
this.faseIndex.set(ultimaFaseDoHistorico);
|
|
108
|
+
} else {
|
|
109
|
+
LOG(1, "Não para onde voltar.");
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
this.faseIndex.set(0);
|
|
113
|
+
this.fase_historico.set([0]);
|
|
114
|
+
LOG(1, "Já está na primeira fase possível.")
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
checkCamposInFase(campos: IFieldComponent<any>[], fases: IFases<any>): string[] {
|
|
121
|
+
// Verifica e informa no console se todos os campos recebidos estão presentes em alguma fase
|
|
122
|
+
let camposNomes = campos.map(c => c.prop);
|
|
123
|
+
let camposEmFases: string[] = [];
|
|
124
|
+
let camposNaoEmFases: string[] = [];
|
|
125
|
+
for (let campoNome of camposNomes) {
|
|
126
|
+
let encontrado = false;
|
|
127
|
+
for (let fase of fases.fases) {
|
|
128
|
+
for (let campoOrGrupo of fase.campos) {
|
|
129
|
+
if (typeof campoOrGrupo === 'string') {
|
|
130
|
+
if (campoOrGrupo === campoNome) {
|
|
131
|
+
encontrado = true;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
if (campoOrGrupo.campos.includes(campoNome)) {
|
|
136
|
+
encontrado = true;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (encontrado) break;
|
|
142
|
+
}
|
|
143
|
+
if (encontrado) {
|
|
144
|
+
camposEmFases.push(campoNome);
|
|
145
|
+
} else {
|
|
146
|
+
camposNaoEmFases.push(campoNome);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// if (camposNaoEmFases.length > 0) {
|
|
150
|
+
// LOG(1, "⚠️ Campos sem fase:", camposNaoEmFases);
|
|
151
|
+
// } else {
|
|
152
|
+
// LOG(1, "✔️ Todos os campos estão presentes em alguma fase.");
|
|
153
|
+
// }
|
|
154
|
+
return camposNaoEmFases;
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
margin-top: 10px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.buttonsGap {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: var(--ui-form-flex-direction, column);
|
|
10
|
+
gap: var(--MasterGap);
|
|
11
|
+
margin-top: var(--MasterGap);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.filtrosAtivos {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
gap: var(--MasterGap);
|
|
18
|
+
margin-bottom: var(--MasterGap);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.filtrosAtivos div {
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 2px;
|
|
24
|
+
align-items: center;
|
|
25
|
+
background-color: var(--sys-high-15);
|
|
26
|
+
padding: 0 0 0 1rem;
|
|
27
|
+
border-radius: var(--MasterRadius);
|
|
28
|
+
font-size: 0.9rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.fieldHidden {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.areaValues {
|
|
36
|
+
outline: 1px solid color-mix(in srgb, var(--sys-outline) 50%, transparent 50%);
|
|
37
|
+
background-color: color-mix(in srgb, var(--sys-card) 80%, var(--sys-background) 20%);
|
|
38
|
+
border-radius: var(--MasterRadius);
|
|
39
|
+
padding: 0.5rem;
|
|
40
|
+
gap: var(--MasterGap);
|
|
41
|
+
margin-top: var(--MasterGap);
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
flex-wrap: wrap;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.areaValues .card {
|
|
48
|
+
flex: 1;
|
|
49
|
+
overflow: auto;
|
|
50
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div class="filtrosAtivos">
|
|
2
|
+
@for ( item of kvPreenchido(); track $index) {
|
|
3
|
+
<div>
|
|
4
|
+
{{ item.v }}
|
|
5
|
+
<ui-button tipo="icon" tema="error" icone="bi bi-x" (click)="onDeletePropriedade(item.k)">
|
|
6
|
+
</ui-button>
|
|
7
|
+
</div>
|
|
8
|
+
}
|
|
9
|
+
</div>
|
|
10
|
+
<div class="g-fields" [style.--g-fields-min]="gmin()" [style.--g-fields-max]="gmax()">
|
|
11
|
+
|
|
12
|
+
@for (campo of form.listaCampos(); track $index) {
|
|
13
|
+
<fields-g [form]="form" [name]="campo.prop" [class]="campo.tipo == 'hidden' ? 'fieldHidden' : ''"></fields-g>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
<div class="buttonsGap">
|
|
18
|
+
<ui-button tipo="fill" tema="primary" icone="bi bi-funnel" (click)="onFiltrar()">{{ actionTitle() }}</ui-button>
|
|
19
|
+
<ng-content></ng-content>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
@if(showFormControls()){
|
|
23
|
+
<ui-form-controls [form]="form" [recebido]="this.values()" [(hasOutline)]="hasOutline" [faseIndex]="faseIndex()"
|
|
24
|
+
[totalFases]="listaFase().length"></ui-form-controls>
|
|
25
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Component, computed, input, model, output } from '@angular/core';
|
|
2
|
+
import { UiButton } from "../../../elements/ui-button/ui-button";
|
|
3
|
+
import { BaseFieldsValues } from '../../Base/BaseFieldsValues/BaseFieldsValues';
|
|
4
|
+
import { FieldsGeneric } from '../../generic/generic';
|
|
5
|
+
import { LibUtil } from '../../../util/util';
|
|
6
|
+
import { IKV } from '../../../interfaces/interfaces';
|
|
7
|
+
import { FormControls } from "../form-controls/form-controls";
|
|
8
|
+
import { IField, IFields } from '../Formulario';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'fields-form-filter',
|
|
12
|
+
templateUrl: './form-filter.html',
|
|
13
|
+
styleUrl: './form-filter.css',
|
|
14
|
+
imports: [UiButton, FieldsGeneric, FormControls],
|
|
15
|
+
})
|
|
16
|
+
export class FormFilter<T> extends BaseFieldsValues<T> {
|
|
17
|
+
|
|
18
|
+
async onSave() {
|
|
19
|
+
// Não faz nada.
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
hasOutline = model<boolean>(false);
|
|
24
|
+
filtrar = output<any>();
|
|
25
|
+
actionTitle = input<string>('Aplicar Filtro');
|
|
26
|
+
|
|
27
|
+
onFiltrar() {
|
|
28
|
+
let valores = LibUtil.clonar(this.form.values());
|
|
29
|
+
valores = LibUtil.limparObject(valores);
|
|
30
|
+
this.filtrar.emit(valores);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
kvPreenchido = computed(() => {
|
|
34
|
+
let propriedades: IKV[] = [];
|
|
35
|
+
let valores = this.values() as any;
|
|
36
|
+
if (!valores) return propriedades;
|
|
37
|
+
let campos = this.campos();
|
|
38
|
+
for (const key of Object.keys(campos)) {
|
|
39
|
+
let campo = campos[key];
|
|
40
|
+
if (campo.tipo === IField.Hidden) continue;
|
|
41
|
+
if (valores?.[key] != null && valores?.[key] !== '' && !(Array.isArray(valores?.[key]) && valores?.[key].length === 0)) {
|
|
42
|
+
propriedades.push({ k: campo.prop, v: campo.titulo ?? String(campo.prop) });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return propriedades;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
onDeletePropriedade(k: string | number | null | undefined) {
|
|
49
|
+
if (k == null) return;
|
|
50
|
+
this.form.updateValues({ [k as keyof IFields<T>]: '' });
|
|
51
|
+
this.onFiltrar();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.buttonsGap {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: var(--ui-form-flex-direction, column);
|
|
9
|
+
gap: var(--MasterGap);
|
|
10
|
+
margin-top: var(--MasterGap);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.fieldHidden {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.areaValues {
|
|
18
|
+
outline: 1px solid color-mix(in srgb, var(--sys-outline) 50%, transparent 50%);
|
|
19
|
+
background-color: color-mix(in srgb, var(--sys-card) 80%, var(--sys-background) 20%);
|
|
20
|
+
border-radius: var(--MasterRadius);
|
|
21
|
+
padding: 0.5rem;
|
|
22
|
+
gap: var(--MasterGap);
|
|
23
|
+
margin-top: var(--MasterGap);
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.areaValues .card {
|
|
30
|
+
flex: 1;
|
|
31
|
+
overflow: auto;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="g-fields" [style.--g-fields-min]="gmin()" [style.--g-fields-max]="gmax()">
|
|
2
|
+
|
|
3
|
+
@for (campo of form.listaCampos(); track $index) {
|
|
4
|
+
<fields-g [form]="form" [name]="campo.prop" [class]="campo.tipo == 'hidden' ? 'fieldHidden' : ''"></fields-g>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
@if(showFormControls()){
|
|
10
|
+
<ui-form-controls [form]="form" [recebido]="this.values()" [(hasOutline)]="hasOutline" [faseIndex]="faseIndex()"
|
|
11
|
+
[totalFases]="listaFase().length"></ui-form-controls>
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, model } from '@angular/core';
|
|
2
|
+
import { FieldsGeneric } from '../../generic/generic';
|
|
3
|
+
import { BaseFieldsValues } from '../../Base/BaseFieldsValues/BaseFieldsValues';
|
|
4
|
+
import { FormControls } from "../form-controls/form-controls";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'fields-form-no-action',
|
|
8
|
+
templateUrl: './form-no-action.html',
|
|
9
|
+
styleUrl: './form-no-action.css',
|
|
10
|
+
imports: [FieldsGeneric, FormControls],
|
|
11
|
+
})
|
|
12
|
+
export class FormNoAction<T> extends BaseFieldsValues<T> {
|
|
13
|
+
|
|
14
|
+
async onSave() {
|
|
15
|
+
// Não faz nada.
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
hasOutline = model<boolean>(false);
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
.showEntidade {
|
|
2
|
+
margin-top: 5px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.linhaDado {
|
|
6
|
+
border: 1px solid transparent;
|
|
7
|
+
border-bottom: 1px dotted var(--sys-primary-15);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.titulo {
|
|
11
|
+
font-weight: 600;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.linhaDado.isEspecial .titulo {
|
|
15
|
+
color: var(--sys-secondary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.conteudo {
|
|
19
|
+
color: color-mix(in srgb, var(--sys-secondary) 50%, var(--sys-on-background) 50%);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.linhaDado:hover {
|
|
23
|
+
border-bottom: 1px solid var(--sys-secondary);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.showEntidade.cantos .linhaDado {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
gap: calc(var(--MasterGap) / 2);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.showEntidade.centro .linhaDado {
|
|
36
|
+
display: grid;
|
|
37
|
+
grid-template-columns: 1fr 1fr;
|
|
38
|
+
gap: calc(var(--MasterGap) / 2);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.showEntidade.centro .titulo {
|
|
42
|
+
text-align: end;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.showEntidade.esquerda .linhaDado {
|
|
46
|
+
display: grid;
|
|
47
|
+
grid-template-columns: auto 1fr;
|
|
48
|
+
gap: calc(var(--MasterGap) / 2);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
.showEntidade.grid {
|
|
53
|
+
display: grid;
|
|
54
|
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
|
55
|
+
gap: calc(var(--MasterGap) / 4);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.showEntidade.grid .linhaDado {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
border: 1px solid var(--sys-primary-15);
|
|
63
|
+
border-radius: var(--MasterRadius);
|
|
64
|
+
padding: calc(var(--MasterGap) / 2);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.showEntidade.grid .linhaDado:hover {
|
|
68
|
+
border: 1px solid var(--sys-secondary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.showEntidade.wrap {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-wrap: wrap;
|
|
74
|
+
gap: calc(var(--MasterGap) / 2);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.showEntidade.wrap .linhaDado {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
border: 1px solid var(--sys-primary-15);
|
|
82
|
+
border-radius: var(--MasterRadius);
|
|
83
|
+
padding: calc(var(--MasterGap) / 2);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.showEntidade.wrap .linhaDado:hover {
|
|
87
|
+
border: 1px solid var(--sys-secondary);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (max-width: 600px) {
|
|
91
|
+
|
|
92
|
+
.showEntidade.cantos .linhaDado,
|
|
93
|
+
.showEntidade.centro .linhaDado,
|
|
94
|
+
.showEntidade.esquerda .linhaDado,
|
|
95
|
+
.showEntidade.cantos .linhaDado *,
|
|
96
|
+
.showEntidade.centro .linhaDado *,
|
|
97
|
+
.showEntidade.esquerda .linhaDado * {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
flex-wrap: wrap;
|
|
101
|
+
gap: calc(var(--MasterGap) / 4);
|
|
102
|
+
text-align: start;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div [class]="modo()" [class.showEntidade]="true">
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@for (field of camposFormatados(); track $index) {
|
|
5
|
+
<div class="linhaDado" [class.isEspecial]="field.isEspecial">
|
|
6
|
+
<div class="titulo" [innerHTML]="field.label"></div>
|
|
7
|
+
<!-- @if(field.isInner){ -->
|
|
8
|
+
<div class="conteudo" [innerHTML]="field.value"></div>
|
|
9
|
+
<!-- }@else {
|
|
10
|
+
<build-component [componente]="field.value" [inputs]="field.inputs"></build-component>
|
|
11
|
+
} -->
|
|
12
|
+
</div>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
</div>
|