@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/form/EntityForm.d.ts +5 -1
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/index.es.js +134 -117
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +134 -117
- package/dist/index.umd.js.map +1 -1
- package/dist/types/fields.d.ts +1 -0
- package/dist/types/plugins.d.ts +1 -0
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
- package/src/core/EntityEditView.tsx +60 -57
- package/src/form/EntityForm.tsx +17 -7
- package/src/form/PropertyFieldBinding.tsx +2 -2
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
- package/src/types/fields.tsx +2 -0
- package/src/types/plugins.tsx +1 -0
- package/src/util/resolutions.ts +1 -1
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))
|
|
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
|
|
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:
|
|
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(
|
|
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] !==
|
|
14798
|
-
t13 = property.clearable && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: handleClearClick, children: /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, {}) });
|
|
14799
|
-
$[20] =
|
|
14800
|
-
$[21] =
|
|
14801
|
-
$[22] =
|
|
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 = $[
|
|
14810
|
+
t13 = $[23];
|
|
14804
14811
|
}
|
|
14805
14812
|
let t14;
|
|
14806
|
-
if ($[
|
|
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
|
-
$[
|
|
14812
|
-
$[
|
|
14813
|
-
$[
|
|
14818
|
+
$[24] = property.dataType;
|
|
14819
|
+
$[25] = setValue;
|
|
14820
|
+
$[26] = t14;
|
|
14814
14821
|
} else {
|
|
14815
|
-
t14 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
14823
|
-
$[
|
|
14824
|
-
$[
|
|
14825
|
-
$[
|
|
14826
|
-
$[
|
|
14827
|
-
$[
|
|
14828
|
-
$[
|
|
14829
|
-
$[
|
|
14830
|
-
$[
|
|
14831
|
-
$[
|
|
14832
|
-
$[
|
|
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 = $[
|
|
14841
|
+
t17 = $[37];
|
|
14835
14842
|
}
|
|
14836
14843
|
let t18;
|
|
14837
|
-
if ($[
|
|
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
|
-
$[
|
|
14840
|
-
$[
|
|
14841
|
-
$[
|
|
14842
|
-
$[
|
|
14843
|
-
$[
|
|
14844
|
-
$[
|
|
14846
|
+
$[38] = disabled;
|
|
14847
|
+
$[39] = error;
|
|
14848
|
+
$[40] = includeDescription;
|
|
14849
|
+
$[41] = property;
|
|
14850
|
+
$[42] = showError;
|
|
14851
|
+
$[43] = t18;
|
|
14845
14852
|
} else {
|
|
14846
|
-
t18 = $[
|
|
14853
|
+
t18 = $[43];
|
|
14847
14854
|
}
|
|
14848
14855
|
let t19;
|
|
14849
|
-
if ($[
|
|
14856
|
+
if ($[44] !== t17 || $[45] !== t18) {
|
|
14850
14857
|
t19 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14851
14858
|
t17,
|
|
14852
14859
|
t18
|
|
14853
14860
|
] });
|
|
14854
|
-
$[
|
|
14855
|
-
$[
|
|
14856
|
-
$[
|
|
14861
|
+
$[44] = t17;
|
|
14862
|
+
$[45] = t18;
|
|
14863
|
+
$[46] = t19;
|
|
14857
14864
|
} else {
|
|
14858
|
-
t19 = $[
|
|
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(
|
|
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] !==
|
|
15107
|
-
t1 = isReadOnly(property) || !!property.disabled || isSubmitting;
|
|
15108
|
-
$[0] =
|
|
15109
|
-
$[1] =
|
|
15110
|
-
$[2] =
|
|
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 = $[
|
|
15120
|
+
t1 = $[3];
|
|
15113
15121
|
}
|
|
15114
15122
|
const disabled = t1;
|
|
15115
15123
|
const t2 = disabled ?? false;
|
|
15116
15124
|
let t3;
|
|
15117
|
-
if ($[
|
|
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
|
-
$[
|
|
15130
|
-
$[
|
|
15131
|
-
$[
|
|
15132
|
-
$[
|
|
15133
|
-
$[
|
|
15134
|
-
$[
|
|
15135
|
-
$[
|
|
15136
|
-
$[
|
|
15137
|
-
$[
|
|
15138
|
-
$[
|
|
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 = $[
|
|
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 ($[
|
|
15160
|
+
if ($[14] !== property || $[15] !== setValue || $[16] !== value) {
|
|
15153
15161
|
t4 = {
|
|
15154
15162
|
property,
|
|
15155
15163
|
value,
|
|
15156
15164
|
setValue
|
|
15157
15165
|
};
|
|
15158
|
-
$[
|
|
15159
|
-
$[
|
|
15160
|
-
$[
|
|
15161
|
-
$[
|
|
15166
|
+
$[14] = property;
|
|
15167
|
+
$[15] = setValue;
|
|
15168
|
+
$[16] = value;
|
|
15169
|
+
$[17] = t4;
|
|
15162
15170
|
} else {
|
|
15163
|
-
t4 = $[
|
|
15171
|
+
t4 = $[17];
|
|
15164
15172
|
}
|
|
15165
15173
|
useClearRestoreValue(t4);
|
|
15166
15174
|
const t5 = property;
|
|
15167
15175
|
let t6;
|
|
15168
|
-
if ($[
|
|
15176
|
+
if ($[18] !== authController || $[19] !== t5) {
|
|
15169
15177
|
t6 = resolveProperty({
|
|
15170
15178
|
propertyOrBuilder: t5,
|
|
15171
15179
|
authController
|
|
15172
15180
|
});
|
|
15173
|
-
$[
|
|
15174
|
-
$[
|
|
15175
|
-
$[
|
|
15181
|
+
$[18] = authController;
|
|
15182
|
+
$[19] = t5;
|
|
15183
|
+
$[20] = t6;
|
|
15176
15184
|
} else {
|
|
15177
|
-
t6 = $[
|
|
15185
|
+
t6 = $[20];
|
|
15178
15186
|
}
|
|
15179
15187
|
const resolvedProperty = t6;
|
|
15180
15188
|
let t7;
|
|
15181
|
-
if ($[
|
|
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
|
-
$[
|
|
15184
|
-
$[
|
|
15185
|
-
$[
|
|
15186
|
-
$[
|
|
15191
|
+
$[21] = minimalistView;
|
|
15192
|
+
$[22] = property;
|
|
15193
|
+
$[23] = propertyKey;
|
|
15194
|
+
$[24] = t7;
|
|
15187
15195
|
} else {
|
|
15188
|
-
t7 = $[
|
|
15196
|
+
t7 = $[24];
|
|
15189
15197
|
}
|
|
15190
15198
|
const t8 = disabled ?? false;
|
|
15191
15199
|
const t9 = autoFocus ?? false;
|
|
15192
15200
|
let t10;
|
|
15193
|
-
if ($[
|
|
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
|
-
$[
|
|
15196
|
-
$[
|
|
15197
|
-
$[
|
|
15198
|
-
$[
|
|
15199
|
-
$[
|
|
15200
|
-
$[
|
|
15201
|
-
$[
|
|
15202
|
-
$[
|
|
15203
|
-
$[
|
|
15204
|
-
$[
|
|
15205
|
-
$[
|
|
15206
|
-
$[
|
|
15207
|
-
$[
|
|
15208
|
-
} else {
|
|
15209
|
-
t10 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
15215
|
-
$[
|
|
15216
|
-
$[
|
|
15217
|
-
$[
|
|
15218
|
-
$[
|
|
15219
|
-
$[
|
|
15222
|
+
$[38] = disabled;
|
|
15223
|
+
$[39] = error;
|
|
15224
|
+
$[40] = includeDescription;
|
|
15225
|
+
$[41] = property;
|
|
15226
|
+
$[42] = showError;
|
|
15227
|
+
$[43] = t11;
|
|
15220
15228
|
} else {
|
|
15221
|
-
t11 = $[
|
|
15229
|
+
t11 = $[43];
|
|
15222
15230
|
}
|
|
15223
15231
|
let t12;
|
|
15224
|
-
if ($[
|
|
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
|
-
$[
|
|
15231
|
-
$[
|
|
15232
|
-
$[
|
|
15233
|
-
$[
|
|
15238
|
+
$[44] = t10;
|
|
15239
|
+
$[45] = t11;
|
|
15240
|
+
$[46] = t7;
|
|
15241
|
+
$[47] = t12;
|
|
15234
15242
|
} else {
|
|
15235
|
-
t12 = $[
|
|
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
|
|
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
|
|
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
|
-
] }) })
|
|
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, {}) }) :
|
|
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
|