@masterkeymaterial/ui 0.2.9 → 0.2.10

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.
@@ -6111,7 +6111,7 @@ class FormAction extends BaseFieldsValues {
6111
6111
  icone: 'fa fa-handshake',
6112
6112
  task: async () => {
6113
6113
  this.form.setTouchedAll(true);
6114
- return true;
6114
+ return { s: true, m: 'Tocando campos concluído' };
6115
6115
  }
6116
6116
  }]);
6117
6117
  }
@@ -6122,7 +6122,7 @@ class FormAction extends BaseFieldsValues {
6122
6122
  icone: 'fa fa-quidditch-broom-ball',
6123
6123
  task: async () => {
6124
6124
  this.form.sanitizar();
6125
- return true;
6125
+ return { s: true, m: 'Sanitizando concluído' };
6126
6126
  }
6127
6127
  }]);
6128
6128
  }
@@ -6133,7 +6133,7 @@ class FormAction extends BaseFieldsValues {
6133
6133
  icone: 'fa fa-power-off',
6134
6134
  task: async () => {
6135
6135
  this.form.onlyAvailable();
6136
- return true;
6136
+ return { s: true, m: 'Disponíveis para envio concluído' };
6137
6137
  }
6138
6138
  }]);
6139
6139
  }
@@ -6145,10 +6145,10 @@ class FormAction extends BaseFieldsValues {
6145
6145
  task: async () => {
6146
6146
  try {
6147
6147
  await this.form.validar();
6148
- return true;
6148
+ return { s: true, m: 'Validação concluída' };
6149
6149
  }
6150
6150
  catch (e) {
6151
- return false;
6151
+ return { s: false, m: 'Erro na validação' };
6152
6152
  }
6153
6153
  }
6154
6154
  }]);
@@ -6161,11 +6161,11 @@ class FormAction extends BaseFieldsValues {
6161
6161
  task: async () => {
6162
6162
  // Para enviar, o form deve estar válido.
6163
6163
  if (!this.form.valido())
6164
- return false;
6164
+ return { s: false, m: 'Formulário inválido' };
6165
6165
  // Para enviar, deve existir a função de envio.
6166
6166
  let fnEnviar = this.sendValues();
6167
6167
  if (!fnEnviar)
6168
- return false;
6168
+ return { s: false, m: 'Função de envio não definida' };
6169
6169
  // Reinicia o resultado anterior, se houver.
6170
6170
  this.result = null;
6171
6171
  // Obtem os valores do formulário.
@@ -6179,14 +6179,14 @@ class FormAction extends BaseFieldsValues {
6179
6179
  this.sending.emit(false);
6180
6180
  if (this.result != null) {
6181
6181
  // Indica que a tarefa de envio foi concluída com sucesso.
6182
- return true;
6182
+ return { s: true, m: 'Envio concluído' };
6183
6183
  }
6184
6184
  }
6185
6185
  catch (e) {
6186
6186
  LOG(1, "❌ ERRO ao Enviar Valores. ", e);
6187
6187
  }
6188
6188
  // Qualquer outro caso, indica falha.
6189
- return false;
6189
+ return { s: false, m: 'Erro ao enviar valores' };
6190
6190
  }
6191
6191
  }]);
6192
6192
  }
@@ -6208,7 +6208,7 @@ class FormAction extends BaseFieldsValues {
6208
6208
  this.done.emit(actionsDone);
6209
6209
  if (ok)
6210
6210
  this.form.isEnviado = true;
6211
- return ok;
6211
+ return { s: ok, m: ok ? 'Ações concluídas com sucesso' : 'Erro nas ações' };
6212
6212
  }
6213
6213
  }
6214
6214
  ]);
@@ -6220,7 +6220,7 @@ class FormAction extends BaseFieldsValues {
6220
6220
  for await (const task of this.tasksToSave()) {
6221
6221
  // await LibUtil.wait(1000);
6222
6222
  let r = task.task();
6223
- r.then(s => task.success = s).catch(f => task.success = false);
6223
+ r.then(s => task.success = s.s).catch(f => task.success = false);
6224
6224
  await r;
6225
6225
  task.done = true;
6226
6226
  }