ywana-core8 0.0.871 → 0.0.872
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 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +4 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +4 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +5 -9
package/package.json
CHANGED
@@ -381,19 +381,15 @@ export const MultiSelectionEditor = ({ field, value = [], content, onChange }) =
|
|
381
381
|
if (onChange) onChange(id, value)
|
382
382
|
}
|
383
383
|
|
384
|
+
function changeAll(v) {
|
385
|
+
if (onChange) onChange(id, [v])
|
386
|
+
}
|
387
|
+
|
384
388
|
function buildOptions() {
|
385
389
|
const opts = typeof options === 'function' ? options(field, content) : options
|
386
390
|
return opts
|
387
391
|
}
|
388
392
|
|
389
|
-
function renderFormat(format, options) {
|
390
|
-
switch (format) {
|
391
|
-
case FORMATS.CHECKBOX: return <CheckBoxGroup options={options} value={value} onChange={change} />
|
392
|
-
case FORMATS.RADIO: return <RadioGroup options={options} value={value} onChange={change} />
|
393
|
-
default: return <CheckBoxGroup options={options} value={value} onChange={change} />
|
394
|
-
}
|
395
|
-
}
|
396
|
-
|
397
393
|
return (
|
398
394
|
<div className="multiselection-editor">
|
399
395
|
<label>{label}</label>
|
@@ -401,7 +397,7 @@ export const MultiSelectionEditor = ({ field, value = [], content, onChange }) =
|
|
401
397
|
const checked = value.includes(option.value)
|
402
398
|
switch (format) {
|
403
399
|
case FORMATS.CHECKBOX: return <CheckBox value={checked} label={option.label} onChange={() => change(option.value)} />
|
404
|
-
case FORMATS.RADIO: return <RadioButton value={checked} label={option.label} onChange={() =>
|
400
|
+
case FORMATS.RADIO: return <RadioButton value={checked} label={option.label} onChange={() => changeAll(option.value)} />
|
405
401
|
default: return <CheckBox value={checked} label={option.label} onChange={() => change(option.value)} />
|
406
402
|
}
|
407
403
|
})}
|