ywana-core8 0.0.447 → 0.0.450

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.
@@ -1328,7 +1328,8 @@ var ContentType = /*#__PURE__*/function () {
1328
1328
  var name = _ref5[0],
1329
1329
  field = _ref5[1];
1330
1330
  var type = field.type,
1331
- item = field.item;
1331
+ item = field.item,
1332
+ optional = field.optional;
1332
1333
  var entryData = data ? data[name] : null;
1333
1334
 
1334
1335
  switch (type) {
@@ -1345,6 +1346,8 @@ var ContentType = /*#__PURE__*/function () {
1345
1346
  break;
1346
1347
 
1347
1348
  case TYPES.ENTITY:
1349
+ if (optional === true) console.log('OPTIONAL', field, !entryData);
1350
+ if (optional === true && !entryData) break;
1348
1351
  var child1 = new ContentType(item);
1349
1352
  next[name] = child1.value(entryData);
1350
1353
  break;
@@ -5238,11 +5241,8 @@ var FieldViewer = function FieldViewer(props) {
5238
5241
  item = field.item,
5239
5242
  label = field.label,
5240
5243
  _field$visible = field.visible,
5241
- visible = _field$visible === void 0 ? true : _field$visible,
5242
- optional = field.optional;
5244
+ visible = _field$visible === void 0 ? true : _field$visible;
5243
5245
  if (!visible) return null;
5244
- if (optional && !value) return null;
5245
- console.log('contentviewer>fieldViewer', field, optional, value, optional && !value);
5246
5246
 
5247
5247
  switch (type) {
5248
5248
  case TYPES.STRING: