ywana-core8 0.0.217 → 0.0.221
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 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +25 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +30 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +30 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +19 -1
- package/src/domain/TablePage.css +26 -0
- package/src/domain/TablePage.js +2 -1
- package/src/html/table.js +2 -2
package/package.json
CHANGED
@@ -315,7 +315,25 @@ export const CollectionContext = (url, field) => {
|
|
315
315
|
const CollectionAPI = (url) => {
|
316
316
|
|
317
317
|
return {
|
318
|
-
all() {
|
318
|
+
all(filters) {
|
319
|
+
let queryParams = "?"
|
320
|
+
if (filters) {
|
321
|
+
const filterQuery = Object.keys(filters).reduce((query, key) => {
|
322
|
+
const value = filters[key]
|
323
|
+
if (typeof (value) === 'boolean') {
|
324
|
+
return query.concat(`${key}=${value}&`)
|
325
|
+
} else if (Array.isArray(value)) {
|
326
|
+
const param = value.length === 0 ? '' : value.reduce((param, item) => {
|
327
|
+
param = param.concat(`${key}=${item}&`)
|
328
|
+
return param
|
329
|
+
}, "")
|
330
|
+
return query.concat(param)
|
331
|
+
} else {
|
332
|
+
return query.concat(`${key}=%${filters[key]}%&`)
|
333
|
+
}
|
334
|
+
}, "")
|
335
|
+
queryParams = queryParams.concat(filterQuery)
|
336
|
+
}
|
319
337
|
return http.GET(url)
|
320
338
|
},
|
321
339
|
|
package/src/domain/TablePage.css
CHANGED
@@ -25,3 +25,29 @@ main.table-editor {
|
|
25
25
|
overflow: auto;
|
26
26
|
}
|
27
27
|
|
28
|
+
.table-selector {
|
29
|
+
display: flex;
|
30
|
+
flex-direction: column;
|
31
|
+
}
|
32
|
+
|
33
|
+
.table-selector>header {
|
34
|
+
border-bottom: solid 1px var(--divider-color);
|
35
|
+
background-color: rgba(220,220,220,.5);
|
36
|
+
}
|
37
|
+
|
38
|
+
.table-selector>main {
|
39
|
+
flex: 1;
|
40
|
+
}
|
41
|
+
|
42
|
+
.table-selector>main>.datatable8 {
|
43
|
+
margin: 0;
|
44
|
+
}
|
45
|
+
|
46
|
+
.table-selector>footer {
|
47
|
+
padding: .5rem;
|
48
|
+
display: flex;
|
49
|
+
}
|
50
|
+
|
51
|
+
.table-selector>footer>* {
|
52
|
+
flex: 1;
|
53
|
+
}
|
package/src/domain/TablePage.js
CHANGED
@@ -165,7 +165,8 @@ const TableSelector = (props) => {
|
|
165
165
|
const rows = all.filter(item => checked.has(item.id))
|
166
166
|
const table = {
|
167
167
|
columns: [
|
168
|
-
{ id: "
|
168
|
+
{ id: "id", label: "ID" },
|
169
|
+
{ id: "idMatricula", label: "ID Matricula" },
|
169
170
|
],
|
170
171
|
rows: rows || []
|
171
172
|
}
|
package/src/html/table.js
CHANGED
@@ -76,7 +76,7 @@ export const DataTable = (props) => {
|
|
76
76
|
<tr>
|
77
77
|
{columns.map(({ id, label, type, item, sortable }) => {
|
78
78
|
const sort = sortDir[id] ? sortDir[id] : null
|
79
|
-
const [rowspan, colspan] = type === TYPES.ENTITY ? [1, Object.
|
79
|
+
const [rowspan, colspan] = type === TYPES.ENTITY ? [1, Object.values(item).filter(v=>v.column===true).length] : [2, 1]
|
80
80
|
return (
|
81
81
|
<th rowSpan={rowspan} colSpan={colspan}>
|
82
82
|
{id === "checked" ? <CheckBox onChange={checkAll} /> : <Text key={`th_${id}`}>{label}</Text>}
|
@@ -185,7 +185,7 @@ const EntityCellViewer = ({ id, item, value }) => {
|
|
185
185
|
console.log(id, item, value)
|
186
186
|
const fields = Object.values(item).filter(field => field.column === true)
|
187
187
|
return fields.map( field => {
|
188
|
-
return (<td key={
|
188
|
+
return (<td key={field.id} className={`entity-cell ${field.id}`} >{value[field.id]}</td>)
|
189
189
|
})
|
190
190
|
}
|
191
191
|
|