@firecms/core 3.0.0-canary.93 → 3.0.0-canary.95
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/PropertyFieldBinding.d.ts +1 -1
- package/dist/index.es.js +24 -14
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +24 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/types/fields.d.ts +5 -0
- package/dist/types/properties.d.ts +1 -1
- package/dist/util/resolutions.d.ts +2 -1
- package/package.json +4 -6
- package/src/core/EntityEditView.tsx +1 -1
- package/src/form/PropertyFieldBinding.tsx +9 -2
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/types/fields.tsx +6 -0
- package/src/types/properties.ts +1 -0
- package/src/util/resolutions.ts +13 -9
|
@@ -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> = Record<string, any>>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled, tableMode, partOfArray, partOfBlock, autoFocus, }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
|
|
29
|
+
declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = Record<string, any>>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled, tableMode, partOfArray, partOfBlock, autoFocus, index, }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
|
|
30
30
|
export {};
|
package/dist/index.es.js
CHANGED
|
@@ -14856,6 +14856,9 @@ const PropertyFieldBinding = React__default.memo(PropertyFieldBindingInternal, (
|
|
|
14856
14856
|
if (a.propertyKey !== b.propertyKey) {
|
|
14857
14857
|
return false;
|
|
14858
14858
|
}
|
|
14859
|
+
if (a.index !== b.index) {
|
|
14860
|
+
return false;
|
|
14861
|
+
}
|
|
14859
14862
|
const aIsBuilder = isPropertyBuilder(a.property) || a.property.fromBuilder;
|
|
14860
14863
|
const bIsBuilder = isPropertyBuilder(b.property) || b.property.fromBuilder;
|
|
14861
14864
|
const baseCheck = (aIsBuilder === bIsBuilder || equal(a.property, b.property)) && a.disabled === b.disabled;
|
|
@@ -14877,7 +14880,8 @@ function PropertyFieldBindingInternal({
|
|
|
14877
14880
|
tableMode,
|
|
14878
14881
|
partOfArray,
|
|
14879
14882
|
partOfBlock,
|
|
14880
|
-
autoFocus
|
|
14883
|
+
autoFocus,
|
|
14884
|
+
index
|
|
14881
14885
|
}) {
|
|
14882
14886
|
const customizationController = useCustomizationController();
|
|
14883
14887
|
return /* @__PURE__ */ jsx(
|
|
@@ -14892,7 +14896,8 @@ function PropertyFieldBindingInternal({
|
|
|
14892
14896
|
values: fieldProps.form.values,
|
|
14893
14897
|
path: context.path,
|
|
14894
14898
|
entityId: context.entityId,
|
|
14895
|
-
fields: customizationController.propertyConfigs
|
|
14899
|
+
fields: customizationController.propertyConfigs,
|
|
14900
|
+
index
|
|
14896
14901
|
});
|
|
14897
14902
|
if (resolvedProperty === null || isHidden(resolvedProperty)) {
|
|
14898
14903
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
@@ -14914,11 +14919,13 @@ function PropertyFieldBindingInternal({
|
|
|
14914
14919
|
throw new Error(`INTERNAL: Could not find field config for property ${propertyKey}`);
|
|
14915
14920
|
}
|
|
14916
14921
|
const configProperty = resolveProperty({
|
|
14922
|
+
propertyKey,
|
|
14917
14923
|
propertyOrBuilder: propertyConfig.property,
|
|
14918
14924
|
values: fieldProps.form.values,
|
|
14919
14925
|
path: context.path,
|
|
14920
14926
|
entityId: context.entityId,
|
|
14921
|
-
fields: customizationController.propertyConfigs
|
|
14927
|
+
fields: customizationController.propertyConfigs,
|
|
14928
|
+
index
|
|
14922
14929
|
});
|
|
14923
14930
|
Component = configProperty.Field;
|
|
14924
14931
|
}
|
|
@@ -15820,7 +15827,7 @@ function RepeatFieldBinding({
|
|
|
15820
15827
|
partOfBlock: false,
|
|
15821
15828
|
autoFocus: internalId === lastAddedId
|
|
15822
15829
|
};
|
|
15823
|
-
return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyFieldBinding, { ...fieldProps }) });
|
|
15830
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyFieldBinding, { ...fieldProps, index }) });
|
|
15824
15831
|
};
|
|
15825
15832
|
const arrayContainer = /* @__PURE__ */ jsx(
|
|
15826
15833
|
FormikArrayContainer,
|
|
@@ -17332,15 +17339,16 @@ function resolveArrayProperty({
|
|
|
17332
17339
|
};
|
|
17333
17340
|
} else {
|
|
17334
17341
|
const of = property.of;
|
|
17335
|
-
const resolvedProperties = Array.isArray(propertyValue) ? propertyValue.map((v, index) =>
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
+
const resolvedProperties = Array.isArray(propertyValue) ? propertyValue.map((v, index) => {
|
|
17343
|
+
return resolveProperty({
|
|
17344
|
+
propertyKey: `${propertyKey}.${index}`,
|
|
17345
|
+
propertyOrBuilder: of,
|
|
17346
|
+
ignoreMissingFields,
|
|
17347
|
+
...props,
|
|
17348
|
+
index
|
|
17349
|
+
});
|
|
17350
|
+
}).filter((e) => Boolean(e)) : [];
|
|
17342
17351
|
const ofProperty = resolveProperty({
|
|
17343
|
-
propertyKey: `${propertyKey}`,
|
|
17344
17352
|
propertyOrBuilder: of,
|
|
17345
17353
|
ignoreMissingFields,
|
|
17346
17354
|
...props
|
|
@@ -17369,6 +17377,7 @@ function resolveArrayProperty({
|
|
|
17369
17377
|
});
|
|
17370
17378
|
}).filter((e) => Boolean(e)) : [];
|
|
17371
17379
|
const properties = resolveProperties({
|
|
17380
|
+
propertyKey,
|
|
17372
17381
|
properties: property.oneOf.properties,
|
|
17373
17382
|
ignoreMissingFields,
|
|
17374
17383
|
...props
|
|
@@ -17394,13 +17403,14 @@ function resolveArrayProperty({
|
|
|
17394
17403
|
}
|
|
17395
17404
|
}
|
|
17396
17405
|
function resolveProperties({
|
|
17406
|
+
propertyKey,
|
|
17397
17407
|
properties,
|
|
17398
17408
|
ignoreMissingFields,
|
|
17399
17409
|
...props
|
|
17400
17410
|
}) {
|
|
17401
17411
|
return Object.entries(properties).map(([key, property]) => {
|
|
17402
17412
|
const childResolvedProperty = resolveProperty({
|
|
17403
|
-
propertyKey: key,
|
|
17413
|
+
propertyKey: propertyKey ? `${propertyKey}.${key}` : void 0,
|
|
17404
17414
|
propertyOrBuilder: property,
|
|
17405
17415
|
ignoreMissingFields,
|
|
17406
17416
|
...props
|
|
@@ -18180,7 +18190,7 @@ function EntityEditViewInner({
|
|
|
18180
18190
|
const formFields = /* @__PURE__ */ jsx(Fragment, { children: getFormFieldKeys(resolvedCollection).map((key) => {
|
|
18181
18191
|
const property = resolvedCollection.properties[key];
|
|
18182
18192
|
if (property) {
|
|
18183
|
-
const underlyingValueHasChanged = !!underlyingChanges && Object.keys(underlyingChanges).includes(key) &&
|
|
18193
|
+
const underlyingValueHasChanged = !!underlyingChanges && Object.keys(underlyingChanges).includes(key) && formex.touched[key];
|
|
18184
18194
|
const disabled2 = !autoSave && formex.isSubmitting || isReadOnly(property) || Boolean(property.disabled);
|
|
18185
18195
|
const hidden = isHidden(property);
|
|
18186
18196
|
if (hidden) return null;
|