ywana-core8 0.0.478 → 0.0.481
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/db/db.json +14 -0
- package/dist/index.cjs +11 -6
- 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 +11 -6
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +11 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +1 -1
- package/src/domain/TablePage.js +4 -3
- package/src/html/table.css +3 -1
- package/src/html/table.js +2 -2
- package/src/html/table.test.js +9 -1
- package/src/site/site.test.js +7 -6
package/package.json
CHANGED
@@ -115,7 +115,7 @@ const CollectionList = (props) => {
|
|
115
115
|
|
116
116
|
const items = all ? all.map(content => ({
|
117
117
|
id: content.id,
|
118
|
-
line1: content.name || content.centre, // centre: Signflow legacy
|
118
|
+
line1: content.name || content.centre || content.tag, // centre: Signflow legacy
|
119
119
|
line2: content.description,
|
120
120
|
content
|
121
121
|
})) : []
|
package/src/domain/TablePage.js
CHANGED
@@ -26,6 +26,7 @@ export const TablePage = (props) => {
|
|
26
26
|
canQuery = false, urlQuery, user,
|
27
27
|
groupBy, validator, scenario,
|
28
28
|
formFilter, tableFilter, editorFilter = false,
|
29
|
+
tableClassName,
|
29
30
|
children
|
30
31
|
} = props
|
31
32
|
|
@@ -152,7 +153,7 @@ export const TablePage = (props) => {
|
|
152
153
|
</menu>
|
153
154
|
) : null}
|
154
155
|
<main key={id} className="table-page">
|
155
|
-
<TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} />
|
156
|
+
<TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} className={tableClassName}/>
|
156
157
|
{children ? <article>{children}</article> : null}
|
157
158
|
</main>
|
158
159
|
{renderAside()}
|
@@ -346,7 +347,7 @@ export const TableEditor = (props) => {
|
|
346
347
|
const site = useContext(SiteContext)
|
347
348
|
const [pageContext, setPageContext] = useContext(PageContext)
|
348
349
|
const { all = [], filters } = pageContext
|
349
|
-
const { icon, title, schema, editable, canDelete, filter, actions } = props
|
350
|
+
const { icon, title, schema, editable, canDelete, filter, actions, className } = props
|
350
351
|
const [groupBy, setGroupBy] = useState(props.groupBy)
|
351
352
|
|
352
353
|
function changeGroup(id, value) {
|
@@ -457,7 +458,7 @@ export const TableEditor = (props) => {
|
|
457
458
|
<Header title={title} >
|
458
459
|
<span className="size">{groupSize}</span>
|
459
460
|
</Header>
|
460
|
-
<DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check} />
|
461
|
+
<DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check} className={className} />
|
461
462
|
</Fragment>
|
462
463
|
)
|
463
464
|
})
|
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 },
|
package/src/site/site.test.js
CHANGED
@@ -9,6 +9,7 @@ import { Button, DropDown, TextField, TextArea } from '../html'
|
|
9
9
|
import { UploadDialog } from '../widgets/upload/UploadDialog'
|
10
10
|
import { Uploader } from '../widgets/upload/Uploader'
|
11
11
|
import { TabbedTablePage } from '../domain/TabbedTablePage'
|
12
|
+
import { TablePage } from '../domain/TablePage'
|
12
13
|
import { FORMATS, TYPES } from '../domain/ContentType'
|
13
14
|
|
14
15
|
const SiteTest = (prop) => {
|
@@ -115,19 +116,19 @@ const Page2 = (props) => {
|
|
115
116
|
const Page3 = (props) => {
|
116
117
|
|
117
118
|
const schema = {
|
118
|
-
name : { id: "name" , type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: false, column: true , filter: true , like: true, label: "Name" },
|
119
|
-
state : { id: "state" , type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: true , column: true , filter: false , label: "State" , options: [
|
119
|
+
name : { id: "name" , type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter: true , like: true, label: "Name" },
|
120
|
+
state : { id: "state" , type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: true , grouper: true , column: true , filter: false , label: "State" , options: [
|
120
121
|
{ label: "Pendiente", value: "NOT_CLASSIFIED" },
|
121
122
|
{ label: "Clasificada", value: "CLASSIFIED"},
|
122
123
|
]},
|
123
|
-
field1: { id: "field1", type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: false, column: true , filter: true , label: "field1" },
|
124
|
-
field2: { id: "field2", type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: false, column: true , filter: true , label: "field2" },
|
125
|
-
field4: { id: "field4", type: TYPES.STRING, format: FORMATS.COLOR, required: true, tab: false, column: true , filter: true , label: "Color" },
|
124
|
+
field1: { id: "field1", type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter: true , label: "field1" },
|
125
|
+
field2: { id: "field2", type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter: true , label: "field2" },
|
126
|
+
field4: { id: "field4", type: TYPES.STRING, format: FORMATS.COLOR, required: true, tab: false, grouper: true , column: true , filter: true , label: "Color" },
|
126
127
|
}
|
127
128
|
|
128
129
|
return (
|
129
130
|
<Fragment>
|
130
|
-
<
|
131
|
+
<TablePage title="Referencias" schema={schema} host="http://localhost:3000" url="/references" canFilter={true} tableClassName="condensed"/>
|
131
132
|
</Fragment>
|
132
133
|
)
|
133
134
|
}
|