ywana-core8 0.0.449 → 0.0.452
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 +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +6 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +6 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentType.js +2 -2
- package/src/domain/ContentViewer.js +5 -2
package/package.json
CHANGED
@@ -140,8 +140,8 @@ export class ContentType {
|
|
140
140
|
|
141
141
|
case TYPES.ENTITY:
|
142
142
|
|
143
|
-
if (optional === true) console.log('OPTIONAL', field, entryData);
|
144
|
-
if (optional === true && entryData
|
143
|
+
if (optional === true) console.log('OPTIONAL', field, !entryData);
|
144
|
+
if (optional === true && !entryData) break;
|
145
145
|
|
146
146
|
const child1 = new ContentType(item)
|
147
147
|
next[name] = child1.value(entryData)
|
@@ -45,10 +45,13 @@ export const ContentViewer = (props) => {
|
|
45
45
|
const FieldViewer = (props) => {
|
46
46
|
|
47
47
|
const { field, value } = props
|
48
|
-
const { id, type, item, label, visible = true } = field
|
48
|
+
const { id, type, item, label, visible = true, optional } = field
|
49
49
|
|
50
50
|
if (!visible) return null
|
51
|
-
|
51
|
+
|
52
|
+
console.log("FieldViewer Optional",field, value, optional && value === null)
|
53
|
+
if (optional && value === null) return null;
|
54
|
+
|
52
55
|
switch (type) {
|
53
56
|
case TYPES.STRING:
|
54
57
|
return <Property label={label} value={value} />
|