@onehat/ui 0.3.49 → 0.3.50

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.49",
3
+ "version": "0.3.50",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -475,14 +475,18 @@ function Form(props) {
475
475
  {buildAdditionalButtons(item.additionalEditButtons, self, { fieldState, formSetValue, formGetValues, formState })}
476
476
  </Row>;
477
477
  }
478
-
478
+
479
479
  if (label && editorType !== EDITOR_TYPE__INLINE) {
480
480
  const labelProps = {};
481
481
  if (defaults?.labelWidth) {
482
482
  labelProps.w = defaults.labelWidth;
483
483
  }
484
+ let requiredIndicator = null;
485
+ if (propertyDef.validator?.spec && !propertyDef.validator.spec.optional) {
486
+ requiredIndicator = <Text color="#f00" pr={1}>*</Text>;
487
+ }
484
488
  element = <Row w="100%" py={1}>
485
- <Label {...labelProps}>{label}</Label>
489
+ <Label {...labelProps}>{requiredIndicator}{label}</Label>
486
490
  {element}
487
491
  </Row>;
488
492
  }
@@ -530,7 +534,6 @@ function Form(props) {
530
534
  return components;
531
535
  },
532
536
  onSubmitError = (errors, e) => {
533
- debugger;
534
537
  if (editorType === EDITOR_TYPE__INLINE) {
535
538
  alert(errors.message);
536
539
  }