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/dist/index.cjs +39 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +39 -12
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +39 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +1 -2
- package/src/domain/ContentEditor.test.js +0 -1
- package/src/domain/ContentType.js +0 -3
- package/src/domain/TablePage.js +8 -8
- package/src/html/table.test.js +3 -3
- package/src/html/textfield.test.js +0 -1
- package/src/html/tokenfield.js +0 -1
- package/src/site/view.js +22 -1
- package/src/widgets/planner/Planner.test.js +2 -3
package/package.json
CHANGED
@@ -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(
|
400
|
+
console.log(error)
|
402
401
|
}
|
403
402
|
return
|
404
403
|
},
|
@@ -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;
|
package/src/domain/TablePage.js
CHANGED
@@ -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) {
|
package/src/html/table.test.js
CHANGED
@@ -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) {
|
package/src/html/tokenfield.js
CHANGED
@@ -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>
|