ywana-core8 0.0.514 → 0.0.517
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 +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +8 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +5 -4
- package/src/html/table.js +3 -1
package/package.json
CHANGED
@@ -22,7 +22,7 @@ export const CollectionPage = (props) => {
|
|
22
22
|
actions = [], onSelect,
|
23
23
|
canFilter = false, canAdd = false, canDelete = false, canEdit = false,
|
24
24
|
autosave = false, delay = 1000,
|
25
|
-
groupBy, levels,
|
25
|
+
groupBy, levels, sorter,
|
26
26
|
editor,
|
27
27
|
children
|
28
28
|
} = props
|
@@ -68,7 +68,7 @@ export const CollectionPage = (props) => {
|
|
68
68
|
<Header title={<Text>Lista de {name}</Text>} >
|
69
69
|
</Header>
|
70
70
|
{canFilter ? <CollectionFilters schema={schema}/> : null }
|
71
|
-
{levels ? <CollectionTree levels={levels} onSelect={onSelect}/> : <CollectionList groupBy={groupBy} onSelect={onSelect}/>}
|
71
|
+
{levels ? <CollectionTree levels={levels} onSelect={onSelect} sorter={sorter}/> : <CollectionList groupBy={groupBy} onSelect={onSelect}/>}
|
72
72
|
</menu>
|
73
73
|
<main key={id} className="collection-page">
|
74
74
|
<CollectionEditor icon={icon} schema={schema} layout={editor} autosave={autosave} delay={delay} />
|
@@ -166,7 +166,7 @@ const CollectionList = (props) => {
|
|
166
166
|
*/
|
167
167
|
export const CollectionTree = (props) => {
|
168
168
|
|
169
|
-
const { levels, onSelect } = props
|
169
|
+
const { levels, onSelect, sorter } = props
|
170
170
|
const [pageContext, setPageContext] = useContext(PageContext)
|
171
171
|
const { all = [] } = pageContext
|
172
172
|
|
@@ -213,7 +213,8 @@ export const CollectionTree = (props) => {
|
|
213
213
|
})
|
214
214
|
}
|
215
215
|
|
216
|
-
const
|
216
|
+
const items = sorter ? sorter(all) : all
|
217
|
+
const nodes = generateNodes(levels, items)
|
217
218
|
return (
|
218
219
|
<main>
|
219
220
|
<Tree>
|
package/src/html/table.js
CHANGED
@@ -191,8 +191,10 @@ const DataTableCell = ({ row, column, cell, editable }) => {
|
|
191
191
|
* @returns
|
192
192
|
*/
|
193
193
|
const EntityCellViewer = ({ id, item, value }) => {
|
194
|
-
const fields = Object.values(item).filter(field => field.column === true)
|
195
194
|
|
195
|
+
const fields = Object.values(item).filter(field => field.column === true)
|
196
|
+
const locale = window.navigator.userLanguage || window.navigator.language;
|
197
|
+
|
196
198
|
return fields.map(field => {
|
197
199
|
|
198
200
|
let text = value[field.id]
|