ywana-core8 0.0.867 → 0.0.869

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.867",
3
+ "version": "0.0.869",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -369,7 +369,7 @@ export const ListEditor = ({ field, value = [], onChange }) => {
369
369
  */
370
370
  export const MultiSelectionEditor = ({ field, value = [], content, onChange }) => {
371
371
 
372
- const { id, label, options } = field
372
+ const { id, label, options, format = FORMATS.CHECKBOX } = field
373
373
 
374
374
  function change(v) {
375
375
  const index = value.indexOf(v)
@@ -386,12 +386,24 @@ export const MultiSelectionEditor = ({ field, value = [], content, onChange }) =
386
386
  return opts
387
387
  }
388
388
 
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
+
389
397
  return (
390
398
  <div className="multiselection-editor">
391
399
  <label>{label}</label>
392
400
  {buildOptions().map(option => {
393
401
  const checked = value.includes(option.value)
394
- return <CheckBox value={checked} label={option.label} onChange={() => change(option.value)} />
402
+ switch (format) {
403
+ 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)} />
405
+ default: return <CheckBox value={checked} label={option.label} onChange={() => change(option.value)} />
406
+ }
395
407
  })}
396
408
  </div>
397
409
  )
@@ -26,6 +26,8 @@ export const FORMATS = {
26
26
  COLOR: 'COLOR',
27
27
  TOKENS: 'TOKENS',
28
28
  PASSWORD: 'PASSWORD',
29
+ RADIO: 'RADIO',
30
+ CHECKBOX: 'CHECKBOX',
29
31
  }
30
32
 
31
33
 
@@ -111,6 +111,14 @@ const StringViewer = (props) => {
111
111
  <img src={value} />
112
112
  </div>
113
113
  )
114
+
115
+ case FORMATS.TOKENS:
116
+ return (
117
+ <div className='tokens-field'>
118
+ <TokenField id={id} label={label} tokens={value} readOnly={true} />
119
+ </div>
120
+ )
121
+
114
122
  default:
115
123
  return <Property label={label} value={value} options={options} />
116
124
  }
package/src/html/table.js CHANGED
@@ -151,7 +151,7 @@ const DataTableFiltersRow = ({ columns }) => {
151
151
  {columns.map(({ id, filterable, onFilter }) => {
152
152
  return (
153
153
  <td className='filter-cell'>
154
- {filterable ? <TextField id={id} onChange={onFilter} /> : null}
154
+ {filterable ? <TextField id={id} onChange={onFilter} outlined /> : null}
155
155
  </td>
156
156
  )
157
157
  })}
@@ -184,10 +184,10 @@ export const TaskMonitor = (props) => {
184
184
 
185
185
  const table = {
186
186
  columns: [
187
- { id: "state", label: "Estado" },
188
- { id: "init", label: "Inicio", type: TYPES.STRING, format: FORMATS.DATE },
189
- { id: "end", label: "Fin", type: TYPES.STRING, format: FORMATS.DATE },
190
- { id: "description", label: "Descripcion" },
187
+ { id: "state", label: "State" },
188
+ { id: "init", label: "Init Date", type: TYPES.STRING, format: FORMATS.DATE },
189
+ { id: "end", label: "End Date", type: TYPES.STRING, format: FORMATS.DATE },
190
+ { id: "description", label: "Description" },
191
191
  { id: "progress", label: "%" },
192
192
  { id: "percentage", label: "" },
193
193
  // { id: "resourceID", label: "Recurso" },