ywana-core8 0.0.159 → 0.0.160
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 +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +4 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +4 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +4 -3
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { Fragment, useState } from 'react';
|
2
2
|
import { Button, CheckBox, DataTable, DropDown, Icon, Stack, Tab, Tabs, Text, TextField, Tree, TreeNode, TreeItem, TokenField, Property } from '../html';
|
3
|
-
import { Content, TYPES } from './ContentType';
|
3
|
+
import { CHECK, Content, TYPES } from './ContentType';
|
4
4
|
import './ContentEditor.css';
|
5
5
|
import { FORMATS } from './ContentType';
|
6
6
|
|
@@ -168,7 +168,7 @@ export const TreededContentEditor = ({ content, filter, onChange }) => {
|
|
168
168
|
* FieldEditor
|
169
169
|
*/
|
170
170
|
export const FieldEditor = ({ field, onChange, content, outlined = false }) => {
|
171
|
-
const { id, type, item, label, editable, options, hidden } = field
|
171
|
+
const { id, type, item, label, editable, options, hidden = false } = field
|
172
172
|
|
173
173
|
function change(id, value) {
|
174
174
|
if (onChange) onChange(id, value)
|
@@ -176,7 +176,8 @@ export const FieldEditor = ({ field, onChange, content, outlined = false }) => {
|
|
176
176
|
|
177
177
|
function renderField() {
|
178
178
|
const value1 = field.value ? field.value : field.default
|
179
|
-
|
179
|
+
const isHidden = CHECK['isFunction'](hidden) ? hidden(field, value1) : hidden
|
180
|
+
if (isHidden) {
|
180
181
|
return null
|
181
182
|
} else {
|
182
183
|
switch (type) {
|