@firecms/core 3.0.0-canary.218 → 3.0.0-canary.219

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.umd.js CHANGED
@@ -860,7 +860,7 @@
860
860
  }
861
861
  }
862
862
  function resolvedSelectedEntityView(customViews, customizationController, selectedTab, canEdit) {
863
- const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter((e) => Boolean(e)).filter((e) => canEdit || !e.includeActions) : [];
863
+ const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter((e) => Boolean(e)) : [];
864
864
  const selectedEntityView = resolvedEntityViews.find((e) => e.key === selectedTab);
865
865
  const selectedSecondaryForm = customViews && resolvedEntityViews.filter((e) => e.includeActions).find((e) => e.key === selectedTab);
866
866
  return {
@@ -13926,12 +13926,14 @@
13926
13926
  onEntityChange,
13927
13927
  openEntityMode = "full_screen",
13928
13928
  formex: formexProp,
13929
+ disabled: disabledProp,
13929
13930
  Builder,
13930
13931
  EntityFormActionsComponent = EntityFormActions,
13931
13932
  showDefaultActions = true,
13932
13933
  showEntityPath = true,
13933
13934
  children
13934
13935
  }) {
13936
+ console.log("disabledProp", disabledProp);
13935
13937
  if (collection.customId && collection.formAutoSave) {
13936
13938
  console.warn(`The collection ${collection.path} has customId and formAutoSave enabled. This is not supported and formAutoSave will be ignored`);
13937
13939
  }
@@ -14163,6 +14165,8 @@
14163
14165
  setSavingError(e_4);
14164
14166
  });
14165
14167
  };
14168
+ const disabled = formex$1.isSubmitting || Boolean(disabledProp);
14169
+ console.log("disabled", disabled);
14166
14170
  const formContext = {
14167
14171
  // @ts-ignore
14168
14172
  setFieldValue: React.useCallback(formex$1.setFieldValue, []),
@@ -14175,7 +14179,8 @@
14175
14179
  entity,
14176
14180
  savingError,
14177
14181
  status,
14178
- openEntityMode
14182
+ openEntityMode,
14183
+ disabled
14179
14184
  };
14180
14185
  React.useEffect(() => {
14181
14186
  onFormContextReady?.(formContext);
@@ -14188,6 +14193,7 @@
14188
14193
  }, []);
14189
14194
  const pluginActions = [];
14190
14195
  const plugins = customizationController.plugins;
14196
+ const actionsDisabled = disabled || formex$1.isSubmitting || status === "existing" && !formex$1.dirty || Boolean(disabledProp);
14191
14197
  if (plugins && collection) {
14192
14198
  const actionProps = {
14193
14199
  entityId,
@@ -14197,7 +14203,8 @@
14197
14203
  context,
14198
14204
  currentEntityId: entityId,
14199
14205
  formContext,
14200
- openEntityMode
14206
+ openEntityMode,
14207
+ disabled: actionsDisabled
14201
14208
  };
14202
14209
  pluginActions.push(...plugins.map((plugin) => plugin.form?.Actions ? /* @__PURE__ */ jsxRuntime.jsx(plugin.form.Actions, { ...actionProps }, `actions_${plugin.key}`) : null).filter(Boolean));
14203
14210
  }
@@ -14266,13 +14273,13 @@
14266
14273
  const property_0 = resolvedCollection.properties[key_1];
