@oondemand/oon-core-front 0.5.2 → 0.5.3

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.js CHANGED
@@ -2513,6 +2513,12 @@ function initialReactiveValues(fields, initialValues) {
2513
2513
  const initial = Object.fromEntries(fields.map((field) => [field.field, initialFieldValue(field, initialValues?.[field.field])]));
2514
2514
  return applyReactiveFormulas(fields, initial);
2515
2515
  }
2516
+ function remoteOptionValues(values, initialValues) {
2517
+ const inherited = Object.fromEntries(
2518
+ Object.entries(initialValues ?? {}).map(([field, value3]) => [field, toValue(value3)])
2519
+ );
2520
+ return { ...inherited, ...values };
2521
+ }
2516
2522
  function validate(fields, values) {
2517
2523
  const errors = {};
2518
2524
  fields.forEach((field) => {
@@ -2626,6 +2632,10 @@ function DynamicForm({ title, eyebrow = "Cadastro", fields: rawFields, initialVa
2626
2632
  () => new Set(remoteFieldKey ? remoteFieldKey.split("|") : [])
2627
2633
  );
2628
2634
  const items = useMemo6(() => buildItems(fields), [rawFields]);
2635
+ const optionValues = useMemo6(
2636
+ () => remoteOptionValues(values, initialValues),
2637
+ [values, initialValues]
2638
+ );
2629
2639
  useEffect9(() => {
2630
2640
  setPendingRemoteFields(new Set(remoteFieldKey ? remoteFieldKey.split("|") : []));
2631
2641
  }, [remoteFieldKey]);
@@ -2733,7 +2743,7 @@ function DynamicForm({ title, eyebrow = "Cadastro", fields: rawFields, initialVa
2733
2743
  inputId: id,
2734
2744
  errorId,
2735
2745
  value: values[field.field] ?? "",
2736
- values,
2746
+ values: optionValues,
2737
2747
  parent: contextValues,
2738
2748
  invalid: !!message,
2739
2749
  readonly,
@@ -6730,7 +6740,7 @@ function Sidebar({ app, menu, registry }) {
6730
6740
  // package.json
6731
6741
  var package_default = {
6732
6742
  name: "@oondemand/oon-core-front",
6733
- version: "0.5.2",
6743
+ version: "0.5.3",
6734
6744
  repository: {
6735
6745
  type: "git",
6736
6746
  url: "git+https://github.com/oondemand/oon-platform.git",