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