ywana-core8 0.0.396 → 0.0.399
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 +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +5 -2
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +13 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +13 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.test.js +7 -2
- package/src/domain/TablePage.css +5 -2
- package/src/domain/TablePage.js +15 -4
- package/src/html/color.js +1 -1
- package/src/site/site.test.js +14 -5
package/package.json
CHANGED
@@ -7,8 +7,12 @@ const schema = {
|
|
7
7
|
name : { id: "name" , type: TYPES.STRING, format: FORMATS.NONE, required: true, label: "Name" },
|
8
8
|
field1: { id: "field1", type: TYPES.STRING, format: FORMATS.NONE, required: true, label: "field1", multivalue: true },
|
9
9
|
field2: { id: "field2", type: TYPES.STRING, format: FORMATS.NONE, required: true, label: "field2" },
|
10
|
-
field3: { id: "field3", type: TYPES.STRING, format: FORMATS.
|
11
|
-
|
10
|
+
field3: { id: "field3", type: TYPES.STRING, format: FORMATS.TOKENS, required: true, label: "field3", options: [
|
11
|
+
{label: "One", value: 1 },
|
12
|
+
{label: "Two", value: 2 },
|
13
|
+
{label: "Three", value: 3 },
|
14
|
+
] },
|
15
|
+
field4: { id: "field4", type: TYPES.STRING, format: FORMATS.COLOR, required: true, label: "Color" },
|
12
16
|
}
|
13
17
|
|
14
18
|
const value = {
|
@@ -24,6 +28,7 @@ const ContentEditorTest = (prop) => {
|
|
24
28
|
}
|
25
29
|
|
26
30
|
const content = new Content(schema, form)
|
31
|
+
console.log(form)
|
27
32
|
return (
|
28
33
|
<>
|
29
34
|
<ContentEditor content={content} outlined={false} onChange={change} className="grid1"/>
|
package/src/domain/TablePage.css
CHANGED
@@ -14,6 +14,11 @@
|
|
14
14
|
margin: 0 1rem;
|
15
15
|
}
|
16
16
|
|
17
|
+
menu.table-page {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
|
+
}
|
21
|
+
|
17
22
|
menu.table-page>header {
|
18
23
|
padding-right: .5rem;
|
19
24
|
}
|
@@ -47,7 +52,6 @@ main.table-editor {
|
|
47
52
|
padding-right: 1rem;
|
48
53
|
}
|
49
54
|
|
50
|
-
|
51
55
|
.table-selector {
|
52
56
|
display: flex;
|
53
57
|
flex-direction: column;
|
@@ -82,7 +86,6 @@ header.table-filters {
|
|
82
86
|
background-color: rgba(220,220,220,.5);
|
83
87
|
}
|
84
88
|
|
85
|
-
main.table-queries,
|
86
89
|
main.table-filters {
|
87
90
|
flex: 1;
|
88
91
|
}
|
package/src/domain/TablePage.js
CHANGED
@@ -4,7 +4,7 @@ import { Button, DataTable, DropDown, Header, Icon, MenuIcon, MenuItem, Text } f
|
|
4
4
|
import { HTTPClient, Session } from '../http'
|
5
5
|
import { PageContext, SiteContext } from '../site'
|
6
6
|
import { ContentEditor } from './ContentEditor'
|
7
|
-
import { CHECK, Content } from './ContentType'
|
7
|
+
import { CHECK, Content, TYPES } from './ContentType'
|
8
8
|
import { ContentViewer } from './ContentViewer'
|
9
9
|
import { CreateContentDialog } from './CreateContentDialog'
|
10
10
|
import { QUERY } from './squema'
|
@@ -215,7 +215,7 @@ const TableSelector = (props) => {
|
|
215
215
|
const TableQueries = (props) => {
|
216
216
|
|
217
217
|
const [pageContext, setPageContext] = useContext(PageContext)
|
218
|
-
const {
|
218
|
+
const { user } = props
|
219
219
|
const { queries = [] } = pageContext
|
220
220
|
const [selected, setSelected] = useState()
|
221
221
|
|
@@ -256,7 +256,7 @@ const TableQueries = (props) => {
|
|
256
256
|
const TableFilters = (props) => {
|
257
257
|
|
258
258
|
const [pageContext, setPageContext] = useContext(PageContext)
|
259
|
-
const {
|
259
|
+
const { filters } = pageContext
|
260
260
|
const { schema, onSave } = props
|
261
261
|
const [form, setForm] = useState({})
|
262
262
|
|
@@ -480,7 +480,18 @@ const TableContext = (url, field, host, urlQuery) => {
|
|
480
480
|
try {
|
481
481
|
const filters = filter ? Object.keys(filter).reduce((filters, key) => {
|
482
482
|
const field = filter[key];
|
483
|
-
|
483
|
+
|
484
|
+
if (field) {
|
485
|
+
if (CHECK['isObject'](field)) {
|
486
|
+
Object.keys(field).forEach(key2 => {
|
487
|
+
const subfield = field[key2]
|
488
|
+
if (subfield) filters[`${key}.${key2}`] = subfield
|
489
|
+
})
|
490
|
+
} else {
|
491
|
+
filters[key] = field;
|
492
|
+
}
|
493
|
+
}
|
494
|
+
|
484
495
|
return filters;
|
485
496
|
}, {}) : []
|
486
497
|
const data = await API.all(filters);
|
package/src/html/color.js
CHANGED
package/src/site/site.test.js
CHANGED
@@ -5,9 +5,10 @@ import { Page } from './page'
|
|
5
5
|
import './site.css'
|
6
6
|
import './page.css'
|
7
7
|
import { Dialog } from './dialog'
|
8
|
-
import { Button,
|
8
|
+
import { Button, DropDown, TextField, TextArea } from '../html'
|
9
9
|
import { UploadDialog } from '../widgets/upload/UploadDialog'
|
10
10
|
import { Uploader } from '../widgets/upload/Uploader'
|
11
|
+
import { TablePage } from '../domain/TablePage'
|
11
12
|
|
12
13
|
const SiteTest = (prop) => {
|
13
14
|
|
@@ -29,7 +30,7 @@ const Page1 = (props) => {
|
|
29
30
|
|
30
31
|
const site = useContext(SiteContext)
|
31
32
|
const [form, setForm] = useState({})
|
32
|
-
|
33
|
+
|
33
34
|
useEffect(() => {
|
34
35
|
site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet" })
|
35
36
|
}, [])
|
@@ -55,9 +56,7 @@ const Page1 = (props) => {
|
|
55
56
|
<Fragment>
|
56
57
|
<header>Page 1</header>
|
57
58
|
<main>
|
58
|
-
|
59
|
-
<Uploader icon="cloud_upload" target="https://maso.developxp.com/kiosk/api/upload" />
|
60
|
-
|
59
|
+
<Uploader icon="cloud_upload" target="https://maso.developxp.com/kiosk/api/upload" />
|
61
60
|
<Button label="Upload" action={upload} />
|
62
61
|
<TextField id="name" label="Name" value={form.name} onChange={change} />
|
63
62
|
<DropDown id="gender1" label="Dropdown 1" value={form.gender1} onChange={change} options={options} predictive={true} />
|
@@ -107,4 +106,14 @@ const Page2 = (props) => {
|
|
107
106
|
<footer>f2</footer>
|
108
107
|
</Fragment>
|
109
108
|
)
|
109
|
+
}
|
110
|
+
|
111
|
+
const Page3 = (props) => {
|
112
|
+
|
113
|
+
const site = useContext(SiteContext)
|
114
|
+
|
115
|
+
return (
|
116
|
+
<Fragment>
|
117
|
+
</Fragment>
|
118
|
+
)
|
110
119
|
}
|