@yakuzaa/jade 0.1.16 → 0.1.18
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/commands/html.js +5 -5
- package/package.json +1 -1
package/commands/html.js
CHANGED
|
@@ -463,7 +463,7 @@ function exportarCSV(dados, nomeArquivo) {
|
|
|
463
463
|
campos.join(';'),
|
|
464
464
|
...dados.map(r => campos.map(c => {
|
|
465
465
|
const v = String(r[c] ?? '').replace(/"/g, '""');
|
|
466
|
-
return
|
|
466
|
+
return '"' + v + '"';
|
|
467
467
|
}).join(';'))
|
|
468
468
|
];
|
|
469
469
|
const bom = '\uFEFF'; // UTF-8 BOM para Excel
|
|
@@ -703,7 +703,7 @@ async function iniciar() {
|
|
|
703
703
|
if (entidade) {
|
|
704
704
|
const dados = await db.find(entidade).catch(() => []);
|
|
705
705
|
exportarCSV(dados, entidade);
|
|
706
|
-
ui.mostrarNotificacao(
|
|
706
|
+
ui.mostrarNotificacao(entidade + ' exportado com sucesso', 'sucesso');
|
|
707
707
|
}
|
|
708
708
|
window.dispatchEvent(new CustomEvent('jade:acao:concluido', { detail: { acao } }));
|
|
709
709
|
return;
|
|
@@ -737,7 +737,7 @@ async function iniciar() {
|
|
|
737
737
|
await db.insert(entidade, dados);
|
|
738
738
|
const registros = await db.find(entidade);
|
|
739
739
|
ui.setDadosEntidade?.(entidade, registros);
|
|
740
|
-
ui.mostrarNotificacao(
|
|
740
|
+
ui.mostrarNotificacao(entidade + ' criado com sucesso', 'sucesso');
|
|
741
741
|
} catch (err) {
|
|
742
742
|
ui.mostrarNotificacao('Erro ao criar: ' + (err?.message ?? err), 'erro');
|
|
743
743
|
}
|
|
@@ -750,7 +750,7 @@ async function iniciar() {
|
|
|
750
750
|
await db.update(entidade, id, dados);
|
|
751
751
|
const registros = await db.find(entidade);
|
|
752
752
|
ui.setDadosEntidade?.(entidade, registros);
|
|
753
|
-
ui.mostrarNotificacao(
|
|
753
|
+
ui.mostrarNotificacao(entidade + ' atualizado', 'sucesso');
|
|
754
754
|
} catch (err) {
|
|
755
755
|
ui.mostrarNotificacao('Erro ao atualizar: ' + (err?.message ?? err), 'erro');
|
|
756
756
|
}
|
|
@@ -763,7 +763,7 @@ async function iniciar() {
|
|
|
763
763
|
await db.delete(entidade, id);
|
|
764
764
|
const registros = await db.find(entidade);
|
|
765
765
|
ui.setDadosEntidade?.(entidade, registros);
|
|
766
|
-
ui.mostrarNotificacao(
|
|
766
|
+
ui.mostrarNotificacao(entidade + ' excluído', 'info');
|
|
767
767
|
} catch (err) {
|
|
768
768
|
ui.mostrarNotificacao('Erro ao excluir: ' + (err?.message ?? err), 'erro');
|
|
769
769
|
}
|