@overmap-ai/forms 1.0.12-links.15 → 1.0.12-links.17
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/forms.js +18 -11
- package/dist/forms.js.map +1 -1
- package/dist/forms.umd.cjs +19 -12
- package/dist/forms.umd.cjs.map +1 -1
- package/dist/style.css +8 -0
- package/package.json +1 -2
package/dist/forms.js
CHANGED
|
@@ -11,8 +11,8 @@ import React, { useMemo, memo, useCallback, useState, useEffect, useRef, forward
|
|
|
11
11
|
import { CheckCircledIcon, FontFamilyIcon, CalendarIcon, InputIcon, RowsIcon, PlusIcon, Cross1Icon, ListBulletIcon, DropdownMenuIcon, CheckboxIcon, UploadIcon, StarFilledIcon, StarIcon, QuestionMarkCircledIcon, PersonIcon, Pencil1Icon, TrashIcon, CopyIcon, DragHandleDots2Icon, DotsVerticalIcon } from "@radix-ui/react-icons";
|
|
12
12
|
import { TextField as TextField$1, Box, Card, Heading, Avatar, Em, Strong, Tabs } from "@radix-ui/themes";
|
|
13
13
|
import Linkify from "linkify-react";
|
|
14
|
+
import { classNames, slugify, useAppSelector, selectFormRevision, useSDK, selectSubmissionAttachments, selectFilteredUserForms, selectUserFormMapping, selectOrganization, selectUser, selectNumberOfUserForms, selectCurrentUser, isToday, getLocalDateString, selectLatestFormRevision, useFileSrc, selectSubmissionsForForm } from "@overmap-ai/core";
|
|
14
15
|
import { DragDropContext, Droppable, Draggable } from "@hello-pangea/dnd";
|
|
15
|
-
import { slugify, useAppSelector, selectFormRevision, useSDK, selectSubmissionAttachments, selectFilteredUserForms, selectUserFormMapping, selectOrganization, selectUser, selectNumberOfUserForms, selectCurrentUser, classNames, isToday, getLocalDateString, selectLatestFormRevision, useFileSrc, selectSubmissionsForForm } from "@overmap-ai/core";
|
|
16
16
|
import get from "lodash.get";
|
|
17
17
|
import set from "lodash.set";
|
|
18
18
|
import cloneDeep from "lodash.clonedeep";
|
|
@@ -107,7 +107,7 @@ class BaseField extends BaseFormElement {
|
|
|
107
107
|
__publicField(BaseField, "fieldTypeName");
|
|
108
108
|
__publicField(BaseField, "fieldTypeDescription");
|
|
109
109
|
const description$1 = "_description_17zed_1";
|
|
110
|
-
const styles$
|
|
110
|
+
const styles$4 = {
|
|
111
111
|
description: description$1
|
|
112
112
|
};
|
|
113
113
|
const InputWithLabel = (props) => {
|
|
@@ -121,7 +121,7 @@ const InputWithLabelAndHelpText = (props) => {
|
|
|
121
121
|
const { helpText, children, severity } = props;
|
|
122
122
|
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
|
|
123
123
|
children,
|
|
124
|
-
/* @__PURE__ */ jsx(Flex, { direction: "column", children: /* @__PURE__ */ jsx(Text, { size: "1", severity, className: styles$
|
|
124
|
+
/* @__PURE__ */ jsx(Flex, { direction: "column", children: /* @__PURE__ */ jsx(Text, { size: "1", severity, className: styles$4.description, children: helpText }) })
|
|
125
125
|
] });
|
|
126
126
|
};
|
|
127
127
|
const useFormikInput = (props) => {
|
|
@@ -473,16 +473,23 @@ __publicField(StringOrTextField, "_validateMax", (value, allValues) => {
|
|
|
473
473
|
}
|
|
474
474
|
return null;
|
|
475
475
|
});
|
|
476
|
+
const clickableLinkContainer = "_clickableLinkContainer_1ace7_1";
|
|
477
|
+
const TextFieldInputCopy = "_TextFieldInputCopy_1ace7_5";
|
|
478
|
+
const styles$3 = {
|
|
479
|
+
clickableLinkContainer,
|
|
480
|
+
TextFieldInputCopy
|
|
481
|
+
};
|
|
476
482
|
const StringInput = memo(function StringInput2(props) {
|
|
477
483
|
const [{ inputId, labelId, severity, helpText, label, fieldProps, field }, rest] = useFormikInput(props);
|
|
478
484
|
const color = useSeverityColor(severity);
|
|
479
|
-
return /* @__PURE__ */ jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsx(InputWithLabel, { severity, inputId, labelId, label, children: !rest.disabled ? /* @__PURE__ */ jsx(TextField$1.Input, { ...rest, ...fieldProps, type: field.inputType, id: inputId, color }) : /* @__PURE__ */ jsxs(TextField$1.Root, {
|
|
485
|
+
return /* @__PURE__ */ jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsx(InputWithLabel, { severity, inputId, labelId, label, children: !rest.disabled ? /* @__PURE__ */ jsx(TextField$1.Input, { ...rest, ...fieldProps, type: field.inputType, id: inputId, color }) : /* @__PURE__ */ jsxs(TextField$1.Root, { className: styles$3.clickableLinkContainer, children: [
|
|
480
486
|
/* @__PURE__ */ jsx(
|
|
481
|
-
|
|
487
|
+
"div",
|
|
482
488
|
{
|
|
483
|
-
className:
|
|
484
|
-
|
|
485
|
-
|
|
489
|
+
className: classNames(
|
|
490
|
+
"rt-TextFieldInput rt-r-size-2 rt-variant-surface",
|
|
491
|
+
styles$3.TextFieldInputCopy
|
|
492
|
+
),
|
|
486
493
|
children: /* @__PURE__ */ jsx(
|
|
487
494
|
Linkify,
|
|
488
495
|
{
|
|
@@ -1032,7 +1039,7 @@ const FieldSectionLayout = memo(function FieldSectionLayout2(props) {
|
|
|
1032
1039
|
return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "3", children: [
|
|
1033
1040
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
1034
1041
|
/* @__PURE__ */ jsx(Heading, { as: "h3", size: "3", children: label }),
|
|
1035
|
-
/* @__PURE__ */ jsx(Text, { className: styles$
|
|
1042
|
+
/* @__PURE__ */ jsx(Text, { className: styles$4.description, children: description2 })
|
|
1036
1043
|
] }),
|
|
1037
1044
|
inputs
|
|
1038
1045
|
] }) });
|
|
@@ -1555,7 +1562,7 @@ const FormRenderer = memo(
|
|
|
1555
1562
|
[schema.title]
|
|
1556
1563
|
);
|
|
1557
1564
|
const Description = useMemo(
|
|
1558
|
-
() => typeof schema.description === "string" ? /* @__PURE__ */ jsx(Text, { className: styles$
|
|
1565
|
+
() => typeof schema.description === "string" ? /* @__PURE__ */ jsx(Text, { className: styles$4.description, children: schema.description }) : schema.description,
|
|
1559
1566
|
[schema.description]
|
|
1560
1567
|
);
|
|
1561
1568
|
const inputs = useFieldInputs(schema.fields, { formId: formId2, disabled: readonly });
|
|
@@ -2419,7 +2426,7 @@ const FieldSectionWithActions = memo(function FieldSectionWithActions2(props) {
|
|
|
2419
2426
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "2", grow: "1", children: [
|
|
2420
2427
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
2421
2428
|
/* @__PURE__ */ jsx(Heading, { as: "h3", size: "3", children: field.label }),
|
|
2422
|
-
/* @__PURE__ */ jsx(Text, { className: styles$
|
|
2429
|
+
/* @__PURE__ */ jsx(Text, { className: styles$4.description, children: field.description })
|
|
2423
2430
|
] }),
|
|
2424
2431
|
field.condition && /* @__PURE__ */ jsx(Text, { size: "1", children: /* @__PURE__ */ jsxs(Em, { children: [
|
|
2425
2432
|
"Display only if ",
|