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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.568",
3
+ "version": "0.0.571",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -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);
@@ -150,8 +150,8 @@ export const DropDown = (props) => {
150
150
  if (!readOnly) setOpen(!open)
151
151
  }
152
152
 
153
- function select(event) {
154
- const next = event.target.getAttribute("value")
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 onMouseDown={select}>{lis}</ul></menu>
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}/>
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef, useState } from '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
- const next = Array.isArray(tokens) ? tokens.concat(token) : [token]
37
- if (onChange) onChange(id, next)
38
- setValue('')
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
  &nbsp;&nbsp;
96
- <Button label="This Week" outlined action={showThisWeek}/>
96
+ <Button label="Esta Semana" outlined action={showThisWeek}/>
97
97
  <Icon icon="chevron_right" clickable action={next} />
98
- <TextField id="to" type="date" label="To" value={to} onChange={(id, value) => setTo(value)} />
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="Date Range" options={DATE_RANGE} value={dateRange} onChange={(id, value) => setDateRange(value)} />
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="From" value={from} onChange={(id, value) => setFrom(value)} />
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}