@firecms/collection_editor 3.0.0-canary.211 → 3.0.0-canary.212
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 +42 -40
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +41 -39
- package/dist/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/src/ui/collection_editor/EnumForm.tsx +1 -1
- package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +9 -2
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, isEmptyObject, ConfirmationDialog, useLargeLayout, makePropertiesEditable, resolveEntityView, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify,
|
|
3
|
+
import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, isEmptyObject, ConfirmationDialog, useLargeLayout, makePropertiesEditable, resolveEntityView, useAuthController, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify, randomString, removeUndefined, ErrorView, removeInitialAndTrailingSlashes, getDefaultPropertiesOrder, joinCollectionLists } from "@firecms/core";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { useContext, useState, useEffect, useMemo, useRef, useDeferredValue } from "react";
|
|
6
6
|
import equal from "react-fast-compare";
|
|
@@ -1251,7 +1251,7 @@ function EnumFormFields(t0) {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
let t10;
|
|
1253
1253
|
if ($[26] !== buildEntry || $[27] !== disabled || $[28] !== enumValuesPath || $[29] !== t8 || $[30] !== values.enumValues) {
|
|
1254
|
-
t10 = /* @__PURE__ */ jsx(ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded,
|
|
1254
|
+
t10 = /* @__PURE__ */ jsx(ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded, canAddElements: true, onValueChange: t8, newDefaultEntry: t9 });
|
|
1255
1255
|
$[26] = buildEntry;
|
|
1256
1256
|
$[27] = disabled;
|
|
1257
1257
|
$[28] = enumValuesPath;
|
|
@@ -8782,102 +8782,104 @@ function PropertySelectItem(t0) {
|
|
|
8782
8782
|
return t9;
|
|
8783
8783
|
}
|
|
8784
8784
|
function CollectionEditorImportDataPreview(t0) {
|
|
8785
|
-
const $ = c(
|
|
8785
|
+
const $ = c(19);
|
|
8786
8786
|
const {
|
|
8787
8787
|
importConfig,
|
|
8788
8788
|
properties,
|
|
8789
8789
|
propertiesOrder
|
|
8790
8790
|
} = t0;
|
|
8791
|
+
const authController = useAuthController();
|
|
8791
8792
|
const [loading, setLoading] = useState(false);
|
|
8792
8793
|
let t1;
|
|
8793
|
-
if ($[0] !==
|
|
8794
|
+
if ($[0] !== authController || $[1] !== importConfig || $[2] !== properties) {
|
|
8794
8795
|
t1 = async function loadEntities2() {
|
|
8795
|
-
const mappedData = importConfig.importData.map((d) => convertDataToEntity(d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
|
|
8796
|
+
const mappedData = importConfig.importData.map((d) => convertDataToEntity(authController, d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
|
|
8796
8797
|
importConfig.setEntities(mappedData);
|
|
8797
8798
|
};
|
|
8798
|
-
$[0] =
|
|
8799
|
-
$[1] =
|
|
8800
|
-
$[2] =
|
|
8799
|
+
$[0] = authController;
|
|
8800
|
+
$[1] = importConfig;
|
|
8801
|
+
$[2] = properties;
|
|
8802
|
+
$[3] = t1;
|
|
8801
8803
|
} else {
|
|
8802
|
-
t1 = $[
|
|
8804
|
+
t1 = $[3];
|
|
8803
8805
|
}
|
|
8804
8806
|
const loadEntities = t1;
|
|
8805
8807
|
let t2;
|
|
8806
|
-
if ($[
|
|
8808
|
+
if ($[4] !== loadEntities) {
|
|
8807
8809
|
t2 = () => {
|
|
8808
8810
|
loadEntities().finally(() => setLoading(false));
|
|
8809
8811
|
};
|
|
8810
|
-
$[
|
|
8811
|
-
$[
|
|
8812
|
+
$[4] = loadEntities;
|
|
8813
|
+
$[5] = t2;
|
|
8812
8814
|
} else {
|
|
8813
|
-
t2 = $[
|
|
8815
|
+
t2 = $[5];
|
|
8814
8816
|
}
|
|
8815
8817
|
let t3;
|
|
8816
|
-
if ($[
|
|
8818
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8817
8819
|
t3 = [];
|
|
8818
|
-
$[
|
|
8820
|
+
$[6] = t3;
|
|
8819
8821
|
} else {
|
|
8820
|
-
t3 = $[
|
|
8822
|
+
t3 = $[6];
|
|
8821
8823
|
}
|
|
8822
8824
|
useEffect(t2, t3);
|
|
8823
8825
|
const selectionController = useSelectionController();
|
|
8824
8826
|
if (loading) {
|
|
8825
8827
|
let t42;
|
|
8826
|
-
if ($[
|
|
8828
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8827
8829
|
t42 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
|
|
8828
|
-
$[
|
|
8830
|
+
$[7] = t42;
|
|
8829
8831
|
} else {
|
|
8830
|
-
t42 = $[
|
|
8832
|
+
t42 = $[7];
|
|
8831
8833
|
}
|
|
8832
8834
|
return t42;
|
|
8833
8835
|
}
|
|
8834
8836
|
let t4;
|
|
8835
|
-
if ($[
|
|
8837
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8836
8838
|
t4 = /* @__PURE__ */ jsxs("div", { children: [
|
|
8837
8839
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Imported data preview" }),
|
|
8838
8840
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: "Entities with the same id will be overwritten" })
|
|
8839
8841
|
] });
|
|
8840
|
-
$[
|
|
8842
|
+
$[8] = t4;
|
|
8841
8843
|
} else {
|
|
8842
|
-
t4 = $[
|
|
8844
|
+
t4 = $[8];
|
|
8843
8845
|
}
|
|
8844
8846
|
let t5;
|
|
8845
|
-
if ($[
|
|
8847
|
+
if ($[9] !== importConfig.entities) {
|
|
8846
8848
|
t5 = {
|
|
8847
8849
|
data: importConfig.entities,
|
|
8848
8850
|
dataLoading: false,
|
|
8849
8851
|
noMoreToLoad: false
|
|
8850
8852
|
};
|
|
8851
|
-
$[
|
|
8852
|
-
$[
|
|
8853
|
+
$[9] = importConfig.entities;
|
|
8854
|
+
$[10] = t5;
|
|
8853
8855
|
} else {
|
|
8854
|
-
t5 = $[
|
|
8856
|
+
t5 = $[10];
|
|
8855
8857
|
}
|
|
8856
8858
|
let t6;
|
|
8857
|
-
if ($[
|
|
8859
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8858
8860
|
t6 = /* @__PURE__ */ jsx("div", { className: "h-12" });
|
|
8859
|
-
$[
|
|
8861
|
+
$[11] = t6;
|
|
8860
8862
|
} else {
|
|
8861
|
-
t6 = $[
|
|
8863
|
+
t6 = $[11];
|
|
8862
8864
|
}
|
|
8863
8865
|
let t7;
|
|
8864
|
-
if ($[
|
|
8866
|
+
if ($[12] !== propertiesOrder) {
|
|
8865
8867
|
t7 = propertiesOrder.map(_temp$1);
|
|
8866
|
-
$[
|
|
8867
|
-
$[
|
|
8868
|
+
$[12] = propertiesOrder;
|
|
8869
|
+
$[13] = t7;
|
|
8868
8870
|
} else {
|
|
8869
|
-
t7 = $[
|
|
8871
|
+
t7 = $[13];
|
|
8870
8872
|
}
|
|
8871
8873
|
let t8;
|
|
8872
|
-
if ($[
|
|
8874
|
+
if ($[14] !== properties || $[15] !== selectionController || $[16] !== t5 || $[17] !== t7) {
|
|
8873
8875
|
t8 = /* @__PURE__ */ jsx(EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, openEntityMode: "side_panel", properties, enablePopupIcon: false });
|
|
8874
|
-
$[
|
|
8875
|
-
$[
|
|
8876
|
-
$[
|
|
8877
|
-
$[
|
|
8878
|
-
$[
|
|
8876
|
+
$[14] = properties;
|
|
8877
|
+
$[15] = selectionController;
|
|
8878
|
+
$[16] = t5;
|
|
8879
|
+
$[17] = t7;
|
|
8880
|
+
$[18] = t8;
|
|
8879
8881
|
} else {
|
|
8880
|
-
t8 = $[
|
|
8882
|
+
t8 = $[18];
|
|
8881
8883
|
}
|
|
8882
8884
|
return t8;
|
|
8883
8885
|
}
|