@nixweb/nixloc-ui 0.0.103 → 0.0.104
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/ckeditor5/README.md +1 -1
- package/ckeditor5/build/ckeditor.js +2 -2
- package/ckeditor5/build/ckeditor.js.map +1 -1
- package/ckeditor5/build/translations/af.js +1 -1
- package/ckeditor5/build/translations/ar.js +1 -1
- package/ckeditor5/build/translations/ast.js +1 -1
- package/ckeditor5/build/translations/az.js +1 -1
- package/ckeditor5/build/translations/bg.js +1 -1
- package/ckeditor5/build/translations/bs.js +1 -1
- package/ckeditor5/build/translations/ca.js +1 -1
- package/ckeditor5/build/translations/cs.js +1 -1
- package/ckeditor5/build/translations/da.js +1 -1
- package/ckeditor5/build/translations/de-ch.js +1 -1
- package/ckeditor5/build/translations/de.js +1 -1
- package/ckeditor5/build/translations/el.js +1 -1
- package/ckeditor5/build/translations/en-au.js +1 -1
- package/ckeditor5/build/translations/en-gb.js +1 -1
- package/ckeditor5/build/translations/en.js +1 -1
- package/ckeditor5/build/translations/eo.js +1 -1
- package/ckeditor5/build/translations/es.js +1 -1
- package/ckeditor5/build/translations/et.js +1 -1
- package/ckeditor5/build/translations/eu.js +1 -1
- package/ckeditor5/build/translations/fa.js +1 -1
- package/ckeditor5/build/translations/fi.js +1 -1
- package/ckeditor5/build/translations/fr.js +1 -1
- package/ckeditor5/build/translations/gl.js +1 -1
- package/ckeditor5/build/translations/gu.js +1 -1
- package/ckeditor5/build/translations/he.js +1 -1
- package/ckeditor5/build/translations/hi.js +1 -1
- package/ckeditor5/build/translations/hr.js +1 -1
- package/ckeditor5/build/translations/hu.js +1 -1
- package/ckeditor5/build/translations/id.js +1 -1
- package/ckeditor5/build/translations/it.js +1 -1
- package/ckeditor5/build/translations/ja.js +1 -1
- package/ckeditor5/build/translations/jv.js +1 -0
- package/ckeditor5/build/translations/km.js +1 -1
- package/ckeditor5/build/translations/kn.js +1 -1
- package/ckeditor5/build/translations/ko.js +1 -1
- package/ckeditor5/build/translations/ku.js +1 -1
- package/ckeditor5/build/translations/lt.js +1 -1
- package/ckeditor5/build/translations/lv.js +1 -1
- package/ckeditor5/build/translations/nb.js +1 -1
- package/ckeditor5/build/translations/ne.js +1 -1
- package/ckeditor5/build/translations/nl.js +1 -1
- package/ckeditor5/build/translations/no.js +1 -1
- package/ckeditor5/build/translations/oc.js +1 -1
- package/ckeditor5/build/translations/pl.js +1 -1
- package/ckeditor5/build/translations/pt.js +1 -1
- package/ckeditor5/build/translations/ro.js +1 -1
- package/ckeditor5/build/translations/ru.js +1 -1
- package/ckeditor5/build/translations/si.js +1 -1
- package/ckeditor5/build/translations/sk.js +1 -1
- package/ckeditor5/build/translations/sl.js +1 -1
- package/ckeditor5/build/translations/sq.js +1 -1
- package/ckeditor5/build/translations/sr-latn.js +1 -1
- package/ckeditor5/build/translations/sr.js +1 -1
- package/ckeditor5/build/translations/sv.js +1 -1
- package/ckeditor5/build/translations/th.js +1 -1
- package/ckeditor5/build/translations/tk.js +1 -1
- package/ckeditor5/build/translations/tr.js +1 -1
- package/ckeditor5/build/translations/tt.js +1 -1
- package/ckeditor5/build/translations/ug.js +1 -1
- package/ckeditor5/build/translations/uk.js +1 -1
- package/ckeditor5/build/translations/uz.js +1 -1
- package/ckeditor5/build/translations/vi.js +1 -1
- package/ckeditor5/build/translations/zh-cn.js +1 -1
- package/ckeditor5/build/translations/zh.js +1 -1
- package/ckeditor5/package.json +23 -20
- package/ckeditor5/sample/index.html +1 -1
- package/ckeditor5/src/ckeditor.js +20 -10
- package/package.json +1 -1
- package/src/component/forms/Modal.vue +5 -1
- package/src/component/shared/CodigoEditor.vue +3 -0
- package/src/component/shared/ConfiguracaoTabela.vue +54 -0
- package/src/component/shared/DocumentoEditor.vue +19 -13
- package/src/component/shared/DocumentoPreview.vue +25 -0
- package/src/component/template/ModeloDocumentoView.vue +68 -15
- package/src/store/modulos/generic.js +80 -1
|
@@ -15,20 +15,41 @@
|
|
|
15
15
|
<b-col sm="6">
|
|
16
16
|
<div class="lado-a-lado">
|
|
17
17
|
<Botao
|
|
18
|
-
chave="
|
|
18
|
+
chave="salvarDocumento"
|
|
19
19
|
tipo="sucesso"
|
|
20
|
-
titulo="Salvar
|
|
20
|
+
titulo="Salvar"
|
|
21
21
|
classeIcone="fas fa-save"
|
|
22
|
+
:desabilitado="salvarDesabilitado"
|
|
22
23
|
tamanho="pequeno"
|
|
24
|
+
:clique="salvarDocumento"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="lado-a-lado">
|
|
28
|
+
<Botao
|
|
29
|
+
v-if="id"
|
|
30
|
+
chave="fazerCopia"
|
|
31
|
+
tipo="sucesso"
|
|
32
|
+
titulo="Fazer uma cópia"
|
|
33
|
+
classeIcone="fas fa-clone"
|
|
34
|
+
tamanho="pequeno"
|
|
35
|
+
:clique="fazerCopia"
|
|
23
36
|
/>
|
|
24
37
|
</div>
|
|
25
38
|
</b-col>
|
|
26
39
|
<b-col class="text-right" sm="6">
|
|
40
|
+
<div class="lado-a-lado">
|
|
41
|
+
<Botao
|
|
42
|
+
chave="abrirConfiguracao"
|
|
43
|
+
tipo="info"
|
|
44
|
+
classeIcone="fas fa-tools"
|
|
45
|
+
tamanho="pequeno"
|
|
46
|
+
:clique="abrirConfiguracao"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
27
49
|
<div class="lado-a-lado">
|
|
28
50
|
<Botao
|
|
29
51
|
chave="abrirCodigo"
|
|
30
52
|
tipo="info"
|
|
31
|
-
titulo="Código Fonte"
|
|
32
53
|
classeIcone="far fa-code"
|
|
33
54
|
tamanho="pequeno"
|
|
34
55
|
:clique="abrirCodigo"
|
|
@@ -48,6 +69,14 @@
|
|
|
48
69
|
</b-row>
|
|
49
70
|
</Moldura>
|
|
50
71
|
</div>
|
|
72
|
+
<Modal titulo="Salvar" :largura="500" v-show="mostrarModal('salvarDocumento')">
|
|
73
|
+
<slot></slot>
|
|
74
|
+
</Modal>
|
|
75
|
+
<Modal titulo="Configuração" :largura="700" v-if="mostrarModal('configuracao')">
|
|
76
|
+
<BarraRolagem :alturaMinima="200" :alturaMaxima="400">
|
|
77
|
+
<ConfiguracaoTabela />
|
|
78
|
+
</BarraRolagem>
|
|
79
|
+
</Modal>
|
|
51
80
|
<Modal titulo="Editor de Código" :largura="900" v-if="mostrarModal('codigo')">
|
|
52
81
|
<BarraRolagem :alturaMinima="200" :alturaMaxima="400">
|
|
53
82
|
<CodigoEditor v-if="modal.abrir" />
|
|
@@ -72,7 +101,7 @@
|
|
|
72
101
|
<BarraRolagem :alturaMinima="300" :alturaMaxima="500">
|
|
73
102
|
<div class="a4">
|
|
74
103
|
<div id="printMe">
|
|
75
|
-
<DocumentoPreview :template="
|
|
104
|
+
<DocumentoPreview :template="documentoPreview" :dados="dados" />
|
|
76
105
|
</div>
|
|
77
106
|
</div>
|
|
78
107
|
</BarraRolagem>
|
|
@@ -93,6 +122,7 @@ import Painel from "@nixweb/nixloc-ui/src/component/layout/Painel";
|
|
|
93
122
|
import DocumentoEditor from "@nixweb/nixloc-ui/src/component/shared/DocumentoEditor.vue";
|
|
94
123
|
import DocumentoPreview from "@nixweb/nixloc-ui/src/component/shared/DocumentoPreview.vue";
|
|
95
124
|
import CodigoEditor from "@nixweb/nixloc-ui/src/component/shared/CodigoEditor.vue";
|
|
125
|
+
import ConfiguracaoTabela from "@nixweb/nixloc-ui/src/component/shared/ConfiguracaoTabela.vue";
|
|
96
126
|
import Moldura from "@nixweb/nixloc-ui/src/component/layout/Moldura";
|
|
97
127
|
import Botao from "@nixweb/nixloc-ui/src/component/forms/Botao";
|
|
98
128
|
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
@@ -112,6 +142,7 @@ export default {
|
|
|
112
142
|
DocumentoEditor,
|
|
113
143
|
DocumentoPreview,
|
|
114
144
|
CodigoEditor,
|
|
145
|
+
ConfiguracaoTabela,
|
|
115
146
|
Moldura,
|
|
116
147
|
Botao,
|
|
117
148
|
Modal,
|
|
@@ -121,25 +152,38 @@ export default {
|
|
|
121
152
|
painel: Object,
|
|
122
153
|
dados: Object,
|
|
123
154
|
},
|
|
155
|
+
data() {
|
|
156
|
+
return {
|
|
157
|
+
id: this.$route.params.id,
|
|
158
|
+
salvarDesabilitado: true,
|
|
159
|
+
};
|
|
160
|
+
},
|
|
124
161
|
computed: {
|
|
125
|
-
...mapState("generic", ["modal"]),
|
|
126
|
-
...mapGetters("generic", ["mostrarModal", "evento"]),
|
|
127
|
-
documentoHtml: {
|
|
128
|
-
get() {
|
|
129
|
-
return this.$store.state.generic.documentoHtml;
|
|
130
|
-
},
|
|
131
|
-
set(value) {
|
|
132
|
-
this.atualizaDocumentoHtml(value);
|
|
133
|
-
},
|
|
134
|
-
},
|
|
162
|
+
...mapState("generic", ["modal", "documentoHtml"]),
|
|
163
|
+
...mapGetters("generic", ["mostrarModal", "evento", "documentoPreview"]),
|
|
135
164
|
},
|
|
136
165
|
methods: {
|
|
137
166
|
...mapMutations("generic", [
|
|
138
167
|
"abrirModal",
|
|
139
168
|
"fecharModal",
|
|
140
169
|
"removeCarregando",
|
|
141
|
-
"
|
|
170
|
+
"insereEvento",
|
|
142
171
|
]),
|
|
172
|
+
salvarDocumento() {
|
|
173
|
+
if (this.id) {
|
|
174
|
+
this.insereEvento({ nome: "salvarDocumento" });
|
|
175
|
+
} else {
|
|
176
|
+
this.abrirModal("salvarDocumento");
|
|
177
|
+
this.removeCarregando(["salvarDocumento"]);
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
fazerCopia() {
|
|
181
|
+
this.insereEvento({ nome: "fazerCopia" });
|
|
182
|
+
},
|
|
183
|
+
abrirConfiguracao() {
|
|
184
|
+
this.abrirModal("configuracao");
|
|
185
|
+
this.removeCarregando(["abrirConfiguracao"]);
|
|
186
|
+
},
|
|
143
187
|
abrirCodigo() {
|
|
144
188
|
this.abrirModal("codigo");
|
|
145
189
|
this.removeCarregando(["abrirCodigo"]);
|
|
@@ -152,6 +196,15 @@ export default {
|
|
|
152
196
|
this.removeCarregando(["imprimir"]);
|
|
153
197
|
},
|
|
154
198
|
},
|
|
199
|
+
watch: {
|
|
200
|
+
evento: {
|
|
201
|
+
handler(evento) {
|
|
202
|
+
if (evento.nome == "documentoEditorModificado") this.salvarDesabilitado = true;
|
|
203
|
+
if (evento.nome == "documentoEditoFocus") this.salvarDesabilitado = false;
|
|
204
|
+
},
|
|
205
|
+
deep: true,
|
|
206
|
+
},
|
|
207
|
+
},
|
|
155
208
|
};
|
|
156
209
|
</script>
|
|
157
210
|
<style scoped>
|
|
@@ -65,6 +65,86 @@ export default {
|
|
|
65
65
|
evento: (state) => {
|
|
66
66
|
return state.evento;
|
|
67
67
|
},
|
|
68
|
+
documentoPreview: (state) => {
|
|
69
|
+
let documentoHtml = state.documentoHtml
|
|
70
|
+
let retorno = documentoHtml;
|
|
71
|
+
|
|
72
|
+
var tabelas = document.getElementsByTagName("table");
|
|
73
|
+
let total = tabelas.length;
|
|
74
|
+
|
|
75
|
+
let config = [];
|
|
76
|
+
|
|
77
|
+
let sequencial = 0;
|
|
78
|
+
while (sequencial <= total - 1) {
|
|
79
|
+
|
|
80
|
+
let tabela = document.getElementsByTagName("table")[sequencial];
|
|
81
|
+
let th = tabela.getElementsByTagName("th")[0];
|
|
82
|
+
|
|
83
|
+
let obj = {
|
|
84
|
+
vForAgrupado: "",
|
|
85
|
+
vForSimples: "",
|
|
86
|
+
nomeGrupo: "",
|
|
87
|
+
nomeGrupoReplace: ""
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
if (th) {
|
|
91
|
+
let ehProdutoAgrupado = th.innerText.includes("n.grupo");
|
|
92
|
+
let ehProduto = th.innerText.includes("n.produto");
|
|
93
|
+
let ehPeriodo = th.innerText.includes("n.periodo");
|
|
94
|
+
let ehPagamento = th.innerText.includes("n.pagamento");
|
|
95
|
+
|
|
96
|
+
if (ehProduto) {
|
|
97
|
+
obj.vForSimples = "v-for='n in dados.produto'";
|
|
98
|
+
config.push(obj);
|
|
99
|
+
} else if (ehPeriodo) {
|
|
100
|
+
obj.vForSimples = "v-for='n in dados.periodo'";
|
|
101
|
+
config.push(obj);
|
|
102
|
+
} else if (ehPagamento) {
|
|
103
|
+
obj.vForSimples = "v-for='n in dados.pagamento'";
|
|
104
|
+
config.push(obj);
|
|
105
|
+
} else if (ehProdutoAgrupado) {
|
|
106
|
+
obj.vForAgrupado = "v-for='(produto, grupoNome) in produtoAgrupado'";
|
|
107
|
+
obj.vForSimples = "v-for='n in produto'";
|
|
108
|
+
|
|
109
|
+
var posicaoInicio = documentoHtml.split("<tbody>", sequencial + 1).join("<tbody>").length;
|
|
110
|
+
var posicaoFim = documentoHtml.split("</tbody>", sequencial + 1).join("</tbody>").length;
|
|
111
|
+
|
|
112
|
+
let tbody = documentoHtml.substring(documentoHtml.indexOf("<tbody>", posicaoInicio), documentoHtml.lastIndexOf("</tbody>", posicaoFim));
|
|
113
|
+
|
|
114
|
+
let tr = tbody.substring(tbody.indexOf("<tr>"), tbody.lastIndexOf("</tr>"));
|
|
115
|
+
|
|
116
|
+
obj.nomeGrupo = tr.substring(0, tr.indexOf('</tr>')) + "</tr>";
|
|
117
|
+
obj.nomeGrupo = obj.nomeGrupo.replaceAll("\"", "'");
|
|
118
|
+
obj.nomeGrupoReplace = obj.nomeGrupo.replace("<tr>", "").replace("</tr>", "");
|
|
119
|
+
config.push(obj);
|
|
120
|
+
|
|
121
|
+
} else {
|
|
122
|
+
config.push(obj);
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
config.push(obj);
|
|
126
|
+
}
|
|
127
|
+
sequencial++;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
let replace = "";
|
|
131
|
+
config.forEach(x => {
|
|
132
|
+
replace += `.replace("<tbody>${x.nomeGrupo}<tr>", "<tbody ${x.vForAgrupado}>${x.nomeGrupoReplace}<tr ${x.vForSimples}>")`;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
var ret = retorno.replaceAll("\"", "'");
|
|
136
|
+
ret = eval(`ret${replace}`);
|
|
137
|
+
|
|
138
|
+
var classeImportant = ret
|
|
139
|
+
.replaceAll("n.grupo", "")
|
|
140
|
+
.replaceAll("n.produto", "")
|
|
141
|
+
.replaceAll("n.periodo", "")
|
|
142
|
+
.replaceAll("n.pagamento", "")
|
|
143
|
+
.replaceAll(";", "!important;")
|
|
144
|
+
.replaceAll("<p> !important;</p>", "<p> </p>");
|
|
145
|
+
|
|
146
|
+
return classeImportant;
|
|
147
|
+
}
|
|
68
148
|
},
|
|
69
149
|
mutations: {
|
|
70
150
|
abrirModal: (state, nome) => {
|
|
@@ -126,7 +206,6 @@ export default {
|
|
|
126
206
|
},
|
|
127
207
|
atualizaDocumentoHtml: (state, value) => {
|
|
128
208
|
state.documentoHtml = value;
|
|
129
|
-
|
|
130
209
|
},
|
|
131
210
|
insereEvento: (state, obj) => {
|
|
132
211
|
state.evento.dataHora = new Date();
|