ywana-core8 0.0.396 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.396",
3
+ "version": "0.0.397",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -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.NONE, required: true, label: "field3" },
11
- field3: { id: "field4", type: TYPES.STRING, format: FORMATS.COLOR, required: true, label: "field3" },
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"/>
@@ -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 { user } = props
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 { filters } = pageContext
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
- if (field) filters[key] = field;
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
@@ -12,7 +12,7 @@ export const ColorField = (props) => {
12
12
 
13
13
  return (
14
14
  <div className="color-field">
15
- <label for={id}>{label}</label>
15
+ <label htmlFor={id}>{label}</label>
16
16
  <input id={id} type="color" onChange={change} value={value}/>
17
17
  </div>
18
18
  )
@@ -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, DropDown, TextField, TextArea } from '../html'
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
  }