ywana-core8 0.0.595 → 0.0.598

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/dist/index.umd.js CHANGED
@@ -5205,16 +5205,18 @@
5205
5205
  label = field.label,
5206
5206
  _field$visible = field.visible,
5207
5207
  visible = _field$visible === void 0 ? true : _field$visible,
5208
- optional = field.optional;
5208
+ optional = field.optional,
5209
+ _field$hidden = field.hidden,
5210
+ hidden = _field$hidden === void 0 ? false : _field$hidden;
5209
5211
  if (!visible) return null;
5210
5212
  if (optional && value === undefined) return null;
5213
+ if (hidden) return null;
5211
5214
 
5212
5215
  switch (type) {
5213
5216
  case TYPES.STRING:
5214
- return /*#__PURE__*/React__default["default"].createElement(Property, {
5215
- label: label,
5216
- value: value,
5217
- options: field.options
5217
+ return /*#__PURE__*/React__default["default"].createElement(StringViewer, {
5218
+ field: field,
5219
+ value: value
5218
5220
  });
5219
5221
 
5220
5222
  case TYPES.ENTITY:
@@ -5258,6 +5260,34 @@
5258
5260
  });
5259
5261
  })));
5260
5262
  };
5263
+ /**
5264
+ * StringViewer
5265
+ */
5266
+
5267
+
5268
+ var StringViewer = function StringViewer(props) {
5269
+ var field = props.field,
5270
+ value = props.value;
5271
+ var format = field.format,
5272
+ label = field.label,
5273
+ options = field.options;
5274
+
5275
+ switch (format) {
5276
+ case FORMATS.IMG:
5277
+ return /*#__PURE__*/React__default["default"].createElement("div", {
5278
+ className: "img-field"
5279
+ }, /*#__PURE__*/React__default["default"].createElement("img", {
5280
+ src: value
5281
+ }));
5282
+
5283
+ default:
5284
+ return /*#__PURE__*/React__default["default"].createElement(Property, {
5285
+ label: label,
5286
+ value: value,
5287
+ options: options
5288
+ });
5289
+ }
5290
+ };
5261
5291
  /**
5262
5292
  * Array Viewer
5263
5293
  */
@@ -5538,6 +5568,7 @@
5538
5568
  _props$canEdit = props.canEdit,
5539
5569
  canEdit = _props$canEdit === void 0 ? false : _props$canEdit,
5540
5570
  searchBy = props.searchBy,
5571
+ addValidator = props.addValidator,
5541
5572
  _props$autosave = props.autosave,
5542
5573
  autosave = _props$autosave === void 0 ? false : _props$autosave,
5543
5574
  _props$delay = props.delay,
@@ -5586,7 +5617,8 @@
5586
5617
  site.openDialog( /*#__PURE__*/React__default["default"].createElement(CreateContentDialog, {
5587
5618
  label: "" + name,
5588
5619
  type: schema,
5589
- onOK: onOK
5620
+ onOK: onOK,
5621
+ validator: addValidator
5590
5622
  }));
5591
5623
  }
5592
5624