ywana-core8 0.0.540 → 0.0.543

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.540",
3
+ "version": "0.0.543",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -318,7 +318,6 @@ const CollectionEditor = (props) => {
318
318
  }
319
319
 
320
320
  async function save() {
321
- console.log('saving.....')
322
321
  await pageContext.update(form)
323
322
  setPageContext(Object.assign({}, pageContext))
324
323
  }
@@ -398,7 +397,7 @@ export const CollectionContext = (url, field, host, page, fetching) => {
398
397
  await API.create(form);
399
398
  await this.load();
400
399
  } catch (error) {
401
- console.log("CREATE ERROR", error)
400
+ console.log(error)
402
401
  }
403
402
  return
404
403
  },
@@ -30,7 +30,6 @@ const ContentEditorTest = (prop) => {
30
30
  const [form, setForm] = useState(value)
31
31
 
32
32
  function change(form) {
33
- console.log(form)
34
33
  setForm(form)
35
34
  }
36
35
 
@@ -141,10 +141,7 @@ export class ContentType {
141
141
  break
142
142
 
143
143
  case TYPES.ENTITY:
144
-
145
- if (optional === true) console.log('OPTIONAL', field, !entryData);
146
144
  if (optional === true && !entryData) break;
147
-
148
145
  const child1 = new ContentType(item)
149
146
  next[name] = child1.value(entryData)
150
147
  break;
@@ -18,7 +18,7 @@ export const TablePage = (props) => {
18
18
  const site = useContext(SiteContext)
19
19
  const { id = "table",
20
20
  icon, title, name,
21
- schema, url, field, host,
21
+ schema, url, field, host, params,
22
22
  autosave = true, delay = 1000,
23
23
  editable,
24
24
  actions = [], dev = false, tableActions, selectionActions = [],
@@ -31,7 +31,7 @@ export const TablePage = (props) => {
31
31
  } = props
32
32
 
33
33
  const [pageContext, setPageContext] = useContext(PageContext)
34
- const context = TableContext(url, field, host, urlQuery)
34
+ const context = TableContext(url, field, host, urlQuery, params)
35
35
  const { selected } = pageContext
36
36
  const timer = useRef(null)
37
37
  const [form, setForm] = useState(selected)
@@ -481,7 +481,7 @@ export const TableEditor = (props) => {
481
481
  return (
482
482
  <Fragment>
483
483
  <Header icon={icon} title={<Text>{title}</Text>}>
484
- <DropDown id="groupBy" label="Agrupar Por" value={groupBy} options={buildGroupOptions(schema)} onChange={changeGroup} />
484
+ { groupBy ? <DropDown id="groupBy" label="Agrupar Por" value={groupBy} options={buildGroupOptions(schema)} onChange={changeGroup} /> : null }
485
485
  </Header>
486
486
  <main className="table-editor">
487
487
  {renderGroups()}
@@ -493,9 +493,9 @@ export const TableEditor = (props) => {
493
493
  /**
494
494
  * Table Context
495
495
  */
496
- const TableContext = (url, field, host, urlQuery) => {
496
+ const TableContext = (url, field, host, urlQuery, params) => {
497
497
 
498
- const API = TableAPI(url, host)
498
+ const API = TableAPI(url, host, params)
499
499
 
500
500
  return {
501
501
 
@@ -615,13 +615,13 @@ const TableContext = (url, field, host, urlQuery) => {
615
615
  /**
616
616
  * table API
617
617
  */
618
- const TableAPI = (url, host) => {
618
+ const TableAPI = (url, host, params) => {
619
619
 
620
620
  const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
621
621
 
622
622
  return {
623
623
  all(filters) {
624
- let queryParams = "?"
624
+ let queryParams = "?" + params
625
625
  if (filters) {
626
626
  const filterQuery = Object.keys(filters).reduce((query, key) => {
627
627
  const value = filters[key]
@@ -639,7 +639,7 @@ const TableAPI = (url, host) => {
639
639
  }, "")
640
640
  queryParams = queryParams.concat(filterQuery)
641
641
  }
642
- return http.GET(url + queryParams)
642
+ return http.GET(url + queryParams )
643
643
  },
644
644
 
645
645
  find(id) {
@@ -19,15 +19,15 @@ export const TableTest = (prop) => {
19
19
  )
20
20
 
21
21
  function editCell(row, cell, value) {
22
- console.log(row, cell, value)
22
+ //console.log(row, cell, value)
23
23
  }
24
24
 
25
25
  function select(row) {
26
- console.log('select',row)
26
+ //console.log('select',row)
27
27
  }
28
28
 
29
29
  function check(id,checked, c) {
30
- console.log('check', id, checked, c)
30
+ //console.log('check', id, checked, c)
31
31
  }
32
32
 
33
33
  function checkAll(ids, checked) {
@@ -26,7 +26,6 @@ const TextFieldTest = (prop) => {
26
26
  { label: "NO", value: "false" },
27
27
  ]
28
28
 
29
- console.log(form)
30
29
  return (
31
30
  <>
32
31
  <DropDown id="b1" label="Boolean1" onChange={change} options={options2} value={form.b1} />
@@ -55,7 +55,6 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
55
55
  if (options) {
56
56
  const lbl = options.find(opt => opt.value == text)
57
57
  if (lbl) text2 = lbl.label
58
- console.log(text, lbl, text2, options)
59
58
  }
60
59
  return <Token text={text2} onDelete={() => remove(index)} />
61
60
  })}
package/src/site/view.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { Icon, MenuIcon } from '../html'
2
+ import { Icon, MenuIcon, Tabs, Tab, Stack } from '../html'
3
3
  import './view.css'
4
4
 
5
5
  /**
@@ -32,4 +32,25 @@ export const View = (props) => {
32
32
  {info ? <footer>{info}</footer> : null}
33
33
  </section>
34
34
  )
35
+ }
36
+
37
+ export const TabbedView = (props) => {
38
+
39
+ const { title, className } = props
40
+ const [tab, setTab] = useState(0)
41
+ const children = React.Children.toArray(props.children);
42
+ const tabs = children.map(child => <Tab key={child.props.label} label={child.props.label}></Tab>)
43
+
44
+ const toolbar = (
45
+ <Tabs selected={tab} onChange={tab => setTab(tab)}>
46
+ {tabs}
47
+ </Tabs>
48
+ )
49
+ return (
50
+ <View title={title} toolbar={toolbar} className={className}>
51
+ <Stack selected={tab}>
52
+ {children}
53
+ </Stack>
54
+ </View>
55
+ )
35
56
  }
@@ -49,9 +49,8 @@ const PlannerTest = (prop) => {
49
49
  lanes={lanes}
50
50
  events={events}
51
51
  navigation={true}
52
- onSelectCell={console.log}
53
-
54
- onChange={(data) => console.log('D&D', data)}
52
+ //onSelectCell={console.log}
53
+ //onChange={(data) => console.log('D&D', data)}
55
54
  >
56
55
 
57
56
  </Planner>