@engagebay/engagebay-form-module 1.0.8-beta.3 → 1.0.8-beta.5
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/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import { Description } from "@headlessui/react";
|
|
|
9
9
|
import React from "react";
|
|
10
10
|
import RenderFormField from "../util/RenderFormField";
|
|
11
11
|
import clsx from "clsx";
|
|
12
|
+
import { XMarkIcon } from "@heroicons/react/20/solid";
|
|
12
13
|
const FileUploadField: React.FC<FormFieldComponentPropSchema> = (
|
|
13
14
|
props: FormFieldComponentPropSchema
|
|
14
15
|
) => {
|
|
@@ -103,7 +104,7 @@ const FileUploadField: React.FC<FormFieldComponentPropSchema> = (
|
|
|
103
104
|
<Description>Loading...</Description>
|
|
104
105
|
) : (
|
|
105
106
|
props.fieldConfig.fieldContainer ? <props.fieldConfig.fieldContainer /> :
|
|
106
|
-
<div className={"flex flex-col items-center justify-center pt-5 pb-6"}>
|
|
107
|
+
<div className={"flex flex-col items-center justify-center pt-5 pb-6 px-2"}>
|
|
107
108
|
{file ? (
|
|
108
109
|
<>
|
|
109
110
|
{isImageFile(file) ? (
|
|
@@ -125,7 +126,7 @@ const FileUploadField: React.FC<FormFieldComponentPropSchema> = (
|
|
|
125
126
|
</div>
|
|
126
127
|
) : (
|
|
127
128
|
<div className="flex">
|
|
128
|
-
<span className="m-2">
|
|
129
|
+
<span className="m-2 max-w-xs truncate">
|
|
129
130
|
{file?.name || file?.toString?.() || ''}
|
|
130
131
|
</span>{" "}
|
|
131
132
|
<button
|
|
@@ -136,8 +137,8 @@ const FileUploadField: React.FC<FormFieldComponentPropSchema> = (
|
|
|
136
137
|
);
|
|
137
138
|
setFile(null);
|
|
138
139
|
}}
|
|
139
|
-
className="btn btn-
|
|
140
|
-
|
|
140
|
+
className="btn btn-sm ">
|
|
141
|
+
<XMarkIcon className="w-3.5 h-3.5 text-gray-800"/>
|
|
141
142
|
</button>
|
|
142
143
|
</div>
|
|
143
144
|
)}
|
|
@@ -199,7 +199,12 @@ const Typeahead2: React.FC<FormFieldComponentPropSchema> = (
|
|
|
199
199
|
: result.includes(resData.value)
|
|
200
200
|
? [...result.filter((v: string) => v != resData.value), resData.value]
|
|
201
201
|
: [...result, resData.value];
|
|
202
|
-
|
|
202
|
+
handleChange(
|
|
203
|
+
result,
|
|
204
|
+
formContext,
|
|
205
|
+
props.fieldConfig,
|
|
206
|
+
props.onChange,
|
|
207
|
+
);
|
|
203
208
|
};
|
|
204
209
|
|
|
205
210
|
const getInput = () => {
|
|
@@ -243,7 +243,7 @@ export class FormFieldPatternsImpl implements FormFieldPatterns {
|
|
|
243
243
|
static readonly EMAIL = new FormFieldPatternsImpl(
|
|
244
244
|
"EMAIL",
|
|
245
245
|
"Please enter a valid email address",
|
|
246
|
-
/^([
|
|
246
|
+
/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i
|
|
247
247
|
);
|
|
248
248
|
// static readonly PASSWORD = new FormFieldPatternsImpl(
|
|
249
249
|
// "PASSWORD",
|