ywana-core8 0.0.219 → 0.0.220
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 +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +25 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +25 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +19 -1
- package/src/html/table.js +1 -1
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/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>}
|