ywana-core8 0.1.12 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -27,6 +27,7 @@ export const TablePage2 = (props) => {
27
27
  groupBy, validator,
28
28
  formFilter, tableFilter, editorFilter = false,
29
29
  tabbedBy,
30
+ sortedBy,
30
31
  tableClassName,
31
32
  children,
32
33
  onSelect,
@@ -139,7 +140,7 @@ export const TablePage2 = (props) => {
139
140
  </menu>
140
141
  ) : null}
141
142
  <main key={id} className={`table-page ${className}`}>
142
- <TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} tabbedBy={tabbedBy} groupBy={groupBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} className={tableClassName} />
143
+ <TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} tabbedBy={tabbedBy} groupBy={groupBy} sortedBy={sortedBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} className={tableClassName} />
143
144
  {children ? <article>{children}</article> : null}
144
145
  </main>
145
146
  {renderAside()}
@@ -331,7 +332,7 @@ export const TableEditor = (props) => {
331
332
  const site = useContext(SiteContext)
332
333
  const [pageContext, setPageContext] = useContext(PageContext)
333
334
  const { all = [], filters } = pageContext
334
- const { icon, title, schema, editable, canDelete, filter, actions, className, tabbedBy } = props
335
+ const { icon, title, schema, editable, canDelete, filter, actions, className, tabbedBy, sortedBy } = props
335
336
  const [groupBy, setGroupBy] = useState(props.groupBy)
336
337
  const [tab, setTab] = useState(0)
337
338
 
@@ -456,7 +457,7 @@ export const TableEditor = (props) => {
456
457
  return groups
457
458
  }, {})
458
459
 
459
- const sections = Object.keys(groups).map(groupName => {
460
+ const sections = Object.keys(groups).sort().map(groupName => {
460
461
 
461
462
  const rows = groups[groupName].map(item => {
462
463
  item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false
@@ -469,6 +470,16 @@ export const TableEditor = (props) => {
469
470
  return item
470
471
  })
471
472
 
473
+ if (sortedBy) {
474
+ rows.sort((a, b) => {
475
+ const valueA = a[sortedBy]
476
+ const valueB = b[sortedBy]
477
+ if (valueA < valueB) return -1
478
+ if (valueA > valueB) return 1
479
+ return 0
480
+ })
481
+ }
482
+
472
483
  table.rows = rows
473
484
 
474
485
  return ({
package/src/site/site.css CHANGED
@@ -42,6 +42,7 @@
42
42
  flex-direction: column;
43
43
  overflow: hidden;
44
44
  width: var(--site-menu-width);
45
+ transition: width 0.3s ease-in-out;
45
46
  }
46
47
 
47
48
  .site6>menu>header {
@@ -53,6 +54,7 @@
53
54
  }
54
55
 
55
56
  .site6>menu.min {
57
+ width: var(--site-menu-width);
56
58
  overflow: visible;
57
59
  }
58
60