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