@overmap-ai/core 1.0.33-revamp-forms-builder.22 → 1.0.33-revamp-forms-builder.24

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.
@@ -6089,7 +6089,7 @@ const OvermapProvider = (props) => {
6089
6089
  }
6090
6090
  return /* @__PURE__ */ jsx(OvermapContext.Provider, { value: null, children: ret });
6091
6091
  };
6092
- const description$2 = "_description_o5vqt_1";
6092
+ const description$1 = "_description_o5vqt_1";
6093
6093
  const floatingButtonContainer$1 = "_floatingButtonContainer_o5vqt_5";
6094
6094
  const tabsList = "_tabsList_o5vqt_12";
6095
6095
  const tabTrigger = "_tabTrigger_o5vqt_20";
@@ -6097,7 +6097,7 @@ const patchfieldBorder = "_patchfieldBorder_o5vqt_24";
6097
6097
  const title = "_title_o5vqt_24";
6098
6098
  const error = "_error_o5vqt_40";
6099
6099
  const styles$7 = {
6100
- description: description$2,
6100
+ description: description$1,
6101
6101
  floatingButtonContainer: floatingButtonContainer$1,
6102
6102
  tabsList,
6103
6103
  tabTrigger,
@@ -6200,10 +6200,10 @@ class BaseField extends BaseFormElement {
6200
6200
  }
6201
6201
  __publicField(BaseField, "fieldTypeName");
6202
6202
  __publicField(BaseField, "fieldTypeDescription");
6203
- const description$1 = "_description_1p32e_1";
6203
+ const description = "_description_1p32e_1";
6204
6204
  const floatingButtonContainer = "_floatingButtonContainer_1p32e_5";
6205
6205
  const styles$6 = {
6206
- description: description$1,
6206
+ description,
6207
6207
  floatingButtonContainer
6208
6208
  };
6209
6209
  const InputWithLabel = (props) => {
@@ -6294,7 +6294,6 @@ const BooleanInput = memo((props) => {
6294
6294
  value: value.toString(),
6295
6295
  checked: value,
6296
6296
  onCheckedChange: fieldProps.onChange,
6297
- alwaysShow: true,
6298
6297
  onChange: void 0,
6299
6298
  onBlur: void 0
6300
6299
  }
@@ -7354,7 +7353,7 @@ const layoutPropDefs = {
7354
7353
  };
7355
7354
  function extractLayoutProps(props) {
7356
7355
  const { rest: paddingRest, ...paddingProps } = extractPaddingProps(props);
7357
- const { position = layoutPropDefs.position.default, width = layoutPropDefs.width.default, height = layoutPropDefs.height.default, inset = layoutPropDefs.inset.default, top = layoutPropDefs.top.default, bottom = layoutPropDefs.bottom.default, left = layoutPropDefs.left.default, right = layoutPropDefs.right.default, shrink = layoutPropDefs.shrink.default, grow = layoutPropDefs.grow.default, ...rest } = paddingRest;
7356
+ const { position = layoutPropDefs.position.default, width = layoutPropDefs.width.default, height = layoutPropDefs.height.default, inset = layoutPropDefs.inset.default, top = layoutPropDefs.top.default, bottom = layoutPropDefs.bottom.default, left = layoutPropDefs.left.default, right = layoutPropDefs.right.default, shrink = layoutPropDefs.shrink.default, grow: grow2 = layoutPropDefs.grow.default, ...rest } = paddingRest;
7358
7357
  return {
7359
7358
  ...paddingProps,
7360
7359
  position,
@@ -7366,7 +7365,7 @@ function extractLayoutProps(props) {
7366
7365
  left,
7367
7366
  right,
7368
7367
  shrink,
7369
- grow,
7368
+ grow: grow2,
7370
7369
  rest
7371
7370
  };
7372
7371
  }
@@ -10276,15 +10275,15 @@ const FieldActions = memo((props) => {
10276
10275
  ] });
10277
10276
  });
10278
10277
  FieldActions.displayName = "FieldActions";
10279
- const popoverInputsContainer = "_popoverInputsContainer_18pn8_1";
10280
- const typeBadge = "_typeBadge_18pn8_5";
10281
- const description = "_description_18pn8_10";
10282
- const previewInput = "_previewInput_18pn8_14";
10278
+ const popoverInputsContainer = "_popoverInputsContainer_95i8x_1";
10279
+ const typeBadge = "_typeBadge_95i8x_5";
10280
+ const previewInput = "_previewInput_95i8x_10";
10281
+ const grow = "_grow_95i8x_14";
10283
10282
  const styles = {
10284
10283
  popoverInputsContainer,
10285
10284
  typeBadge,
10286
- description,
10287
- previewInput
10285
+ previewInput,
10286
+ grow
10288
10287
  };
10289
10288
  const FieldSettingsPopover = memo((props) => {
10290
10289
  const { popoverInputs, hasError } = props;
@@ -10354,6 +10353,16 @@ const FieldBuilder = memo((props) => {
10354
10353
  }
10355
10354
  conditionValue = Array.isArray((_c = initial.condition) == null ? void 0 : _c.value) ? initial.condition.value.map((v) => typeof v === "string" ? v : v.label).join(", ") : (_e = (_d = initial.condition) == null ? void 0 : _d.value) == null ? void 0 : _e.toString();
10356
10355
  }
10356
+ const handleInputChangeForInput = useCallback((event) => {
10357
+ if (event.target.parentNode instanceof HTMLElement) {
10358
+ event.target.parentNode.dataset.replicatedValue = event.target.value;
10359
+ }
10360
+ }, []);
10361
+ const handleInputChangeForTextArea = useCallback((event) => {
10362
+ if (event.target.parentNode instanceof HTMLElement) {
10363
+ event.target.parentNode.dataset.replicatedValue = event.target.value;
10364
+ }
10365
+ }, []);
10357
10366
  const type = initial.type;
10358
10367
  const fieldCls = CompleteFieldTypeToClsMapping[type];
10359
10368
  const [directlyShownFields, popoverFields] = useMemo(() => {
@@ -10412,7 +10421,7 @@ const FieldBuilder = memo((props) => {
10412
10421
  const deserializedField = useMemo(() => deserialize(initial), [initial]);
10413
10422
  const previewInput2 = useFieldInput(deserializedField, { formId, disabled: true, showInputOnly: true });
10414
10423
  return /* @__PURE__ */ jsxs(Flex, { align: "center", grow: "1", children: [
10415
- /* @__PURE__ */ jsxs(Flex, { direction: "column", grow: "1", children: [
10424
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
10416
10425
  fieldCls === FieldSection && /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
10417
10426
  directlyShownFields.length > 0 && directlyShownInputs,
10418
10427
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", children: [
@@ -10437,8 +10446,7 @@ const FieldBuilder = memo((props) => {
10437
10446
  {
10438
10447
  checked: value,
10439
10448
  onCheckedChange: setValue,
10440
- label: /* @__PURE__ */ jsx(Text, { size: "2", children: "Required field" }),
10441
- alwaysShow: true
10449
+ label: /* @__PURE__ */ jsx(Text, { size: "2", children: "Required field" })
10442
10450
  }
10443
10451
  )
10444
10452
  }
@@ -10455,11 +10463,13 @@ const FieldBuilder = memo((props) => {
10455
10463
  render: ({ setValue, value }) => /* @__PURE__ */ jsx(
10456
10464
  Input,
10457
10465
  {
10466
+ className: styles.grow,
10458
10467
  placeholder: `Enter a ${type === "section" ? "section" : "field"} label`,
10459
10468
  value,
10460
10469
  onChange: (event) => {
10461
10470
  setValue(event.target.value);
10462
10471
  },
10472
+ onInput: handleInputChangeForInput,
10463
10473
  maxLength: 200,
10464
10474
  showInputLength: false,
10465
10475
  variant: "ghost",
@@ -10476,13 +10486,14 @@ const FieldBuilder = memo((props) => {
10476
10486
  render: ({ setValue, value }) => /* @__PURE__ */ jsx(
10477
10487
  TextArea,
10478
10488
  {
10479
- className: styles.description,
10489
+ className: styles.grow,
10480
10490
  placeholder: `Enter a ${type === "section" ? "section" : "field"} description`,
10481
10491
  value,
10482
10492
  onChange: (event) => {
10483
10493
  setValue(event.target.value);
10484
10494
  },
10485
- resize: "vertical",
10495
+ onInput: handleInputChangeForTextArea,
10496
+ resize: "none",
10486
10497
  maxLength: 1e3,
10487
10498
  showInputLength: false,
10488
10499
  variant: "ghost"
@@ -10849,36 +10860,6 @@ const findSection = (fields, sectionId) => {
10849
10860
  return [section, i];
10850
10861
  }
10851
10862
  };
10852
- const BasicFieldSection = memo((props) => {
10853
- const { field, provided } = props;
10854
- return /* @__PURE__ */ jsx(
10855
- Card,
10856
- {
10857
- ref: provided == null ? void 0 : provided.innerRef,
10858
- ...provided == null ? void 0 : provided.draggableProps,
10859
- ...provided == null ? void 0 : provided.dragHandleProps,
10860
- style: { ...provided == null ? void 0 : provided.draggableProps.style, height: "80px" },
10861
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "2", children: [
10862
- /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "2", children: [
10863
- /* @__PURE__ */ jsx(Text, { size: "4", children: field.label }),
10864
- /* @__PURE__ */ jsx(Badge, { className: styles$1.typeBadge, children: /* @__PURE__ */ jsxs(Text, { children: [
10865
- field.fields.length,
10866
- " fields"
10867
- ] }) })
10868
- ] }),
10869
- /* @__PURE__ */ jsx(Flex, { direction: "row", gap: "2", children: field.fields.map((child) => {
10870
- const childInfo = FieldTypeToClsMapping[child.type];
10871
- const Icon = childInfo.Icon;
10872
- return /* @__PURE__ */ jsx(Flex, { gap: "3", children: /* @__PURE__ */ jsxs(Badge, { className: styles$1.typeBadge, children: [
10873
- /* @__PURE__ */ jsx(Icon, {}),
10874
- /* @__PURE__ */ jsx(Text, { children: childInfo.fieldTypeName })
10875
- ] }) }, child.identifier);
10876
- }) })
10877
- ] })
10878
- }
10879
- );
10880
- });
10881
- BasicFieldSection.displayName = "BasicFieldSection";
10882
10863
  const FieldsEditor = memo(() => {
10883
10864
  const { values, setFieldValue } = useFormikContext();
10884
10865
  const [dropState, dispatch] = useReducer(reducer, values.fields, initializer);