@declarion/react 0.180.0 → 0.185.0

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.
@@ -140,9 +140,9 @@ function M({ open: n, onOpenChange: c, action: u, actionName: d, onSubmit: C, is
140
140
  M,
141
141
  W,
142
142
  I
143
- ]), [K] = y(G), [q, J] = y(K);
143
+ ]), [K] = y(G), [q, J] = y(K), [Y, X] = y(!1);
144
144
  m(n && JSON.stringify(q) !== JSON.stringify(K));
145
- let Y = h((e, t) => {
145
+ let Z = h((e, t) => {
146
146
  J((n) => {
147
147
  let r = {
148
148
  ...n,
@@ -156,11 +156,14 @@ function M({ open: n, onOpenChange: c, action: u, actionName: d, onSubmit: C, is
156
156
  }
157
157
  return r;
158
158
  });
159
- }, [F]), X = h(() => {
159
+ }, [F]), Q = h(() => {
160
160
  let e = { ...q };
161
161
  for (let [t, n] of V) {
162
162
  let r = q[t], i = r == null || r === "";
163
- if (n.required && i) return;
163
+ if (n.required && i) {
164
+ X(!0);
165
+ return;
166
+ }
164
167
  i && !T(n, K[t], r) && delete e[t];
165
168
  }
166
169
  C(e);
@@ -304,19 +307,19 @@ function M({ open: n, onOpenChange: c, action: u, actionName: d, onSubmit: C, is
304
307
  filterTargets: t,
305
308
  selectedRows: M,
306
309
  value: q[e] ?? {},
307
- onChange: (t) => Y(e, t)
310
+ onChange: (t) => Z(e, t)
308
311
  });
309
312
  } else if (n.type === "status_group") i = /* @__PURE__ */ x(A, {
310
313
  param: n,
311
314
  value: q[e],
312
- onChange: (t) => Y(e, t),
315
+ onChange: (t) => Z(e, t),
313
316
  statusGroups: H,
314
317
  formData: q
315
318
  });
316
319
  else if (n.type === "status") i = /* @__PURE__ */ x(j, {
317
320
  param: n,
318
321
  value: q[e],
319
- onChange: (t) => Y(e, t),
322
+ onChange: (t) => Z(e, t),
320
323
  statusGroups: H,
321
324
  formData: q
322
325
  });
@@ -327,7 +330,7 @@ function M({ open: n, onOpenChange: c, action: u, actionName: d, onSubmit: C, is
327
330
  fieldName: e,
328
331
  value: q[e],
329
332
  mode: "edit",
330
- onChange: (t) => Y(e, t),
333
+ onChange: (t) => Z(e, t),
331
334
  t: N
332
335
  });
333
336
  }
@@ -339,6 +342,16 @@ function M({ open: n, onOpenChange: c, action: u, actionName: d, onSubmit: C, is
339
342
  children: r
340
343
  }),
341
344
  i,
345
+ Y && n.required && (q[e] == null || q[e] === "") && /* @__PURE__ */ x("p", {
346
+ role: "alert",
347
+ style: {
348
+ fontSize: 11,
349
+ color: "var(--danger)",
350
+ marginTop: 4,
351
+ marginBottom: 0
352
+ },
353
+ children: N("record.field.required", "Required")
354
+ }),
342
355
  n.display?.description && /* @__PURE__ */ x("p", {
343
356
  style: {
344
357
  fontSize: 11,
@@ -376,7 +389,7 @@ function M({ open: n, onOpenChange: c, action: u, actionName: d, onSubmit: C, is
376
389
  kind: "primary",
377
390
  danger: L,
378
391
  icon: x(D ? a : L ? r.trash : r.bolt, { size: 13 }),
379
- onClick: X,
392
+ onClick: Q,
380
393
  disabled: D,
381
394
  children: D ? N("action.dialog.working", "Working…") : d || N("dialog.confirm", "Confirm")
382
395
  })