14267
14274
  if (property_0) {
14268
14275
  const underlyingValueHasChanged = !!underlyingChanges && Object.keys(underlyingChanges).includes(key_1) && formex$1.touched[key_1];
14269
- const disabled = !autoSave && formex$1.isSubmitting || isReadOnly(property_0) || Boolean(property_0.disabled);
14276
+ const disabled_0 = disabledProp || !autoSave && formex$1.isSubmitting || isReadOnly(property_0) || Boolean(property_0.disabled);
14270
14277
  const hidden = isHidden(property_0);
14271
14278
  if (hidden) return null;
14272
14279
  const widthPercentage = property_0.widthPercentage ?? 100;
14273
14280
  const cmsFormFieldProps = {
14274
14281
  propertyKey: key_1,
14275
- disabled,
14282
+ disabled: disabled_0,
14276
14283
  property: property_0,
14277
14284
  includeDescription: property_0.description || property_0.longDescription,
14278
14285
  underlyingValueHasChanged: underlyingValueHasChanged && !autoSave,
@@ -14323,11 +14330,10 @@
14323
14330
  React.useEffect(() => {
14324
14331
  if (entityId && onIdChange) onIdChange(entityId);
14325
14332
  }, [entityId, onIdChange]);
14326
- const disabled_0 = formex$1.isSubmitting || !formex$1.dirty && status === "existing";
14327
14333
  if (!resolvedCollection || !path) {
14328
14334
  throw Error("INTERNAL: Collection and path must be defined in form context");
14329
14335
  }
14330
- const dialogActions = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex: formex$1, disabled: disabled_0, status, pluginActions, openEntityMode, showDefaultActions });
14336
+ const dialogActions = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex: formex$1, disabled: actionsDisabled, status, pluginActions, openEntityMode, showDefaultActions });
14331
14337
  return /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formex$1, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: formex$1.handleSubmit, onReset: () => formex$1.resetForm({
14332
14338
  values: getInitialEntityValues(authController, collection, path, status, entity, customizationController.propertyConfigs)
14333
14339
  }), noValidate: true, className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
@@ -14697,7 +14703,7 @@
14697
14703
  return t2;
14698
14704
  }
14699
14705
  function SelectFieldBinding(t0) {
14700
- const $ = reactCompilerRuntime.c(46);
14706
+ const $ = reactCompilerRuntime.c(47);
14701
14707
  const {
14702
14708
  propertyKey,
14703
14709
  value,
@@ -14794,68 +14800,69 @@
14794
14800
  t12 = $[19];
14795
14801
  }
14796
14802
  let t13;
14797
- if ($[20] !== handleClearClick || $[21] !== property.clearable) {
14798
- t13 = property.clearable && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: handleClearClick, children: /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, {}) });
14799
- $[20] = handleClearClick;
14800
- $[21] = property.clearable;
14801
- $[22] = t13;
14803
+ if ($[20] !== disabled || $[21] !== handleClearClick || $[22] !== property.clearable) {
14804
+ t13 = property.clearable && !disabled && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: handleClearClick, children: /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, {}) });
14805
+ $[20] = disabled;
14806
+ $[21] = handleClearClick;
14807
+ $[22] = property.clearable;
14808
+ $[23] = t13;
14802
14809
  } else {
14803
- t13 = $[22];
14810
+ t13 = $[23];
14804
14811
  }
14805
14812
  let t14;
14806
- if ($[23] !== property.dataType || $[24] !== setValue) {
14813
+ if ($[24] !== property.dataType || $[25] !== setValue) {
14807
14814
  t14 = (updatedValue) => {
14808
14815
  const newValue = updatedValue ? property.dataType === "number" ? parseFloat(updatedValue) : updatedValue : null;
14809
14816
  return setValue(newValue);
14810
14817
  };
14811
- $[23] = property.dataType;
14812
- $[24] = setValue;
14813
- $[25] = t14;
14818
+ $[24] = property.dataType;
14819
+ $[25] = setValue;
14820
+ $[26] = t14;
14814
14821
  } else {
14815
- t14 = $[25];
14822
+ t14 = $[26];
14816
14823
  }
14817
14824
  const t15 = (enumKey) => /* @__PURE__ */ jsxRuntime.jsx(EnumValuesChip, { enumKey, enumValues, size });
14818
14825
  const t16 = enumValues && enumValues.map((option) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: String(option.id), children: /* @__PURE__ */ jsxRuntime.jsx(EnumValuesChip, { enumKey: String(option.id), enumValues, size }) }, option.id));
14819
14826
  let t17;
