@open-mercato/ui 0.6.8-develop.6925.1.cefa200fa4 → 0.6.8-develop.6930.1.1e5976efc3

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.
@@ -1,3 +1,3 @@
1
- Generated lucide registry with 145 icons -> /home/runner/work/open-mercato/open-mercato/packages/ui/src/backend/icons/lucideRegistry.generated.tsx
1
+ Generated lucide registry with 150 icons -> /home/runner/work/open-mercato/open-mercato/packages/ui/src/backend/icons/lucideRegistry.generated.tsx
2
2
  [build:ui] found 400 entry points
3
3
  [build:ui] built successfully
@@ -566,6 +566,7 @@ function CrudForm({
566
566
  dirtyBaselineSnapshotRef.current = createDirtySnapshot(source);
567
567
  dirtyBaselineValuesRef.current = { ...source };
568
568
  userEditedFieldIdsRef.current.clear();
569
+ everEditedFieldIdsRef.current.clear();
569
570
  isDirtyRef.current = false;
570
571
  setHasUnsavedChanges(false);
571
572
  }, []);
@@ -1361,6 +1362,7 @@ function CrudForm({
1361
1362
  const field = fieldById.get(fieldId);
1362
1363
  if (!field || field.disabled) return;
1363
1364
  if (hiddenBaseFieldIds.has(fieldId) || hiddenInjectedFieldIds.has(fieldId)) return;
1365
+ if (!everEditedFieldIdsRef.current.has(fieldId)) return;
1364
1366
  const nextValues = sourceValues ?? valuesRef.current;
1365
1367
  const nextFieldErrors = {};
1366
1368
  const requiredMessage = t("ui.forms.errors.required");
@@ -1708,6 +1710,7 @@ function CrudForm({
1708
1710
  return;
1709
1711
  }
1710
1712
  userEditedFieldIdsRef.current.add(id);
1713
+ everEditedFieldIdsRef.current.add(id);
1711
1714
  }, []);
1712
1715
  const setValue = React.useCallback((id, nextValue) => {
1713
1716
  let nextData = null;
@@ -1825,6 +1828,7 @@ function CrudForm({
1825
1828
  const dirtyBaselineSnapshotRef = React.useRef(void 0);
1826
1829
  const dirtyBaselineValuesRef = React.useRef(void 0);
1827
1830
  const userEditedFieldIdsRef = React.useRef(/* @__PURE__ */ new Set());
1831
+ const everEditedFieldIdsRef = React.useRef(/* @__PURE__ */ new Set());
1828
1832
  React.useLayoutEffect(() => {
1829
1833
  if (!initialValues) return;
1830
1834
  const snapshot = JSON.stringify({
@@ -2358,11 +2362,14 @@ function CrudForm({
2358
2362
  }
2359
2363
  };
2360
2364
  const renderFields = (fieldList) => {
2361
- const usesResponsive = fieldList.some(
2365
+ const visibleFieldList = fieldList.filter(
2366
+ (field) => !hiddenBaseFieldIds.has(field.id) && !hiddenInjectedFieldIds.has(field.id)
2367
+ );
2368
+ const usesResponsive = visibleFieldList.some(
2362
2369
  (field) => field.layout === "half" || field.layout === "third"
2363
2370
  );
2364
2371
  const gridClass = usesResponsive ? "grid grid-cols-1 gap-4 md:grid-cols-6" : "grid grid-cols-1 gap-4";
2365
- return /* @__PURE__ */ jsx("div", { className: gridClass, children: fieldList.map((f) => {
2372
+ return /* @__PURE__ */ jsx("div", { className: gridClass, children: visibleFieldList.map((f) => {
2366
2373
  const layout = f.layout ?? "full";
2367
2374
  const wrapperClassName = usesResponsive ? resolveLayoutClass(layout) : void 0;
2368
2375
  return /* @__PURE__ */ jsx(