ywana-core8 0.0.485 → 0.0.488

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.485",
3
+ "version": "0.0.488",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -4,6 +4,7 @@ import { CHECK, Content, TYPES } from './ContentType';
4
4
  import './ContentEditor.css';
5
5
  import { FORMATS } from './ContentType';
6
6
  import { ColorField } from '../html/color';
7
+ import { DateRange } from '../html/textfield';
7
8
 
8
9
  /**
9
10
  * Content Editor
@@ -272,6 +273,7 @@ export const StringEditor = ({ field, value = '', onChange, content, outlined })
272
273
  case FORMATS.COLOR: return <ColorField id={id} onChange={change} value={value} />
273
274
  case FORMATS.HTML: return <Editor id={id} value={value} onChange={change} content={content} />
274
275
  case FORMATS.DATE: return <TextField outlined={outlined} id={id} type="date" label={label} value={value} onChange={change} readOnly={!editable} />
276
+ case FORMATS.DATERANGE: return <DateRange id={id} label={label} value={value} onChange={change} readOnly={!editable}/>
275
277
  case FORMATS.TOKENS:
276
278
  return <TokenField id={id} label={label} onChange={change} options={buildOptions()} tokens={value} />
277
279
  default:
@@ -16,7 +16,7 @@ export const TYPES = {
16
16
  export const FORMATS = {
17
17
  NONE: '',
18
18
  DATE: 'date',
19
- DATERANGE: 'DATARANGE',
19
+ DATERANGE: 'DATERANGE',
20
20
  TIME: 'time',
21
21
  EMAIL: 'email',
22
22
  HTML: 'HTML',
@@ -187,7 +187,7 @@ export const DropDown = (props) => {
187
187
 
188
188
  export const DateRange = (props) => {
189
189
 
190
- const { id, onChange } = props
190
+ const { id, label, value, onChange } = props
191
191
  const [form, setForm] = useState({})
192
192
 
193
193
  useEffect(() => {
@@ -201,6 +201,7 @@ export const DateRange = (props) => {
201
201
 
202
202
  return (
203
203
  <div className="date-range">
204
+ { label ? <label>{label}</label> : null }
204
205
  <TextField id="from" type="date" label="From" value={form.from} onChange={change} />
205
206
  <TextField id="to" type="date" label="To" value={form.to} onChange={change} />
206
207
  </div>