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.cjs +38 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +38 -6
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +38 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +2 -2
- package/src/domain/ContentViewer.js +24 -5
package/dist/index.cjs
CHANGED
@@ -5211,16 +5211,18 @@ var FieldViewer = function FieldViewer(props) {
|
|
5211
5211
|
label = field.label,
|
5212
5212
|
_field$visible = field.visible,
|
5213
5213
|
visible = _field$visible === void 0 ? true : _field$visible,
|
5214
|
-
optional = field.optional
|
5214
|
+
optional = field.optional,
|
5215
|
+
_field$hidden = field.hidden,
|
5216
|
+
hidden = _field$hidden === void 0 ? false : _field$hidden;
|
5215
5217
|
if (!visible) return null;
|
5216
5218
|
if (optional && value === undefined) return null;
|
5219
|
+
if (hidden) return null;
|
5217
5220
|
|
5218
5221
|
switch (type) {
|
5219
5222
|
case TYPES.STRING:
|
5220
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
5221
|
-
|
5222
|
-
value: value
|
5223
|
-
options: field.options
|
5223
|
+
return /*#__PURE__*/React__default["default"].createElement(StringViewer, {
|
5224
|
+
field: field,
|
5225
|
+
value: value
|
5224
5226
|
});
|
5225
5227
|
|
5226
5228
|
case TYPES.ENTITY:
|
@@ -5264,6 +5266,34 @@ var EntityViewer = function EntityViewer(props) {
|
|
5264
5266
|
});
|
5265
5267
|
})));
|
5266
5268
|
};
|
5269
|
+
/**
|
5270
|
+
* StringViewer
|
5271
|
+
*/
|
5272
|
+
|
5273
|
+
|
5274
|
+
var StringViewer = function StringViewer(props) {
|
5275
|
+
var field = props.field,
|
5276
|
+
value = props.value;
|
5277
|
+
var format = field.format,
|
5278
|
+
label = field.label,
|
5279
|
+
options = field.options;
|
5280
|
+
|
5281
|
+
switch (format) {
|
5282
|
+
case FORMATS.IMG:
|
5283
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
5284
|
+
className: "img-field"
|
5285
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
5286
|
+
src: value
|
5287
|
+
}));
|
5288
|
+
|
5289
|
+
default:
|
5290
|
+
return /*#__PURE__*/React__default["default"].createElement(Property, {
|
5291
|
+
label: label,
|
5292
|
+
value: value,
|
5293
|
+
options: options
|
5294
|
+
});
|
5295
|
+
}
|
5296
|
+
};
|
5267
5297
|
/**
|
5268
5298
|
* Array Viewer
|
5269
5299
|
*/
|
@@ -5544,6 +5574,7 @@ var CollectionPage = function CollectionPage(props) {
|
|
5544
5574
|
_props$canEdit = props.canEdit,
|
5545
5575
|
canEdit = _props$canEdit === void 0 ? false : _props$canEdit,
|
5546
5576
|
searchBy = props.searchBy,
|
5577
|
+
addValidator = props.addValidator,
|
5547
5578
|
_props$autosave = props.autosave,
|
5548
5579
|
autosave = _props$autosave === void 0 ? false : _props$autosave,
|
5549
5580
|
_props$delay = props.delay,
|
@@ -5592,7 +5623,8 @@ var CollectionPage = function CollectionPage(props) {
|
|
5592
5623
|
site.openDialog( /*#__PURE__*/React__default["default"].createElement(CreateContentDialog, {
|
5593
5624
|
label: "" + name,
|
5594
5625
|
type: schema,
|
5595
|
-
onOK: onOK
|
5626
|
+
onOK: onOK,
|
5627
|
+
validator: addValidator
|
5596
5628
|
}));
|
5597
5629
|
}
|
5598
5630
|
|