14820
- if ($[26] !== T0 || $[27] !== disabled || $[28] !== size || $[29] !== t12 || $[30] !== t13 || $[31] !== t14 || $[32] !== t15 || $[33] !== t16 || $[34] !== t5 || $[35] !== t8) {
14827
+ if ($[27] !== T0 || $[28] !== disabled || $[29] !== size || $[30] !== t12 || $[31] !== t13 || $[32] !== t14 || $[33] !== t15 || $[34] !== t16 || $[35] !== t5 || $[36] !== t8) {
14821
14828
  t17 = /* @__PURE__ */ jsxRuntime.jsx(T0, { value: t5, disabled, size, fullWidth: t6, position: t7, inputClassName: t8, label: t12, endAdornment: t13, onValueChange: t14, renderValue: t15, children: t16 });
14822
- $[26] = T0;
14823
- $[27] = disabled;
14824
- $[28] = size;
14825
- $[29] = t12;
14826
- $[30] = t13;
14827
- $[31] = t14;
14828
- $[32] = t15;
14829
- $[33] = t16;
14830
- $[34] = t5;
14831
- $[35] = t8;
14832
- $[36] = t17;
14829
+ $[27] = T0;
14830
+ $[28] = disabled;
14831
+ $[29] = size;
14832
+ $[30] = t12;
14833
+ $[31] = t13;
14834
+ $[32] = t14;
14835
+ $[33] = t15;
14836
+ $[34] = t16;
14837
+ $[35] = t5;
14838
+ $[36] = t8;
14839
+ $[37] = t17;
14833
14840
  } else {
14834
- t17 = $[36];
14841
+ t17 = $[37];
14835
14842
  }
14836
14843
  let t18;
14837
- if ($[37] !== disabled || $[38] !== error || $[39] !== includeDescription || $[40] !== property || $[41] !== showError) {
14844
+ if ($[38] !== disabled || $[39] !== error || $[40] !== includeDescription || $[41] !== property || $[42] !== showError) {
14838
14845
  t18 = /* @__PURE__ */ jsxRuntime.jsx(FieldHelperText, { includeDescription, showError, error, disabled, property });
14839
- $[37] = disabled;
14840
- $[38] = error;
14841
- $[39] = includeDescription;
14842
- $[40] = property;
14843
- $[41] = showError;
14844
- $[42] = t18;
14846
+ $[38] = disabled;
14847
+ $[39] = error;
14848
+ $[40] = includeDescription;
14849
+ $[41] = property;
14850
+ $[42] = showError;
14851
+ $[43] = t18;
14845
14852
  } else {
14846
- t18 = $[42];
14853
+ t18 = $[43];
14847
14854
  }
14848
14855
  let t19;
14849
- if ($[43] !== t17 || $[44] !== t18) {
14856
+ if ($[44] !== t17 || $[45] !== t18) {
14850
14857
  t19 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14851
14858
  t17,
14852
14859
  t18
14853
14860
  ] });
14854
- $[43] = t17;
14855
- $[44] = t18;
14856
- $[45] = t19;
14861
+ $[44] = t17;
14862
+ $[45] = t18;
14863
+ $[46] = t19;
14857
14864
  } else {
14858
- t19 = $[45];
14865
+ t19 = $[46];
14859
14866
  }
14860
14867
  return t19;
14861
14868
  }
@@ -15083,7 +15090,7 @@
15083
15090
  const acceptDropClasses = "transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-2 border-solid border-green-500";
15084
15091
  const rejectDropClasses = "transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-2 border-solid border-red-500";
