@overmap-ai/core 1.0.38-component-fields.3 → 1.0.38-component-fields.5
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/overmap-core.js +23 -16
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +23 -16
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -5440,7 +5440,6 @@ class UserFormService extends BaseApiService {
|
|
|
5440
5440
|
const activeWorkspaceId = state.workspaceReducer.activeWorkspaceId;
|
|
5441
5441
|
const offlineFormPayload = offline({});
|
|
5442
5442
|
const offlineRevisionPayload = offline(initialRevision);
|
|
5443
|
-
console.log(componentType);
|
|
5444
5443
|
const retForm = {
|
|
5445
5444
|
...offlineFormPayload,
|
|
5446
5445
|
index_workspace: activeWorkspaceId,
|
|
@@ -5450,7 +5449,6 @@ class UserFormService extends BaseApiService {
|
|
|
5450
5449
|
...componentType && { component_type: componentType },
|
|
5451
5450
|
...ownerAttrs
|
|
5452
5451
|
};
|
|
5453
|
-
console.log(retForm);
|
|
5454
5452
|
const { payloadWithoutImage, images } = await separateImageFromFields(offlineRevisionPayload);
|
|
5455
5453
|
const retRevision = {
|
|
5456
5454
|
...payloadWithoutImage,
|
|
@@ -5468,7 +5466,11 @@ class UserFormService extends BaseApiService {
|
|
|
5468
5466
|
queryParams: activeWorkspaceId ? {
|
|
5469
5467
|
workspace_id: activeWorkspaceId
|
|
5470
5468
|
} : void 0,
|
|
5471
|
-
payload: {
|
|
5469
|
+
payload: {
|
|
5470
|
+
...offlineFormPayload,
|
|
5471
|
+
...componentType && { component_type: componentType },
|
|
5472
|
+
initial_revision: payloadWithoutImage
|
|
5473
|
+
},
|
|
5472
5474
|
blockers: [],
|
|
5473
5475
|
blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
|
|
5474
5476
|
});
|
|
@@ -10843,19 +10845,24 @@ const FieldBuilder = memo((props) => {
|
|
|
10843
10845
|
const { parentPath, index: index2, initial, conditionalSourceFields } = props;
|
|
10844
10846
|
const { values, setFieldValue, errors } = useFormikContext();
|
|
10845
10847
|
const fieldTypeItems = useFieldTypeItems();
|
|
10848
|
+
const containerRef = useRef(null);
|
|
10846
10849
|
const RADIX_SM_MIN_WIDTH = 576;
|
|
10847
|
-
const [
|
|
10848
|
-
|
|
10850
|
+
const [isLargeContainer, setIsLargeContainer] = useState(
|
|
10851
|
+
containerRef.current && containerRef.current.getBoundingClientRect().width >= RADIX_SM_MIN_WIDTH
|
|
10849
10852
|
);
|
|
10850
10853
|
useEffect(() => {
|
|
10851
|
-
const
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10854
|
+
const container = containerRef.current;
|
|
10855
|
+
if (container) {
|
|
10856
|
+
const observer = new ResizeObserver((entries) => {
|
|
10857
|
+
if (entries[0]) {
|
|
10858
|
+
setIsLargeContainer(entries[0].contentRect.width >= RADIX_SM_MIN_WIDTH);
|
|
10859
|
+
}
|
|
10860
|
+
});
|
|
10861
|
+
observer.observe(container);
|
|
10862
|
+
return () => {
|
|
10863
|
+
observer.disconnect();
|
|
10864
|
+
};
|
|
10865
|
+
}
|
|
10859
10866
|
}, []);
|
|
10860
10867
|
const [resolvedImage, setResolvedImage] = useState(void 0);
|
|
10861
10868
|
const [showImagePreview, setShowImagePreview] = useState(false);
|
|
@@ -10932,7 +10939,7 @@ const FieldBuilder = memo((props) => {
|
|
|
10932
10939
|
const fieldObject = fieldCls.getFieldCreationSchema(
|
|
10933
10940
|
`${parentPath}.${index2}`
|
|
10934
10941
|
);
|
|
10935
|
-
if (
|
|
10942
|
+
if (isLargeContainer) {
|
|
10936
10943
|
directlyShownFields2 = [
|
|
10937
10944
|
...directlyShownFields2,
|
|
10938
10945
|
...fieldObject.filter((field) => field.showDirectly).map((field) => field.field)
|
|
@@ -10946,7 +10953,7 @@ const FieldBuilder = memo((props) => {
|
|
|
10946
10953
|
}
|
|
10947
10954
|
}
|
|
10948
10955
|
return [directlyShownFields2, popoverFields2];
|
|
10949
|
-
}, [fieldCls, conditionalSourceFields, parentPath, index2,
|
|
10956
|
+
}, [fieldCls, conditionalSourceFields, parentPath, index2, isLargeContainer]);
|
|
10950
10957
|
const directlyShownInputs = useFieldInputs(directlyShownFields, {
|
|
10951
10958
|
formId,
|
|
10952
10959
|
disabled: false,
|
|
@@ -10966,7 +10973,7 @@ const FieldBuilder = memo((props) => {
|
|
|
10966
10973
|
});
|
|
10967
10974
|
const deserializedField = useMemo(() => deserialize(initial), [initial]);
|
|
10968
10975
|
const previewInput2 = useFieldInput(deserializedField, { formId, disabled: true, showInputOnly: true });
|
|
10969
|
-
return /* @__PURE__ */ jsxs(Flex, { align: "center", grow: "1", children: [
|
|
10976
|
+
return /* @__PURE__ */ jsxs(Flex, { ref: containerRef, align: "center", grow: "1", children: [
|
|
10970
10977
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", width: "100%", children: [
|
|
10971
10978
|
fieldCls === FieldSection && /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
|
|
10972
10979
|
directlyShownFields.length > 0 && directlyShownInputs,
|