@engagebay/engagebay-form-module 1.0.8-beta.3 → 1.0.8-beta.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engagebay/engagebay-form-module",
3
- "version": "1.0.8-beta.3",
3
+ "version": "1.0.8-beta.4",
4
4
  "description": "Provide base form components to reacho",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -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-outline-dark btn-sm ">
140
- X
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
  )}
@@ -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
- /^([A-Za-z0-9\._%+\-]+@[A-Za-z0-9\.\-]+\.[A-Za-z]{2,})$/
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",
@@ -476,7 +476,7 @@ export function renderListBoxValue(
476
476
  if (!value && !listOptions) {
477
477
  return getPlaceholder();
478
478
  }
479
- if (!outputFormat && Array.isArray(value)) {
479
+ if (Array.isArray(value)) {
480
480
  return renderAsArray();
481
481
  }
482
482
  return renderAsString();