15085
15092
  function StorageUploadFieldBinding(t0) {
15086
- const $ = reactCompilerRuntime.c(47);
15093
+ const $ = reactCompilerRuntime.c(48);
15087
15094
  const {
15088
15095
  propertyKey,
15089
15096
  value,
@@ -15103,18 +15110,19 @@
15103
15110
  }
15104
15111
  const storageSource = useStorageSource(context.collection);
15105
15112
  let t1;
15106
- if ($[0] !== isSubmitting || $[1] !== property) {
15107
- t1 = isReadOnly(property) || !!property.disabled || isSubmitting;
15108
- $[0] = isSubmitting;
15109
- $[1] = property;
15110
- $[2] = t1;
15113
+ if ($[0] !== context.disabled || $[1] !== isSubmitting || $[2] !== property) {
15114
+ t1 = isReadOnly(property) || !!property.disabled || isSubmitting || context.disabled;
15115
+ $[0] = context.disabled;
15116
+ $[1] = isSubmitting;
15117
+ $[2] = property;
15118
+ $[3] = t1;
15111
15119
  } else {
15112
- t1 = $[2];
15120
+ t1 = $[3];
15113
15121
  }
15114
15122
  const disabled = t1;
15115
15123
  const t2 = disabled ?? false;
15116
15124
  let t3;
15117
- if ($[3] !== context.entityId || $[4] !== context.path || $[5] !== context.values || $[6] !== property || $[7] !== propertyKey || $[8] !== setValue || $[9] !== storageSource || $[10] !== t2 || $[11] !== value) {
15125
+ if ($[4] !== context.entityId || $[5] !== context.path || $[6] !== context.values || $[7] !== property || $[8] !== propertyKey || $[9] !== setValue || $[10] !== storageSource || $[11] !== t2 || $[12] !== value) {
15118
15126
  t3 = {
15119
15127
  entityValues: context.values,
15120
15128
  entityId: context.entityId,
@@ -15126,18 +15134,18 @@
15126
15134
  disabled: t2,
15127
15135
  onChange: setValue
15128
15136
  };
15129
- $[3] = context.entityId;
15130
- $[4] = context.path;
15131
- $[5] = context.values;
15132
- $[6] = property;
15133
- $[7] = propertyKey;
15134
- $[8] = setValue;
15135
- $[9] = storageSource;
15136
- $[10] = t2;
15137
- $[11] = value;
15138
- $[12] = t3;
15137
+ $[4] = context.entityId;
15138
+ $[5] = context.path;
15139
+ $[6] = context.values;
15140
+ $[7] = property;
15141
+ $[8] = propertyKey;
15142
+ $[9] = setValue;
15143
+ $[10] = storageSource;
15144
+ $[11] = t2;
15145
+ $[12] = value;
15146
+ $[13] = t3;
15139
15147
  } else {
15140
- t3 = $[12];
15148
+ t3 = $[13];
15141
15149
  }
15142
15150
  const {
15143
15151
  internalValue,
@@ -15149,90 +15157,90 @@
15149
15157
  multipleFilesSupported
15150
15158
  } = useStorageUploadController(t3);
15151
15159
  let t4;
15152
- if ($[13] !== property || $[14] !== setValue || $[15] !== value) {
15160
+ if ($[14] !== property || $[15] !== setValue || $[16] !== value) {
15153
15161
  t4 = {
15154
15162
  property,
15155
15163
  value,
15156
15164
  setValue
15157
15165
  };
15158
- $[13] = property;
15159
- $[14] = setValue;
15160
- $[15] = value;
15161
- $[16] = t4;
15166
+ $[14] = property;
15167
+ $[15] = setValue;
15168
+ $[16] = value;
15169
+ $[17] = t4;
15162
15170
  } else {
15163
- t4 = $[16];
15171
+ t4 = $[17];
15164
15172
  }
15165
15173
  useClearRestoreValue(t4);
15166
15174
  const t5 = property;
15167
15175
  let t6;
15168
- if ($[17] !== authController || $[18] !== t5) {
15176
+ if ($[18] !== authController || $[19] !== t5) {
15169
15177
  t6 = resolveProperty({
15170
15178
  propertyOrBuilder: t5,
15171
15179
  authController
15172
15180
  });
15173
- $[17] = authController;
15174
- $[18] = t5;
15175
- $[19] = t6;
15181
+ $[18] = authController;
15182
+ $[19] = t5;
15183
+ $[20] = t6;
15176
15184
  } else {
15177
- t6 = $[19];
15185
+ t6 = $[20];
15178
15186
  }
15179
15187
  const resolvedProperty = t6;
15180
15188
  let t7;
15181
- if ($[20] !== minimalistView || $[21] !== property || $[22] !== propertyKey) {
15189
+ if ($[21] !== minimalistView || $[22] !== property || $[23] !== propertyKey) {
15182
15190
  t7 = !minimalistView && /* @__PURE__ */ jsxRuntime.jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-8text-text-secondary dark:text-text-secondary-dark ml-3.5" });
15183
- $[20] = minimalistView;
15184
- $[21] = property;
15185
- $[22] = propertyKey;
15186
- $[23] = t7;
15191
+ $[21] = minimalistView;
15192
+ $[22] = property;
15193
+ $[23] = propertyKey;
15194
+ $[24] = t7;
15187
15195
  } else {
15188
- t7 = $[23];
15196
+ t7 = $[24];
15189
15197
  }
15190
15198
  const t8 = disabled ?? false;
15191
15199
  const t9 = autoFocus ?? false;
15192
15200
  let t10;
15193
- if ($[24] !== internalValue || $[25] !== multipleFilesSupported || $[26] !== onFileUploadComplete || $[27] !== onFilesAdded || $[28] !== propertyKey || $[29] !== resolvedProperty || $[30] !== setInternalValue || $[31] !== setValue || $[32] !== storage || $[33] !== storagePathBuilder || $[34] !== t8 || $[35] !== t9) {
15201
+ if ($[25] !== internalValue || $[26] !== multipleFilesSupported || $[27] !== onFileUploadComplete || $[28] !== onFilesAdded || $[29] !== propertyKey || $[30] !== resolvedProperty || $[31] !== setInternalValue || $[32] !== setValue || $[33] !== storage || $[34] !== storagePathBuilder || $[35] !== t8 || $[36] !== t9) {
15194
15202
  t10 = /* @__PURE__ */ jsxRuntime.jsx(StorageUpload, { value: internalValue, name: propertyKey, disabled: t8, autoFocus: t9, property: resolvedProperty, onChange: setValue, setInternalValue, onFilesAdded, onFileUploadComplete, storagePathBuilder, storage, multipleFilesSupported });
15195
- $[24] = internalValue;
15196
- $[25] = multipleFilesSupported;
15197
- $[26] = onFileUploadComplete;
15198
- $[27] = onFilesAdded;
15199
- $[28] = propertyKey;
15200
- $[29] = resolvedProperty;
15201
- $[30] = setInternalValue;
15202
- $[31] = setValue;
15203
- $[32] = storage;
15204
- $[33] = storagePathBuilder;
15205
- $[34] = t8;
15206
- $[35] = t9;
15207
- $[36] = t10;
15208
- } else {
15209
- t10 = $[36];
15203
+ $[25] = internalValue;
15204
+ $[26] = multipleFilesSupported;
15205
+ $[27] = onFileUploadComplete;
15206
+ $[28] = onFilesAdded;
15207
+ $[29] = propertyKey;
15208
+ $[30] = resolvedProperty;
15209
+ $[31] = setInternalValue;
15210
+ $[32] = setValue;
15211
+ $[33] = storage;
15212
+ $[34] = storagePathBuilder;
15213
+ $[35] = t8;
15214
+ $[36] = t9;
15215
+ $[37] = t10;
15216
+ } else {
15217
+ t10 = $[37];
15210
15218
  }
15211
15219
  let t11;
15212
- if ($[37] !== disabled || $[38] !== error || $[39] !== includeDescription || $[40] !== property || $[41] !== showError) {
15220
+ if ($[38] !== disabled || $[39] !== error || $[40] !== includeDescription || $[41] !== property || $[42] !== showError) {
15213
15221
  t11 = /* @__PURE__ */ jsxRuntime.jsx(FieldHelperText, { includeDescription, showError, error, disabled, property });
15214
- $[37] = disabled;
15215
- $[38] = error;
15216
- $[39] = includeDescription;
15217
- $[40] = property;
15218
- $[41] = showError;
15219
- $[42] = t11;
15222
+ $[38] = disabled;
15223
+ $[39] = error;
15224
+ $[40] = includeDescription;
15225
+ $[41] = property;
15226
+ $[42] = showError;
15227
+ $[43] = t11;
15220
15228
  } else {
15221
- t11 = $[42];
15229
+ t11 = $[43];
15222
15230
  }
15223
15231
  let t12;
15224
- if ($[43] !== t10 || $[44] !== t11 || $[45] !== t7) {
15232
+ if ($[44] !== t10 || $[45] !== t11 || $[46] !== t7) {
15225
15233
  t12 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15226
15234
  t7,
15227
15235
  t10,
15228
15236
  t11
15229
15237
  ] });
15230
- $[43] = t10;
15231
- $[44] = t11;
15232
- $[45] = t7;
15233
- $[46] = t12;
15238
+ $[44] = t10;
15239
+ $[45] = t11;
15240
+ $[46] = t7;
15241
+ $[47] = t12;
15234
15242
  } else {
15235
- t12 = $[46];
15243
+ t12 = $[47];
15236
15244
  }
15237
15245
  return t12;
15238
15246
  }
@@ -16148,7 +16156,7 @@
16148
16156
  index,
16149
16157
  authController
16150
16158
  });
16151
- const disabled = disabledProp || isReadOnly(resolvedProperty) || Boolean(resolvedProperty?.disabled);
16159
+ const disabled = disabledProp || isReadOnly(resolvedProperty) || Boolean(resolvedProperty?.disabled) || context.disabled;
16152
16160
  if (resolvedProperty === null || isHidden(resolvedProperty)) {
16153
16161
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
16154
16162
  } else {
@@ -18191,7 +18199,8 @@
18191
18199
  save: saveValue,
18192
18200
  formex: formex$1,
18193
18201
  status: "existing",
18194
- openEntityMode: "side_panel"
18202
+ openEntityMode: "side_panel",
18203
+ disabled: false
18195
18204
  };
18196
18205
  const property = propertyKey && getPropertyInPath(collection?.properties ?? {}, propertyKey);
18197
18206
  const fieldProps = propertyKey && property ? {
@@ -21236,6 +21245,9 @@
21236
21245
  return entity ? canEditEntity(props.collection, authController, props.path, entity ?? null) : void 0;
21237
21246
  }
21238
21247
  }, [authController, entity, status]);
21248
+ console.log({
21249
+ canEdit
21250
+ });
21239
21251
  if (dataLoading && !cachedValues || (!entity || canEdit === void 0) && (status === "existing" || status === "copy")) {
21240
21252
  return /* @__PURE__ */ jsxRuntime.jsx(CircularProgressCenter, {});
21241
21253
  }
@@ -21291,7 +21303,7 @@
21291
21303
  resolvedEntityViews,
21292
21304
  selectedEntityView,
21293
21305
  selectedSecondaryForm
21294
- } = resolvedSelectedEntityView(customViews, customizationController, selectedTab, canEdit);
21306
+ } = resolvedSelectedEntityView(customViews, customizationController, selectedTab);
21295
21307
  const actionsAtTheBottom = !largeLayout || layout === "side_panel" || selectedEntityView?.includeActions === "bottom";
