ywana-core8 0.0.568 → 0.0.571
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 +24 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +13 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +24 -14
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +24 -14
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +5 -0
- package/src/html/textfield.js +4 -4
- package/src/html/textfield.test.js +1 -0
- package/src/html/tokenfield.js +6 -5
- package/src/site/site.css +13 -0
- package/src/site/site.js +1 -1
- package/src/widgets/planner/Planner.js +4 -4
package/package.json
CHANGED
@@ -371,8 +371,13 @@ export const CollectionContext = (url, field, host, page, fetching) => {
|
|
371
371
|
return {
|
372
372
|
|
373
373
|
all: [],
|
374
|
+
filters: {},
|
374
375
|
selected: null,
|
375
376
|
|
377
|
+
changeFilters(filters) {
|
378
|
+
this.filters = filters
|
379
|
+
},
|
380
|
+
|
376
381
|
async load() {
|
377
382
|
try {
|
378
383
|
const data = await API.all(null, page);
|
package/src/html/textfield.js
CHANGED
@@ -150,8 +150,8 @@ export const DropDown = (props) => {
|
|
150
150
|
if (!readOnly) setOpen(!open)
|
151
151
|
}
|
152
152
|
|
153
|
-
function select(
|
154
|
-
const next =
|
153
|
+
function select(value) {
|
154
|
+
const next = value
|
155
155
|
const option = options.find(option => option.value === next)
|
156
156
|
setOpen(false)
|
157
157
|
const label = verbose ? option.label : ""
|
@@ -168,8 +168,8 @@ export const DropDown = (props) => {
|
|
168
168
|
if (canShow) {
|
169
169
|
const filterActive = predictive === true && label && label.length > 0
|
170
170
|
const items = filterActive ? options.filter(option => option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0) : options
|
171
|
-
const lis = items.map(option => <li key={option.value} value={option.value}><Text>{option.label}</Text></li>)
|
172
|
-
return <menu><ul
|
171
|
+
const lis = items.map(option => <li key={option.value} value={option.value} onClick={() => select(option.value)}><Text>{option.label}</Text></li>)
|
172
|
+
return <menu><ul>{lis}</ul></menu>
|
173
173
|
} else {
|
174
174
|
return null
|
175
175
|
}
|
@@ -30,6 +30,7 @@ const TextFieldTest = (prop) => {
|
|
30
30
|
<>
|
31
31
|
<DropDown id="b1" label="Boolean1" onChange={change} options={options2} value={form.b1} />
|
32
32
|
<TokenField id="token1" label="Tokens" onChange={change} />
|
33
|
+
<TokenField id="token2" label="Tokens DropDown" onChange={change} options={options} tokens={form.token2}/>
|
33
34
|
<TextField id="name" label="Name" value={form.name} onChange={change} />
|
34
35
|
<DropDown id="gender1" label="Dropdown 1" value={form.gender1} onChange={change} options={options} predictive={false}/>
|
35
36
|
<DropDown id="gender2" label="Dropdown 2" value={form.gender2} onChange={change} options={options} predictive={true}/>
|
package/src/html/tokenfield.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from 'react'
|
2
2
|
import { Icon } from './icon';
|
3
3
|
import { Text } from './text';
|
4
4
|
import { DropDown } from './textfield';
|
@@ -33,9 +33,11 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
|
|
33
33
|
event.preventDefault()
|
34
34
|
event.stopPropagation()
|
35
35
|
const token = event.target.value
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
if (token && token.length > 0) {
|
37
|
+
const next = Array.isArray(tokens) ? tokens.concat(token) : [token]
|
38
|
+
if (onChange) onChange(id, next)
|
39
|
+
setValue('')
|
40
|
+
}
|
39
41
|
}
|
40
42
|
|
41
43
|
if (value === '' && tokens.length > 0 && event.key === 'Backspace') {
|
@@ -45,7 +47,6 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, onChange
|
|
45
47
|
}
|
46
48
|
|
47
49
|
const tks = Array.isArray(tokens) ? tokens : []
|
48
|
-
|
49
50
|
return (
|
50
51
|
<div className='tokenField'>
|
51
52
|
<label>{label}</label>
|
package/src/site/site.css
CHANGED
@@ -52,6 +52,10 @@
|
|
52
52
|
width: 20rem;
|
53
53
|
}
|
54
54
|
|
55
|
+
.site6>menu.min {
|
56
|
+
overflow: visible;
|
57
|
+
}
|
58
|
+
|
55
59
|
.site6>menu>main {
|
56
60
|
padding: .4rem;
|
57
61
|
}
|
@@ -95,6 +99,15 @@
|
|
95
99
|
align-items: center;
|
96
100
|
}
|
97
101
|
|
102
|
+
.site6>menu.min>main {
|
103
|
+
flex: 1;
|
104
|
+
overflow-x: visible;
|
105
|
+
overflow-y: visible;
|
106
|
+
display: flex;
|
107
|
+
flex-direction: column;
|
108
|
+
align-items: center;
|
109
|
+
}
|
110
|
+
|
98
111
|
.site6>main {
|
99
112
|
grid-area: main;
|
100
113
|
overflow: hidden;
|
package/src/site/site.js
CHANGED
@@ -234,7 +234,7 @@ const SiteMenu = ({ logo, title, children, min }) => {
|
|
234
234
|
const styleItem = id === page ? 'selected' : ''
|
235
235
|
return (
|
236
236
|
<div className={`site-menu-item ${styleItem}`} key={id} onClick={() => goto(id)}>
|
237
|
-
<Tooltip text={title}>
|
237
|
+
<Tooltip text={title} top=".5rem" left="2rem">
|
238
238
|
<Icon key={id} icon={icon} clickable action={() => goto(id)} />
|
239
239
|
</Tooltip>
|
240
240
|
{sideNav === 'max' ? <label>{title}</label> : null}
|
@@ -93,13 +93,13 @@ export const Planner = ({ title, events = [], lanes = [], navigation = true, onS
|
|
93
93
|
{navigation ? (
|
94
94
|
<Header title={label}>
|
95
95
|
|
96
|
-
<Button label="
|
96
|
+
<Button label="Esta Semana" outlined action={showThisWeek}/>
|
97
97
|
<Icon icon="chevron_right" clickable action={next} />
|
98
|
-
<TextField id="to" type="date" label="
|
98
|
+
<TextField id="to" type="date" label="Hasta" value={to} onChange={(id, value) => setTo(value)} />
|
99
99
|
<div className="expand"></div>
|
100
|
-
<DropDown id="ranges" label="
|
100
|
+
<DropDown id="ranges" label="Rango" options={DATE_RANGE} value={dateRange} onChange={(id, value) => setDateRange(value)} />
|
101
101
|
<div className="expand"></div>
|
102
|
-
<TextField id="from" type="date" label="
|
102
|
+
<TextField id="from" type="date" label="Desde" value={from} onChange={(id, value) => setFrom(value)} />
|
103
103
|
<Icon icon="chevron_left" clickable action={prev} />
|
104
104
|
</Header>
|
105
105
|
) : null}
|