@onehat/ui 0.3.335 → 0.3.337

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": "@onehat/ui",
3
- "version": "0.3.335",
3
+ "version": "0.3.337",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -400,6 +400,7 @@ function Form(props) {
400
400
  title,
401
401
  name,
402
402
  isEditable = true,
403
+ isEditingEnabledInPlainEditor,
403
404
  label,
404
405
  items,
405
406
  onChange: onEditorChange,
@@ -425,6 +426,10 @@ function Form(props) {
425
426
  if (propertyDef?.isEditingDisabled && checkIsEditingDisabled) {
426
427
  isEditable = false;
427
428
  }
429
+ if (isEditingEnabledInPlainEditor && editorType === EDITOR_TYPE__PLAIN) {
430
+ // If this is a plain editor, allow the field to be editable, even if it's not editable in other editor types
431
+ isEditable = true;
432
+ }
428
433
  if (!type) {
429
434
  if (isEditable) {
430
435
  const
@@ -228,7 +228,6 @@ export default function withPdfButtons(WrappedComponent) {
228
228
  onChooseEmailAddress = (data) => {
229
229
  showModal({
230
230
  title: 'Email To',
231
- message: 'Please enter an email address to send the PDF to. (1)',
232
231
  includeCancel: true,
233
232
  onOk: () => {
234
233
  hideModal();
@@ -250,7 +249,8 @@ export default function withPdfButtons(WrappedComponent) {
250
249
  <Column w="40px" mr={5} justifyContent="flex-start">
251
250
  <Icon as={TriangleExclamation} size={10} color="#000" />
252
251
  </Column>
253
- <Text flex={1}>Please enter an email address to send the PDF to. (2)</Text>
252
+ <Text flex={1}>Please enter one more more email addresses{"\n"}
253
+ (separated by a comma) to send the PDF to.</Text>
254
254
  </Row>
255
255
  <Form
256
256
  parent={self}
@@ -269,7 +269,21 @@ export default function withPdfButtons(WrappedComponent) {
269
269
  },
270
270
  ]}
271
271
  validator={yup.object({
272
- email: yup.string().email().required(),
272
+ email: yup.string().required().test({
273
+ name: 'csvEmails',
274
+ test: function(value) {
275
+ const firstInvalidEmail = value.split(",")
276
+ .map(email => email.trim())
277
+ .filter(v => !_.isEmpty(v))
278
+ .find(v => !yup.string().email().isValidSync(v));
279
+ if (firstInvalidEmail) {
280
+ return this.createError({
281
+ message: `The email address '${firstInvalidEmail}' is invalid.`
282
+ });
283
+ }
284
+ return true;
285
+ },
286
+ }),
273
287
  })}
274
288
  />
275
289
  </Column>,
@@ -11,7 +11,7 @@ import {
11
11
  DUPLICATE,
12
12
  PRINT,
13
13
  UPLOAD_DOWNLOAD,
14
- } from '../../constants/Commands.js';
14
+ } from '../../Constants/Commands.js';
15
15
  import Clipboard from '../Icons/Clipboard.js';
16
16
  import Duplicate from '../Icons/Duplicate.js';
17
17
  import Edit from '../Icons/Edit.js';