ywana-core8 0.0.571 → 0.0.574
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 +1261 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +38 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +1260 -150
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +1261 -149
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.css +1 -0
- package/src/domain/ContentEditor.js +16 -4
- package/src/domain/TablePage.js +8 -1
- package/src/domain/TablePage2.js +679 -0
- package/src/domain/index.js +1 -0
- package/src/domain2/Content.js +33 -0
- package/src/domain2/ContentFilters.js +74 -0
- package/src/domain2/ContentPage.js +96 -0
- package/src/domain2/FORMATS.js +15 -0
- package/src/domain2/TYPES.js +11 -0
- package/src/html/accordion.css +36 -0
- package/src/html/accordion.js +58 -0
- package/src/html/accordion.test.js +37 -0
- package/src/html/index.js +1 -0
- package/src/html/section.css +1 -1
- package/src/html/section.js +1 -1
- package/src/html/table.test.js +2 -2
- package/src/site/site.test.js +16 -16
- package/src/widgets/planner/Planner.js +16 -17
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { Fragment, useState } from 'react';
|
2
|
-
import { Button, CheckBox, DataTable, DropDown, Icon, Stack, Tab, Tabs, Text, TextField, Tree, TreeNode, TreeItem, TokenField, Header } from '../html';
|
2
|
+
import { Button, CheckBox, DataTable, DropDown, Icon, Stack, Tab, Tabs, Text, TextField, Tree, TreeNode, TreeItem, TokenField, Header, Accordion } from '../html';
|
3
3
|
import { CHECK, Content, TYPES, FORMATS } from './ContentType';
|
4
4
|
import { DateRange } from '../html/textfield';
|
5
5
|
import { ColorField } from '../html/color';
|
@@ -44,6 +44,17 @@ export const ContentEditor = ({ content, filter, outlined = true, className, onC
|
|
44
44
|
)
|
45
45
|
}
|
46
46
|
|
47
|
+
|
48
|
+
export const GroupedContentEditor = ({ content, filter, className }) => {
|
49
|
+
|
50
|
+
const sections = content.sections()
|
51
|
+
|
52
|
+
return (
|
53
|
+
<Accordion sections={sections} />
|
54
|
+
)
|
55
|
+
}
|
56
|
+
|
57
|
+
|
47
58
|
/**
|
48
59
|
* Tabbed Content Editor
|
49
60
|
*/
|
@@ -382,7 +393,7 @@ export const MultiSelectionEditor = ({ field, value = [], content, onChange }) =
|
|
382
393
|
*/
|
383
394
|
export const CollectionEditor = ({ field, value = [], onChange, onReload }) => {
|
384
395
|
|
385
|
-
const { id, item, label, Feeder, Renderer, Adder = true, editable = true } = field
|
396
|
+
const { id, item, label, groupBy="field1", Feeder, Renderer, Adder = true, editable = true } = field
|
386
397
|
|
387
398
|
function add(rows) {
|
388
399
|
if (onChange) {
|
@@ -410,7 +421,7 @@ export const CollectionEditor = ({ field, value = [], onChange, onReload }) => {
|
|
410
421
|
if (onReload) onReload()
|
411
422
|
}
|
412
423
|
|
413
|
-
|
424
|
+
/* const columns = Object.values(item)
|
414
425
|
.filter(field => field.column === true)
|
415
426
|
.map((item) => ({ ...item, onChange: change }))
|
416
427
|
columns.push({ id: 'actions', label: 'Actions' })
|
@@ -424,6 +435,7 @@ export const CollectionEditor = ({ field, value = [], onChange, onReload }) => {
|
|
424
435
|
}))
|
425
436
|
|
426
437
|
const table = { columns, rows }
|
438
|
+
*/
|
427
439
|
|
428
440
|
return (
|
429
441
|
<div className='collection-editor'>
|
@@ -431,7 +443,7 @@ export const CollectionEditor = ({ field, value = [], onChange, onReload }) => {
|
|
431
443
|
Renderer ?
|
432
444
|
<Renderer field={field} value={value} onRemove={remove} onChange={onChange} onReload={reload} />
|
433
445
|
// : <DataTable {...table} editable={editable} />
|
434
|
-
: <TableEditor icon={"info"} title={label} data={value} schema={item} groupBy={
|
446
|
+
: <TableEditor icon={"info"} title={label} data={value} schema={item} groupBy={groupBy} canDelete={true} remove={remove}/>
|
435
447
|
|
436
448
|
}
|
437
449
|
<footer>
|
package/src/domain/TablePage.js
CHANGED
@@ -3,7 +3,7 @@ import React, { Fragment, useContext, useEffect, useMemo, useRef, useState } fro
|
|
3
3
|
import { Button, DataTable, DropDown, Header, Icon, MenuIcon, MenuItem, Text } from '../html'
|
4
4
|
import { HTTPClient, Session } from '../http'
|
5
5
|
import { PageContext, SiteContext } from '../site'
|
6
|
-
import { ContentEditor } from './ContentEditor'
|
6
|
+
import { ContentEditor, GroupedContentEditor } from './ContentEditor'
|
7
7
|
import { CHECK, Content, TYPES } from './ContentType'
|
8
8
|
import { ContentViewer } from './ContentViewer'
|
9
9
|
import { CreateContentDialog } from './CreateContentDialog'
|
@@ -200,10 +200,12 @@ const TableSelector = (props) => {
|
|
200
200
|
columns,
|
201
201
|
rows: rows || []
|
202
202
|
}
|
203
|
+
|
203
204
|
const buttons = actions.map(({ label, action, validate }) => {
|
204
205
|
return <Button
|
205
206
|
label={label} raised
|
206
207
|
action={() => action(checked, pageContext, async () => {
|
208
|
+
await pageContext.clearChecks()
|
207
209
|
await pageContext.load()
|
208
210
|
setPageContext(Object.assign({}, pageContext))
|
209
211
|
}, rows)}
|
@@ -485,6 +487,7 @@ export const TableEditor = (props) => {
|
|
485
487
|
</Header>
|
486
488
|
<main className="table-editor">
|
487
489
|
{renderGroups()}
|
490
|
+
|
488
491
|
</main>
|
489
492
|
</Fragment>
|
490
493
|
)
|
@@ -539,6 +542,10 @@ const TableContext = (url, field, host, urlQuery, params) => {
|
|
539
542
|
}
|
540
543
|
},
|
541
544
|
|
545
|
+
clearChecks() {
|
546
|
+
this.checked = new Set([])
|
547
|
+
},
|
548
|
+
|
542
549
|
select(id) {
|
543
550
|
const result = this.all.find(item => item.id === id);
|
544
551
|
this.selected = result;
|