@onehat/ui 0.3.187 → 0.3.188

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.187",
3
+ "version": "0.3.188",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -287,17 +287,12 @@ function Form(props) {
287
287
  return <Row>{elements}</Row>;
288
288
  },
289
289
  buildFromItems = () => {
290
- const builtItems = [];
291
- _.each(items, (item, ix) => {
292
- if (!item) {
293
- return;
294
- }
295
- const builtItem = buildFromItem(item, ix, columnDefaults);
296
- builtItems.push(builtItem);
297
- });
298
- return builtItems;
290
+ return _.map(items, (item, ix) => buildFromItem(item, ix, columnDefaults));
299
291
  },
300
292
  buildFromItem = (item, ix, defaults) => {
293
+ if (!item) {
294
+ return null;
295
+ }
301
296
  if (React.isValidElement(item)) {
302
297
  return item;
303
298
  }
@@ -57,17 +57,12 @@ function Viewer(props) {
57
57
  styles = UiGlobals.styles,
58
58
  flex = props.flex || 1,
59
59
  buildFromItems = () => {
60
- const builtItems = [];
61
- _.each(items, (item, ix) => {
62
- if (!item) {
63
- return;
64
- }
65
- const builtItem = buildFromItem(item, ix, columnDefaults);
66
- builtItems.push(builtItem);
67
- });
68
- return builtItems;
60
+ return _.map(items, (item, ix) => buildFromItem(item, ix, columnDefaults));
69
61
  },
70
62
  buildFromItem = (item, ix, defaults) => {
63
+ if (!item) {
64
+ return null;
65
+ }
71
66
  let {
72
67
  type,
73
68
  title,