21296
21308
  const mainViewVisible = selectedTab === MAIN_TAB_VALUE || Boolean(selectedSecondaryForm);
21297
21309
  const authController = useAuthController();
@@ -21309,6 +21321,7 @@
21309
21321
  const formexStub = createFormexStub(usedEntity?.values ?? {});
21310
21322
  const usedFormContext = formContext ?? {
21311
21323
  entityId,
21324
+ disabled: false,
21312
21325
  openEntityMode: layout,
21313
21326
  status,
21314
21327
  values: usedEntity?.values ?? {},
@@ -21360,10 +21373,11 @@
21360
21373
  });
21361
21374
  }
21362
21375
  };
21363
- const entityView = !canEdit ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", !mainViewVisible ? "hidden" : ""), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("relative flex flex-col max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit"), children: [
21376
+ const entityReadOnlyView = /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", canEdit || !mainViewVisible || selectedSecondaryForm ? "hidden" : ""), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("relative flex flex-col max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit"), children: [
21364
21377
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { className: "mt-16 mb-8 mx-8", variant: "h4", children: collection.singularName ?? collection.name }),
21365
21378
  /* @__PURE__ */ jsxRuntime.jsx(EntityView, { className: "px-8 h-full overflow-auto", entity, path, collection })
21366
- ] }) }) : /* @__PURE__ */ jsxRuntime.jsx(EntityForm, { collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues: cachedDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: ui.cls(!mainViewVisible ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, ...formProps, onEntityChange: (entity_0) => {
21379
+ ] }) });
21380
+ const entityView = /* @__PURE__ */ jsxRuntime.jsx(EntityForm, { collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues: cachedDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: ui.cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
21367
21381
  setUsedEntity(entity_0);
21368
21382
  formProps?.onEntityChange?.(entity_0);
21369
21383
  }, onStatusChange: (status_0) => {
@@ -21396,7 +21410,10 @@
21396
21410
  subcollectionTabs
21397
21411
  ] })
21398
21412
  ] }),
21399
- globalLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full pt-12 pb-16 px-4 sm:px-8 md:px-10", children: /* @__PURE__ */ jsxRuntime.jsx(CircularProgressCenter, {}) }) : entityView,
21413
+ globalLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full pt-12 pb-16 px-4 sm:px-8 md:px-10", children: /* @__PURE__ */ jsxRuntime.jsx(CircularProgressCenter, {}) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21414
+ entityReadOnlyView,
21415
+ entityView
21416
+ ] }),
21400
21417
  jsonView,
21401
21418
  customViewsView,
21402
21419
  subCollectionsViews