ywana-core8 0.0.394 → 0.0.397
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 +23 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -3
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +23 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +23 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +1 -0
- package/src/domain/ContentEditor.test.js +7 -2
- package/src/domain/ContentType.js +2 -1
- package/src/domain/TablePage.js +12 -4
- package/src/html/color.js +1 -1
- package/src/html/tokenfield.css +4 -3
- package/src/html/tokenfield.js +0 -2
- package/src/site/site.test.js +14 -5
package/package.json
CHANGED
@@ -249,6 +249,7 @@ export const StringEditor = ({ field, value = '', onChange, content, outlined })
|
|
249
249
|
case FORMATS.COLOR: return <ColorField id={id} onChange={change} value={value}/>
|
250
250
|
case FORMATS.HTML: return <Editor id={id} value={value} onChange={change} content={content} />
|
251
251
|
case FORMATS.DATE: return <TextField outlined={outlined} id={id} type="date" label={label} value={value} onChange={change} readOnly={!editable} />
|
252
|
+
case FORMATS.TOKENS: return <TokenField id={id} label={label} onChange={change} readOnly={!editable} options={options} />
|
252
253
|
default:
|
253
254
|
return options ? (
|
254
255
|
<DropDown outlined={outlined} id={id} label={label} value={value} onChange={change} options={buildOptions()} readOnly={!editable} predictive={predictive} />
|
@@ -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.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,15 @@ 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 => filters[`${key}.${key2}`] = field[key2])
|
487
|
+
} else {
|
488
|
+
filters[key] = field;
|
489
|
+
}
|
490
|
+
}
|
491
|
+
|
484
492
|
return filters;
|
485
493
|
}, {}) : []
|
486
494
|
const data = await API.all(filters);
|
package/src/html/color.js
CHANGED
package/src/html/tokenfield.css
CHANGED
@@ -11,12 +11,13 @@
|
|
11
11
|
}
|
12
12
|
|
13
13
|
.tokenField>label {
|
14
|
+
color: var(--primary-color);
|
15
|
+
font-size: .8rem;
|
16
|
+
font-weight: normal;
|
14
17
|
position: absolute;
|
18
|
+
pointer-events: none;
|
15
19
|
top:-9px;
|
16
20
|
padding: 2px 6px 2px 4px;
|
17
|
-
font-size: .8rem;
|
18
|
-
background-color: var(--paper-color);
|
19
|
-
color: var(--text-color-light)
|
20
21
|
}
|
21
22
|
|
22
23
|
.tokenField input,
|
package/src/html/tokenfield.js
CHANGED
@@ -59,9 +59,7 @@ export const TokenField = ({ id, label, init = [], readOnly, options, onChange }
|
|
59
59
|
return (
|
60
60
|
<div className='tokenField'>
|
61
61
|
<label>{label}</label>
|
62
|
-
|
63
62
|
{tokens.map((text, index) => <Token text={text} onDelete={() => remove(index)} />)}
|
64
|
-
|
65
63
|
{options ? (
|
66
64
|
<DropDown onChange={changeDropDown} options={options} predictive={true} verbose={false} />
|
67
65
|
) : (
|
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
|
}
|