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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.871",
3
+ "version": "0.0.872",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -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={() => change(option.value)} />
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
  })}