ywana-core8 0.0.408 → 0.0.409
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +1 -1
- package/src/domain/ContentEditor.test.js +9 -5
package/package.json
CHANGED
@@ -249,7 +249,7 @@ export const StringEditor = ({ field, value = '', onChange, content, outlined })
|
|
249
249
|
case FORMATS.COLOR: return <ColorField id={id} onChange={change} value={value}/>
|
250
250
|
case FORMATS.HTML: return <Editor id={id} value={value} onChange={change} content={content} />
|
251
251
|
case FORMATS.DATE: return <TextField outlined={outlined} id={id} type="date" label={label} value={value} onChange={change} readOnly={!editable} />
|
252
|
-
case FORMATS.TOKENS: return <TokenField id={id} label={label} onChange={change} readOnly={!editable} options={
|
252
|
+
case FORMATS.TOKENS: return <TokenField id={id} label={label} onChange={change} readOnly={!editable} options={buildOptions()} />
|
253
253
|
default:
|
254
254
|
return options ? (
|
255
255
|
<DropDown outlined={outlined} id={id} label={label} value={value} onChange={change} options={buildOptions()} readOnly={!editable} predictive={predictive} />
|
@@ -3,15 +3,19 @@ import { ContentEditor } from './ContentEditor'
|
|
3
3
|
import { Content, FORMATS, TYPES } from './ContentType'
|
4
4
|
import './ContentEditor.test.css'
|
5
5
|
|
6
|
+
function buildTokenOptions() {
|
7
|
+
return [
|
8
|
+
{label: "One", value: 1 },
|
9
|
+
{label: "Two", value: 2 },
|
10
|
+
{label: "Thressse", value: 3 },
|
11
|
+
]
|
12
|
+
}
|
13
|
+
|
6
14
|
const schema = {
|
7
15
|
name : { id: "name" , type: TYPES.STRING, format: FORMATS.NONE, required: true, label: "Name" },
|
8
16
|
field1: { id: "field1", type: TYPES.STRING, format: FORMATS.NONE, required: true, label: "field1", multivalue: true },
|
9
17
|
field2: { id: "field2", type: TYPES.STRING, format: FORMATS.NONE, required: true, label: "field2" },
|
10
|
-
field3: { id: "field3", type: TYPES.STRING, format: FORMATS.TOKENS, required: true, label: "field3", options:
|
11
|
-
{label: "One", value: 1 },
|
12
|
-
{label: "Two", value: 2 },
|
13
|
-
{label: "Three", value: 3 },
|
14
|
-
] },
|
18
|
+
field3: { id: "field3", type: TYPES.STRING, format: FORMATS.TOKENS, required: true, label: "field3", options: buildTokenOptions },
|
15
19
|
field4: { id: "field4", type: TYPES.STRING, format: FORMATS.COLOR, required: true, label: "Color" },
|
16
20
|
}
|
17
21
|
|