@5minds/node-red-dashboard-2-processcube-dynamic-form 2.5.0 → 2.6.0-develop-d70b79-mgo5cwgw

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.
@@ -184,8 +184,11 @@
184
184
  </div>
185
185
  </v-card-text>
186
186
  <v-card-actions>
187
+ <a href="modalImage.url" :download="modalImage.name">
188
+ <v-btn color="secondary" text>Herunterladen</v-btn>
189
+ </a>
187
190
  <v-spacer></v-spacer>
188
- <v-btn color="primary" text @click="closeImageModal">Close</v-btn>
191
+ <v-btn color="primary" text @click="closeImageModal">Schließen</v-btn>
189
192
  </v-card-actions>
190
193
  </v-card>
191
194
  </v-dialog>
@@ -205,6 +208,22 @@ import UIDynamicFormFooterAction from './FooterActions.vue';
205
208
  import UIDynamicFormTitleText from './TitleText.vue';
206
209
 
207
210
  function requiredIf({ value }, [targetField, expectedValue], node) {
211
+ /*
212
+ {
213
+ $formkit: 'text',
214
+ name: 'companyName',
215
+ label: 'Company Name',
216
+ validation: 'requiredIf:isCompany,true'
217
+ }
218
+ -- oder--
219
+ {
220
+ $formkit: 'text',
221
+ name: 'lastName',
222
+ label: 'Last name',
223
+ validation: 'requiredIf:firstName'
224
+ }
225
+ */
226
+
208
227
  console.debug(arguments);
209
228
 
210
229
  const actual = node?.root?.value?.[targetField];
@@ -216,6 +235,26 @@ function requiredIf({ value }, [targetField, expectedValue], node) {
216
235
 
217
236
  return true;
218
237
  }
238
+ // Optional: Eigenschaftsflags
239
+ requiredIf.blocking = true; // bei Fehlschlag blockiert es das Formular
240
+ requiredIf.skipEmpty = true; // bei leerem Wert überspringen
241
+
242
+ function multipleEmails(node) {
243
+ if (!node.value) {
244
+ return true; // Leerlauben, oder je nach Bedarf „required“ extra setzen
245
+ }
246
+
247
+ // Trenne anhand von Komma oder Semikolon
248
+ const parts = node.value.split(/\s*[,;]\s*/);
249
+
250
+ // regulärer Ausdruck für gültige E-Mail
251
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
252
+
253
+ return parts.every(p => emailRegex.test(p));
254
+ };
255
+ // Optional: Eigenschaftsflags
256
+ multipleEmails.blocking = true; // bei Fehlschlag blockiert es das Formular
257
+ multipleEmails.skipEmpty = true; // bei leerem Wert überspringen
219
258
 
220
259
  function normalizeCustomForm(input, defaultValue = {}) {
221
260
  if (typeof input === "string") {
@@ -288,7 +327,7 @@ export default {
288
327
  theme: 'genesis',
289
328
  locales: { de },
290
329
  locale: 'de',
291
- rules: { requiredIf: requiredIf },
330
+ rules: { requiredIf, multipleEmails },
292
331
  });
293
332
  app.use(plugin, formkitConfig);
294
333
  },