ywana-core8 0.0.806 → 0.0.807

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.806",
3
+ "version": "0.0.807",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -116,7 +116,7 @@ export const TabbedContentEditor = ({ content, filter, grouped = false, onChange
116
116
  fields
117
117
  .filter(field => field.id !== 'id')
118
118
  .filter(field => filter ? filter(field) : true)
119
- .map((field) => <FieldEditor key={field.id} field={field} onChange={change} content={content} onReload={onReload}/>)
119
+ .map((field) => <FieldEditor key={field.id} field={field} onChange={change} content={content} onReload={onReload} />)
120
120
  }
121
121
  </section>
122
122
  )
@@ -168,7 +168,7 @@ export const TreededContentEditor = ({ content, filter, onChange }) => {
168
168
  </Tree>
169
169
  </menu>
170
170
  <div>
171
- {selected ? <TabbedContentEditor content={selected.item} onChange={change} onReload={reload}/> : "select"}
171
+ {selected ? <TabbedContentEditor content={selected.item} onChange={change} onReload={reload} /> : "select"}
172
172
  </div>
173
173
  </div>
174
174
  )
@@ -206,7 +206,7 @@ export const FieldEditor = ({ field, onChange, content, outlined = false, onRelo
206
206
  case TYPES.ARRAY:
207
207
  return item === TYPES.STRING ?
208
208
  options ? <MultiSelectionEditor content={content} field={field} value={value1} onChange={change} /> : <ListEditor field={field} value={value1} onChange={change} />
209
- : <CollectionEditor field={field} value={value1} onChange={change} onReload={reload}/>
209
+ : <CollectionEditor field={field} value={value1} onChange={change} onReload={reload} />
210
210
  default:
211
211
  return <div>{label}</div>
212
212
  }
@@ -219,7 +219,7 @@ export const FieldEditor = ({ field, onChange, content, outlined = false, onRelo
219
219
  * Entity Editor
220
220
  */
221
221
  const EntityEditor = ({ field, value = {}, onChange }) => {
222
- const { id, item, label, outlined=false } = field
222
+ const { id, item, label, outlined = false } = field
223
223
  const content = new Content(item, value)
224
224
 
225
225
  function change(fid, value) {
@@ -271,7 +271,7 @@ const EntityEditor = ({ field, value = {}, onChange }) => {
271
271
  * String Editor
272
272
  */
273
273
  export const StringEditor = ({ field, value = '', onChange, content, outlined }) => {
274
- const { id, format, options, required=false, editable = true, predictive = false, multivalue = false, freeValue = false, Editor } = field
274
+ const { id, format, options, required = false, editable = true, predictive = false, multivalue = false, freeValue = false, Editor } = field
275
275
 
276
276
  function change(id, value) {
277
277
  if (onChange) onChange(id, value)
@@ -324,7 +324,7 @@ export const StringEditor = ({ field, value = '', onChange, content, outlined })
324
324
  * Number Editor
325
325
  */
326
326
  const NumberEditor = ({ field, value, onChange, outlined = false }) => {
327
- const { id, label, editable = true } = field
327
+ const { id, label, editable = true, options } = field
328
328
 
329
329
  function change(id, value) {
330
330
  if (onChange) onChange(id, value)
@@ -337,7 +337,11 @@ const NumberEditor = ({ field, value, onChange, outlined = false }) => {
337
337
 
338
338
  return (
339
339
  <div className='field-editor number-editor'>
340
- <TextField outlined={outlined} id={id} label={label} type='NUMBER' value={val} max={max} min={min} onChange={change} disabled={disabled} />
340
+ {options ? (
341
+ <DropDown outlined={outlined} id={id} label={label} value={val} onChange={change} options={options} disabled={disabled} />
342
+ ) : (
343
+ <TextField outlined={outlined} id={id} label={label} type='NUMBER' value={val} max={max} min={min} onChange={change} disabled={disabled} />
344
+ )}
341
345
  </div>
342
346
  )
343
347
  }
@@ -399,7 +403,7 @@ export const MultiSelectionEditor = ({ field, value = [], content, onChange }) =
399
403
  */
400
404
  export const CollectionEditor = ({ field, value = [], onChange, onReload }) => {
401
405
 
402
- const { id, item, label, groupBy="field1", Feeder, Renderer, Adder = true, editable = true } = field
406
+ const { id, item, label, groupBy = "field1", Feeder, Renderer, Adder = true, editable = true } = field
403
407
 
404
408
  function add(rows) {
405
409
  if (onChange) {
@@ -425,7 +429,7 @@ export const CollectionEditor = ({ field, value = [], onChange, onReload }) => {
425
429
  Renderer ?
426
430
  <Renderer field={field} value={value} onRemove={remove} onChange={onChange} onReload={reload} />
427
431
  // : <DataTable {...table} editable={editable} />
428
- : <TableEditor icon={"info"} title={label} data={value} schema={item} groupBy={groupBy} canDelete={true} remove={remove}/>
432
+ : <TableEditor icon={"info"} title={label} data={value} schema={item} groupBy={groupBy} canDelete={true} remove={remove} />
429
433
 
430
434
  }
431
435
  <footer>
@@ -516,7 +520,7 @@ const TableEditor = (props) => {
516
520
 
517
521
  const groups = items.reduce((groups, item) => {
518
522
  let groupName = item[groupBy]
519
- if (!groupName) groupName=`NO ${groupBy}`.toUpperCase()
523
+ if (!groupName) groupName = `NO ${groupBy}`.toUpperCase()
520
524
  if (groupName === false) groupName = `NO ${groupBy}`.toUpperCase()
521
525
  if (groupName === true) groupName = `SI ${groupBy}`.toUpperCase()
522
526
  const group = groups[groupName]