ywana-core8 0.0.477 → 0.0.480
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 +30 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +30 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +30 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +30 -3
- package/src/html/table.css +3 -1
- package/src/html/table.js +2 -2
- package/src/html/table.test.js +9 -1
package/package.json
CHANGED
@@ -15,7 +15,18 @@ import "./CollectionPage.css"
|
|
15
15
|
export const CollectionPage = (props) => {
|
16
16
|
|
17
17
|
const site = useContext(SiteContext)
|
18
|
-
const {
|
18
|
+
const {
|
19
|
+
id = "collection",
|
20
|
+
icon, title, name = "Collection 1",
|
21
|
+
schema, url, field, host, page, fetching= false,
|
22
|
+
actions = [], onSelect,
|
23
|
+
canFilter = false, canAdd = false, canDelete = false, canEdit = false,
|
24
|
+
autosave = false, delay = 1000,
|
25
|
+
groupBy, levels,
|
26
|
+
editor,
|
27
|
+
children
|
28
|
+
} = props
|
29
|
+
|
19
30
|
const [pageContext, setPageContext] = useContext(PageContext)
|
20
31
|
const context = CollectionContext(url, field, host, page, fetching)
|
21
32
|
|
@@ -48,13 +59,15 @@ export const CollectionPage = (props) => {
|
|
48
59
|
return (
|
49
60
|
<Fragment>
|
50
61
|
<Header className="collection-page" title={<Text>{title}</Text>}>
|
51
|
-
<Button icon="add" label="Add" action={add} />
|
62
|
+
{ canAdd ? <Button icon="add" label="Add" action={add} /> : false }
|
63
|
+
|
52
64
|
<Button icon="refresh" label="Reload" action={reload} />
|
53
65
|
{renderActions()}
|
54
66
|
</Header>
|
55
67
|
<menu className="collection-page">
|
56
68
|
<Header title={<Text>Lista de {name}</Text>} >
|
57
69
|
</Header>
|
70
|
+
{canFilter ? <CollectionFilters schema={schema}/> : null }
|
58
71
|
{levels ? <CollectionTree levels={levels} onSelect={onSelect}/> : <CollectionList groupBy={groupBy} onSelect={onSelect}/>}
|
59
72
|
</menu>
|
60
73
|
<main key={id} className="collection-page">
|
@@ -65,6 +78,20 @@ export const CollectionPage = (props) => {
|
|
65
78
|
)
|
66
79
|
}
|
67
80
|
|
81
|
+
/**
|
82
|
+
* Collection Filters
|
83
|
+
*/
|
84
|
+
const CollectionFilters = (props) => {
|
85
|
+
|
86
|
+
const { schema } = props
|
87
|
+
|
88
|
+
return (
|
89
|
+
<div className="collection-filters">
|
90
|
+
TODO: filters
|
91
|
+
</div>
|
92
|
+
)
|
93
|
+
}
|
94
|
+
|
68
95
|
/**
|
69
96
|
* Collection List
|
70
97
|
*/
|
@@ -88,7 +115,7 @@ const CollectionList = (props) => {
|
|
88
115
|
|
89
116
|
const items = all ? all.map(content => ({
|
90
117
|
id: content.id,
|
91
|
-
line1: content.name,
|
118
|
+
line1: content.name || content.centre || content.tag, // centre: Signflow legacy
|
92
119
|
line2: content.description,
|
93
120
|
content
|
94
121
|
})) : []
|
package/src/html/table.css
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
overflow: hidden;
|
3
3
|
border: solid 0px var(--divider-color);
|
4
4
|
background-color: var(--paper-color);
|
5
|
+
overflow: auto;
|
5
6
|
}
|
6
7
|
|
7
8
|
.datatable8.outlined {
|
@@ -15,9 +16,10 @@
|
|
15
16
|
.datatable8 thead {
|
16
17
|
position: sticky;
|
17
18
|
top: 0px;
|
18
|
-
background-color: rgba(
|
19
|
+
background-color: rgba(240,240,240);
|
19
20
|
overflow: hidden;
|
20
21
|
color: var(--text-color-lighter);
|
22
|
+
z-index: 2000;
|
21
23
|
}
|
22
24
|
|
23
25
|
.datatable8 thead tr {
|
package/src/html/table.js
CHANGED
@@ -14,7 +14,7 @@ const isFunction = value => value && (Object.prototype.toString.call(value) ===
|
|
14
14
|
*/
|
15
15
|
export const DataTable = (props) => {
|
16
16
|
|
17
|
-
const { columns = [], rows = [], onRowSelection, onSort, onCheckAll, editable, outlined, expanded = false } = props
|
17
|
+
const { columns = [], rows = [], onRowSelection, onSort, onCheckAll, editable, outlined, expanded = false, className} = props
|
18
18
|
const [sortDir, setSortDir] = useState({})
|
19
19
|
const [allChecked, setAllChecked] = useState(false)
|
20
20
|
|
@@ -73,7 +73,7 @@ export const DataTable = (props) => {
|
|
73
73
|
|
74
74
|
const style = outlined ? "outlined" : ""
|
75
75
|
return (
|
76
|
-
<div className={`datatable8 ${style}`}>
|
76
|
+
<div className={`datatable8 ${className} ${style}`}>
|
77
77
|
<table>
|
78
78
|
<thead>
|
79
79
|
<tr>
|
package/src/html/table.test.js
CHANGED
@@ -7,7 +7,14 @@ const TableTest = (prop) => {
|
|
7
7
|
const [rows, setRows] = useState(
|
8
8
|
[
|
9
9
|
{ id: 1, checked: false, name: "John Smith", thumb: "https://w7.pngwing.com/pngs/881/826/png-transparent-pikachu-ash-ketchum-pokemon-vrste-pikachu-leaf-flower-meme-thumbnail.png"},
|
10
|
-
{ id: 2, checked: false, name: "Ann Martin", color: "#CCFFFF" }
|
10
|
+
{ id: 2, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
11
|
+
{ id: 3, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
12
|
+
{ id: 4, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
13
|
+
{ id: 5, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
14
|
+
{ id: 6, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
15
|
+
{ id: 7, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
16
|
+
{ id: 8, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
17
|
+
{ id: 9, checked: false, name: "Ann Martin", color: "#CCFFFF" },
|
11
18
|
]
|
12
19
|
)
|
13
20
|
|
@@ -29,6 +36,7 @@ const TableTest = (prop) => {
|
|
29
36
|
}
|
30
37
|
|
31
38
|
const table = {
|
39
|
+
className: "xxx",
|
32
40
|
editable: true,
|
33
41
|
columns : [
|
34
42
|
{ id: "checked", onChange: check },
|