@firecms/core 3.0.0-canary.171 → 3.0.0-canary.173

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/dist/index.es.js CHANGED
@@ -13718,7 +13718,7 @@ function ArrayContainer({
13718
13718
  }, [hasValue, internalIds.length, value]);
13719
13719
  const insertInEnd = (e) => {
13720
13720
  e.preventDefault();
13721
- if (disabled || value.length >= max) return;
13721
+ if (disabled || (value ?? []).length >= max) return;
13722
13722
  const id = getRandomId$1();
13723
13723
  const newIds = [...internalIds, id];
13724
13724
  if (onInternalIdAdded) onInternalIdAdded(id);
@@ -13726,14 +13726,14 @@ function ArrayContainer({
13726
13726
  onValueChange([...value ?? [], newDefaultEntry]);
13727
13727
  };
13728
13728
  const remove = (index_0) => {
13729
- if (value.length <= min) return;
13729
+ if ((value ?? []).length <= min) return;
13730
13730
  const newIds_0 = [...internalIds];
13731
13731
  newIds_0.splice(index_0, 1);
13732
13732
  setInternalIds(newIds_0);
13733
13733
  onValueChange(value.filter((_, i) => i !== index_0));
13734
13734
  };
13735
13735
  const copy = (index_1) => {
13736
- if (value.length >= max) return;
13736
+ if ((value ?? []).length >= max) return;
13737
13737
  const id_0 = getRandomId$1();
13738
13738
  const copyingItem = value[index_1];
13739
13739
  const newIds_1 = [...internalIds.slice(0, index_1 + 1), id_0, ...internalIds.slice(index_1 + 1)];
@@ -13742,7 +13742,7 @@ function ArrayContainer({
13742
13742
  onValueChange([...value.slice(0, index_1 + 1), copyingItem, ...value.slice(index_1 + 1)]);
13743
13743
  };
13744
13744
  const addInIndex = (index_2) => {
13745
- if (value.length >= max) return;
13745
+ if ((value ?? []).length >= max) return;
13746
13746
  const id_1 = getRandomId$1();
13747
13747
  const newIds_2 = [...internalIds.slice(0, index_2), id_1, ...internalIds.slice(index_2)];
13748
13748
  if (onInternalIdAdded) onInternalIdAdded(id_1);