@onehat/ui 0.3.88 → 0.3.90

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.88",
3
+ "version": "0.3.90",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -508,7 +508,9 @@ function Form(props) {
508
508
  if (validator?.fields && validator.fields[name]?.exclusiveTests?.required) {
509
509
  isRequired = true;
510
510
  }
511
- } else if (propertyDef?.validator?.spec && !propertyDef.validator.spec.optional) {
511
+ } else if ((propertyDef?.validator?.spec && !propertyDef.validator.spec.optional) ||
512
+ (propertyDef?.requiredIfPhantom && isPhantom) ||
513
+ (propertyDef?.requiredIfNotPhantom && !isPhantom)) {
512
514
  // property definition
513
515
  isRequired = true;
514
516
  }
@@ -56,8 +56,10 @@ export default function withValue(WrappedComponent) {
56
56
  newValue = _.isNil(newValue) ? [] : [newValue];
57
57
  }
58
58
  if (_.isArray(newValue)) {
59
+ const sortFn = natsort.default || natsort; // was having trouble with webpack and this solves it
60
+
59
61
  // TODO: sort by the sortProperty, whatever that is, instead of just value
60
- newValue.sort(natsort()); // Only sort if we're using id/text arrangement. Otherwise, keep sort order as specified in Repository.
62
+ newValue.sort(sortFn()); // Only sort if we're using id/text arrangement. Otherwise, keep sort order as specified in Repository.
61
63
  }
62
64
  if (isValueAsStringifiedJson) {
63
65
  newValue = JSON.stringify(newValue);
@@ -192,7 +192,7 @@ function TabBar(props) {
192
192
  }
193
193
  const tabIcon = _.clone(tab._icon);
194
194
  if (tabIcon.as && _.isString(tabIcon.as)) {
195
- Type = getComponentFromType(tabIcon.as);
195
+ const Type = getComponentFromType(tabIcon.as);
196
196
  if (Type) {
197
197
  tabIcon.as = Type;
198
198
  }